Repository: Coldairarrow/Coldairarrow.Fx.Net.Easyui.GitHub Branch: master Commit: 920493285834 Files: 509 Total size: 9.4 MB Directory structure: gitextract_tryq7klz/ ├── .gitattributes ├── .gitignore ├── .nuget ├── .tfignore ├── LICENSE ├── README.md ├── docs/ │ ├── 初始化文件/ │ │ ├── Coldairarrow.Fx.Net.Easyui.GitHub.bak │ │ └── db.sql │ └── 数据库设计/ │ ├── Base_Table.pdm │ └── Base_Table.sws ├── src/ │ ├── Coldairarrow.Business/ │ │ ├── 00Cache/ │ │ │ ├── BaseCache/ │ │ │ │ ├── BaseCache.T.cs │ │ │ │ └── IBaseCache.T.cs │ │ │ └── Base_UserModelCache.cs │ │ ├── 04.Coldairarrow.Business.csproj │ │ ├── BaseBusiness/ │ │ │ └── BaseBusiness.T.cs │ │ ├── Base_SysManage/ │ │ │ ├── Base_AppSecretBusiness.cs │ │ │ ├── Base_DatabaseLinkBusiness.cs │ │ │ ├── Base_SysLogBusiness.cs │ │ │ ├── Base_SysRoleBusiness.cs │ │ │ ├── Base_UserBusiness.cs │ │ │ ├── CheckSignBusiness.cs │ │ │ ├── HomeBusiness.cs │ │ │ ├── PermissionManage.cs │ │ │ ├── RapidDevelopmentBusiness.cs │ │ │ └── UrlPermissionManage.cs │ │ ├── Common/ │ │ │ ├── BusHelper.cs │ │ │ └── Operator.cs │ │ ├── Logger/ │ │ │ ├── ElasticSearchLogger.cs │ │ │ ├── ILogger.cs │ │ │ ├── LoggerFactory.cs │ │ │ └── RDBMSLogger.cs │ │ ├── Properties/ │ │ │ └── AssemblyInfo.cs │ │ ├── app.config │ │ └── packages.config │ ├── Coldairarrow.Console/ │ │ ├── 06.Coldairarrow.Console.csproj │ │ ├── App.config │ │ ├── Program.cs │ │ ├── Properties/ │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── Coldairarrow.DataRepository/ │ │ ├── 02.Coldairarrow.DataRepository.csproj │ │ ├── DbContext/ │ │ │ └── BaseDbContext.cs │ │ ├── DbFactory.cs │ │ ├── IRepository/ │ │ │ ├── IRepository.T.cs │ │ │ └── IRepository.cs │ │ ├── Properties/ │ │ │ └── AssemblyInfo.cs │ │ ├── Repository/ │ │ │ ├── DbRepository.cs │ │ │ ├── MySqlRepository.cs │ │ │ ├── OracleRepository.cs │ │ │ ├── PostgreSqlRepository.cs │ │ │ └── SqlServerRepository.cs │ │ ├── Transaction/ │ │ │ └── DistributedTransaction.cs │ │ ├── app.config │ │ ├── packages.config │ │ └── publishNuget.bat │ ├── Coldairarrow.Demo/ │ │ ├── 07.Coldairarrow.Demo.csproj │ │ ├── App.config │ │ ├── Program.cs │ │ ├── Properties/ │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── Coldairarrow.Entity/ │ │ ├── 03.Coldairarrow.Entity.csproj │ │ ├── App.config │ │ ├── Base_SysManage/ │ │ │ ├── Base_AppSecret.cs │ │ │ ├── Base_DatabaseLink.cs │ │ │ ├── Base_PermissionAppId.cs │ │ │ ├── Base_PermissionRole.cs │ │ │ ├── Base_PermissionUser.cs │ │ │ ├── Base_SysLog.cs │ │ │ ├── Base_SysRole.cs │ │ │ ├── Base_UnitTest.cs │ │ │ ├── Base_User.cs │ │ │ ├── Base_UserRoleMap.cs │ │ │ └── EnumType.cs │ │ ├── Properties/ │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── Coldairarrow.Fx.Net.Easyui.GitHub.sln │ ├── Coldairarrow.UnitTests/ │ │ ├── 10.Coldairarrow.UnitTests.csproj │ │ ├── App.config │ │ ├── Base_SysManage/ │ │ │ └── Base_BusinessTests.cs │ │ ├── Properties/ │ │ │ └── AssemblyInfo.cs │ │ ├── UnitTest.cs │ │ └── packages.config │ ├── Coldairarrow.Util/ │ │ ├── 01.Coldairarrow.Util.csproj │ │ ├── 01.Coldairarrow.Util.nuspec │ │ ├── ApiSDK/ │ │ │ └── CTCC_IOT_ApiSDK.cs │ │ ├── Cache/ │ │ │ ├── CacheHelper.cs │ │ │ ├── ICache.cs │ │ │ ├── RedisCache.cs │ │ │ └── SystemCache.cs │ │ ├── ClassLibrary/ │ │ │ ├── BloomFilter.cs │ │ │ ├── LinqKit/ │ │ │ │ ├── ExpandableQuery.cs │ │ │ │ ├── ExpressionExpander.cs │ │ │ │ ├── ExpressionVisitor.cs │ │ │ │ ├── Extensions.cs │ │ │ │ └── Linq.cs │ │ │ ├── ParentChildrenMapping.cs │ │ │ ├── SerialConnecter/ │ │ │ │ └── SerialConnecter.cs │ │ │ ├── ShareMemory.cs │ │ │ ├── Sockets/ │ │ │ │ ├── SendCheckMsg.cs │ │ │ │ ├── TcpSocketClient.cs │ │ │ │ ├── TcpSocketConnection.cs │ │ │ │ ├── TcpSocketServer.cs │ │ │ │ ├── UdpSocketClient.cs │ │ │ │ ├── UdpSocketServer.cs │ │ │ │ ├── WebSocketConnection.cs │ │ │ │ └── WebSocketServer.cs │ │ │ ├── TaskQeury.cs │ │ │ ├── Wcf/ │ │ │ │ ├── IWcfHost.cs │ │ │ │ ├── WcfClient.cs │ │ │ │ ├── WcfHelper.cs │ │ │ │ └── WcfHost.cs │ │ │ ├── WcfMS/ │ │ │ │ ├── BaseWcfMSService.cs │ │ │ │ ├── IBaseWcfMSService.cs │ │ │ │ ├── WcfMSBase.cs │ │ │ │ ├── WcfMSClient.cs │ │ │ │ ├── WcfMSConfig.cs │ │ │ │ └── WcfMSServer.cs │ │ │ └── WindowsService/ │ │ │ ├── WindowsService.cs │ │ │ ├── WindowsService.designer.cs │ │ │ └── WindowsServiceContainer.cs │ │ ├── DataAccess/ │ │ │ ├── DbHelper.cs │ │ │ ├── DbHelperFactory.cs │ │ │ ├── DbProviderFactoryHelper.cs │ │ │ ├── MySqlHelper.cs │ │ │ ├── OracleHelper.cs │ │ │ ├── PostgreSqlHelper.cs │ │ │ ├── RedisHelper.cs │ │ │ └── SqlServerHelper.cs │ │ ├── Extention/ │ │ │ ├── Extention.ActionExecutingContext.cs │ │ │ ├── Extention.Byte.cs │ │ │ ├── Extention.DataTable.cs │ │ │ ├── Extention.DateTime.cs │ │ │ ├── Extention.Delegate.cs │ │ │ ├── Extention.ExpandoObject.cs │ │ │ ├── Extention.Expression.cs │ │ │ ├── Extention.Guid.cs │ │ │ ├── Extention.IEnumerable.cs │ │ │ ├── Extention.IQueryable.cs │ │ │ ├── Extention.Int.cs │ │ │ ├── Extention.Object.cs │ │ │ ├── Extention.Stream.cs │ │ │ ├── Extention.String.cs │ │ │ └── Extention.Type.cs │ │ ├── GlobalSwitch.cs │ │ ├── Helper/ │ │ │ ├── AsposeOfficeHelper.cs │ │ │ ├── BaiduApiHelper.cs │ │ │ ├── ConfigHelper.cs │ │ │ ├── DbSearchHelper.cs │ │ │ ├── DelegateHelper.cs │ │ │ ├── EmitHelper.cs │ │ │ ├── ExceptionHelper.cs │ │ │ ├── FileHelper.cs │ │ │ ├── FileZipHelper.cs │ │ │ ├── GuidHelper.cs │ │ │ ├── HttpHelper.cs │ │ │ ├── ImgHelper.cs │ │ │ ├── IocHelper.cs │ │ │ ├── IpHelper.cs │ │ │ ├── LinqHelper.cs │ │ │ ├── LogHelper.cs │ │ │ ├── LoopHelper.cs │ │ │ ├── QRCodeHelper.cs │ │ │ ├── RandomHelper.cs │ │ │ ├── TimerHelper.cs │ │ │ ├── TreeHelper.cs │ │ │ ├── TypeBuilderHelper.cs │ │ │ └── XmlHelper.cs │ │ ├── Model/ │ │ │ ├── AjaxResult.cs │ │ │ ├── DatabaseType.cs │ │ │ ├── DbTableInfo.cs │ │ │ ├── DynamicModel.cs │ │ │ ├── EasyuiTreeDto.cs │ │ │ ├── ErrorResult.cs │ │ │ ├── FileEntry.cs │ │ │ ├── LoggerType.cs │ │ │ ├── Pagination.cs │ │ │ ├── SuccessResult.cs │ │ │ ├── TableInfo.cs │ │ │ └── TreeModel.cs │ │ ├── Properties/ │ │ │ └── AssemblyInfo.cs │ │ ├── WebApp/ │ │ │ └── SessionHelper.cs │ │ ├── app.config │ │ ├── packages.config │ │ └── publishNuget.bat │ └── Coldairarrow.Web/ │ ├── 05.Coldairarrow.Web.csproj │ ├── App_Start/ │ │ ├── 01Handler/ │ │ │ ├── 全局错误过滤/ │ │ │ │ └── HandlerGlobalError.cs │ │ │ ├── 参数非空校验/ │ │ │ │ └── CheckParamNotEmptyAttribute.cs │ │ │ ├── 后台用户接口权限校验/ │ │ │ │ ├── CheckUrlPermissionAttribute.cs │ │ │ │ └── IgnoreUrlPermissionAttribute.cs │ │ │ ├── 对外接口签名校验/ │ │ │ │ ├── CheckAppIdPermissionAttribute.cs │ │ │ │ ├── CheckSignAttribute.cs │ │ │ │ ├── IgnoreAppIdPermissionAttribute.cs │ │ │ │ └── IgnoreSignAttribute.cs │ │ │ └── 登录校验/ │ │ │ ├── CheckLoginAttribute.cs │ │ │ └── IgnoreLoginAttribute.cs │ │ ├── 02BaseController/ │ │ │ ├── BaseApiController.cs │ │ │ ├── BaseController.cs │ │ │ └── BaseMvcController.cs │ │ ├── 03Extentions/ │ │ │ └── Extention.UrlHelper.cs │ │ ├── FilterConfig.cs │ │ └── RouteConfig.cs │ ├── Areas/ │ │ └── Base_SysManage/ │ │ ├── Base_SysManageAreaRegistration.cs │ │ ├── Controllers/ │ │ │ ├── Base_AppSecretController.cs │ │ │ ├── Base_DatabaseLinkController.cs │ │ │ ├── Base_SysLogController.cs │ │ │ ├── Base_SysRoleController.cs │ │ │ ├── Base_UserController.cs │ │ │ ├── CityController.cs │ │ │ ├── CommonController.cs │ │ │ └── RapidDevelopmentController.cs │ │ └── Views/ │ │ ├── Base_AppSecret/ │ │ │ ├── Form.cshtml │ │ │ ├── Index.cshtml │ │ │ └── PermissionForm.cshtml │ │ ├── Base_DatabaseLink/ │ │ │ ├── Form.cshtml │ │ │ └── Index.cshtml │ │ ├── Base_SysLog/ │ │ │ └── Index.cshtml │ │ ├── Base_SysRole/ │ │ │ ├── Form.cshtml │ │ │ ├── Index.cshtml │ │ │ └── PermissionForm.cshtml │ │ ├── Base_User/ │ │ │ ├── ChangePwdForm.cshtml │ │ │ ├── Form.cshtml │ │ │ ├── Index.cshtml │ │ │ └── PermissionForm.cshtml │ │ ├── City/ │ │ │ └── Index.cshtml │ │ ├── Common/ │ │ │ └── ShowBigImg.cshtml │ │ ├── RapidDevelopment/ │ │ │ ├── Form.cshtml │ │ │ └── Index.cshtml │ │ └── web.config │ ├── Common/ │ │ └── SystemMenuManage.cs │ ├── Config/ │ │ ├── NingboGeojson.json │ │ ├── Permission.config │ │ ├── Province.json │ │ ├── SystemMenu.config │ │ ├── UrlPermission.config │ │ ├── database.config │ │ └── system.config │ ├── Controllers/ │ │ ├── DemoController.cs │ │ ├── HomeController.cs │ │ └── TestController.cs │ ├── Download/ │ │ └── _.txt │ ├── Global.asax │ ├── Global.asax.cs │ ├── Properties/ │ │ ├── AssemblyInfo.cs │ │ └── PublishProfiles/ │ │ └── FolderProfile.pubxml │ ├── Scripts/ │ │ ├── business/ │ │ │ └── requestbusiness.js │ │ ├── config.js │ │ ├── easyui/ │ │ │ ├── datagrid-cellediting.js │ │ │ ├── easyloader.js │ │ │ ├── jquery.easyui.extend.js │ │ │ ├── license_freeware.txt │ │ │ ├── locale/ │ │ │ │ └── easyui-lang-zh_CN.js │ │ │ ├── plugins/ │ │ │ │ ├── jquery.accordion.js │ │ │ │ ├── jquery.calendar.js │ │ │ │ ├── jquery.combo.js │ │ │ │ ├── jquery.combobox.js │ │ │ │ ├── jquery.combogrid.js │ │ │ │ ├── jquery.combotree.js │ │ │ │ ├── jquery.combotreegrid.js │ │ │ │ ├── jquery.datagrid.js │ │ │ │ ├── jquery.datalist.js │ │ │ │ ├── jquery.datebox.js │ │ │ │ ├── jquery.datetimebox.js │ │ │ │ ├── jquery.datetimespinner.js │ │ │ │ ├── jquery.dialog.js │ │ │ │ ├── jquery.draggable.js │ │ │ │ ├── jquery.droppable.js │ │ │ │ ├── jquery.filebox.js │ │ │ │ ├── jquery.form.js │ │ │ │ ├── jquery.layout.js │ │ │ │ ├── jquery.linkbutton.js │ │ │ │ ├── jquery.menu.js │ │ │ │ ├── jquery.menubutton.js │ │ │ │ ├── jquery.messager.js │ │ │ │ ├── jquery.mobile.js │ │ │ │ ├── jquery.numberbox.js │ │ │ │ ├── jquery.numberspinner.js │ │ │ │ ├── jquery.pagination.js │ │ │ │ ├── jquery.panel.js │ │ │ │ ├── jquery.parser.js │ │ │ │ ├── jquery.passwordbox.js │ │ │ │ ├── jquery.progressbar.js │ │ │ │ ├── jquery.propertygrid.js │ │ │ │ ├── jquery.resizable.js │ │ │ │ ├── jquery.searchbox.js │ │ │ │ ├── jquery.slider.js │ │ │ │ ├── jquery.spinner.js │ │ │ │ ├── jquery.splitbutton.js │ │ │ │ ├── jquery.switchbutton.js │ │ │ │ ├── jquery.tabs.js │ │ │ │ ├── jquery.tagbox.js │ │ │ │ ├── jquery.textbox.js │ │ │ │ ├── jquery.timespinner.js │ │ │ │ ├── jquery.tooltip.js │ │ │ │ ├── jquery.tree.js │ │ │ │ ├── jquery.treegrid.js │ │ │ │ ├── jquery.validatebox.js │ │ │ │ └── jquery.window.js │ │ │ ├── themes/ │ │ │ │ ├── bootstrap/ │ │ │ │ │ ├── accordion.css │ │ │ │ │ ├── calendar.css │ │ │ │ │ ├── combo.css │ │ │ │ │ ├── combobox.css │ │ │ │ │ ├── datagrid.css │ │ │ │ │ ├── datalist.css │ │ │ │ │ ├── datebox.css │ │ │ │ │ ├── dialog.css │ │ │ │ │ ├── easyui.css │ │ │ │ │ ├── filebox.css │ │ │ │ │ ├── layout.css │ │ │ │ │ ├── linkbutton.css │ │ │ │ │ ├── menu.css │ │ │ │ │ ├── menubutton.css │ │ │ │ │ ├── messager.css │ │ │ │ │ ├── numberbox.css │ │ │ │ │ ├── pagination.css │ │ │ │ │ ├── panel.css │ │ │ │ │ ├── passwordbox.css │ │ │ │ │ ├── progressbar.css │ │ │ │ │ ├── propertygrid.css │ │ │ │ │ ├── searchbox.css │ │ │ │ │ ├── slider.css │ │ │ │ │ ├── spinner.css │ │ │ │ │ ├── splitbutton.css │ │ │ │ │ ├── switchbutton.css │ │ │ │ │ ├── tabs.css │ │ │ │ │ ├── tagbox.css │ │ │ │ │ ├── textbox.css │ │ │ │ │ ├── tooltip.css │ │ │ │ │ ├── tree.css │ │ │ │ │ ├── validatebox.css │ │ │ │ │ └── window.css │ │ │ │ ├── color.css │ │ │ │ ├── default/ │ │ │ │ │ ├── accordion.css │ │ │ │ │ ├── calendar.css │ │ │ │ │ ├── combo.css │ │ │ │ │ ├── combobox.css │ │ │ │ │ ├── datagrid.css │ │ │ │ │ ├── datalist.css │ │ │ │ │ ├── datebox.css │ │ │ │ │ ├── dialog.css │ │ │ │ │ ├── easyui.css │ │ │ │ │ ├── filebox.css │ │ │ │ │ ├── layout.css │ │ │ │ │ ├── linkbutton.css │ │ │ │ │ ├── menu.css │ │ │ │ │ ├── menubutton.css │ │ │ │ │ ├── messager.css │ │ │ │ │ ├── numberbox.css │ │ │ │ │ ├── pagination.css │ │ │ │ │ ├── panel.css │ │ │ │ │ ├── passwordbox.css │ │ │ │ │ ├── progressbar.css │ │ │ │ │ ├── propertygrid.css │ │ │ │ │ ├── searchbox.css │ │ │ │ │ ├── slider.css │ │ │ │ │ ├── spinner.css │ │ │ │ │ ├── splitbutton.css │ │ │ │ │ ├── switchbutton.css │ │ │ │ │ ├── tabs.css │ │ │ │ │ ├── textbox.css │ │ │ │ │ ├── tooltip.css │ │ │ │ │ ├── tree.css │ │ │ │ │ ├── validatebox.css │ │ │ │ │ └── window.css │ │ │ │ └── icon.css │ │ │ └── views/ │ │ │ ├── datagrid-bufferview.js │ │ │ ├── datagrid-defaultview.js │ │ │ ├── datagrid-detailview.js │ │ │ ├── datagrid-groupview.js │ │ │ └── datagrid-scrollview.js │ │ ├── global.js │ │ ├── typings/ │ │ │ └── jquery/ │ │ │ └── jquery.d.ts │ │ ├── util/ │ │ │ ├── easyui-extend.js │ │ │ ├── framework-util.js │ │ │ ├── upload-time.js │ │ │ └── util.js │ │ └── vendor/ │ │ ├── easy-validate/ │ │ │ └── easy-validate.js │ │ ├── echarts/ │ │ │ └── echarts.js │ │ ├── highcharts/ │ │ │ ├── adapters/ │ │ │ │ ├── standalone-framework.js │ │ │ │ └── standalone-framework.src.js │ │ │ ├── highcharts-3d.js │ │ │ ├── highcharts-3d.src.js │ │ │ ├── highcharts-more.js │ │ │ ├── highcharts-more.src.js │ │ │ ├── highcharts.js │ │ │ ├── highcharts.src.js │ │ │ ├── modules/ │ │ │ │ ├── boost.js │ │ │ │ ├── boost.src.js │ │ │ │ ├── broken-axis.js │ │ │ │ ├── broken-axis.src.js │ │ │ │ ├── canvas-tools.js │ │ │ │ ├── canvas-tools.src.js │ │ │ │ ├── data.js │ │ │ │ ├── data.src.js │ │ │ │ ├── drilldown.js │ │ │ │ ├── drilldown.src.js │ │ │ │ ├── exporting.js │ │ │ │ ├── exporting.src.js │ │ │ │ ├── funnel.js │ │ │ │ ├── funnel.src.js │ │ │ │ ├── heatmap.js │ │ │ │ ├── heatmap.src.js │ │ │ │ ├── no-data-to-display.js │ │ │ │ ├── no-data-to-display.src.js │ │ │ │ ├── offline-exporting.js │ │ │ │ ├── offline-exporting.src.js │ │ │ │ ├── series-label.js │ │ │ │ ├── series-label.src.js │ │ │ │ ├── solid-gauge.js │ │ │ │ ├── solid-gauge.src.js │ │ │ │ ├── treemap.js │ │ │ │ └── treemap.src.js │ │ │ └── themes/ │ │ │ ├── dark-blue.js │ │ │ ├── dark-green.js │ │ │ ├── dark-unica.js │ │ │ ├── gray.js │ │ │ ├── grid-light.js │ │ │ ├── grid.js │ │ │ ├── sand-signika.js │ │ │ └── skies.js │ │ ├── html5Uploader/ │ │ │ └── html5Uploader.js │ │ ├── layui/ │ │ │ ├── css/ │ │ │ │ ├── layui.css │ │ │ │ ├── layui.mobile.css │ │ │ │ └── modules/ │ │ │ │ ├── code.css │ │ │ │ ├── laydate/ │ │ │ │ │ └── default/ │ │ │ │ │ └── laydate.css │ │ │ │ └── layer/ │ │ │ │ └── default/ │ │ │ │ └── layer.css │ │ │ ├── lay/ │ │ │ │ └── modules/ │ │ │ │ ├── carousel.js │ │ │ │ ├── code.js │ │ │ │ ├── element.js │ │ │ │ ├── flow.js │ │ │ │ ├── form.js │ │ │ │ ├── jquery.js │ │ │ │ ├── laydate.js │ │ │ │ ├── layedit.js │ │ │ │ ├── layer.js │ │ │ │ ├── laypage.js │ │ │ │ ├── laytpl.js │ │ │ │ ├── mobile.js │ │ │ │ ├── table.js │ │ │ │ ├── tree.js │ │ │ │ ├── upload.js │ │ │ │ └── util.js │ │ │ ├── layui.all.js │ │ │ └── layui.js │ │ ├── template/ │ │ │ └── template.js │ │ ├── umeditor/ │ │ │ ├── dialogs/ │ │ │ │ ├── emotion/ │ │ │ │ │ ├── emotion.css │ │ │ │ │ └── emotion.js │ │ │ │ ├── formula/ │ │ │ │ │ ├── formula.css │ │ │ │ │ ├── formula.html │ │ │ │ │ └── formula.js │ │ │ │ ├── image/ │ │ │ │ │ ├── image.css │ │ │ │ │ └── image.js │ │ │ │ ├── link/ │ │ │ │ │ └── link.js │ │ │ │ ├── map/ │ │ │ │ │ ├── map.html │ │ │ │ │ └── map.js │ │ │ │ └── video/ │ │ │ │ ├── video.css │ │ │ │ └── video.js │ │ │ ├── index.html │ │ │ ├── lang/ │ │ │ │ ├── en/ │ │ │ │ │ └── en.js │ │ │ │ └── zh-cn/ │ │ │ │ └── zh-cn.js │ │ │ ├── net/ │ │ │ │ ├── Uploader.cs │ │ │ │ ├── getContent.ashx │ │ │ │ ├── getContent.ashx.cs │ │ │ │ ├── imageUp.ashx │ │ │ │ └── imageUp.ashx.cs │ │ │ ├── themes/ │ │ │ │ └── default/ │ │ │ │ └── css/ │ │ │ │ └── umeditor.css │ │ │ ├── third-party/ │ │ │ │ └── mathquill/ │ │ │ │ ├── font/ │ │ │ │ │ ├── Symbola.otf │ │ │ │ │ └── stixgeneral-bundle/ │ │ │ │ │ └── STIXFontLicense2010.txt │ │ │ │ ├── mathquill.css │ │ │ │ └── mathquill.js │ │ │ ├── umeditor.config.js │ │ │ └── umeditor.js │ │ ├── util/ │ │ │ ├── easyui-extends.js │ │ │ ├── upload-time.js │ │ │ └── util.js │ │ └── vue/ │ │ └── vue.js │ ├── Skin/ │ │ ├── compass.watch.cmd │ │ ├── config.rb │ │ ├── global.css │ │ ├── home/ │ │ │ └── desktop.css │ │ ├── login.css │ │ ├── reference/ │ │ │ ├── sprite-mixins.css │ │ │ └── variables.css │ │ ├── scss/ │ │ │ ├── global.scss │ │ │ ├── login.scss │ │ │ ├── reference/ │ │ │ │ ├── sprite-mixins.scss │ │ │ │ └── variables.scss │ │ │ └── ue_templates.scss │ │ └── ue_templates.css │ ├── Upload/ │ │ └── _.txt │ ├── Views/ │ │ ├── Demo/ │ │ │ ├── UMEditor.cshtml │ │ │ ├── UploadFileForm.cshtml │ │ │ ├── UploadFileIndex.cshtml │ │ │ └── UploadImgView.cshtml │ │ ├── Home/ │ │ │ ├── Desktop.cshtml │ │ │ ├── Index.cshtml │ │ │ ├── Login.cshtml │ │ │ ├── Statis.cshtml │ │ │ └── Test.cshtml │ │ ├── Shared/ │ │ │ ├── _Layout_List.cshtml │ │ │ └── _Layout_List_js.cshtml │ │ ├── Test/ │ │ │ ├── GetNingboGeojsonForm.cshtml │ │ │ ├── Index.cshtml │ │ │ ├── MapDatTest.cshtml │ │ │ └── RequestDemo.cshtml │ │ └── web.config │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ └── packages.config └── 框架使用说明书.docx ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ ############################################################################### # Set default behavior to automatically normalize line endings. ############################################################################### * text=auto ############################################################################### # Set default behavior for command prompt diff. # # This is need for earlier builds of msysgit that does not have it on by # default for csharp files. # Note: This is only used by command line ############################################################################### #*.cs diff=csharp ############################################################################### # Set the merge driver for project and solution files # # Merging from the command prompt will add diff markers to the files if there # are conflicts (Merging from VS is not affected by the settings below, in VS # the diff markers are never inserted). Diff markers may cause the following # file extensions to fail to load in VS. An alternative would be to treat # these files as binary and thus will always conflict and require user # intervention with every merge. To do so, just uncomment the entries below ############################################################################### #*.sln merge=binary #*.csproj merge=binary #*.vbproj merge=binary #*.vcxproj merge=binary #*.vcproj merge=binary #*.dbproj merge=binary #*.fsproj merge=binary #*.lsproj merge=binary #*.wixproj merge=binary #*.modelproj merge=binary #*.sqlproj merge=binary #*.wwaproj merge=binary ############################################################################### # behavior for image files # # image files are treated as binary by default. ############################################################################### #*.jpg binary #*.png binary #*.gif binary ############################################################################### # diff behavior for common document formats # # Convert binary document formats to text before diffing them. This feature # is only available from the command line. Turn it on by uncommenting the # entries below. ############################################################################### #*.doc diff=astextplain #*.DOC diff=astextplain #*.docx diff=astextplain #*.DOCX diff=astextplain #*.dot diff=astextplain #*.DOT diff=astextplain #*.pdf diff=astextplain #*.PDF diff=astextplain #*.rtf diff=astextplain #*.RTF diff=astextplain ================================================ FILE: .gitignore ================================================ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. # User-specific files *.suo *.user *.userosscache *.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs # Build results [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ x64/ x86/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ # Visual Studio 2015 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUNIT *.VisualState.xml TestResult.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c # DNX project.lock.json project.fragment.lock.json artifacts/ *_i.c *_p.c *_i.h *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.svclog *.scc # Chutzpah Test files _Chutzpah* # Visual C++ cache files ipch/ *.aps *.ncb *.opendb *.opensdf *.sdf *.cachefile *.VC.db *.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx *.sap # TFS 2012 Local Workspace $tf/ # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user # JustCode is a .NET coding add-in .JustCode # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # NCrunch _NCrunch_* .*crunch*.local.xml nCrunchTemp_* # MightyMoose *.mm.* AutoTest.Net/ # Web workbench (sass) .sass-cache/ # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml # TODO: Comment the next line if you want to checkin your web deploy settings # but database connection strings (with potential passwords) will be unencrypted #*.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to # checkin your Azure Web App publish settings, but sensitive information contained # in these scripts will be unencrypted PublishScripts/ # NuGet Packages *.nupkg # The packages folder can be ignored because of Package Restore **/packages/* # except build/, which is used as an MSBuild target. !**/packages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/packages/repositories.config # NuGet v3's project.json files produces more ignoreable files *.nuget.props *.nuget.targets # Microsoft Azure Build Output csx/ *.build.csdef # Microsoft Azure Emulator ecf/ rcf/ # Windows Store app package directories and files AppPackages/ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache !*.[Cc]ache/ # Others ClientBin/ ~$* *~ *.dbmdl *.dbproj.schemaview *.jfm *.pfx *.publishsettings node_modules/ orleans.codegen.cs # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file # to a newer Visual Studio version. Backup files are not needed, # because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm # SQL Server files *.mdf *.ldf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings # Microsoft Fakes FakesAssemblies/ # GhostDoc plugin setting file *.GhostDoc.xml # Node.js Tools for Visual Studio .ntvs_analysis.dat # Visual Studio 6 build log *.plg # Visual Studio 6 workspace options file *.opt # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts **/*.DesktopClient/ModelManifest.xml **/*.Server/GeneratedArtifacts **/*.Server/ModelManifest.xml _Pvt_Extensions # Paket dependency manager .paket/paket.exe paket-files/ # FAKE - F# Make .fake/ # JetBrains Rider .idea/ *.sln.iml # CodeRush .cr/ # Python Tools for Visual Studio (PTVS) __pycache__/ *.pyc /src/Coldairarrow.Web/Upload/Img/2018-10-25 /src/Coldairarrow.Web/Upload/FIle /src/Coldairarrow.Web/Upload/Img ================================================ FILE: .nuget ================================================ ================================================ FILE: .tfignore ================================================ \packages !\packages\repositories.config ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: README.md ================================================ # Coldairarrow.Fx.Net.Easyui.GitHub Web后台快速开发框架,.NET452版本 使用方式:https://github.com/Coldairarrow/Coldairarrow.Fx.Net.Easyui.GitHub/wiki ================================================ FILE: docs/数据库设计/Base_Table.pdm ================================================ 160EB092-2F96-4235-852F-052B990C5A86 Base_Table Base_Table 1506739078 xgc15 1536569712 xgc15 [FolderOptions] [FolderOptions\Physical Objects] GenerationCheckModel=Yes GenerationPath= GenerationOptions= GenerationTasks= GenerationTargets= GenerationSelections= RevPkey=Yes RevFkey=Yes RevAkey=Yes RevCheck=Yes RevIndx=Yes RevOpts=Yes RevViewAsTabl=No RevViewOpts=Yes RevSystAsTabl=Yes RevTablPerm=No RevViewPerm=No RevProcPerm=No RevDbpkPerm=No RevSqncPerm=No RevAdtPerm=No RevUserPriv=No RevUserOpts=No RevGrpePriv=No RevRolePriv=No RevDtbsOpts=Yes RevDtbsPerm=No RevViewIndx=Yes RevJidxOpts=Yes RevStats=No RevTspcPerm=No RevCaseSensitive=No GenTrgrStdMsg=Yes GenTrgrMsgTab= GenTrgrMsgNo= GenTrgrMsgTxt= TrgrPreserve=No TrgrIns=Yes TrgrUpd=Yes TrgrDel=Yes TrgrC2Ins=Yes TrgrC2Upd=Yes TrgrC3=Yes TrgrC4=Yes TrgrC5=Yes TrgrC6=Yes TrgrC7=Yes TrgrC8=Yes TrgrC9=Yes TrgrC10=Yes TrgrC11=Yes TrgrC1=Yes TrgrC12Ins=Yes TrgrC12Upd=Yes TrgrC13=Yes UpdateTableStatistics=Yes UpdateColumnStatistics=Yes [FolderOptions\Physical Objects\Database Generation] GenScriptName=crebas GenScriptName0= GenScriptName1= GenScriptName2= GenScriptName3= GenScriptName4= GenScriptName5= GenScriptName6= GenScriptName7= GenScriptName8= GenScriptName9= GenPathName= GenSingleFile=Yes GenODBC=No GenCheckModel=Yes GenScriptPrev=Yes GenArchiveModel=No GenUseSync=No GenSyncChoice=0 GenSyncArch= GenSyncRmg=0 [FolderOptions\Physical Objects\Database Generation\Format] GenScriptTitle=Yes GenScriptNamLabl=No GenScriptQDtbs=No GenScriptQOwnr=Yes GenScriptCase=0 GenScriptEncoding=ANSI GenScriptNAcct=No IdentifierDelimiter=" [FolderOptions\Physical Objects\Database Generation\Database] Create=Yes Open=Yes Close=Yes Drop=Yes Permission=No [FolderOptions\Physical Objects\Database Generation\Database\Create] Physical Options=Yes Header=Yes Footer=Yes [FolderOptions\Physical Objects\Database Generation\Tablespace] Create=Yes Drop=Yes Comment=Yes Permission=No [FolderOptions\Physical Objects\Database Generation\Tablespace\Create] Header=Yes Footer=Yes [FolderOptions\Physical Objects\Database Generation\Storage] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\User] Create=Yes Drop=Yes Comment=Yes Privilege=No [FolderOptions\Physical Objects\Database Generation\User\Create] Physical Options=No [FolderOptions\Physical Objects\Database Generation\Group] Create=Yes Drop=Yes Comment=Yes Privilege=No [FolderOptions\Physical Objects\Database Generation\Role] Create=Yes Drop=Yes Privilege=No [FolderOptions\Physical Objects\Database Generation\UserDefinedDataType] Create=Yes Comment=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\UserDefinedDataType\Create] Default value=Yes Check=Yes [FolderOptions\Physical Objects\Database Generation\AbstractDataType] Create=Yes Header=Yes Footer=Yes Drop=Yes Comment=Yes Install JAVA class=Yes Remove JAVA class=Yes Permission=No [FolderOptions\Physical Objects\Database Generation\Rule] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\Default] Create=Yes Comment=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\Sequence] Create=Yes Drop=Yes Comment=Yes Permission=No [FolderOptions\Physical Objects\Database Generation\Table&&Column] [FolderOptions\Physical Objects\Database Generation\Table&&Column\Table] Create=Yes Drop=Yes Comment=Yes Permission=No [FolderOptions\Physical Objects\Database Generation\Table&&Column\Table\Create] Check=Yes Physical Options=Yes Header=Yes Footer=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Table\Create\Check] Constraint declaration=No [FolderOptions\Physical Objects\Database Generation\Table&&Column\Column] User datatype=Yes Default value=Yes Check=Yes Physical Options=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Column\Check] Constraint declaration=No [FolderOptions\Physical Objects\Database Generation\Table&&Column\Key] [FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Primary key] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Primary key\Create] Constraint declaration=No Physical Options=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Alternate key] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Key\Alternate key\Create] Constraint declaration=No Physical Options=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Foreign key] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Foreign key\Create] Constraint declaration=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Index] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Index\Create] Constraint declaration=Yes Physical Options=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Index\Filter] Primary key=No Foreign key=Yes Alternate key=No Cluster=Yes Other=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Trigger] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\Table&&Column\Trigger\Filter] For insert=Yes For update=Yes For delete=Yes For other=Yes [FolderOptions\Physical Objects\Database Generation\View] Create=Yes Drop=Yes Comment=Yes Permission=No [FolderOptions\Physical Objects\Database Generation\View\Create] Force Column list=No Physical Options=Yes Header=Yes Footer=Yes [FolderOptions\Physical Objects\Database Generation\View\ViewColumn] Comment=Yes [FolderOptions\Physical Objects\Database Generation\View\ViewIndex] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\View\ViewIndex\Create] Physical Options=Yes [FolderOptions\Physical Objects\Database Generation\View\ViewIndex\Filter] Cluster=Yes Other=Yes [FolderOptions\Physical Objects\Database Generation\View\Trigger] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\View\Trigger\Filter] For insert=Yes For update=Yes For delete=Yes For other=Yes [FolderOptions\Physical Objects\Database Generation\DBMSTrigger] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\Synonym] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\Synonym\Filter] Table=Yes View=Yes Proc=Yes Synonym=Yes Database Package=Yes Sequence=Yes [FolderOptions\Physical Objects\Database Generation\JoinIndex] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\JoinIndex\Create] Physical Options=Yes Header=Yes Footer=Yes [FolderOptions\Physical Objects\Database Generation\Procedure] Create=Yes Drop=Yes Comment=Yes Permission=No [FolderOptions\Physical Objects\Database Generation\Procedure\Create] Header=Yes Footer=Yes [FolderOptions\Physical Objects\Database Generation\DatabasePackage] Create=Yes Drop=Yes Permission=No [FolderOptions\Physical Objects\Database Generation\WebService] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\Dimension] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\Synchronization] GenBackupTabl=1 GenKeepBackTabl=1 GenTmpTablDrop=No GenKeepTablOpts=No [FolderOptions\Physical Objects\Database Generation\User <<Schema>>] Create=Yes Drop=Yes Comment=Yes [FolderOptions\Physical Objects\Database Generation\User <<User>>] Create=Yes Drop=Yes Comment=Yes Privilege=No [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<Aggregate>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<Aggregate>>\ExtendedSubObject <<AggregateParameter>>] Create=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<Assembly>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<AsymmetricKey>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<Certificate>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<Contract>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<EndPoint>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<EventNotification>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<FullTextCatalog>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<MessageType>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<PartitionFunction>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<PartitionScheme>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<Queue>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<RemoteServiceBinding>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<ResourcePool>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<Route>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<Service>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<SymmetricKey>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<WorkloadGroup>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Database Generation\ExtendedObject <<XMLSchemaCollection>>] Create=Yes Drop=Yes [FolderOptions\Physical Objects\Test Data] GenDataPathName= GenDataSinglefile=Yes GenDataScriptName=testdata GenDataScriptName0= GenDataScriptName1= GenDataScriptName2= GenDataScriptName3= GenDataScriptName4= GenDataScriptName5= GenDataScriptName6= GenDataScriptName7= GenDataScriptName8= GenDataScriptName9= GenDataOdbc=0 GenDataDelOld=No GenDataTitle=No GenDataDefNumRows=20 GenDataCommit=0 GenDataPacket=0 GenDataOwner=No GenDataProfNumb= GenDataProfChar= GenDataProfDate= GenDataCSVSeparator=, GenDataFileFormat=CSV GenDataUseWizard=No [FolderOptions\Pdm] IndxIQName=%COLUMN%_%INDEXTYPE% IndxPK=Yes IndxFK=Yes IndxAK=Yes IndxPKName=%TABLE%_PK IndxFKName=%REFR%_FK IndxAKName=%AKEY%_AK IndxPreserve=No IndxThreshold=0 IndxStats=No RefrPreserve=No JidxPreserve=No RbldMultiFact=Yes RbldMultiDim=Yes RbldMultiJidx=Yes CubePreserve=No TablStProcPreserve=No ProcDepPreserve=Yes TrgrDepPreserve=Yes CubeScriptPath= CubeScriptCase=0 CubeScriptEncoding=ANSI CubeScriptNacct=No CubeScriptHeader=No CubeScriptExt=csv CubeScriptExt0=txt CubeScriptExt1= CubeScriptExt2= CubeScriptSep=, CubeScriptDeli=" EstimationYears=0 DfltDomnName=D_%.U:VALUE% DfltColnName=D_%.U:VALUE% DfltReuse=Yes DfltDrop=Yes [ModelOptions] [ModelOptions\Physical Objects] CaseSensitive=No DisplayName=Yes EnableTrans=No UseTerm=No EnableRequirements=No EnableFullShortcut=Yes DefaultDttp= IgnoreOwner=No RebuildTrigger=Yes RefrUnique=No RefrAutoMigrate=Yes RefrMigrateReuse=Yes RefrMigrateDomain=Yes RefrMigrateCheck=Yes RefrMigrateRule=Yes RefrMigrateExtd=No RefrMigrDefaultLink=No RefrDfltImpl=D RefrPrgtColn=No RefrMigrateToEnd=No RebuildTriggerDep=No ColnFKName=%.3:PARENT%_%COLUMN% ColnFKNameUse=No DomnCopyDttp=Yes DomnCopyChck=No DomnCopyRule=No DomnCopyMand=No DomnCopyExtd=No DomnCopyProf=No Notation=0 DomnDefaultMandatory=No ColnDefaultMandatory=No TablDefaultOwner= ViewDefaultOwner= TrgrDefaultOwnerTabl= TrgrDefaultOwnerView= IdxDefaultOwnerTabl= IdxDefaultOwnerView= JdxDefaultOwner= DBPackDefaultOwner= SeqDefaultOwner= ProcDefaultOwner= DBMSTrgrDefaultOwner= Currency=USD RefrDeleteConstraint=0 RefrUpdateConstraint=0 RefrParentMandatory=No RefrParentChangeAllow=Yes RefrCheckOnCommit=No [ModelOptions\Physical Objects\NamingOptionsTemplates] [ModelOptions\Physical Objects\ClssNamingOptions] [ModelOptions\Physical Objects\ClssNamingOptions\PDMPCKG] [ModelOptions\Physical Objects\ClssNamingOptions\PDMPCKG\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\PDMPCKG\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\PDMDOMN] [ModelOptions\Physical Objects\ClssNamingOptions\PDMDOMN\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\PDMDOMN\Code] Template= MaxLen=128 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\TABL] [ModelOptions\Physical Objects\ClssNamingOptions\TABL\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\TABL\Code] Template= MaxLen=128 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\COLN] [ModelOptions\Physical Objects\ClssNamingOptions\COLN\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\COLN\Code] Template= MaxLen=128 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\INDX] [ModelOptions\Physical Objects\ClssNamingOptions\INDX\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\INDX\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\REFR] [ModelOptions\Physical Objects\ClssNamingOptions\REFR\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\REFR\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\VREF] [ModelOptions\Physical Objects\ClssNamingOptions\VREF\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\VREF\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\VIEW] [ModelOptions\Physical Objects\ClssNamingOptions\VIEW\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\VIEW\Code] Template= MaxLen=128 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\VIEWC] [ModelOptions\Physical Objects\ClssNamingOptions\VIEWC\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\VIEWC\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\WEBSERV] [ModelOptions\Physical Objects\ClssNamingOptions\WEBSERV\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\WEBSERV\Code] Template= MaxLen=254 Case=M ValidChar='a'-'z','A'-'Z','0'-'9',"/-_.!~*'()" InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\WEBOP] [ModelOptions\Physical Objects\ClssNamingOptions\WEBOP\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\WEBOP\Code] Template= MaxLen=254 Case=M ValidChar='a'-'z','A'-'Z','0'-'9',"/-_.!~*'()" InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\WPARAM] [ModelOptions\Physical Objects\ClssNamingOptions\WPARAM\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\WPARAM\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\FACT] [ModelOptions\Physical Objects\ClssNamingOptions\FACT\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\FACT\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\DIMN] [ModelOptions\Physical Objects\ClssNamingOptions\DIMN\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\DIMN\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\MEAS] [ModelOptions\Physical Objects\ClssNamingOptions\MEAS\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\MEAS\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\DATTR] [ModelOptions\Physical Objects\ClssNamingOptions\DATTR\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\DATTR\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\FILO] [ModelOptions\Physical Objects\ClssNamingOptions\FILO\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\FILO\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\FRMEOBJ] [ModelOptions\Physical Objects\ClssNamingOptions\FRMEOBJ\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\FRMEOBJ\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\FRMELNK] [ModelOptions\Physical Objects\ClssNamingOptions\FRMELNK\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\FRMELNK\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\DefaultClass] [ModelOptions\Physical Objects\ClssNamingOptions\DefaultClass\Name] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Physical Objects\ClssNamingOptions\DefaultClass\Code] Template= MaxLen=254 Case=M ValidChar= InvldChar= AllValid=Yes NoAccent=No DefaultChar= Script= ConvTable= ConvTablePath=%_HOME%\Resource Files\Conversion Tables [ModelOptions\Connection] [ModelOptions\Pdm] [ModelOptions\Generate] [ModelOptions\Generate\Xsm] GenRootElement=Yes GenComplexType=No GenAttribute=Yes CheckModel=Yes SaveLinks=Yes ORMapping=No NameToCode=No [ModelOptions\Generate\Pdm] RRMapping=No [ModelOptions\Generate\Cdm] CheckModel=Yes SaveLinks=Yes NameToCode=No Notation=2 [ModelOptions\Generate\Oom] CheckModel=Yes SaveLinks=Yes ORMapping=No NameToCode=Yes ClassPrefix= [ModelOptions\Generate\Ldm] CheckModel=Yes SaveLinks=Yes NameToCode=No [ModelOptions\Default Opts] [ModelOptions\Default Opts\TABL] PhysOpts= [ModelOptions\Default Opts\COLN] PhysOpts= [ModelOptions\Default Opts\INDX] PhysOpts= [ModelOptions\Default Opts\AKEY] PhysOpts= [ModelOptions\Default Opts\PKEY] PhysOpts= [ModelOptions\Default Opts\STOR] PhysOpts= [ModelOptions\Default Opts\TSPC] PhysOpts= [ModelOptions\Default Opts\SQNC] PhysOpts= [ModelOptions\Default Opts\DTBS] PhysOpts= [ModelOptions\Default Opts\USER] PhysOpts= [ModelOptions\Default Opts\JIDX] PhysOpts= [ModelOptions\Default Opts\FRMEOBJ<<ResourcePool>>] PhysOpts= [ModelOptions\Default Opts\FRMEOBJ<<WorkloadGroup>>] PhysOpts= [ModelOptions\Default Opts\FRMESOB<<ResourcePool>>] PhysOpts= [ModelOptions\Default Opts\FRMESOB<<WorkloadGroup>>] PhysOpts= CCE4FBFC-B300-47D9-8E20-B1A09F5ABACF Microsoft SQL Server 2008 MSSQLSRV2008 1506739078 xgc15 1506739078 xgc15 F5C20738-B05A-4F70-BC90-9B5EB9437766 4BA9F647-DAB1-11D1-9944-006097355D9B 5A69F729-BEF2-4E0C-99B2-54CA329A99A9 PhysicalDiagram_1 PhysicalDiagram_1 1506739078 xgc15 1536569712 xgc15 [DisplayPreferences] [DisplayPreferences\PDM] [DisplayPreferences\General] Adjust to text=Yes Snap Grid=No Constrain Labels=Yes Display Grid=No Show Page Delimiter=Yes Show Links intersections=Yes Activate automatic link routing=Yes Grid size=0 Graphic unit=2 Window color=255, 255, 255 Background image= Background mode=8 Watermark image= Watermark mode=8 Show watermark on screen=No Gradient mode=0 Gradient end color=255, 255, 255 Show Swimlane=No SwimlaneVert=Yes TreeVert=No CompDark=0 [DisplayPreferences\Object] Show Icon=No Mode=2 Trunc Length=40 Word Length=40 Word Text=!"#$%&')*+,-./:;=>?@\]^_`|}~ Shortcut IntIcon=Yes Shortcut IntLoct=Yes Shortcut IntFullPath=No Shortcut IntLastPackage=Yes Shortcut ExtIcon=Yes Shortcut ExtLoct=No Shortcut ExtFullPath=No Shortcut ExtLastPackage=Yes Shortcut ExtIncludeModl=Yes EObjShowStrn=Yes ExtendedObject.Comment=No ExtendedObject.IconPicture=No ExtendedObject.TextStyle=No ExtendedObject_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Object Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <Separator Name="Separator" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> ELnkShowStrn=Yes ELnkShowName=Yes ExtendedLink_SymbolLayout=<Form>[CRLF] <Form Name="Center" >[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Source" >[CRLF] </Form>[CRLF] <Form Name="Destination" >[CRLF] </Form>[CRLF]</Form> FileObject.Stereotype=No FileObject.DisplayName=Yes FileObject.LocationOrName=No FileObject.IconPicture=No FileObject.TextStyle=No FileObject.IconMode=Yes FileObject_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Location" Attribute="LocationOrName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> Package.Stereotype=Yes Package.Comment=No Package.IconPicture=No Package.TextStyle=No Package_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <Separator Name="Separator" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> Display Model Version=Yes Table.Stereotype=Yes Table.DisplayName=Yes Table.OwnerDisplayName=No Table.Columns=Yes Table.Columns._Filter="All Columns" PDMCOLNALL Table.Columns._Columns=Stereotype DataType KeyIndicator Table.Columns._Limit=-5 Table.Keys=No Table.Keys._Columns=Stereotype Indicator Table.Indexes=No Table.Indexes._Columns=Stereotype Table.Triggers=No Table.Triggers._Columns=Stereotype Table.Comment=No Table.IconPicture=No Table.TextStyle=No Table_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Owner and Name" Attribute="OwnerDisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <Separator Name="Separator" />[CRLF] <StandardCollection Name="Columns" Collection="Columns" Columns="Stereotype No\r\nDisplayName Yes\r\nDataType No\r\nSymbolDataType No &quot;Domain or Data type&quot;\r\nDomain No\r\nKeyIndicator No\r\nIndexIndicator No\r\nNullStatus No" Filters="&quot;All Columns&quot; PDMCOLNALL &quot;&quot;\r\n&quot;PK Columns&quot; PDMCOLNPK &quot;\&quot;PRIM \&quot;TRUE\&quot; TRUE\&quot;&quot;\r\n&quot;Key Columns&quot; PDMCOLNKEY &quot;\&quot;KEYS \&quot;TRUE\&quot; TRUE\&quot;&quot;" HasLimit="Yes" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Keys" Collection="Keys" Columns="Stereotype No\r\nDisplayName Yes\r\nIndicator No" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Indexes" Collection="Indexes" Columns="Stereotype No\r\nDisplayName Yes\r\nIndicator No" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Triggers" Collection="Triggers" Columns="Stereotype No\r\nDisplayName Yes" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> View.Stereotype=Yes View.DisplayName=Yes View.OwnerDisplayName=No View.Columns=Yes View.Columns._Columns=DisplayName View.Columns._Limit=-5 View.TemporaryVTables=Yes View.Indexes=No View.Comment=No View.IconPicture=No View.TextStyle=No View_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Owner and Name" Attribute="OwnerDisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <Separator Name="Separator" />[CRLF] <StandardCollection Name="Columns" Collection="Columns" Columns="DisplayName No\r\nExpression No\r\nDataType No\r\nSymbolDataType No &quot;Domain or Data type&quot;\r\nIndexIndicator No" HasLimit="Yes" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Tables" Collection="TemporaryVTables" Columns="Name Yes" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardCollection Name="Indexes" Collection="Indexes" Columns="DisplayName Yes" HasLimit="No" HideEmpty="No" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> Procedure.Stereotype=No Procedure.DisplayName=Yes Procedure.OwnerDisplayName=No Procedure.Comment=No Procedure.IconPicture=No Procedure.TextStyle=No Procedure_SymbolLayout=<Form>[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="Yes" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Owner and Name" Attribute="OwnerDisplayName" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <Separator Name="Separator" />[CRLF] <StandardAttribute Name="Comment" Attribute="Comment" Prefix="" Suffix="" Alignment="LEFT" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Icon" Attribute="IconPicture" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF] <StandardAttribute Name="Force top align" Attribute="TextStyle" Prefix="" Suffix="" Alignment="CNTR" Caption="" Mandatory="Yes" />[CRLF]</Form> Reference.Cardinality=No Reference.ImplementationType=No Reference.ChildRole=Yes Reference.Stereotype=Yes Reference.DisplayName=No Reference.ForeignKeyConstraintName=No Reference.JoinExpression=No Reference.Integrity=No Reference.ParentRole=Yes Reference_SymbolLayout=<Form>[CRLF] <Form Name="Source" >[CRLF] <StandardAttribute Name="Cardinality" Attribute="Cardinality" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Implementation" Attribute="ImplementationType" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Child Role" Attribute="ChildRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Center" >[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="No" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Cons&amp;traint Name" Attribute="ForeignKeyConstraintName" Prefix="" Suffix="" Caption="Cons&amp;traint Name" Mandatory="No" />[CRLF] <StandardAttribute Name="Join" Attribute="JoinExpression" Prefix="" Suffix="" Caption="Join" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] <StandardAttribute Name="Referential integrity" Attribute="Integrity" Prefix="" Suffix="" Caption="Referential integrity" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Destination" >[CRLF] <StandardAttribute Name="Parent Role" Attribute="ParentRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF]</Form> ViewReference.ChildRole=Yes ViewReference.Stereotype=Yes ViewReference.DisplayName=No ViewReference.JoinExpression=No ViewReference.ParentRole=Yes ViewReference_SymbolLayout=<Form>[CRLF] <Form Name="Source" >[CRLF] <StandardAttribute Name="Child Role" Attribute="ChildRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF] <Form Name="Center" >[CRLF] <StandardAttribute Name="Stereotype" Attribute="Stereotype" Prefix="&lt;&lt;" Suffix="&gt;&gt;" Caption="" Mandatory="No" />[CRLF] <ExclusiveChoice Name="Exclusive Choice" Mandatory="No" Display="HorizontalRadios" >[CRLF] <StandardAttribute Name="Name" Attribute="DisplayName" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] <StandardAttribute Name="Join Expression" Attribute="JoinExpression" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </ExclusiveChoice>[CRLF] </Form>[CRLF] <Form Name="Destination" >[CRLF] <StandardAttribute Name="Parent Role" Attribute="ParentRole" Prefix="" Suffix="" Caption="" Mandatory="No" />[CRLF] </Form>[CRLF]</Form> [DisplayPreferences\Symbol] [DisplayPreferences\Symbol\FRMEOBJ] STRNFont=新宋体,8,N STRNFont color=0, 0, 0 DISPNAMEFont=新宋体,8,N DISPNAMEFont color=0, 0, 0 LABLFont=新宋体,8,N LABLFont color=0, 0, 0 AutoAdjustToText=Yes Keep aspect=No Keep center=No Keep size=No Width=6000 Height=2000 Brush color=255 255 255 Fill Color=Yes Brush style=6 Brush bitmap mode=12 Brush gradient mode=64 Brush gradient color=192 192 192 Brush background image= Custom shape= Custom text mode=0 Pen=1 0 255 128 128 Shadow color=192 192 192 Shadow=0 [DisplayPreferences\Symbol\FRMELNK] CENTERFont=新宋体,8,N CENTERFont color=0, 0, 0 Line style=1 AutoAdjustToText=Yes Keep aspect=No Keep center=No Keep size=No Brush color=255 255 255 Fill Color=Yes Brush style=1 Brush bitmap mode=12 Brush gradient mode=0 Brush gradient color=118 118 118 Brush background image= Custom shape= Custom text mode=0 Pen=1 0 128 128 255 Shadow color=192 192 192 Shadow=0 [DisplayPreferences\Symbol\FILO] OBJSTRNFont=新宋体,8,N OBJSTRNFont color=0, 0, 0 DISPNAMEFont=新宋体,8,N DISPNAMEFont color=0, 0, 0 LCNMFont=新宋体,8,N LCNMFont color=0, 0, 0 AutoAdjustToText=Yes Keep aspect=No Keep center=No Keep size=No Width=4800 Height=3600 Brush color=255 255 255 Fill Color=Yes Brush style=1 Brush bitmap mode=12 Brush gradient mode=0 Brush gradient color=118 118 118 Brush background image= Custom shape= Custom text mode=0 Pen=1 0 0 0 255 Shadow color=192 192 192 Shadow=0 [DisplayPreferences\Symbol\PDMPCKG] STRNFont=新宋体,8,N STRNFont color=0, 0, 0 DISPNAMEFont=新宋体,8,N DISPNAMEFont color=0, 0, 0 LABLFont=新宋体,8,N LABLFont color=0, 0, 0 AutoAdjustToText=Yes Keep aspect=No Keep center=No Keep size=No Width=4800 Height=4000 Brush color=255 255 192 Fill Color=Yes Brush style=6 Brush bitmap mode=12 Brush gradient mode=65 Brush gradient color=255 255 255 Brush background image= Custom shape= Custom text mode=0 Pen=1 0 178 178 178 Shadow color=192 192 192 Shadow=0 [DisplayPreferences\Symbol\TABL] STRNFont=新宋体,8,N STRNFont color=0, 0, 0 DISPNAMEFont=新宋体,8,N DISPNAMEFont color=0, 0, 0 OWNRDISPNAMEFont=新宋体,8,N OWNRDISPNAMEFont color=0, 0, 0 ColumnsFont=新宋体,8,N ColumnsFont color=0, 0, 0 TablePkColumnsFont=新宋体,8,U TablePkColumnsFont color=0, 0, 0 TableFkColumnsFont=新宋体,8,N TableFkColumnsFont color=0, 0, 0 KeysFont=新宋体,8,N KeysFont color=0, 0, 0 IndexesFont=新宋体,8,N IndexesFont color=0, 0, 0 TriggersFont=新宋体,8,N TriggersFont color=0, 0, 0 LABLFont=新宋体,8,N LABLFont color=0, 0, 0 AutoAdjustToText=Yes Keep aspect=No Keep center=No Keep size=No Width=4800 Height=4000 Brush color=178 214 252 Fill Color=Yes Brush style=6 Brush bitmap mode=12 Brush gradient mode=65 Brush gradient color=255 255 255 Brush background image= Custom shape= Custom text mode=0 Pen=1 0 0 128 192 Shadow color=192 192 192 Shadow=0 [DisplayPreferences\Symbol\VIEW] STRNFont=新宋体,8,N STRNFont color=0, 0, 0 DISPNAMEFont=新宋体,8,N DISPNAMEFont color=0, 0, 0 OWNRDISPNAMEFont=新宋体,8,N OWNRDISPNAMEFont color=0, 0, 0 ColumnsFont=新宋体,8,N ColumnsFont color=0, 0, 0 TablePkColumnsFont=新宋体,8,U TablePkColumnsFont color=0, 0, 0 TableFkColumnsFont=新宋体,8,N TableFkColumnsFont color=0, 0, 0 TemporaryVTablesFont=新宋体,8,N TemporaryVTablesFont color=0, 0, 0 IndexesFont=新宋体,8,N IndexesFont color=0, 0, 0 LABLFont=新宋体,8,N LABLFont color=0, 0, 0 AutoAdjustToText=Yes Keep aspect=No Keep center=No Keep size=No Width=4800 Height=4000 Brush color=208 208 255 Fill Color=Yes Brush style=6 Brush bitmap mode=12 Brush gradient mode=65 Brush gradient color=255 255 255 Brush background image= Custom shape= Custom text mode=0 Pen=1 0 128 128 192 Shadow color=192 192 192 Shadow=0 [DisplayPreferences\Symbol\PROC] STRNFont=新宋体,8,N STRNFont color=0, 0, 0 DISPNAMEFont=新宋体,8,N DISPNAMEFont color=0, 0, 0 OWNRDISPNAMEFont=新宋体,8,N OWNRDISPNAMEFont color=0, 0, 0 LABLFont=新宋体,8,N LABLFont color=0, 0, 0 AutoAdjustToText=Yes Keep aspect=No Keep center=No Keep size=No Width=4000 Height=1000 Brush color=255 255 192 Fill Color=Yes Brush style=6 Brush bitmap mode=12 Brush gradient mode=65 Brush gradient color=255 255 255 Brush background image= Custom shape= Custom text mode=0 Pen=1 0 128 108 0 Shadow color=192 192 192 Shadow=0 [DisplayPreferences\Symbol\REFR] SOURCEFont=新宋体,8,N SOURCEFont color=0, 0, 0 CENTERFont=新宋体,8,N CENTERFont color=0, 0, 0 DESTINATIONFont=新宋体,8,N DESTINATIONFont color=0, 0, 0 Line style=1 AutoAdjustToText=Yes Keep aspect=No Keep center=No Keep size=No Brush color=255 255 255 Fill Color=Yes Brush style=1 Brush bitmap mode=12 Brush gradient mode=0 Brush gradient color=118 118 118 Brush background image= Custom shape= Custom text mode=0 Pen=1 0 0 128 192 Shadow color=192 192 192 Shadow=0 [DisplayPreferences\Symbol\VREF] SOURCEFont=新宋体,8,N SOURCEFont color=0, 0, 0 CENTERFont=新宋体,8,N CENTERFont color=0, 0, 0 DESTINATIONFont=新宋体,8,N DESTINATIONFont color=0, 0, 0 Line style=1 AutoAdjustToText=Yes Keep aspect=No Keep center=No Keep size=No Brush color=255 255 255 Fill Color=Yes Brush style=1 Brush bitmap mode=12 Brush gradient mode=0 Brush gradient color=118 118 118 Brush background image= Custom shape= Custom text mode=0 Pen=1 0 128 128 192 Shadow color=192 192 192 Shadow=0 [DisplayPreferences\Symbol\USRDEPD] OBJXSTRFont=新宋体,8,N OBJXSTRFont color=0, 0, 0 Line style=1 AutoAdjustToText=Yes Keep aspect=No Keep center=No Keep size=No Brush color=255 255 255 Fill Color=Yes Brush style=1 Brush bitmap mode=12 Brush gradient mode=0 Brush gradient color=118 118 118 Brush background image= Custom shape= Custom text mode=0 Pen=2 0 128 128 255 Shadow color=192 192 192 Shadow=0 [DisplayPreferences\Symbol\Free Symbol] Free TextFont=新宋体,8,N Free TextFont color=0, 0, 0 Line style=0 AutoAdjustToText=Yes Keep aspect=No Keep center=No Keep size=No Brush color=255 255 255 Fill Color=Yes Brush style=1 Brush bitmap mode=12 Brush gradient mode=0 Brush gradient color=118 118 118 Brush background image= Custom shape= Custom text mode=0 Pen=1 0 0 0 255 Shadow color=192 192 192 Shadow=0 (8268, 11693) ((315,354), (433,354)) 1 15 1506739100 1506740418 -1 ((-23080,7260), (-8970,15080)) 0 12615680 16570034 12632256 STRN 0 新宋体,8,N DISPNAME 0 新宋体,8,N OWNRDISPNAME 0 新宋体,8,N Columns 0 新宋体,8,N TablePkColumns 0 新宋体,8,U TableFkColumns 0 新宋体,8,N Keys 0 新宋体,8,N Indexes 0 新宋体,8,N Triggers 0 新宋体,8,N LABL 0 新宋体,8,N 6 65 16777215 1 1507182882 1537275215 -1 ((13402,-5170), (26376,378)) 12615680 16570034 12632256 STRN 0 新宋体,8,N DISPNAME 0 新宋体,8,N OWNRDISPNAME 0 新宋体,8,N Columns 0 新宋体,8,N TablePkColumns 0 新宋体,8,U TableFkColumns 0 新宋体,8,N Keys 0 新宋体,8,N Indexes 0 新宋体,8,N Triggers 0 新宋体,8,N LABL 0 新宋体,8,N 6 65 16777215 1507623325 1537275207 -1 ((8331,10353), (23370,15825)) 0 12615680 16570034 12632256 STRN 0 新宋体,8,N DISPNAME 0 新宋体,8,N OWNRDISPNAME 0 新宋体,8,N Columns 0 新宋体,8,N TablePkColumns 0 新宋体,8,U TableFkColumns 0 新宋体,8,N Keys 0 新宋体,8,N Indexes 0 新宋体,8,N Triggers 0 新宋体,8,N LABL 0 新宋体,8,N 6 65 16777215 1 1508978602 1536569369 -1 ((-23103,449), (-9690,5431)) 0 12615680 16570034 12632256 STRN 0 新宋体,8,N DISPNAME 0 新宋体,8,N OWNRDISPNAME 0 新宋体,8,N Columns 0 新宋体,8,N TablePkColumns 0 新宋体,8,U TableFkColumns 0 新宋体,8,N Keys 0 新宋体,8,N Indexes 0 新宋体,8,N Triggers 0 新宋体,8,N LABL 0 新宋体,8,N 6 65 16777215 1 1536569188 1537275214 -1 ((-7948,250), (8370,4250)) 0 12615680 16570034 12632256 STRN 0 新宋体,8,N DISPNAME 0 新宋体,8,N OWNRDISPNAME 0 新宋体,8,N Columns 0 新宋体,8,N TablePkColumns 0 新宋体,8,U TableFkColumns 0 新宋体,8,N Keys 0 新宋体,8,N Indexes 0 新宋体,8,N Triggers 0 新宋体,8,N LABL 0 新宋体,8,N 6 65 16777215 1 1536569287 1537275204 -1 ((-7798,11275), (7650,15275)) 0 12615680 16570034 12632256 STRN 0 新宋体,8,N DISPNAME 0 新宋体,8,N OWNRDISPNAME 0 新宋体,8,N Columns 0 新宋体,8,N TablePkColumns 0 新宋体,8,U TableFkColumns 0 新宋体,8,N Keys 0 新宋体,8,N Indexes 0 新宋体,8,N Triggers 0 新宋体,8,N LABL 0 新宋体,8,N 6 65 16777215 1 1536569380 1537275211 -1 ((-7864,5650), (7890,9650)) 0 12615680 16570034 12632256 STRN 0 新宋体,8,N DISPNAME 0 新宋体,8,N OWNRDISPNAME 0 新宋体,8,N Columns 0 新宋体,8,N TablePkColumns 0 新宋体,8,U TableFkColumns 0 新宋体,8,N Keys 0 新宋体,8,N Indexes 0 新宋体,8,N Triggers 0 新宋体,8,N LABL 0 新宋体,8,N 6 65 16777215 1 1536569446 1537275212 -1 ((10661,3194), (23803,9320)) 0 12615680 16570034 12632256 STRN 0 新宋体,8,N DISPNAME 0 新宋体,8,N OWNRDISPNAME 0 新宋体,8,N Columns 0 新宋体,8,N TablePkColumns 0 新宋体,8,U TableFkColumns 0 新宋体,8,N Keys 0 新宋体,8,N Indexes 0 新宋体,8,N Triggers 0 新宋体,8,N LABL 0 新宋体,8,N 6 65 16777215 1 1536569712 1536569714 -1 ((-23075,-6091), (-9662,-1109)) 0 12615680 16570034 12632256 STRN 0 新宋体,8,N DISPNAME 0 新宋体,8,N OWNRDISPNAME 0 新宋体,8,N Columns 0 新宋体,8,N TablePkColumns 0 新宋体,8,U TableFkColumns 0 新宋体,8,N Keys 0 新宋体,8,N Indexes 0 新宋体,8,N Triggers 0 新宋体,8,N LABL 0 新宋体,8,N 6 65 16777215 1 C0ADB72D-C082-44EE-A15B-D2D44310D18C Report 1 Report 1 1520149495 xgc15 1520149497 xgc15 xgc15 %DATE% LightBlue_Theme.css Header_LightBlue.html Footer_LightBlue.html 54 18 4 0 Home_LightBlue.html Light Blue Professional 1 ED4A063B-7E7F-4F99-84C5-38253A6716B8 1520149495 xgc15 1520149497 xgc15 新宋体 10 1 4 423 106 15 0 5FD2649D-D025-44D9-849C-A1CE18FA290C 1520149495 xgc15 1520149497 xgc15 Microsoft Sans Serif 10 4 0 FFBC2925-6524-415C-A652-1BEDC3A64589 Section_2 0 1520149497 xgc15 160EB092-2F96-4235-852F-052B990C5A86 %_HOME%\Resource Files\Report Templates\pdmlisus.rtp 1 TEMPLATE PDM %MODULE% %MODELNAME% Physical Data Model Base_Table 0 %APPNAME% %DATE% Page %PAGE% 页脚 0 ((800,899), (1100,899)) ((549,508), (660,635)) (20998, 29698) F9F79E38-28E3-4617-9A9C-8B955325C02D 1520149496 xgc15 1520149497 xgc15 1 TBLCTS PDM 40EEB912-B8AF-4CE6-93C1-C6685AE978BE 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 218FDEDC-9FCD-4822-A1C5-C71823A98DD8 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 1 0DBDC4C5-01A1-479A-A142-8CFE6F1104D2 1520149496 xgc15 1520149497 xgc15 19098 3 ED3F28CB-F509-4A7E-BB15-C94A36249001 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 350 1 F7E1A1E7-4D51-43A8-BDD2-619C0DB9A57F 1520149496 xgc15 1520149497 xgc15 19098 3 BC03143A-EDAA-4DF9-8398-3F43467F3318 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 700 1 E80B597D-51EA-4191-BC43-36CD0A13C234 1520149496 xgc15 1520149497 xgc15 19098 3 18E9BC3D-5E33-437D-BECB-81ACDF6F393E 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 1050 1 EC511B19-70C8-4A91-AEFA-6085C2266CC5 1520149496 xgc15 1520149497 xgc15 19098 3 B8220C6B-4F2C-4250-8327-1B9E7E76A92C 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 1400 1 C5F36A79-FBAB-4774-AD0E-656A40FBDC5E 1520149496 xgc15 1520149497 xgc15 19098 3 480E378E-B0C8-4D74-A8A0-C66AFE12691B 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 1750 1 424A128C-0847-4039-81B4-C959E4793696 1520149496 xgc15 1520149497 xgc15 19098 3 2D35F0B7-6DB1-4564-AA58-1D01B7132AEE 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 2100 1 81641C03-935E-48A9-919B-FA440AADC816 1520149496 xgc15 1520149497 xgc15 19098 3 764BB5CD-FE99-4BC1-9863-F906078533EF 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 2450 1 08C19F04-DB05-4894-850B-5CB72C7C6C7D 1520149496 xgc15 1520149497 xgc15 19098 3 FDEB6F58-4FB8-4B3E-A35D-63C2304B791B 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 2800 1 2FAD6409-8014-40D3-A745-F25A6FA925F8 1520149496 xgc15 1520149497 xgc15 19098 3 7A4D3D48-0546-49E2-B3EC-7EFD22832873 1520149496 xgc15 1520149497 xgc15 1 1 TITLE PDM PDM Diagrams 29B66374-1AD4-4F1A-9BF9-E319DC2C3AFE 1520149496 xgc15 1520149497 xgc15 1 1 TITLE PDM Model level diagrams DF0766D7-D10F-4D06-B8F2-06F5E5566F2E 1520149496 xgc15 1520149497 xgc15 1 1 PDM_DIAG_TITLE PDM Diagram %ITEM% Diagram %ITEM% Diagram %ITEM% 88BA66A9-24BE-4DBD-85F1-C41407337C62 1520149496 xgc15 1520149497 xgc15 1 PDM_GRAPHIC PDM 1 1 98A7C42D-0009-4E7B-8E3D-6F89E77A2582 1520149496 xgc15 1520149497 xgc15 Matrix Item Font Name 22959464 21916 1 353 106 8EF200B5-7A06-4EF0-A88A-F6649EF4858A 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 EEAB3EE5-70AF-4201-BE5E-52B0EFAD2211 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 423 106 037949C7-40AD-4638-A966-85F7A8E95C99 1520149496 xgc15 1520149497 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% Package diagrams %ITEM% 1 1F856387-1C56-488A-923D-9AFE53F21EC8 1520149496 xgc15 1520149497 xgc15 1 1 PDM_DIAG_TITLE PDM Diagram %ITEM% Diagram %ITEM% Diagram %ITEM% 85CC6CE2-2365-4438-8AFB-2F497332AC2E 1520149496 xgc15 1520149497 xgc15 1 PDM_GRAPHIC PDM 1 1 5157F4EC-D138-4536-AB9A-F0706FDDFE81 1520149496 xgc15 1520149497 xgc15 Matrix Item Font Name 22959464 21916 1 353 106 C990BDE3-E7FE-4D91-A006-49FFA5AF3FE6 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 ED58E901-E79E-451A-B139-F696218DEE59 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 075C0DF1-8E6E-48F6-94C5-6DC5255245F0 1520149496 xgc15 1520149497 xgc15 1 PAGEBREAK PDM A2A74FA4-E86E-426D-BF16-E60829541058 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 423 106 80F1E3FF-D459-4031-B634-6B3D26CCDB65 1520149496 xgc15 1520149497 xgc15 1 1 TITLE PDM Model level object lists FA324AB2-623A-4E5B-9CD5-98DE295556C7 1520149496 xgc15 1520149497 xgc15 1 1 TITLE PDM Common Objects 90B3D039-0AA7-448A-B06C-5BD85E663B36 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_RULE_LIST PDM Business rule list Business rule list Business rule list 1 -40 Name -40 Code -20 Type 88C19E6B-61E8-44B3-90DF-2AC648514B12 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 E5600D25-8658-4B91-809E-31EEE6CC1C55 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 ADE288DB-BF8D-4774-9B5E-E48A9428954F 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 CF82F85D-886F-4AC6-9DF9-61315145D6AC 1520149496 xgc15 1520149497 xgc15 CD48F697-7435-4EAF-823E-C973298EA3CA 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_DTSC_LIST PDM Data source list Data source list Data source list 1 -50 Name -50 Code 86B8A807-50DC-4247-8562-D34F2F32E5DC 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 FB0DF24D-3B01-4EBC-91AF-A83C8F79CD55 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 F21C5159-23EB-47F8-A45F-E00A0A90B37B 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 61DB9ACA-D71B-41BC-8185-AC2C797BBF0F 1520149496 xgc15 1520149497 xgc15 AB9B7A62-A422-436E-9E33-D959E90C8624 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_DIAG_LIST PDM Diagram list Diagram list Diagram list 1 -33 Name -33 Code 407C28DF-9B12-4EF6-83AD-B1AE657B191A 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 6FDA484D-28B1-4D3B-811D-457A3A53DBF9 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 215E0F6D-155D-4592-BE24-AF22EA5B1FDB 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 B897B633-7CB3-422B-AF3B-0617DFE57F84 1520149496 xgc15 1520149497 xgc15 AB56B6DD-E593-463F-9F60-677D80C99306 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_EXA_LIST PDM Extended Attribute list Extended Attribute list Extended Attribute list 1 -30 Name -20 DataType -20 Value -30 TargetName 2108054D-9629-4DD1-888D-0844D6C32B98 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 04D4DF40-BE0A-43C4-96EE-8B0EE8D46CE3 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6B4CCB05-3B32-4643-858A-9278BC1A14E6 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 2E55059D-A854-47F9-B3B9-6CBBED381AEE 1520149496 xgc15 1520149497 xgc15 6AB2BE27-4FE0-4215-9771-51B1B6B505D1 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_FILE_LIST PDM Files list Files list Files list 1 -40 Name -40 Location -20 LocationType 0B38971A-0166-44F4-BBD2-DCE33A004AC4 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 951E4E30-403E-4A28-921F-867D66CFB8CB 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 E96C4FDC-076C-4C53-B4B7-A43582C9D25B 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 2014F810-5737-485F-A9A9-3CC084AE73ED 1520149496 xgc15 1520149497 xgc15 FAFAE5A6-E037-44D6-9503-CA8DE8F78D99 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_PCKG_LIST PDM Package list Package list Package list 1 -33 Name -33 Code -33 UseParentNamespace D9F1E1F2-4734-4D78-825A-02288A5B3CCC 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 9509A674-CA95-4BF5-8407-BEFEE484955C 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 FA3ACCB7-3606-4153-A4E6-49DB3FE6FC99 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 E0A45DEC-D3C1-499D-81F6-3841770BEF5D 1520149496 xgc15 1520149497 xgc15 642F9043-0770-41EF-8C21-298D255824C6 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 423 106 0 EFB38B8D-BD7E-4427-9018-1A7508BBE912 1520149496 xgc15 1520149497 xgc15 1 1 TITLE PDM Physical diagrams objects 9F757AD2-A957-422E-B37A-D7AFBC03197E 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_ADTS_LIST PDM Abstract Data Type list Abstract Data Type list Abstract Data Type list 1 -50 Name -50 Code AAB26D64-130E-4601-861F-FE1123974020 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 5E282C61-D8E3-4173-B8E2-29562E51B92E 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 70057B56-1F00-444C-B0B0-0DE66FBB6A72 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 7CB9D3D8-7782-4B26-936C-40DA7CE198E0 1520149496 xgc15 1520149497 xgc15 2E12C9F5-21FF-47F6-A2ED-699279B5D562 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TABL_COLN_LIST PDM Table columns list Table columns list Table columns list 1 -50 Name -50 Code D66A22B0-1FF4-4B52-B573-0E32472D5285 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 28BDFCCA-DA02-4787-B288-809ED136EF7F 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 E8983B83-BE61-4BC7-BD08-BEC6C456489C 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 CC690E77-B595-4664-AECD-3FED31673B80 1520149496 xgc15 1520149497 xgc15 F181256F-9FC6-4911-8E81-89BA8E9CA4BF 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_DOMN_LIST PDM Domain list Domain list Domain list 1 -30 Name -30 Code -30 DataType -10 Mandatory A4825872-CF65-4F6B-A588-48735AB54271 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 06C0A45A-EE01-406C-995A-B3D29DCE5CD2 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 E8F0BF0C-DE68-49B4-A4E0-F4CB5FC930B6 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 90869955-5FE1-42D1-B585-38CEB2904193 1520149496 xgc15 1520149497 xgc15 D16AA53E-CA81-4B36-8F08-625D8B6BEE1D 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TABL_INDX_LIST PDM Table indexes list Table indexes list Table indexes list 1 -33 Name -33 Code 15 Unique 15 Clustered 15 Primary 15 ForeignKey 15 AlternateKey -33 Table A4C8C0E9-64F9-493E-89D8-575322E003CD 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 90A25FC4-3633-4BFE-B70E-FC6B5F31A1DF 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 5B3631C5-26C0-428C-97A9-FD46D9E553E5 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 A1285305-68DD-4E0F-803D-E7D399F9AC34 1520149496 xgc15 1520149497 xgc15 5988BD0A-A3BB-4D61-90BD-3EF28A2F1006 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_JIDX_LIST PDM Join Index list Join Index list Join Index list 1 -50 Name -50 Code D7D79E31-C8FC-447E-AA6A-477436063D2A 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 3B1963E4-4149-4FBC-AC5B-C74C68E3230E 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A5A25456-1616-409C-BCE6-1199472DB38A 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 19EE7884-F714-4275-A14C-61A2286089BD 1520149496 xgc15 1520149497 xgc15 C59F3546-495C-414F-B24B-17B59301D824 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TABL_KEY_LIST PDM Table keys list Table keys list Table keys list 1 -33 Name -33 Code -33 Table 4985B483-5895-41CB-9F61-CB2E60AFD176 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 836CF97E-527E-4D8B-8510-444DA9CE8B31 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 44748ADF-25DB-496C-933E-6D02B208FD94 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 5DDD7C02-AEC3-4BFB-A82D-DB0F907E5C21 1520149496 xgc15 1520149497 xgc15 72840013-E183-4B32-A3B9-01C8308EBEB0 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_PROC_LIST PDM Procedure list Procedure list Procedure list 1 -50 Name -50 Code C3C6425F-F88A-4CE5-AF0D-288819FFD748 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 4C7A8A94-F4B1-41B9-A95A-AA6B15F422A2 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6622B91A-CAB3-4A64-9B6A-016FA01F3024 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 49DC409D-A214-4E71-A907-D720CD97961D 1520149496 xgc15 1520149497 xgc15 6F92CE7F-76FF-416E-AAE2-9AD23E671587 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_REFR_LIST PDM Reference list Reference list Reference list 1 -25 Name -25 Code -25 ParentTable -25 ChildTable 9061AD08-B056-4BB7-8DC9-3CDF2899AF4A 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 CFC411DD-0A3C-4A2A-A12C-5E712BBD784D 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 DDBCF174-503E-4EFB-AF77-84CD4087B6D7 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 F0808275-81B1-4DA9-840E-9CED709651D7 1520149496 xgc15 1520149497 xgc15 9834E06F-2C1B-45E0-AE7B-F12C9146F654 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_SQNC_LIST PDM Sequence list Sequence list Sequence list 1 -50 Name -50 Code 4903B7FA-CD53-4E6C-AB91-91858322ADBD 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 106AA283-AA9A-4E36-8E77-D58B379640B2 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 83348A6A-A0D6-4A26-BED6-3CB853AEFF43 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 CF2894F1-89EC-4CC9-9492-F8A1E6967757 1520149496 xgc15 1520149497 xgc15 A47AC216-6752-4053-B0E2-3D34F97B61C1 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_STOR_LIST PDM Storage list Storage list Storage list 1 -50 Name -50 Code 2AFC6A50-ED84-42FB-9A93-0CB41F8E59BC 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 6D3F616B-E34F-43B8-8C66-B7F8DEA1079B 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 74C88232-7F00-4B37-9BBB-3754B8AE88CB 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 1BD9CD69-26C3-4581-A33E-1657396C129D 1520149496 xgc15 1520149497 xgc15 D7A04E4F-FFBB-49D4-9BA0-5DD9E917ED2E 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TABL_LIST PDM Table list Table list Table list 1 -50 Name -50 Code C3F17EED-5B9C-42FB-A60D-09B5D66CFF61 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 15F6A22D-199E-4FD4-89D1-8673766E72A2 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B056A8FC-6CAA-49DC-9260-F7B6E7A0798B 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 76D42706-E600-4531-AF6F-C9A7854FE4AE 1520149496 xgc15 1520149497 xgc15 6417AEDC-573D-4ED1-B398-C69FB4889BFD 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TSPC_LIST PDM Tablespace list Tablespace list Tablespace list 1 -50 Name -50 Code E01D5D0D-A09D-4D38-87EA-ACCEC3DF6567 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 E47C8655-2350-442E-AE98-863C68C5E6C3 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 452FEB0B-5FB6-45E8-B8CF-96362E8FCAD9 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 B6399366-D6EC-4D8D-967A-3FCB79357F16 1520149496 xgc15 1520149497 xgc15 78E6DC04-FB50-4384-BC60-C92BF0DD84BB 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_PROF_LIST PDM Test Data Profile list Test Data Profile list Test Data Profile list 1 -50 Name -50 Code 196674BE-C21D-4E8F-BE97-4B9B62CDCEDA 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 3C76A28B-229E-4EFF-A349-2511CD4D9E8B 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C4F907DD-1EA9-4A2C-AC75-636FE6650F1E 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 ADD96F7F-774B-4695-8C3C-5A9CB5D796B1 1520149496 xgc15 1520149497 xgc15 EBD91015-9B34-4FF3-87E6-CED9DF7F2314 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TABL_TRGR_LIST PDM Table triggers list Table triggers list Table triggers list 1 -50 Name -50 Code 5DF08AE7-66C5-4660-BA94-E4E2803F378F 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 DE4A18F4-64EC-4B17-B8F1-6C110EE2A9FB 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 4001424D-0924-4A33-BF43-FB1165943857 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 5C7E3A6C-770D-4C28-89FD-88B133D38086 1520149496 xgc15 1520149497 xgc15 F6E85A28-BC8D-479E-8E49-CFE2FE9C9952 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TRGI_LIST PDM Trigger item list Trigger item list Trigger item list 1 -50 Name -50 Code EEC643C5-3C20-4034-96D0-172C06AC21B1 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 490CF6F8-8295-4EF8-9457-7372CFADB642 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3A5BE0FC-2F52-4D9B-A700-3D8690D20BAA 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 231F89DB-CA6E-4AA7-90DF-A16C4A478AB4 1520149496 xgc15 1520149497 xgc15 E9496891-303E-4531-8762-645997BD955C 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TRGT_LIST PDM Trigger template list Trigger template list Trigger template list 1 -50 Name -50 Code 5C3BC8FE-5180-4D03-A5AB-4B7C99D52522 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 BE8678DC-7CAB-41E3-9242-F9C2FD780227 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 0DDA92F3-1406-4494-B349-30E86E31061A 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 C0E9FE1E-DACC-4A64-951A-57DAF9EEF4AE 1520149496 xgc15 1520149497 xgc15 586080EA-2F6C-4F21-8FFF-B39FD7313F40 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_USER_LIST PDM User list User list User list 1 -50 Name -50 Code DB3A9E9E-3D0D-4A3A-9194-BB94F0C68AFC 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 C830AE94-B223-466D-9A5F-A04E4C7221BE 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 5584292D-4EB1-4A4F-9527-92A076553F14 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 852CDC8C-AC23-4214-BDD3-7252FEF8C1A5 1520149496 xgc15 1520149497 xgc15 10D30C51-AE65-4DD7-9787-E5D0802F476C 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_VIEW_LIST PDM View list View list View list 1 -50 Name -50 Code 393BBBD9-FCCF-4E08-AFEB-847276FBCB8D 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 5E53B308-D5C6-4F86-889C-DC40CBFA9F05 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D370E5AE-C8A1-4793-835C-0135378771A0 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 8B4981A3-F77B-464D-B900-3322DF5F2F20 1520149496 xgc15 1520149497 xgc15 2D8A955B-4DC9-4DA8-8556-1792F21A2241 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_VREF_LIST PDM View reference list View reference list View reference list 1 -25 Name -25 Code -25 TableView1 -25 TableView2 97C2D6A6-68C3-411D-A9C6-D36F5EC92AC0 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 A0F2C53A-2F60-4BE1-B89C-9F2672431DC9 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 9277301A-BA8B-4D95-8F7C-79EEE04C0497 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 E523491F-DC2C-4961-8E5E-0EB33E0C951B 1520149496 xgc15 1520149497 xgc15 AC570887-FCC8-49DE-919B-BD72C2DAB1B5 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_SYNM_LIST PDM Synonym list Synonym list Synonym list 1 -50 Name -50 Code FF99541A-C89E-4D03-ACCC-74024D2DA85D 1520149496 xgc15 1520149497 xgc15 Arial 10 5 353 106 0 01A71129-22DB-4008-946C-36FB6594254E 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 4 1 1 8FD28E5C-9F1B-4A58-951A-F2C2B30BBCF6 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 1 EC5F31D0-5A7F-4459-966E-5F387B2DBEC4 1520149496 xgc15 1520149497 xgc15 E16C7389-E91A-4023-BF7D-2FC78B97B77E 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 423 106 0 EA9AB69E-3EA8-4296-9809-758DCF17BB81 1520149496 xgc15 1520149497 xgc15 1 1 TITLE PDM Multi-dimensional Diagrams Objects 3DC0FCEF-572A-4791-862D-CBB37C9032A1 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_ASSC_LIST PDM Association list Association list Association list 1 148EB118-A69D-4D23-939A-2C192EB103A6 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 D85C0DFD-317D-4A60-A4E8-81E19AD1B62D 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 87D8C006-67E9-493F-94AA-0B4E64F90E0F 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 D728DF62-4800-487F-AF3D-A4A634D49B12 1520149496 xgc15 1520149497 xgc15 0189D4FA-33FF-4008-B329-7D7153E3796A 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_DIMN_LIST PDM Dimension list Dimension list Dimension list 1 -50 Name -50 Code A8EDD111-D277-46CE-96BA-F5EB1F9E46FF 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 DF264266-4159-46A8-BBE0-51E142048EC8 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 1F5AB017-AF24-4046-8078-09E9C8D05E52 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 3D59DADC-0193-4F45-92B8-3E7DBDE079B8 1520149496 xgc15 1520149497 xgc15 DCE81E8D-083C-4555-A83B-C50AAD2346CD 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_FACT_LIST PDM Fact list Fact list Fact list 1 -50 Name -50 Code 50C7F090-4F72-47F6-A9C0-EE75186F1F48 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 53F2D8A5-87B0-4B3E-8B94-46926B992609 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 CAC4A7A0-8CFA-4F58-97F9-2A8324F51E03 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 62AA9602-11A6-4AB3-B264-919E76BD91F0 1520149496 xgc15 1520149497 xgc15 B85BD691-3AB9-4258-B128-433DD24FC034 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 423 106 0 62803459-4703-49FA-AF58-617ED84809F7 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 423 106 8D1DB920-0D73-4012-8CA8-C06E8B74154C 1520149496 xgc15 1520149497 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% List of objects for package %ITEM% 1 Packages 1BF2BAD1-457A-49DA-AAFE-02BFC3B17B6B 1520149496 xgc15 1520149497 xgc15 1 1 TITLE PDM Common Objects E068B853-5C25-4864-82E8-7D55865A1743 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_DIAG_LIST PDM Diagram list Diagram list Diagram list 1 -33 Name -33 Code 5BE6E8CA-6D24-41DB-A35F-7BC708683AAA 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 12F40770-53E9-40AA-BFA8-4B477D78BE61 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6E73E5AA-349E-45D0-8132-337731FA3D9C 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 E11BF1FD-5C26-489A-B254-1CA1DE31E568 1520149496 xgc15 1520149497 xgc15 6BEE9A58-0052-4D49-82BB-3C166297DC1F 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_EXA_LIST PDM Extended Attribute list Extended Attribute list Extended Attribute list 1 -30 Name -20 DataType -20 Value -30 TargetName B26764B5-A90B-4B51-A2BB-D80D1D0A73F9 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 11306E20-A717-452E-A2DA-4E71383EFD57 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 59AE33F9-C4B2-4F1C-9C49-F141660E8BA5 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 97DFBFA3-C9F0-42B3-A6FD-0AA27B0AD417 1520149496 xgc15 1520149497 xgc15 9AF3FFDA-B6A3-4840-A526-4688EE5DD809 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_FILE_LIST PDM Files list Files list Files list 1 -40 Name -40 Location -20 LocationType C2402FF9-DC9A-48E2-BFB6-412140ECF5E7 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 2B4C5310-4B65-4FF9-8A0E-2000B4E87AC7 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A29693AE-636A-4174-A893-5583F7E67C59 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 30AE3C99-F130-458E-9824-43E2337E34CA 1520149496 xgc15 1520149497 xgc15 F6A34BCF-5292-48A5-8F00-7FCC3E2BE7C5 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_PCKG_LIST PDM Package list Package list Package list 1 -33 Name -33 Code -33 UseParentNamespace CBE176E5-C22B-47AC-8639-F5D1D2F4E241 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 A580748F-B8D8-4F86-830B-BD082DF66879 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3100F148-35BB-461B-A00C-344712459EAC 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 D6E5CB8A-B22F-45D9-96A5-6D830D93041D 1520149496 xgc15 1520149497 xgc15 367682E9-1D33-4711-9B69-07B5D74B12D6 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 423 106 0 1B409040-4B10-4F25-B4BD-D7851DFEC6D6 1520149496 xgc15 1520149497 xgc15 1 1 TITLE PDM Physical diagrams objects 45B25234-46AE-46F1-8348-C0699162764F 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TABL_COLN_LIST PDM Table columns list Table columns list Table columns list 1 -50 Name -50 Code 6AAD05E9-E426-43EC-900C-36510AB33C2C 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 E1AE1755-E077-4719-A0EF-4CDC3EBBCA1F 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 BC5CC5E4-F825-4804-954E-B2315C9BDD26 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 4EC4AB9D-CE58-4CA9-8E2E-637E97B806D3 1520149496 xgc15 1520149497 xgc15 27BB022F-5457-4885-BD88-3A1CDFF6F1F1 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_DOMN_LIST PDM Domain list Domain list Domain list 1 -30 Name -30 Code -30 DataType -10 Mandatory 55FE3945-40FC-48CA-A67D-7149C2107289 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 85101D4F-AE1A-4E47-A31A-4D064B72F32E 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 97981568-471F-4CFB-ACBE-C0B14F2AD79F 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 8C081921-92DF-4585-B67F-E9D19F9EE369 1520149496 xgc15 1520149497 xgc15 0DED0B38-F070-44A1-A308-30FCBB909FBA 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TABL_INDX_LIST PDM Table indexes list Table indexes list Table indexes list 1 -33 Name -33 Code 15 Unique 15 Clustered 15 Primary 15 ForeignKey 15 AlternateKey -33 Table 52913CC5-C848-4CD7-9D35-A970CF819EC4 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 C3361B61-31B8-49AD-8D23-F2D1F42ECDDB 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 EFC7CF2E-F1B6-4A67-9975-6906D09DA219 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 C3B7D879-B2B0-419E-B7E5-FD9F3051DD4C 1520149496 xgc15 1520149497 xgc15 99ED0365-26F7-4509-A96C-0AFD7724FA1C 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_JIDX_LIST PDM Join Index list Join Index list Join Index list 1 -50 Name -50 Code 6124EF3D-5768-4D48-A32A-C5857CADCC56 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 704D19BE-34B7-45E4-BA9F-F13203444FE0 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 BF47D311-582B-4683-B0A7-182599DFF42E 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 C361E965-0F04-4B96-AE6F-3ADB332CBFB5 1520149496 xgc15 1520149497 xgc15 407992C7-1383-4005-8B06-4954F5EFBB0B 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TABL_KEY_LIST PDM Table keys list Table keys list Table keys list 1 -33 Name -33 Code -33 Table 955C5E1B-F72F-4044-86E9-5E5FEB17B218 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 312FAD0F-ADEE-453C-95E6-8F579F7B38F1 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B841B080-7AA6-4405-B36A-DB580D04E420 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 80D21733-B65D-480F-8070-6CC77D29CC8E 1520149496 xgc15 1520149497 xgc15 DC548DCE-986A-4B44-9EB0-8F50ADC1425C 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_PROC_LIST PDM Procedure list Procedure list Procedure list 1 -50 Name -50 Code 8025D245-EAD2-4709-A095-ADB5A8E1AABC 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 415B6BA2-59EE-48AA-88FB-A69D23A8698D 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 4D79772D-1700-4B93-8AD4-7020E203EAEF 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 A5C46895-F0E8-4394-9CD6-B25463F832BB 1520149496 xgc15 1520149497 xgc15 B73B7533-FAB7-48CB-AD65-1B2FC068207C 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_REFR_LIST PDM Reference list Reference list Reference list 1 -25 Name -25 Code -25 ParentTable -25 ChildTable F577F35B-3EA4-4B8F-9B6B-A09E8698E6AA 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 B1A114D2-3591-456E-9320-F5B2C5444F4E 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C704840B-597C-4F0C-8233-13DA317028BF 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 4B1EBC99-4F3C-401E-A6C9-DB92B0826F92 1520149496 xgc15 1520149497 xgc15 5004F9E1-F6E2-4DA6-A117-C9577CD5DE1B 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_SQNC_LIST PDM Sequence list Sequence list Sequence list 1 -50 Name -50 Code 244D7952-1B38-46D3-9130-2C243C93BD0C 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 24483DDE-898C-4D30-96D3-0E898681C457 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 4DB60015-AE6C-4773-B408-65D8820AF9BD 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 B0CB0EC8-5371-4001-8658-4CEF72A973D7 1520149496 xgc15 1520149497 xgc15 5162132B-381C-480C-86F5-9034C8575D13 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_STOR_LIST PDM Storage list Storage list Storage list 1 -50 Name -50 Code 843119B8-7E65-440C-833B-09D120AD5190 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 3BACADB3-76D0-4036-A760-6D57704C978B 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 137B4D1D-9110-4E07-8123-D7D9475F26E8 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 1E6858AC-B3A7-4DD2-84AC-073ACC0144C1 1520149496 xgc15 1520149497 xgc15 17153433-2A8C-40F3-A27A-8DF1928728FC 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TABL_LIST PDM Table list Table list Table list 1 -50 Name -50 Code 195AF5B8-56F8-4DA3-88E2-FE84A2D3EAC9 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 77F7BD5F-CC97-4BDB-B637-11826A2B154F 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 600FAE2C-CE3E-4E7F-8068-88E886C2A11E 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 67F9DF9D-3292-47A0-9D31-F4316AA793EA 1520149496 xgc15 1520149497 xgc15 FED0C525-DA79-4764-B5BB-099066044820 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TSPC_LIST PDM Tablespace list Tablespace list Tablespace list 1 -50 Name -50 Code 77152889-0A1C-4D1A-AFED-C218F1B53192 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 02AD7522-F990-48DF-84F1-A4D4635A26A6 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 403C84D0-DA71-444A-AFD7-A3C8125F6067 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 A62850F4-ABCA-4B39-BEA5-368F9AB56013 1520149496 xgc15 1520149497 xgc15 201AEF9D-C2F0-4317-9B8F-7E38CC44FC0F 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_PROF_LIST PDM Test Data Profile list Test Data Profile list Test Data Profile list 1 -50 Name -50 Code 9AE0287F-6872-43DC-94C5-B46474CFCFB4 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 E84716C9-51FE-4AA9-85BE-30F5639D443A 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 71074C48-1B2B-4FE1-860D-EB80A08A032B 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 88D41643-1026-40E6-AA9C-C67C1D424554 1520149496 xgc15 1520149497 xgc15 D2E7E618-E715-4294-809C-1AF76A4E833F 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_TABL_TRGR_LIST PDM Table triggers list Table triggers list Table triggers list 1 -50 Name -50 Code F12F8F6F-0C7D-409B-A78E-C534C46AE1F1 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 EC2681B6-A634-41FE-911A-1BCB3D380D0B 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 0980C31D-41E4-417B-8649-2DDDFDFE6E94 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 6DB97FCF-3523-4E69-837D-2E3447BD3575 1520149496 xgc15 1520149497 xgc15 43B4BE56-98ED-4B2B-9B74-B011E724FF19 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_USER_LIST PDM User list User list User list 1 -50 Name -50 Code 4A1009A6-922A-431E-B8EC-348FFF19B9EC 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 225F794F-4B28-47A2-9C31-9CB6363FD122 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 865F09B3-E6F4-40BC-A2B2-65AC8A341769 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 42480D90-4BF3-4D6F-AD48-6E72D347D68F 1520149496 xgc15 1520149497 xgc15 2737F188-F4D6-47AB-91D3-B116B8253485 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_VIEW_LIST PDM View list View list View list 1 -50 Name -50 Code 4362422A-2C4C-4EAF-99E6-31DF21D49A4D 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 520711F4-1A64-425E-A48E-8447E7775B71 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C645B297-580F-482F-B286-55C06DC1C561 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 B0DD7F83-3FFB-4731-AE15-C65801BEED17 1520149496 xgc15 1520149497 xgc15 3AF0F697-AD67-4960-B16C-DF4CEC78901F 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_VREF_LIST PDM View reference list View reference list View reference list 1 -25 Name -25 Code -25 TableView1 -25 TableView2 4766C55C-4222-4025-A18D-067644EB5F5D 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 B7B19525-9ECF-4675-A840-D4BF3D3397CA 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2066D0FD-9167-48A7-88F0-40E9C8AACC72 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 01FF6129-7948-4582-81D3-DA4E2A3B1201 1520149496 xgc15 1520149497 xgc15 B31D914C-44DD-46BE-B03D-54C4AED4929B 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_SYNM_LIST PDM Synonym list Synonym list Synonym list 1 -50 Name -50 Code 115D0CE7-5462-4674-B34D-33A1AAC6DB88 1520149496 xgc15 1520149497 xgc15 Arial 10 5 353 106 0 F4E25E38-52DB-4B2A-BFEF-503DE0288DB4 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 4 1 1 DFA18026-CF1E-4B09-889E-36B7874516C2 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 1 AE6FF5D4-A600-42E4-BC99-FE7C135A13D3 1520149496 xgc15 1520149497 xgc15 2C87FA4F-368A-455C-AE1C-4F7D892F7998 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 423 106 0 D6F264B3-35E3-4A87-9400-A750DEBBD621 1520149496 xgc15 1520149497 xgc15 1 1 TITLE PDM Multi-dimensional Diagrams Objects 75EC114A-E0C5-48B6-8FAD-9F6B6174FF59 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_ASSC_LIST PDM Association list Association list Association list 1 562884E0-F5DC-4A41-8984-EE625C113384 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 0004D8F8-4893-4FAA-B0BC-0D7C0E69DA62 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 50AB6598-B1B5-4CB5-A654-014AD7E70DBA 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 C1B8F26C-C012-46BD-BD06-C99A6D4EB37B 1520149496 xgc15 1520149497 xgc15 A449670D-F595-4382-A536-E27FC5DAA8CE 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_DIMN_LIST PDM Dimension list Dimension list Dimension list 1 -50 Name -50 Code 749BC330-A467-4EB5-AD0F-46E2EDE8B99A 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 7B9842D4-6942-4FCC-9DB2-283AC11E0462 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 83713DB5-754B-4C21-BD2F-B4FA8CF033A5 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 0023AD04-9543-4983-B466-FC8DB5DDF51E 1520149496 xgc15 1520149497 xgc15 B3488065-601B-4B68-B2E3-4309A9C71A9D 1520149496 xgc15 1520149497 xgc15 1 1 PDM_MODEL_FACT_LIST PDM Fact list Fact list Fact list 1 -50 Name -50 Code BE60F350-A281-48A7-84F7-8E9698FB66B3 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 0 CCE7BB1D-0C80-4CB6-B9F9-C5DF22001878 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C1BEDF02-AFBC-434D-A114-681818A415E0 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 15 18 1 18 03097897-528C-4155-BC95-E98B454988F1 1520149496 xgc15 1520149497 xgc15 D10461AA-08B7-475D-8AE3-A48C49A743EC 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 423 106 0 551DE8AA-5595-428A-98C6-F2F30E94634F 1520149496 xgc15 1520149497 xgc15 Arial 10 5 1 353 106 194ACD4F-488D-4793-A58C-13D65E1F2DFD 1520149508 xgc15 1520150135 xgc15 1 1 PDM_MODEL_TABL_COLN_LIST PDM List of table columns List of table columns List of table columns 1 -20 Code -20 DataType -10 Length -30 Comment -10 Mandatory -10 Primary 52AA829F-9213-4725-A1B6-1DB24AFEE2F4 Column selection 1520149549 xgc15 1520149549 xgc15 6 Code 1 0 Comment 1 0 DataType 1 0 Mandatory 1 0 Primary 1 0 C91551EB-40E2-41A5-B0FB-ED44CC732684 1520149508 xgc15 1520149508 xgc15 新宋体 10 5 353 106 0 F718BEBC-C860-4FA5-8372-676E17D68976 1520149508 xgc15 1520149508 xgc15 Microsoft Sans Serif 10 2 4 1 1 E5C5213A-EA16-4EAA-A0C6-EF766E5C896B 1520149508 xgc15 1520149508 xgc15 Microsoft Sans Serif 10 1 1 422081C4-7B90-45B4-A506-E888688E6D0A 1520149508 xgc15 1520149508 xgc15 9C82A7E1-75DB-4F1F-BCDB-001411F973FB 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_TITLE PDM Table %ITEM% Table %ITEM% Table %ITEM% Tables DA440AF5-6849-44F1-830A-9DFCEB585474 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_CARD PDM Card of table %ITEM% Card of table %ITEM% Card of table %ITEM% Name Code 6DA2B8A2-84A3-41A1-ACEE-9A564F8F83D5 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 2 0 6069942D-774D-4F1C-8BA4-6901A888FE8D 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 1 2 1 F6F18B29-EF03-4951-BD24-9B66AD87EF5A 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 2 1 871361B9-21B3-40E0-BA6B-7B2347A415AF 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_EXA_LIST PDM List of extended attributes of the table %PARENT% List of extended attributes of the table %PARENT% List of extended attributes of the table %PARENT% 1 -30 LabelOrName -20 DataType -20 Value -30 TargetName 8BD2709F-A12D-45BC-9FF8-16F84E9315E6 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 BC14158C-A0E4-44C7-A26C-1AA339901DF6 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 3936A72B-E67D-4641-9B7B-6BB4D51886B5 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 B639EC3C-F607-4DD8-9BB4-9D7E2F407567 1520150527 xgc15 1520150527 xgc15 F402232A-5472-496C-AE49-3C81887F8246 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_DESC PDM Description of the table %ITEM% Description of the table %ITEM% Description of the table %ITEM% 2B3E1084-8DA9-45A4-9CEB-A43731381091 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 8C23EF83-C10C-4D6E-9595-F1CC6653F2D2 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 C6682653-B9E6-411D-961B-62A6F78DC67F 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_NOTE PDM Annotation of the table %ITEM% Annotation of the table %ITEM% Annotation of the table %ITEM% 43C90576-EFD6-4E16-A417-84CBAA862915 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 FD6414A9-A0DB-4B9C-A04F-83134AA98561 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 E3ED7343-535C-4910-8D0C-AFEF397598F4 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_PREV PDM Code preview of the table %ITEM% Code preview of the table %ITEM% Code preview of the table %ITEM% 1A81A5BC-ADCD-41CC-A6AB-AFA822830737 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 7C71A701-464F-4B3F-862E-86459E865012 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 288EAD4B-B97A-485B-BF29-BAE6C9C260BA 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_HEAD PDM Begin script of the table %ITEM% Begin script of the table %ITEM% Begin script of the table %ITEM% 102D8011-E6D4-4E7A-9309-98E26C262747 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 FC174946-D246-46F5-B32D-96CB27CC619F 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 661E99F6-DF3A-475B-9E55-6F45DFFC07C2 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_FOOT PDM End script of the table %ITEM% End script of the table %ITEM% End script of the table %ITEM% BC235232-615E-4104-9E62-6DD42E042B79 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 ED035AE7-F510-41FB-8A1F-0771D26B3088 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 024340B9-9E7A-40A1-8626-D00AA43CD44D 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_CRUL PDM Client validation rule of the table %ITEM% Client validation rule of the table %ITEM% Client validation rule of the table %ITEM% A4860464-87FD-46C3-A97F-80ABFCA8A73C 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 713B3B33-57BF-477A-889A-4A67501B6CEE 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 0324C0F8-87FA-4023-AB01-8E08EC5095A9 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_SRUL PDM Server validation rule of the table %ITEM% Server validation rule of the table %ITEM% Server validation rule of the table %ITEM% BCFAFB38-BA80-4A38-9365-58A99E5A0DA9 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 72B3FA35-BF09-4E05-B9A6-5F1761DB36D0 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 12B334FB-C8E1-4351-8B02-C0E804AF7765 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_OPTS PDM Options of the table %ITEM% Options of the table %ITEM% Options of the table %ITEM% AAEBFF19-97F4-4CD5-BA61-35952BCE87E3 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 977096DB-5437-4E72-A0B0-BC8975BB4AF5 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 648751CB-FFFB-4E0E-B7DB-30E514E27EB8 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_CKCN PDM Check constraint name of the table %ITEM% Check constraint name of the table %ITEM% Check constraint name of the table %ITEM% B8BD6CDF-9506-40DC-988F-ECFB7DEEEE81 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 24F71063-E84C-4A0F-8AFC-E51B91F5BB23 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 F1D34F01-0FA7-4DA7-AC22-F337D39DB088 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_RELDIAG_LIST PDM List of related diagrams of the table %PARENT% List of related diagrams of the table %PARENT% List of related diagrams of the table %PARENT% 1 -50 Name -50 Code AD47346F-729D-4A65-BFEB-39501840990F 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 9E429393-3364-4B63-8C45-D6C18526A807 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 6170F5A0-7FAC-427A-AB1B-2ED21CD5ABD8 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 DDAFF66B-749F-4B36-99F4-7FED6063BFF4 1520150527 xgc15 1520150527 xgc15 0575511C-51DC-463C-A811-C77C2750D963 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_DIAG_TITLE PDM Related diagram %ITEM% of the table %PARENT% Related diagram %ITEM% of the table %PARENT% Related diagram %ITEM% of the table %PARENT% RelatedDiagrams E31E4441-3574-48E9-B0D4-C8CE290CA853 1520150527 xgc15 1520150527 xgc15 1 PDM_TABL_GRAPHIC PDM 1 1 84 2070C03E-9960-4BB8-8EF5-26049B004B6E 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 4 0 0179EF9B-A0A9-43FA-8BBB-1BE1A9C8E679 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_DIAG_DESC PDM Description of the related diagram %ITEM% of the table %PARENT% Description of the related diagram %ITEM% of the table %PARENT% Description of the related diagram %ITEM% of the table %PARENT% 6F781220-CA8C-46D8-856E-9967E2EA0DAD 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 B7DC955A-920F-4573-9959-E7A23D31E51E 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 B0A955A4-EE16-4025-8929-B46B92317FCE 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_DIAG_NOTE PDM Annotation of the related diagram %ITEM% of the table %PARENT% Annotation of the related diagram %ITEM% of the table %PARENT% Annotation of the related diagram %ITEM% of the table %PARENT% BB7884F9-B027-476C-A15F-3412EBD3B211 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 A2C3E230-3172-44EF-8BA5-300A4A78EE15 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 6FCA3F6E-871A-4769-8D22-86BFCCD0E1C2 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 16CE3263-B657-425D-B67F-6C72549C8B06 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_DEPND_LIST PDM List of all dependencies of the table %PARENT% List of all dependencies of the table %PARENT% List of all dependencies of the table %PARENT% 1 -40 Name -40 Code -20 ClassName 008320E7-7469-48F9-AAD0-B63C3CCB5379 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 9ED7954A-4ED4-48CC-B1EC-9DD189B2F586 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 C77ACA27-FA99-4EF2-B502-065A58B3BFE6 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 01AB6BF5-1F8A-4A9B-830C-8A67A727EC9B 1520150527 xgc15 1520150527 xgc15 FB8A32A2-24FC-44D3-887A-911F07EA0B04 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_OBJRDIAG_LIST PDM List of objects in related diagrams of the table %PARENT% List of objects in related diagrams of the table %PARENT% List of objects in related diagrams of the table %PARENT% 1 -100 ShortDescription 1333A26C-F344-409F-B37D-3D25C7C0B720 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 31B99AF2-A53B-4CF4-AAD7-67D785FEE71A 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 163D9196-D833-453C-81C6-E430430A9132 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 DC78682A-4932-497D-82F2-27F3DDBD552F 1520150527 xgc15 1520150527 xgc15 E0AE2C64-EBB5-4AD9-98DA-73E4D9EB06EB 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_ARTC_LIST PDM List of remote articles of the table %PARENT% List of remote articles of the table %PARENT% List of remote articles of the table %PARENT% 1 -100 ShortDescription D6613AA0-EB1F-4ED6-BF87-FCB089FC49C6 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 7170B15B-1C19-4CB9-BF70-466DD346DE2E 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 B31C1007-07F3-4E92-977A-C8C7F76528EC 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 6E442D98-8BED-4CC6-BE89-AF1D5D190790 1520150527 xgc15 1520150527 xgc15 B41D4EF1-3659-42E0-8940-ECA64F2F1EEA 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_SRCARTC_LIST PDM List of source articles of the table %PARENT% List of source articles of the table %PARENT% List of source articles of the table %PARENT% 1 -100 ShortDescription B58926BF-320B-4632-A169-68F38E82DDCE 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 CE0D2DA5-9C41-47D8-942F-2198D6E6E2F0 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 A4EC3EEF-5B61-4CC3-895C-BFA9605CEA29 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 5E340D38-EAD2-4AFF-BC2A-604FCCCD1468 1520150527 xgc15 1520150527 xgc15 C3D57FFC-DD1F-4F2A-A742-DD9122B2FE79 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_SRCSTEP_LIST PDM List of source steps of the table %PARENT% List of source steps of the table %PARENT% List of source steps of the table %PARENT% 1 -100 ShortDescription B9AFB5BE-3052-475D-B9D1-244DE92DDB96 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 5DF907E6-9D58-4086-A85A-E2CA32F9402D 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 AB39B4AF-D6BE-4104-9B40-57BA9CFAF9F7 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 147865B4-3875-446A-AE02-486497843798 1520150527 xgc15 1520150527 xgc15 E069231D-EC35-4F5C-8063-3E19B9B7C455 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_DSTSTEP_LIST PDM List of target steps of the table %PARENT% List of target steps of the table %PARENT% List of target steps of the table %PARENT% 1 -100 ShortDescription 8D04C3EE-EAD6-4A9B-A5F2-654220A76829 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 B4DF1719-8960-4497-ABE9-F5AAE3BE36F4 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 9CCB5302-591E-4CED-B6A2-227C2F10CBDE 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 6B7A943B-6052-424E-A676-AF780F0071D2 1520150527 xgc15 1520150527 xgc15 1D97F561-F394-4A8E-82AE-1779E7FC4A8D 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_DIAG_LIST PDM List of diagrams containing the table %PARENT% List of diagrams containing the table %PARENT% List of diagrams containing the table %PARENT% 1 -50 Name -50 Code 0CC82FCB-058C-4CAE-BC0D-B897B9830309 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 E0A7E055-987B-495B-972C-89F28160ADF9 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 FFD7362D-0F7A-4CE9-91F8-632439DCA257 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 1A724E9B-E4CE-4691-BA18-99CB9A0B6354 1520150527 xgc15 1520150527 xgc15 4E86A057-2DBD-41E2-AEF2-74C23BFECDA7 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_LIST PDM List of columns of the table %PARENT% List of columns of the table %PARENT% List of columns of the table %PARENT% Columns 1 -50 Name -50 Code 9826DA93-4C6A-40D8-BCFD-C9DA69F9C8BA 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 252E9E4A-DF23-403D-BFBA-540E088CCAFD 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 E360EED1-ADF3-447E-9865-DE210BF0B356 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 8864430D-5672-4CEE-B159-631248A415F9 1520150527 xgc15 1520150527 xgc15 B9502DDC-F986-47AD-9C2D-68C494BE0777 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_GROUP PDM Column %ITEM% of the table %PARENT% Column %ITEM% of the table %PARENT% Column %ITEM% of the table %PARENT% Columns 31475FE0-9F55-4FEB-A988-A81CE8ECE711 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_CARD PDM Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Name Code DataType Mandatory 0E9D3B88-436B-455E-9BBA-98BA1E2262FB 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 2 0 A534A371-92BC-487F-A7D0-0069C17D0CE3 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 1 2 1 3663D5E8-6C31-4E55-A03F-3F0D69D3C1C5 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 2 1 6C929A39-27B0-44D4-AD88-6A8B8A8CE6B6 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_CHECK PDM Check of the column %ITEM% of the table %PARENT% Check of the column %ITEM% of the table %PARENT% Check of the column %ITEM% of the table %PARENT% LowValue HighValue DefaultValue Unit Format CharacterCase CannotModify NoSpace ListOfValues Complete DefaultValueDisplayed 4AFD510E-D42A-4ADC-8BF2-79CD19E5D3B4 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 2 0 12FB52D7-D9E9-467A-85CE-2F556DED457E 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 1 2 1 3F52B5A4-02EE-4CD0-AA46-7FB91CE3138B 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 2 1 1B9E0901-147A-4015-A8D9-27FE96F2C4E9 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_EXA_LIST PDM List of extended attributes of the table column %PARENT% List of extended attributes of the table column %PARENT% List of extended attributes of the table column %PARENT% 1 -30 LabelOrName -20 DataType -20 Value -30 TargetName 65E7D225-EE66-4460-BCD4-0FD84A966C75 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 0734EE67-2E76-4D5B-8449-59E108041D27 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 EDB37382-3962-4B6E-AF26-3CC8222282F4 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 77C38B9D-F5F8-4118-847C-9642DDD6D715 1520150527 xgc15 1520150527 xgc15 440DABE9-6C27-4E17-ABB7-6A575DF6C8B1 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_DESC PDM Description of the column %ITEM% of the table %PARENT% Description of the column %ITEM% of the table %PARENT% Description of the column %ITEM% of the table %PARENT% 78A94C21-A851-4C68-B00A-3E070FA76A2D 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 00DEDD91-EDF6-4DC1-86F5-9DD6AF2A3801 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 BDF26648-A104-4BF6-AB23-0D552B24F977 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_NOTE PDM Annotation of the column %ITEM% of the table %PARENT% Annotation of the column %ITEM% of the table %PARENT% Annotation of the column %ITEM% of the table %PARENT% D45DFB70-91A6-4D89-8BDA-CC4169B0FD74 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 5DD1374A-151A-4D3D-9B7E-2B149C95B7C3 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 B2623089-2714-48DC-A3AB-4CCCEF641B42 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_PREV PDM Code preview of the column %ITEM% of the table %PARENT% Code preview of the column %ITEM% of the table %PARENT% Code preview of the column %ITEM% of the table %PARENT% 6CF53286-A317-473A-99BD-6B37130D1A11 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 52EB7ADA-6A90-4D92-8E67-5A3F0E34113E 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 E6B30CF7-BA80-4A61-9AFE-B072C0DDF7B6 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_CRUL PDM Client validation rule of the column %ITEM% of the table %PARENT% Client validation rule of the column %ITEM% of the table %PARENT% Client validation rule of the column %ITEM% of the table %PARENT% B66C4B61-9CAF-4C3E-A9DA-D27909723BC7 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 F0A8EE33-12A3-4019-8B1E-2CE3F4350677 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 855EB63F-4A4A-4011-8509-89739C539418 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_SRUL PDM Server validation rule of the column %ITEM% of the table %PARENT% Server validation rule of the column %ITEM% of the table %PARENT% Server validation rule of the column %ITEM% of the table %PARENT% 17620A14-1BE7-4A05-9C49-28BB36EB8ECD 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 CFDF8290-29E2-427B-A8CB-FF5CD370B12A 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 680DB65F-A3C3-408D-B9CD-2F2B78A0CEC1 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_OPTS PDM Options of the column %ITEM% of the table %PARENT% Options of the column %ITEM% of the table %PARENT% Options of the column %ITEM% of the table %PARENT% 1745CA3A-A4D1-477D-95B5-939EB1556EE1 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 106D1742-B949-4A44-9CBB-5486AAA2AC2B 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 684C6E98-6E65-4BE2-8486-BE92BB9FB4E9 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_CKCN PDM Check constraint name of the column %ITEM% of the table %PARENT% Check constraint name of the column %ITEM% of the table %PARENT% Check constraint name of the column %ITEM% of the table %PARENT% E7C2043C-25B1-4B51-BF95-5EE2102AEAB0 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 47CCE3B0-0063-444D-A12A-181BC5FCCBDE 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 B24AE93D-3F7A-4D01-9919-B3A2CE8813DB 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_CTXT PDM Computed expression text of the column %ITEM% of the table %PARENT% Computed expression text of the column %ITEM% of the table %PARENT% Computed expression text of the column %ITEM% of the table %PARENT% EC89D718-182C-49C5-9028-1A490B2A573E 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 43F6B76B-FE56-4238-929A-202ADD1A2AC3 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 FB855E80-8A14-4E28-9019-4CD105D528C8 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_RELDIAG_LIST PDM List of related diagrams of the table column %PARENT% List of related diagrams of the table column %PARENT% List of related diagrams of the table column %PARENT% 1 -50 Name -50 Code 2A6F6F5C-7881-4B3E-9139-5BA128BD0BCE 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 1CA1D44E-67B5-434E-A408-8AA95D80F9F2 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 E754705C-1B0D-4AF7-A3A5-E39B21238EC3 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 0FAD4C83-AA84-4373-89DE-20AA12920E5D 1520150527 xgc15 1520150527 xgc15 7C4BDCB1-0FC1-4C78-9129-D898DF621454 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_DIAG_TITLE PDM Related diagram %ITEM% of the column %PARENT% Related diagram %ITEM% of the column %PARENT% Related diagram %ITEM% of the column %PARENT% RelatedDiagrams 847FF2D7-CB44-4B0D-BC2A-4C22BCD9B92B 1520150527 xgc15 1520150527 xgc15 1 PDM_TABL_COLN_GRAPHIC PDM 1 1 84 16EE8393-3D92-436D-BAC5-A144A9ECF78C 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 4 0 2EF28D12-DEAA-4BB0-BDEA-3AF59203730C 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_DIAG_DESC PDM Description of the related diagram %ITEM% of the column %PARENT% Description of the related diagram %ITEM% of the column %PARENT% Description of the related diagram %ITEM% of the column %PARENT% C48F0338-F31C-47D0-B55A-BA2C00E954BC 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 A79652C6-0B61-4569-9420-A5D5BF8222CC 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 D0C0E604-D6FD-4F10-8369-EEAFEFE3107D 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_DIAG_NOTE PDM Annotation of the related diagram %ITEM% of the column %PARENT% Annotation of the related diagram %ITEM% of the column %PARENT% Annotation of the related diagram %ITEM% of the column %PARENT% E5DD5207-B849-47C2-9C53-EAEAE38774ED 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 99D6D95A-0480-4145-87B6-F21B339D2846 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 DBAE8EF2-8731-4ED4-B6E2-A23B0BD2E355 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 2A948473-F150-4AD9-8E20-F2078714CB86 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_DEPND_LIST PDM List of all dependencies of the table column %PARENT% List of all dependencies of the table column %PARENT% List of all dependencies of the table column %PARENT% 1 -40 Name -40 Code -20 ClassName C9DD9EC3-3059-4D34-8931-8A622632A206 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 CCBDA5AF-3847-4755-BB79-DAF985BF7036 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 1327966A-29A3-459F-98D5-3969331DD3E9 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 CCD9999E-BE6E-4CA8-B93B-85262DF33CCD 1520150527 xgc15 1520150527 xgc15 AD2EB89F-215E-4530-AE35-8BECCA097ADB 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_OBJRDIAG_LIST PDM List of objects in related diagrams of the table column %PARENT% List of objects in related diagrams of the table column %PARENT% List of objects in related diagrams of the table column %PARENT% 1 -100 ShortDescription A37CB878-8268-4EE7-9D95-78823747D2B9 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 1B5E9FB4-F68D-4448-A388-EEE7CC8AD650 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 EFFE9180-9605-4175-8D4C-CDC1F6C88C87 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 D5B235D9-FBE0-424F-9A42-132753C323B8 1520150527 xgc15 1520150527 xgc15 183DC540-2042-44DE-BFA7-E238D5A4AEA3 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_KEY_LIST PDM List of keys of the table column %PARENT% List of keys of the table column %PARENT% List of keys of the table column %PARENT% 1 -50 Name -50 Code 20 Primary 232CB511-3AF8-4209-8B9E-BF2D828A6CD6 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 ABA75834-AF57-4AA8-A6A9-F826C7B94E94 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 75F4EE2A-0DEA-40F6-9685-2330CA6BE4CA 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 4B25D09A-5554-44BD-B676-7D986F5B107A 1520150527 xgc15 1520150527 xgc15 DC03C171-2ADE-4EB7-83F2-8E39D928F912 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_ARCO_LIST PDM List of remote article columns of the table column %PARENT% List of remote article columns of the table column %PARENT% List of remote article columns of the table column %PARENT% 1 -100 ShortDescription DA48AA59-4D70-4ABC-BA18-D863585B65B9 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 86DE6108-F596-4896-B702-2271A822DC65 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 332BDCF9-2978-4AB1-BD1E-77D408920489 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 24C4F31D-2845-405D-8986-DBEF5C07FDCA 1520150527 xgc15 1520150527 xgc15 6D22845A-60F0-41C6-BD6C-B819E0517E86 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_SRCARCO_LIST PDM List of source article columns of the table column %PARENT% List of source article columns of the table column %PARENT% List of source article columns of the table column %PARENT% 1 -100 ShortDescription B98230B8-EAA4-42B9-8260-F3F7D26FC0A1 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 385E2E13-C1D7-46C0-A16B-23DB15A6FA3F 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 09CAC7AE-27AE-4192-9F83-2F6A8420225C 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 2D32F846-0758-4A48-AFC1-F4A638264A5A 1520150527 xgc15 1520150527 xgc15 2708BA16-9C48-4127-9363-EA7D85FF2258 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_DSCOLUMNSRC_LIST PDM List of source data structure columns of the table column %PARENT% List of source data structure columns of the table column %PARENT% List of source data structure columns of the table column %PARENT% 1 -100 ShortDescription 9861B9BF-913A-4D25-B8E5-62425E228BBC 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 F2F87666-BE12-42EE-A8DA-B89E01E95D24 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 A08BACA0-115E-411E-A432-7E860B325650 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 A0184DC0-3D85-4586-811A-41DBEA081919 1520150527 xgc15 1520150527 xgc15 C2C18167-0925-4E56-B5C3-6FB61E1C103F 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_COLN_DSCOLUMNTRG_LIST PDM List of target data structure columns of the table column %PARENT% List of target data structure columns of the table column %PARENT% List of target data structure columns of the table column %PARENT% 1 -100 ShortDescription 5C0DC575-A6E2-4342-A223-E25E64358CAD 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 8EE2464D-4D8A-4B5F-AFCE-69ED5F176C13 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 127538BA-EE89-49EC-9169-BB29600B8AAE 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 F4A1B0B6-D4DE-4171-AEA4-4856432B8C14 1520150527 xgc15 1520150527 xgc15 58223E3D-9E90-4876-B474-3E884168218A 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 74C98288-059F-4E87-AD9F-06E813856A02 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_LIST PDM List of keys of the table %PARENT% List of keys of the table %PARENT% List of keys of the table %PARENT% Keys 1 -50 Name -50 Code 20 Primary B1CE34D7-0731-4F8A-ADF6-531E883DD413 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 179C2692-8FA7-479B-B095-69A8CF3D2D7A 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 3BC57AAF-302E-4974-B8FB-C3B0F574611A 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 BCE36778-E2C8-43EC-B2C0-EACC622C78D8 1520150527 xgc15 1520150527 xgc15 607BFA0A-79E9-408D-B3E9-B484AD7C5ED6 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_GROUP PDM Key %ITEM% of the table %PARENT% Key %ITEM% of the table %PARENT% Key %ITEM% of the table %PARENT% Keys F1E91F21-8C64-4553-85E5-A72F40BD3C94 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_CARD PDM Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Name Code Primary 73EBDEEF-1B65-4386-9795-E140629F8036 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 2 0 BE88FA21-AE52-483E-9B0F-0060D9A5E1FA 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 1 2 1 84B8292F-317E-40D5-A665-A30B83BFC066 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 2 1 C8E9DF84-A226-4508-8420-54F33613AC7F 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_EXA_LIST PDM List of extended attributes of the table key %PARENT% List of extended attributes of the table key %PARENT% List of extended attributes of the table key %PARENT% 1 -30 LabelOrName -20 DataType -20 Value -30 TargetName F7B5FB9D-0F6F-4DE1-9DBF-C375F571C577 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 9CD9F91D-0EDA-49B0-A51D-3E9D0C62CB21 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 7AA54816-5DB3-4FAE-B525-7755F6747444 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 7CD0E713-03D4-4223-A6FA-05AA6A985837 1520150527 xgc15 1520150527 xgc15 4E319A35-C32C-4F4C-9BAA-78D62002048E 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_DESC PDM Description of the key %ITEM% of the table %PARENT% Description of the key %ITEM% of the table %PARENT% Description of the key %ITEM% of the table %PARENT% F1A411B9-B2A2-40EB-ABC7-F2F666338180 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 B58EB6B8-886E-449C-8106-BB0616EF54B5 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 9F9ED7CA-701C-4591-AC9A-8B02A0A1D7F4 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_NOTE PDM Annotation of the key %ITEM% of the table %PARENT% Annotation of the key %ITEM% of the table %PARENT% Annotation of the key %ITEM% of the table %PARENT% B2F9BE75-5F1A-4D96-AA20-6585E050BF40 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 5B711E32-EA9D-4E33-877E-1A111DAAFC45 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 04C0A7DA-0D24-4C29-85D0-B032248D898A 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_PREV PDM Code preview of the key %ITEM% of the table %PARENT% Code preview of the key %ITEM% of the table %PARENT% Code preview of the key %ITEM% of the table %PARENT% 9F53EDF1-7E59-4AD4-BC45-D51D533594B1 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 49C7A6AC-75D1-41B0-9DBA-031E5822929A 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 25848AB6-630F-4BB9-B42F-058491CFA456 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_OPTS PDM Options of the key %ITEM% of the table %PARENT% Options of the key %ITEM% of the table %PARENT% Options of the key %ITEM% of the table %PARENT% FBD112A9-FD66-4BE8-9E71-CE547916799E 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 89072849-1305-4FC9-81BB-3C4BE7BBE768 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 F537D765-AB93-4C04-93AB-DF9B3CB5DFE5 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_RELDIAG_LIST PDM List of related diagrams of the table key %PARENT% List of related diagrams of the table key %PARENT% List of related diagrams of the table key %PARENT% 1 -50 Name -50 Code 5D4C0CF8-F159-41A8-8DD8-AA1F2758AE11 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 822B0FF1-5C6B-422F-866D-D0260A4F641B 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 8CD91F7E-593F-4D99-B8F0-9E6C1FDAE9BC 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 051B3665-64C3-4848-AB73-EE2C706CCA90 1520150527 xgc15 1520150527 xgc15 D2BB4D18-7379-4320-9126-6FD07F58A425 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_DIAG_TITLE PDM Related diagram %ITEM% of the key %PARENT% Related diagram %ITEM% of the key %PARENT% Related diagram %ITEM% of the key %PARENT% RelatedDiagrams 72B8C316-6111-415A-AC19-FAD72A86D548 1520150527 xgc15 1520150527 xgc15 1 PDM_TABL_KEY_GRAPHIC PDM 1 1 84 B1092D0E-8DF3-46FA-902C-4DBADD6141C2 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 4 0 384B9254-626D-4168-9C61-5ACD05951D87 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_DIAG_DESC PDM Description of the related diagram %ITEM% of the key %PARENT% Description of the related diagram %ITEM% of the key %PARENT% Description of the related diagram %ITEM% of the key %PARENT% 8499B762-0693-43F0-95D2-D67AB3E07B0F 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 E03EE7DF-3DAC-47CD-81A2-6FAD2ECB9894 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 1913F6D6-6B63-48C4-9681-20B7EBA9380F 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_DIAG_NOTE PDM Annotation of the related diagram %ITEM% of the key %PARENT% Annotation of the related diagram %ITEM% of the key %PARENT% Annotation of the related diagram %ITEM% of the key %PARENT% C3349C5C-871B-4B42-AA3E-33D5777AED69 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 3F68FFBB-7929-4B75-8717-9112AE7AF93D 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 0 3BEBBC68-9495-4918-85C9-AC2573DDB274 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 C6055DBD-2CB9-427C-8960-5A4A44FB51EF 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_COLN_LIST PDM List of columns of the table key %PARENT% List of columns of the table key %PARENT% List of columns of the table key %PARENT% 1 -50 Name -50 Code F0E30B9A-793C-47C9-9B9D-99F68E572D67 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 36B2A25C-08A3-43FC-975D-934072CEFED0 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 11189362-C393-4C2F-83BB-CCD8A8430772 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 4D903237-D5E5-468D-9267-FB4B4D0F3126 1520150527 xgc15 1520150527 xgc15 EAA098AD-3FD9-49AA-B93D-64719867D5B2 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_DEPND_LIST PDM List of all dependencies of the table key %PARENT% List of all dependencies of the table key %PARENT% List of all dependencies of the table key %PARENT% 1 -40 Name -40 Code -20 ClassName 3EE90327-8BF9-425E-9CE1-5FA87A254FF3 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 11ED2D51-F7A6-48B6-98FA-CC11F8C0F45D 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 60E0EF61-C994-425C-A85A-00383481BCF7 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 CAF931E0-22F8-484D-BA68-F6EFEDFC69B8 1520150527 xgc15 1520150527 xgc15 8D34504C-7C98-486D-B641-F213A68C0060 1520150527 xgc15 1520150527 xgc15 1 1 PDM_TABL_KEY_OBJRDIAG_LIST PDM List of objects in related diagrams of the table key %PARENT% List of objects in related diagrams of the table key %PARENT% List of objects in related diagrams of the table key %PARENT% 1 -100 ShortDescription 7B86FDBA-3F59-4FC4-A89E-72B6CDCFE15A 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 252FE093-E230-4CB1-BD91-A3012D8297B7 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 2 4 1 1 E87E3CB5-5E32-4C25-B2EE-537AE9522163 1520150527 xgc15 1520150527 xgc15 Microsoft Sans Serif 10 1 1 281636E2-88EF-4E53-8BD2-6DC8EF5488D0 1520150527 xgc15 1520150527 xgc15 38758B78-6C5C-4407-A231-A046E73CBFED 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 7B3EF8C9-CA1F-4B4D-BBDC-F818D4F2543C 1520150527 xgc15 1520150527 xgc15 新宋体 10 5 353 106 0 5AEBBE29-D162-41F1-9E6B-ACA19FB00BE1 1520150258 xgc15 1520150401 xgc15 1 1 PDM_TABL_COLN_LIST PDM List of columns of the table %PARENT% List of columns of the table %PARENT% List of columns of the table %PARENT% TableColumns 1 -20 Code -20 DataType -10 Length -30 Comment -10 Mandatory -10 Primary 5907068C-F4A9-477E-9FA9-F639ABE9B644 1520150258 xgc15 1520150258 xgc15 新宋体 10 5 353 106 0 D1FE0BCF-162F-401B-B0B1-779BBED56BF6 1520150258 xgc15 1520150258 xgc15 Microsoft Sans Serif 10 2 4 1 1 7525EEE2-C979-48CA-921D-E4BCFE3715B5 1520150258 xgc15 1520150258 xgc15 Microsoft Sans Serif 10 1 1 8641A469-0618-499A-BDC9-8BD351FE3015 1520150258 xgc15 1520150258 xgc15 49FAC418-2E66-4058-90D8-172FE1C3CC84 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_TITLE PDM Table %ITEM% Table %ITEM% Table %ITEM% Tables 7E2BB7D7-6504-4005-A2D6-544CECF0EACD 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_CARD PDM Card of table %ITEM% Card of table %ITEM% Card of table %ITEM% Name Code C6186B78-A92A-40B7-97D6-8397F1082AB5 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 2 0 09B9CF14-DD90-4895-B26C-65AB4B5DE9C1 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 1 2 1 BBBF0308-65A3-48C2-9B9A-1EC18D70D2CA 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 2 1 37BB2894-B6C8-49EE-B16A-7E3DF5AFECD8 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_EXA_LIST PDM List of extended attributes of the table %PARENT% List of extended attributes of the table %PARENT% List of extended attributes of the table %PARENT% 1 -30 LabelOrName -20 DataType -20 Value -30 TargetName 93B85719-8F9C-4FC0-934F-06469895D392 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 CB96067F-F8A6-4527-9F69-2CCE4D3C5725 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 B07E9139-45FF-40C7-8468-55CAA1D5EB99 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 C79A7F49-FFB6-4DFD-89AE-9D740E17DDA4 1520150582 xgc15 1520150582 xgc15 55268980-CA24-4DB3-A44C-BD57593C25D6 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_DESC PDM Description of the table %ITEM% Description of the table %ITEM% Description of the table %ITEM% 540BA19C-93D4-4935-A4D3-486898492B4F 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 4DB5589D-D34D-485A-9B27-EB714CF9A785 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 E973CFD0-D688-45CD-BD9B-8A233D3F6553 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_NOTE PDM Annotation of the table %ITEM% Annotation of the table %ITEM% Annotation of the table %ITEM% EDE9D99B-514C-44B9-B5C1-F44FF1F3D4CB 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 2D963386-BF30-4651-B5F2-647DB136A42B 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 2A4DBD51-D7E5-4F76-8CE9-D2B090310EC3 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_PREV PDM Code preview of the table %ITEM% Code preview of the table %ITEM% Code preview of the table %ITEM% 843766D4-106F-4229-AB36-880CBBC48681 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 68BB147C-12AB-45C2-B5AB-00FFDCE0B93F 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 28FC543D-767E-458B-B8C0-B5C0B138D01F 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_HEAD PDM Begin script of the table %ITEM% Begin script of the table %ITEM% Begin script of the table %ITEM% C055FECD-D0F0-4570-8CE2-5791ACF846F6 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 ABE1D49C-0515-4367-9E40-FCEAA29B675B 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 07F0BCA1-3E58-45B8-ACA3-F2EBBB0CAC1E 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_FOOT PDM End script of the table %ITEM% End script of the table %ITEM% End script of the table %ITEM% 9C5F8A09-E0FF-407E-9192-36BF40D21E58 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 A4140A8C-78C4-4B63-AC9B-0B2B1DCE735A 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 F5EC42A4-8D4D-49BA-8EC2-43F962E503DB 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_CRUL PDM Client validation rule of the table %ITEM% Client validation rule of the table %ITEM% Client validation rule of the table %ITEM% B4EE5376-2B2F-48D9-AD4D-919C080C4FB7 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 065D761B-1A15-4139-8CBA-DF7D6E83D11F 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 C829A231-DC5A-4488-AEFD-AF94B55B84D2 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_SRUL PDM Server validation rule of the table %ITEM% Server validation rule of the table %ITEM% Server validation rule of the table %ITEM% 011C4595-D6E8-4AEF-9FF9-3FEA8DD9EFAE 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 B298602A-8158-4733-9FDE-C48CFADE0F24 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 DD4BE1DD-F710-4028-BF12-CAE8BE50A21A 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_OPTS PDM Options of the table %ITEM% Options of the table %ITEM% Options of the table %ITEM% DA9E793E-4F2F-4FF3-AF59-A830525A2417 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 96238CD0-F3A9-4504-9B8F-8E22A03E1AB2 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 42CC8C0D-59F8-4E63-916A-DD7FE9E500A7 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_CKCN PDM Check constraint name of the table %ITEM% Check constraint name of the table %ITEM% Check constraint name of the table %ITEM% 6205590B-44F9-4E7F-A23D-2E6325BFE244 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 7640A0E6-8DDC-42D1-BC33-13BCFFE41A21 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 DC55D993-C0B7-432A-B940-F745A65BEC26 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_RELDIAG_LIST PDM List of related diagrams of the table %PARENT% List of related diagrams of the table %PARENT% List of related diagrams of the table %PARENT% 1 -50 Name -50 Code F8189939-04DC-4C92-9005-5409B787DF24 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 CA5CDFA7-E8D8-4AD7-A0DC-F97B7C680717 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 E175FA63-0721-4E34-9DEA-FC190BCAB3BF 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 D3D3318E-B50E-4FBA-A998-D9104EA3BA3F 1520150582 xgc15 1520150582 xgc15 EF322B6E-2FCC-466D-871B-AD35856642E5 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_DIAG_TITLE PDM Related diagram %ITEM% of the table %PARENT% Related diagram %ITEM% of the table %PARENT% Related diagram %ITEM% of the table %PARENT% RelatedDiagrams 878344DC-A687-4BFA-9028-98EF0D1D845C 1520150582 xgc15 1520150582 xgc15 1 PDM_TABL_GRAPHIC PDM 1 1 84 059017D8-F2CB-4055-AA70-1D4D486EAB23 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 4 0 3AAD16E7-7071-4194-92B1-5293CE13594F 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_DIAG_DESC PDM Description of the related diagram %ITEM% of the table %PARENT% Description of the related diagram %ITEM% of the table %PARENT% Description of the related diagram %ITEM% of the table %PARENT% 3CF6AA94-BE1A-4931-8353-875C162891A5 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 71136655-C557-41E8-92C6-195E2F7F2AC6 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 2EDABD8F-0E04-4FEC-B35B-7ED75E2AF23D 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_DIAG_NOTE PDM Annotation of the related diagram %ITEM% of the table %PARENT% Annotation of the related diagram %ITEM% of the table %PARENT% Annotation of the related diagram %ITEM% of the table %PARENT% 58E6A40D-658E-4B87-B746-1CDFB1C8F49B 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 6932D5B5-55CF-4D03-9E08-942B148773E4 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 1398533D-85B7-4EB3-8A00-1BF2EF47978C 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 7A56D2FA-708C-4722-A6A7-66E08755B4C7 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_DEPND_LIST PDM List of all dependencies of the table %PARENT% List of all dependencies of the table %PARENT% List of all dependencies of the table %PARENT% 1 -40 Name -40 Code -20 ClassName 39021ECB-FF06-4DA1-B0C7-918CB5349F39 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 438B268E-CC9A-4099-9EC8-38A002E480E5 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 8D72922E-6D78-4FE2-9DC1-0A4D9A170ACD 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 2CBBBB9A-E3EF-487C-9182-15156412BCF4 1520150582 xgc15 1520150582 xgc15 90977E2B-76C2-467C-A96B-0CFF6E283AFF 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_OBJRDIAG_LIST PDM List of objects in related diagrams of the table %PARENT% List of objects in related diagrams of the table %PARENT% List of objects in related diagrams of the table %PARENT% 1 -100 ShortDescription 0138366E-0FFA-464E-A594-5ED5002F8B11 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 1A49DA9F-36CA-474D-9D22-AF95B176D5D8 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 B483C5C7-EB3D-4CA6-AB65-ED311118483B 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 DBFCE969-A460-4417-968C-17C1B654325C 1520150582 xgc15 1520150582 xgc15 A6ED2BEA-671E-4D0C-98C3-5C84D5624DE3 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_ARTC_LIST PDM List of remote articles of the table %PARENT% List of remote articles of the table %PARENT% List of remote articles of the table %PARENT% 1 -100 ShortDescription E46D84CF-1D70-4C38-86C9-31C6C641A3C0 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 1B7675F0-EDF9-4D6B-A4EC-576416B360B1 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 4E66EF04-3C1A-42A8-B19C-15B48D931D29 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 A4B405BA-5EE8-4E9B-9CDD-BF489164CF4C 1520150582 xgc15 1520150582 xgc15 DB9C850B-191B-4C50-A019-C5A929A42563 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_SRCARTC_LIST PDM List of source articles of the table %PARENT% List of source articles of the table %PARENT% List of source articles of the table %PARENT% 1 -100 ShortDescription 21282441-8FC7-4AEC-9D71-711D0FF5D15C 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 546C8A96-6BBC-4765-B5D3-6DC74AF7C475 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 9FCE6953-A685-4FD0-8D5D-E4E3E8325D61 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 E62B29A1-7712-4025-A603-1EAC46861413 1520150582 xgc15 1520150582 xgc15 D49D1F9B-99B1-4075-9090-02C417CAEF2A 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_SRCSTEP_LIST PDM List of source steps of the table %PARENT% List of source steps of the table %PARENT% List of source steps of the table %PARENT% 1 -100 ShortDescription BCDFF1B2-8604-4856-A047-915B6B075C62 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 21275FAE-798C-4A9C-935C-BE10305698E7 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 C97A6711-7C54-469C-A7E3-4797FB0A7D2A 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 9F796143-DA10-4EA9-B093-8DE39C7DABDA 1520150582 xgc15 1520150582 xgc15 4E7C987E-9E6A-489B-8318-ACF7955790AA 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_DSTSTEP_LIST PDM List of target steps of the table %PARENT% List of target steps of the table %PARENT% List of target steps of the table %PARENT% 1 -100 ShortDescription DFA07C85-3AAE-481E-8218-ADFFAA77CE61 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 9C3DE6FA-DCED-445D-997A-EE837DB48E3B 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 A93FE252-A9D7-4FC2-BE53-016BB22F502D 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 CF0344BD-9128-4394-B5C6-2E8A15682AAB 1520150582 xgc15 1520150582 xgc15 92C22AE6-481F-4508-9428-AB63663B4C25 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_DIAG_LIST PDM List of diagrams containing the table %PARENT% List of diagrams containing the table %PARENT% List of diagrams containing the table %PARENT% 1 -50 Name -50 Code 44939C14-0328-4696-BB5F-97EA69606FDE 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 9E39808C-E481-49C6-8E75-0403D0870D74 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 A9ADCC89-69BB-44CF-81F7-2DC629AC1985 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 7E9B427B-9E48-427A-90C6-255E0F5EEFAA 1520150582 xgc15 1520150582 xgc15 B1F12228-3CAD-4F6C-AE0E-24D5527FF766 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_LIST PDM List of columns of the table %PARENT% List of columns of the table %PARENT% List of columns of the table %PARENT% Columns 1 -50 Name -50 Code E7BA8098-C5AA-4F0F-BB52-3F5B85135F74 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 289CF866-1C75-4986-8947-DF377467FC19 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 7727C3E4-7C43-4EC4-AA8B-1DB9CF31BDBC 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 DE1BA866-EBE2-43C5-9A6E-778FDB2AF4D2 1520150582 xgc15 1520150582 xgc15 604A08D8-E11E-48C5-9F18-75BD4E0F76B3 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_GROUP PDM Column %ITEM% of the table %PARENT% Column %ITEM% of the table %PARENT% Column %ITEM% of the table %PARENT% Columns 89E79601-FCC0-4B10-86D5-38CED0AF5FF8 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_CARD PDM Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Name Code DataType Mandatory BB48133D-C36B-46B9-AA10-305A515F40E9 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 2 0 2250E877-AA64-4DCA-97E1-E6E9905D9C6E 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 1 2 1 45D96B6C-97EE-4632-B942-BCE1141D4C30 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 2 1 DB1365BF-B078-4700-B34F-91DE456AAA91 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_CHECK PDM Check of the column %ITEM% of the table %PARENT% Check of the column %ITEM% of the table %PARENT% Check of the column %ITEM% of the table %PARENT% LowValue HighValue DefaultValue Unit Format CharacterCase CannotModify NoSpace ListOfValues Complete DefaultValueDisplayed 168626C5-F894-4C79-B274-188A90DF452E 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 2 0 1FA16DC7-7B7E-4B13-84BA-D9A80FD75180 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 1 2 1 B72BD854-2877-4B86-B4EF-6EA8B099BD90 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 2 1 57208C66-4E66-40DD-84CD-9674810B161D 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_EXA_LIST PDM List of extended attributes of the table column %PARENT% List of extended attributes of the table column %PARENT% List of extended attributes of the table column %PARENT% 1 -30 LabelOrName -20 DataType -20 Value -30 TargetName D50D12BB-5D5A-4AE6-BD2E-D83A682B0F6B 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 C9C5B470-E0BF-443F-89B2-482765A3E5C3 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 AA3C6768-94B5-44D1-B90B-155094286AF4 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 B49FB810-DED6-4690-BBBB-26C4FFF4AD17 1520150582 xgc15 1520150582 xgc15 C114DD91-4AFE-43C6-BB34-7825E9949267 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_DESC PDM Description of the column %ITEM% of the table %PARENT% Description of the column %ITEM% of the table %PARENT% Description of the column %ITEM% of the table %PARENT% 417F6279-CED3-49D6-92B0-A91233DBEA42 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 61F111B9-047B-43B0-B922-FE87DFF8EB5C 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 5EE3D98F-2ED4-4BC8-AFE9-E551DDE2A076 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_NOTE PDM Annotation of the column %ITEM% of the table %PARENT% Annotation of the column %ITEM% of the table %PARENT% Annotation of the column %ITEM% of the table %PARENT% 0BE24668-1417-4CD4-8AAA-410C48CE2C9F 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 FAD10A2E-7C26-47CB-9583-9EE2E5D99E87 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 92A0ED57-84B9-4A29-BAE0-EE30B02EA218 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_PREV PDM Code preview of the column %ITEM% of the table %PARENT% Code preview of the column %ITEM% of the table %PARENT% Code preview of the column %ITEM% of the table %PARENT% D950456B-F738-45EA-8AEE-FE212A9C07C4 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 706FB166-5182-40BB-8FF0-D52E8E655533 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 B20D8F7C-B294-4A49-B70D-19F0D45134BD 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_CRUL PDM Client validation rule of the column %ITEM% of the table %PARENT% Client validation rule of the column %ITEM% of the table %PARENT% Client validation rule of the column %ITEM% of the table %PARENT% A53FF02C-CC69-4B04-8973-EB2A53A519D5 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 B5CF878E-A296-4688-B124-DE451ED2A8D7 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 B4262694-3BB1-4D27-8EA0-10385C4902CB 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_SRUL PDM Server validation rule of the column %ITEM% of the table %PARENT% Server validation rule of the column %ITEM% of the table %PARENT% Server validation rule of the column %ITEM% of the table %PARENT% 3A1FE621-6B5B-4B6E-B351-377B77A67EDD 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 A96A206B-3035-4CB1-BE23-1A929A529E18 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 EACC381B-E943-4E58-A81F-01A924F6E3A3 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_OPTS PDM Options of the column %ITEM% of the table %PARENT% Options of the column %ITEM% of the table %PARENT% Options of the column %ITEM% of the table %PARENT% 33D71281-E554-485D-8E41-9109A5C3A65D 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 CF6C906B-D98D-411D-8EEC-F2C1685B721A 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 7FD90E6A-648D-4505-A725-BB82E70101EA 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_CKCN PDM Check constraint name of the column %ITEM% of the table %PARENT% Check constraint name of the column %ITEM% of the table %PARENT% Check constraint name of the column %ITEM% of the table %PARENT% A21402CE-6B2F-4B9D-90A6-783F5EFE4CC2 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 14FE955D-3B3F-4A39-ACAD-551EC1BF6A74 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 1090E6AE-ED70-4DB7-97B9-0002841BE660 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_CTXT PDM Computed expression text of the column %ITEM% of the table %PARENT% Computed expression text of the column %ITEM% of the table %PARENT% Computed expression text of the column %ITEM% of the table %PARENT% 54CD7DE0-E9B4-4A8A-972C-3DCADF8376C3 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 F83ACAF8-AD5D-44DF-A376-71B54B24B1E4 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 F4FD8F47-8FC0-475D-A520-9B130A67A116 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_RELDIAG_LIST PDM List of related diagrams of the table column %PARENT% List of related diagrams of the table column %PARENT% List of related diagrams of the table column %PARENT% 1 -50 Name -50 Code A3BE2208-50AA-4462-BAE7-7BAD8620ECF3 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 A10C2B1C-9BC0-42F7-BE6D-BC4EAFD5C0C0 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 64F5B3F3-743D-484B-AF5F-26173E1B3B2B 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 93611278-0A24-45FF-8BF5-7AE328E7EC1D 1520150582 xgc15 1520150582 xgc15 398AEFF2-826E-4275-829B-E28A8F8BFE90 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_DIAG_TITLE PDM Related diagram %ITEM% of the column %PARENT% Related diagram %ITEM% of the column %PARENT% Related diagram %ITEM% of the column %PARENT% RelatedDiagrams 79A69529-37FE-4D8B-9AC4-E24FD2B97B41 1520150582 xgc15 1520150582 xgc15 1 PDM_TABL_COLN_GRAPHIC PDM 1 1 84 7B994A3F-6616-4572-9EC7-2E976C6EC2BF 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 4 0 5D650326-E99A-43C7-BD86-E362B090D919 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_DIAG_DESC PDM Description of the related diagram %ITEM% of the column %PARENT% Description of the related diagram %ITEM% of the column %PARENT% Description of the related diagram %ITEM% of the column %PARENT% 15DD2EAE-327C-49EE-A108-39315E83EF7C 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 8D8FAE18-C205-42D9-B2A5-FF2356770DB1 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 A1C6AEF1-5FE8-4D6F-98D5-0F47F7AD34E8 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_DIAG_NOTE PDM Annotation of the related diagram %ITEM% of the column %PARENT% Annotation of the related diagram %ITEM% of the column %PARENT% Annotation of the related diagram %ITEM% of the column %PARENT% 976538FE-3099-4842-820D-E1751D6DC4BF 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 5226BACA-13D1-4491-A537-9751F77E9927 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 93293527-DCF6-4AC8-8D82-4A1D036BD645 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 7A9C9098-B5CF-4FCF-9B7B-0F73495833F6 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_DEPND_LIST PDM List of all dependencies of the table column %PARENT% List of all dependencies of the table column %PARENT% List of all dependencies of the table column %PARENT% 1 -40 Name -40 Code -20 ClassName 67FC8B0A-D015-4E53-9466-90F128FCF201 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 6E5EDA0D-7EAC-43B6-ABBA-B47E6BA68496 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 9225DE65-1D28-42CC-99B0-654A4FCEC880 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 C394CFDF-B525-44D5-8EAD-76F66528EA80 1520150582 xgc15 1520150582 xgc15 C5351579-E281-471A-B213-D938DA19ACDA 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_OBJRDIAG_LIST PDM List of objects in related diagrams of the table column %PARENT% List of objects in related diagrams of the table column %PARENT% List of objects in related diagrams of the table column %PARENT% 1 -100 ShortDescription 679DED90-6CBD-4DCE-873B-C6386407EF21 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 B4AA04F3-B8CA-445F-A738-F216ECCA8386 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 3E701EDF-5A9E-46A3-9C61-048FEE05A109 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 B57E69B8-44E6-4023-92E5-00BCB591D6FE 1520150582 xgc15 1520150582 xgc15 9F2CD8E2-7342-4FFC-B27B-033AEB98DF15 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_KEY_LIST PDM List of keys of the table column %PARENT% List of keys of the table column %PARENT% List of keys of the table column %PARENT% 1 -50 Name -50 Code 20 Primary 728E0AC8-EAF3-4E91-8BDF-95F867E4BB7C 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 284469E4-FAC3-4838-B1AA-958BA5CA0C32 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 666DFB2C-85CC-499A-B55E-274AFED2077A 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 9C7B94A9-DEF8-4A5A-A159-25BBC82EAE58 1520150582 xgc15 1520150582 xgc15 D8154AD8-5D0E-46B4-B4D5-A4FA888DB097 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_ARCO_LIST PDM List of remote article columns of the table column %PARENT% List of remote article columns of the table column %PARENT% List of remote article columns of the table column %PARENT% 1 -100 ShortDescription DB0993BE-2C13-4304-A7BE-C3A701AECE21 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 8EDF0191-62E2-4D2D-949C-CC98882535F3 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 2C45CC5F-3163-4150-9AE5-0B53F59D58F8 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 831450E2-25A2-4747-BE1A-3AC2D26C81C9 1520150582 xgc15 1520150582 xgc15 14A6A9DD-8EC1-4173-8D4A-2DE2353CD374 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_SRCARCO_LIST PDM List of source article columns of the table column %PARENT% List of source article columns of the table column %PARENT% List of source article columns of the table column %PARENT% 1 -100 ShortDescription 36B93F3C-94EB-4979-A064-0D33C2427EC6 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 55DAEE4B-85FC-4D65-8AC7-31B301556E5C 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 FEBEBEEF-AD49-43C9-A4FD-02257DCC8E79 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 CFB1C978-99BF-4E20-BCD8-9BA4ABFF16A8 1520150582 xgc15 1520150582 xgc15 D3EC13EE-9DF3-4E1C-ADE5-05A5F8263208 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_DSCOLUMNSRC_LIST PDM List of source data structure columns of the table column %PARENT% List of source data structure columns of the table column %PARENT% List of source data structure columns of the table column %PARENT% 1 -100 ShortDescription BC7F6350-1DA1-40D8-80F7-77BAE8258FA0 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 0D5273BF-0EC2-48BA-9E26-AA2407B878F2 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 AC16DFD1-A025-44E4-B08A-D1201BC6B973 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 E7F48B15-E180-4384-849F-A42BC9247DA2 1520150582 xgc15 1520150582 xgc15 9D7AA746-ECC0-424B-B163-331CAFB7D17A 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_COLN_DSCOLUMNTRG_LIST PDM List of target data structure columns of the table column %PARENT% List of target data structure columns of the table column %PARENT% List of target data structure columns of the table column %PARENT% 1 -100 ShortDescription 042E9F7C-0052-4390-842F-D453CA6FD1C7 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 7006D085-8BF1-449A-BB7A-C521DA915463 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 904E6268-E200-4AC6-8E2E-47B2BBE9A480 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 D5415BCA-E7AA-4C82-A511-1AE2BDF8558F 1520150582 xgc15 1520150582 xgc15 08216174-1E3E-4EB1-B5E0-CB6C723D0A87 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 21BEBBC3-7227-46B7-A933-C975849812F4 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_LIST PDM List of keys of the table %PARENT% List of keys of the table %PARENT% List of keys of the table %PARENT% Keys 1 -50 Name -50 Code 20 Primary 7B5AEBF9-45D5-4DA2-B021-F3A99E2AF3B4 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 62EC36DE-740D-4ACB-9ABD-217666DB3BB0 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 8979041D-A2B4-4814-8642-0F1AEE039FF0 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 DAAC0AFA-D4B1-4F25-A7D7-FE02088DCAD6 1520150582 xgc15 1520150582 xgc15 3F73224A-35ED-46C1-AD8D-C89C2CCAA0B6 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_GROUP PDM Key %ITEM% of the table %PARENT% Key %ITEM% of the table %PARENT% Key %ITEM% of the table %PARENT% Keys B229B0E2-71A4-4DF8-A1AE-CD7B855D01D6 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_CARD PDM Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Name Code Primary AE0D7FB4-A51A-4BFD-B68A-02FB6849253A 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 2 0 2BB9CC6A-6A77-41FA-A3C2-C69D7004734D 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 1 2 1 448669BE-570E-40A0-AF40-0B0047D92D8F 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 2 1 50899BD5-9618-49E3-BC98-3757A7763823 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_EXA_LIST PDM List of extended attributes of the table key %PARENT% List of extended attributes of the table key %PARENT% List of extended attributes of the table key %PARENT% 1 -30 LabelOrName -20 DataType -20 Value -30 TargetName A8072E8E-622B-4779-A1FF-E1BE332FFF23 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 0E552B4B-6E3A-424E-9BF5-3711CEFA8DA2 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 45922E4A-7814-469D-8D4E-5C73C887DE52 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 C4B2705D-1DE7-457D-B0E4-E555CD7CFB3B 1520150582 xgc15 1520150582 xgc15 1E7F2023-F258-4A0C-9107-F1C6CECD435E 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_DESC PDM Description of the key %ITEM% of the table %PARENT% Description of the key %ITEM% of the table %PARENT% Description of the key %ITEM% of the table %PARENT% 29D10C8C-228A-4C94-83F5-6148A6369F11 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 C5FBEFDA-B02F-4CC0-B414-C739ECE69CC2 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 92A74146-D68E-4902-8D43-0916CA9524AA 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_NOTE PDM Annotation of the key %ITEM% of the table %PARENT% Annotation of the key %ITEM% of the table %PARENT% Annotation of the key %ITEM% of the table %PARENT% FE1AB247-F291-40BB-9246-3211E7B4AEBA 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 3ECF4CAE-3EBD-4C66-8B0A-6593F8373DEB 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 BA94858C-7DA5-4CCA-850D-73E3BF42A4B1 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_PREV PDM Code preview of the key %ITEM% of the table %PARENT% Code preview of the key %ITEM% of the table %PARENT% Code preview of the key %ITEM% of the table %PARENT% AD27CD3D-851A-41F2-B595-028D83AEF900 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 0B3A808C-6B25-408D-A8D2-62FF66222C74 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 F6221C2B-976B-45A5-9EE4-F312EEA12807 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_OPTS PDM Options of the key %ITEM% of the table %PARENT% Options of the key %ITEM% of the table %PARENT% Options of the key %ITEM% of the table %PARENT% 9E9BEA72-D6BF-4FFE-BF9F-77D7B6347773 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 BEC068DF-59E0-491A-9770-9CE1C7CC918F 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 DF566F1A-633B-4136-B536-6F3A47CD2D39 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_RELDIAG_LIST PDM List of related diagrams of the table key %PARENT% List of related diagrams of the table key %PARENT% List of related diagrams of the table key %PARENT% 1 -50 Name -50 Code 76339250-2747-44CF-9F4D-41924A690EDB 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 349F5B2A-13A1-4F59-9EA6-7B0BE3E71B6D 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 56708C85-A7E5-4D6C-B522-2C3254E47C65 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 F700D2E0-9B8D-421D-AD60-B6DDA700C86F 1520150582 xgc15 1520150582 xgc15 6DB43E28-1F39-490F-836D-427F2089D274 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_DIAG_TITLE PDM Related diagram %ITEM% of the key %PARENT% Related diagram %ITEM% of the key %PARENT% Related diagram %ITEM% of the key %PARENT% RelatedDiagrams CBAF74BA-F14A-43C7-AC88-5203B90370A1 1520150582 xgc15 1520150582 xgc15 1 PDM_TABL_KEY_GRAPHIC PDM 1 1 84 90A565F5-0553-4293-8097-D1E75B613DEE 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 4 0 BE4DB18F-2F2C-4AEC-B232-459EFDB923ED 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_DIAG_DESC PDM Description of the related diagram %ITEM% of the key %PARENT% Description of the related diagram %ITEM% of the key %PARENT% Description of the related diagram %ITEM% of the key %PARENT% 3088AC61-36C1-4E8F-B697-279E8EC80773 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 3A0C637E-7C66-4AAC-A513-D66B807437CA 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 16038B14-ABC9-40BB-85CB-11DBDA4704CE 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_DIAG_NOTE PDM Annotation of the related diagram %ITEM% of the key %PARENT% Annotation of the related diagram %ITEM% of the key %PARENT% Annotation of the related diagram %ITEM% of the key %PARENT% 012C7025-ADE9-4462-83EF-F0AC199A1FCB 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 FFB82E91-AB72-4398-8BF4-41076574245F 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 0 912C7640-D79C-4858-AF7A-42557EE3D7A2 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 2FCA7ED2-745F-48D1-9966-3EC1457AB725 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_COLN_LIST PDM List of columns of the table key %PARENT% List of columns of the table key %PARENT% List of columns of the table key %PARENT% 1 -50 Name -50 Code E7FEAD84-A4D0-4860-8074-7E8DBD2B792E 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 2DC2BA2A-25A3-4F42-B892-E4F99B768DDA 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 FC50FC8E-FC87-4898-A885-3E8FD66B29FB 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 259BC7A7-C7E9-4851-8330-C66EAC062A64 1520150582 xgc15 1520150582 xgc15 0FF37AF7-F570-4B3A-A0D1-50F54DD1A797 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_DEPND_LIST PDM List of all dependencies of the table key %PARENT% List of all dependencies of the table key %PARENT% List of all dependencies of the table key %PARENT% 1 -40 Name -40 Code -20 ClassName 76455E23-C571-49E9-9E4E-7E09EC965B88 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 5DD07F8B-1A2D-41A8-A30F-AB0ECCE86ED4 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 E096ACAF-3E66-49C7-81E0-08BCAF1F1357 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 FEB4D8D3-46EE-455A-8876-0EE78C48A22B 1520150582 xgc15 1520150582 xgc15 213353AD-1F82-48C0-9BCF-CBF7B2052879 1520150582 xgc15 1520150582 xgc15 1 1 PDM_TABL_KEY_OBJRDIAG_LIST PDM List of objects in related diagrams of the table key %PARENT% List of objects in related diagrams of the table key %PARENT% List of objects in related diagrams of the table key %PARENT% 1 -100 ShortDescription 9AA73B95-6AD6-4D89-A61D-896ED6AE70BE 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 5983649A-D689-4438-8358-BD84C9687038 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 2 4 1 1 DD773960-ECFB-4908-9972-51BF81001105 1520150582 xgc15 1520150582 xgc15 Microsoft Sans Serif 10 1 1 193F362E-639C-4134-87F4-AEBC8C4D8D3F 1520150582 xgc15 1520150582 xgc15 8587F65C-6068-4CA1-A7E2-5E680C6CCBBC 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 EDFE05A7-674C-4AD8-8FDE-2A58FA3B3CA2 1520150582 xgc15 1520150582 xgc15 新宋体 10 5 353 106 0 64270F8B-AB0E-4146-A4A4-341273F740CF 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 8 C2821889-1039-4967-9D1B-B7EA6E47F370 1520149496 xgc15 1520149497 xgc15 18637 3 2E750007-5228-4A14-A024-D959C98867C0 1520149496 xgc15 1520149497 xgc15 Times New Roman 10 1 2 1C5CA2EC-1DF7-479F-8897-CB2A9D538CD8 1520149496 xgc15 1520149497 xgc15 9549 2 328EF1B8-A40A-4213-91F1-41EBA3E7A1B3 1520149496 xgc15 1520149497 xgc15 19098 3 F47E36E8-D6CF-4242-BA30-8102CE505817 Simplified Chinese ZH-CN 1520149495 xgc15 1520149497 xgc15 F3A0BF0F-7536-11D5-A4D6-0008C79B4501 585CBB37-C940-11D1-BD0D-00A02478ECC9 4A321061-16C6-4615-9CD3-3553F85CFF26 Base_Table Base_Table 1520149495 xgc15 1520149497 xgc15 file:///. 160EB092-2F96-4235-852F-052B990C5A86 CDE44E21-9669-11D1-9914-006097355D9B 1520151663 1A538BB0-E6BA-4769-97A9-CA6737B443DB Report 2 Report 2 1520150885 xgc15 1520150885 xgc15 xgc15 %DATE% LightBlue_Theme.css Header_LightBlue.html Footer_LightBlue.html 54 18 4 0 Home_LightBlue.html Light Blue Professional 1 874FE50C-2094-4712-B6FC-24F32C4ACF0C 1520150885 xgc15 1520150885 xgc15 新宋体 10 1 4 423 106 15 0 4B0F34D2-7881-41A4-AC4B-9D6252361467 1520150885 xgc15 1520150885 xgc15 Microsoft Sans Serif 10 4 0 236EF371-9C70-42DE-BE93-DC07E2971186 Section_2 1520150885 xgc15 1520150885 xgc15 160EB092-2F96-4235-852F-052B990C5A86 1 TEMPLATE PDM %MODULE% %MODELNAME% Physical Data Model Base_Table 0 %APPNAME% %DATE% Page %PAGE% 页脚 0 ((800,900), (1100,900)) (21000, 29700) A85E645C-BC6C-47A6-B02A-4FA92D24E566 1520150895 xgc15 1520150895 xgc15 1 1 PDM_TABL_COLN_LIST PDM List of columns of the table %PARENT% List of columns of the table %PARENT% List of columns of the table %PARENT% TableColumns 1 -50 Name -50 Code D4B602A3-378C-4F04-A148-BAE7C8417F11 1520150895 xgc15 1520150895 xgc15 新宋体 10 5 353 106 0 63E440D0-03EA-4120-8011-A1601AAD5847 1520150895 xgc15 1520150895 xgc15 Microsoft Sans Serif 10 2 4 1 1 6510AA29-8C23-4053-A4F7-B0AC10A855FC 1520150895 xgc15 1520150895 xgc15 Microsoft Sans Serif 10 1 1 4E3348EA-87C9-42C4-A0AE-876120135501 1520150895 xgc15 1520150895 xgc15 8DDAED3C-1924-4FA6-B143-CD595101C7E1 1520150885 xgc15 1520150885 xgc15 Microsoft Sans Serif 10 8 0 EB033BAD-61BC-48B2-AC26-11E5331D048A 1520150885 xgc15 1520150885 xgc15 18646 3 B6BB36FA-79B4-43E2-9DC0-600AF38EE434 1520150885 xgc15 1520150885 xgc15 Microsoft Sans Serif 10 2 0 528C893F-98A5-4080-B7D1-7037CF12A3A9 1520150885 xgc15 1520150885 xgc15 9550 2 D6763196-1A27-4E44-98EF-E09120472F4A 1520150885 xgc15 1520150885 xgc15 19100 3 73D92C6D-2048-4842-B6F3-37E8B4D64226 Simplified Chinese ZH-CN 1520150885 xgc15 1520150885 xgc15 F3A0BF0F-7536-11D5-A4D6-0008C79B4501 585CBB37-C940-11D1-BD0D-00A02478ECC9 E4673642-D432-4422-986B-F85B6EA6399C Base_Table Base_Table 1520150885 xgc15 1520150885 xgc15 file:///. 160EB092-2F96-4235-852F-052B990C5A86 CDE44E21-9669-11D1-9914-006097355D9B 1520152423 C60A483F-DCF4-454C-A8F9-253B486E0BCC 数据字典 数据字典 1520151187 xgc15 1520151187 xgc15 xgc15 %DATE% LightBlue_Theme.css Header_LightBlue.html Footer_LightBlue.html 54 18 4 0 Home_LightBlue.html Light Blue Professional 1 3F8FF574-34C5-4481-9F02-561B28D9EA91 1520151187 xgc15 1520151187 xgc15 新宋体 10 1 4 423 106 15 0 804F4716-3DC5-42BA-93B8-6F335BE42DF3 1520151187 xgc15 1520151187 xgc15 Microsoft Sans Serif 10 4 0 A3C49456-5B20-4F86-A952-D2CC80BA762E Section_2 0 1520151187 xgc15 160EB092-2F96-4235-852F-052B990C5A86 %_HOME%\Resource Files\Report Templates\pdmstdus.rtp 1 TEMPLATE PDM %MODULE% %MODELNAME% Physical Data Model Base_Table 0 %APPNAME% %DATE% Page %PAGE% 页脚 0 ((800,899), (1100,899)) ((549,508), (660,635)) (20998, 29698) 27225498-E881-4429-AF71-B8CFD96FD7C9 1520151187 xgc15 1520151187 xgc15 1 TBLCTS PDM 6D12096E-0082-4875-96F9-B04EE1938805 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 AF77978E-B6AE-432C-A377-00EF7812F08F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 1 7BEBDACB-1FAD-4A33-853E-2F09200DF3DD 1520151187 xgc15 1520151187 xgc15 19098 3 B5FE9B83-2D7A-4B9D-8187-3AC1BCB81B33 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 350 1 6FED272A-6689-4CBF-84A5-933EFDA9A9C0 1520151187 xgc15 1520151187 xgc15 19098 3 29A9CF82-C295-4691-9128-739AB6005598 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 700 1 E62EC301-A284-4291-9CA8-46E6584DE2D5 1520151187 xgc15 1520151187 xgc15 19098 3 9FF9F60C-BE0C-41C9-B99E-0A1A02CC4E8E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 1050 1 8EA6E028-DD03-470D-8E47-3FDECD204172 1520151187 xgc15 1520151187 xgc15 19098 3 7D6B0D9D-0116-481E-9989-832F25460C12 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 1400 1 1BE62F52-929D-4FE7-A852-5B6860849896 1520151187 xgc15 1520151187 xgc15 19098 3 23B391DE-015D-402B-AB21-0C168A404943 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 1750 1 7C718E03-7390-42E8-AA02-07717A14BC33 1520151187 xgc15 1520151187 xgc15 19098 3 3EF0CA01-2604-4679-8233-2914519CCE8C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 2100 1 41A55C77-16C4-4133-A545-0CDABB32B2F5 1520151187 xgc15 1520151187 xgc15 19098 3 13A9B827-0A6C-424B-85CB-51940969B670 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 2450 1 961FB7A7-45F5-419E-9418-FCAB176A1EAC 1520151187 xgc15 1520151187 xgc15 19098 3 C19B959C-D5DD-44FA-99F8-94E64FE5323B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 2800 1 9FD83584-0533-413D-B2D7-FBA5517BD81B 1520151187 xgc15 1520151187 xgc15 19098 3 DB9B2955-8181-411F-AEF8-10AEC87080AC 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM PDM Diagrams 704714DA-CB4C-488E-984E-FF2260BA2CD1 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Model level diagrams C41330D0-13C2-4A56-9FB2-83BC33581DBF 1520151187 xgc15 1520151187 xgc15 1 1 PDM_DIAG_TITLE PDM Diagram %ITEM% Diagram %ITEM% Diagram %ITEM% 77E6BD1A-823C-4493-BE86-5161CF45F1B0 1520151187 xgc15 1520151187 xgc15 1 PDM_GRAPHIC PDM 1 1 9FF91CE9-85F6-4EDB-B517-B9B1CF6AD41A 1520151187 xgc15 1520151187 xgc15 Matrix Item Font Name 22959464 21916 1 353 106 B97F8695-EC75-4DFE-B5B3-DF4CA1A17480 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 3C96943C-4723-46F0-A73D-73F7A8AB9655 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 6254853A-29F5-4B53-BE20-52E39D0C9B1A 1520151187 xgc15 1520151187 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% Package diagrams %ITEM% 1 CB2B46B1-F9B1-463F-953E-BCE0DFBDECC6 1520151187 xgc15 1520151187 xgc15 1 1 PDM_DIAG_TITLE PDM Diagram %ITEM% Diagram %ITEM% Diagram %ITEM% DE81EACE-3C77-46EE-BEED-B1ED83FDE4A9 1520151187 xgc15 1520151187 xgc15 1 PDM_GRAPHIC PDM 1 1 268C0861-A121-4AA7-966F-EF5152D802EF 1520151187 xgc15 1520151187 xgc15 Matrix Item Font Name 22959464 21916 1 353 106 E2F69160-E1CD-4128-AA61-217C249BF693 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0E97C535-1A59-468B-A717-CB2BC259DB93 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 97087606-E711-439B-B678-1A2BE57BCA8C 1520151187 xgc15 1520151187 xgc15 1 PAGEBREAK PDM 0E04F935-76BF-4C47-B750-349B3B383F4C 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 C8FBE9A3-EAAC-4BB5-B7F7-B39E8BB0BE1A 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Model level object lists 78F16469-3048-4422-A482-0282E8069B8D 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Common Objects 52C24925-0495-4E9E-978F-C2D1A892B7F6 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_RULE_LIST PDM Business rule list Business rule list Business rule list 1 -40 Name -40 Code -20 Type 443AD121-A52F-4759-9A36-2F1A375359F6 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 83E38487-2723-4AE5-B923-50A0EAFB0365 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 9F38C21E-B136-445A-92B3-C7F2D286390F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 43623767-56C2-4C2D-9D5A-021D96E0584A 1520151187 xgc15 1520151187 xgc15 AD3270E5-A122-41B4-AC68-ECE33D454565 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_DTSC_LIST PDM Data source list Data source list Data source list 1 -50 Name -50 Code 51DAD11E-BCD8-42F1-A8EE-6BD6A6EE4A88 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 53AE0B0C-5B52-4F27-AD90-03A3A889F95C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D95B5C57-CD1C-454D-B2F8-BADFC26BB7D9 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 F70C0846-FB5C-4A66-86C8-44D893EBEA63 1520151187 xgc15 1520151187 xgc15 7DD69E6C-2024-4516-AFD2-4BAD7573572B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_DIAG_LIST PDM Diagram list Diagram list Diagram list 1 -33 Name -33 Code 20185D00-5F8E-46A6-9848-8C71471D5176 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 AFB2439A-143C-445D-B298-32133FA9EC0A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6E8B5757-21C7-4EDB-9F4F-3B631E30A443 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 DA3C017C-AC31-459F-841C-C473B68C4F0C 1520151187 xgc15 1520151187 xgc15 0F26E8C0-CB61-470F-B5C5-4CE55CEEF969 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_EXA_LIST PDM Extended Attribute list Extended Attribute list Extended Attribute list 1 -30 Name -20 DataType -20 Value -30 TargetName 5592295D-0A81-4583-92F8-FAB7C46B233A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 EF0F9088-AE58-43A7-B2CB-01F970F94A09 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 09BC9D2F-3F79-49C3-9D9C-755E709E14FA 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 F819AC17-0065-480D-8A91-C621E4BFE277 1520151187 xgc15 1520151187 xgc15 E68BA1D8-B97C-4785-AC4B-F718C8D9ACE4 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_FILE_LIST PDM Files list Files list Files list 1 -40 Name -40 Location -20 LocationType B379DCBA-3EB6-49E8-AF11-274B78F36C42 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 B33F05FA-A21E-4585-911A-AA5097CA9266 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 1F194AFD-271B-41CE-BD8A-F8989C210844 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 76584274-2D33-4BE5-8C49-BD26D0F80CEE 1520151187 xgc15 1520151187 xgc15 EAC31485-04F5-49C4-BB68-B9C53141F949 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_PCKG_LIST PDM Package list Package list Package list 1 -33 Name -33 Code -33 UseParentNamespace 76F4A0CC-8997-47D6-A947-D7BFE20F3D75 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 BE4544A5-FEC9-485E-8A3E-0AF74D53D084 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C7228BDD-A0F6-4C21-A5EE-42DF679AA09B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 C8F96355-DE2B-4496-B540-9A47B35F8904 1520151187 xgc15 1520151187 xgc15 50B81E4F-CB92-4B74-8EEC-454A6A2EF353 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 2B5A917E-A200-4334-91C9-D9E82AB3170A 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Physical diagrams objects 9977D4FC-B925-462F-849A-EB9CEE43A958 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_ADTS_LIST PDM Abstract Data Type list Abstract Data Type list Abstract Data Type list 1 -50 Name -50 Code D26EA485-6B70-4656-8F9B-64A632240804 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 0C4BF186-9DDA-44EC-A696-AF69C06FAA28 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 E89B3F1C-D2A7-41A7-8A83-79B6F3CD8661 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 0C64A5DA-291D-442A-8884-1DD188C01CC9 1520151187 xgc15 1520151187 xgc15 A4E094D0-960D-4AE2-AF1C-32CA5E5D783C 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TABL_COLN_LIST PDM Table columns list Table columns list Table columns list 1 -50 Name -50 Code 67181DBF-0DB2-44B8-BAB7-84B4073E5E7A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 D4D4BE52-EC60-4CD8-9BD8-1EC7CE829302 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 FA329696-01A8-46C3-8B21-8EE67FBF5CC4 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 F5D90461-7B8D-4B0B-8B7E-CA0840395557 1520151187 xgc15 1520151187 xgc15 E4ED7D9A-DF6D-4DE2-84A5-EE469E96B67C 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_DOMN_LIST PDM Domain list Domain list Domain list 1 -30 Name -30 Code -30 DataType -10 Mandatory 86093040-31BD-4904-A747-445E7B9FB9BE 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 4951F6EE-1A9F-44D3-A327-7253383041C3 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A0F4404B-01AC-4F2C-B119-547D284B8CA8 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 DC9A0C2E-7D59-4FEC-9F2D-D057F19D2941 1520151187 xgc15 1520151187 xgc15 FCBA6C76-F9FB-4114-803A-947BA1EC1990 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TABL_INDX_LIST PDM Table indexes list Table indexes list Table indexes list 1 -33 Name -33 Code 15 Unique 15 Clustered 15 Primary 15 ForeignKey 15 AlternateKey -33 Table F9363510-6144-4C8C-9ADE-26A37F9FE444 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 90B2F00B-18AA-4B18-96CE-BECB216061C6 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D4CB3152-EA3A-4032-9D1B-FD8B7F979C15 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 B3F0075D-7767-43B3-A88E-E368DD00FE08 1520151187 xgc15 1520151187 xgc15 803DDD9E-21DB-4BBD-A0D4-D700BDEE5016 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_JIDX_LIST PDM Join Index list Join Index list Join Index list 1 -50 Name -50 Code 229CAA7D-653F-48A5-8A8E-FD67660599CE 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 B284D6CD-19B6-4779-8F34-B52D00279F1D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 75B8D35D-58A2-4E24-9416-F67422D51982 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 132BE5D1-B91B-4E86-BF36-5FFCAE21CF74 1520151187 xgc15 1520151187 xgc15 EC51259C-1FEC-4979-9E59-4DF2CDD23E25 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TABL_KEY_LIST PDM Table keys list Table keys list Table keys list 1 -33 Name -33 Code -33 Table 9392E0CB-A806-47BD-8213-D3B880132540 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 0DD23A65-AB17-484E-A301-CEB50E75DFA1 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 16A31AB3-9AAF-49CE-801F-D244A1C60331 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 47932A5F-FFC3-43C8-B5A2-C1AE213F9107 1520151187 xgc15 1520151187 xgc15 0DF6A1A2-B43F-4900-B5AE-676F57A4FFF6 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_PROC_LIST PDM Procedure list Procedure list Procedure list 1 -50 Name -50 Code 64A9BFC3-0CC7-4DBB-BC08-D7BB1B652824 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 EFEC238E-D487-42A2-B3D6-0CB50055D8AA 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 F9667768-C7CC-489D-ABE0-C5C7EA8B9BDE 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 191178B1-DBCB-4978-AAA7-B8E192E072A9 1520151187 xgc15 1520151187 xgc15 5D10AC2F-69F7-43DC-80EA-7DE1DC599278 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_REFR_LIST PDM Reference list Reference list Reference list 1 -25 Name -25 Code -25 ParentTable -25 ChildTable 9A04D847-5F4D-41F7-9049-30947C440CD6 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 4567E8AD-DDE0-4F80-9CB6-A16EE2ACDED9 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 AEC6683F-B078-4330-A597-585064FE78CB 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 A88ABE9A-5E27-4F89-BC14-ADDA31D331B2 1520151187 xgc15 1520151187 xgc15 30571371-AC5C-4F41-AF49-2F19DB66E4D3 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_SQNC_LIST PDM Sequence list Sequence list Sequence list 1 -50 Name -50 Code 70480FE3-7CB2-412F-B63C-AF222CD2288B 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 846EB801-B113-4782-8ECE-BD9DD56E426C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 28D7D844-D62F-4F72-B146-3EF274FBE72A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 37BB38DC-6AB3-43C6-86B0-AE42C9580330 1520151187 xgc15 1520151187 xgc15 4B6327BB-3BF8-45E6-8B88-9467C5195F17 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_STOR_LIST PDM Storage list Storage list Storage list 1 -50 Name -50 Code AEF41369-F157-44B4-991A-D6E09AFB90BF 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 BFDAA330-9BDB-4232-A900-52C03A40CE7F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 8EE8972E-F7E2-4CF9-8AB8-F4CC6EB17EFE 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 E43B5734-6659-4E17-9BE3-B1B429A4B6DA 1520151187 xgc15 1520151187 xgc15 60100057-5243-48FA-8F4D-89467207061A 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TABL_LIST PDM Table list Table list Table list 1 -50 Name -50 Code 97B6A284-43D6-4454-9040-3525C9E4840C 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 697DB81A-5684-4095-BB04-74619D4F1E38 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6ACA907F-6D11-4248-A44F-61E712C32D5B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 4E7DD767-7586-4E3A-BD4E-A9AE203DF3A0 1520151187 xgc15 1520151187 xgc15 679FBFE9-357D-479D-AB6A-32C2187384AE 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TSPC_LIST PDM Tablespace list Tablespace list Tablespace list 1 -50 Name -50 Code A882668E-E00C-455D-B6E5-537F8EBE8CC3 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 39AED3BC-8B6F-4F68-A74D-5280B8F739B7 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 CB14BE5C-EAD7-4946-B7BB-E00288B66C83 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 A64A21F5-8E82-411C-85C6-ED7E41E67DAF 1520151187 xgc15 1520151187 xgc15 982601C9-A820-4A34-A643-B55CC433980B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_PROF_LIST PDM Test Data Profile list Test Data Profile list Test Data Profile list 1 -50 Name -50 Code 417C140A-1467-4DD2-83DB-A270EAC587FB 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 0F2134E6-47BC-45A7-9109-F59A23989C77 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 45C1B41E-D7DB-4281-9D6E-E6A42569B086 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 0DBE65EA-C660-423A-B835-E7F9991BA409 1520151187 xgc15 1520151187 xgc15 981001E8-D59D-466B-9DE1-C60325FF90E9 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TABL_TRGR_LIST PDM Table triggers list Table triggers list Table triggers list 1 -50 Name -50 Code 5C66AE22-5BC1-473D-B427-EE3FAF87DDCC 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 B51ADA7E-2A2A-42A5-87BF-63287FB17442 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3CDB3473-7988-4EDC-812C-3A59ECD1FBDF 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 0A3FB1E4-B4FC-42FF-B1F4-B766133926E2 1520151187 xgc15 1520151187 xgc15 C18F36C9-2265-4D60-B7BC-E64D5C046903 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TRGI_LIST PDM Trigger item list Trigger item list Trigger item list 1 -50 Name -50 Code FF436B5E-BB78-4AF4-9DB1-ECE31E46BAA8 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 ABD1D8E2-15C4-4B24-9991-BC776A91027C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 724F7F87-83C1-4039-BA6A-453C1CE03D2E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 5D3326FB-FF42-4234-8035-EB9D335423D1 1520151187 xgc15 1520151187 xgc15 DEB33FD0-EB02-4D91-A3A3-0DE5E6D09FF3 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TRGT_LIST PDM Trigger template list Trigger template list Trigger template list 1 -50 Name -50 Code 3082E3B9-A86E-43CA-8F96-82F520F54A2E 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 A61F27E0-CA4F-4419-A196-14005D7054CB 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3D9C36DC-7B63-4ED3-AF30-CA4F258970AB 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 F72D7810-D7C8-4252-9A26-180DC723962B 1520151187 xgc15 1520151187 xgc15 96AEFA52-C3AE-4116-8F93-D4AF767E3B34 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_USER_LIST PDM User list User list User list 1 -50 Name -50 Code AA41DC45-3FEC-4E46-94F1-20C17EA84E4F 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 4D299C62-9AAE-4D33-A3FB-D0A94C274F0D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 ACD5DA27-3AEF-4870-A3FA-E1780539BA01 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 6F49140D-B06A-44A1-9958-570B24AC65BC 1520151187 xgc15 1520151187 xgc15 33041100-B562-4DF1-B5AE-029CC70A4091 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_VIEW_LIST PDM View list View list View list 1 -50 Name -50 Code E43F90E2-7EB5-4302-870E-1322F15C7B65 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 BA1E6B39-F826-4FFE-A4D0-7AD9CEAB8DA8 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 8560DB51-846E-4075-A1DC-06585EA7E967 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 4BE10315-31DA-41EB-8D83-316E755A0C43 1520151187 xgc15 1520151187 xgc15 21E5E51E-1132-439C-A645-3D4C2A8E4797 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_VREF_LIST PDM View reference list View reference list View reference list 1 -25 Name -25 Code -25 TableView1 -25 TableView2 7824F9B7-A9F7-4D4D-AE40-D7986D56797C 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 A830CED1-47F2-49C3-B915-82E3274549A2 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 4031ED9C-AC94-4542-A20C-A3243C22BC4F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 D80796EC-B5FE-4B85-A90D-8934479A79E3 1520151187 xgc15 1520151187 xgc15 AE4BFA79-EDB0-4FF1-B82E-E928A5355B15 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_SYNM_LIST PDM Synonym list Synonym list Synonym list 1 -50 Name -50 Code 7754B474-0C5F-4674-9C2A-A1050911E510 1520151187 xgc15 1520151187 xgc15 Arial 10 5 353 106 0 6EBE4F89-EADB-4F95-BC31-A14AF63C1624 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 4 1 1 EBF6D6DC-48B4-466D-8FE0-E627AD19E5C6 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 1 C9682A46-8E4D-4B9A-B5B0-234302336485 1520151187 xgc15 1520151187 xgc15 9BF3831F-6D5F-41FE-A2F3-7158B93018B6 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 36EA68DF-5E05-4227-A6C3-E54AB6879160 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Multi-dimensional Diagrams Objects AF7E2C34-FD15-48B3-92A1-B86404600597 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_ASSC_LIST PDM Association list Association list Association list 1 DF2042A6-37A3-4E17-90F2-476FE87FA706 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 7E77BDFC-29B3-4EA9-BD8E-94EFDBF5E0C4 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 8DD1AE6F-1FE3-49C8-A411-A60EBD657FC9 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 CDBDC290-5A22-4E67-8C78-D08A629BAB1E 1520151187 xgc15 1520151187 xgc15 6BDC3A4D-4956-4655-AEE8-8D11ED47F68B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_DIMN_LIST PDM Dimension list Dimension list Dimension list 1 -50 Name -50 Code DC76E0BD-8C22-4D16-816E-D66C2C830B83 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 78A41FEF-1885-47A1-B838-B8F0A95145D9 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A0BE1D4A-3125-4523-A2EB-94521340FF84 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 706F9377-BA2F-491D-9AE4-9A08156583E1 1520151187 xgc15 1520151187 xgc15 70EFD9CA-9111-4A6A-84FE-4CF2E7BCABA7 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_FACT_LIST PDM Fact list Fact list Fact list 1 -50 Name -50 Code 259F146D-BCAF-4E03-8983-9A9E634EE928 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 5CF1FAB1-ED55-4C4B-B543-CE7911F5DEFD 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 9F0C7486-E405-4E58-AC65-7E317AA087B6 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 47FAF41E-B98B-437B-84F4-28146B78B293 1520151187 xgc15 1520151187 xgc15 72EABF15-6038-42B6-A934-71649BE11F67 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 05E41949-3EF8-416A-A256-668873DB8F22 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 50E8514B-C427-465A-8E49-36E0CF2047CB 1520151187 xgc15 1520151187 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% List of objects for package %ITEM% 1 Packages 27DC2851-7A33-470B-8AF5-29BE452567FD 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Common Objects 9FC1DD13-E19C-40D2-9BEB-BA1E7967FD4F 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_DIAG_LIST PDM Diagram list Diagram list Diagram list 1 -33 Name -33 Code 217BF0C5-B53B-4F3F-BE94-6EDC2932A3C3 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 21FF2026-49C7-45C6-A0CE-DE1E6F22AB16 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D87DE588-1DD9-49CA-B85F-1ABB54EBEE78 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 F250646D-04CB-4249-B423-7695F8C26218 1520151187 xgc15 1520151187 xgc15 9CE17B9D-FB07-4474-9237-7BEA5231EF1B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_EXA_LIST PDM Extended Attribute list Extended Attribute list Extended Attribute list 1 -30 Name -20 DataType -20 Value -30 TargetName 127BE89C-137C-47C1-91C3-C5654833E018 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 DF2A37C7-8E6D-49A0-B783-AEA33076E63B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A66A186C-F16F-486C-80A7-20A5BF299046 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 17E06212-4F6E-47B4-B357-602AAE5AEA85 1520151187 xgc15 1520151187 xgc15 F3213664-0B9B-45EF-8E89-8B43E02F4458 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_FILE_LIST PDM Files list Files list Files list 1 -40 Name -40 Location -20 LocationType 914D044E-324B-4A14-9D97-96328F3ED6F2 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 7CB1CEC6-6294-4CAA-9CCD-396F57ED7417 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3423E98B-4623-41CD-B753-E46E7925E18A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 51F623B9-C8A4-464C-9BC4-733A111E93A0 1520151187 xgc15 1520151187 xgc15 1C2D776D-78AB-4C2F-B40D-A9FF4190FE28 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_PCKG_LIST PDM Package list Package list Package list 1 -33 Name -33 Code -33 UseParentNamespace E1FFB9B8-9DA1-4244-8AB4-7345122F744A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 2457601D-42A4-4B8B-B8C0-CF922E59B8D0 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 96E6C50F-C5C2-46C2-B598-B5041619DE47 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 CF3487C0-5663-4AB5-9310-F607CDA33BD2 1520151187 xgc15 1520151187 xgc15 9D230F63-D1A8-4C68-A1C7-E3B6D6B4C6D7 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 989F4CBA-6DBA-4E91-A6CB-29EA90B05E7F 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Physical diagrams objects 43FB0DE1-6DA9-47CA-BA2B-70A15763A328 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TABL_COLN_LIST PDM Table columns list Table columns list Table columns list 1 -50 Name -50 Code 3AA12604-3FC9-49D3-A629-409AECC1AA1A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E546D650-10DE-47FB-9E5C-AF2407CFF222 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 606A418D-807B-4F6B-82C0-DC139A475F41 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 8C18F27B-FC0B-4C79-A067-476EBDE147B7 1520151187 xgc15 1520151187 xgc15 9E116855-BA65-4AC4-8C87-B8E47546BBC7 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_DOMN_LIST PDM Domain list Domain list Domain list 1 -30 Name -30 Code -30 DataType -10 Mandatory 8C5B1098-CCE7-4DF6-B71B-876AA347BD10 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 A6F47924-8728-4EB9-B874-890FFE06E262 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A26638C6-B54A-4933-9FEF-4E7368965235 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 75FB11B8-8E2E-46C5-9C43-43D0ACB0F77C 1520151187 xgc15 1520151187 xgc15 9C2DBCEA-9F0D-4473-AC30-2B1191F1D07B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TABL_INDX_LIST PDM Table indexes list Table indexes list Table indexes list 1 -33 Name -33 Code 15 Unique 15 Clustered 15 Primary 15 ForeignKey 15 AlternateKey -33 Table 5F7F7A4F-B518-40D9-9C25-1D40803799D7 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 4847A49D-3CC6-4401-91FB-0020D8D8F158 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 F938EAD7-6FF3-482D-B178-1398BC3DB86D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 E0FE5345-FD27-4CA0-A7A6-2F278A6B7DA7 1520151187 xgc15 1520151187 xgc15 71681809-F766-4DCB-AEFE-12F35B513699 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_JIDX_LIST PDM Join Index list Join Index list Join Index list 1 -50 Name -50 Code B5891F9A-B02B-4CA3-B662-DEDA30AA0384 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 BED96078-DCCA-4D45-BD37-B485C509A059 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D4A5C952-5329-42A8-B18A-71651ACC4805 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 1D10D5AE-2069-4F68-8D53-75EAFABCBE9B 1520151187 xgc15 1520151187 xgc15 09629B49-C76A-4F14-857F-EAFB934D4ADB 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TABL_KEY_LIST PDM Table keys list Table keys list Table keys list 1 -33 Name -33 Code -33 Table 106C40BB-A998-47CF-913E-0D2EB79662E4 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 246A308E-4057-4A4B-8D4C-9372877DE80E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 99F7DF83-D604-48C9-8C61-EC4C93745213 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 0643CDD6-990D-4EBE-969F-2ECAAAC1E0F8 1520151187 xgc15 1520151187 xgc15 53D40C78-D78A-447A-9894-9F658F76D569 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_PROC_LIST PDM Procedure list Procedure list Procedure list 1 -50 Name -50 Code 0946BC28-99A8-44D4-AD38-CBC862A1F0DD 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 857F3533-20A0-4C00-91DD-19BED1C37742 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B71856F0-2F59-49A1-83D2-F60C840A4F48 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 2022D117-6888-4260-B829-8E58A48FCF84 1520151187 xgc15 1520151187 xgc15 193AAA52-8BBD-48E9-A1B7-961502D984C6 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_REFR_LIST PDM Reference list Reference list Reference list 1 -25 Name -25 Code -25 ParentTable -25 ChildTable FBCDD09E-58F8-4F2C-9D66-20C83620A1D7 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 EA322B82-C0B7-43E3-8B65-B712F50CA311 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 FDB0F2AC-701A-49DF-93A9-F7FE5CBADF35 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 69A6CDD0-3168-4925-9788-6FE6A8B2465C 1520151187 xgc15 1520151187 xgc15 9B555AB9-48FA-4301-ADAE-D5EDAA700424 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_SQNC_LIST PDM Sequence list Sequence list Sequence list 1 -50 Name -50 Code 19209452-822D-4395-B791-256167C9872E 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 1158A21E-5842-44D8-BB28-4F8041F05580 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 BC17A0A2-A065-407F-B489-37FA604754F9 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 44C94ECF-CB48-4471-8C93-9E5392F40A07 1520151187 xgc15 1520151187 xgc15 C244877F-AB98-4B9A-9242-7A4FE23061D4 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_STOR_LIST PDM Storage list Storage list Storage list 1 -50 Name -50 Code 2FCD6A59-9012-4A74-AD12-E25CF1CE0044 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 B8276B55-EAFA-4F22-8892-B1E772BAC679 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2DE2FC3B-1498-4363-8150-10C062D2EF7D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 E53F487C-8EEA-4EF9-8D3E-986B8C161337 1520151187 xgc15 1520151187 xgc15 B42A854B-7225-4EBF-BE10-BE31D1319ACD 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TABL_LIST PDM Table list Table list Table list 1 -50 Name -50 Code 986B3EF8-9A4A-4235-BB5F-8E1884930864 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 42C17DAF-765C-405C-9F37-9A012F1E27BE 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D3F7D852-6176-4E68-B1CA-C32847040F88 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 C3A3D2F0-662B-4FDA-8DF4-0481D73E4559 1520151187 xgc15 1520151187 xgc15 AB66ECB6-38AE-49C2-876B-245F12838010 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TSPC_LIST PDM Tablespace list Tablespace list Tablespace list 1 -50 Name -50 Code 2DC82754-9D40-409E-AADC-452D923EABE6 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 532CBCB8-DE97-41B5-8173-A1D2E77DA3AF 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 BB3BAFFE-B789-4DCF-B43B-274966B71A3D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 08D4685C-5416-45D3-9B4E-32DCF3DE5C54 1520151187 xgc15 1520151187 xgc15 AC08D3EE-02AF-4FBE-B373-B1D62614E25F 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_PROF_LIST PDM Test Data Profile list Test Data Profile list Test Data Profile list 1 -50 Name -50 Code 271B8CC9-BB24-46F5-8424-30B3F8FFFB32 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 13B1C10A-4F60-4C04-9184-2A92BC1D815B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 CDC4CE65-35B2-4026-A805-6AAA9A64F73F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 6E1DF0E9-4C8D-4322-A534-192E8A8CC0C8 1520151187 xgc15 1520151187 xgc15 5AC387CD-C1D4-4604-A24C-8EC128D9D061 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_TABL_TRGR_LIST PDM Table triggers list Table triggers list Table triggers list 1 -50 Name -50 Code 12C6448D-6782-466F-8C1E-45E3F063981C 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 9CA0113F-00DF-4BE4-BF1B-495612EEAA7F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 F5904E8E-445C-419D-9654-973E2F62E20B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 9FC835B8-BD29-47C6-B38E-B4FB98230B75 1520151187 xgc15 1520151187 xgc15 6766DD4F-7327-4AB5-9DCC-65A6B0C8B3C5 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_USER_LIST PDM User list User list User list 1 -50 Name -50 Code 10DC2209-FF27-48E9-821F-4354C755F49E 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E02B0692-1592-49E9-B54D-0E093964086C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 23D4E1F0-7F13-442E-9411-3BBD2E1CE54D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 9D20DAE5-0636-4044-82A9-05F6C2E990AC 1520151187 xgc15 1520151187 xgc15 4177BE3A-B935-4CC1-86C2-AD194D5B8FD5 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_VIEW_LIST PDM View list View list View list 1 -50 Name -50 Code 63E1691C-1661-4CC8-8375-F7792588D5AC 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 7723DC2E-2493-41FA-86E4-BBACD9461CEF 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 056DA258-AAD9-4CE9-AD96-6B920EDAFB2B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 D9C933E6-1675-4658-8CC2-B54CB3D86DCB 1520151187 xgc15 1520151187 xgc15 4A834C9E-E247-4B35-A839-46870E605012 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_VREF_LIST PDM View reference list View reference list View reference list 1 -25 Name -25 Code -25 TableView1 -25 TableView2 1AB34B0B-2010-420E-A4EE-5ADDD6536630 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 20098E62-FDAD-4248-9C5B-B1A5AF25A30C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6F6F6D9C-BD26-4ECF-A383-37D191E6ABDE 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 64F4E52E-1A40-497E-A810-CDC5E9FF6F41 1520151187 xgc15 1520151187 xgc15 B92E908A-C9CE-4D33-A25B-C2097F0F2BEF 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_SYNM_LIST PDM Synonym list Synonym list Synonym list 1 -50 Name -50 Code 88E62E8F-9412-49B9-B2DB-D4B6BA4205C1 1520151187 xgc15 1520151187 xgc15 Arial 10 5 353 106 0 5BAACC8E-AB93-4565-9AB7-B0F31191E9C8 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 4 1 1 11CCFAAB-E597-442C-8FD1-85B9F93D1B72 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 1 0F9127B4-48F5-4268-AEA1-4DD99830A519 1520151187 xgc15 1520151187 xgc15 E2E6FE00-0221-4C31-9436-A36779C37B5B 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 1C92B4D6-C296-40EE-ACAA-DD1BF423F139 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Multi-dimensional Diagrams Objects BE68FF49-ABCD-4165-91DB-CBA7E3347EEF 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_ASSC_LIST PDM Association list Association list Association list 1 4F1BCD77-D72B-4A33-A4AB-8F1DB69D0F9B 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 04961ED9-8A19-4C5F-819B-23EFB09A8D0E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 62BA040B-5A3E-4780-A62F-55949BE4DF2C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 B4F1E9DE-3135-4B1C-90CB-5BA6E90C6D97 1520151187 xgc15 1520151187 xgc15 E00CC7E1-B174-46E8-A70E-430EA05371E5 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_DIMN_LIST PDM Dimension list Dimension list Dimension list 1 -50 Name -50 Code 509AF360-1DD8-4096-A245-5EF3CBF955C8 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 FF42F206-8D8C-4583-BF0D-421D2D73A974 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 AFB1AA95-A08F-49F1-ADD0-1F56ED9D2EC3 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 68060778-5BBA-4677-A91B-D80315A07E86 1520151187 xgc15 1520151187 xgc15 EE53A3C9-CBDB-404E-A1AF-0C5209389954 1520151187 xgc15 1520151187 xgc15 1 1 PDM_MODEL_FACT_LIST PDM Fact list Fact list Fact list 1 -50 Name -50 Code 9C70E234-63F7-4797-A1E6-C06A9A92CA19 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 B6FAB691-D03C-464D-90A6-09707753C7FF 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 AFE3F04A-465C-402C-9DF3-0B7AF98DEE59 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 2740B8CD-BF65-446A-98D8-73E674F2C138 1520151187 xgc15 1520151187 xgc15 9866F4DE-AD95-4271-92F7-A53513FBC06D 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 4970FE59-ED79-4AED-88D4-154F8538E066 1520151187 xgc15 1520151187 xgc15 1 PAGEBREAK PDM 90511B93-2BCA-4CD5-AA07-F3D1DD5D43AA 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 D0BBD5F6-FC79-40DC-8607-362300989FE9 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Tables D2BA4CED-47A3-4DE3-AD03-D3DEE0CED638 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Model level tables B17C85E7-E316-4AA9-90D4-2ED482FD68A2 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TITLE PDM Table %ITEM% Table %ITEM% Table %ITEM% A3D01512-3CC0-4FFB-8A02-6E7F2584D1AE 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CARD PDM Card of the table %ITEM% Card of the table %ITEM% Card of the table %ITEM% Name Code DBMS C3B0F8E1-76B2-4F9C-8137-CA32C0910725 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 7CD2110A-E329-405B-98C6-E68442FB80D8 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 D0DB9211-9E96-4B5D-AEAF-D1B43A40D9A8 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 02D8CB52-39D0-4890-A5C2-F09F164B6158 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_DESC PDM Description of table %ITEM% Description of table %ITEM% Description of table %ITEM% 7EA39F86-C352-4A08-97E4-3BD65D59C704 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 DAB932C6-09FA-4887-B10B-23032A2740B6 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 5342B3C4-448B-46F4-A79F-E127C5F8F13B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_NOTE PDM Annotation of table %ITEM% Annotation of table %ITEM% Annotation of table %ITEM% 8DC59206-2235-4A57-8515-85DF96C780AA 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 D81DAA41-31FA-46CD-9701-CE32C9C0B21E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 90395FB1-C97E-42FF-BD10-CA20F15C98DA 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CKCN PDM Constraint name of table %ITEM% Constraint name of table %ITEM% Constraint name of table %ITEM% 52E883B8-79EB-42CB-A257-3BAEC05D1186 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E0B53380-1608-4C36-8E97-75ACD4500C99 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 E39D1A54-AD9F-479D-9BFD-973DFA013E11 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_OPTS PDM Options of table %ITEM% Options of table %ITEM% Options of table %ITEM% 41F6F0FE-52CF-460F-81B6-26E9ACE79205 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 A7CDB8B7-E08C-4BB5-B681-7D31010BC9A4 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 2CCCCE64-4789-4EF0-9DD6-414E7684F8F0 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CRUL PDM Client check expression of table %ITEM% Client check expression of table %ITEM% Client check expression of table %ITEM% DA1967BA-FE75-4A2C-9C90-62E6FBD62EC2 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 AE7CCCEA-1085-4493-B8FD-0B338FB25D27 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 D02AD1EE-DB37-4752-ACEE-A1FACFB8C369 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_SRUL PDM Server check expression of table %ITEM% Server check expression of table %ITEM% Server check expression of table %ITEM% 0910C831-5A1B-48FD-9184-AFD51E694E05 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 A7185E47-4082-4D17-8C68-817A9215F731 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 E2F03E7A-7EA1-4EA8-A9F0-B0A76F55097B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_HEAD PDM Begin script of table %ITEM% Begin script of table %ITEM% Begin script of table %ITEM% CED97ECA-C684-40D0-9345-9732B158A2B1 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 3352F075-58BD-46D3-BF17-2251C25FBC8E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 EB05C860-2C0D-4D2D-87E5-97FEA412C710 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_FOOT PDM End script of table %ITEM% End script of table %ITEM% End script of table %ITEM% 3423913F-4093-4029-A2EA-0E224A1068C2 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 8A96282C-E98D-4562-B30C-AD478961B362 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 BCEA23C4-4894-446E-8831-F4BC5007E961 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 299B3C1A-F98D-4311-986C-ADA65B5865A4 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 90FB4714-E320-44C9-9A15-59CDCE2025E6 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 24CB08F9-5F85-4BD1-895E-6284EF4D9EAE 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_DIAG_LIST PDM List of diagrams containing table %PARENT% List of diagrams containing table %PARENT% List of diagrams containing table %PARENT% 1 -50 Name -50 Code 432AFDD3-6663-45BF-B527-97AB91D50A14 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 A1D7E406-B1C8-49F2-9982-8F36AF7B6BD5 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A28DA089-2B1A-4E3D-9B61-6B266CB14F46 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 5A269020-8841-4FBE-89C1-DC2F5571F207 1520151187 xgc15 1520151187 xgc15 C7398BAC-B906-4B3E-BC9F-C6EC806C0425 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_OUTREFR_LIST PDM Reference from list of the table %PARENT% Reference from list of the table %PARENT% Reference from list of the table %PARENT% 1 -30 Name -30 Code -40 ForeignKeyColumnList 97F975C9-B9FA-4BB8-9794-6476F465218F 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 B3C3B278-9586-4092-8F93-5ED8B61BFEE0 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 E3B56A29-4CDC-4B57-8209-A45FF705E9C5 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 A1FEED2A-D00E-4159-AF16-56663D6CD9EA 1520151187 xgc15 1520151187 xgc15 D442435C-17B3-472D-9935-E143D1109AA6 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INREFR_LIST PDM Reference to list of the table %PARENT% Reference to list of the table %PARENT% Reference to list of the table %PARENT% 1 -50 Name -50 Code 8EC97202-525C-406C-99CD-74D11FF70E25 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 9541EAA0-C1F1-4D77-A005-7428B110B6F9 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 F501373B-81B2-4938-9DAC-FDE4948D32BE 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 EF4E15B9-EAD1-4533-90A2-CFADCC8E5636 1520151187 xgc15 1520151187 xgc15 CA085900-DC8C-41D3-82AA-EE10FA08715C 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_RULE_LIST PDM Rule list of the table %PARENT% Rule list of the table %PARENT% Rule list of the table %PARENT% 1 -50 Name -50 Code D22B27ED-FD62-4026-98AD-52A04ED9F3FF 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 D4EFC273-5D77-4EB4-8C1B-EF5296C5385B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 0E30097D-6490-40E6-A3D1-36B54AEFC180 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 2E2A4F68-44D9-411D-BAA2-0FDB26EE7472 1520151187 xgc15 1520151187 xgc15 83BEB3CD-AF90-4F37-94AD-67B09A30B1F8 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_DEPND_LIST PDM Dependent Object list of table %PARENT% Dependent Object list of table %PARENT% Dependent Object list of table %PARENT% 1 -40 Name -40 Code -20 ClassName FBD21BC8-82B9-4EB5-B05F-BA7E61D35850 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E38124E6-E07A-43DE-A850-4E0CF8EFD18D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A000DCE3-12E3-4F9C-B5F4-04F5A3A16525 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 9FBFE327-DD72-490A-AC46-5FCF28A0EFBC 1520151187 xgc15 1520151187 xgc15 D6C02708-4F21-4F44-816C-F861CD8D6CE5 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_EXA_LIST PDM Extended Attribute list of table %PARENT% Extended Attribute list of table %PARENT% Extended Attribute list of table %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName A3EAA1E6-57BB-41D2-B3B0-73EEC69F1311 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 BF9DF718-A3A8-4B50-B49F-B1EF29B3BD53 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 94DB910D-1756-4BEE-A7C3-6CD43CEF215B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 1E6D342E-05E8-429A-ADD7-CA6A930BA945 1520151187 xgc15 1520151187 xgc15 210AFFAC-A7A0-4159-80D4-91FE8B18CF05 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_USRDEPD_LIST PDM Extended Dependency list of table %PARENT% Extended Dependency list of table %PARENT% Extended Dependency list of table %PARENT% 1 -33 Stereotype -33 InfluentObject -33 InfluentObjectType 0A0385BC-BF2B-4057-98E6-32AB676C9A46 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E017F2B8-7806-46BF-A314-16E464AF4BA4 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B5EB8E52-3716-4E79-AACD-26FB162E5931 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 8E838864-33D4-45B8-B7D6-6C38288CA9F9 1520151187 xgc15 1520151187 xgc15 79E9F8F2-26F2-45DB-8C9A-2317F495B115 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_LIST PDM Column list of the table %PARENT% Column list of the table %PARENT% Column list of the table %PARENT% 1 -50 Name -50 Code 1690FBA3-6C9B-42AC-913D-6EB22F8434C6 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 7F100B05-C982-42D8-B589-305FD88494ED 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3C2EF127-6EEE-4F79-BD75-05854ADA4222 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 269004B5-5A23-47CA-8F89-8C22FF3B6567 1520151187 xgc15 1520151187 xgc15 79CDBDD3-D257-4676-933D-49CE7F36A34F 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_GROUP PDM Column %ITEM% of table %PARENT% Column %ITEM% of table %PARENT% Column %ITEM% of table %PARENT% 99D60897-9CDA-4624-AE19-DCE7DA8BE8A2 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_CARD PDM Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Name Code DataType Mandatory 3ADF8CD6-BC67-4116-84A1-D739B5A76FE3 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 B4AEA30E-B543-4496-BC5D-0C80AD688C20 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 5A6F2A1C-3305-4485-A884-798EA9330EE2 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 19823A86-D8E0-4E87-A03E-53A1B0A47DE0 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_DESC PDM Description of column %ITEM% of table %PARENT% Description of column %ITEM% of table %PARENT% Description of column %ITEM% of table %PARENT% F0A694A1-3EC4-4258-9942-5B83535B951F 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 384E11D2-1F1E-4FAE-94AC-86E831DC7A6A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 A011855C-2A91-482C-B571-B2BF5AF08613 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_NOTE PDM Annotation of column %ITEM% of table %PARENT% Annotation of column %ITEM% of table %PARENT% Annotation of column %ITEM% of table %PARENT% 15A537B3-F524-43A2-B550-737A3B250D81 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 54980C3E-C5F1-4D65-A51A-3CCCC1E899C4 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 6C837863-5976-4FD0-B40D-F94C7B3E4B78 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_CKCN PDM Constraint name of column %ITEM% of table %PARENT% Constraint name of column %ITEM% of table %PARENT% Constraint name of column %ITEM% of table %PARENT% 038A91AC-3C36-4DE1-8B57-B30D66F8D90A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 7A6822BE-B160-4301-A2E4-016978C22784 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 847AC2CC-861D-424B-B2E5-2DA1CB33F632 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_CHECK PDM Standard check of column %ITEM% of table %PARENT% Standard check of column %ITEM% of table %PARENT% Standard check of column %ITEM% of table %PARENT% LowValue HighValue DefaultValue Unit Format Uppercase Lowercase CannotModify ListOfValues 97F8F7D1-7013-43E2-BA28-58A7A3E2BFF6 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 3F839DF8-2240-47CD-A550-B40DF1C76B1A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 24321B94-AA03-416B-98A0-E7C85B2ED217 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 D1CA28EE-6E8C-41DC-8A5A-BC537DE7754C 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_CRUL PDM Client check expression of column %ITEM% of table %PARENT% Client check expression of column %ITEM% of table %PARENT% Client check expression of column %ITEM% of table %PARENT% 495F2829-C07A-41E0-9397-33AAC56C2AE6 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 D3B8FD48-7E1E-43A2-8EC0-67A662DE4255 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 70A5F918-5067-4C4C-9BFD-BA4F4216AE66 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_SRUL PDM Server check expression of column %ITEM% of table %PARENT% Server check expression of column %ITEM% of table %PARENT% Server check expression of column %ITEM% of table %PARENT% 2C2AA37A-936B-45FC-8092-B31F13BFAAC6 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 06E6679A-C1EC-4ACD-8DBC-827B36D4508C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 5DE98579-6AA3-4A6E-901C-600D3155E909 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_RULE_LIST PDM Business rule list for column %PARENT% Business rule list for column %PARENT% Business rule list for column %PARENT% 1 -40 Name -40 Code -20 Type E81D0D1C-EC42-4380-AD7F-62ECDF80E787 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 6D8F0E95-04C4-4C5F-88FE-944E3861FADF 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A77CE050-E1FA-4DBB-AE41-82DFF225AC43 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 6AC45C78-87BA-42CB-BF18-263032DE094E 1520151187 xgc15 1520151187 xgc15 7F148DE3-FC16-43A0-A496-C913DEB4DFD5 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_DEPND_LIST PDM Dependent Object list of column %PARENT% Dependent Object list of column %PARENT% Dependent Object list of column %PARENT% 1 -40 Name -40 Code -20 ClassName D8D50176-D7DF-4639-8D0E-C37642808E45 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 6767ADE1-13ED-4AD3-8932-D9521232FA5E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 0285E542-1B39-4798-9F95-C5E6AE1FCFE6 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 55EFEE63-5A1E-494B-ADEA-DD7EA8B39F28 1520151187 xgc15 1520151187 xgc15 8FA6A0D1-B43F-4457-98C1-617521B2E450 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_EXA_LIST PDM Extended Attribute List of column %PARENT% Extended Attribute List of column %PARENT% Extended Attribute List of column %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName C5EE453E-A034-4184-906C-693E0171C413 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 99120C07-19DB-4A48-9CD4-917A8B3EFA49 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 828FEAA0-8628-4BC2-927D-B3C3FE90DCE3 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 F35DB53A-0346-4C50-ACCA-12FCB2E46DF3 1520151187 xgc15 1520151187 xgc15 EE02968F-E822-4442-8BC3-6E568940DB3A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 50342B1A-3F0E-4616-B203-BE30500F94B5 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_LIST PDM Key list of the table %PARENT% Key list of the table %PARENT% Key list of the table %PARENT% 1 -40 Name -40 Code -20 Primary 822DEBB3-A650-4AEE-8F31-A928638CDFA7 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 5D6A12E3-A88D-4FEF-814A-2845A417E766 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 CF23C898-ED26-4ABC-B195-F0D6005E497A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 09F5B75D-A0D5-4691-94EB-CA3A8E9464FB 1520151187 xgc15 1520151187 xgc15 4DD773DD-D038-43E6-8B8A-9D5755747C0B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_GROUP PDM Key %ITEM% of table %PARENT% Key %ITEM% of table %PARENT% Key %ITEM% of table %PARENT% 3D2394E4-DA7E-476A-A6AD-A7DB35B5DF76 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_CARD PDM Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Name Code Table 097C3E82-841E-4EBF-829A-696FAEBF4C2E 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 29FDD743-74D7-4CA2-A95F-91072BBDA19F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 C3982028-46F4-4EA9-9134-EAABA2327D78 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 C37C196F-1414-428C-9CA5-1B4CAAFF795C 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_DESC PDM Description of key %ITEM% of table %PARENT% Description of key %ITEM% of table %PARENT% Description of key %ITEM% of table %PARENT% 4D7E9E09-4044-4869-A50F-3CECFAE88217 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 10CF3917-49F8-4245-9407-FBC3BB356374 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 B4D55410-EA3B-4A0F-AC1B-D064CA76EC3D 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_NOTE PDM Annotation of key %ITEM% of table %PARENT% Annotation of key %ITEM% of table %PARENT% Annotation of key %ITEM% of table %PARENT% 586C701C-A773-47A1-9A1B-A15AB76768A6 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 C04C7144-431A-4CE1-8B70-E4BD7B92B504 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 94972349-AB3E-4A5B-A390-2C9AA0D4FA23 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 19CE769A-9CD5-413D-9240-813C17E72817 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 C313205D-553F-4E48-90E9-0CD0F97A9C26 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 2BEC70C0-3523-4068-9F92-E9DD1A48887B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_COLN_LIST PDM Column list of the key %PARENT% Column list of the key %PARENT% Column list of the key %PARENT% 1 -40 Name -40 Code DB5E5AC8-63EE-40BF-8FC0-A3C09DE4D575 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 792F41F6-922B-42B4-B143-5D6D310E0573 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 CF11FC82-D71F-421C-A52E-463855D94554 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 397290C2-3BF7-468C-83B2-7E51AEE64179 1520151187 xgc15 1520151187 xgc15 07EA638B-DEBB-4567-854A-DA7013134827 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_DEPND_LIST PDM Dependent Object list of key %PARENT% Dependent Object list of key %PARENT% Dependent Object list of key %PARENT% 1 -40 Name -40 Code -20 ClassName 78000E5E-1BDB-4648-B5D9-EE5E10B0B220 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 430650DD-E99A-418C-BDC6-D9086744898A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 43BADD84-1F7E-4A38-BA83-866221372B98 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 26D2F7A0-5675-4A06-B7A8-F4733955E4BE 1520151187 xgc15 1520151187 xgc15 FCE76825-EB13-4EBF-8154-EF1954D1E9A9 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_EXA_LIST PDM Extended Attribute List of key %PARENT% Extended Attribute List of key %PARENT% Extended Attribute List of key %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName CEDB96C8-0290-41BA-AE35-A019D49FEAC0 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 F3874BA2-3905-4ADA-B7A0-30A36F0E78C2 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3583CA36-28FE-45B9-B3CC-616739DAAAAA 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 7F4ACEB3-C3F8-4AFE-8703-EB59DEA3E163 1520151187 xgc15 1520151187 xgc15 5A314E20-997A-4B82-AFA0-A66A300521EB 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 AF389C54-0A2E-4121-941F-E07B0C550F0F 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_LIST PDM Index list of the table %PARENT% Index list of the table %PARENT% Index list of the table %PARENT% 1 -20 Name -20 Code -12 Unique -12 Clustered -12 Primary -12 ForeignKey -12 AlternateKey 8664B7A6-F7FD-44FC-8753-55D252478D63 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 0D44788E-2BD5-4BE1-905A-A6882F476520 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 861FA560-EE2A-4735-8228-34227E52B821 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 A74E149E-64AA-4EA0-ACD3-9D8BA52CCE23 1520151187 xgc15 1520151187 xgc15 2BB3C754-55FD-432F-9C17-DB9EF5A22C5B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_GROUP PDM Index %ITEM% of table %PARENT% Index %ITEM% of table %PARENT% Index %ITEM% of table %PARENT% 54785C1C-4B35-49DB-918C-F25F92C52D20 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_CARD PDM Card of the index %ITEM% of the table %PARENT% Card of the index %ITEM% of the table %PARENT% Card of the index %ITEM% of the table %PARENT% Name Code Unique Clustered Primary ForeignKey AlternateKey Table 7FDA9F1E-487C-4DD9-A98F-389C7989D399 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 AE4C4DC4-7C31-4C45-A3C4-96842F06BA73 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 1F0073BD-8E72-4F20-80AD-5F9C31A50520 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 7BE0E505-C6C5-4283-B9C6-90E1DCD04697 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_DESC PDM Description of index %ITEM% of table %PARENT% Description of index %ITEM% of table %PARENT% Description of index %ITEM% of table %PARENT% E0D06D69-4DDA-41FB-9505-71F12E7D950A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 08922C1D-73F2-4B1A-A670-7B0CDBF81D97 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 D8D5EB49-7C75-45C6-AF17-D6303AE4C526 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_NOTE PDM Annotation of index %ITEM% of table %PARENT% Annotation of index %ITEM% of table %PARENT% Annotation of index %ITEM% of table %PARENT% 9866D144-0944-4AC7-84A9-66F8A9949D21 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 9912F08D-0994-4BBE-918C-72DBE9C5BEF9 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 CE28B11E-26F6-446B-9C6B-D66622D8CCBD 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 3B8B1707-BA46-4453-8573-D5B5A5E2F732 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 DBFAB69A-19E5-4D75-8358-19020DC089B8 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 8ADCE383-FF8B-4F01-BF80-F3D9D2EF7D18 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_COLN_LIST PDM Column list of the index %PARENT% Column list of the index %PARENT% Column list of the index %PARENT% 1 -38 Name -38 Code -24 Ascending D34FE212-0622-4074-B659-15977A4B2A77 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 762DEAEB-5BC9-43B4-82BD-0BD1CD47BB34 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2E8ED2AA-2AB9-4F00-A191-054D857361A3 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 FF33ED15-FDC1-431A-BAD6-FC51F555548D 1520151187 xgc15 1520151187 xgc15 D68870CE-6A3A-495A-9DBE-8E5DB0321818 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_DEPND_LIST PDM Dependent Object list of index %PARENT% Dependent Object list of index %PARENT% Dependent Object list of index %PARENT% 1 -40 Name -40 Code -20 ClassName AE8529B4-DB2A-48C2-96EF-85056F156587 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 04CE433A-F4E2-4470-B100-2CC8C126F14C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 4A4A354B-09DE-4880-8222-C8AB1EE395D5 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 4BEE0AE2-F0F9-4AD9-AD93-30B180D7D095 1520151187 xgc15 1520151187 xgc15 BCC52926-636C-4627-ABA2-48B80D1C3007 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_EXA_LIST PDM Extended Attribute List of index %PARENT% Extended Attribute List of index %PARENT% Extended Attribute List of index %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName C8A65B78-7295-4364-A878-5C85E6812CE9 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E817AE37-F7C6-496D-960B-B327AF0E511F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2740DCC6-CD22-4361-8C40-AE85E3843B7B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 A5FCECC5-0CB2-46BE-8AC7-9835BECD58C4 1520151187 xgc15 1520151187 xgc15 E08C71B0-9454-4285-B5EA-440FCA4A1264 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 B1C5C462-BE98-4D51-BD84-6789A29CD036 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_LIST PDM Trigger list of the table %PARENT% Trigger list of the table %PARENT% Trigger list of the table %PARENT% 1 -50 Name -50 Code F888A7E1-B391-410F-83DE-BCE8613F71F7 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 9347517B-7D32-4CC5-9F2C-32C5AD174141 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 54AC804F-868E-498A-92AF-404085A40602 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 BCEE2334-8BEE-4FBB-9B6D-5AED9DE5095C 1520151187 xgc15 1520151187 xgc15 BB71BF6A-DD3A-4459-9D76-0BE704C8206C 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_GROUP PDM Trigger %ITEM% of table %PARENT% Trigger %ITEM% of table %PARENT% Trigger %ITEM% of table %PARENT% 253DF56F-929E-4B36-B8EE-8B4E3658366A 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_CARD PDM Card of the trigger %ITEM% of the table %PARENT% Card of the trigger %ITEM% of the table %PARENT% Card of the trigger %ITEM% of the table %PARENT% Name Code Generated Table TriggerTemplate UserDefinedSQL 101502B6-72D2-4D07-B693-5BA01820F6BD 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 F834BC8C-04B5-4107-920B-080F91767732 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 2EBEDEA4-9C47-41E2-A968-B39105DC8BC7 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 2E20E3AF-0266-464D-8C05-BF96462B4A56 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_DESC PDM Description of trigger %ITEM% of table %PARENT% Description of trigger %ITEM% of table %PARENT% Description of trigger %ITEM% of table %PARENT% FF9E72C4-CF5A-45F1-92C1-0F59E0994F70 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 0A2DEAE0-4F68-41FA-A9D6-DB44634B6151 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 897267B7-A180-4514-8695-1C9FCBAF76F8 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_NOTE PDM Annotation of trigger %ITEM% of table %PARENT% Annotation of trigger %ITEM% of table %PARENT% Annotation of trigger %ITEM% of table %PARENT% 7CB09BD8-D941-4E93-A58F-B9AE878BC53F 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 3DAD36EF-DA02-4716-A36A-FCDA066769BF 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 1257B66F-3DF3-47DB-8226-42581396230C 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 0CD615AD-4DB9-48E0-BF2D-65FE09BCB576 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 B17FECBE-1587-4201-BB2C-454C8CE2EB1E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 BF3865DD-78FF-4C82-B932-DCB04779BE03 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_EXA_LIST PDM Extended Attribute List of trigger %PARENT% Extended Attribute List of trigger %PARENT% Extended Attribute List of trigger %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 29B34873-3AA3-4E7D-83CE-84A1E93DE64B 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 3E90B620-EAEC-42DF-8444-D9801FB76739 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 31E56A2B-671F-4959-B9AF-F952C415E516 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 F83446B3-501C-4B01-895F-1EB5B3D980D1 1520151187 xgc15 1520151187 xgc15 1F4E073A-6A3A-46FB-BA3F-A7A4D8D2982C 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 ADA6767C-0EAC-4E9C-BFDE-54B4D0DDFA0C 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_LIST PDM Mapping list of the table %PARENT% Mapping list of the table %PARENT% Mapping list of the table %PARENT% 1 -50 Name -50 Code 1BE16EDC-7950-4EDB-A4F6-55CC9CB78F89 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 EFE62122-82FD-4235-9B99-30028DB5DE75 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 EEBDE29D-F6F4-4A64-AA1D-A07F8F6B3798 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 DB5A51F3-EE34-4C22-8679-4E03B7AADD38 1520151187 xgc15 1520151187 xgc15 94B7A46D-1E59-4E7E-8624-54C88F5B51C2 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_GROUP PDM Mapping %ITEM% of table %PARENT% Mapping %ITEM% of table %PARENT% Mapping %ITEM% of table %PARENT% 971843E5-859E-423F-AB5C-4CBCA13286F8 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_CARD PDM Card of the mapping %ITEM% of the table %PARENT% Card of the mapping %ITEM% of the table %PARENT% Card of the mapping %ITEM% of the table %PARENT% Name Code E55DA18B-DB2B-4249-A3F3-DB6D1328083D 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 F98EADFF-7D32-40C1-A6DB-6545C7F96F57 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 A83801A1-C659-4622-BEC9-3A1708BDEE40 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 F25D1152-8B27-48FE-943F-D165C029A62D 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_CRTR PDM Criteria of mapping %ITEM% of table %PARENT% Criteria of mapping %ITEM% of table %PARENT% Criteria of mapping %ITEM% of table %PARENT% F606ADF3-1512-41DA-824F-9C1302C64C8A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 11D4F0E2-9D0B-4250-B646-0FBB1E07E7DE 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 5FBBDB86-79AD-461D-A7E2-16C265AED5BD 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_EXPR PDM Source expression of mapping %ITEM% of table %PARENT% Source expression of mapping %ITEM% of table %PARENT% Source expression of mapping %ITEM% of table %PARENT% CCA55894-3F87-4CDE-A2DC-B6A906E8255F 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 46C9FCC2-4BB6-486B-A560-9B7CCC90CEC4 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 0261F20D-6C8A-4688-8035-174959748006 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_SFEA_LIST PDM Column mapping list of %PARENT% Column mapping list of %PARENT% Column mapping list of %PARENT% 1 -50 Column -50 MappedTo 0A2BC6F9-0C85-47C6-A5F8-5D1424D2557D 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 6741F9C2-C625-4EAB-BC5B-D030C7C91DCE 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B112FE2D-1C0C-4021-AEB6-5B0F40DCE599 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 9BFEF338-1815-45BC-8E50-D47E79DDA0C1 1520151187 xgc15 1520151187 xgc15 999476D4-7AFB-41F0-9C8E-6ED4F58BC12C 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_SCRC_LIST PDM Table sources list of mapping %PARENT% Table sources list of mapping %PARENT% Table sources list of mapping %PARENT% 1 -50 Name -50 Code 2D5EBF55-D904-42A3-8B5C-FC88A5AEADBF 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 AD69AA9D-BC31-422F-8B9C-F1157F9B4ABD 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D1A9DC15-4B11-4726-A643-2992CFCD5A59 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 F895B843-4204-4127-9268-F4CB57C4D028 1520151187 xgc15 1520151187 xgc15 84C23F12-8CBB-4619-BA7F-24C78E5A1344 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 40883E92-7E62-4B13-9AF8-DD58BA08CC33 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E4BD7426-38A6-4295-BF28-A3AE4E7F6166 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 1ADE5A5E-F265-49FB-96D6-90CE2CB8DE92 1520151187 xgc15 1520151187 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% Tables from Package %ITEM% 1 7E696E34-EEE4-4B23-B958-AFF71E089EF0 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TITLE PDM Table %ITEM% Table %ITEM% Table %ITEM% 3D0C2D1F-0DEE-46C0-B43E-5DE59492C8BF 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CARD PDM Card of the table %ITEM% Card of the table %ITEM% Card of the table %ITEM% Name Code DBMS 29D0BC3F-7BDF-45F2-9531-373947681636 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 BD020968-C0AA-4A2B-B63E-2701899547FF 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 78C877C1-FB8A-47BF-8E9C-EFE639A05EC8 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 EBD89807-0B5F-4EB3-A097-F790A9A45A21 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_DESC PDM Description of table %ITEM% Description of table %ITEM% Description of table %ITEM% 2C1CC0F4-8CF1-4340-B5CC-CF179D71ED11 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E7979525-2609-46FC-937C-4C97E472CD5A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 2B13C6C3-5122-48F1-BA69-28BFC345CDB4 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_NOTE PDM Annotation of table %ITEM% Annotation of table %ITEM% Annotation of table %ITEM% B21C6F35-80E9-4002-AB9B-C555C564B9DB 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 33E79A81-DE23-491F-94E1-4304237AE4F5 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 0CF81F75-7403-4699-B391-1625E86D01DA 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CKCN PDM Constraint name of table %ITEM% Constraint name of table %ITEM% Constraint name of table %ITEM% 99445715-0C2B-4C06-8ACB-7A5D8836C94A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 EA067031-ECE2-4D1B-B99F-ACFC224468C1 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 287AAD6F-09E4-4570-8842-33B96A20F7F8 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_OPTS PDM Options of table %ITEM% Options of table %ITEM% Options of table %ITEM% D7BD98AB-CEB6-4AE9-B5DE-8C70958A1CAC 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 D2A31D0C-173E-4981-B97A-180AE3461325 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 C5242344-2953-4808-9934-D55ABB6BFC64 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CRUL PDM Client check expression of table %ITEM% Client check expression of table %ITEM% Client check expression of table %ITEM% 305B7B47-233F-40E0-B33F-7F4CC4F14796 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 0AD0EFD8-8EAF-4893-A9D9-A502D26BC2F5 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 C8544E07-E73C-4CFE-989F-FA19F433D644 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_SRUL PDM Server check expression of table %ITEM% Server check expression of table %ITEM% Server check expression of table %ITEM% 10B74337-774E-4767-8FC5-EEE2F45DF599 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 62F9DF60-A889-4996-80DE-72C826E754E7 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 86EF52F7-E3D7-4558-89E2-04458EAADBD8 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_HEAD PDM Begin script of table %ITEM% Begin script of table %ITEM% Begin script of table %ITEM% 5146AB2F-6E07-42B1-9DDB-0671DC22C51E 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 5A69255A-D09F-499F-A3A5-097914E9E6BF 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 4B44952A-B291-4301-ADB4-A75C5A69EA31 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_FOOT PDM End script of table %ITEM% End script of table %ITEM% End script of table %ITEM% 48DB551F-43F0-46DA-94F2-F9393619A135 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 44F50A4E-FA8D-46EE-B15F-1E26C059F66A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 27D0FE6F-685D-4EAB-9AC7-2090102A7773 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 4A348F51-0B91-4A3A-9119-E9871886F29B 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E667C0CE-074D-4611-B2A5-8E7034D541CC 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 A902407F-A17A-4A47-A8C8-A1FE8365D5BB 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_DIAG_LIST PDM List of diagrams containing table %PARENT% List of diagrams containing table %PARENT% List of diagrams containing table %PARENT% 1 -50 Name -50 Code 380C3FF0-7407-4633-89AC-023646A25FBA 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 B049C2F8-8ED5-47D8-8619-C7C2BCC49C3A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3E764E12-023D-4500-B9E1-021BE4FD7FA6 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 48D64230-E1A4-4F63-BBDA-0171443B2F24 1520151187 xgc15 1520151187 xgc15 992F09B7-D8F0-409F-A411-DF7A870C703B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_OUTREFR_LIST PDM Reference from list of the table %PARENT% Reference from list of the table %PARENT% Reference from list of the table %PARENT% 1 -30 Name -30 Code -40 ForeignKeyColumnList 159C8A70-9106-45CC-A573-7D737450D3DE 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 4E65418B-EB6C-41B6-97C5-E9A85F902081 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D794F099-8BAC-4900-B125-C8DD90A5345E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 6AFACA4F-C411-4AFF-A269-BD810635780A 1520151187 xgc15 1520151187 xgc15 94E87BE7-7A5E-4677-B888-6EBB787C8C69 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INREFR_LIST PDM Reference to list of the table %PARENT% Reference to list of the table %PARENT% Reference to list of the table %PARENT% 1 -50 Name -50 Code 64623C7C-583C-4D9D-9E2D-45F03AE02080 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 233F0AD5-833C-4407-9125-199409834405 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6F6ADA17-6ACF-4D14-BA36-B2BBD8ADFC55 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 0BBFBC6D-DDBC-4365-8C76-5A21C81143EB 1520151187 xgc15 1520151187 xgc15 E189136C-30F0-4BD0-AB2D-E1BB7B5C2F26 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_RULE_LIST PDM Rule list of the table %PARENT% Rule list of the table %PARENT% Rule list of the table %PARENT% 1 -50 Name -50 Code CE939A29-B04F-4076-B765-0B10E44B7E5B 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 5A273D1A-3046-45D9-B139-35883EED36F5 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 AD91B9B9-B239-41C2-8D60-57708D6E029F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 FE43BD5E-EA33-4185-B4AD-3276B7DA53C5 1520151187 xgc15 1520151187 xgc15 A9689F1A-949A-4B74-9352-EC23B7B0D4CD 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_DEPND_LIST PDM Dependent Object list of table %PARENT% Dependent Object list of table %PARENT% Dependent Object list of table %PARENT% 1 -40 Name -40 Code -20 ClassName 1F9E3DD2-4F71-4580-AF37-B9DC44C4DCE7 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 498ECAC9-371D-426D-AED2-465E47A4B4E5 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3975E162-1B5B-44A3-9DDC-C68C58DE1050 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 CC8E254A-FF54-45CD-84C7-C8467B83C5A3 1520151187 xgc15 1520151187 xgc15 E3C83257-A1E9-49DB-9E56-A237EA4F3B52 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_EXA_LIST PDM Extended Attribute list of table %PARENT% Extended Attribute list of table %PARENT% Extended Attribute list of table %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 98E7F1D5-89AB-4E92-B3F5-0C229AFBF348 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 659AF5CE-33E4-4CC7-BAA1-EE95346FBCFA 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B9F1FB48-74A3-4003-B939-98867E018D7D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 7884758F-8C22-4318-A5CA-46A8D36751B1 1520151187 xgc15 1520151187 xgc15 645A6F20-77F1-4C15-993D-883B38E2B1F9 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_USRDEPD_LIST PDM Extended Dependency list of table %PARENT% Extended Dependency list of table %PARENT% Extended Dependency list of table %PARENT% 1 -33 Stereotype -33 InfluentObject -33 InfluentObjectType 151A1930-C63E-4FAF-AC57-35FBB4A77F8B 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 577150D3-4A24-485E-9D2D-A476077F05DC 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3A3A0A2D-284D-4B6A-925E-5DD6E2344AFD 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 8527A99E-6673-4882-B323-7A7B846B434E 1520151187 xgc15 1520151187 xgc15 DAA8BF3D-1ED7-4E66-9402-EDAD08FD7BC6 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_LIST PDM Column list of the table %PARENT% Column list of the table %PARENT% Column list of the table %PARENT% 1 -50 Name -50 Code 4F6091C2-144F-4CE4-BC84-0F86486D81B5 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 F9964BA7-DEA9-4A44-8A7C-FDC22223F9EA 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B1619A93-87A6-463F-BE7C-AC0801B0D88F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 BD4CA778-175E-4FAF-A808-6E829E37CB8B 1520151187 xgc15 1520151187 xgc15 6832EF66-D4C2-483D-B020-C76619DA9CB3 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_GROUP PDM Column %ITEM% of table %PARENT% Column %ITEM% of table %PARENT% Column %ITEM% of table %PARENT% 2E8FB912-0B83-426A-A0C5-B91C58791E21 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_CARD PDM Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Name Code DataType Mandatory 5B9051E5-E804-4C17-B478-F504EE060B51 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 01EFC7DD-ABDA-488D-95AB-54226FD6B62D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 369BD774-75DC-4008-A7AA-ACF8871418C0 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 7503CE7D-8A42-494D-B5FA-95B82075F012 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_DESC PDM Description of column %ITEM% of table %PARENT% Description of column %ITEM% of table %PARENT% Description of column %ITEM% of table %PARENT% 429C9414-4CD3-4DA7-AF9A-C82CB0F68E66 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 28E43237-FCE6-40FE-AF08-4CB418B6B728 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 8AA92C6A-82FF-47A2-B9C6-3922B90C522B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_NOTE PDM Annotation of column %ITEM% of table %PARENT% Annotation of column %ITEM% of table %PARENT% Annotation of column %ITEM% of table %PARENT% E63E501D-811D-4BEB-8893-68B2A4592F5A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 2E7ABAAB-9613-4D72-A107-C6B462094675 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 F7162A72-DC93-4585-B266-B8E786379F93 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_CKCN PDM Constraint name of column %ITEM% of table %PARENT% Constraint name of column %ITEM% of table %PARENT% Constraint name of column %ITEM% of table %PARENT% 356797AD-2C03-49EA-98AC-2FBD2A80A666 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 BE8B3586-FA7F-4810-96C9-69E1721FA42A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 1C927C4C-98EB-4020-8CA0-0178A7FF86CE 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_CHECK PDM Standard check of column %ITEM% of table %PARENT% Standard check of column %ITEM% of table %PARENT% Standard check of column %ITEM% of table %PARENT% LowValue HighValue DefaultValue Unit Format Uppercase Lowercase CannotModify ListOfValues 2652A55F-4533-438F-B4E2-59455CB32C79 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 7EB0EE2F-F2E5-4BC3-A67A-C3A59FF2F2A2 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 4628BEAE-73E1-48AE-85D9-462473473DF9 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 04B29851-1D6D-42FE-BEB2-A1353E875088 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_CRUL PDM Client check expression of column %ITEM% of table %PARENT% Client check expression of column %ITEM% of table %PARENT% Client check expression of column %ITEM% of table %PARENT% E2EB7862-B1C4-463D-9935-58051C9E9C9A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 1A31BF0B-FF6F-4A0C-801D-1B4DB732E82E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 8BA90D21-727A-450F-9215-E691940FAEB4 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_SRUL PDM Server check expression of column %ITEM% of table %PARENT% Server check expression of column %ITEM% of table %PARENT% Server check expression of column %ITEM% of table %PARENT% 720C87FC-B80C-4625-886D-569761A8B095 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 7C21416A-5A77-43EF-B64D-011436F898C5 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 828CA840-D092-4B74-9B34-46D3F24EEE66 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_RULE_LIST PDM Business rule list for column %PARENT% Business rule list for column %PARENT% Business rule list for column %PARENT% 1 -40 Name -40 Code -20 Type C9FCA523-CF7B-4788-ADA3-E7A61AFB6B74 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 1C5A7BC9-5B59-4692-8EDC-21AAE5006D78 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 7EFA1DEA-26E5-42AF-8D75-8F218E89C03E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 8E70FDCD-7BF5-482E-9258-5CD4F2D650B6 1520151187 xgc15 1520151187 xgc15 992A6AE1-9879-40C6-BBCC-E61692B4FE3D 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_DEPND_LIST PDM Dependent Object list of column %PARENT% Dependent Object list of column %PARENT% Dependent Object list of column %PARENT% 1 -40 Name -40 Code -20 ClassName AAE42D2A-BAD7-422D-992F-0064183EC1FB 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 D63E05A1-A474-465D-901B-30A521F82C36 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A73A3C89-008D-4ECD-8270-2DEEA7023819 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 6AE5CEEA-DD08-4E90-922D-E200E0957D3E 1520151187 xgc15 1520151187 xgc15 85AE1AA4-54A3-4ECF-B9AA-45A1DAFFE6C6 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_COLN_EXA_LIST PDM Extended Attribute List of column %PARENT% Extended Attribute List of column %PARENT% Extended Attribute List of column %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName C34A98B8-A647-4177-872C-C3D34A18E111 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 F4F91B2E-AC96-4D10-8665-0F3E9E7FF0FD 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 7C03B4D6-E38C-47F7-B1D3-C18C7E1CD95A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 51C3D6AF-AFA4-4EE4-80FC-094D7D46A978 1520151187 xgc15 1520151187 xgc15 6DFF472C-5A42-4019-8807-92A9BBC8301D 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 61616735-7578-42E4-9C86-496964D8A568 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_LIST PDM Key list of the table %PARENT% Key list of the table %PARENT% Key list of the table %PARENT% 1 -40 Name -40 Code -20 Primary F35D0791-9C52-410D-AEDE-4C1EF9F8D954 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 54361C71-9648-4D0A-9EBF-DAF690FE943B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 19BD5E83-1DEC-4C1F-BD58-1BF3275E8EE7 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 28DE4348-79DD-41D0-B8ED-4585C8E1A1E8 1520151187 xgc15 1520151187 xgc15 47EA6FD2-FE63-45CF-B927-57A1194A7667 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_GROUP PDM Key %ITEM% of table %PARENT% Key %ITEM% of table %PARENT% Key %ITEM% of table %PARENT% 2018D9E6-7D77-4927-AAA6-743DD5D85154 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_CARD PDM Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Name Code Table A801F351-66F0-42C9-8E8D-18FB75431DD4 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 2E84C64D-9ED0-40B1-8DA6-FFD16EAA3F4E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 E3C47CF0-7B21-41D2-A964-048DE19C2EC6 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 3CD112D8-D510-4609-A3F8-3DA227F2C8B1 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_DESC PDM Description of key %ITEM% of table %PARENT% Description of key %ITEM% of table %PARENT% Description of key %ITEM% of table %PARENT% 6BECB2FF-EE93-46FA-B305-18311E8DF73A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E3DF573C-8D8B-42D3-ACC3-E3E77F805CAB 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 5AD0FC53-1C95-498B-B578-B00A2A51C275 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_NOTE PDM Annotation of key %ITEM% of table %PARENT% Annotation of key %ITEM% of table %PARENT% Annotation of key %ITEM% of table %PARENT% E6184F0B-9427-48D3-8B38-18A4DFD52532 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 DFDF5726-F68E-402E-A32F-755272BB82E6 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 076E4CF9-C861-4CF9-B970-0E5C5BCC6379 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% E471FA52-4FBF-4C04-BF5F-E81CC6AE6CB5 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E2354ABC-CFA7-4EA8-917D-1851EF125E94 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 B6B86D9A-607B-4D21-87CD-83972DC8641F 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_COLN_LIST PDM Column list of the key %PARENT% Column list of the key %PARENT% Column list of the key %PARENT% 1 -40 Name -40 Code A9EABEBA-9B00-4279-B7C2-C558E91A2E93 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 894B91E4-1A6E-46A3-A02A-40374B0EC49C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 4E19F7D6-F09E-4161-833D-FA8708E1733D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 FAE5489A-7CE5-4D78-AFEB-693D446CE35F 1520151187 xgc15 1520151187 xgc15 4C97E934-8069-4773-BF59-C3EB6F856317 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_DEPND_LIST PDM Dependent Object list of key %PARENT% Dependent Object list of key %PARENT% Dependent Object list of key %PARENT% 1 -40 Name -40 Code -20 ClassName F58FE9F1-8AA1-44AA-B153-268653ABE62C 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 080D9E48-BCD9-44D4-8569-435A1A1BC09D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 EC72745D-55ED-4133-A1CF-05410386595A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 27BC4FBC-B4F4-4824-A215-F916112A6FC0 1520151187 xgc15 1520151187 xgc15 76FB9373-F685-4022-B135-3682A96841E5 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_KEY_EXA_LIST PDM Extended Attribute List of key %PARENT% Extended Attribute List of key %PARENT% Extended Attribute List of key %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName AB003CC0-B48F-4A1D-B1CA-48AE2C5136DB 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 4185D297-320C-4776-AEB5-0F10E2DA0C65 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 11A20852-D3BF-4153-970E-64419BB34FFA 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 47DF072A-04D5-4188-A0E7-AD0BB18CAD7B 1520151187 xgc15 1520151187 xgc15 74694177-7637-4C28-8ABD-7194449E810B 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 D9A3402D-38AD-4FC5-8CAD-3F708B09EFDC 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_LIST PDM Index list of the table %PARENT% Index list of the table %PARENT% Index list of the table %PARENT% 1 -20 Name -20 Code -12 Unique -12 Clustered -12 Primary -12 ForeignKey -12 AlternateKey 7B743B45-C260-4156-8A16-DDE4B823D463 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 FED1AE76-1CB8-4585-9F1F-82EC06A95F98 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 AAEC7377-CB64-450E-87A6-260601ADF687 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 30D1A988-84F3-4CA9-BEDC-D576D7ADBD52 1520151187 xgc15 1520151187 xgc15 E799A759-01C7-43D8-8F57-9C8BA45F20ED 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_GROUP PDM Index %ITEM% of table %PARENT% Index %ITEM% of table %PARENT% Index %ITEM% of table %PARENT% C7E23D20-7DFB-433D-A666-BE3CC1D59741 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_CARD PDM Card of the index %ITEM% of the table %PARENT% Card of the index %ITEM% of the table %PARENT% Card of the index %ITEM% of the table %PARENT% Name Code Unique Clustered Primary ForeignKey AlternateKey Table B08C55C2-E5CB-4E26-9C18-62DA0355A988 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 F292E192-A166-4061-96FB-E6E909CBDD5E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 27D923F2-D0FB-42A5-BD68-7D55EA3C4D7D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 54881D94-E248-43F1-9D94-EB10C91D549C 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_DESC PDM Description of index %ITEM% of table %PARENT% Description of index %ITEM% of table %PARENT% Description of index %ITEM% of table %PARENT% C0645CBA-C586-4215-9C92-71FCECBD6776 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 EB91DD3B-0B1C-48AB-BD9E-DABC275026E3 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 C9364F2B-F44F-46A4-887B-8FBFF8476844 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_NOTE PDM Annotation of index %ITEM% of table %PARENT% Annotation of index %ITEM% of table %PARENT% Annotation of index %ITEM% of table %PARENT% CD80DCC6-D3C9-4B1E-886A-6FDF03D85772 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 974FE524-E37D-4B19-9592-15AD6AA87AEB 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 E0F63CAF-3EF5-4411-A93E-961C93576F81 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% BDF7938C-B490-46E8-8470-E4B389379BB7 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 0CFBE1CA-C148-487B-A0E6-C61BEBDA0CDA 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 8BF7424E-E205-4852-BA41-F5E996E08AEA 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_COLN_LIST PDM Column list of the index %PARENT% Column list of the index %PARENT% Column list of the index %PARENT% 1 -38 Name -38 Code -24 Ascending 3838941C-5A82-4455-847D-F3FE01FDB718 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 5E34DC54-782E-49F8-AAEA-746F45CBF97F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B4C373E3-E05B-49AD-8FD8-5C410B4F4C74 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 CD1BB8EC-B40A-4D4D-87F1-4448A277A14E 1520151187 xgc15 1520151187 xgc15 D65939A8-07DE-4D5C-9885-A428B27B3C53 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_DEPND_LIST PDM Dependent Object list of index %PARENT% Dependent Object list of index %PARENT% Dependent Object list of index %PARENT% 1 -40 Name -40 Code -20 ClassName 5B75C0D3-EA22-4653-B91A-D32411DDFA0F 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 57D80BF1-B539-46B7-9AA2-5ED90696449D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2CB79D12-0E4D-4FEF-A6B5-7AD3A3BE2B23 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 2798DA78-3092-40B1-AE35-D9110D9548C5 1520151187 xgc15 1520151187 xgc15 AFBA88EB-795D-4217-8BFA-A7004810E8C2 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_INDX_EXA_LIST PDM Extended Attribute List of index %PARENT% Extended Attribute List of index %PARENT% Extended Attribute List of index %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 0EA7A3F7-E00C-4353-A68D-7D6070EBC23F 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 A4E119FF-442F-461C-BD9C-953C65BDC834 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 36408750-C9C0-4A5A-A5B0-A7B9FB964016 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 76A0F303-5933-4B71-93DD-147EAB32DEBF 1520151187 xgc15 1520151187 xgc15 FA9EED4B-8680-49FA-86B0-D9B32BC0E799 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 D8CD8B6D-A5D9-458A-9FDB-F0013686F533 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_LIST PDM Trigger list of the table %PARENT% Trigger list of the table %PARENT% Trigger list of the table %PARENT% 1 -50 Name -50 Code 46B7D9F8-25CA-4C39-8099-F5250E7C3AF3 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 31D0407F-982F-42A1-8DE0-92FEB676EDD8 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6B18CEF2-266D-4FF6-9F04-E5FBBD4B9331 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 4B167012-EF61-4817-AF56-63BDDBBA3415 1520151187 xgc15 1520151187 xgc15 FDF19855-A8D1-44B7-97AA-9DC0D297FFEC 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_GROUP PDM Trigger %ITEM% of table %PARENT% Trigger %ITEM% of table %PARENT% Trigger %ITEM% of table %PARENT% F9FACE19-A4DF-4B8C-91E4-8C4360E3486C 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_CARD PDM Card of the trigger %ITEM% of the table %PARENT% Card of the trigger %ITEM% of the table %PARENT% Card of the trigger %ITEM% of the table %PARENT% Name Code Generated Table TriggerTemplate UserDefinedSQL 29A008AD-0F0C-44F9-AD11-75B489A43898 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 55A98446-FA90-40A4-93BC-FA1C062CE620 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 8ED23B2A-5EDA-4E8C-8EA5-CA5FF859CA36 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 781A4703-F3F4-4B9A-889B-4E2A8405E854 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_DESC PDM Description of trigger %ITEM% of table %PARENT% Description of trigger %ITEM% of table %PARENT% Description of trigger %ITEM% of table %PARENT% 8FD37192-63B1-4030-9EF2-F9002DBF2EAF 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 5FD17B6A-A8E4-48FE-B6C6-0F4CADFA5B8E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 19F17E6E-AE64-443F-B62C-32DCEFF6D74B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_NOTE PDM Annotation of trigger %ITEM% of table %PARENT% Annotation of trigger %ITEM% of table %PARENT% Annotation of trigger %ITEM% of table %PARENT% B042ADD7-8631-4F35-A711-DAD53155AFAE 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 C8DFDDF3-ED6B-4A32-99EE-7FF0AE73F089 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 87941272-924B-4086-ADE3-52534688C4C3 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 1C91690D-533A-4D99-96BE-EB83A538923C 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 72FAF641-77A6-4798-B14A-8695609C6B5B 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 3537AE2F-D469-48C1-9110-52900301B6D1 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_TRGR_EXA_LIST PDM Extended Attribute List of trigger %PARENT% Extended Attribute List of trigger %PARENT% Extended Attribute List of trigger %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 2BE71A2E-446D-48D7-B53B-D792C1FBBFF1 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 2E396F20-544A-4779-B518-910D29EEF941 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 24B7F7F0-001B-429A-86B1-22D6E2BD10F3 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 01BDD309-7646-4A47-A565-D19183FBEA2B 1520151187 xgc15 1520151187 xgc15 1C0CD79D-7554-4ABD-8CE9-1777B34583EC 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 6B1D9D7C-781B-41A2-96CF-2A607620406A 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_LIST PDM Mapping list of the table %PARENT% Mapping list of the table %PARENT% Mapping list of the table %PARENT% 1 -50 Name -50 Code 8943D873-2DF8-4989-9AAC-B85CACF6DECA 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 78A86BDA-3C2A-4D5A-AA1A-3D0A7DE4B4AF 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B7391239-FFAA-40F5-9DC7-998A838D452E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 24AC25FA-2CC2-419D-AF98-03908D18F4CE 1520151187 xgc15 1520151187 xgc15 9D6AF91B-E9EB-49CC-9B38-30B2BA358689 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_GROUP PDM Mapping %ITEM% of table %PARENT% Mapping %ITEM% of table %PARENT% Mapping %ITEM% of table %PARENT% C2838D98-0D7D-43C4-970C-74E0787F322F 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_CARD PDM Card of the mapping %ITEM% of the table %PARENT% Card of the mapping %ITEM% of the table %PARENT% Card of the mapping %ITEM% of the table %PARENT% Name Code 90C5FD16-7A61-42F4-B15C-BB3B2AD31FD8 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 6EBEFC15-05FA-4DD2-9E98-96EFC282F45E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 F94BA990-03CE-459D-A0B3-EAC374573E0E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 E0ED34BF-79CE-409E-9BF4-D07BBBB2CC58 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_CRTR PDM Criteria of mapping %ITEM% of table %PARENT% Criteria of mapping %ITEM% of table %PARENT% Criteria of mapping %ITEM% of table %PARENT% 4F93EAE7-B52E-4318-9A68-2F5C8ADBDA1B 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 050B9FB3-1C69-44DA-9BFE-68479D373126 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 DFF4D900-06C5-44EC-B640-1C629628DE0E 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_EXPR PDM Source expression of mapping %ITEM% of table %PARENT% Source expression of mapping %ITEM% of table %PARENT% Source expression of mapping %ITEM% of table %PARENT% 7E0E09FA-8AAA-4221-9283-CAA94182F0AD 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 F5BCB16F-8665-41CE-8CC0-D8D77105A89A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 A0A4AA39-FC0F-4E57-8B4B-6D4CD2671F41 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_SFEA_LIST PDM Column mapping list of %PARENT% Column mapping list of %PARENT% Column mapping list of %PARENT% 1 -50 Column -50 MappedTo 1DF9CB73-C67F-4269-84AC-C6DF2D5B83A3 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 5575C57B-7D51-4779-AB2A-87EDAEDA08D8 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 EF1F1619-4D01-46DA-B484-7D5C73238A97 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 AB5C4A72-955C-406D-9681-2F12B0C969FE 1520151187 xgc15 1520151187 xgc15 A5E47DE3-905D-48C2-BD2E-9DAA974E9B34 1520151187 xgc15 1520151187 xgc15 1 1 PDM_TABL_CMAP_SCRC_LIST PDM Table sources list of mapping %PARENT% Table sources list of mapping %PARENT% Table sources list of mapping %PARENT% 1 -50 Name -50 Code 09A86C87-3A70-49CF-84B4-F2861BDA84E3 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 1414C752-6293-4BA6-AFA2-9046A51862DE 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 003D878A-82E5-498C-B4B0-F40CBB005380 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 22804F10-B622-42F6-842A-A13A987F6E5D 1520151187 xgc15 1520151187 xgc15 4B5E4FDD-4928-48E0-9679-7D904192C327 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 94D1D95E-0326-4957-91D2-85EFECBDE33A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 7C7546E6-76AA-4D31-9481-D09CA48B9CE9 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 DC861F22-3700-4DF7-B784-1B77CCF96258 1520151187 xgc15 1520151187 xgc15 1 PAGEBREAK PDM 7B57D1B2-DF2B-4F60-8E43-F56DC1F81828 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 B8E67C95-DFB6-4020-AFC2-43B0528842B4 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM References 54CFBC79-69D9-4D2E-A200-310030212D38 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Model level references 137632D7-DB0B-4739-8210-557AEFE534FD 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_TITLE PDM Reference %ITEM% Reference %ITEM% Reference %ITEM% C19EC3FB-E719-4FE2-8639-98DFE2738252 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_CARD PDM Card of the reference %ITEM% Card of the reference %ITEM% Card of the reference %ITEM% Name Code ParentTable ChildTable 715A044D-ADB4-4837-9086-69161FFEC3E4 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 AED25EC1-E4FB-4505-A5A1-EF98D2CDCD74 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 80E7489B-072F-4AAF-A190-67A764E9289C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 9988A862-D86A-4511-8EE4-4D588C76B91B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_DESC PDM Description of reference %ITEM% Description of reference %ITEM% Description of reference %ITEM% A153505B-51E1-4233-A5A1-5406AE40EE2D 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 AE5AE5B4-B332-44FB-94E0-F955ED5B48A6 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 3A93213A-F477-4312-BA70-21341364EC95 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_NOTE PDM Annotation of reference %ITEM% Annotation of reference %ITEM% Annotation of reference %ITEM% 0851FD2B-9FBB-47E3-BD48-6EF515AA172B 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 EBBCC0D7-0348-40C2-9BE3-75A514C1E775 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 D6293FCC-2C21-42ED-A867-5CEAFFB6C6E6 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% DA94F163-E3D5-4119-9417-31A10BCC4BB0 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 30C448C4-D12A-4C64-9B86-7382CF6BEABD 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 878ED414-10C2-4C2A-97BF-2A703E11DE90 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_DIAG_LIST PDM List of diagrams containing reference %PARENT% List of diagrams containing reference %PARENT% List of diagrams containing reference %PARENT% 1 -50 Name -50 Code 861D7376-B9FB-4825-99E8-180250B29CA3 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 FF75633E-6E59-4761-A617-4DA3D260CEAA 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 F275B88D-CFF9-4B87-BDBC-C3B1FEFBECF3 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 06B1B345-A832-4F8F-BA6B-D09C54B9B058 1520151187 xgc15 1520151187 xgc15 658EEEDE-A9C6-4214-9FC5-4D71CD725751 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_JOIN_LIST PDM Reference join list for reference %PARENT% Reference join list for reference %PARENT% Reference join list for reference %PARENT% 1 -50 ParentTableColumn -50 ChildTableColumn 7229EA17-777B-45BA-9CFF-678B27713932 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 A2ED70A4-95C5-4E50-B66F-1981D083C6E2 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 9012A4EA-2B2E-4839-886E-0E1D3D3136D9 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 2625E506-0C76-440B-9849-B2A17F366CDD 1520151187 xgc15 1520151187 xgc15 DDC19BD2-037D-4E20-B1C5-23CC2F81832D 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_RULE_LIST PDM Business rule list for reference %PARENT% Business rule list for reference %PARENT% Business rule list for reference %PARENT% 1 40 Name -40 Code -20 Type 0BD77A38-F16A-41E3-8A66-DAAB851033BB 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 4C7599D8-A3C2-4978-BF99-16F734DBD1D0 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 DA575D97-8BBE-41AC-B30F-C47ACBA36F5D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 83DFBBFC-24F5-48A1-B0CA-CEE46BB2889E 1520151187 xgc15 1520151187 xgc15 5D44ECB0-F379-4DD5-9ACA-1DAD8E8DD4AC 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_DEPND_LIST PDM Dependent Object list of reference %PARENT% Dependent Object list of reference %PARENT% Dependent Object list of reference %PARENT% 1 -40 Name -40 Code -20 ClassName 628E7FEB-DFB6-4D8A-930D-81314AB3FB3F 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 B7043CB7-4B01-40FE-939D-F6FFB98E25AD 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 1BD94DA2-515E-470C-9344-D2E9AD15134F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 3532D74F-C9FC-41E1-8D2C-9C0BEBD193E8 1520151187 xgc15 1520151187 xgc15 36BED4BA-6B4C-4414-BE78-439C04F569BE 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_EXA_LIST PDM Extended Attribute List of reference %PARENT% Extended Attribute List of reference %PARENT% Extended Attribute List of reference %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName B873E81E-737F-4F78-90FE-53EEA664F962 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 8BCAC1DF-ACD4-4F3D-A8A9-D5E0807A611A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3CF30E71-20DB-49E5-BC6D-446CEFEAFFF4 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 7E9C2AE6-C1D7-49D0-AD24-53C160A39D33 1520151187 xgc15 1520151187 xgc15 EA8CD7B3-F643-4AD0-B9C0-07655E6A5564 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 E40D27D0-1CE0-4378-AF27-A80E54294907 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 CA00E6AA-1909-4A53-9CAA-B77E8915330F 1520151187 xgc15 1520151187 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% References from Package %ITEM% 1 0B8BD47E-9453-487D-8D73-94AF32F4BDF0 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_TITLE PDM Reference %ITEM% Reference %ITEM% Reference %ITEM% 0151F1FB-A91A-4F45-BC93-C82BDDB19368 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_CARD PDM Card of the reference %ITEM% Card of the reference %ITEM% Card of the reference %ITEM% Name Code ParentTable ChildTable C5911253-87DA-4A03-813E-A931B7CA3E5B 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 57501C16-6514-4EFA-89B9-F7F68B9213F4 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 D6C0B9F7-6921-4AD5-AD23-A9E9A3F1E316 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 DAD120C1-75AF-4BBD-B8EC-6E0A4AC98370 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_DESC PDM Description of reference %ITEM% Description of reference %ITEM% Description of reference %ITEM% 312C44E0-B0FA-4884-9B82-3C049F76A543 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 9D6B3FAB-C781-4B49-AD96-976DA587F2A9 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 58AE6DE2-1595-40A5-B12C-595DF8367F1E 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_NOTE PDM Annotation of reference %ITEM% Annotation of reference %ITEM% Annotation of reference %ITEM% 7E1AF600-CC64-4792-9BFC-F2D4DE305FEF 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 20C5F302-5D63-4556-ACB0-1051C3CA959F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 7CDCB967-2644-4A7B-8BD6-B6DB256054AA 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% B7AC1F61-1080-43BB-9525-0A9CF95AD3AD 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 91B9657A-ADAA-4209-A0B0-3E7F4E526C9C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 943C74B7-B891-4A3C-85D4-63663A5E3683 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_DIAG_LIST PDM List of diagrams containing reference %PARENT% List of diagrams containing reference %PARENT% List of diagrams containing reference %PARENT% 1 -50 Name -50 Code D7D88508-161E-4ACD-846F-2502B64ECE91 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 A3B60F4B-1F6D-4FEC-A64B-3D05DE08E218 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C88210DA-6AC7-41F8-A6FD-6A6ADC130A12 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 7BC4BF76-2CD7-405D-8435-FAAAEDF7BA00 1520151187 xgc15 1520151187 xgc15 FFB65DEC-E601-40DC-959E-C5B3C90BC6B8 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_JOIN_LIST PDM Reference join list for reference %PARENT% Reference join list for reference %PARENT% Reference join list for reference %PARENT% 1 -50 ParentTableColumn -50 ChildTableColumn 8D1EA1C1-8894-46CE-A2A9-3E87E7CA3268 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 B25BF302-CB57-41C0-98FA-09A1684D6B58 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 7FAB3D09-8819-45D6-8EA3-EB478F03D5AD 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 19641722-4DD3-41D5-964E-724C5D1F9E98 1520151187 xgc15 1520151187 xgc15 EACE22B6-4267-4D41-89C3-1ED7F00A6D76 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_RULE_LIST PDM Business rule list for reference %PARENT% Business rule list for reference %PARENT% Business rule list for reference %PARENT% 1 40 Name -40 Code -20 Type F51D4CF9-258C-4B67-8EB0-A447CA5C30E1 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 ECDB68B1-EB25-41A4-8FEA-A6F5B304E772 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C10B3F73-0BD8-4108-999A-775CE8B34829 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 F95EFCEE-71E3-4077-AEFE-CF20F6A4C483 1520151187 xgc15 1520151187 xgc15 99D71A7F-EED6-4A37-B0AB-8F3601CB19B8 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_DEPND_LIST PDM Dependent Object list of reference %PARENT% Dependent Object list of reference %PARENT% Dependent Object list of reference %PARENT% 1 -40 Name -40 Code -20 ClassName 48464DC2-9AC0-49BA-83DE-968E235FDECB 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 2532FF09-F30D-4E2C-9CAD-25C7E22FE7E0 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 AC752B4C-180B-400A-9A97-11E7B0268CBD 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 50CA876F-B706-4BD2-9DCA-B6F25D16A1E3 1520151187 xgc15 1520151187 xgc15 99614512-26FE-46CF-90CB-A5787E46BBEA 1520151187 xgc15 1520151187 xgc15 1 1 PDM_REFR_EXA_LIST PDM Extended Attribute List of reference %PARENT% Extended Attribute List of reference %PARENT% Extended Attribute List of reference %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 4F81922C-D36E-4010-B950-E5C6A21B7BE9 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 D2AFB262-A5F3-4871-875B-38EF097FA9F3 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 91875C27-9FBF-4B37-A225-878CA61C0127 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 DD90EB2E-6B1A-47CD-9B42-4E350B8376B2 1520151187 xgc15 1520151187 xgc15 4633929D-BBCC-4382-899E-8E788F278361 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 8788514B-8CF7-4619-AA18-14756F23309F 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 49AE045C-E443-4976-BDA5-40B3B7F1324B 1520151187 xgc15 1520151187 xgc15 1 PAGEBREAK PDM 7D1E19C0-5CC5-4F26-B401-475E4C8BD72E 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 8DD734E4-CF30-4EDD-B84B-D21DE39F029A 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Views AF6D7EFB-A8D0-40E9-8021-EC1BB6B7CF81 1520151187 xgc15 1520151187 xgc15 1 1 TITLE PDM Model level views 753CB2B9-3AC4-4048-BFD3-23905ABF3074 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_TITLE PDM View %ITEM% View %ITEM% View %ITEM% 63142F7E-4507-4430-AB58-5C3D650349EE 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_CARD PDM Card of the view %ITEM% Card of the view %ITEM% Card of the view %ITEM% Name Code 052F4211-8A4D-4109-939D-F76490B29D16 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 4E398A21-4076-448D-9E29-706388FF9BD2 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 9E8410C6-ABBB-42F9-B3B6-7AD4F01B1444 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 8A442524-E50B-41CC-9F21-007D937056EF 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_DESC PDM Description of view %ITEM% Description of view %ITEM% Description of view %ITEM% 9CB73691-CD26-41CF-8D8D-69FFD8F34058 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 4A202D32-E7C3-4890-A21F-1ADC3248F048 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 61D3FACB-DF43-43E7-B2AB-25D2123F4FA6 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_NOTE PDM Annotation of view %ITEM% Annotation of view %ITEM% Annotation of view %ITEM% 2E17353D-A119-47B7-9EAA-39EDCE4FAE3F 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 FFE8F12B-02EC-4598-A52C-D76EE5E80D42 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 64F18370-845C-4C13-BDBF-1E68CF219317 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_SQL PDM SQL Query of view %ITEM% SQL Query of view %ITEM% SQL Query of view %ITEM% 1C979C27-076E-44A8-8C79-0034C2097BF0 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 4D83B429-A674-411E-9C03-C7410DDE19C7 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 EDE4C060-F9DB-4053-AF2A-2508E400CB12 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 2C21FBF9-7399-4EF7-AB24-7A5F7795D576 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 C0B1B372-3C66-491C-AA8C-0CF51B876F62 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 32ABB1C6-B576-47E2-93E7-CD51A8A2B2EC 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_DIAG_LIST PDM List of diagrams containing view %PARENT% List of diagrams containing view %PARENT% List of diagrams containing view %PARENT% 1 -50 Name -50 Code 712AFC6E-64AA-4B30-93A8-17DB4983C884 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 DA2DA555-17A2-4704-85D2-86B3BD410DBC 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 74345BFE-B0F5-4381-B1EA-B3113B6FF235 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 15128A1F-D5E8-489F-9CF7-6B7D61CDF63F 1520151187 xgc15 1520151187 xgc15 D7FC2888-FB89-4E56-A973-58C5D20DD4AD 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_RULE_LIST PDM Business rule list for view %PARENT% Business rule list for view %PARENT% Business rule list for view %PARENT% 1 -40 Name -40 Code -20 Type 64EF05CA-6067-43FD-8EFC-3A6F70110D32 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 6F795DC0-180A-45E2-91C1-58238A44C4AE 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2246D278-C502-477F-B5AD-FBEF72423D99 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 34936B9C-EE1C-4700-9551-161A0800D5D2 1520151187 xgc15 1520151187 xgc15 46950520-9FC2-4E66-A00C-6E73393AE40B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_DEPND_LIST PDM Dependent Object list of view %PARENT% Dependent Object list of view %PARENT% Dependent Object list of view %PARENT% 1 -40 Name -40 Code -20 ClassName F2868E15-C9D1-4680-BA40-C8F41CAB5957 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 090E1620-2697-45CA-939E-E8FBA391D052 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 1E9B7887-AE29-4532-8274-2BA92C9A4F49 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 F9693C75-C74F-46AA-BE17-691245D576A5 1520151187 xgc15 1520151187 xgc15 C5F0381B-9E38-4D7D-BB59-51AA83FABA31 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_EXA_LIST PDM Extended Attribute List of view %PARENT% Extended Attribute List of view %PARENT% Extended Attribute List of view %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 079E78F3-0E2E-4A6C-A2B3-AA0D2C27A1F5 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 D7009DE8-DC01-4506-B760-F422F1DAF1C8 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 80FE5F80-159E-42C8-B5C7-B4E4B1AF978F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 4CED98E1-F056-4881-9E2D-4BC04DD239B5 1520151187 xgc15 1520151187 xgc15 CE596463-AAC9-4C7F-977C-3A001FA4CDC6 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_USRDEPD_LIST PDM Extended Dependency list of view %PARENT% Extended Dependency list of view %PARENT% Extended Dependency list of view %PARENT% 1 -33 Stereotype -33 InfluentObject -33 InfluentObjectType 469D7855-4573-4883-AE92-2B89365D500A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 157DA92A-07D8-4A8D-8F3B-71C64C3982EC 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A66918C6-CF2C-4DD2-A534-FF1DDB3F0E0D 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 4CE98770-841E-4651-8EC0-ED392D974B7A 1520151187 xgc15 1520151187 xgc15 1B084F34-B2D5-433E-BC4F-D08BBDA110CA 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 F0443B15-278E-4381-9CBE-633C48FE8FF3 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 0BC335A2-E42E-42C2-9EAF-44259CB7B5C4 1520151187 xgc15 1520151187 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% Views from Package %ITEM% 1 2491A54C-3339-4269-A1D1-CEDC43D3F24D 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_TITLE PDM View %ITEM% View %ITEM% View %ITEM% 2241F318-89E3-4343-8221-F3AD38E5DBA8 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_CARD PDM Card of the view %ITEM% Card of the view %ITEM% Card of the view %ITEM% Name Code 2AB4F98D-DD3C-4BE3-BB7E-61866C00F615 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 84018A10-15C8-4D33-8FA2-F48356414F6C 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 5D401759-244D-4E26-AF43-FBF31BA70C05 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 2 1 18 123731A7-F712-4287-8806-D335F6C48B58 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_DESC PDM Description of view %ITEM% Description of view %ITEM% Description of view %ITEM% 61676F88-9A23-4C6C-9C37-0BFECF09388F 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 BF83CC81-4B4A-4A19-8081-50F8B6218427 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 0C45EDCC-0016-4A1C-9F89-97D5C9531EA0 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_NOTE PDM Annotation of view %ITEM% Annotation of view %ITEM% Annotation of view %ITEM% AE108F8E-8D89-4AB8-9AB2-B3A3BE470B50 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 FEE60422-3669-4D6D-A1D9-B196ED9072C6 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 4E1D94FF-A431-457E-B8CD-F9C612FD3A18 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_SQL PDM SQL Query of view %ITEM% SQL Query of view %ITEM% SQL Query of view %ITEM% EE530644-48B9-4B74-9CCC-DAC02D8395C2 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 57A1E7F7-D66B-433A-B036-79553AF53BDD 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 8B7BFEB9-D797-49D8-A303-9060C75A167B 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% DC507A7B-68B3-4EE7-8D1C-0B7D9A731A23 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 039DAF1B-F29A-468C-894B-BF2198395734 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 0 F373E61D-9DF6-40B5-A891-75222AA7EBCE 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_DIAG_LIST PDM List of diagrams containing view %PARENT% List of diagrams containing view %PARENT% List of diagrams containing view %PARENT% 1 -50 Name -50 Code 099A5800-6BA3-4F18-A6C5-11FA13CF3448 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 FE2174AE-55EA-4F61-B3FD-BF35706A786E 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A7F90FC8-D7D2-46BF-B422-7E55E21AF893 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 F36B6798-DF8D-4F38-B6FE-25C3857137E4 1520151187 xgc15 1520151187 xgc15 BAC99D7B-9158-43F2-A163-E720914E00E4 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_RULE_LIST PDM Business rule list for view %PARENT% Business rule list for view %PARENT% Business rule list for view %PARENT% 1 -40 Name -40 Code -20 Type B294E570-60FC-4247-B45F-4FAC660C1522 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 2A6BA9EC-EEEC-4E07-9F26-7CBE79DEC29A 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 24652BD2-A61C-415A-B833-0762FCD7A807 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 BC3386A9-7483-440B-893D-8B3CF23332E2 1520151187 xgc15 1520151187 xgc15 D082A43D-8864-4826-A552-FF042F9A6412 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_DEPND_LIST PDM Dependent Object list of view %PARENT% Dependent Object list of view %PARENT% Dependent Object list of view %PARENT% 1 -40 Name -40 Code -20 ClassName F3AF65C2-B7B1-4E54-AFF3-CCF7CF7B1279 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 4EE232EE-E696-4912-8DAC-772EA8173F4F 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 8C8D70B8-6B0B-4C28-9130-A9EA5DE05AFC 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 99258EDA-3091-4FFB-A728-3FE4D4D72327 1520151187 xgc15 1520151187 xgc15 CD7E4684-B559-4939-B1D3-D57EE9BBBDEC 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_EXA_LIST PDM Extended Attribute List of view %PARENT% Extended Attribute List of view %PARENT% Extended Attribute List of view %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 3E1E07AD-F83D-4297-BECE-DFE38E6AE614 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 0E4AC3E4-E3FB-4097-841E-E9492D0642A5 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 23EC3C9B-CCEE-46D2-959F-C54628CECB24 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 910B4850-5716-4259-BD54-1984E213B330 1520151187 xgc15 1520151187 xgc15 F2049227-1EB8-463E-A89C-94A7EDD466A2 1520151187 xgc15 1520151187 xgc15 1 1 PDM_VIEW_USRDEPD_LIST PDM Extended Dependency list of view %PARENT% Extended Dependency list of view %PARENT% Extended Dependency list of view %PARENT% 1 -33 Stereotype -33 InfluentObject -33 InfluentObjectType 873BA5AA-0008-45A0-8843-CF5D858AD2B8 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 5135F69F-9E20-45C6-B619-7E7520958FFA 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 2 1 4 15 18 1 18 FAF94DE9-8F15-4E78-B174-21A563BFCD83 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 15 18 1 18 25FD696C-65A6-4B62-A685-B36A5821F6A1 1520151187 xgc15 1520151187 xgc15 FC65EEED-87C0-4A8C-9DAC-FB0B085D63AA 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 F6D5AA32-C177-43C5-BA57-AFD725EE9E7A 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 353 106 0 253F3CFB-C227-47F7-9D3F-0814C335D8A9 1520151187 xgc15 1520151187 xgc15 Arial 10 5 1 423 106 0 FDFB2823-7213-47A0-B44D-754A46D2EA74 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 8 FC988883-6324-474F-BD73-15E2BC532C79 1520151187 xgc15 1520151187 xgc15 18637 3 E7AD5389-8331-4BBD-9CDA-79468FF204B7 1520151187 xgc15 1520151187 xgc15 Times New Roman 10 1 2 6CB94A64-F1A5-4A7C-9E36-935AF9729954 1520151187 xgc15 1520151187 xgc15 9549 2 31360B31-5FC2-46CE-B630-EFCBF668DEF7 1520151187 xgc15 1520151187 xgc15 19098 3 563AD98D-E295-4070-9CF8-B4C08FC2C4A4 Simplified Chinese ZH-CN 1520151187 xgc15 1520151187 xgc15 F3A0BF0F-7536-11D5-A4D6-0008C79B4501 585CBB37-C940-11D1-BD0D-00A02478ECC9 F6286BA7-1961-4383-A9BF-DDE1FA1B644B Base_Table Base_Table 1520151187 xgc15 1520151187 xgc15 file:///. 160EB092-2F96-4235-852F-052B990C5A86 CDE44E21-9669-11D1-9914-006097355D9B 1520152423 60F3F38A-27B8-4A5B-92FE-140B232919F7 Report 4 Report 4 1520151423 xgc15 1520151423 xgc15 xgc15 %DATE% LightBlue_Theme.css Header_LightBlue.html Footer_LightBlue.html 54 18 4 0 Home_LightBlue.html Light Blue Professional 1 3D9F3DAF-8E85-4B9F-9858-EF7A6B477FF4 1520151423 xgc15 1520151423 xgc15 新宋体 10 1 4 423 106 15 0 DC97FC0F-9794-4F0D-B4C8-5A853C1BC910 1520151423 xgc15 1520151423 xgc15 Microsoft Sans Serif 10 4 0 E3826CC4-C8F8-4C12-9ABF-39F64E6D5BD5 Section_2 0 1520151423 xgc15 160EB092-2F96-4235-852F-052B990C5A86 %_HOME%\Resource Files\Report Templates\pdmstdus.rtp 1 TEMPLATE PDM %MODULE% %MODELNAME% Physical Data Model Base_Table 0 %APPNAME% %DATE% Page %PAGE% 页脚 0 ((800,899), (1100,899)) ((549,508), (660,635)) (20998, 29698) 1B8CA8D0-2A7D-4815-8F94-421CB3D3DAD8 1520151423 xgc15 1520151423 xgc15 1 TBLCTS PDM D5E3F49E-A54E-4B83-8F6E-62379374C8E7 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 E8BCB5C3-93D2-41B7-8552-274B48C0DFB0 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 1 12B5389A-1124-471B-A42B-35370F0903DA 1520151423 xgc15 1520151423 xgc15 19098 3 C5B65801-77FF-4BB2-8DDB-C68EC87E0817 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 350 1 B6C10035-E5C6-4428-AD53-64E44E903756 1520151423 xgc15 1520151423 xgc15 19098 3 A848E846-D402-4F4E-93C6-8D3703DD29A1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 700 1 41D30052-CB1D-40D3-B76A-A0EBFAF7C97A 1520151423 xgc15 1520151423 xgc15 19098 3 8DAB616B-83EE-46E4-8923-E76BDA9EBD8A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 1050 1 4BA2F162-E532-4B29-BADA-BF06ADAE5EB4 1520151423 xgc15 1520151423 xgc15 19098 3 3918C356-FE97-4169-88DF-FEFDE0E5E33E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 1400 1 77FF76E6-FEFE-437C-B0B4-CA92B4D1909C 1520151423 xgc15 1520151423 xgc15 19098 3 9DF9107E-E6C5-4D6A-B2C5-4509E85B08E2 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 1750 1 0B35579F-D488-4D30-9A78-CE1D5F185BEA 1520151423 xgc15 1520151423 xgc15 19098 3 7C97F97D-FD64-4455-BEC8-6D8DB8C68E05 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 2100 1 8A1C97F6-A466-4AE3-B33E-D3ACD58E8F88 1520151423 xgc15 1520151423 xgc15 19098 3 CA196BBA-3C6D-47AF-8616-03FC76D62778 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 2450 1 502587D1-F626-48BD-A7B1-FC016FD874FC 1520151423 xgc15 1520151423 xgc15 19098 3 28D1E268-E83E-4C13-8346-307968FE7CA5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 2800 1 3F503BA6-F026-45FB-86F5-54B4442A3B82 1520151423 xgc15 1520151423 xgc15 19098 3 DC80E0AF-F506-4DCA-8B0A-3BD13E441828 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM PDM Diagrams FE4A17AE-515C-4187-9468-FD7065D22A10 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Model level diagrams 95AA42F5-14B0-4831-9546-95D4A8647101 1520151423 xgc15 1520151423 xgc15 1 1 PDM_DIAG_TITLE PDM Diagram %ITEM% Diagram %ITEM% Diagram %ITEM% 886A004A-88CD-4E1D-AF04-12E1277A3EF3 1520151423 xgc15 1520151423 xgc15 1 PDM_GRAPHIC PDM 1 1 49EEBBE5-2F8A-4D14-A1F7-CDA485EDCAFF 1520151423 xgc15 1520151423 xgc15 Matrix Item Font Name 22959464 21916 1 353 106 72D6949A-1920-4E12-A117-E17590F58CF6 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 5CFE6B18-56AF-4B48-BEF4-325320A75C2A 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 7445232B-584F-4C6E-8A67-036BBAB17CDA 1520151423 xgc15 1520151423 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% Package diagrams %ITEM% 1 B972C6E3-49BE-46C7-A544-2B6810028EE1 1520151423 xgc15 1520151423 xgc15 1 1 PDM_DIAG_TITLE PDM Diagram %ITEM% Diagram %ITEM% Diagram %ITEM% C4B43A54-017E-48EE-896E-15A0DC7D895D 1520151423 xgc15 1520151423 xgc15 1 PDM_GRAPHIC PDM 1 1 A1CA2097-8704-419A-9BAC-D0383169B8BE 1520151423 xgc15 1520151423 xgc15 Matrix Item Font Name 22959464 21916 1 353 106 70411870-07A2-4560-A78F-4D91F528B797 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 ED12ECBB-2AC2-4AA5-AE00-112646FA9B88 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 A11D6604-21B9-48C6-A9A9-39C7C3F646FC 1520151423 xgc15 1520151423 xgc15 1 PAGEBREAK PDM 5C1576E7-0482-42D7-9E92-BCC4C0A1D9B2 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 C3E473DC-CA87-4C13-979C-3C8A9F985234 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Model level object lists 3086143E-1CF6-461F-8929-93833F67076D 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Common Objects 3EA05029-DC4F-47F9-86C1-C138537DAE2F 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_RULE_LIST PDM Business rule list Business rule list Business rule list 1 -40 Name -40 Code -20 Type B6D917B3-07F9-462A-A6B0-CA81BDC2AE04 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 C91DD9EF-72B5-4646-82F4-C433019273BD 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 9E83D489-6B2B-405F-A426-9023B331F3FB 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 3646E7F4-EC32-435C-B9AF-CB4FDD731EF3 1520151423 xgc15 1520151423 xgc15 530CE16E-C148-4E9B-9D1C-F7226E4B7668 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_DTSC_LIST PDM Data source list Data source list Data source list 1 -50 Name -50 Code 6622A397-AD25-41F3-930E-E7F468E5DD81 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 1113BB66-7DF3-45DE-8795-ECF41D08F498 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 E6A77FCB-A220-4D6A-BF4A-B902C2F5C16C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 728125B3-4088-448E-A474-01AE520B013F 1520151423 xgc15 1520151423 xgc15 00829659-ADD0-4876-B2B3-0BBADFBCEE3A 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_DIAG_LIST PDM Diagram list Diagram list Diagram list 1 -33 Name -33 Code 65A67D0F-A916-463C-BA0E-E0AE64126346 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6B9B6AD8-2820-4FEE-9270-D37150F2078E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C135F826-84B0-49C6-A8EA-1D1B26F6589E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 DB4BC2B9-6C10-40C4-8119-6FB8D294095C 1520151423 xgc15 1520151423 xgc15 9B853CB0-C33C-46FF-940F-315CE53725BA 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_EXA_LIST PDM Extended Attribute list Extended Attribute list Extended Attribute list 1 -30 Name -20 DataType -20 Value -30 TargetName 7CDEA038-83D3-4AF6-B02D-4152923BC51E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 7D27EFAB-9783-4DD4-BE3F-833925F353F6 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 21CD3147-6D45-4C29-B9EF-F46D518FBAF5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 C8FFB685-2F9D-4957-AB94-E1D8354D353E 1520151423 xgc15 1520151423 xgc15 B6C42FB0-D53D-4943-AA76-0309183B5035 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_FILE_LIST PDM Files list Files list Files list 1 -40 Name -40 Location -20 LocationType 01A3E993-D5E8-4FCF-95EA-9A7C088E72D5 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 8952FB08-39A9-49CD-8EEC-79FC8AA71E1C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 BBF54732-5AB2-4E48-A7E1-3C04C5656605 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 080B810D-2CC3-404A-AA0F-42461CFB4449 1520151423 xgc15 1520151423 xgc15 C39C2734-B831-4D32-BCAB-812234F51DE8 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_PCKG_LIST PDM Package list Package list Package list 1 -33 Name -33 Code -33 UseParentNamespace ED8C6868-5C56-435D-BCB4-6614AD8A1404 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 A1EC30F4-08C7-4E80-93E6-D2C29D024FCC 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D0EBC2B6-EC04-4215-8D05-49A85C7818CA 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 BF75CB6F-975E-4458-A6CD-099DADE53A9A 1520151423 xgc15 1520151423 xgc15 84F7E200-297F-4B97-AEC2-6A77F93A0489 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 A7A4F6B2-1352-4F88-A6AA-372CA64ADC20 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Physical diagrams objects 3D7F7C29-35AA-4725-94B2-689FCCFAAD7A 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_ADTS_LIST PDM Abstract Data Type list Abstract Data Type list Abstract Data Type list 1 -50 Name -50 Code 38C2CA9B-B510-44F2-A7D1-FF95064E4C80 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 DABCE908-DA76-464A-A5FE-04CC556BA749 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 30EC900B-B046-4A96-8101-AE6C00CD8D6D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 E644D6C2-C147-47D9-8FE1-A7A24DCAB387 1520151423 xgc15 1520151423 xgc15 F8F9F732-4319-4B7B-AFED-2844798D2E7E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TABL_COLN_LIST PDM Table columns list Table columns list Table columns list 1 -50 Name -50 Code 398DF0A1-54D2-4B7F-B558-C5E692C3E207 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 7EE4344E-002A-4C8F-B6A3-2E801156172E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6BB910AA-AA24-424C-BCF9-5FFA531B6B7A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 6E760A80-169B-49E8-99B5-86A3DF1926D9 1520151423 xgc15 1520151423 xgc15 F8DA4D88-32A6-4D73-9DFB-06740DA8BF4F 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_DOMN_LIST PDM Domain list Domain list Domain list 1 -30 Name -30 Code -30 DataType -10 Mandatory 4BA0AB77-0A81-45E1-9A4F-1A417C3B1AA3 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 210C8EF8-15DA-460A-AD90-6940463458C6 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2E32269B-35D2-46A2-A683-41C1B6B35CF2 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 81D41198-5403-4BB5-8E69-FEFCDF4C31A8 1520151423 xgc15 1520151423 xgc15 BA3B85FC-F2A2-4B06-B080-AA14C3354FEE 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TABL_INDX_LIST PDM Table indexes list Table indexes list Table indexes list 1 -33 Name -33 Code 15 Unique 15 Clustered 15 Primary 15 ForeignKey 15 AlternateKey -33 Table 17D52ACB-2340-4F8D-AD3B-3C01C0F2439B 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 302C6E72-EB52-476F-95D8-175A2F40DB1D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 7BBF35D6-1FE3-493D-91E0-6800E0AA8A9C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 B2A79D85-2091-4FF9-BFEE-209254C822DE 1520151423 xgc15 1520151423 xgc15 84CE0C90-7EC9-483E-8122-18D05572A380 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_JIDX_LIST PDM Join Index list Join Index list Join Index list 1 -50 Name -50 Code E4FD38FF-A333-4B13-8C22-C3EE376929C8 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 43A7CA91-28FA-415A-B1E1-8976058D2906 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 7DB0A8B7-3F33-4A5C-8833-EE2E5BD4C766 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 33AC3166-785B-49CB-B7A2-2DFA1649B871 1520151423 xgc15 1520151423 xgc15 58C18471-C049-42C1-B92C-A7AEDB2DBD33 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TABL_KEY_LIST PDM Table keys list Table keys list Table keys list 1 -33 Name -33 Code -33 Table 5D915556-D209-4BE2-B094-1B1FEC871397 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 C490A275-CB54-4F55-96BB-8CC2866CAD1B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 86461079-1132-4983-8045-108B6BCB40E2 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 8A49DF8A-1759-4D3F-8CB4-0D7A37860B6D 1520151423 xgc15 1520151423 xgc15 F388812C-5806-48F7-956A-A447F4EA8D5F 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_PROC_LIST PDM Procedure list Procedure list Procedure list 1 -50 Name -50 Code 7D395CC9-0168-4C73-BCD0-79A4C102CFF5 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 8FB12427-985C-4709-A1D0-7F7731EE89BA 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 7B4F00D2-96DD-494E-B03A-6EE7599FEE67 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 C3D76085-689A-46D9-BCF4-3B2D533591A6 1520151423 xgc15 1520151423 xgc15 DA51F732-9FB1-4435-A42C-AD88C08EB8AB 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_REFR_LIST PDM Reference list Reference list Reference list 1 -25 Name -25 Code -25 ParentTable -25 ChildTable 4CC3E3A7-54BB-4279-9B47-26A24EF04BC4 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 8E56A1D1-0813-4EA8-A6DC-8BF08B58F5D1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 9F059678-4C5C-4737-9CE5-93EA255EDE59 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 EFBF46AF-FE26-4B10-97B0-0043AEA68A8F 1520151423 xgc15 1520151423 xgc15 888ACED3-4AAD-4792-8BED-1841ACD57624 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_SQNC_LIST PDM Sequence list Sequence list Sequence list 1 -50 Name -50 Code DD068F13-4CB9-47A4-883C-4D485EA116B2 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 D5613FE6-9A46-417E-B3E8-D476AF5916F0 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B1A5A827-386D-4B81-AFFB-D527C6884F6A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 8FA060E8-F66C-4503-B108-079648480809 1520151423 xgc15 1520151423 xgc15 9B17EFC1-0A1B-411F-BC34-7EA9D0E677DE 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_STOR_LIST PDM Storage list Storage list Storage list 1 -50 Name -50 Code 5023164A-A0AE-461E-BEC1-606665B36D3C 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 672B683F-8AFF-43E1-8FDD-0FA0A3199F36 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C6FDA0E6-2C15-4842-A2C4-9C65BF0E252E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 9BF0656B-0AF7-4B83-B929-50BEC2655550 1520151423 xgc15 1520151423 xgc15 DA316CC8-282E-4357-8CB1-755EE9476CE8 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TABL_LIST PDM Table list Table list Table list 1 -50 Name -50 Code 1397E1EE-5B5B-438B-834B-CA624B4C360A 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 180ACC73-EA3A-4621-B23F-85C6C46C97B7 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 E4676510-15AA-453F-9D04-5FCC0EC516F0 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 8E814B39-EEBA-4315-A650-A8542FE18DE2 1520151423 xgc15 1520151423 xgc15 0DEE73BD-993D-4612-96F9-E254A2DD2CAE 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TSPC_LIST PDM Tablespace list Tablespace list Tablespace list 1 -50 Name -50 Code 55241C91-1230-49F0-A5E0-C0C76416359D 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B03F1C15-5CC9-4C6E-B756-42FFC7F92BF3 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A31DC067-0B85-46FE-8FDA-C861A7442017 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 3A421DB8-E099-469E-8107-546C72F3B1D3 1520151423 xgc15 1520151423 xgc15 CB5FD64D-6823-4C1E-AB67-4DA4C5AD1F35 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_PROF_LIST PDM Test Data Profile list Test Data Profile list Test Data Profile list 1 -50 Name -50 Code B3E605B4-09F0-4E59-8263-65D84DA3F74C 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 61E2386C-A86C-4F45-AA92-8CAC11035708 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 F7664A3A-ED89-40E8-B8EE-87A7638E5DCD 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 8262B707-7763-4C73-8F3D-684F7645C8EC 1520151423 xgc15 1520151423 xgc15 0571CE0A-DCF0-4D25-8478-47352AE50ABD 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TABL_TRGR_LIST PDM Table triggers list Table triggers list Table triggers list 1 -50 Name -50 Code DF92E60A-9F52-4DE2-9B83-EE72E19ECF17 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 8F5AD087-E730-4068-96AD-8E54EEDD8EBC 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 0BB76DF3-2D96-4F9D-B803-78DAC755830C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 91CF9664-650E-4626-A9DC-A6CB58D7B8E0 1520151423 xgc15 1520151423 xgc15 57D67A4D-A1D5-4087-9E93-B0236BE261E9 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TRGI_LIST PDM Trigger item list Trigger item list Trigger item list 1 -50 Name -50 Code ED269C9D-FDAB-4442-A8AA-44C8D4562941 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 1B772920-B45D-4FA7-9C3C-5F58296B47EB 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 425E55F7-42BA-4D98-B892-9530C268B5B9 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 18B9BE43-E573-4E17-90DF-681951307157 1520151423 xgc15 1520151423 xgc15 AD14D195-D917-4DB1-8F06-188B0B18F90E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TRGT_LIST PDM Trigger template list Trigger template list Trigger template list 1 -50 Name -50 Code BC9FECEE-7106-4CA7-994A-857DD59E6CFE 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 A04FBB8A-6988-4048-9E5F-FB7D9D97D675 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 CE808897-7C77-4C7F-BEA5-4257B9413C1B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 4501B191-C381-4451-92FD-67A07148335B 1520151423 xgc15 1520151423 xgc15 6575F54F-DA26-4F25-9DEC-3C263DAFF96F 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_USER_LIST PDM User list User list User list 1 -50 Name -50 Code 811EF872-2ABF-4EC0-96CB-92DB7BBD944F 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 E3D4C33F-92FC-4B5F-B25C-CF0FEFD624C3 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 F70580CF-8416-4A74-9F24-76832572CA7F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 E3A9E582-6712-4FF9-A49D-830177C013E6 1520151423 xgc15 1520151423 xgc15 DD9057A2-898A-4F84-B8C7-F4738CF9C3F5 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_VIEW_LIST PDM View list View list View list 1 -50 Name -50 Code C276109F-209C-4A40-99F1-F6A0BCA0D8A0 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B60F9F13-61CB-4A70-8F35-F6000F910C9A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 299F0782-C891-4308-815A-B551B78D4320 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 DCEDE3D5-65C6-47A3-9AA0-C9C6B3602148 1520151423 xgc15 1520151423 xgc15 4283FEB2-C44A-475C-9F03-0B6EF1D8FD2E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_VREF_LIST PDM View reference list View reference list View reference list 1 -25 Name -25 Code -25 TableView1 -25 TableView2 D824862E-9467-407D-BEFD-2BAA146CEE5A 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 DA9AB6EB-A79C-4F47-9CC6-5D80B9E39385 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2251716C-5DDE-489E-90B7-8AEACE730D0F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 63400E56-856B-40D9-B8C1-543648D59DBD 1520151423 xgc15 1520151423 xgc15 9C6D1FFD-D09C-4C43-85E8-BECC29BC63BA 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_SYNM_LIST PDM Synonym list Synonym list Synonym list 1 -50 Name -50 Code 36E32971-8003-44E2-B244-BC054F4AB292 1520151423 xgc15 1520151423 xgc15 Arial 10 5 353 106 0 4BE5F321-9907-4E2E-B300-964058D232CC 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 4 1 1 1F62A21A-119E-4082-AE01-B0A5098276A1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 1 2CE3F083-FA49-44D1-93DE-58D4D504A408 1520151423 xgc15 1520151423 xgc15 21C38D12-4B60-4E84-BC00-D18D363D7AF2 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 D163F290-110A-49BC-B57D-3DDC4BFB9639 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Multi-dimensional Diagrams Objects A84F1265-9CD2-4A7D-ADB4-6089E4517DA1 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_ASSC_LIST PDM Association list Association list Association list 1 61A3C941-9094-4859-AE04-1C11C66ED3D4 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 FCA5920E-431E-44E9-8AE2-A0F2CE4BD5C5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 8AB9CB03-1C2F-4C1D-9CBF-5CE2F6AAEF0A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 EDBC3DB2-75D9-4924-A902-DE12FF4456FA 1520151423 xgc15 1520151423 xgc15 2EED99A2-3712-487F-A87D-EC7F00F55F3F 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_DIMN_LIST PDM Dimension list Dimension list Dimension list 1 -50 Name -50 Code 00789073-D4BA-4FE9-9E64-5DAC95265B81 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 45F7C895-EC39-4A69-866E-64428D404E3C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D3E45BA3-23F7-4D98-97C0-6C8474B14654 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 FBEF8609-BC9B-487E-9384-A554E05A30B1 1520151423 xgc15 1520151423 xgc15 0B647FDF-BB15-4B1E-A0F0-326578794F69 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_FACT_LIST PDM Fact list Fact list Fact list 1 -50 Name -50 Code 5A159B8E-18B3-4EAE-952D-137F23B6007E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 F3B29E64-A1DA-4C83-9CA2-A8B95A1CBB0F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D20925E3-9443-4B63-BF65-A8FFC5535CA0 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 7501725D-45EB-43C3-B663-1A3959381F44 1520151423 xgc15 1520151423 xgc15 46280300-0219-4072-8A87-9A3CC2D5E5B3 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 130C76E4-55E7-4239-A72C-11D6E0E041DF 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 C49952A7-C472-4147-83BC-13856E8E6C2F 1520151423 xgc15 1520151423 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% List of objects for package %ITEM% 1 Packages 1D8347D2-C07C-45E7-8B20-F115CC7B89CF 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Common Objects 6D28209B-7859-4A35-81C3-2A2FC052CEBA 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_DIAG_LIST PDM Diagram list Diagram list Diagram list 1 -33 Name -33 Code 93561738-1907-4D0A-88B9-15D66D40CBC7 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 580757CC-C0E3-47D7-AA7C-A5BD4607AE98 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 863A8F40-B4B2-4F9E-96B2-AF53EBECEBAD 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 2F639631-3556-4805-A9B5-8F87A489DC31 1520151423 xgc15 1520151423 xgc15 814BE6EB-D0B0-4650-9316-B4596FC05F67 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_EXA_LIST PDM Extended Attribute list Extended Attribute list Extended Attribute list 1 -30 Name -20 DataType -20 Value -30 TargetName 0B82CF54-7FA7-4913-8C39-5CB5CACDE5F6 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3F577B09-0994-4D42-8673-E5488B103189 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 0D2B5E74-535C-4751-BE04-DD60D896C276 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 EC95C740-3E48-44DC-8E3B-561C4387A1F7 1520151423 xgc15 1520151423 xgc15 DF5231AD-DF69-424F-A32A-CCA83AA931E5 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_FILE_LIST PDM Files list Files list Files list 1 -40 Name -40 Location -20 LocationType 46702808-5262-4CBA-AE03-0783A55F1EC9 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 E3FC35B9-B163-4A9A-B051-684D74AC1656 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 AF2D8925-0933-4FB2-8025-56ABD6172DEF 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 BFCC7779-86C3-4AAD-B9AF-CDABFE709CBB 1520151423 xgc15 1520151423 xgc15 A8ABC6EC-5D17-44DC-AC5E-4AA41E028178 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_PCKG_LIST PDM Package list Package list Package list 1 -33 Name -33 Code -33 UseParentNamespace 3C72BBC5-F7F6-4625-8F91-90BB10046037 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B046D7D9-7A42-4105-BAAA-6CD557FC3A5E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C629586A-9C55-47FF-92BC-A47B3A5C5B7A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 DE082E33-A92B-4324-9F07-1E2B7AEC1CB7 1520151423 xgc15 1520151423 xgc15 7CE1D2E3-8CA0-41B6-8D13-9C519ED1F2C3 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 C6288BCC-8785-4C88-9576-33A0E62696E0 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Physical diagrams objects D3909663-406C-4EB0-9B94-71F2851834F7 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TABL_COLN_LIST PDM Table columns list Table columns list Table columns list 1 -50 Name -50 Code 5D9EABE9-3D64-4FB6-A029-A43BCF55D66A 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B35864F9-140C-4A16-AC42-1F7013F2B9D3 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 EC2D8E6E-3BA2-4072-A588-C58A6E2B7817 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 91671EC1-ECA5-47E6-A54B-7F7CED1BD4CF 1520151423 xgc15 1520151423 xgc15 3F5C71D4-A15A-4950-9953-DE47155A3479 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_DOMN_LIST PDM Domain list Domain list Domain list 1 -30 Name -30 Code -30 DataType -10 Mandatory 86A22404-C7CC-47B2-A3D8-8D387B9B07F5 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3270AD86-08F8-44EE-A78A-53984679CDF1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 F6EDDAAF-5FE9-4032-882B-B05F1E83E05D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 5395C188-E4EF-4E24-9489-946EBC011DFD 1520151423 xgc15 1520151423 xgc15 908A3EB0-BF86-4D43-866D-2F5F09559F20 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TABL_INDX_LIST PDM Table indexes list Table indexes list Table indexes list 1 -33 Name -33 Code 15 Unique 15 Clustered 15 Primary 15 ForeignKey 15 AlternateKey -33 Table 862B89CD-CC53-4CA6-A4D3-E1B45904B337 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 4B5A6EF6-1F64-4A39-9782-137757F8CD21 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 CD0FFBA7-2E18-4B0D-947B-1E5EB32CCAF0 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 CBDDC1E1-C0CE-42A2-A2ED-4E2338FC9FE0 1520151423 xgc15 1520151423 xgc15 BA0ABF75-AD41-4C64-AF77-507B920D7E4D 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_JIDX_LIST PDM Join Index list Join Index list Join Index list 1 -50 Name -50 Code 9FED02F2-73F6-4174-8105-0F57184D179E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 E0650624-D5BA-458B-BCB2-9BC4F6ED826B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 CB76A648-6D2D-47C0-8C9E-74C6A4F094AF 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 9380DC46-E46F-4AB4-9DA1-DAB9329A7BD9 1520151423 xgc15 1520151423 xgc15 E87CAF7F-FDD4-458E-AF74-57FF426F3A68 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TABL_KEY_LIST PDM Table keys list Table keys list Table keys list 1 -33 Name -33 Code -33 Table 07FC884B-5129-46C0-ADEA-6E7C56911445 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 DE5695F4-E469-4FE2-A980-A8E8417C03CF 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 FFE775D3-DC21-41DD-9470-0279DD97C85B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 D0786D9B-97F9-4561-906D-AEAD4F9B4160 1520151423 xgc15 1520151423 xgc15 4ED8EA2A-C353-42AB-AE3F-97F078A01CFE 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_PROC_LIST PDM Procedure list Procedure list Procedure list 1 -50 Name -50 Code 5034BD87-0B8B-4DA4-A3C4-104D3D07CB84 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 BCB02F84-3A57-428E-B169-37DE91B63605 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 74E95358-2A5C-4D93-821B-766AAC7A54CF 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 E0BB4BF8-8AB1-4B26-8F13-7B4DEDFE3DF8 1520151423 xgc15 1520151423 xgc15 5A24C246-1BB0-4075-9689-19C8A76D6D28 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_REFR_LIST PDM Reference list Reference list Reference list 1 -25 Name -25 Code -25 ParentTable -25 ChildTable 27079CF2-7508-40F0-B6CF-D38FF471CDB1 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 D089AA01-7540-4A60-ADD9-FCA4AFCCFF95 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 587BFA24-9D38-4BCE-8C16-5D8F9ECC1B48 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 7770E6A9-CE89-467C-B4CF-9BA4A22E1387 1520151423 xgc15 1520151423 xgc15 4ED1567A-1CF6-40E1-B960-59096CA27BD2 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_SQNC_LIST PDM Sequence list Sequence list Sequence list 1 -50 Name -50 Code E48A3E4C-7657-4F9D-B9AC-02E89CC7013D 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 BA3A24E5-E77A-49C4-A4ED-927B43E9D79B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 0822B394-4560-4A32-8BAC-904EAAC4DF30 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 8E172071-651B-40EF-BC25-BB1D337B53DE 1520151423 xgc15 1520151423 xgc15 AEDFB38D-6DB5-4737-872E-1A631CEC487B 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_STOR_LIST PDM Storage list Storage list Storage list 1 -50 Name -50 Code C277D4C2-108A-4DC7-A31C-5C0B40BF8259 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3E9A9D22-DFDC-40D3-BB58-D973386A8981 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 0DB5673A-798F-40B2-A773-3201C388195C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 474A3080-0B2F-44D7-A0A6-A633F4C27C6F 1520151423 xgc15 1520151423 xgc15 6C8B7474-017B-4513-8E7D-BF9831ADFC09 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TABL_LIST PDM Table list Table list Table list 1 -50 Name -50 Code B8A33954-4069-4EFC-80CF-D69903848955 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 45DFDB14-E52E-4F10-970D-A763EC8C723C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 719E0C7F-6AB0-4442-BC38-6D8665FFEA7B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 DF9D6001-3779-42AB-AD48-EE04EFA7B724 1520151423 xgc15 1520151423 xgc15 236488AD-9AFD-42F0-9F7B-EA7729DC122C 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TSPC_LIST PDM Tablespace list Tablespace list Tablespace list 1 -50 Name -50 Code AFB1615C-E7BA-438A-ABB2-BF2AC9576848 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 35FAC8B5-9699-496C-BF72-0D6642CD9811 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 EB2AA7D0-3648-4849-959F-F0E92F50C261 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 F110FB76-DC47-4BB7-ADE1-4506785E387B 1520151423 xgc15 1520151423 xgc15 646E2E97-8754-4D4E-B2CE-58A6B8DF9C4C 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_PROF_LIST PDM Test Data Profile list Test Data Profile list Test Data Profile list 1 -50 Name -50 Code E8FBB22E-0034-49B4-9648-9AA6A2E0C2FA 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 4072E638-C39B-4D13-AFE2-F206EC8F129D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2A940C41-C87F-4020-B813-2406B34D2B9E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 70951502-7EAD-4257-955B-216B33D2686E 1520151423 xgc15 1520151423 xgc15 F2E84B8D-FF7E-4F4E-9A1D-A858B8581329 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_TABL_TRGR_LIST PDM Table triggers list Table triggers list Table triggers list 1 -50 Name -50 Code 84FEBADA-2F59-4FBC-B22D-E3036E91E0EA 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 1A3BD0A0-14FE-4764-9344-59CFFAD8C23C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 AF2DB5A6-9D5F-4713-9124-92D7563B6823 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 91721EB2-C708-4F6B-BF08-5C5A171F01B7 1520151423 xgc15 1520151423 xgc15 91A1C49B-89BA-4295-B1E3-8769B4288DEA 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_USER_LIST PDM User list User list User list 1 -50 Name -50 Code C25D75A8-0C3F-4403-A105-39403D46D1EF 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 26BF8790-1580-4AF9-B10E-3C1FDABF8E17 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D0635EB3-D7BF-4ADF-BD20-02631846E97F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 09B8C4F4-EDEB-4C72-876E-E7507291F94A 1520151423 xgc15 1520151423 xgc15 024B373A-568A-4149-8CFC-0D18778168F3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_VIEW_LIST PDM View list View list View list 1 -50 Name -50 Code 9A7E9D85-8E11-4EF1-9FEA-957423A8E105 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 A7A6F6C1-69BC-4636-9F01-21707D1C65D8 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6E576981-534C-4357-B7D5-ED1DE84C9F9D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 BC11CEB9-910F-4F93-8957-526C34E59705 1520151423 xgc15 1520151423 xgc15 4013CE9E-4C5F-4B2B-AE21-30C9F17CDD5E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_VREF_LIST PDM View reference list View reference list View reference list 1 -25 Name -25 Code -25 TableView1 -25 TableView2 F8ACF602-7E5D-4671-BCEE-33C0304548F4 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6DD36886-700C-4BAF-B47A-F9E2869E1A93 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 4A02A577-C338-4D7A-A4F5-8192E0E3970F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 127C108F-593A-4CE6-AA64-770F4F11115F 1520151423 xgc15 1520151423 xgc15 EED7E53E-CA61-4406-8103-C781E770C00F 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_SYNM_LIST PDM Synonym list Synonym list Synonym list 1 -50 Name -50 Code 6FF3C1F7-4CB3-4000-98F1-A0594AAF9B5E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 353 106 0 E47F4608-C35D-49BB-BA83-FDBD14FCA982 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 4 1 1 6F40E481-1196-4947-A5E3-7F63286B8BD6 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 1 89330DE8-D5AA-42A8-BF18-C95F94A539FE 1520151423 xgc15 1520151423 xgc15 9915FEA9-DE1F-4115-AD9A-B153097C10E6 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 473A46BA-7041-45CA-AE60-27DEB55A6BCE 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Multi-dimensional Diagrams Objects D16FB8A7-593D-4B87-AE5E-2BA801FC203D 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_ASSC_LIST PDM Association list Association list Association list 1 FD84CC1F-BB8C-434A-8910-790A48249499 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 540D2688-403B-450E-A94A-476AA4905EFB 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 A88BF583-8911-4D14-8431-BBC2FC8D27AA 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 2E87C807-B493-40EF-BB88-82D20137EBBB 1520151423 xgc15 1520151423 xgc15 EC714899-1B5D-4C22-A0DA-29BCFB7C38D4 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_DIMN_LIST PDM Dimension list Dimension list Dimension list 1 -50 Name -50 Code 75A061BE-0AF7-4A04-98F8-A2A742DC6853 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 546BBE6B-F6F8-4BAE-B255-D3A55CE73563 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6671AF52-BC8F-46B6-A9DC-D21424734723 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 F7A15013-5A44-401E-8A28-983E706E1358 1520151423 xgc15 1520151423 xgc15 F8E29CDA-6D56-4317-951A-1D5B597722F3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_MODEL_FACT_LIST PDM Fact list Fact list Fact list 1 -50 Name -50 Code A67A70F8-1340-41EC-A7FA-C4FF7FCF01C5 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 32DAE570-8B5A-44ED-8D9F-5F9BEF7C4F02 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C9D62644-498C-41C4-B5C0-4840B82CEA33 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 5DFB2F73-0D92-41B4-A27C-75C032513A51 1520151423 xgc15 1520151423 xgc15 B8D58C1D-0D33-40F0-95D2-B6564A35DD6E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 DE7DF03F-DB73-408C-987F-A167C20694E8 1520151423 xgc15 1520151423 xgc15 1 PAGEBREAK PDM B10A1E20-0342-4630-B7C9-5141EFEB7CAC 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 D2EC0688-071F-4ED8-9958-2A9223E5B623 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Tables D795B2BA-28E3-4AB9-B510-B7EB807B996B 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Model level tables DD190E00-EF6E-400E-B1EE-4A6E642FC311 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TITLE PDM Table %ITEM% Table %ITEM% Table %ITEM% 21A7BB8B-CA89-44B8-BA04-7AA03910EE73 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CARD PDM Card of the table %ITEM% Card of the table %ITEM% Card of the table %ITEM% Name Code DBMS 3A64AE82-FF99-43DE-9BB1-FD6FD6DD3C5B 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3ADEB762-4D45-45B6-AB87-7EF39FE36582 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 28D25A8B-3756-47A7-9F0F-A984A179864E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 D0F90ADD-D007-448D-9DC1-03D06B0E5C34 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_DESC PDM Description of table %ITEM% Description of table %ITEM% Description of table %ITEM% 7DC60D00-F841-4A32-B6A2-E8528C48841E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 4978E4FD-75E1-4B64-8860-7AE54C7A6D56 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 34926628-A2E8-430A-AA42-F585675DC9A6 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_NOTE PDM Annotation of table %ITEM% Annotation of table %ITEM% Annotation of table %ITEM% 06E3EF66-8C05-4F61-BF53-1ED6A7E6F20A 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 09A4165A-1F9B-4470-904A-EE76E808B2D6 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 B911D7A4-445F-4D1C-B077-90347DC04C67 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CKCN PDM Constraint name of table %ITEM% Constraint name of table %ITEM% Constraint name of table %ITEM% 05B9CBC9-BBFE-4463-A6D5-B1A2EF4E4E3C 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 02074456-F738-470F-9E4A-1DA66E6702A4 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 28074069-F392-49DA-A6FB-9EB565E1C659 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_OPTS PDM Options of table %ITEM% Options of table %ITEM% Options of table %ITEM% B1AC6D2B-285D-4C16-BC4C-DDEF08F07A59 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 19B7C758-9F69-4382-8884-609DB96FEB00 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 08479137-E12E-4026-961F-2328E1647CD0 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CRUL PDM Client check expression of table %ITEM% Client check expression of table %ITEM% Client check expression of table %ITEM% 055CCAF3-F3DF-4F82-8C63-4E1121D986C3 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 EA3E103F-764F-465E-8483-73AC20523D31 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 1865E430-1B56-4B54-8577-064DB789089A 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_SRUL PDM Server check expression of table %ITEM% Server check expression of table %ITEM% Server check expression of table %ITEM% 4C71CF31-CB35-4BB1-911D-30E9F78353FD 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 44CAEA37-5667-49EB-BA77-80F6AB97DAD8 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 6629B66E-2987-4F30-AAF3-0DA0A6173989 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_HEAD PDM Begin script of table %ITEM% Begin script of table %ITEM% Begin script of table %ITEM% 120BDFC6-9E44-4AEB-84B8-3FBB70A9A514 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 7724D3D7-4190-4993-9D2F-D85E31853825 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 B3CF9F82-6580-4C35-BEA2-6901BDCD2A9C 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_FOOT PDM End script of table %ITEM% End script of table %ITEM% End script of table %ITEM% 337F7179-1908-447D-B32A-EB6CD17D2F60 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 84DD4402-F221-4E97-BA04-F9A0A0394EAC 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 03A2CBA3-685D-4C50-A891-7771DBB1CC33 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% ABD83C7D-21B2-4B42-B0C9-5642F1DD3EED 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 96AADE12-CFF9-4ACB-B3CD-3D9B50A1889F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 F317DFB6-6687-4AC1-A02B-6B9EE658A9E6 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_DIAG_LIST PDM List of diagrams containing table %PARENT% List of diagrams containing table %PARENT% List of diagrams containing table %PARENT% 1 -50 Name -50 Code 69C25C5E-9447-4FE8-8C8E-8D42AFEA3A28 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 83A8FE47-4F5D-42F2-8290-2D342E6821BE 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3FFC096D-9ABC-4342-880A-822A80A06742 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 04758050-B4E1-46B3-B305-5ED87DC16A34 1520151423 xgc15 1520151423 xgc15 6FFC6C8D-9354-49F6-A81A-CD2494FE8DF1 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_OUTREFR_LIST PDM Reference from list of the table %PARENT% Reference from list of the table %PARENT% Reference from list of the table %PARENT% 1 -30 Name -30 Code -40 ForeignKeyColumnList 74D383BC-E7C6-4B52-B3A5-13A3D1177B97 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 548CB10E-88C9-45AF-B8D8-F342D471A18A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 19BAC2FB-11EB-4DD7-AED9-C37732D89EC5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 CC6C2CC1-7537-4812-B766-3FC9D11BAC3D 1520151423 xgc15 1520151423 xgc15 363F2552-3438-4D3D-B3A5-BEC447150E85 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INREFR_LIST PDM Reference to list of the table %PARENT% Reference to list of the table %PARENT% Reference to list of the table %PARENT% 1 -50 Name -50 Code 9AB23194-F639-4230-A849-2806DD3327FF 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 E3708112-3431-4235-9D68-0DC525FAE9A3 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 DF5DA6C9-0F96-4D9A-A0D6-84CF9D39D71E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 AF544F31-8B87-498A-96BD-0E34E96DA923 1520151423 xgc15 1520151423 xgc15 2EDF6765-CE6D-492B-AB30-A7D56903C81A 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_RULE_LIST PDM Rule list of the table %PARENT% Rule list of the table %PARENT% Rule list of the table %PARENT% 1 -50 Name -50 Code 26A1DB94-FD6A-4391-A4E0-ECE810F53E60 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 E723E681-D335-4D5F-A906-CBB57B9DC8D1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 47EAAE0F-4B73-48E9-8663-DD5317950B27 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 F12E16DB-41DF-4D37-B1DE-A94C2316FCF0 1520151423 xgc15 1520151423 xgc15 B99B54C9-762E-4ED5-A2D5-CFBC605E1983 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_DEPND_LIST PDM Dependent Object list of table %PARENT% Dependent Object list of table %PARENT% Dependent Object list of table %PARENT% 1 -40 Name -40 Code -20 ClassName 4D4F1645-7B40-4B73-AEA8-C44B80800FD1 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 5F0E6266-6854-448C-B825-06D8CE7B9FDE 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 541387B0-C15D-4144-B9B4-A9FF8A056601 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 F270B8EB-231B-4322-925E-C84FC97728F8 1520151423 xgc15 1520151423 xgc15 D77E7251-ECD3-4BD4-89F7-6A192A38DB5D 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_EXA_LIST PDM Extended Attribute list of table %PARENT% Extended Attribute list of table %PARENT% Extended Attribute list of table %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName BB7D8924-4A7E-4800-BAD0-D6F986FD2D51 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 189F57FE-B803-4B46-A333-2FB262FFA50F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D7AE13A8-A958-439E-A1DE-FA72CCD7D4A1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 324EF0C8-665C-40FA-983A-0D7C8328AD7E 1520151423 xgc15 1520151423 xgc15 5795C8A5-8B3B-4E86-889D-860E6E94A049 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_USRDEPD_LIST PDM Extended Dependency list of table %PARENT% Extended Dependency list of table %PARENT% Extended Dependency list of table %PARENT% 1 -33 Stereotype -33 InfluentObject -33 InfluentObjectType D8290E21-5A0C-4848-9466-10AF288B4427 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 A560402B-443C-4570-8D3A-0E55A0877753 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3878B6F1-830F-461E-998D-CE098B87632C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 57F97788-FBA0-468B-B6F2-247CFF878CA8 1520151423 xgc15 1520151423 xgc15 53AACDD7-53B4-465D-814E-B5E0207CE470 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_LIST PDM Column list of the table %PARENT% Column list of the table %PARENT% Column list of the table %PARENT% 1 -50 Name -50 Code 7E5C699F-579C-47B0-BDFD-1003E7CFF2C5 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6EBEF1C9-E1A5-44A2-82E6-19390A3AD97F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 0B88F9B3-32DA-4C34-92A9-BBAA1553F558 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 14D7CB98-DA4D-4987-9959-28BC791207A3 1520151423 xgc15 1520151423 xgc15 30CE0A52-8E35-4154-BBA1-1866E4BDF464 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_GROUP PDM Column %ITEM% of table %PARENT% Column %ITEM% of table %PARENT% Column %ITEM% of table %PARENT% E7DD8128-9209-433E-B536-CC7479635F38 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_CARD PDM Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Name Code DataType Mandatory CE1B2C37-ECC6-4E06-B0D3-17478B0615C3 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 D41A76BA-AABE-4731-A0B7-107F3B3CEE82 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 4E18BF66-D9A6-45E2-AB21-EBA26EDB1E7A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 4E2FCE9F-8851-48BF-9364-021CAEA27A09 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_DESC PDM Description of column %ITEM% of table %PARENT% Description of column %ITEM% of table %PARENT% Description of column %ITEM% of table %PARENT% 3E2ACBED-F132-4EC8-AB33-8A7EE00130E9 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B9EBA9E3-57EF-4966-A664-BE9988E29FDF 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 CA889551-7A05-4D19-BD8E-B914EB2E4744 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_NOTE PDM Annotation of column %ITEM% of table %PARENT% Annotation of column %ITEM% of table %PARENT% Annotation of column %ITEM% of table %PARENT% E4E567AA-21A4-42CE-A16E-BA9DEDB436F6 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 365A5A14-6D99-4A82-838F-1746A563F273 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 75EC5540-646B-4023-9603-57C678FDE176 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_CKCN PDM Constraint name of column %ITEM% of table %PARENT% Constraint name of column %ITEM% of table %PARENT% Constraint name of column %ITEM% of table %PARENT% 3563BC9F-1550-4A76-8977-339CCAA9018F 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 29E91A7D-030B-4A7A-87F6-4B19E1F2DEE5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 419BEB93-C9AC-4671-8E12-B10AE2F05853 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_CHECK PDM Standard check of column %ITEM% of table %PARENT% Standard check of column %ITEM% of table %PARENT% Standard check of column %ITEM% of table %PARENT% LowValue HighValue DefaultValue Unit Format Uppercase Lowercase CannotModify ListOfValues AEE98C9B-48BC-4D26-A26F-6533FEE8379F 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 959BB730-B85C-426B-B7DA-08A947D72BCF 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 B5CFF4F3-1336-4CA8-A31C-D0C34665F2A7 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 B4E95138-F5DC-44B2-8EFC-0F0D119C8CE2 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_CRUL PDM Client check expression of column %ITEM% of table %PARENT% Client check expression of column %ITEM% of table %PARENT% Client check expression of column %ITEM% of table %PARENT% DA76345D-9A9F-4A7E-9F61-DADBCE77941A 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 91C97184-CA91-4449-81A0-5F1CA07FB342 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 E6EB53C4-BAD5-4249-9596-CB7451E584CE 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_SRUL PDM Server check expression of column %ITEM% of table %PARENT% Server check expression of column %ITEM% of table %PARENT% Server check expression of column %ITEM% of table %PARENT% B3EF1076-B423-4214-8E11-0D6145D7CCDD 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 E8EF9046-4448-45E9-8E44-29324A5A5727 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 85DAD165-C365-454D-B531-B86904972A03 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_RULE_LIST PDM Business rule list for column %PARENT% Business rule list for column %PARENT% Business rule list for column %PARENT% 1 -40 Name -40 Code -20 Type 1E927228-4BA3-4F2C-AC76-70A88094237D 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 E84002A1-BF92-41ED-B2E0-D3044D4F181C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 8B0F376F-4486-462E-BE6E-D1E709630CB6 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 A59D5FEE-5CB0-4996-9324-CF58D21B81E3 1520151423 xgc15 1520151423 xgc15 ECB2EBDF-584E-4C07-B9B6-96A6C1F94F9F 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_DEPND_LIST PDM Dependent Object list of column %PARENT% Dependent Object list of column %PARENT% Dependent Object list of column %PARENT% 1 -40 Name -40 Code -20 ClassName 0FDCDC3F-C5D8-4A2D-B5A4-3C21EF2944F1 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 513C5CEC-9055-4C4A-A26A-49F5066C7945 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 F691D812-D69C-4B77-9491-678DBDDA5FE2 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 8A249403-AB1B-4CBF-8471-02EE35CC6475 1520151423 xgc15 1520151423 xgc15 2AC0382E-6EE2-4EE0-B492-D2D5CB7E82D2 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_EXA_LIST PDM Extended Attribute List of column %PARENT% Extended Attribute List of column %PARENT% Extended Attribute List of column %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 2E571C79-D1E3-4EBF-85A7-8B70235BE1A4 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 C84FB574-31D1-4DDA-B2F8-2B3094F6C0E2 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 0DB3E3F2-D1D5-45CD-80DF-CAB37922CD60 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 990CEA69-4F00-4A79-9593-E55193CDA79D 1520151423 xgc15 1520151423 xgc15 1F4AC2F6-D510-46D1-9A9B-3DC949A3E333 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3B006EAE-5054-4342-9DAA-1B76C05A7C88 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_LIST PDM Key list of the table %PARENT% Key list of the table %PARENT% Key list of the table %PARENT% 1 -40 Name -40 Code -20 Primary 45DC5596-FD76-4177-8FB8-9EBB6F615724 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 7F979BC2-66C9-4334-B052-0BB1D680F099 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 DAE58A01-17FE-48F5-B017-DCB2DFD1B248 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 B1BA2506-978E-423F-BE26-2F99A8C0876D 1520151423 xgc15 1520151423 xgc15 7928A16E-07F9-49D8-A724-C5EE29CEF943 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_GROUP PDM Key %ITEM% of table %PARENT% Key %ITEM% of table %PARENT% Key %ITEM% of table %PARENT% C7D958D6-77D3-4BBC-95C7-26A1FD33D60E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_CARD PDM Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Name Code Table 9172F94F-B497-4B80-BE2E-CF642EA6DAC6 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 2B15E7A7-7577-407A-BA84-6278C635ECDB 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 264F3D38-3C87-43E8-BC04-6E3C5C3B3385 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 6D8095EE-313E-4DA3-9983-AEDD0807CCAA 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_DESC PDM Description of key %ITEM% of table %PARENT% Description of key %ITEM% of table %PARENT% Description of key %ITEM% of table %PARENT% 015B79CC-3575-4A93-80DC-EC8E9CBDAEF7 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 302A9F60-5353-4915-A85F-9A5E3FCDDB8F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 35B97F10-CFE7-4A97-9F13-1B777D91C57A 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_NOTE PDM Annotation of key %ITEM% of table %PARENT% Annotation of key %ITEM% of table %PARENT% Annotation of key %ITEM% of table %PARENT% 01CBEFA3-FE7F-4D11-AAE8-34C19FCC66B5 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 CC6CD734-D6D7-4454-9722-DD70B81F8DB9 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 1BCDC598-4CE3-423D-9A27-E8741CF80114 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% E7825B3B-90DC-434E-89F0-F4A5283097F4 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 361C3154-2F25-44EE-8718-8639B5173377 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 EC803E1F-2576-4B3F-B50C-49DB65D8B0CB 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_COLN_LIST PDM Column list of the key %PARENT% Column list of the key %PARENT% Column list of the key %PARENT% 1 -40 Name -40 Code 2044313E-7173-45CC-B8D2-FD5A32F1953E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 C0397EEC-BDF0-4486-80E0-351CCCB5652B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 9720BDC7-90B1-467F-AF6D-D3FB6227F829 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 25AF84F3-A2F8-4973-9E4D-F325810B4B26 1520151423 xgc15 1520151423 xgc15 2075671B-0B27-48EF-A4C0-7A639E7D535A 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_DEPND_LIST PDM Dependent Object list of key %PARENT% Dependent Object list of key %PARENT% Dependent Object list of key %PARENT% 1 -40 Name -40 Code -20 ClassName 8396BCFF-796A-4788-8692-6187D4A31AA4 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 EDC30B6E-C833-4FC7-9FCA-AA75956A8C2C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 BE64FA36-B0E2-4FF2-A5FA-9E5F01530A75 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 770CF679-54FF-4484-A1C5-0EBA1C475DD6 1520151423 xgc15 1520151423 xgc15 DA01FCD4-7A5F-4834-A191-FD53FEBAE56D 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_EXA_LIST PDM Extended Attribute List of key %PARENT% Extended Attribute List of key %PARENT% Extended Attribute List of key %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 0A77A143-7A83-4243-B18C-09FE2F8F1717 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 0436050F-6236-421E-9219-7B868A042E9B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3FDEEC8E-FEB5-4C83-BD5D-B97B07B62646 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 0CB84DC8-10BF-4B7F-85FE-DB00F44539E8 1520151423 xgc15 1520151423 xgc15 BCF1B0B3-B720-4CA2-A831-C011E756F818 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 911D94B8-E828-416E-9105-E83DD20DD8F0 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_LIST PDM Index list of the table %PARENT% Index list of the table %PARENT% Index list of the table %PARENT% 1 -20 Name -20 Code -12 Unique -12 Clustered -12 Primary -12 ForeignKey -12 AlternateKey FB4FF54C-286F-48E0-8827-DE45060986EB 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 7F395D11-5DA0-4CFD-8F21-3A3C97C0EBF7 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 BF559408-AF86-44D2-A534-360AF67872AA 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 165CDEC2-3E9E-46B1-8E97-5AC73E85B268 1520151423 xgc15 1520151423 xgc15 B8D31DA4-AA6F-4E58-BE94-E3A2BFE4F2D3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_GROUP PDM Index %ITEM% of table %PARENT% Index %ITEM% of table %PARENT% Index %ITEM% of table %PARENT% 08E75F48-1E1D-4EF4-B9D4-7F58C871A3AE 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_CARD PDM Card of the index %ITEM% of the table %PARENT% Card of the index %ITEM% of the table %PARENT% Card of the index %ITEM% of the table %PARENT% Name Code Unique Clustered Primary ForeignKey AlternateKey Table 7538056F-ED16-434A-8DE7-32F22C35E8BF 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 12ADA2C8-8D9F-4D95-9126-736E757F76FF 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 31F27853-97D7-47C0-AFBE-2CA69D8DCD76 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 A167C1A8-DE72-44F9-B6DE-34865C8E8FA2 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_DESC PDM Description of index %ITEM% of table %PARENT% Description of index %ITEM% of table %PARENT% Description of index %ITEM% of table %PARENT% CE9E391C-5E6C-4F23-A930-99D1E9CD7324 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 05090842-95EF-4062-A698-F98E0A3700A4 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 8B71F1F9-405E-459B-94FC-74B5FBA4BFC0 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_NOTE PDM Annotation of index %ITEM% of table %PARENT% Annotation of index %ITEM% of table %PARENT% Annotation of index %ITEM% of table %PARENT% BC1AE058-2959-4F36-A267-E62387DBF688 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B206C289-F4A5-49B6-A842-5DAF204669BD 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 97DC763F-ABEA-4F9D-A67A-5D2D898B9EC0 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 6BAEE641-D531-40D1-8D00-3FB63D4330DF 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 94B2D008-2E0D-485F-A002-8F31B452D140 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 D5082209-63A0-4A64-A6BB-0EF7EF7229A3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_COLN_LIST PDM Column list of the index %PARENT% Column list of the index %PARENT% Column list of the index %PARENT% 1 -38 Name -38 Code -24 Ascending 797A8E70-1A32-4DE5-A471-6C7464CA17D5 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 BD2DD853-0C63-4E0C-A6A5-51EF9454FCF7 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 73EFA706-3D7F-43D7-A97D-E5AC95E1C5D4 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 E58849F6-FE5E-4480-8CF8-3ED34BB99EA1 1520151423 xgc15 1520151423 xgc15 4C19AB01-55BF-4628-AE83-767919554FBE 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_DEPND_LIST PDM Dependent Object list of index %PARENT% Dependent Object list of index %PARENT% Dependent Object list of index %PARENT% 1 -40 Name -40 Code -20 ClassName 5885AD87-9F53-410E-847E-20060D58688E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 24E78B6C-2809-455F-A9D8-4A8E36B41F00 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 0379AC26-1A3E-4952-965B-22A1133C5BEB 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 150B2E75-D1D3-4AF1-809D-7DFEFB90E29E 1520151423 xgc15 1520151423 xgc15 CE8D9DE8-7A68-44D3-8461-8087785BFE3D 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_EXA_LIST PDM Extended Attribute List of index %PARENT% Extended Attribute List of index %PARENT% Extended Attribute List of index %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName BBCA5A33-67FB-4450-8567-178BD3057D9A 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3AABCB9B-BA13-47A1-8F36-B9260E4259BC 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 4FBAEE38-2027-48DE-8E5A-0DD8430B97A2 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 A093A8CE-2D6B-47B6-8FB1-3A504C7DE9A2 1520151423 xgc15 1520151423 xgc15 656AA66A-6D06-49E6-B26C-94468B3B198E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 5F124C18-A857-4646-B8BB-15461F2BD0E4 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_LIST PDM Trigger list of the table %PARENT% Trigger list of the table %PARENT% Trigger list of the table %PARENT% 1 -50 Name -50 Code 41081C89-500D-4793-BA8F-C5653F7D19BD 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 5D849BF9-B17D-4034-ABC0-3106366EBB0C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 E39C2F1E-362E-482C-B14C-1B36F1BD85FB 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 0274260C-8964-4E16-B4C8-F583B4339088 1520151423 xgc15 1520151423 xgc15 0135035F-279D-4FE2-975C-03249D8BDC31 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_GROUP PDM Trigger %ITEM% of table %PARENT% Trigger %ITEM% of table %PARENT% Trigger %ITEM% of table %PARENT% 63944921-C14C-40F5-9477-CA9F4C370C96 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_CARD PDM Card of the trigger %ITEM% of the table %PARENT% Card of the trigger %ITEM% of the table %PARENT% Card of the trigger %ITEM% of the table %PARENT% Name Code Generated Table TriggerTemplate UserDefinedSQL BF3CE3A6-155D-4A8E-9E7D-4F67D8E5B877 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3DE88F0F-7D13-4C56-9692-C817858AF9E2 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 C7B9CE11-D3A9-4106-B0AC-58562AF0B259 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 FE3A1DA5-ACEA-4DBD-9D52-C16681DA9739 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_DESC PDM Description of trigger %ITEM% of table %PARENT% Description of trigger %ITEM% of table %PARENT% Description of trigger %ITEM% of table %PARENT% B11F9D35-2A0D-4650-A748-47D77E72EC71 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 427CC969-51F8-489C-9DBF-5EC8629AE620 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 D2D05472-D35B-4065-BB6E-FB2658A47D35 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_NOTE PDM Annotation of trigger %ITEM% of table %PARENT% Annotation of trigger %ITEM% of table %PARENT% Annotation of trigger %ITEM% of table %PARENT% 48ED1CFA-E026-47F8-BF3F-E76A18792B42 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B40F4B70-D49A-4759-9D87-D92AE8A670A5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 EAAF151E-27F4-403D-BBD5-20BD9853F1CA 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% ADF1EFE6-1828-4E04-8182-4555D809D8C3 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 E922B931-C5AE-48CB-957B-D62FE306AA42 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 B20251CB-FC51-4BD3-869D-A2E51EEA8B1C 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_EXA_LIST PDM Extended Attribute List of trigger %PARENT% Extended Attribute List of trigger %PARENT% Extended Attribute List of trigger %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 874F70DD-B466-4365-829B-271EA521294D 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 A4B99510-91DC-42FA-9F34-412CB67B87B6 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 C85DE611-9059-4D0D-99EF-C767A1436391 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 7257B05C-1A0F-4953-9C62-967AEEAA66B6 1520151423 xgc15 1520151423 xgc15 4D2D38E5-C610-4E0A-B9C9-DCDB34738C70 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B2BAA9F6-5296-449F-AFBE-F03ECE3A5BF3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_LIST PDM Mapping list of the table %PARENT% Mapping list of the table %PARENT% Mapping list of the table %PARENT% 1 -50 Name -50 Code 1FB32A37-74A1-43C6-9374-10C044E89447 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 332AFA15-8078-4986-BAEE-4496658AF19C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 395D84A0-7990-4A7B-A6DD-8062EBC277D3 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 D1696FAD-40C4-493B-8776-A37A4A94EB4D 1520151423 xgc15 1520151423 xgc15 11B3D362-EAD5-4384-BFB6-BBC3E501D9BF 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_GROUP PDM Mapping %ITEM% of table %PARENT% Mapping %ITEM% of table %PARENT% Mapping %ITEM% of table %PARENT% 99DD0528-8ED8-4134-BEDE-4C757FCBFD73 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_CARD PDM Card of the mapping %ITEM% of the table %PARENT% Card of the mapping %ITEM% of the table %PARENT% Card of the mapping %ITEM% of the table %PARENT% Name Code 2C95FEA3-DFC5-4CB0-91CA-F4CDAFD5DF4D 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6A835383-CBAD-4411-8530-CC4BFCFCD35D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 7E8CC751-D7C9-4E4B-A290-44FAC7A037B5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 A1F347CD-E368-4A8E-A49C-80F8ADA68F8C 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_CRTR PDM Criteria of mapping %ITEM% of table %PARENT% Criteria of mapping %ITEM% of table %PARENT% Criteria of mapping %ITEM% of table %PARENT% 1AE4C3D7-5889-44DB-972B-704794A17F36 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 CA779B68-CE88-4F6B-A70D-9881730684BF 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 01C72B21-1F5C-4185-848A-F6930C6DAB4D 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_EXPR PDM Source expression of mapping %ITEM% of table %PARENT% Source expression of mapping %ITEM% of table %PARENT% Source expression of mapping %ITEM% of table %PARENT% EA9993F1-938B-40BD-8F62-7C73C157FF3A 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3FE73B15-A9BB-41A2-93F2-625CDB80889A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 BAC34D14-59D8-4629-8509-08059C5810D3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_SFEA_LIST PDM Column mapping list of %PARENT% Column mapping list of %PARENT% Column mapping list of %PARENT% 1 -50 Column -50 MappedTo DA2B2157-B4BE-4071-872C-D4069CD93D17 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B98A51C8-B01C-4C1B-B42F-9F32AFBEA6F4 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 51CE4BE5-9E44-4B60-8586-20450240A127 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 B248D7FB-8349-4ED8-9CB9-4DBE44508B68 1520151423 xgc15 1520151423 xgc15 9322410F-DB82-4F82-9092-6C689C583674 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_SCRC_LIST PDM Table sources list of mapping %PARENT% Table sources list of mapping %PARENT% Table sources list of mapping %PARENT% 1 -50 Name -50 Code F0B5397F-8625-4DF8-93D3-C8E625ADE034 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 48E867E8-47EF-4118-99BD-A4F6A0E229F4 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 87FCE07E-3D2C-4BEF-AC0D-E2503CA494B0 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 7E68FC4D-61F7-4DA5-A210-E3CF0F6D85DB 1520151423 xgc15 1520151423 xgc15 C2D47371-1C7F-4A0B-95DF-BB4C6A0BD7F9 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 840C36D7-66C2-4B5F-8D3F-1F615E4A887C 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 1990AE1E-4D48-4627-912E-3926B88EC64F 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 696BFD44-9500-4B6E-BC2B-762809F77FC5 1520151423 xgc15 1520151423 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% Tables from Package %ITEM% 1 6EAE93A6-124D-4B8C-AADE-47E187118420 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TITLE PDM Table %ITEM% Table %ITEM% Table %ITEM% 214FA28D-B316-4A31-BB77-FB9DD77DD35A 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CARD PDM Card of the table %ITEM% Card of the table %ITEM% Card of the table %ITEM% Name Code DBMS 7B92323D-614B-4381-B67E-12ED3E7E5730 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 225406AE-FEB9-4818-880B-058DF556B1FF 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 94A9AB46-8FF2-4A3A-93B7-FBC1982C64D8 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 6BD057FA-1CCD-4805-A521-7C358E996E83 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_DESC PDM Description of table %ITEM% Description of table %ITEM% Description of table %ITEM% D98AFD5E-C14A-4B1C-A9B0-9DEC05194E31 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 FD88818A-15E4-422C-98A2-ECA88658E289 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 E4D6AD25-6B3B-4822-9877-9ED158910392 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_NOTE PDM Annotation of table %ITEM% Annotation of table %ITEM% Annotation of table %ITEM% EA280627-BF23-4CCD-9025-0C7AE66B558A 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6744DEE3-967D-41A3-B440-7D08DE2D2C95 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 0E6B2744-5F0E-4D33-B6D2-79F235C820A7 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CKCN PDM Constraint name of table %ITEM% Constraint name of table %ITEM% Constraint name of table %ITEM% BD4767FF-10D6-4E46-ADF3-8461FA8C5ED2 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 1560E36D-AFFB-4AA8-A139-A8363CCAAE44 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 DCB3AF33-C192-40C9-884A-C1F0A3B79FE9 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_OPTS PDM Options of table %ITEM% Options of table %ITEM% Options of table %ITEM% 37D679E2-0739-4CF6-A732-F1FC5331C396 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 360589A0-5D2C-47A6-8FB3-37E111336784 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 1A39A2C8-3706-4437-9581-A2C95554EAC7 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CRUL PDM Client check expression of table %ITEM% Client check expression of table %ITEM% Client check expression of table %ITEM% 70B0C5F6-CE9E-4224-A060-42F4C66316BA 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 FDB8033F-9135-4A6B-A642-993FA5AB0E49 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 CFC2EF0D-6ACB-4BEB-91F4-ECF98EBB36AB 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_SRUL PDM Server check expression of table %ITEM% Server check expression of table %ITEM% Server check expression of table %ITEM% C68AD6BC-15ED-425D-8CD9-B630ECED4159 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3DE09436-E64C-4556-B89D-D398998C257D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 1EC87DE9-4E01-458F-B702-67800720FEE9 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_HEAD PDM Begin script of table %ITEM% Begin script of table %ITEM% Begin script of table %ITEM% 6374D7A8-17FB-47BB-8982-8DD555A095DA 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 E908E359-C4CD-4D5F-9FA9-CE349B9AB805 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 BB7B94F4-234F-40FD-AECC-88D927C6175E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_FOOT PDM End script of table %ITEM% End script of table %ITEM% End script of table %ITEM% FA0B7D8B-4FDB-413D-943C-684F85A949CA 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 66D24041-9E31-430B-B0F3-AAF04E621D5A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 6B2F702F-314C-4749-BE1F-D803FA2D1F53 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 15FE6865-32C3-43D4-9E47-3A3ED6814D79 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6A777AC6-5B7B-4736-A27F-824D3C838FF8 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 7A6863FA-A45F-4DC7-8342-127812D612B5 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_DIAG_LIST PDM List of diagrams containing table %PARENT% List of diagrams containing table %PARENT% List of diagrams containing table %PARENT% 1 -50 Name -50 Code B8005A5A-CB00-4516-B990-B2F65FAF0597 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 32764BBC-E49E-45EA-A636-BE829116D3C0 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 9462F12E-3FBE-49A8-8DF3-DA4517EFEECE 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 34D1916F-3DD9-4766-840A-A6F1B77630BF 1520151423 xgc15 1520151423 xgc15 8C7077CA-C42B-41A8-ABCA-DA6E90BDB7DE 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_OUTREFR_LIST PDM Reference from list of the table %PARENT% Reference from list of the table %PARENT% Reference from list of the table %PARENT% 1 -30 Name -30 Code -40 ForeignKeyColumnList 2F36E04A-9584-47B8-9C97-04E5980B9151 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 CC078786-B13A-4A53-8E93-AA9E88EFF390 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 8E7B65D2-E301-4A2C-B89D-4E6DA437B527 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 3A0B9582-1229-4848-8768-AA6828629849 1520151423 xgc15 1520151423 xgc15 E287F408-78CD-4EE6-BC24-727508AB8C03 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INREFR_LIST PDM Reference to list of the table %PARENT% Reference to list of the table %PARENT% Reference to list of the table %PARENT% 1 -50 Name -50 Code 6B867AD3-2460-4E3A-BBB4-4D92E9E12A00 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 E4E7E306-07B7-41D6-AD7C-D3AB3B7CAC68 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 32C1318C-34ED-4D90-B86C-5C175659E826 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 6D0B7380-F65D-43D5-9398-5E8E1D3A6185 1520151423 xgc15 1520151423 xgc15 B56094CB-0C55-4ACE-BA60-FC1C5E215D7E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_RULE_LIST PDM Rule list of the table %PARENT% Rule list of the table %PARENT% Rule list of the table %PARENT% 1 -50 Name -50 Code 25D13513-4152-4C3B-9D7D-8971975A748F 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 2A1B714D-770D-4E9F-8554-55E061A00486 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2154DF6C-B7DB-4B1B-BAD8-8EE9F9F39C2E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 0E4E0008-A6F7-46F5-9AF7-902DFF9DCE3F 1520151423 xgc15 1520151423 xgc15 30B47B79-3218-4232-BDFC-A7F518281527 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_DEPND_LIST PDM Dependent Object list of table %PARENT% Dependent Object list of table %PARENT% Dependent Object list of table %PARENT% 1 -40 Name -40 Code -20 ClassName 10939FE3-8DEB-4FA0-9D24-F0A9D930D057 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 767E8AC6-0E8F-489F-8AB1-8162175B6E8C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D011AB2E-EC75-4034-9811-2CC25130025B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 78463A70-88A7-46F3-BD16-C8519A8086F3 1520151423 xgc15 1520151423 xgc15 439E9C48-3660-49AC-B8C0-C702005314BA 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_EXA_LIST PDM Extended Attribute list of table %PARENT% Extended Attribute list of table %PARENT% Extended Attribute list of table %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 0D1A2BEC-12A8-4778-AE61-DCC77CF597A8 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 87430E87-A27F-49AC-AB4B-355137CF3414 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 14AC0EB1-783B-4806-B799-1C5407603A6C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 39A71DDB-2CFE-4847-B57A-D06120AF742C 1520151423 xgc15 1520151423 xgc15 4943C61D-1038-459E-A9E5-D557445E1BD5 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_USRDEPD_LIST PDM Extended Dependency list of table %PARENT% Extended Dependency list of table %PARENT% Extended Dependency list of table %PARENT% 1 -33 Stereotype -33 InfluentObject -33 InfluentObjectType 448282B8-745D-41FF-8C1B-B361F8E0707A 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 F0E1E350-B79E-48EF-A9E6-24435884C384 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 468AEC13-A15B-43C9-BC53-01B4788D1BF2 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 096C0244-F6D8-4ABB-B6AE-856B2B2C7731 1520151423 xgc15 1520151423 xgc15 97BF88B5-BD5F-431B-87B2-4485AE0453F4 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_LIST PDM Column list of the table %PARENT% Column list of the table %PARENT% Column list of the table %PARENT% 1 -50 Name -50 Code E14DC416-525E-4CF2-8EEC-07CFAF5C1E09 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 2DCE9C35-C565-45DF-A3A8-1AE59E4CD4DA 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 7BD515B9-199A-451B-9E27-940BAD0FC64F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 F16F13F5-D973-4B09-96B1-339AC043341D 1520151423 xgc15 1520151423 xgc15 73CE4F57-CF71-4F3F-8AB0-B8D59B6C0DFF 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_GROUP PDM Column %ITEM% of table %PARENT% Column %ITEM% of table %PARENT% Column %ITEM% of table %PARENT% 38DDF252-D197-4260-B79F-2D686DAD0B1B 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_CARD PDM Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Card of the column %ITEM% of the table %PARENT% Name Code DataType Mandatory 0F2D61F6-C101-4EED-81F7-4AB6326E03C4 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 C1903F8C-83A4-44DA-8061-0A607973F3E1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 06B1F8F6-B126-4AAC-BACA-729BC44E6036 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 F9F7E33E-A813-41F1-BC01-AFDAA9E4F16B 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_DESC PDM Description of column %ITEM% of table %PARENT% Description of column %ITEM% of table %PARENT% Description of column %ITEM% of table %PARENT% ECBD7CA6-5F05-422B-91E8-30DD30EB49E8 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 26F28148-812F-42E9-81F5-93E51E776E8C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 1A730D65-0D77-4A57-9CDA-4177566C60C4 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_NOTE PDM Annotation of column %ITEM% of table %PARENT% Annotation of column %ITEM% of table %PARENT% Annotation of column %ITEM% of table %PARENT% BE9DE802-A760-4724-8733-C1FB3FE01244 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 59D529FE-0205-4B43-A0F5-63EB483D6FA8 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 418D3AB0-08A5-4C12-A985-CDB62C4395B4 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_CKCN PDM Constraint name of column %ITEM% of table %PARENT% Constraint name of column %ITEM% of table %PARENT% Constraint name of column %ITEM% of table %PARENT% 908051FC-8E2F-48D3-8875-FCFB8464B1CF 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B0FD34FF-8C29-4170-BC0D-5C8BF0B8E809 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 C94E4499-EF8E-455F-8393-37C5DC8631BA 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_CHECK PDM Standard check of column %ITEM% of table %PARENT% Standard check of column %ITEM% of table %PARENT% Standard check of column %ITEM% of table %PARENT% LowValue HighValue DefaultValue Unit Format Uppercase Lowercase CannotModify ListOfValues 8974D4FD-2AF7-402A-A274-FE0291CA9B5E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 D865ECA9-F219-4523-A14E-220F7CF261BC 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 5F043893-2278-4419-A274-8574229A8C93 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 04728A5F-5F85-4C27-AE5A-AD7F45B3F4D9 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_CRUL PDM Client check expression of column %ITEM% of table %PARENT% Client check expression of column %ITEM% of table %PARENT% Client check expression of column %ITEM% of table %PARENT% 1776145E-9200-4262-899E-352EBD2A1D86 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 FA6D50CC-68C9-4A8B-964A-B328D97BEC05 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 8B020AF8-D8FE-4446-8480-2A5A24058463 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_SRUL PDM Server check expression of column %ITEM% of table %PARENT% Server check expression of column %ITEM% of table %PARENT% Server check expression of column %ITEM% of table %PARENT% 01C45634-EB9E-4B38-882E-51E093C0A30E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 2E10B1EF-8540-4A62-9620-9E396A6B9172 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 3F7EB03E-9CA2-4913-A50A-ACC44B3CD4E3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_RULE_LIST PDM Business rule list for column %PARENT% Business rule list for column %PARENT% Business rule list for column %PARENT% 1 -40 Name -40 Code -20 Type 476AB092-4761-4C52-A54B-166B4C0A6FF8 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 1486AD3F-A7A9-4F80-87F8-4CA9CBF8D263 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 67B41890-CC61-4ACD-8987-AC85FB4ADB06 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 0F2D30EA-4A4E-49CF-8594-E5C0677E9D9F 1520151423 xgc15 1520151423 xgc15 E80D7184-D905-4AFB-A147-253113DC198E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_DEPND_LIST PDM Dependent Object list of column %PARENT% Dependent Object list of column %PARENT% Dependent Object list of column %PARENT% 1 -40 Name -40 Code -20 ClassName 8D9A8577-464C-4B1D-BD0E-3483798C67A8 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 9B09B1E6-6A4D-4206-BDBF-1497E748422B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 31B31B0B-4615-4C4D-9128-2B56D6DAC78F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 AAEC932C-369F-4892-B432-46F24B591694 1520151423 xgc15 1520151423 xgc15 80DDAE43-A2C6-45F8-AF6A-446021B9D9A8 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_COLN_EXA_LIST PDM Extended Attribute List of column %PARENT% Extended Attribute List of column %PARENT% Extended Attribute List of column %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 16C3A8A5-5F7E-49E2-97ED-E8599577877C 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 0F02BEFE-E28D-40B5-87BC-8EC646557973 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 D05E3E06-5073-4E6A-A32C-804071C99E30 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 25B5828B-47B7-4CE3-88D1-304EA99BC30E 1520151423 xgc15 1520151423 xgc15 F381499C-7D84-4735-B4F0-082F7672077D 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 1B4E2B57-57B3-4A4C-BBC1-736E5618D637 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_LIST PDM Key list of the table %PARENT% Key list of the table %PARENT% Key list of the table %PARENT% 1 -40 Name -40 Code -20 Primary 410E4A57-7163-43B9-9C3E-63011BA11202 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 26A71505-3660-4934-AF4A-FC25BF3E357B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 32E730DC-FA85-4FB8-AC06-085E9C6D5B4E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 1D99F2BA-A77D-4668-A38A-3C63877DBAED 1520151423 xgc15 1520151423 xgc15 E9F9D6C6-6AE4-4EA7-AE12-0348993C29E2 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_GROUP PDM Key %ITEM% of table %PARENT% Key %ITEM% of table %PARENT% Key %ITEM% of table %PARENT% 98651B47-0B16-405D-B89D-EAB1AC65F56A 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_CARD PDM Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Card of the key %ITEM% of the table %PARENT% Name Code Table 40F20F2B-E5AA-4DD7-9463-F3DAAA06A1E3 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 2F80F946-97FF-4AB9-887B-6B7890335C11 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 EA78C389-97DC-41F0-AD80-6F75B3880D84 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 F2336783-02D8-472E-A1D7-67D28CECA49B 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_DESC PDM Description of key %ITEM% of table %PARENT% Description of key %ITEM% of table %PARENT% Description of key %ITEM% of table %PARENT% 5985B515-D0B3-4DB1-9F9D-8D427D6EBF61 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 199867FA-F055-4AA8-A066-7930B2A3308C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 1A8FAD61-D444-40B5-BFAE-7DC54E106E19 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_NOTE PDM Annotation of key %ITEM% of table %PARENT% Annotation of key %ITEM% of table %PARENT% Annotation of key %ITEM% of table %PARENT% DF2F5D1C-08C4-4A3F-8FAE-4C8EEA310D0C 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 9FDE70AC-2CCC-4058-8236-EE4D3E705A33 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 D3763D26-2470-465F-96C8-B847294AE94E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% E9994E2B-14FA-4303-8E49-6B4B93B4C20F 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 EFDA3261-7ACD-4F12-B76A-23FE14D8157A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 84DCF1E7-B904-4358-9981-597522DBDCC9 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_COLN_LIST PDM Column list of the key %PARENT% Column list of the key %PARENT% Column list of the key %PARENT% 1 -40 Name -40 Code 69181C1A-A345-45C3-B07D-0236D553AC8B 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 0B800E10-5DBE-4BB5-BEEC-B5C0EF2599FB 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2AE8893F-805D-4D1B-B6F2-823CBB677037 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 7B05C1BF-097E-407A-AC3E-56D5E5CB8D3B 1520151423 xgc15 1520151423 xgc15 FE731AE4-72BC-4A20-A08F-DF623758A0D8 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_DEPND_LIST PDM Dependent Object list of key %PARENT% Dependent Object list of key %PARENT% Dependent Object list of key %PARENT% 1 -40 Name -40 Code -20 ClassName 37ED9651-450C-4375-A4AC-FF8E24FEE9D7 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 281E9D42-1CBB-4B90-A0E8-AA5E3BDE741E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 078FF11E-B0EF-4832-9D76-22D1A953A2FB 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 A0A6F8A3-B5CC-421E-ABF6-6DDE83FB39A6 1520151423 xgc15 1520151423 xgc15 5B44AC81-A4BF-45DF-A3A4-8D13FF65231B 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_KEY_EXA_LIST PDM Extended Attribute List of key %PARENT% Extended Attribute List of key %PARENT% Extended Attribute List of key %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 83B6E42B-EE95-478B-ADEA-F7A8C2D434D9 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 F4051263-8E2F-499A-BDAA-566CF42934D1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 4CE992BD-164E-4B40-BA38-CC34DD73A164 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 56ECCE5E-311F-4989-90CC-11AE51CCA413 1520151423 xgc15 1520151423 xgc15 CDD6728D-DCCE-4F76-90D2-DAC14AE26FA5 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 9457616F-57E6-472E-9803-49E559C5BA75 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_LIST PDM Index list of the table %PARENT% Index list of the table %PARENT% Index list of the table %PARENT% 1 -20 Name -20 Code -12 Unique -12 Clustered -12 Primary -12 ForeignKey -12 AlternateKey 335748AB-BE43-4164-8428-A78C368B4E42 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 9C05D291-ED7B-4136-B4CE-EF317B6CBE08 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 40763A17-99E4-480B-9230-05F948E72C51 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 3C11F301-5523-497D-8F20-753B4A0B7A6A 1520151423 xgc15 1520151423 xgc15 35ADAC64-D05C-4C84-B8E2-A25E599CBC84 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_GROUP PDM Index %ITEM% of table %PARENT% Index %ITEM% of table %PARENT% Index %ITEM% of table %PARENT% 6E88ECB3-4CBC-4C10-A7AE-850B09C638CC 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_CARD PDM Card of the index %ITEM% of the table %PARENT% Card of the index %ITEM% of the table %PARENT% Card of the index %ITEM% of the table %PARENT% Name Code Unique Clustered Primary ForeignKey AlternateKey Table BA77E35E-CA3D-4DE2-8E78-398D42A77BDD 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 29546158-A916-43B3-BEAE-87C1985FDD64 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 CEA3AE22-351D-4063-B15B-B6C19F50B844 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 3E3767D7-6680-499C-B567-2E331E408C06 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_DESC PDM Description of index %ITEM% of table %PARENT% Description of index %ITEM% of table %PARENT% Description of index %ITEM% of table %PARENT% B96D6BF0-0B55-4701-A29F-6A2E63F605CC 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 2A665D1B-A7D3-4812-9265-28D11E686C2F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 F5E1E644-7E1E-4B26-8F95-A7E2C19DF1C5 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_NOTE PDM Annotation of index %ITEM% of table %PARENT% Annotation of index %ITEM% of table %PARENT% Annotation of index %ITEM% of table %PARENT% CE08C2A5-F523-4632-91D5-4E799B205D51 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 E5D81433-DBEF-4F1C-B8F8-08D8D9E9C927 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 77DB51E1-F357-4EEB-8218-37AB6F4BCAC1 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% A62C8D37-350C-440C-92AB-2AACC7851DCA 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 852FF7A7-8AD3-4566-A316-E7391648F6AB 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 A9CD7DC5-61F8-4497-9DF9-F84B8149BB9C 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_COLN_LIST PDM Column list of the index %PARENT% Column list of the index %PARENT% Column list of the index %PARENT% 1 -38 Name -38 Code -24 Ascending 75534E1D-9F06-48AA-9222-05938ED418CA 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 38CF7254-1EE6-4C54-BF63-89EC23EA49E1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 69A26DA8-A697-4B0D-989C-9F7B32D66C48 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 1A30006A-79A2-4A8F-AE2D-9E1004B88236 1520151423 xgc15 1520151423 xgc15 FA6511AB-278D-4FE8-AECB-0072F8FBDD00 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_DEPND_LIST PDM Dependent Object list of index %PARENT% Dependent Object list of index %PARENT% Dependent Object list of index %PARENT% 1 -40 Name -40 Code -20 ClassName E46A3715-6E0F-4A2C-84C0-DAB8410C8A72 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 4470F3A7-C9A7-4827-BAD9-8E5CAEF9E37B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 E3ECAEEC-D8F0-4179-A6C6-D1675950B22D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 AB7C47B4-6565-4412-9772-DAC03D4EF5A1 1520151423 xgc15 1520151423 xgc15 557F8DC1-2F01-4B7D-9814-A0CD4527056B 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_INDX_EXA_LIST PDM Extended Attribute List of index %PARENT% Extended Attribute List of index %PARENT% Extended Attribute List of index %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName E77AA4C3-BF8F-4479-9D3C-979D1D0C9792 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B87B643E-9010-4C7D-90CB-898F8EFDC8A5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 E15B78FE-2025-4BA4-8ABA-1F1BE4827962 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 8701773D-0AE0-433A-9BC6-F83394F1815D 1520151423 xgc15 1520151423 xgc15 5B0A3B1E-C31E-4701-BE0F-F1B644DFD6A7 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 5B9D46E7-D13B-4806-A5E2-1221AE65208F 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_LIST PDM Trigger list of the table %PARENT% Trigger list of the table %PARENT% Trigger list of the table %PARENT% 1 -50 Name -50 Code D65AF9A9-B661-4127-8609-47DF042F31E2 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6E70F999-D260-4A3C-BB8D-17DD9B7DAA59 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 BE0CB964-A341-43EA-AE41-53BADB7690D8 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 40E8F56E-DFE0-4A82-A962-8D6AD373E77E 1520151423 xgc15 1520151423 xgc15 9F469C6B-A681-4702-A215-9B70CD08ABF6 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_GROUP PDM Trigger %ITEM% of table %PARENT% Trigger %ITEM% of table %PARENT% Trigger %ITEM% of table %PARENT% D8FA9925-8E66-421A-876D-FD17FE287C97 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_CARD PDM Card of the trigger %ITEM% of the table %PARENT% Card of the trigger %ITEM% of the table %PARENT% Card of the trigger %ITEM% of the table %PARENT% Name Code Generated Table TriggerTemplate UserDefinedSQL 99F68958-E62D-4AA6-84A5-8A0EDFF418DA 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B754C141-A9A5-4998-8F99-86854546DE66 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 98E6ABA7-301E-4DEF-8FAE-E582DE65CBAB 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 41621A8A-3BEB-4DF2-AA81-7BC73A81AC0B 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_DESC PDM Description of trigger %ITEM% of table %PARENT% Description of trigger %ITEM% of table %PARENT% Description of trigger %ITEM% of table %PARENT% 690A6F53-1B1B-47C5-BA6F-F8DAA3E4A64C 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6A2D2B1A-4367-48F6-B61A-A41BD0A313B3 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 2D16167D-E421-4757-BC16-4FF580A215F0 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_NOTE PDM Annotation of trigger %ITEM% of table %PARENT% Annotation of trigger %ITEM% of table %PARENT% Annotation of trigger %ITEM% of table %PARENT% FCF0F5BB-972B-4557-AEA1-0E3B8EE43CC2 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 302D187C-F3B6-4A40-978F-C878674F323E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 A0B8853C-942C-416A-A684-DEF87ABCC9FC 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 470579C0-2019-4CDB-93B6-CD6E36E2CE00 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 94F627C5-6904-4DD9-BB89-2F26E0C306AA 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 AF99A0DA-EEA5-4E28-A99A-DC6D81C88F78 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_TRGR_EXA_LIST PDM Extended Attribute List of trigger %PARENT% Extended Attribute List of trigger %PARENT% Extended Attribute List of trigger %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 4F6E6107-3887-4DA3-8069-0D628396858F 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 926343E4-40BC-432B-A4F8-4F33EC00CFF3 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 50365574-23D8-48D3-B8BE-BA8C46B42482 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 1902E161-90E2-44FE-8157-0497E6B6D5DE 1520151423 xgc15 1520151423 xgc15 7FB4B048-636F-4EF1-88C1-294246D4E5DD 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 352201A2-AC4A-4F63-A712-A5B3E19F5177 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_LIST PDM Mapping list of the table %PARENT% Mapping list of the table %PARENT% Mapping list of the table %PARENT% 1 -50 Name -50 Code 47187163-F987-4A23-8E08-CF616C6A7282 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 2C309B2A-0349-4287-B4F1-4543B8F6F9DF 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3B2AE455-0576-4512-9D99-2E5269945B11 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 36337E9E-9130-46DB-AC98-B1D2C4A39486 1520151423 xgc15 1520151423 xgc15 833CDA55-4F65-499C-85A4-4A5142799637 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_GROUP PDM Mapping %ITEM% of table %PARENT% Mapping %ITEM% of table %PARENT% Mapping %ITEM% of table %PARENT% BB450E0D-F5C6-4D78-AFD5-E1D6249078D6 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_CARD PDM Card of the mapping %ITEM% of the table %PARENT% Card of the mapping %ITEM% of the table %PARENT% Card of the mapping %ITEM% of the table %PARENT% Name Code 9F6B0716-5657-4349-A9AE-518C6F45BB63 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 11502013-F466-4EEA-8246-08D11BACA74D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 447FBE91-DDAD-4491-B626-2E61BAC0A66C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 DF91C842-636E-46F4-B829-D20D181E7EB3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_CRTR PDM Criteria of mapping %ITEM% of table %PARENT% Criteria of mapping %ITEM% of table %PARENT% Criteria of mapping %ITEM% of table %PARENT% 82996C6E-FAE7-4536-9B0C-64FD886775CE 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3EB593E0-9AF9-4DBA-9C44-F0B7815ED1AC 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 9E32BC82-CD37-4C45-8DB5-9FBAE3D45868 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_EXPR PDM Source expression of mapping %ITEM% of table %PARENT% Source expression of mapping %ITEM% of table %PARENT% Source expression of mapping %ITEM% of table %PARENT% 66E39B3C-03C8-4371-B516-4ED80BB1A9C9 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6F0E57F8-4A64-4AC2-90DF-873BE14026C5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 08E100F7-5C91-412F-98EC-86304C329065 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_SFEA_LIST PDM Column mapping list of %PARENT% Column mapping list of %PARENT% Column mapping list of %PARENT% 1 -50 Column -50 MappedTo D7FBC840-629D-4703-A275-0DAAFE403ADB 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3E013323-4304-4138-BBAB-1BE00AAC583B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 8413282E-26AC-47B6-8C91-0590C6C59B90 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 E7C3251D-F469-42E2-9571-6BEEF06BE73E 1520151423 xgc15 1520151423 xgc15 56C46C93-E03F-430E-89FB-5E9450AD4A42 1520151423 xgc15 1520151423 xgc15 1 1 PDM_TABL_CMAP_SCRC_LIST PDM Table sources list of mapping %PARENT% Table sources list of mapping %PARENT% Table sources list of mapping %PARENT% 1 -50 Name -50 Code 0C8F6C54-FF10-446C-A9C9-28CBF044A494 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 CFCAE991-8E04-4D9F-9692-37711AD688E1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 3C80A145-88B5-4F7E-93B3-E72A854A581D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 CB33882D-7031-4F15-9F8D-267B73BEA82C 1520151423 xgc15 1520151423 xgc15 9F2AB59F-0060-4DA4-854E-54D1ABE254A1 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 9DE43765-A738-4F33-9286-175BCB2981A8 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 16F5778A-55E0-4BF6-88F6-BC69C43CAD11 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 391FD16D-58AA-436F-816C-79B4EC09BE6F 1520151423 xgc15 1520151423 xgc15 1 PAGEBREAK PDM ECFF5165-4BED-46E9-A485-85A80B7BC129 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 BB51EA5C-6882-4553-A2D5-194C90E8BF66 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM References EFEB9B0B-A243-4406-88FA-6DA9604A8D45 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Model level references 7A8D1BED-2A21-4D23-BEDA-FA70DDE25BC8 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_TITLE PDM Reference %ITEM% Reference %ITEM% Reference %ITEM% 38C8CE6F-30DF-4400-BF74-DEC455E626AE 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_CARD PDM Card of the reference %ITEM% Card of the reference %ITEM% Card of the reference %ITEM% Name Code ParentTable ChildTable 02AE6789-BCFD-4D2C-A1C7-1D36A1BC4BF4 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6F911372-D3E1-492D-9554-66F524B96C98 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 18D485DA-2BA6-44A7-8D26-B56CA27C7113 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 A58979B4-E7C6-49A8-80EE-10B0D3C01263 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_DESC PDM Description of reference %ITEM% Description of reference %ITEM% Description of reference %ITEM% 559D1F16-2F4D-4E39-BC20-4908BF0561E5 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 642D6723-576C-4369-9291-6454C5CB97C5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 64CF6423-1DC9-48BA-BB18-754F6A869596 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_NOTE PDM Annotation of reference %ITEM% Annotation of reference %ITEM% Annotation of reference %ITEM% E322962D-0197-4D41-9D19-0C750E37129E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 1B82F9AC-F1F2-48AB-872A-E9F5597B622E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 7FDE8DF1-C846-4E53-9B6E-3F21510569FA 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 4D6D5D7B-D10F-421E-9483-292D07F9770C 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 42416A2D-F4EA-43AA-BB15-9D883D18170D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 B7F4FB4F-5D6F-4DEE-8E76-3E3B5C471D2B 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_DIAG_LIST PDM List of diagrams containing reference %PARENT% List of diagrams containing reference %PARENT% List of diagrams containing reference %PARENT% 1 -50 Name -50 Code 8A0314F3-00F2-4C81-BFB4-2383FA3D4F28 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6400A73F-6E21-45BB-8741-4409C7624B83 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 7D37E72F-8750-4011-A787-7BF8AD4EED37 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 F283EB3A-C824-4C89-B6A1-A6A20C059EF9 1520151423 xgc15 1520151423 xgc15 E4E19779-C871-495F-9E66-EA11E444FBE5 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_JOIN_LIST PDM Reference join list for reference %PARENT% Reference join list for reference %PARENT% Reference join list for reference %PARENT% 1 -50 ParentTableColumn -50 ChildTableColumn CDFCDEC7-3FC5-45C5-91E1-099F6CD06A64 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 0B4EC31E-CE67-450B-8A2C-AD6ABA0141E9 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 528E4696-716B-4E44-8C96-5E9144EBBB3D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 B490320F-5E04-4106-A510-07DDD5D71443 1520151423 xgc15 1520151423 xgc15 253C4999-6744-42A9-A395-85722F1BC63A 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_RULE_LIST PDM Business rule list for reference %PARENT% Business rule list for reference %PARENT% Business rule list for reference %PARENT% 1 40 Name -40 Code -20 Type A48ECEF1-378F-4478-B966-7FE78356D5F8 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 F898E49C-A5FA-4709-9B7D-6C85BD7FEF0E 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 89ABE3CF-87E0-4775-8042-8EDCF036F853 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 CB52B5FE-BA75-4773-A304-BBAE340F47E1 1520151423 xgc15 1520151423 xgc15 AC953C33-7903-4814-9314-7BEC03CA8CF7 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_DEPND_LIST PDM Dependent Object list of reference %PARENT% Dependent Object list of reference %PARENT% Dependent Object list of reference %PARENT% 1 -40 Name -40 Code -20 ClassName 4937842E-6BC4-4CEB-A636-697967D0449D 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B791F1D1-053D-4C52-B068-A45ECEAFEE53 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 8C81E03B-848D-470D-9942-3CD3628CF7DB 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 CDE7394D-EE7F-4396-83FF-0A6356372003 1520151423 xgc15 1520151423 xgc15 C170B112-3C32-466A-A6C8-6E8989770A08 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_EXA_LIST PDM Extended Attribute List of reference %PARENT% Extended Attribute List of reference %PARENT% Extended Attribute List of reference %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName D388EB44-D041-40EC-99EF-FC1410942F8D 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 06B73293-8D54-4259-A092-CB48D1066620 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 DF7C42EE-3051-4043-BBAD-0B12A1B62E10 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 BBDFAB28-E963-4238-86AE-C28BA94D8417 1520151423 xgc15 1520151423 xgc15 696A6AF0-9BCF-4029-A369-E45C36A78B69 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 A7714C97-5FF9-4C4D-BBFB-F4B0E77B0652 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 F292A491-310D-4C97-9044-85A8543BD308 1520151423 xgc15 1520151423 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% References from Package %ITEM% 1 0DF10579-ECCD-486E-9E9E-E0963FBAD3CF 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_TITLE PDM Reference %ITEM% Reference %ITEM% Reference %ITEM% 5CEDD7FC-9B9B-4DC6-9FFB-AEDAB081FF7E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_CARD PDM Card of the reference %ITEM% Card of the reference %ITEM% Card of the reference %ITEM% Name Code ParentTable ChildTable EF6DDE3D-8E1B-4C21-A6C2-C7F454FD0898 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 DD314162-2D03-49A2-BD3C-8FED19888A7B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 F2444C3E-CEEF-469E-82F1-1C45FEA27A0A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 2BC2F91E-EBCE-4212-BD17-543A10358CB1 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_DESC PDM Description of reference %ITEM% Description of reference %ITEM% Description of reference %ITEM% F782FD22-38B9-4696-9F06-EE18B98271D2 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 7111173F-C825-4F05-B880-EB64ABB7A0B6 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 4BBF4136-BE8C-43C4-992F-09111F68D477 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_NOTE PDM Annotation of reference %ITEM% Annotation of reference %ITEM% Annotation of reference %ITEM% 1B07231A-399D-49C9-9CDF-23D4A36FEB00 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 3E32EFD2-AC62-4328-9349-635EBB531617 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 AA756795-E800-4976-B1B7-7540ABBEAADA 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% D28B4CDF-19AB-4987-84E0-7A2949BD57B4 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 5670E36B-38AC-4A3E-9F1E-23CA3E939B8D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 4D4F8436-3CCE-4ADF-96F4-8B9E8417C641 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_DIAG_LIST PDM List of diagrams containing reference %PARENT% List of diagrams containing reference %PARENT% List of diagrams containing reference %PARENT% 1 -50 Name -50 Code A91004B4-1532-4F9E-AF08-E134D1306D97 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 68087EA3-7D9A-4EEC-9674-5FFBA5ECC5A6 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 4F0E6B78-52E0-4F3B-B312-718631193ED8 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 D94740EC-A00E-45AC-BCC8-86F7208F1859 1520151423 xgc15 1520151423 xgc15 EF8F2CDE-FBE8-4D2D-8739-A92CD6A1BFB3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_JOIN_LIST PDM Reference join list for reference %PARENT% Reference join list for reference %PARENT% Reference join list for reference %PARENT% 1 -50 ParentTableColumn -50 ChildTableColumn 941C5D06-8C3B-478D-A7D5-B84E0B1569CF 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 04C98474-F413-4CC0-A283-40B0F3D7E900 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 6FC59BA4-8FC0-488C-967F-D02B3C81737A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 7101C406-299E-4A30-8315-7294549BF8D6 1520151423 xgc15 1520151423 xgc15 06F6A7FB-DD6F-461F-B9B5-D259A89C44E6 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_RULE_LIST PDM Business rule list for reference %PARENT% Business rule list for reference %PARENT% Business rule list for reference %PARENT% 1 40 Name -40 Code -20 Type 8130F6AF-DE4D-4B9C-BD6D-E0BAFB249729 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 0C75AE50-0245-4D8E-993C-860E73177265 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 2ECA95BA-4F3F-4EA6-9F86-75C5FF5518CC 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 1D046632-BCD7-4DAB-B8A3-BF8BC880D193 1520151423 xgc15 1520151423 xgc15 F9B30C00-5188-498B-B502-D6BE0A6CCB90 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_DEPND_LIST PDM Dependent Object list of reference %PARENT% Dependent Object list of reference %PARENT% Dependent Object list of reference %PARENT% 1 -40 Name -40 Code -20 ClassName F6D6362E-66C1-4958-A4AB-31E78D71FA98 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 4E6C257E-182E-412C-ABF1-810BCB48C06B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 635DE5F4-D8BF-479F-9EFD-41D128A2E5CD 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 E4AD223A-D2D8-488D-89DE-C8F57C7D9ACC 1520151423 xgc15 1520151423 xgc15 078B01C8-D776-4FA0-9BD8-97915C689826 1520151423 xgc15 1520151423 xgc15 1 1 PDM_REFR_EXA_LIST PDM Extended Attribute List of reference %PARENT% Extended Attribute List of reference %PARENT% Extended Attribute List of reference %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName C0E51D7C-6D02-4F28-8AA6-BA4EF67ED896 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 C96E0C1B-9C4A-48DE-9DAB-6B841207AC3D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 41030F50-AF06-4ED2-B0D0-D07C94D29D86 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 EC901AD3-4B1B-4E5A-BE8F-BD304071C86C 1520151423 xgc15 1520151423 xgc15 9A70A753-E7C8-4141-B4B7-D560361243EC 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 F158C353-4B9D-4FE1-8047-EE205A5A8BA9 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 32ABC4F8-53C0-47E6-B828-27EB606E557A 1520151423 xgc15 1520151423 xgc15 1 PAGEBREAK PDM 14A830F0-00FC-4E62-A49D-011B78A2FF53 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 20C54256-9D05-475C-ABC9-A2099FE2FDAB 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Views 8287385C-20D0-4A30-B2CF-671717B18AE7 1520151423 xgc15 1520151423 xgc15 1 1 TITLE PDM Model level views F50E8AB7-38F3-423E-86DF-24438A15FD7D 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_TITLE PDM View %ITEM% View %ITEM% View %ITEM% 0888E947-3FAD-4D67-819B-99E5DB2EFC1A 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_CARD PDM Card of the view %ITEM% Card of the view %ITEM% Card of the view %ITEM% Name Code 14C577D7-B440-4502-9788-699B25BF307D 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 227BAB61-AA79-4CFB-932D-D4743A5BA9C5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 BE051383-4A05-49D4-8D83-2EC768D325BE 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 BC3D5323-BD33-4FD7-95A6-93CCBF8010E7 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_DESC PDM Description of view %ITEM% Description of view %ITEM% Description of view %ITEM% 6FDF0AC2-B324-4EF9-98E0-F7C3A12D7AA9 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 374E7BBA-3B9D-440B-9934-4883B33C586D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 2996CAF0-FBAB-46CF-8254-0DC00BDEF289 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_NOTE PDM Annotation of view %ITEM% Annotation of view %ITEM% Annotation of view %ITEM% 0BAA26CF-21FD-444A-877A-7C376F49B9A0 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 CABDF744-6C8E-438E-94D1-191A1FF0631C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 F3DF74C3-110B-47CE-8DB8-FE8FB969C80B 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_SQL PDM SQL Query of view %ITEM% SQL Query of view %ITEM% SQL Query of view %ITEM% 0CD16B67-B851-4A8F-B2E3-72EFBD03B3D5 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 5A51A841-BF34-43D0-AD0F-8563953A9FA5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 A3BFEBFF-8C25-4840-B55A-865B185EB7C3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% 993FD342-741E-49CC-BE35-D047F0150D44 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 17B46450-5BAE-4581-AF47-E8E28F16F7C1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 59A9D22B-F8FF-47E8-8BE6-06F71A0EAC98 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_DIAG_LIST PDM List of diagrams containing view %PARENT% List of diagrams containing view %PARENT% List of diagrams containing view %PARENT% 1 -50 Name -50 Code EF7B38A0-C0F5-4C93-999F-0ABEE9E05374 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 20BB4DDC-8171-4F90-8F97-C3AA33848DF1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B4FC24F5-7B59-4440-B8B0-73F54585D5F5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 DC32BA57-F325-44E4-BDA1-F0BD34A139F9 1520151423 xgc15 1520151423 xgc15 BD1D2678-6969-4045-95A9-7C27D56AC28D 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_RULE_LIST PDM Business rule list for view %PARENT% Business rule list for view %PARENT% Business rule list for view %PARENT% 1 -40 Name -40 Code -20 Type 1C2F0EC5-6A46-47C7-B8B2-02F1B4C29C97 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 E3653676-737A-46B8-BCC4-7C32EC76BF9B 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 1064ACCF-70E5-44ED-A0EB-DBC790637A95 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 6B941A84-5CE5-4523-966D-FCBC8662AA17 1520151423 xgc15 1520151423 xgc15 D35CEFF3-0215-49CD-BC1D-F451BAE70FE3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_DEPND_LIST PDM Dependent Object list of view %PARENT% Dependent Object list of view %PARENT% Dependent Object list of view %PARENT% 1 -40 Name -40 Code -20 ClassName 8CEDE8F0-58AE-4AA3-976B-1DC0152F0417 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 AE54ECD1-735A-4A45-8222-377B8B5CAF21 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 725DB5C9-E8E3-4B8E-B9C0-577AFAA765C2 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 F3C778BA-5C21-4D21-8B78-3FDC4151A923 1520151423 xgc15 1520151423 xgc15 B29ED3F2-F9E6-4734-8108-4F474098C3C8 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_EXA_LIST PDM Extended Attribute List of view %PARENT% Extended Attribute List of view %PARENT% Extended Attribute List of view %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 67EA5543-BF41-4BAA-ACCF-31C7E92B91E4 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 CC1F7A77-0011-41B8-A81F-02E15365234F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 F80F6514-E922-4B09-A14B-D080CC8E159C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 631AE6CD-904D-491B-8422-7224546110EB 1520151423 xgc15 1520151423 xgc15 EF18F2B5-7CC9-4F48-AC36-9A5EBE5C3A5B 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_USRDEPD_LIST PDM Extended Dependency list of view %PARENT% Extended Dependency list of view %PARENT% Extended Dependency list of view %PARENT% 1 -33 Stereotype -33 InfluentObject -33 InfluentObjectType 95A5A89D-A246-47B2-BAD8-03FDB87C8C7B 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 A490C02F-1BFA-477B-BD7C-96C96F56E4A3 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B0500314-E437-47CD-8FD4-236B0D3A41FE 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 576A534C-32A7-4BC4-872B-77698D48B9BD 1520151423 xgc15 1520151423 xgc15 A4EE0679-9BDC-438F-AA9E-C64553399B79 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 B596D5CE-F2B0-4BAB-8DD7-2F279D4A1D21 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 37E708D1-2B70-41DE-A1C6-A3A9BC2BBB26 1520151423 xgc15 1520151423 xgc15 1 1 PDM_PCKG_TITLE PDM Package %ITEM% Package %ITEM% Views from Package %ITEM% 1 838C9721-620C-4E8B-B782-934898C0054B 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_TITLE PDM View %ITEM% View %ITEM% View %ITEM% 3B12AFFB-DC02-4DE9-8904-8E4933824965 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_CARD PDM Card of the view %ITEM% Card of the view %ITEM% Card of the view %ITEM% Name Code 9D4B6999-549D-4571-B6B8-9D4B825CB785 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 6148D738-8A20-4FE5-B8C0-1FB9D0E7DB36 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 3 3 15 18 2 1 18 0A6C6D07-7E39-4FBA-895C-A44CFF6C922A 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 2 1 18 D5B7178A-5F81-491F-B317-5431A85DCBA1 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_DESC PDM Description of view %ITEM% Description of view %ITEM% Description of view %ITEM% 0B88AEAE-86D3-4490-A0D5-74FE9B283F5B 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 BA995CCD-9DC0-4B61-8761-4EFD518F1A0C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 7012DC35-C065-4336-AA2E-1B7CF52CCDE3 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_NOTE PDM Annotation of view %ITEM% Annotation of view %ITEM% Annotation of view %ITEM% 517DE74F-3502-42C1-A91B-2CE5F7E59DE8 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 D38D8C51-EB08-4262-9913-D3C0DF010D3D 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 FF72459E-9A0A-4969-848B-F356A2D14CFE 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_SQL PDM SQL Query of view %ITEM% SQL Query of view %ITEM% SQL Query of view %ITEM% 407F9A23-5B9A-4D9F-B9E4-C0548610592E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 52CE68A4-A6E2-4A23-85B4-9731CFCBCCCE 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 F9EBBC06-489B-4673-959F-3EEC1B72934C 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_PREV PDM Code preview of %ITEM% Code preview of %ITEM% Code preview of %ITEM% EA79BF02-8088-438D-93D5-32A169E3550E 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 D642922B-1FD0-4A8A-9483-5BAFF75517B5 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 0 21456755-CDD3-4BC3-B37D-6F17FA838464 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_DIAG_LIST PDM List of diagrams containing view %PARENT% List of diagrams containing view %PARENT% List of diagrams containing view %PARENT% 1 -50 Name -50 Code 74B77549-A9A7-4D1C-9A55-FF839B7933E1 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 9713CA06-C33A-43B4-9DFC-E2BE04F2AA21 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 86011E98-C1A0-48CC-A72B-13AEA8827E6F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 3CFC5589-B871-443E-968C-89CD7EFD95BF 1520151423 xgc15 1520151423 xgc15 B16D9D99-8332-4F19-89B5-982D69962274 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_RULE_LIST PDM Business rule list for view %PARENT% Business rule list for view %PARENT% Business rule list for view %PARENT% 1 -40 Name -40 Code -20 Type 2329B0B3-B111-4B36-9594-A7CAC71BA6A0 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 AECCFDF7-02C4-40AC-BAC4-CFF2040104F1 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 8F1F179B-D634-46FA-BC42-7CF36E36AA26 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 081A10EF-5236-47DD-8494-FD3B8E0319C1 1520151423 xgc15 1520151423 xgc15 8C201567-5CFA-4E38-9763-BEEED475B55E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_DEPND_LIST PDM Dependent Object list of view %PARENT% Dependent Object list of view %PARENT% Dependent Object list of view %PARENT% 1 -40 Name -40 Code -20 ClassName F32638B8-B40D-4E68-BF00-44CF89175238 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 7624DA40-2F69-41FC-A5C7-691D2E9B1FEE 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 90229573-3654-4749-A64F-57F9CCB2A29C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 7BB7D911-D7CA-4567-8620-6BFDAEC28C05 1520151423 xgc15 1520151423 xgc15 86C3F06E-F3BC-4977-BAA4-D1F9A3080810 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_EXA_LIST PDM Extended Attribute List of view %PARENT% Extended Attribute List of view %PARENT% Extended Attribute List of view %PARENT% 1 -30 Name -20 DataType -20 Value -30 TargetName 50E90A2D-7629-460D-A020-68DBF5AC79B0 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 F72333AA-E71B-4DF7-8CCC-86F852779B33 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 B7D664D0-4897-4368-B27B-ED8007578422 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 F540B7CD-C527-4B2C-9714-A3FEEBDA6E4C 1520151423 xgc15 1520151423 xgc15 77AABB76-2D6A-4466-88DC-DE9632DC495E 1520151423 xgc15 1520151423 xgc15 1 1 PDM_VIEW_USRDEPD_LIST PDM Extended Dependency list of view %PARENT% Extended Dependency list of view %PARENT% Extended Dependency list of view %PARENT% 1 -33 Stereotype -33 InfluentObject -33 InfluentObjectType 7B01922A-DF83-4195-AD39-44F2AE0DA460 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 74A22FC0-F9E1-4466-B947-45504B76393F 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 2 1 4 15 18 1 18 431DB327-B3ED-485D-B68B-6C5E87B85F82 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 15 18 1 18 F01F3359-2694-4A9F-B1BB-F750093DB990 1520151423 xgc15 1520151423 xgc15 B76F5E34-F71C-4DE6-AA04-CC1DAD07D841 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 8A167BD7-1F31-4C62-A8D5-C0715B20E15B 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 353 106 0 AF346CFC-2EC4-4447-A394-4893B47F7C23 1520151423 xgc15 1520151423 xgc15 Arial 10 5 1 423 106 0 B675E95A-8E70-4D0E-99FE-23FCEEC87C20 1520151439 xgc15 1520151439 xgc15 1 1 PDM_TABL_TITLE PDM Table %ITEM% Table %ITEM% Table %ITEM% Tables 6D3BACEE-8A90-49D3-B3B8-BF67F72A73C9 1520151439 xgc15 1520151663 xgc15 1 1 PDM_TABL_COLN_LIST PDM List of columns of the table %PARENT% List of columns of the table %PARENT% List of columns of the table %PARENT% Columns 1 -20 Code -20 DataType -10 Length -30 Comment -10 Mandatory -10 Primary 307FCD0F-0645-40F5-88EF-2220C80CB84C Column selection 1520151503 xgc15 1520151503 xgc15 10 Code 1 0 Comment 1 0 DataType 1 0 Length 1 0 Mandatory 1 0 Primary 1 0 ; Criterion; IncludeShortcuts; 5776CBA8-A7AD-465C-A835-BDA92C88F6BA 1520151439 xgc15 1520151439 xgc15 新宋体 10 5 353 106 0 286A3D23-97B1-4861-9255-157B9B97CD61 1520151439 xgc15 1520151439 xgc15 Microsoft Sans Serif 10 2 4 1 1 1C6C22E7-553C-43A3-9121-3B37851C09F9 1520151439 xgc15 1520151439 xgc15 Microsoft Sans Serif 10 1 1 98CEDA8A-0CA6-4955-A6A9-BBC193B1E7BD 1520151439 xgc15 1520151439 xgc15 2C23165C-0988-47FD-8C05-AC36021C9A76 1520151439 xgc15 1520151439 xgc15 新宋体 10 5 353 106 0 5BA1038B-7389-47DA-9D3A-F879397A060C 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 8 65A67577-904B-40DC-B91A-4E9D193E94E5 1520151423 xgc15 1520151423 xgc15 18637 3 40F1F1A5-0625-4783-9AF1-07AA2D943BA7 1520151423 xgc15 1520151423 xgc15 Times New Roman 10 1 2 8B898493-CA5F-42E2-B65A-D376184DFEF2 1520151423 xgc15 1520151423 xgc15 9549 2 ECB47E73-8A4F-45E7-A8F5-5C969CC4032C 1520151423 xgc15 1520151423 xgc15 19098 3 52D60E79-97A7-4050-9629-831A78E0B748 Simplified Chinese ZH-CN 1520151423 xgc15 1520151423 xgc15 F3A0BF0F-7536-11D5-A4D6-0008C79B4501 585CBB37-C940-11D1-BD0D-00A02478ECC9 2FFE5D00-4ACE-44D6-AEC9-9CAB11BAD251 Base_Table Base_Table 1520151423 xgc15 1520151423 xgc15 file:///. 160EB092-2F96-4235-852F-052B990C5A86 CDE44E21-9669-11D1-9914-006097355D9B 1520152423 924E1F4D-7116-4ED8-92CF-E33EB5D643F6 dbo dbo 1536569054 xgc15 1536569233 xgc15 Schema 9C05B61E-6146-47EA-BD6D-6353BF49466A Base_User【系统用户表】 Base_User 1506739100 xgc15 1536569098 xgc15 系统用户表 C057AEEA-8C81-4255-BA91-A003617E9122 自然主键 Id 1506741663 xgc15 1536568654 xgc15 自然主键 varchar(50) 50 1 F24C6FD1-6416-48CC-B6B6-8F89ED36ABBD 用户主键 UserId 1506739587 xgc15 1536568654 xgc15 用户主键 varchar(50) 50 ECC84CE6-4665-41BA-83E1-20D37BEBDBB0 用户名 UserName 1536568663 xgc15 1536568691 xgc15 用户名 varchar(50) 50 B555008F-DC95-4D34-9FA7-9AA4132C43EB 密码 Password 1506739811 xgc15 1506740404 xgc15 密码 varchar(50) 50 2C25A539-D7AA-4A30-9D92-F9CB31A6A8E9 姓名 RelaName 1506739964 xgc15 1536568663 xgc15 姓名 nvarchar(50) 50 628BD730-6D8D-4A64-A9E2-996A9D3DD644 性别(1为男,0为女) Sex 1506739964 xgc15 1506740404 xgc15 性别(1为男,0为女) int 6986F57C-F948-4439-A1A4-270C110264DD 出生日期 Birthday 1506739964 xgc15 1506740404 xgc15 出生日期 date 278C2B8B-FB63-4940-AC54-1E5A1CBA40D6 Key_1 Key_1 1506739587 xgc15 1506741767 xgc15 E75C8AEB-9FB2-44A9-AD81-7733C2323DC3 Base_DatabaseLink【数据库连接表】 Base_DatabaseLink 1507182882 xgc15 1536569085 xgc15 数据库连接表 B626C714-5B93-49A9-93E7-5D8CD2FA33F3 自然主键 Id 1507182882 xgc15 1536569136 xgc15 自然主键 varchar(50) 50 1 BE021714-AB12-465C-B45C-AF4E56AD3E86 连接名 LinkName 1507182882 xgc15 1507183219 xgc15 连接名 varchar(50) 50 C301FB2B-B6B0-4A70-994A-8B17797FBE23 连接字符串 ConnectionStr 1507182882 xgc15 1507183219 xgc15 连接字符串 varchar(50) 50 1EF75F1F-4D0C-4A2B-B4EB-7AEB915E0C46 数据库类型 DbType 1507182882 xgc15 1507183219 xgc15 数据库类型 varchar(50) 50 D4FB0095-5F13-456F-945C-65EE687853B2 排序编号 SortNum 1507182882 xgc15 1507183219 xgc15 排序编号 varchar(50) 50 E6A723D8-2ADA-4883-BA08-8E2377F4D8E2 Key_1 Key_1 1507182882 xgc15 1507183219 xgc15 B32CB75F-B20E-4423-89F9-13AD723CC8F7 Base_AppSecret【应用秘钥表】 Base_AppSecret 1507623325 xgc15 1536568994 xgc15 应用密钥表 7053E7B7-D4BC-4836-9BF0-FAF9A11FAE22 主键Id Id 1507623325 xgc15 1536568962 xgc15 自然主键 varchar(50) 50 1 8E39DE69-6381-4B49-A589-BA91C2B0C2CA 应用Id AppId 1507623325 xgc15 1507623537 xgc15 应用Id varchar(50) 50 2D8F4608-9EF3-49DC-81C3-9A6913DBC543 应用密钥 AppSecret 1507623325 xgc15 1507623537 xgc15 应用密钥 varchar(50) 50 48527EF4-BC3F-4188-9383-F74CD0CEDC7D 应用名 AppName 1536568962 xgc15 1536568994 xgc15 应用名 varchar(50) 50 BDB40063-1B26-4EEE-B97C-708862E36677 Key_1 Key_1 1507623325 xgc15 1507623537 xgc15 0A35DB61-FCEE-4C37-BB8C-320C633FD20A Base_SysRole【系统角色表】 Base_SysRole 1508978602 xgc15 1536569680 xgc15 系统角色表 73BC16E9-48A9-432B-8C24-C8B10F9C82CB 自然主键 Id 1508978602 xgc15 1536568851 xgc15 自然主键 varchar(50) 50 1 5D5C0AF9-8482-4207-803C-B51162F548C0 角色Id RoleId 1508978602 xgc15 1508978806 xgc15 角色Id varchar(50) 50 CD047A9F-4B4C-4FB7-AA06-C2EE86B50129 角色名 RoleName 1508978602 xgc15 1508978806 xgc15 角色名 nvarchar(50) 50 B793DDC0-17FA-472B-96A6-0968329BB110 Key_1 Key_1 1508978602 xgc15 1508978806 xgc15 BB10EAC2-BA31-421F-8728-3F3B86533203 Base_PermissionAppId【AppId权限表】 Base_PermissionAppId 1508978814 xgc15 1536569233 xgc15 AppId权限表 92FF9AB3-7B2C-4C15-98DB-AD1DBB1B068C 自然主键 Id 1508978814 xgc15 1536569277 xgc15 自然主键 varchar(50) 50 1 3E11C482-D287-41EB-859A-81C2C10AF543 应用Id AppId 1508978814 xgc15 1536569277 xgc15 应用Id varchar(50) 50 3F0AE3DF-D979-4015-B446-277B1B817C63 权限值 PermissionValue 1508978814 xgc15 1536569277 xgc15 权限值 varchar(50) 50 1D783F0D-9353-4B3B-BEDB-B146E1703590 Key_1 Key_1 1508978814 xgc15 1536569188 xgc15 143D7E8C-8AB8-4551-A643-3D77678AE86E Base_PermissionRole【角色权限表】 Base_PermissionRole 1508978814 xgc15 1536569330 xgc15 角色权限表 9B7199F4-49D9-4551-B977-815299541F41 自然主键 Id 1508978814 xgc15 1536569287 xgc15 自然主键 varchar(50) 50 1 47F77FFE-206F-47E4-A65B-D727859ECC2A 角色Id RoleId 1508978814 xgc15 1536569342 xgc15 角色Id varchar(50) 50 F0FC43CC-1D32-4D17-9114-3DE647154213 权限值 PermissionValue 1508978814 xgc15 1536569287 xgc15 权限值 varchar(50) 50 F08429A1-2A56-4937-9AE2-75041BF76353 Key_1 Key_1 1508978814 xgc15 1536569287 xgc15 F8320650-D90D-4C95-8235-48BF6CC50253 Base_PermissionUser【用户权限表】 Base_PermissionUser 1508978814 xgc15 1536569415 xgc15 用户权限表 844A93D2-6462-4170-89E0-E86DFCAB1727 自然主键 Id 1508978814 xgc15 1536569380 xgc15 自然主键 varchar(50) 50 1 EB440F6F-3A38-432A-9C28-EAC4426B2DFC 用户Id UserId 1508978814 xgc15 1536569426 xgc15 用户Id varchar(50) 50 17467BC4-31AD-4009-A5C5-1A57790F2267 权限值 PermissionValue 1508978814 xgc15 1536569380 xgc15 权限值 varchar(50) 50 14D60F89-3285-4D08-8E21-586F0A58B407 Key_1 Key_1 1508978814 xgc15 1536569380 xgc15 FEA503C2-B2E2-4A5E-9D3E-F6B5B9455404 Base_SysLog【系统日志表】 Base_SysLog 1508978814 xgc15 1536569633 xgc15 系统日志表 326474CD-27DB-4E6C-AEAE-8856689D6B5F 自然主键 Id 1508978814 xgc15 1536569446 xgc15 自然主键 varchar(50) 50 1 29B7B342-CFC8-43F7-9DBD-3D81B23306D3 日志类型 LogType 1536569453 xgc15 1536569529 xgc15 日志类型 varchar(50) 50 5701352D-29DB-4357-A269-7F0D78CDF052 日志内容 LogContent 1536569529 xgc15 1536569560 xgc15 日志内容 varchar(Max) A3E90726-C1D5-4AE6-A672-B584F8337398 操作员用户名 OpUserName 1536569560 xgc15 1536569633 xgc15 操作员用户名 varchar(50) 50 1EA8325D-41E4-4F1A-95F2-662D1ABFB2F3 日志记录时间 OpTime 1536569560 xgc15 1536569633 xgc15 日志记录时间 datetime 68C2C9DB-6858-4399-A8A2-0DAF557F8C7E Key_1 Key_1 1508978814 xgc15 1536569446 xgc15 2EBC4054-FB0A-4502-A5B2-E27F21BB412C Base_UserRoleMap【用户角色映射表】 Base_UserRoleMap 1508978602 xgc15 1536569777 xgc15 用户角色映射表 A07417D2-21BA-4C4A-B0BB-36879B2207B3 自然主键 Id 1508978602 xgc15 1536569712 xgc15 自然主键 varchar(50) 50 1 9D7D8746-4DAD-4214-9F66-2DBBD91C2122 用户Id UserId 1508978602 xgc15 1536569774 xgc15 用户Id varchar(50) 50 FDC849FA-F578-46E7-8E16-CA7D983EC854 角色Id RoleId 1508978602 xgc15 1536569712 xgc15 角色Id varchar(50) 50 8E962F7C-AE7C-4AA7-B1C3-3A76C5411F85 Key_1 Key_1 1508978602 xgc15 1536569712 xgc15 5977E6B6-3DFB-435B-8912-54B6868E8324 PUBLIC PUBLIC 1506739078 xgc15 1536569093 xgc15 E3356D8D-8D14-4545-B082-E0EAF380DFCF Microsoft SQL Server 2008 MSSQLSRV2008 1506739078 xgc15 1506739078 xgc15 file:///%_DBMS%/sqlsv2k8.xdb F5C20738-B05A-4F70-BC90-9B5EB9437766 4BA9F647-DAB1-11D1-9944-006097355D9B 1341502043 C29FDDE2-8E31-4002-9F46-9ED24D84074C Simplified Chinese ZH-CN 1520149495 xgc15 1520151423 xgc15 file:///%_RTPLANG%/Chinese.xrl F3A0BF0F-7536-11D5-A4D6-0008C79B4501 585CBB37-C940-11D1-BD0D-00A02478ECC9 1310116582 ================================================ FILE: docs/数据库设计/Base_Table.sws ================================================ ================================================ FILE: src/Coldairarrow.Business/00Cache/BaseCache/BaseCache.T.cs ================================================ using Coldairarrow.Util; using System; using System.Collections.Generic; namespace Coldairarrow.Business.Cache { public class BaseCache : IBaseCache where T : class { #region 构造函数 /// /// 构造函数 /// /// 缓存模块键值 /// 根据主键获取数据的具体方法 public BaseCache(string cacheModuleKey, Func getDataFunc) { _moduleKey = cacheModuleKey; _getDataFunc = getDataFunc; } #endregion #region 私有成员 private Func _getDataFunc { get; set; } public string _moduleKey { get; set; } #endregion #region 外部接口 public string BuildKey(string idKey) { return $"{GlobalSwitch.ProjectName}_Cache_{_moduleKey}_{idKey}"; } public T GetCache(string idKey) { if (idKey.IsNullOrEmpty()) return null; string cacheKey = BuildKey(idKey); var cache = CacheHelper.Cache.GetCache(cacheKey); if (cache == null) { cache = _getDataFunc(idKey); if (cache != null) CacheHelper.Cache.SetCache(cacheKey, cache); } return cache; } public void UpdateCache(string idKey) { CacheHelper.Cache.RemoveCache(BuildKey(idKey)); } public void UpdateCache(List idKeys) { idKeys.ForEach(x => UpdateCache(x)); } #endregion } } ================================================ FILE: src/Coldairarrow.Business/00Cache/BaseCache/IBaseCache.T.cs ================================================ namespace Coldairarrow.Business.Cache { public interface IBaseCache where T : class { T GetCache(string idKey); void UpdateCache(string idKey); } } ================================================ FILE: src/Coldairarrow.Business/00Cache/Base_UserModelCache.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Util; using System.Linq; namespace Coldairarrow.Business.Cache { public class Base_UserModelCache : BaseCache { public Base_UserModelCache() : base("Base_UserModel", userId => { if (userId.IsNullOrEmpty()) return null; return new Base_UserBusiness().GetDataList("UserId", userId, new Pagination()).FirstOrDefault(); }) { } } } ================================================ FILE: src/Coldairarrow.Business/04.Coldairarrow.Business.csproj ================================================  Debug AnyCPU {62858A89-DA3C-4658-8219-580780D435C9} Library Properties Coldairarrow.Business Coldairarrow.Business v4.5.2 512 true full false bin\Debug\ DEBUG;TRACE prompt 4 pdbonly false bin\Release\ TRACE prompt 4 ..\packages\AutoMapper.6.2.2\lib\net45\AutoMapper.dll ..\packages\Elasticsearch.Net.6.1.0\lib\net45\Elasticsearch.Net.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll ..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.1.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll ..\packages\Microsoft.Extensions.Logging.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.dll ..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll ..\packages\NEST.6.1.0\lib\net45\Nest.dll ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\System.Collections.Immutable.1.5.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll ..\packages\System.Linq.Dynamic.1.0.7\lib\net40\System.Linq.Dynamic.dll ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll ..\packages\System.Threading.Tasks.Extensions.4.5.1\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll {01c93a6b-76c5-4b10-b8b9-2f173b5f9441} 02.Coldairarrow.DataRepository {544fe3ea-46f2-45f7-9574-d4fea111a9c1} 03.Coldairarrow.Entity {7095b12b-7ff2-4b6b-8c6c-654197edaa34} 01.Coldairarrow.Util ================================================ FILE: src/Coldairarrow.Business/BaseBusiness/BaseBusiness.T.cs ================================================ using Coldairarrow.Business.Common; using Coldairarrow.DataRepository; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Data; using System.Data.Common; using System.Data.Entity; using System.Linq; using System.Linq.Dynamic; using System.Linq.Expressions; namespace Coldairarrow.Business { /// /// 描述:业务处理基类 /// 作者:Coldairarrow /// /// 泛型约束(数据库实体) public class BaseBusiness : IRepository where T : class, new() { #region 构造函数 /// /// 构造函数 /// public BaseBusiness() { SetService(null, null, null); } /// /// 构造函数 /// /// 连接名或连接字符串 public BaseBusiness(string conStr) { SetService(conStr, null, null); } /// /// 构造函数 /// /// 连接名或连接字符串 /// 数据库类型 public BaseBusiness(string conStr, DatabaseType dbType) { SetService(conStr, dbType, null); } /// /// 构造函数 /// /// 数据库连接名或连接字符串 /// 数据库类型 /// 实体命名空间 public BaseBusiness(string conStr, DatabaseType dbType, string entityNamespace) { SetService(conStr, dbType, entityNamespace); } /// /// 构造函数 /// /// 上下文连接的DbContext public BaseBusiness(DbContext dbContext) { SetService(dbContext, null, null); } /// /// 构造函数 /// /// 上下文连接的DbContext /// 数据库类型 public BaseBusiness(DbContext dbContext, DatabaseType dbType) { SetService(dbContext, dbType, null); } #endregion #region 私有成员 /// /// 设置仓储服务 /// /// 参数 /// 数据库类型 /// 命名空间 private void SetService(object param, DatabaseType? dbType, string entityNamespace) { Service = DbFactory.GetRepository(param, dbType, entityNamespace); } #endregion #region 外部属性 public IRepository Service { get; set; } #endregion #region 事物提交 /// /// 开始事物提交 /// public void BeginTransaction() { Service.BeginTransaction(); } /// /// 结束事物提交 /// public bool EndTransaction() { return Service.EndTransaction(); } #endregion #region 增加数据 /// /// 插入数据 /// /// 实体类型 /// 实体 public void Insert(T entity) { Service.Insert(entity); } /// /// 插入数据列表 /// 注:若数据量较大,请使用BulkInsert /// /// 实体类型 /// 实体列表 public void Insert(List entities) { Service.Insert(entities); } /// /// 使用Bulk批量插入数据 /// 注:适合大数据量,速度非常快,不支持事务提交(本身是一个事务) /// /// 数据 public void BulkInsert(List entities) { Service.BulkInsert(entities); } #endregion #region 删除数据 /// /// 删除表中所有数据 /// /// 实体 public void DeleteAll() { Service.DeleteAll(); } /// /// 删除一条记录 /// /// 该记录主键 public void Delete(string key) { Service.Delete(key); } /// /// 删除多条记录 /// /// 主键列表 public void Delete(List keys) { Service.Delete(keys); } /// /// 删除一条数据 /// /// 实体类型 /// 实体对象 public void Delete(T entity) { Service.Delete(entity); } /// /// 删除多条数据 /// /// 实体类型 /// 数据列表 public void Delete(List entities) { Service.Delete(entities); } /// /// 通过条件删除数据 /// /// 实体类型 /// 条件 public void Delete(Expression> condition) { Service.Delete_Sql(condition); } #endregion #region 更新数据 /// /// 更新一条数据 /// /// 实体类型 /// 实体对象 public void Update(T entity) { Service.Update(entity); } /// /// 更新多条数据 /// /// 实体类型 /// 数据列表 public void Update(List entities) { Service.Update(entities); } /// /// 更新一条数据,某些属性 /// /// 实体对象 /// 需要更新的字段 public void UpdateAny(T entity, List properties) { Service.UpdateAny(entity, properties); } /// /// 更新多条数据,某些属性 /// /// 数据列表 /// 需要更新的字段 public void UpdateAny(List entities, List properties) { Service.UpdateAny(entities, properties); } /// /// 指定条件更新 /// /// 实体类型 /// 筛选表达式 /// 更改属性回调 public void UpdateWhere(Expression> whereExpre, Action set) { Service.UpdateWhere(whereExpre, set); } #endregion #region 查询数据 /// /// 获取实体 /// /// 实体类型 /// 主键 /// public T GetEntity(params object[] keyValue) { return Service.GetEntity(keyValue); } /// /// 获取表的所有数据,当数据量很大时不要使用! /// /// 实体类型 /// public List GetList() { return Service.GetList(); } /// /// 获取实体对应的表,延迟加载,主要用于支持Linq查询操作 /// /// 实体类型 /// public virtual IQueryable GetIQueryable() { return Service.GetIQueryable(); } /// /// 获取分页后的数据 /// /// 实体类型 /// 数据源IQueryable /// 分页参数 /// public List GetPagination(IQueryable query, Pagination pagination) { return query.GetPagination(pagination).ToList(); } /// /// 获取分页后的数据 /// /// 实体参数 /// IQueryable数据源 /// 当前页 /// 每页行数 /// 排序列 /// 排序类型 /// 总记录数 /// 总页数 /// public List GetPagination(IQueryable query, int pageIndex, int pageRows, string orderColumn, string orderType, ref int count, ref int pages) { Pagination pagination = new Pagination { page = pageIndex, rows = pageRows, sord = orderType, sidx = orderColumn }; count = pagination.records = query.Count(); pages = pagination.total; return query.GetPagination(pagination).ToList(); } /// /// 通过Sql查询返回DataTable /// /// sql语句 /// public DataTable GetDataTableWithSql(string sql) { return Service.GetDataTableWithSql(sql); } /// /// 通过Sql参数查询返回DataTable /// /// Sql语句 /// 查询参数 /// public DataTable GetDataTableWithSql(string sql, List parameters) { return Service.GetDataTableWithSql(sql, parameters); } /// /// 通过sql返回List /// /// 实体类型 /// sql语句 /// public List GetListBySql(string sqlStr) where U : class, new() { return Service.GetListBySql(sqlStr); } /// /// 通过sql返回list /// /// 实体类 /// sql语句 /// 参数 /// public List GetListBySql(string sqlStr, List param) where U : class, new() { return Service.GetListBySql(sqlStr, param); } #endregion #region 执行Sql语句 /// /// 执行Sql语句 /// /// Sql语句 public void ExecuteSql(string sql) { Service.ExecuteSql(sql); } /// /// 通过参数执行Sql语句 /// /// Sql语句 public void ExecuteSql(string sql, List parameters) { Service.ExecuteSql(sql, parameters); } #endregion #region 业务返回 /// /// 返回成功 /// /// public AjaxResult Success() { AjaxResult res = new AjaxResult { Success = true, Msg = "请求成功!", Data = null }; return res; } /// /// 返回成功 /// /// 消息 /// public AjaxResult Success(string msg) { AjaxResult res = new AjaxResult { Success = true, Msg = msg, Data = null }; return res; } /// /// 返回成功 /// /// 返回的数据 /// public AjaxResult Success(object data) { AjaxResult res = new AjaxResult { Success = true, Msg = "请求成功!", Data = data }; return res; } /// /// 返回成功 /// /// 返回的消息 /// 返回的数据 /// public AjaxResult Success(string msg, object data) { AjaxResult res = new AjaxResult { Success = true, Msg = msg, Data = data }; return res; } /// /// 返回错误 /// /// public AjaxResult Error() { AjaxResult res = new AjaxResult { Success = false, Msg = "请求失败!", Data = null }; return res; } /// /// 返回错误 /// /// 错误提示 /// public AjaxResult Error(string msg) { AjaxResult res = new AjaxResult { Success = false, Msg = msg, Data = null }; return res; } #endregion #region 其它操作 public virtual EnumType.LogType LogType { get => throw new Exception("请在子类重写"); } public void WriteSysLog(string logContent) { WriteSysLog(logContent, LogType); } /// /// 写入日志 /// /// 日志内容 /// 日志类型 public static void WriteSysLog(string logContent, EnumType.LogType logType) { BusHelper.WriteSysLog(logContent, logType); } /// /// 处理系统异常 /// /// 异常对象 public static void HandleException(Exception ex) { BusHelper.HandleException(ex); } /// /// 校验重复的数据字段 /// /// 校验的数据 public void CheckRepeatProperty(T data) { CheckRepeatProperty(data, CheckRepeatPropertyConfig); } /// /// 校验重复的数据字段 /// /// 校验的数据 /// 校验的属性,Key为字段名,Value为重复后的提示信息 public void CheckRepeatProperty(T data, Dictionary properties) { foreach (var aProperty in properties) { if (!data.GetPropertyValue(aProperty.Key).IsNullOrEmpty()) { int count = GetIQueryable().Where($"Id!=@0&&{aProperty.Key}==@1", data.GetPropertyValue("Id"), data.GetPropertyValue(aProperty.Key)).Count(); if (count > 0) throw new Exception(aProperty.Value); } } } public virtual Dictionary CheckRepeatPropertyConfig { get; } = new Dictionary(); #endregion } } ================================================ FILE: src/Coldairarrow.Business/Base_SysManage/Base_AppSecretBusiness.cs ================================================ using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic; namespace Coldairarrow.Business.Base_SysManage { public class Base_AppSecretBusiness : BaseBusiness { #region ⲿӿ /// /// ȡб /// /// ѯ /// ؼ /// public List GetDataList(string condition, string keyword, Pagination pagination) { var q = GetIQueryable(); //ģѯ if (!condition.IsNullOrEmpty() && !keyword.IsNullOrEmpty()) q = q.Where($@"{condition}.Contains(@0)", keyword); return q.GetPagination(pagination).ToList(); } /// /// ȡָĵ /// /// /// public Base_AppSecret GetTheData(string id) { return GetEntity(id); } /// /// /// /// public void AddData(Base_AppSecret newData) { Insert(newData); } /// /// /// public void UpdateData(Base_AppSecret theData) { Update(theData); } /// /// ɾ /// /// ɾ public void DeleteData(List ids) { Delete(ids); } /// /// Ȩ /// /// ӦId /// Ȩֵ public void SavePermission(string appId, List permissions) { Service.Delete_Sql(x => x.AppId == appId); List insertList = new List(); permissions.ForEach(newPermission => { insertList.Add(new Base_PermissionAppId { Id = Guid.NewGuid().ToSequentialGuid(), AppId = appId, PermissionValue = newPermission }); }); Service.Insert(insertList); } #endregion #region ˽гԱ #endregion #region ģ #endregion } } ================================================ FILE: src/Coldairarrow.Business/Base_SysManage/Base_DatabaseLinkBusiness.cs ================================================ using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic; namespace Coldairarrow.Business.Base_SysManage { public class Base_DatabaseLinkBusiness : BaseBusiness { #region ⲿӿ /// /// ȡб /// /// ѯ /// ؼ /// public List GetDataList(string condition, string keyword, Pagination pagination) { var q = GetIQueryable(); //ģѯ if (!condition.IsNullOrEmpty() && !keyword.IsNullOrEmpty()) q = q.Where($@"{condition}.Contains(@0)", keyword); return q.GetPagination(pagination).ToList(); } /// /// ȡָĵ /// /// /// public Base_DatabaseLink GetTheData(string id) { return GetEntity(id); } /// /// /// /// public void AddData(Base_DatabaseLink newData) { Insert(newData); } /// /// /// public void UpdateData(Base_DatabaseLink theData) { Update(theData); } /// /// ɾ /// /// ɾ public void DeleteData(List ids) { Delete(ids); } #endregion #region ˽гԱ #endregion #region ģ #endregion } } ================================================ FILE: src/Coldairarrow.Business/Base_SysManage/Base_SysLogBusiness.cs ================================================ using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; namespace Coldairarrow.Business.Base_SysManage { public class Base_SysLogBusiness : BaseBusiness { #region ⲿӿ /// /// ȡ־б /// /// ־ /// ־ /// û /// ʼʱ /// ʱ /// ҳ /// public List GetLogList( string logContent, string logType, string opUserName, DateTime? startTime, DateTime? endTime, Pagination pagination) { return LoggerFactory.GetLogger().GetLogList(logContent, logType, opUserName, startTime, endTime, pagination); } #endregion #region ˽гԱ #endregion #region ģ #endregion } } ================================================ FILE: src/Coldairarrow.Business/Base_SysManage/Base_SysRoleBusiness.cs ================================================ using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic; namespace Coldairarrow.Business.Base_SysManage { public class Base_SysRoleBusiness : BaseBusiness { #region ⲿӿ /// /// ȡб /// /// ѯ /// ؼ /// public List GetDataList(string condition, string keyword, Pagination pagination) { var q = GetIQueryable(); //ģѯ if (!condition.IsNullOrEmpty() && !keyword.IsNullOrEmpty()) q = q.Where($@"{condition}.Contains(@0)", keyword); return q.GetPagination(pagination).ToList(); } /// /// ȡָĵ /// /// /// public Base_SysRole GetTheData(string id) { return GetEntity(id); } /// /// /// /// public void AddData(Base_SysRole newData) { Insert(newData); } /// /// /// public void UpdateData(Base_SysRole theData) { Update(theData); } /// /// ɾ /// /// ɾ public void DeleteData(List ids) { //ɾɫ Delete(ids); } /// /// Ȩ /// /// ɫId /// Ȩֵ public void SavePermission(string roleId,List permissions) { Service.Delete_Sql(x => x.RoleId == roleId); List insertList = new List(); permissions.ForEach(newPermission => { insertList.Add(new Base_PermissionRole { Id=Guid.NewGuid().ToSequentialGuid(), RoleId=roleId, PermissionValue=newPermission }); }); Service.Insert(insertList); PermissionManage.ClearUserPermissionCache(); } #endregion #region ˽гԱ #endregion #region ģ #endregion } } ================================================ FILE: src/Coldairarrow.Business/Base_SysManage/Base_UserBusiness.cs ================================================ using Coldairarrow.Business.Cache; using Coldairarrow.Business.Common; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic; using System.Linq.Expressions; namespace Coldairarrow.Business.Base_SysManage { public class Base_UserBusiness : BaseBusiness { static Base_UserModelCache _cache { get; } = new Base_UserModelCache(); #region ⲿӿ /// /// ȡб /// /// ѯ /// ؼ /// public List GetDataList(string condition, string keyword, Pagination pagination) { var where = LinqHelper.True(); Expression> selectExpre = a => new Base_UserModel { }; selectExpre = selectExpre.BuildExtendSelectExpre(); var q = from a in GetIQueryable().AsExpandable() select selectExpre.Invoke(a); //ģѯ if (!condition.IsNullOrEmpty() && !keyword.IsNullOrEmpty()) q = q.Where($@"{condition}.Contains(@0)", keyword); var list= q.Where(where).GetPagination(pagination).ToList(); SetProperty(list); return list; void SetProperty(List users) { //ûɫ List userIds = users.Select(x => x.UserId).ToList(); var userRoles = (from a in Service.GetIQueryable() join b in Service.GetIQueryable() on a.RoleId equals b.RoleId where userIds.Contains(a.UserId) select new { a.UserId, b.RoleId, b.RoleName }).ToList(); users.ForEach(aUser => { aUser.RoleIdList = userRoles.Where(x => x.UserId == aUser.UserId).Select(x => x.RoleId).ToList(); aUser.RoleNameList = userRoles.Where(x => x.UserId == aUser.UserId).Select(x => x.RoleName).ToList(); }); } } /// /// ȡָĵ /// /// /// public Base_User GetTheData(string id) { return GetEntity(id); } public void AddData(Base_User newData) { if (GetIQueryable().Any(x => x.UserName == newData.UserName)) throw new Exception("ûѴڣ"); Insert(newData); } /// /// /// public void UpdateData(Base_User theData) { if (theData.UserId == "Admin" && Operator.UserId != theData.UserId) throw new Exception("ֹijԱ"); Update(theData); _cache.UpdateCache(theData.UserId); } public void SetUserRole(string userId, List roleIds) { Service.Delete_Sql(x => x.UserId == userId); var insertList = roleIds.Select(x => new Base_UserRoleMap { Id = GuidHelper.GenerateKey(), UserId = userId, RoleId = x }).ToList(); Service.Insert(insertList); _cache.UpdateCache(userId); PermissionManage.UpdateUserPermissionCache(userId); } /// /// ɾ /// /// ɾ public void DeleteData(List ids) { var adminUser = GetTheUser("Admin"); if (ids.Contains(adminUser.Id)) throw new Exception("Ա˺,ֹɾ"); var userIds = GetIQueryable().Where(x => ids.Contains(x.UserId)).Select(x => x.UserId).ToList(); Delete(ids); _cache.UpdateCache(userIds); } /// /// ȡǰϢ /// /// public static Base_UserModel GetCurrentUser() { return GetTheUser(Operator.UserId); } /// /// ȡûϢ /// /// ûId /// public static Base_UserModel GetTheUser(string userId) { return _cache.GetCache(userId); } public static List GetUserRoleIds(string userId) { return GetTheUser(userId).RoleIdList; } /// /// /// /// /// public AjaxResult ChangePwd(string oldPwd,string newPwd) { AjaxResult res = new AjaxResult() { Success = true }; string userId = Operator.UserId; oldPwd = oldPwd.ToMD5String(); newPwd = newPwd.ToMD5String(); var theUser = GetIQueryable().Where(x => x.UserId == userId && x.Password == oldPwd).FirstOrDefault(); if (theUser == null) { res.Success = false; res.Msg = "ԭ벻ȷ"; } else { theUser.Password = newPwd; Update(theUser); } _cache.UpdateCache(userId); return res; } /// /// Ȩ /// /// ûId /// Ȩֵ public void SavePermission(string userId, List permissions) { Service.Delete_Sql(x => x.UserId == userId); var roleIdList = Service.GetIQueryable().Where(x => x.UserId == userId).Select(x => x.RoleId).ToList(); var existsPermissions = Service.GetIQueryable() .Where(x => roleIdList.Contains(x.RoleId) && permissions.Contains(x.PermissionValue)) .GroupBy(x => x.PermissionValue) .Select(x => x.Key) .ToList(); permissions.RemoveAll(x => existsPermissions.Contains(x)); List insertList = new List(); permissions.ForEach(newPermission => { insertList.Add(new Base_PermissionUser { Id = Guid.NewGuid().ToSequentialGuid(), UserId = userId, PermissionValue = newPermission }); }); Service.Insert(insertList); } #endregion #region ˽гԱ #endregion #region ģ #endregion } public class Base_UserModel : Base_User { public string RoleNames { get => string.Join(",", RoleNameList); } public List RoleIdList { get; set; } public List RoleNameList { get; set; } public EnumType.RoleType RoleType { get { int type = 0; var values = typeof(EnumType.RoleType).GetEnumValues(); foreach (var aValue in values) { if (RoleNames.Contains(aValue.ToString())) type += (int)aValue; } return (EnumType.RoleType)type; } } } } ================================================ FILE: src/Coldairarrow.Business/Base_SysManage/CheckSignBusiness.cs ================================================ using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Web; namespace Coldairarrow.Business.Base_SysManage { public class CheckSignBusiness : BaseBusiness { /// /// 判断是否有权限操作接口 /// /// public AjaxResult IsSecurity(HttpContext context) { try { var request = context.Request; var allRequestParams = GetAllRequestParams(context); if (!allRequestParams.ContainsKey("appId")) return new ErrorResult("签名校验失败:缺少appId参数"); if (!allRequestParams.ContainsKey("sign")) return new ErrorResult("签名校验失败:缺少sign签名参数"); if (!allRequestParams.ContainsKey("time")) return new ErrorResult("签名校验失败:缺少time时间参数"); string appId = allRequestParams["appId"]?.ToString(); string appSecret = GetAppSecret(appId); return CheckSign(allRequestParams, appSecret); } catch (Exception ex) { WriteSysLog($"签名校验异常:{ExceptionHelper.GetExceptionAllMsg(ex)}", EnumType.LogType.系统异常); return new ErrorResult("签名校验异常,请查看系统异常日志!"); } } /// /// 获取应用密钥 /// /// 应用Id /// public string GetAppSecret(string appId) { return GetIQueryable().Where(x => x.AppId == appId).FirstOrDefault()?.AppSecret; } /// /// 获取所有请求的参数(包括get参数和post参数) /// /// 请求上下文 /// private Dictionary GetAllRequestParams(HttpContext context) { Dictionary allParams = new Dictionary(); var request = context.Request; List paramKeys = new List(); var getParams = request.QueryString.AllKeys.ToList(); var postParams = request.Form.AllKeys.ToList(); paramKeys.AddRange(getParams); paramKeys.AddRange(postParams); paramKeys.ForEach(aParam => { allParams.Add(aParam, request[aParam]); }); string contentType = request.ContentType.ToLower(); //若为POST的application/json if (contentType.Contains("application/json")) { var stream = request.InputStream; stream.Position = 0; string str = new StreamReader(stream).ReadToEnd(); var obj = str.ToJObject(); foreach (var aProperty in obj) { allParams.Add(aProperty.Key, aProperty.Value); } } return allParams; } /// /// 检验签名是否有效 /// /// 所有的请求参数 /// 应用密钥 /// private AjaxResult CheckSign(Dictionary allRequestParames, string appSecret) { //检验签名是否过期 DateTime now = DateTime.Now; DateTime requestTime = Convert.ToDateTime(allRequestParames["time"]?.ToString()); if (requestTime < now.AddMinutes(-5) || requestTime > now.AddMinutes(5)) return new ErrorResult("签名校验失败:time时间参数过期,请校准时间"); //检验签名是否有效 string oldSign = allRequestParames["sign"]?.ToString(); Dictionary parames = new Dictionary(); foreach (var aParam in allRequestParames) { parames.Add(aParam.Key, aParam.Value); } parames.Remove("sign"); string newSign = BuildSign(parames, appSecret); if (newSign != oldSign) return new ErrorResult("签名校验失败:sign签名参数校验失败,请仔细核对签名算法"); return Success(); } /// /// 构建安全的请求参数(默认签名规则) /// /// 业务参数(不包含校验参数) /// 应用Id /// 应用密钥 public static Dictionary BuildSafeHttpParam(Dictionary businessParams, string appId, string appSecret) { Dictionary requestParames = new Dictionary(); if (businessParams != null) { foreach (var aParam in businessParams) { requestParames.Add(aParam.Key, aParam.Value); } } requestParames.Add("time", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); requestParames.Add("appId", appId); string sign = BuildSign(requestParames, appSecret); requestParames.Add("sign", sign); return requestParames; } /// /// 构造签名 /// /// 需要的参数(不包括sign) /// 应用密钥 /// private static string BuildSign(Dictionary needParames, string appSecret) { var sortedParams = new SortedDictionary(new AsciiComparer()); foreach (var aParam in needParames) { sortedParams.Add(aParam.Key, aParam.Value); } StringBuilder signBuilder = new StringBuilder(); foreach (var aParam in sortedParams) { var value = aParam.IsNullOrEmpty() ? string.Empty : aParam.Value.ToString(); signBuilder.Append($@"{aParam.Key}{value}"); } signBuilder.Append(appSecret); string sign = signBuilder.ToString().ToMD5String().ToUpper(); return sign; } /// /// 基于ASCII码排序规则的String比较器 /// class AsciiComparer : IComparer { public int Compare(string a, string b) { if (a == b) return 0; else if (string.IsNullOrEmpty(a)) return -1; else if (string.IsNullOrEmpty(b)) return 1; if (a.Length <= b.Length) { for (int i = 0; i < a.Length; i++) { if (a[i] < b[i]) return -1; else if (a[i] > b[i]) return 1; else continue; } return a.Length == b.Length ? 0 : -1; } else { for (int i = 0; i < b.Length; i++) { if (a[i] < b[i]) return -1; else if (a[i] > b[i]) return 1; else continue; } return 1; } } } } } ================================================ FILE: src/Coldairarrow.Business/Base_SysManage/HomeBusiness.cs ================================================ using Coldairarrow.Business.Common; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System.Linq; namespace Coldairarrow.Business.Base_SysManage { public class HomeBusiness:BaseBusiness { public AjaxResult SubmitLogin(string userName, string password) { if (userName.IsNullOrEmpty() || password.IsNullOrEmpty()) return Error("账号或密码不能为空!"); password = password.ToMD5String(); var theUser = GetIQueryable().Where(x => x.UserName == userName && x.Password == password).FirstOrDefault(); if (theUser != null) { Operator.Login(theUser.UserId); return Success(); } else return Error("账号或密码不正确!"); } } } ================================================ FILE: src/Coldairarrow.Business/Base_SysManage/PermissionManage.cs ================================================ using Coldairarrow.Business.Common; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml.Linq; namespace Coldairarrow.Business.Base_SysManage { /// /// 权限管理静态类 /// public static class PermissionManage { #region 构造函数 /// /// 构造函数 /// static PermissionManage() { InitAllPermissionModules(); InitAllPermissionValues(); } #endregion #region 内部成员 private static string _permissionConfigFile { get; } = "~/Config/Permission.config"; private static List _allPermissionModules { get; set; } private static List _allPermissionValues { get; set; } private static void InitAllPermissionModules() { List resList = new List(); string filePath = HttpContext.Current.Server.MapPath(_permissionConfigFile); XElement xe = XElement.Load(filePath); xe.Elements("module")?.ForEach(aModule => { PermissionModule newModule = new PermissionModule(); resList.Add(newModule); newModule.Name = aModule.Attribute("name")?.Value; newModule.Value = aModule.Attribute("value")?.Value; newModule.Items = new List(); aModule?.Elements("permission")?.ForEach(aItem => { PermissionItem newItem = new PermissionItem(); newModule.Items.Add(newItem); newItem.Name = aItem?.Attribute("name")?.Value; newItem.Value = aItem?.Attribute("value")?.Value; }); }); _allPermissionModules = resList; } private static void InitAllPermissionValues() { List resList = new List(); GetAllPermissionModules()?.ForEach(aModule => { aModule.Items?.ForEach(aItem => { resList.Add($"{aModule.Value}.{aItem.Value}"); }); }); _allPermissionValues = resList; } private static List GetPermissionModules(List hasPermissions) { var permissionModules = GetAllPermissionModules(); permissionModules.ForEach(aModule => { aModule.Items?.ForEach(aItem => { aItem.IsChecked = hasPermissions.Contains($"{aModule.Value}.{aItem.Value}"); }); }); return permissionModules; } private static string _cacheKey { get; } = "Permission"; private static string BuildCacheKey(string key) { return $"{GlobalSwitch.ProjectName}_{_cacheKey}_{key}"; } #endregion #region 所有权限 /// /// 获取所有权限模块 /// /// public static List GetAllPermissionModules() { return _allPermissionModules.DeepClone(); } /// /// 获取所有权限值 /// /// public static List GetAllPermissionValues() { return _allPermissionValues.DeepClone(); } #endregion #region 角色权限 /// /// 获取角色权限模块 /// /// /// public static List GetRolePermissionModules(string roleId) { BaseBusiness _db = new BaseBusiness(); var hasPermissions = _db.GetIQueryable().Where(x => x.RoleId == roleId).Select(x => x.PermissionValue).ToList(); return GetPermissionModules(hasPermissions); } #endregion #region AppId权限 /// /// 获取AppId权限模块 /// /// /// public static List GetAppIdPermissionModules(string appId) { var hasPermissions = GetAppIdPermissionValues(appId); return GetPermissionModules(hasPermissions); } /// /// 获取AppId权限值 /// /// /// public static List GetAppIdPermissionValues(string appId) { string cacheKey = BuildCacheKey(appId); var permissions = CacheHelper.Cache.GetCache>(cacheKey); if (permissions == null) { BaseBusiness _db = new BaseBusiness(); permissions = _db.GetIQueryable().Where(x => x.AppId == appId).Select(x => x.PermissionValue).ToList(); CacheHelper.Cache.SetCache(cacheKey, permissions); } return permissions.DeepClone(); } /// /// 设置AppId权限 /// /// AppId /// 权限值列表 public static void SetAppIdPermission(string appId,List permissions) { //更新缓存 string cacheKey = BuildCacheKey(appId); CacheHelper.Cache.SetCache(cacheKey, permissions); //更新数据库 BaseBusiness _db = new BaseBusiness(); var Service = _db.Service; Service.Delete_Sql(x => x.AppId == appId); List insertList = new List(); permissions.ForEach(newPermission => { insertList.Add(new Base_PermissionAppId { Id = Guid.NewGuid().ToSequentialGuid(), AppId = appId, PermissionValue = newPermission }); }); Service.Insert(insertList); } #endregion #region 用户权限 /// /// 获取用户权限模块 /// /// /// public static List GetUserPermissionModules(string userId) { var hasPermissions = GetUserPermissionValues(userId); return GetPermissionModules(hasPermissions); } /// /// 获取用户拥有的所有权限值 /// /// 用户Id /// public static List GetUserPermissionValues(string userId) { string cacheKey = BuildCacheKey(userId); var permissions = CacheHelper.Cache.GetCache>(cacheKey)?.DeepClone(); if (permissions == null) { UpdateUserPermissionCache(userId); permissions = CacheHelper.Cache.GetCache>(cacheKey)?.DeepClone(); } return permissions; } /// /// 设置用户权限 /// /// 用户Id /// 权限值列表 public static void SetUserPermission(string userId,List permissions) { //更新数据库 BaseBusiness _db = new BaseBusiness(); var Service = _db.Service; Service.Delete_Sql(x => x.UserId == userId); var roleIdList = _db.Service.GetIQueryable().Where(x => x.UserId == userId).Select(x => x.RoleId).ToList(); var existsPermissions = Service.GetIQueryable() .Where(x => roleIdList.Contains(x.RoleId) && permissions.Contains(x.PermissionValue)) .GroupBy(x => x.PermissionValue) .Select(x => x.Key) .ToList(); permissions.RemoveAll(x => existsPermissions.Contains(x)); List insertList = new List(); permissions.ForEach(newPermission => { insertList.Add(new Base_PermissionUser { Id = Guid.NewGuid().ToSequentialGuid(), UserId = userId, PermissionValue = newPermission }); }); Service.Insert(insertList); //更新缓存 UpdateUserPermissionCache(userId); } /// /// 清除所有用户权限缓存 /// public static void ClearUserPermissionCache() { BaseBusiness _db = new BaseBusiness(); var userIdList = _db.Service.GetIQueryable().Select(x => x.UserId).ToList(); userIdList.ForEach(aUserId => { CacheHelper.Cache.RemoveCache(BuildCacheKey(aUserId)); }); } /// /// 更新用户权限缓存 /// /// <用户Id/param> public static void UpdateUserPermissionCache(string userId) { string cacheKey = BuildCacheKey(userId); List permissions = new List(); BaseBusiness _db = new BaseBusiness(); var userPermissions = _db.GetIQueryable().Where(x => x.UserId == userId).Select(x => x.PermissionValue).ToList(); var theUser = _db.Service.GetIQueryable().Where(x => x.UserId == userId).FirstOrDefault(); var roleIdList = Base_UserBusiness.GetUserRoleIds(userId); var rolePermissions = _db.Service.GetIQueryable().Where(x => roleIdList.Contains(x.RoleId)).GroupBy(x => x.PermissionValue).Select(x => x.Key).ToList(); var existsPermissions = userPermissions.Concat(rolePermissions).Distinct(); permissions = existsPermissions.ToList(); CacheHelper.Cache.SetCache(cacheKey, permissions); } #endregion #region 当前操作用户权限 /// /// 获取当前操作者拥有的所有权限值 /// /// public static List GetOperatorPermissionValues() { if (Operator.IsAdmin()) return GetAllPermissionValues(); else return GetUserPermissionValues(Operator.UserId); } /// /// 判断当前操作者是否拥有某项权限值 /// /// 权限值 /// public static bool OperatorHasPermissionValue(string value) { return GetOperatorPermissionValues().Exists(x => x.ToLower() == value.ToLower()); } #endregion } #region 数据模型 public class PermissionModule { public string Name { get; set; } public string Value { get; set; } public List Items { get; set; } } public class PermissionItem { public string Name { get; set; } public string Value { get; set; } public bool IsChecked { get; set; } } #endregion } ================================================ FILE: src/Coldairarrow.Business/Base_SysManage/RapidDevelopmentBusiness.cs ================================================ using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Linq.Dynamic; using System.Text; namespace Coldairarrow.Business.Base_SysManage { public class RapidDevelopmentBusiness : BaseBusiness { #region 外部接口 /// /// 获取所有数据库连接 /// /// public List GetAllDbLink() { return GetList(); } /// /// 获取数据库所有表 /// /// 数据库连接Id /// public List GetDbTableList(string linkId) { if (linkId.IsNullOrEmpty()) return new List(); else return GetTheDbHelper(linkId).GetDbAllTables(); } /// /// 生成代码 /// /// 连接Id /// 区域名 /// 表列表 /// 需要生成类型 public void BuildCode(string linkId, string areaName, string tables, string buildType) { //内部成员初始化 _dbHelper = GetTheDbHelper(linkId); GetDbTableList(linkId).ForEach(aTable => { _dbTableInfoDic.Add(aTable.TableName, aTable); }); List tableList = tables.ToList(); List buildTypeList = buildType.ToList(); tableList.ForEach(aTable => { var tableFieldInfo = _dbHelper.GetDbTableInfo(aTable); //实体层 if (buildTypeList.Exists(x => x.ToLower() == "entity")) { BuildEntity(tableFieldInfo, areaName, aTable); } //业务层 if (buildTypeList.Exists(x => x.ToLower() == "business")) { BuildBusiness(areaName, aTable); } //控制器 if (buildTypeList.Exists(x => x.ToLower() == "controller")) { BuildArea(areaName); BuildController(areaName, aTable); } //视图 if (buildTypeList.Exists(x => x.ToLower() == "view")) { BuildArea(areaName); BuildView(tableFieldInfo, areaName, aTable); } }); } #endregion #region 私有成员 /// /// 生成实体 /// /// 表字段信息 /// 区域名 /// 表名 private void BuildEntity(List tableInfo, string areaName, string tableName) { string rootPath = AppDomain.CurrentDomain.BaseDirectory; string entityPath = rootPath.Replace("Coldairarrow.Web", "Coldairarrow.Entity") + areaName; string filePath = $@"{entityPath}\{tableName}.cs"; string nameSpace = $@"Coldairarrow.Entity.{areaName}"; _dbHelper.SaveEntityToFile(tableInfo, tableName, _dbTableInfoDic[tableName].Description, filePath, nameSpace); } /// /// 生成业务逻辑代码 /// /// 区域名 /// 实体名 private void BuildBusiness(string areaName, string entityName) { string code = $@"using Coldairarrow.Entity.{areaName}; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic; namespace Coldairarrow.Business.{areaName} {{ public class {entityName}Business : BaseBusiness<{entityName}> {{ #region 外部接口 /// /// 获取数据列表 /// /// 查询类型 /// 关键字 /// public List<{entityName}> GetDataList(string condition, string keyword, Pagination pagination) {{ var q = GetIQueryable(); //模糊查询 if (!condition.IsNullOrEmpty() && !keyword.IsNullOrEmpty()) q = q.Where($@""{{condition}}.Contains(@0)"", keyword); return q.GetPagination(pagination).ToList(); }} /// /// 获取指定的单条数据 /// /// 主键 /// public {entityName} GetTheData(string id) {{ return GetEntity(id); }} /// /// 添加数据 /// /// 数据 public void AddData({entityName} newData) {{ Insert(newData); }} /// /// 更新数据 /// public void UpdateData({entityName} theData) {{ Update(theData); }} /// /// 删除数据 /// /// 删除的数据 public void DeleteData(List ids) {{ Delete(ids); }} #endregion #region 私有成员 #endregion #region 数据模型 #endregion }} }}"; string rootPath = AppDomain.CurrentDomain.BaseDirectory; string areaPath = rootPath.Replace("Coldairarrow.Web", "Coldairarrow.Business") + areaName; string filePath = $@"{areaPath}\{entityName}Business.cs"; FileHelper.WriteTxt(code, filePath, FileMode.Create); } /// /// 生成控制器代码 /// /// 区域名 /// 实体名 private void BuildController(string areaName, string entityName) { string varBusiness = $@"_{entityName.ToFirstLowerStr()}Business"; string code = $@"using Coldairarrow.Business.{areaName}; using Coldairarrow.Entity.{areaName}; using Coldairarrow.Util; using System; using System.Web.Mvc; namespace Coldairarrow.Web {{ public class {entityName}Controller : BaseMvcController {{ {entityName}Business {varBusiness} = new {entityName}Business(); #region 视图功能 public ActionResult Index() {{ return View(); }} public ActionResult Form(string id) {{ var theData = id.IsNullOrEmpty() ? new {entityName}() : {varBusiness}.GetTheData(id); return View(theData); }} #endregion #region 获取数据 /// /// 获取数据列表 /// /// 查询类型 /// 关键字 /// public ActionResult GetDataList(string condition, string keyword, Pagination pagination) {{ var dataList = {varBusiness}.GetDataList(condition, keyword, pagination); return Content(pagination.BuildTableResult_DataGrid(dataList).ToJson()); }} #endregion #region 提交数据 /// /// 保存 /// /// 保存的数据 public ActionResult SaveData({entityName} theData) {{ if(theData.Id.IsNullOrEmpty()) {{ theData.Id = Guid.NewGuid().ToSequentialGuid(); {varBusiness}.AddData(theData); }} else {{ {varBusiness}.UpdateData(theData); }} return Success(); }} /// /// 删除数据 /// /// 删除的数据 public ActionResult DeleteData(string ids) {{ {varBusiness}.DeleteData(ids.ToList()); return Success(""删除成功!""); }} #endregion }} }}"; string rootPath = AppDomain.CurrentDomain.BaseDirectory; string filePath = $@"{rootPath}Areas\{areaName}\Controllers\{entityName}Controller.cs"; FileHelper.WriteTxt(code, filePath, FileMode.Create); } /// /// 生成视图 /// /// 表字段信息 /// 区域名 /// 实体名 private void BuildView(List tableInfoList, string areaName, string entityName) { //生成Index页面 StringBuilder searchConditionSelectHtml = new StringBuilder(); StringBuilder tableColsBuilder = new StringBuilder(); StringBuilder formRowBuilder = new StringBuilder(); tableInfoList.Where(x => x.Name != "Id").ForEach((aField, index) => { //搜索的下拉选项 Type fieldType = _dbHelper.DbTypeStr_To_CsharpType(aField.Type); if (fieldType == typeof(string)) { string newOption = $@" "; searchConditionSelectHtml.Append(newOption); } //数据表格列 string end = (index == tableInfoList.Count - 2) ? "" : ","; string newCol =$@" {{ title: '{aField.Description}', field: '{aField.Name}', width: 200 }}{end}"; tableColsBuilder.Append(newCol); //Form页面中的Html string newFormRow = $@" {aField.Description} "; formRowBuilder.Append(newFormRow); }); string indexHtml = $@"@{{ Layout = ""~/Views/Shared/_Layout_List.cshtml""; }} @section toolbar{{ 添加 修改 删除 }} @section search{{
}}
"; string rootPath = AppDomain.CurrentDomain.BaseDirectory; string indexPath = $@"{rootPath}Areas\{areaName}\Views\{entityName}\Index.cshtml"; FileHelper.WriteTxt(indexHtml, indexPath, FileMode.Create); //生成Form页面 string formHtml = $@"@using Coldairarrow.Entity.{areaName}; @using Coldairarrow.Util; @{{ Layout = ""~/Views/Shared/_Layout_List.cshtml""; var obj = ({entityName})Model; var objStr = Html.Raw(obj.ToJson()); }}
{formRowBuilder.ToString()}
@section foottoolbar{{ 保存 }} "; string formPath = $@"{rootPath}Areas\{areaName}\Views\{entityName}\Form.cshtml"; FileHelper.WriteTxt(formHtml, formPath, FileMode.Create); } /// /// 生成区域配置代码 /// /// 区域名 private void BuildArea(string areaName) { //生成区域注册文件 string areaRegistrationCode = $@"using System.Web.Mvc; namespace Coldairarrow.Web {{ public class {areaName}AreaRegistration : AreaRegistration {{ public override string AreaName {{ get {{ return ""{areaName}""; }} }} public override void RegisterArea(AreaRegistrationContext context) {{ context.MapRoute( ""{areaName}_default"", ""{areaName}/{{controller}}/{{action}}/{{id}}"", new {{ action = ""Index"", id = UrlParameter.Optional }} ); }} }} }}"; string rootPath = AppDomain.CurrentDomain.BaseDirectory; string areaRegistrationPath = $@"{rootPath}Areas\{areaName}\{areaName}AreaRegistration.cs"; if(!FileHelper.Exists(areaRegistrationPath)) FileHelper.WriteTxt(areaRegistrationCode, areaRegistrationPath, FileMode.Create); //生成区域web.config string webConfigCode = $@"
"; rootPath = AppDomain.CurrentDomain.BaseDirectory; string webConfigPath = $@"{rootPath}Areas\{areaName}\Views\web.config"; if(!FileHelper.Exists(webConfigPath)) FileHelper.WriteTxt(webConfigCode, webConfigPath, FileMode.Create); } /// /// 获取对应的数据库帮助类 /// /// 数据库连接Id /// private DbHelper GetTheDbHelper(string linkId) { var theLink = GetTheLink(linkId); DbHelper dbHelper = DbHelperFactory.GetDbHelper(theLink.DbType, theLink.ConnectionStr); return dbHelper; } /// /// 获取指定的数据库连接 /// /// 连接Id /// private Base_DatabaseLink GetTheLink(string linkId) { Base_DatabaseLink resObj = new Base_DatabaseLink(); var theModule = GetIQueryable().Where(x => x.Id == linkId).FirstOrDefault(); resObj = theModule ?? resObj; return resObj; } private DbHelper _dbHelper { get; set; } private Dictionary _dbTableInfoDic { get; set; } = new Dictionary(); #endregion #region 数据模型 #endregion } } ================================================ FILE: src/Coldairarrow.Business/Base_SysManage/UrlPermissionManage.cs ================================================ using Coldairarrow.Util; using System.Collections.Generic; using System.Web; using System.Xml.Linq; namespace Coldairarrow.Business.Base_SysManage { public static class UrlPermissionManage { #region 构造函数 static UrlPermissionManage() { InitAllUrlPermissions(); } #endregion #region 私有成员 private static string _configFile { get; } = "~/Config/UrlPermission.config"; private static List _allUrlPermissions { get; set; } private static void InitAllUrlPermissions() { List resList = new List(); string filePath = HttpContext.Current.Server.MapPath(_configFile); XElement xe = XElement.Load(filePath); xe.Elements("action")?.ForEach(aUrl => { ActionPermission newUrl = new ActionPermission { Url = aUrl.Attribute("url")?.Value, PermissionValue = aUrl.Attribute("needPermission")?.Value }; if (!newUrl.Url.IsNullOrEmpty() && !newUrl.PermissionValue.IsNullOrEmpty()) resList.Add(newUrl); }); _allUrlPermissions = resList; } #endregion #region 外部接口 /// /// 获取所有URL需要的权限 /// /// public static List GetAllUrlPermissions() { return _allUrlPermissions.DeepClone(); } #endregion } #region 数据模型 /// /// URL接口权限 /// public class ActionPermission { public string Url { get; set; } public string PermissionValue { get; set; } } #endregion } ================================================ FILE: src/Coldairarrow.Business/Common/BusHelper.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Threading.Tasks; namespace Coldairarrow.Business.Common { static public class BusHelper { /// /// 写入日志 /// /// 日志内容 /// 日志类型 public static void WriteSysLog(string logContent, EnumType.LogType logType) { string userName = null; try { userName = Base_UserBusiness.GetCurrentUser().UserName; } catch { } Base_SysLog newLog = new Base_SysLog { Id = Guid.NewGuid().ToSequentialGuid(), LogType = logType.ToString(), LogContent = logContent.Replace("\r\n", "
").Replace(" ", "  "), OpTime = DateTime.Now, OpUserName = userName }; Task.Run(() => { try { LoggerFactory.GetLogger().WriteSysLog(newLog); } catch { } }); } /// /// 处理系统异常 /// /// 异常对象 public static void HandleException(Exception ex) { string msg = ExceptionHelper.GetExceptionAllMsg(ex); WriteSysLog(msg, EnumType.LogType.系统异常); } } } ================================================ FILE: src/Coldairarrow.Business/Common/Operator.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Util; namespace Coldairarrow.Business.Common { /// /// 操作者 /// public static class Operator { /// /// 当前操作者UserId /// public static string UserId { get { if (GlobalSwitch.RunModel == RunModel.LocalTest) return "Admin"; else return SessionHelper.Session["UserId"]?.ToString(); } } public static Base_UserModel Property { get => Base_UserBusiness.GetTheUser(UserId); } #region 操作方法 /// /// 是否已登录 /// /// public static bool Logged() { return !UserId.IsNullOrEmpty(); } /// /// 登录 /// /// 用户逻辑主键Id public static void Login(string userId) { SessionHelper.Session["UserId"] = userId; } /// /// 注销 /// public static void Logout() { SessionHelper.Session["UserId"] = null; } /// /// 判断是否为超级管理员 /// /// public static bool IsAdmin() { return UserId == "Admin"; } #endregion } } ================================================ FILE: src/Coldairarrow.Business/Logger/ElasticSearchLogger.cs ================================================ using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using Elasticsearch.Net; using Nest; using System; using System.Collections.Generic; using System.Linq; namespace Coldairarrow.Business { class ElasticSearchLogger : ILogger { static ElasticSearchLogger() { string index = $"{GlobalSwitch.ProjectName}.{typeof(Base_SysLog).Name}".ToLower(); var pool = new StaticConnectionPool(GlobalSwitch.ElasticSearchNodes); _connectionSettings = new ConnectionSettings(pool).DefaultIndex(index); _elasticClient = new ElasticClient(_connectionSettings); if (!_elasticClient.IndexExists(Indices.Parse(index)).Exists) { var descriptor = new CreateIndexDescriptor(index) .Mappings(ms => ms .Map(m => m.AutoMap()) ); var res = _elasticClient.CreateIndex(descriptor); } } private static ConnectionSettings _connectionSettings { get; set; } private static ElasticClient _elasticClient { get; set; } public List GetLogList(string logContent, string logType, string opUserName, DateTime? startTime, DateTime? endTime, Pagination pagination) { var client = GetElasticClient(); var filters = new List, QueryContainer>>(); if (!logContent.IsNullOrEmpty()) filters.Add(q => q.Wildcard(w => w.Field(f => f.LogContent).Value($"*{logContent}*"))); if (!logType.IsNullOrEmpty()) filters.Add(q => q.Terms(t => t.Field(f => f.LogType).Terms(logType))); if (!opUserName.IsNullOrEmpty()) filters.Add(q => q.Wildcard(w => w.Field(f => f.OpUserName).Value($"*{opUserName}*"))); if (!startTime.IsNullOrEmpty()) filters.Add(q => q.DateRange(d => d.Field(f => f.OpTime).GreaterThan(startTime))); if (!endTime.IsNullOrEmpty()) filters.Add(q => q.DateRange(d => d.Field(f => f.OpTime).LessThan(endTime))); SortOrder sortOrder = pagination.SortType.ToLower() == "asc" ? SortOrder.Ascending : SortOrder.Descending; var result = client.Search(s => s.Query(q => q.Bool(b => b.Filter(filters.ToArray())) ) .Sort(o => o.Field(typeof(Base_SysLog).GetProperty(pagination.SortField), sortOrder)) .Skip((pagination.page - 1) * pagination.rows) .Take(pagination.rows) ); pagination.RecordCount = (int)result.Total; return result.Documents.ToList(); } public void WriteSysLog(Base_SysLog log) { GetElasticClient().IndexDocument(log); } private ElasticClient GetElasticClient() { return _elasticClient; } } } ================================================ FILE: src/Coldairarrow.Business/Logger/ILogger.cs ================================================ using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; namespace Coldairarrow.Business { interface ILogger { void WriteSysLog(Base_SysLog log); List GetLogList( string logContent, string logType, string opUserName, DateTime? startTime, DateTime? endTime, Pagination pagination); } } ================================================ FILE: src/Coldairarrow.Business/Logger/LoggerFactory.cs ================================================ using Coldairarrow.Util; using System; namespace Coldairarrow.Business { static class LoggerFactory { public static ILogger GetLogger() { return GetLogger(GlobalSwitch.LoggerType); } public static ILogger GetLogger(LoggerType LoggerType) { switch (LoggerType) { case LoggerType.RDBMS: return new RDBMSLogger(); case LoggerType.ElasticSearch: return new ElasticSearchLogger(); default: throw new Exception("请配置记录日志的类型"); } } } } ================================================ FILE: src/Coldairarrow.Business/Logger/RDBMSLogger.cs ================================================ using Coldairarrow.DataRepository; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Linq; namespace Coldairarrow.Business { class RDBMSLogger : ILogger { private IRepository _db { get; } = DbFactory.GetRepository(); public List GetLogList(string logContent, string logType, string opUserName, DateTime? startTime, DateTime? endTime, Pagination pagination) { var whereExp = LinqHelper.True(); if (!logContent.IsNullOrEmpty()) whereExp = whereExp.And(x => x.LogContent.Contains(logContent)); if (!logType.IsNullOrEmpty()) whereExp = whereExp.And(x => x.LogType == logType); if (!opUserName.IsNullOrEmpty()) whereExp = whereExp.And(x => x.OpUserName.Contains(opUserName)); if (!startTime.IsNullOrEmpty()) whereExp = whereExp.And(x => x.OpTime >= startTime); if (!endTime.IsNullOrEmpty()) whereExp = whereExp.And(x => x.OpTime <= endTime); return _db.GetIQueryable().Where(whereExp).GetPagination(pagination).ToList(); } public void WriteSysLog(Base_SysLog log) { _db.Insert(log); } } } ================================================ FILE: src/Coldairarrow.Business/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Coldairarrow.Business")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Coldairarrow.Business")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 会使此程序集中的类型 //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 //请将此类型的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("62858a89-da3c-4658-8219-580780d435c9")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: src/Coldairarrow.Business/app.config ================================================ 
================================================ FILE: src/Coldairarrow.Business/packages.config ================================================  ================================================ FILE: src/Coldairarrow.Console/06.Coldairarrow.Console.csproj ================================================  Debug AnyCPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70} Exe Coldairarrow.Console1 Coldairarrow.Console v4.5.2 512 true true AnyCPU true full false bin\Debug\ DEBUG;TRACE prompt 4 AnyCPU pdbonly true bin\Release\ TRACE prompt 4 ..\packages\DotNetty.Buffers.0.6.0\lib\net45\DotNetty.Buffers.dll ..\packages\DotNetty.Codecs.0.6.0\lib\net45\DotNetty.Codecs.dll ..\packages\DotNetty.Common.0.6.0\lib\net45\DotNetty.Common.dll ..\packages\DotNetty.Transport.0.6.0\lib\net45\DotNetty.Transport.dll ..\packages\DotNettyRPC.1.5.3\lib\net45\DotNettyRPC.dll ..\packages\Dynamitey.2.0.9.136\lib\net40\Dynamitey.dll ..\packages\Elasticsearch.Net.6.1.0\lib\net45\Elasticsearch.Net.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll ..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll ..\packages\ImpromptuInterface.7.0.1\lib\net40\ImpromptuInterface.dll ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.1.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll ..\packages\Microsoft.Extensions.Logging.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.dll ..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll ..\packages\NEST.6.1.0\lib\net45\Nest.dll ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\System.Collections.Immutable.1.5.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll ..\packages\System.Linq.Dynamic.1.0.7\lib\net40\System.Linq.Dynamic.dll ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll ..\packages\System.Threading.Tasks.Extensions.4.5.1\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll {62858a89-da3c-4658-8219-580780d435c9} 04.Coldairarrow.Business {01c93a6b-76c5-4b10-b8b9-2f173b5f9441} 02.Coldairarrow.DataRepository {544fe3ea-46f2-45f7-9574-d4fea111a9c1} 03.Coldairarrow.Entity {7095b12b-7ff2-4b6b-8c6c-654197edaa34} 01.Coldairarrow.Util ================================================ FILE: src/Coldairarrow.Console/App.config ================================================ 
================================================ FILE: src/Coldairarrow.Console/Program.cs ================================================ using System; namespace Coldairarrow.Console1 { class Program { static void Main(string[] args) { Console.WriteLine("完成"); Console.ReadLine(); } } } ================================================ FILE: src/Coldairarrow.Console/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Coldairarrow.Console")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Coldairarrow.Console")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 会使此程序集中的类型 //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 //请将此类型的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("78a6219e-ef16-4b0a-9f8b-df1bed594c70")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: src/Coldairarrow.Console/packages.config ================================================  ================================================ FILE: src/Coldairarrow.DataRepository/02.Coldairarrow.DataRepository.csproj ================================================  Debug AnyCPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441} Library Properties Coldairarrow.DataRepository Coldairarrow.DataRepository v4.5.2 512 true full false bin\Debug\ DEBUG;TRACE prompt 4 pdbonly false bin\Release\ TRACE prompt 4 ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll ..\packages\EntityFramework6.Npgsql.3.2.0\lib\net45\EntityFramework6.Npgsql.dll ..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll ..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll ..\packages\MySql.Data.Entity.6.8.8\lib\net45\MySql.Data.Entity.EF6.dll ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\Npgsql.4.0.3\lib\net451\Npgsql.dll ..\packages\Oracle.ManagedDataAccess.18.3.0\lib\net40\Oracle.ManagedDataAccess.dll ..\packages\Oracle.ManagedDataAccess.EntityFramework.18.3.0\lib\net45\Oracle.ManagedDataAccess.EntityFramework.dll ..\packages\StackExchange.Redis.1.2.4\lib\net45\StackExchange.Redis.dll ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.0\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Threading.Tasks.Extensions.4.5.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll ..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll {7095b12b-7ff2-4b6b-8c6c-654197edaa34} 01.Coldairarrow.Util ================================================ FILE: src/Coldairarrow.DataRepository/DbContext/BaseDbContext.cs ================================================ using Coldairarrow.Util; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Data.Common; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Linq; using System.Reflection; using System.Text; namespace Coldairarrow.DataRepository { public class BaseDbContext : DbContext { #region 构造函数 /// /// 静态构造函数 /// static BaseDbContext() { //数据库已手动构建,不需要自己生成初始化 Database.SetInitializer(null); //初始化模型类型 InitModelType(); } /// /// 构造函数 /// /// 数据库连接名或连接字符串 /// 数据库类型 /// 数据库实体命名空间,注意,该命名空间应该包含所有需要的数据库实体 public BaseDbContext(string nameOrConStr, DatabaseType dbType, string entityNamespace) : base(GetDbConnection(nameOrConStr, dbType), true) { _dbType = dbType; } #endregion #region 公有成员 public static bool NeedReloadDb(Type type) { string modelId = GetIdentity(type); if (_modelTypeMap.ContainsKey(modelId)) return false; else { AddSet(type); return true; } } public override DbSet Set() { return Set(typeof(TEntity)).Cast(); } public override DbSet Set(Type entityType) { string modelId = GetIdentity(entityType); var type = _modelTypeMap[modelId]; return base.Set(type); } #endregion #region 私有成员 private DatabaseType _dbType { get; set; } /// /// 初始化DbContext /// /// 模型建造者 protected override void OnModelCreating(DbModelBuilder modelBuilder) { //modelBuilder.Entity(); //以下代码最终目的就是将所有需要的实体类调用上面的方法加入到DbContext中,成为其中的一部分 modelBuilder.HasDefaultSchema(GetSchema()); var entityMethod = typeof(DbModelBuilder).GetMethod("Entity"); _modelTypes.ToList().ForEach(aModel => { entityMethod.MakeGenericMethod(aModel).Invoke(modelBuilder, null); }); string GetSchema() { switch (_dbType) { case DatabaseType.SqlServer: return "dbo"; case DatabaseType.MySql: case DatabaseType.PostgreSql: return "public"; case DatabaseType.Oracle:return Database.Connection.Database; default: return "dbo"; } } } /// /// 获取DbConnection /// /// 连接名或字符串 /// private static DbConnection GetDbConnection(string conStr, DatabaseType dbType) { if (conStr.IsNullOrEmpty()) conStr = GlobalSwitch.DefaultDbConName; DbConnection dbConnection = DbProviderFactoryHelper.GetDbConnection(dbType); dbConnection.ConnectionString = DbProviderFactoryHelper.GetConStr(conStr); return dbConnection; } private static void InitModelType() { var assemblies = AppDomain.CurrentDomain.GetAssemblies().Union(new Assembly[] { Assembly.Load("Coldairarrow.Entity") }); List allTypes = new List(); assemblies.ForEach(aAssembly => { allTypes.AddRange(aAssembly.GetTypes()); }); List types = allTypes .Where(x => x.GetCustomAttribute(typeof(TableAttribute), false) != null && x.FullName.Contains(GlobalSwitch.DefaultEntityNamespace)) .ToList(); types.ForEach(aType => { _modelTypes.Add(aType); _modelTypeMap[GetIdentity(aType)] = aType; }); } private static SynchronizedCollection _modelTypes { get; } = new SynchronizedCollection(); private static ConcurrentDictionary _modelTypeMap { get; } = new ConcurrentDictionary(); private static void AddSet(Type type) { var existsModel = _modelTypes.Where(x => x.Name == type.Name).FirstOrDefault(); if (existsModel != null) { _modelTypes.Remove(existsModel); _modelTypeMap.TryRemove(GetIdentity(existsModel), out Type type1); } _modelTypes.Add(type); _modelTypeMap[GetIdentity(type)] = type; EntityModelCacheKey.ChangeCache(); } private static string GetIdentity(Type type) { StringBuilder builder = new StringBuilder(); builder.Append(type.Name); type.GetProperties().OrderBy(x => x.Name).ForEach(aProperty => { builder.Append($"{aProperty.Name}{aProperty.PropertyType.FullName}"); }); return builder.ToString().ToMD5String(); } #endregion } public class EntityModelCacheKey : IDbModelCacheKey { public static void ChangeCache() { _hashCode = Guid.NewGuid().ToString().GetHashCode(); } private static int _hashCode { get; set; } = Guid.NewGuid().ToString().GetHashCode(); public override bool Equals(object other) { if (other == null) return false; return other.GetHashCode() == _hashCode; } public override int GetHashCode() { return _hashCode; } } public class EntityFrameworkConfiguration : DbConfiguration { public EntityFrameworkConfiguration() { SetModelCacheKey(ctx => new EntityModelCacheKey()); } } } ================================================ FILE: src/Coldairarrow.DataRepository/DbFactory.cs ================================================ using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Data.Entity; namespace Coldairarrow.DataRepository { /// /// 数据库工厂 /// public class DbFactory { #region 构造函数 static DbFactory() { _dbrepositoryContainer = new IocHelper(); _dbrepositoryContainer.RegisterType(DatabaseType.SqlServer.ToString()); _dbrepositoryContainer.RegisterType(DatabaseType.MySql.ToString()); _dbrepositoryContainer.RegisterType(DatabaseType.PostgreSql.ToString()); _dbrepositoryContainer.RegisterType(DatabaseType.Oracle.ToString()); } #endregion #region 内部成员 private static IocHelper _dbrepositoryContainer { get; } #endregion #region 外部接口 /// /// 根据配置文件获取数据库类型,并返回对应的工厂接口 /// /// 初始化参数,可为连接字符串或者DbContext /// public static IRepository GetRepository(Object obj = null, DatabaseType? dbType = null, string entityNamespace = null) { IRepository res = null; DatabaseType _dbType = GetDbType(dbType); Type dbRepositoryType = Type.GetType("Coldairarrow.DataRepository." + DbProviderFactoryHelper.DbTypeToDbTypeStr(_dbType) + "Repository"); List paramters = new List(); void BuildParamters() { if (obj.IsNullOrEmpty()) return; if (obj is DbContext) { paramters.Add(obj); return; } else if (obj is string) { paramters.Add(obj); paramters.Add(entityNamespace); } } BuildParamters(); res = _dbrepositoryContainer.Resolve(_dbType.ToString(), paramters.ToArray()); return res; } /// /// 获取DbType /// /// 数据库类型 /// private static DatabaseType GetDbType(DatabaseType? dbType) { DatabaseType _dbType; if (dbType.IsNullOrEmpty()) { _dbType = GlobalSwitch.DatabaseType; } else _dbType = dbType.Value; return _dbType; } /// /// 根据参数获取数据库的DbContext /// /// 初始化参数,可为连接字符串或者DbContext /// 数据库类型 /// public static DbContext GetDbContext(Object obj, DatabaseType dbType, string entityNamespace) { DbContext dbContext = null; if (obj.IsNullOrEmpty()) { dbContext = new BaseDbContext(null, dbType, entityNamespace); } else { //若参数为字符串 if (obj is String) dbContext = new BaseDbContext((string)obj, dbType, entityNamespace); //若参数为DbContext else if (obj is DbContext) dbContext = (DbContext)Activator.CreateInstance(obj.GetType(), null); else throw new Exception("请传入有效的参数!"); } dbContext.Database.CommandTimeout = 5 * 60; return dbContext; } #endregion } } ================================================ FILE: src/Coldairarrow.DataRepository/IRepository/IRepository.T.cs ================================================ using System; using System.Collections.Generic; using System.Data; using System.Data.Common; using System.Linq; using System.Linq.Expressions; namespace Coldairarrow.DataRepository { public interface IRepository where T : class, new() { #region 事物提交 void BeginTransaction(); bool EndTransaction(); #endregion #region 增加数据 void Insert(T entity); void Insert(List entities); void BulkInsert(List entities); #endregion #region 删除数据 void DeleteAll(); void Delete(string key); void Delete(List keys); void Delete(T entity); void Delete(List entities); void Delete(Expression> condition); #endregion #region 更新数据 void Update(T entity); void Update(List entities); void UpdateAny(T entity, List properties); void UpdateAny(List entities, List properties); void UpdateWhere(Expression> whereExpre, Action set); #endregion #region 查询数据 T GetEntity(params object[] keyValue); List GetList(); IQueryable GetIQueryable(); DataTable GetDataTableWithSql(string sql); DataTable GetDataTableWithSql(string sql, List parameters); List GetListBySql(string sqlStr) where U : class, new(); List GetListBySql(string sqlStr, List param) where U : class, new(); #endregion #region 执行Sql语句 void ExecuteSql(string sql); void ExecuteSql(string sql, List spList); #endregion } } ================================================ FILE: src/Coldairarrow.DataRepository/IRepository/IRepository.cs ================================================ using System; using System.Collections.Generic; using System.Data; using System.Data.Common; using System.Data.Entity; using System.Linq; using System.Linq.Expressions; namespace Coldairarrow.DataRepository { public interface IRepository { #region 数据库连接相关方法 DbContext GetDbContext(); Action HandleSqlLog { set; } #endregion #region 事物提交 /// /// 开始单库事物 /// 注意:若要使用跨库事务,请使用DistributedTransaction /// void BeginTransaction(); bool EndTransaction(); #endregion #region 增加数据 void Insert(T entity) where T : class, new(); void Insert(List entities) where T : class, new(); void BulkInsert(List entities) where T : class, new(); #endregion #region 删除数据 void DeleteAll() where T : class, new(); void Delete(string key) where T : class, new(); void Delete(List keys) where T : class, new(); void Delete(T entity) where T : class, new(); void Delete(List entities) where T : class, new(); void Delete(Expression> condition) where T : class, new(); void Delete_Sql(Expression> condition) where T : class, new(); #endregion #region 更新数据 void Update(T entity) where T : class, new(); void Update(List entities) where T : class, new(); void UpdateAny(T entity, List properties) where T : class, new(); void UpdateAny(List entities, List properties) where T : class, new(); void UpdateWhere(Expression> whereExpre, Action set) where T : class, new(); #endregion #region 查询数据 T GetEntity(params object[] keyValue) where T : class, new(); List GetList() where T : class, new(); IQueryable GetIQueryable() where T : class, new(); IQueryable GetIQueryable(Type type); DataTable GetDataTableWithSql(string sql); DataTable GetDataTableWithSql(string sql, List parameters); List GetListBySql(string sqlStr) where T : class, new(); List GetListBySql(string sqlStr, List parameters) where T : class, new(); #endregion #region 执行Sql语句 void ExecuteSql(string sql); void ExecuteSql(string sql, List parameters); #endregion } } ================================================ FILE: src/Coldairarrow.DataRepository/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Coldairarrow.DataRepository")] [assembly: AssemblyDescription("A Very Helpful DataRepository ClassLibrary")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Coldairarrow")] [assembly: AssemblyProduct("Coldairarrow.DataRepository")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 会使此程序集中的类型 //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 //请将此类型的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("01c93a6b-76c5-4b10-b8b9-2f173b5f9441")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: src/Coldairarrow.DataRepository/Repository/DbRepository.cs ================================================ using Coldairarrow.Util; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Data; using System.Data.Common; using System.Data.Entity; using System.Data.Entity.Core.Objects; using System.Data.Entity.Infrastructure; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Text.RegularExpressions; namespace Coldairarrow.DataRepository { /// /// 描述:数据库仓储基类类 /// 作者:Coldairarrow /// public class DbRepository : IRepository { #region 构造函数 /// /// 构造函数 /// /// 构造参数,可以为数据库连接字符串或者DbContext /// 数据库类型 public DbRepository(Object param, DatabaseType dbType, string entityNamespace) { BuildParam = param; _dbType = dbType; _entityNamespace = entityNamespace; Handle_BuildDbContext = new Func(() => { return DbFactory.GetDbContext(BuildParam, _dbType, _entityNamespace); }); _db = Handle_BuildDbContext?.Invoke(); _connectionString = _db.Database.Connection.ConnectionString; IsDisposed = false; } #endregion #region 拥有成员 /// /// 连接字符串 /// protected string _connectionString { get; } /// /// 数据库类型 /// private DatabaseType _dbType { get; set; } /// /// 连接上下文DbContext /// private DbContext _db { get; set; } /// /// 建造DbConText所需参数 /// private Object BuildParam { get; set; } /// /// 实体命名空间 /// private string _entityNamespace { get; set; } /// /// 标记DbContext是否已经释放 /// protected bool IsDisposed { get; set; } /// /// 判断是否开始事物 /// protected DbContextTransaction Transaction { get; set; } protected DbContext Db { get { if (IsDisposed) { _db = Handle_BuildDbContext?.Invoke(); IsDisposed = false; } return _db; } set { _db = value; } } protected static PropertyInfo GetKeyProperty() { return GetKeyPropertys().FirstOrDefault(); } protected static List GetKeyPropertys() { var properties = typeof(T) .GetProperties() .Where(x => x.GetCustomAttributes(true).Select(o => o.GetType().FullName).Contains(typeof(KeyAttribute).FullName)) .ToList(); return properties; } protected static string GetDbTableName() { string tableName = string.Empty; var tableAttribute = typeof(T).GetCustomAttribute(); if (tableAttribute != null) tableName = tableAttribute.Name; else tableName = typeof(T).Name; return tableName; } protected static ObjectQuery GetObjectQueryFromDbQueryable(IQueryable query) { var internalQueryField = query.GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance).Where(f => f.Name.Equals("_internalQuery")).FirstOrDefault(); var internalQuery = internalQueryField.GetValue(query); var objectQueryField = internalQuery.GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance).Where(f => f.Name.Equals("_objectQuery")).FirstOrDefault(); return objectQueryField.GetValue(internalQuery) as ObjectQuery; } private void CheckEntityState(T entity) where T : class { if (Db.Entry(entity).State == EntityState.Detached) { var objectContext = ((IObjectContextAdapter)Db).ObjectContext; var entitySet = objectContext.CreateObjectSet(); var entityKey = objectContext.CreateEntityKey(entitySet.EntitySet.Name, entity); object foundSet; bool exists = objectContext.TryGetObjectByKey(entityKey, out foundSet); if (exists) { objectContext.Detach(foundSet); //从上下文中移除 } } } #endregion #region 事件处理 Func Handle_BuildDbContext { get; set; } #endregion #region 事物相关 /// /// 是否开启事务,单库事务 /// protected bool _openedTransaction { get; set; } = false; /// /// 需要执行的Sql事务 /// protected Action _sqlTransaction { get; set; } /// /// 提交到数据库 /// protected void Commit() { //若未开启事物则直接提交到数据库 if (!_openedTransaction) { Db.SaveChanges(); Db.Dispose(); IsDisposed = true; } } /// /// 释放数据,初始化状态 /// protected void Dispose() { Transaction?.Dispose(); Db?.Dispose(); IsDisposed = true; _openedTransaction = false; _sqlTransaction = null; } /// /// 开始单库事物 /// 注意:若要使用跨库事务,请使用DistributedTransaction /// public void BeginTransaction() { Transaction = Db.Database.BeginTransaction(); _openedTransaction = true; } /// /// 结束事物提交 /// public bool EndTransaction() { bool isOK = true; try { _sqlTransaction?.Invoke(); Db.SaveChanges(); Transaction.Commit(); } catch { Transaction.Rollback(); isOK = false; } finally { Dispose(); } return isOK; } #endregion #region 数据库连接相关方法 /// /// 获取DbContext /// /// public DbContext GetDbContext() { return Db; } public Action HandleSqlLog { set { Db.Database.Log = value; } } #endregion #region 增加数据 /// /// 插入数据 /// /// 实体类型 /// 实体 public void Insert(T entity) where T : class, new() { Db.Entry(entity).State = EntityState.Added; Commit(); } /// /// 插入数据列表 /// /// 实体类型 /// 实体列表 public void Insert(List entities) where T : class, new() { Db.Set().AddRange(entities); Commit(); } /// /// 使用Bulk批量插入数据(适合大数据量,速度非常快) /// /// 实体类型 /// 数据 public virtual void BulkInsert(List entities) where T : class, new() { } #endregion #region 删除数据 /// /// 删除表中所有数据 /// /// 实体 public virtual void DeleteAll() where T : class, new() { TableAttribute tableAttribute = typeof(T).GetCustomAttributes(typeof(TableAttribute), true).FirstOrDefault() as TableAttribute; string tableName = tableAttribute.Name; string sql = $"DELETE {tableName}"; ExecuteSql(sql); } /// /// 删除一条数据 /// /// 实体类型 /// 主键值 public void Delete(string key) where T : class, new() { T newData = new T(); var theProperty = GetKeyProperty(); if (theProperty == null) throw new Exception("该实体没有主键标识!请使用[Key]标识主键!"); var value = Convert.ChangeType(key, theProperty.PropertyType); theProperty.SetValue(newData, value); Delete(newData); } /// /// 删除多条数据 /// /// 实体类型 /// 主键列表 public void Delete(List keys) where T : class, new() { var theProperty = GetKeyProperty(); if (theProperty == null) throw new Exception("该实体没有主键标识!请使用[Key]标识主键!"); List deleteList = new List(); keys.ForEach(aKey => { T newData = new T(); var value = Convert.ChangeType(aKey, theProperty.PropertyType); theProperty.SetValue(newData, value); deleteList.Add(newData); }); Delete(deleteList); } /// /// 删除一条数据 /// /// 实体类型 /// 实体对象 public void Delete(T entity) where T : class, new() { CheckEntityState(entity); Db.Set().Attach(entity); Db.Set().Remove(entity); Commit(); } /// /// 删除多条数据 /// /// 实体类型 /// 数据列表 public void Delete(List entities) where T : class, new() { foreach (var entity in entities) { CheckEntityState(entity); Db.Set().Attach(entity); Db.Set().Remove(entity); } Commit(); } /// /// 通过条件删除数据 /// /// 实体类型 /// 条件 public void Delete(Expression> condition) where T : class, new() { var deleteList = GetIQueryable().Where(condition).ToList(); Delete(deleteList); } /// /// 通过条件删除数据 /// /// 实体类型 /// 条件 public virtual void Delete_Sql(Expression> condition) where T : class, new() { var objectQuery = GetObjectQueryFromDbQueryable(GetIQueryable().Where(condition)); string querySTr = objectQuery.ToTraceString(); string parttern = "^SELECT.*?FROM.*?AS(.*?)WHERE.*?$"; var match = Regex.Match(querySTr, parttern, RegexOptions.Singleline); string extent1 = match.Groups[1].ToString(); parttern = "^SELECT.*?(FROM.*?AS.*?WHERE.*?$)"; match = Regex.Match(querySTr, parttern, RegexOptions.Singleline); string fromSql = match.Groups[1].ToString(); string deleteSql = $"DELETE {extent1} {fromSql}"; List dbParamters = new List(); objectQuery.Parameters.ToList().ForEach(aParamter => { var parameter = DbProviderFactoryHelper.GetDbParameter(_dbType); parameter.ParameterName = aParamter.Name; parameter.Value = aParamter.Value ?? DBNull.Value; dbParamters.Add(parameter); }); ExecuteSql(deleteSql, dbParamters); } #endregion #region 更新数据 /// /// 默认更新一个实体,所有字段 /// /// /// public void Update(T entity) where T : class, new() { CheckEntityState(entity); Db.Entry(entity).State = EntityState.Modified; Commit(); } /// /// 默认更新实体列表,所有字段 /// /// /// public void Update(List entities) where T : class, new() { entities.ForEach(aEntity => { CheckEntityState(aEntity); Db.Entry(aEntity).State = EntityState.Modified; }); Commit(); } /// /// 更新一条数据,某些属性 /// /// 实体类型 /// 实体对象 /// 需要更新的字段 public void UpdateAny(T entity, List properties) where T : class, new() { CheckEntityState(entity); Db.Set().Attach(entity); properties.ForEach(aProperty => { Db.Entry(entity).Property(aProperty).IsModified = true; }); Commit(); } /// /// 更新多条数据,某些属性 /// /// 实体类型 /// 数据列表 /// 需要更新的字段 public void UpdateAny(List entities, List properties) where T : class, new() { entities.ForEach(aEntity => { CheckEntityState(aEntity); Db.Set().Attach(aEntity); properties.ForEach(aProperty => { Db.Entry(aEntity).Property(aProperty).IsModified = true; }); }); Commit(); } /// /// 指定条件更新 /// /// 实体类型 /// 筛选表达式 /// 更改属性回调 public void UpdateWhere(Expression> whereExpre, Action set) where T : class, new() { var list = GetIQueryable().Where(whereExpre).ToList(); list.ForEach(aData => set(aData)); Update(list); } #endregion #region 查询数据 /// /// 获取实体 /// /// 实体类型 /// 主键 /// public T GetEntity(params object[] keyValue) where T : class, new() { return Db.Set().Find(keyValue); } /// /// 获取表的所有数据,当数据量很大时不要使用! /// /// 实体类型 /// public List GetList() where T : class, new() { return GetIQueryable().ToList(); } /// /// 获取实体对应的表,延迟加载,主要用于支持Linq查询操作 /// 注意:无缓存 /// /// 实体类型 /// public IQueryable GetIQueryable() where T : class, new() { return GetIQueryable(typeof(T)) as IQueryable; } public IQueryable GetIQueryable(Type type) { if(BaseDbContext.NeedReloadDb(type)) Db = Handle_BuildDbContext?.Invoke(); return Db.Set(type).AsNoTracking(); } /// /// 通过Sql语句获取DataTable /// /// Sql语句 /// public DataTable GetDataTableWithSql(string sql) { return GetDataTableWithSql(sql, null); } /// /// 通过Sql参数查询返回DataTable /// /// Sql语句 /// 查询参数 /// public DataTable GetDataTableWithSql(string sql, List parameters) { DbProviderFactory dbProviderFactory = DbProviderFactories.GetFactory(Db.Database.Connection); using (DbConnection conn = dbProviderFactory.CreateConnection()) { conn.ConnectionString = _connectionString; if (conn.State != ConnectionState.Open) { conn.Open(); } using (DbCommand cmd = conn.CreateCommand()) { cmd.Connection = conn; cmd.CommandText = sql; cmd.CommandTimeout = 5 * 60; if (parameters != null && parameters?.Count > 0) cmd.Parameters.AddRange(parameters.ToArray()); DbDataAdapter adapter = dbProviderFactory.CreateDataAdapter(); adapter.SelectCommand = cmd; DataSet table = new DataSet(); adapter.Fill(table); cmd.Parameters.Clear(); return table.Tables[0]; } } } /// /// 通过sql返回List /// /// 实体类型 /// sql语句 /// public List GetListBySql(string sqlStr) where T : class, new() { return Db.Database.SqlQuery(sqlStr).ToList(); } /// /// 通过sql返回list /// /// 实体类 /// sql语句 /// 参数 /// public List GetListBySql(string sqlStr, List parameters) where T : class, new() { return Db.Database.SqlQuery(sqlStr, parameters.ToArray()).ToList(); } #endregion #region 执行Sql语句 /// /// 执行Sql语句 /// /// Sql语句 public void ExecuteSql(string sql) { if (!_openedTransaction) { Db.Database.ExecuteSqlCommand(sql); Dispose(); } else { _sqlTransaction += new Action(() => { Db.Database.ExecuteSqlCommand(sql); }); } } /// /// 通过参数执行Sql语句 /// /// Sql语句 public void ExecuteSql(string sql, List parameters) { if (!_openedTransaction) { Db.Database.ExecuteSqlCommand(sql, parameters.ToArray()); Dispose(); } else { _sqlTransaction += new Action(() => { Db.Database.ExecuteSqlCommand(sql, parameters.ToArray()); }); } } #endregion } } ================================================ FILE: src/Coldairarrow.DataRepository/Repository/MySqlRepository.cs ================================================ using Coldairarrow.Util; using MySql.Data.MySqlClient; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Data; using System.Data.Entity; using System.IO; using System.Linq; using System.Linq.Expressions; using System.Text; namespace Coldairarrow.DataRepository { public class MySqlRepository : DbRepository, IRepository { #region 构造函数 /// /// 构造函数 /// public MySqlRepository() : base(null, DatabaseType.MySql, null) { } /// /// 构造函数 /// /// 数据库连接名 public MySqlRepository(string conStr) : base(conStr, DatabaseType.MySql, null) { } /// /// 构造函数 /// /// 数据库连接名 /// 实体命名空间 public MySqlRepository(string conStr, string entityNamespace) : base(conStr, DatabaseType.MySql, entityNamespace) { } /// /// 构造函数 /// /// 数据库连接上下文 public MySqlRepository(DbContext dbContext) : base(dbContext, DatabaseType.MySql, null) { } #endregion #region 插入数据 /// /// 使用Bulk批量插入数据(适合大数据量,速度非常快) /// /// 实体类型 /// 数据 public override void BulkInsert(List entities) { DataTable dt = entities.ToDataTable(); using (MySqlConnection conn=new MySqlConnection()) { conn.ConnectionString = _connectionString; if (conn.State != ConnectionState.Open) { conn.Open(); } string tableName = string.Empty; var tableAttribute = typeof(T).GetCustomAttributes(typeof(TableAttribute), true).FirstOrDefault(); if (tableAttribute != null) tableName = ((TableAttribute)tableAttribute).Name; else tableName = typeof(T).Name; int insertCount = 0; string tmpPath = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString() + "_" + Guid.NewGuid().ToString() + ".tmp"); string csv = dt.ToCsvStr(); File.WriteAllText(tmpPath, csv, Encoding.UTF8); using (MySqlTransaction tran = conn.BeginTransaction()) { MySqlBulkLoader bulk = new MySqlBulkLoader(conn) { FieldTerminator = ",", FieldQuotationCharacter = '"', EscapeCharacter = '"', LineTerminator = "\r\n", FileName = tmpPath, NumberOfLinesToSkip = 0, TableName = tableName, }; try { bulk.Columns.AddRange(dt.Columns.Cast().Select(colum => colum.ColumnName).ToList()); insertCount = bulk.Load(); tran.Commit(); } catch (MySqlException ex) { if (tran != null) tran.Rollback(); throw ex; } } File.Delete(tmpPath); } } public override void Delete_Sql(Expression> condition) { Delete(condition); } #endregion } } ================================================ FILE: src/Coldairarrow.DataRepository/Repository/OracleRepository.cs ================================================ using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq.Expressions; namespace Coldairarrow.DataRepository { public class OracleRepository : DbRepository, IRepository { #region 构造函数 /// /// 构造函数 /// public OracleRepository() : base(null, DatabaseType.Oracle, null) { } /// /// 构造函数 /// /// 数据库连接名 public OracleRepository(string conStr) : base(conStr, DatabaseType.Oracle, null) { } /// /// 构造函数 /// /// 数据库连接名 /// 实体命名空间 public OracleRepository(string conStr, string entityNamespace) : base(conStr, DatabaseType.Oracle, entityNamespace) { } /// /// 构造函数 /// /// 数据库连接上下文 public OracleRepository(DbContext dbContext) : base(dbContext, DatabaseType.Oracle, null) { } #endregion #region 插入数据 /// /// 使用Bulk批量插入数据(适合大数据量,速度非常快) /// /// 实体类型 /// 数据 public override void BulkInsert(List entities) { throw new Exception("抱歉!暂不支持Oracle!"); } public override void Delete_Sql(Expression> condition) { Delete(condition); } #endregion } } ================================================ FILE: src/Coldairarrow.DataRepository/Repository/PostgreSqlRepository.cs ================================================ using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq.Expressions; namespace Coldairarrow.DataRepository { public class PostgreSqlRepository : DbRepository, IRepository { #region 构造函数 /// /// 构造函数 /// public PostgreSqlRepository() : base(null, DatabaseType.PostgreSql, null) { } /// /// 构造函数 /// /// 数据库连接名 public PostgreSqlRepository(string conStr) : base(conStr, DatabaseType.PostgreSql, null) { } /// /// 构造函数 /// /// 数据库连接名 /// 实体命名空间 public PostgreSqlRepository(string conStr, string entityNamespace) : base(conStr, DatabaseType.PostgreSql, entityNamespace) { } /// /// 构造函数 /// /// 数据库连接上下文 public PostgreSqlRepository(DbContext dbContext) : base(dbContext, DatabaseType.PostgreSql, null) { } #endregion #region 插入数据 /// /// 使用Bulk批量插入数据(适合大数据量,速度非常快) /// /// 实体类型 /// 数据 public override void BulkInsert(List entities) { throw new Exception("抱歉!暂不支持PostgreSql!"); } public override void Delete_Sql(Expression> condition) { Delete(condition); } #endregion } } ================================================ FILE: src/Coldairarrow.DataRepository/Repository/SqlServerRepository.cs ================================================ using Coldairarrow.Util; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Data; using System.Data.Entity; using System.Data.SqlClient; using System.Linq; namespace Coldairarrow.DataRepository { public class SqlServerRepository : DbRepository, IRepository { #region 构造函数 /// /// 构造函数 /// public SqlServerRepository() : base(null, DatabaseType.SqlServer, null) { } /// /// 构造函数 /// /// 数据库连接名 public SqlServerRepository(string conStr) : base(conStr, DatabaseType.SqlServer, null) { } /// /// 构造函数 /// /// 数据库连接名 /// 实体命名空间 public SqlServerRepository(string conStr, string entityNamespace) : base(conStr, DatabaseType.SqlServer, entityNamespace) { } /// /// 构造函数 /// /// 数据库连接上下文 public SqlServerRepository(DbContext dbContext) : base(dbContext, DatabaseType.SqlServer, null) { } #endregion #region 插入数据 /// /// 使用Bulk批量插入数据(适合大数据量,速度非常快) /// /// 实体类型 /// 数据 public override void BulkInsert(List entities) { using (SqlConnection conn = new SqlConnection()) { conn.ConnectionString = _connectionString; if (conn.State != ConnectionState.Open) { conn.Open(); } string tableName = string.Empty; var tableAttribute = typeof(T).GetCustomAttributes(typeof(TableAttribute), true).FirstOrDefault(); if (tableAttribute != null) tableName = ((TableAttribute)tableAttribute).Name; else tableName = typeof(T).Name; SqlBulkCopy sqlBC = new SqlBulkCopy(conn) { BatchSize = 100000, BulkCopyTimeout = 0, DestinationTableName = tableName }; using (sqlBC) { sqlBC.WriteToServer(entities.ToDataTable()); } } } #endregion } } ================================================ FILE: src/Coldairarrow.DataRepository/Transaction/DistributedTransaction.cs ================================================ using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Reflection; namespace Coldairarrow.DataRepository { /// /// 数据库分布式事务,跨库事务 /// public class DistributedTransaction { #region 构造函数 /// /// 构造函数 /// /// 第一个数据仓储 /// 第二个数据仓储 /// 其它数据仓储 public DistributedTransaction(IRepository one, IRepository two, params IRepository[] others) { if (one == null || two == null) throw new Exception("参数不能为null!"); _repositorys = others.Concat(new IRepository[] { one, two }).Distinct().ToList(); } #endregion #region 内部成员 private Dictionary _successDic { get; } = new Dictionary(); private List _repositorys { get; } private void SetProperty(object obj, string propertyName, object value) { obj.GetType().GetProperty(propertyName, BindingFlags.NonPublic | BindingFlags.Instance).SetValue(obj, value); } private object GetProperty(object obj, string propertyName) { return obj.GetType().GetProperty(propertyName, BindingFlags.NonPublic | BindingFlags.Instance).GetValue(obj); } #endregion #region 外部接口 /// /// 开始事务 /// public void BeginTransaction() { _repositorys.ForEach(aRepository => { _successDic.Add(aRepository, null); (aRepository as DbRepository).BeginTransaction(); SetProperty(aRepository, "_openedTransaction", true); }); } /// /// 结束事务 /// /// 是否成功完成 public bool EndTransaction() { bool isOK = true; foreach (var aRepository in _repositorys) { try { aRepository.GetDbContext().SaveChanges(); Action _sqlTransaction = GetProperty(aRepository, "_sqlTransaction") as Action; _sqlTransaction?.Invoke(); _successDic[aRepository] = true; } catch { _successDic[aRepository] = false; isOK = false; break; } } _repositorys.ForEach(aRepository => { var transaction = GetProperty(aRepository, "Transaction") as DbContextTransaction; bool? success = _successDic[aRepository]; if (isOK) transaction.Commit(); else { if (success != null) transaction.Rollback(); } //释放初始化 aRepository.GetType().GetMethod("Dispose", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(aRepository, null); }); return isOK; } #endregion } } ================================================ FILE: src/Coldairarrow.DataRepository/app.config ================================================ 
================================================ FILE: src/Coldairarrow.DataRepository/packages.config ================================================  ================================================ FILE: src/Coldairarrow.DataRepository/publishNuget.bat ================================================ @echo off pushd %~dp0 nuget pack 02.Coldairarrow.DataRepository.csproj ================================================ FILE: src/Coldairarrow.Demo/07.Coldairarrow.Demo.csproj ================================================  Debug AnyCPU {BF4AA72C-981B-45FE-830E-36489A759804} Exe Coldairarrow.Demo Coldairarrow.Demo v4.5.2 512 true true AnyCPU true full false bin\Debug\ DEBUG;TRACE prompt 4 AnyCPU pdbonly true bin\Release\ TRACE prompt 4 ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll ..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll {01C93A6B-76C5-4B10-B8B9-2F173B5F9441} 02.Coldairarrow.DataRepository {544fe3ea-46f2-45f7-9574-d4fea111a9c1} 03.Coldairarrow.Entity {7095B12B-7FF2-4B6B-8C6C-654197EDAA34} 01.Coldairarrow.Util ================================================ FILE: src/Coldairarrow.Demo/App.config ================================================ 
================================================ FILE: src/Coldairarrow.Demo/Program.cs ================================================ //using Coldairarrow.DataRepository; //using Coldairarrow.Entity.Base_SysManage; //using Coldairarrow.Entity.DevManage; //using Coldairarrow.Util; //using System; //using System.Collections.Generic; //using System.Linq; //using System.Linq.Expressions; //namespace Coldairarrow.Demo //{ // public class Dev_ProjectDTO : Dev_Project // { // /// // /// 项目经理 // /// // public string ProjectManager { get; set; } // /// // /// 项目类型名 // /// // public string ProjectTypeName { get; set; } // } // class Program // { // /// // /// 查询示例 // /// 使用EF + LINQ + Expression能够满足绝大多数查询需求 // /// 其中核心需要使用IRepository接口中的GetIQueryable // /// 熟练掌握IQueryable的使用,从最基础的查询到进阶的联表查询,到最后高阶的数据权限过滤 // /// IQueryable扮演着核心的角色 // /// 注意Business类中的Service就是IRepository接口,通过GetIQueryable能够获取数据源 // /// // public static void SearchDemo() // { // Pagination pagination = new Pagination(); // var list = GetProjectList(null, null, null, pagination); // Console.WriteLine(list.ToJson()); // } // public static List GetProjectList(string projectName, string projectTypeName, string projectManager, Pagination pagination) // { // var db = DbFactory.GetRepository(); // var where = LinqHelper.True(); // Expression> select = (a, b, c) => new Dev_ProjectDTO // { // ProjectTypeName = b.ProjectTypeName, // ProjectManager = c.RealName // }; // select = select.BuildExtendSelectExpre(); // var q = from a in db.GetIQueryable().AsExpandable() // join b in db.GetIQueryable() on a.ProjectTypeId equals b.ProjectTypeId into ab // from b in ab.DefaultIfEmpty() // join c in db.GetIQueryable() on a.ProjectManagerId equals c.UserId into ac // from c in ac.DefaultIfEmpty() // select @select.Invoke(a, b, c); // if (!projectName.IsNullOrEmpty()) // where = where.And(x => x.ProjectName.Contains(projectName)); // if (!projectTypeName.IsNullOrEmpty()) // where = where.And(x => x.ProjectTypeName.Contains(projectTypeName)); // if (!projectManager.IsNullOrEmpty()) // where = where.And(x => x.ProjectManager.Contains(projectManager)); // return q.Where(where).GetPagination(pagination).ToList(); // } // static void Main(string[] args) // { // SearchDemo(); // Console.WriteLine("完成"); // Console.ReadLine(); // } // } //} ================================================ FILE: src/Coldairarrow.Demo/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Coldairarrow.Demo")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Coldairarrow.Demo")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 会使此程序集中的类型 //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 //请将此类型的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("bf4aa72c-981b-45fe-830e-36489a759804")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: src/Coldairarrow.Demo/packages.config ================================================  ================================================ FILE: src/Coldairarrow.Entity/03.Coldairarrow.Entity.csproj ================================================  Debug AnyCPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1} Library Properties Coldairarrow.Entity Coldairarrow.Entity v4.5.2 512 true full false bin\Debug\ DEBUG;TRACE prompt 4 pdbonly false bin\Release\ TRACE prompt 4 ..\packages\Elasticsearch.Net.6.1.0\lib\net45\Elasticsearch.Net.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll ..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll ..\packages\NEST.6.1.0\lib\net45\Nest.dll ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\Npgsql.4.0.3\lib\net451\Npgsql.dll ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.0\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Threading.Tasks.Extensions.4.5.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll ..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll ================================================ FILE: src/Coldairarrow.Entity/App.config ================================================ 
================================================ FILE: src/Coldairarrow.Entity/Base_SysManage/Base_AppSecret.cs ================================================ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Coldairarrow.Entity.Base_SysManage { /// /// ӦԿ /// [Table("Base_AppSecret")] public class Base_AppSecret { /// /// /// [Key] public String Id { get; set; } /// /// ӦId /// public String AppId { get; set; } /// /// ӦԿ /// public String AppSecret { get; set; } /// /// Ӧ /// public String AppName { get; set; } } } ================================================ FILE: src/Coldairarrow.Entity/Base_SysManage/Base_DatabaseLink.cs ================================================ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Coldairarrow.Entity.Base_SysManage { /// /// ݿ /// [Table("Base_DatabaseLink")] public class Base_DatabaseLink { /// /// /// [Key] public String Id { get; set; } /// /// /// public String LinkName { get; set; } /// /// ַ /// public String ConnectionStr { get; set; } /// /// ݿ /// public String DbType { get; set; } /// /// /// public String SortNum { get; set; } } } ================================================ FILE: src/Coldairarrow.Entity/Base_SysManage/Base_PermissionAppId.cs ================================================ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Coldairarrow.Entity.Base_SysManage { /// /// AppIdȨޱ /// [Table("Base_PermissionAppId")] public class Base_PermissionAppId { /// /// /// [Key] public String Id { get; set; } /// /// AppId /// public String AppId { get; set; } /// /// Ȩֵ /// public String PermissionValue { get; set; } } } ================================================ FILE: src/Coldairarrow.Entity/Base_SysManage/Base_PermissionRole.cs ================================================ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Coldairarrow.Entity.Base_SysManage { /// /// ɫȨޱ /// [Table("Base_PermissionRole")] public class Base_PermissionRole { /// /// ߼ /// [Key] public String Id { get; set; } /// /// ɫId /// public String RoleId { get; set; } /// /// Ȩֵ /// public String PermissionValue { get; set; } } } ================================================ FILE: src/Coldairarrow.Entity/Base_SysManage/Base_PermissionUser.cs ================================================ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Coldairarrow.Entity.Base_SysManage { /// /// ûȨޱ /// [Table("Base_PermissionUser")] public class Base_PermissionUser { /// /// /// [Key] public String Id { get; set; } /// /// ûId /// public String UserId { get; set; } /// /// Ȩ /// public String PermissionValue { get; set; } } } ================================================ FILE: src/Coldairarrow.Entity/Base_SysManage/Base_SysLog.cs ================================================ using Nest; using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Coldairarrow.Entity.Base_SysManage { /// /// ϵͳ־ /// [Table("Base_SysLog")] public class Base_SysLog { /// /// /// [Key] [Keyword] public String Id { get; set; } /// /// ־ /// [Keyword] public String LogType { get; set; } /// /// ־ /// [Keyword] public String LogContent { get; set; } /// /// Աû /// [Keyword] public String OpUserName { get; set; } /// /// ־¼ʱ /// [Keyword] public DateTime? OpTime { get; set; } } } ================================================ FILE: src/Coldairarrow.Entity/Base_SysManage/Base_SysRole.cs ================================================ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Coldairarrow.Entity.Base_SysManage { /// /// ϵͳɫ /// [Table("Base_SysRole")] public class Base_SysRole { /// /// /// [Key] public String Id { get; set; } /// /// ߼ɫId /// public String RoleId { get; set; } /// /// ɫ /// public String RoleName { get; set; } } } ================================================ FILE: src/Coldairarrow.Entity/Base_SysManage/Base_UnitTest.cs ================================================ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Coldairarrow.Entity.Base_SysManage { /// /// ԪԱ /// [Table("Base_UnitTest")] public class Base_UnitTest { /// /// /// [Key] public String Id { get; set; } /// /// UserId /// public String UserId { get; set; } /// /// UserName /// public String UserName { get; set; } /// /// Age /// public Int32? Age { get; set; } } } ================================================ FILE: src/Coldairarrow.Entity/Base_SysManage/Base_User.cs ================================================ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Coldairarrow.Entity.Base_SysManage { /// /// ϵͳû /// [Table("Base_User")] public class Base_User { /// /// /// [Key, Column(Order = 1)] public String Id { get; set; } /// /// ûId,߼ /// public String UserId { get; set; } /// /// û /// public String UserName { get; set; } /// /// /// public String Password { get; set; } /// /// ʵ /// public String RealName { get; set; } /// /// Ա(1ΪУ0ΪŮ) /// public Int32? Sex { get; set; } /// /// /// public DateTime? Birthday { get; set; } } } ================================================ FILE: src/Coldairarrow.Entity/Base_SysManage/Base_UserRoleMap.cs ================================================ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Coldairarrow.Entity.Base_SysManage { /// /// Base_UserRoleMap /// [Table("Base_UserRoleMap")] public class Base_UserRoleMap { /// /// Id /// [Key] public String Id { get; set; } /// /// UserId /// public String UserId { get; set; } /// /// RoleId /// public String RoleId { get; set; } } } ================================================ FILE: src/Coldairarrow.Entity/Base_SysManage/EnumType.cs ================================================ namespace Coldairarrow.Entity.Base_SysManage { /// /// 枚举类型 /// public class EnumType { /// /// 系统日志类型 /// public enum LogType { 系统异常, 系统用户管理, 系统角色管理, 接口密钥管理, } /// /// 系统角色类型 /// public enum RoleType { 超级管理员 = 1 } } } ================================================ FILE: src/Coldairarrow.Entity/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Entity")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Entity")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 会使此程序集中的类型 //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 //请将此类型的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("544fe3ea-46f2-45f7-9574-d4fea111a9c1")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: src/Coldairarrow.Entity/packages.config ================================================  ================================================ FILE: src/Coldairarrow.Fx.Net.Easyui.GitHub.sln ================================================  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27130.2003 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "01.Coldairarrow.Util", "Coldairarrow.Util\01.Coldairarrow.Util.csproj", "{7095B12B-7FF2-4B6B-8C6C-654197EDAA34}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02.Coldairarrow.DataRepository", "Coldairarrow.DataRepository\02.Coldairarrow.DataRepository.csproj", "{01C93A6B-76C5-4B10-B8B9-2F173B5F9441}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03.Coldairarrow.Entity", "Coldairarrow.Entity\03.Coldairarrow.Entity.csproj", "{544FE3EA-46F2-45F7-9574-D4FEA111A9C1}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "04.Coldairarrow.Business", "Coldairarrow.Business\04.Coldairarrow.Business.csproj", "{62858A89-DA3C-4658-8219-580780D435C9}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "05.Coldairarrow.Web", "Coldairarrow.Web\05.Coldairarrow.Web.csproj", "{3CD25499-8291-48BB-9A24-D99BC1675A0D}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "06.Coldairarrow.Console", "Coldairarrow.Console\06.Coldairarrow.Console.csproj", "{78A6219E-EF16-4B0A-9F8B-DF1BED594C70}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "10.Coldairarrow.UnitTests", "Coldairarrow.UnitTests\10.Coldairarrow.UnitTests.csproj", "{9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Debug|Any CPU.Build.0 = Debug|Any CPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Debug|x64.ActiveCfg = Debug|Any CPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Debug|x64.Build.0 = Debug|Any CPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Debug|x86.ActiveCfg = Debug|Any CPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Debug|x86.Build.0 = Debug|Any CPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Release|Any CPU.ActiveCfg = Release|Any CPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Release|Any CPU.Build.0 = Release|Any CPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Release|x64.ActiveCfg = Release|Any CPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Release|x64.Build.0 = Release|Any CPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Release|x86.ActiveCfg = Release|Any CPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34}.Release|x86.Build.0 = Release|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Debug|Any CPU.Build.0 = Debug|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Debug|x64.ActiveCfg = Debug|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Debug|x64.Build.0 = Debug|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Debug|x86.ActiveCfg = Debug|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Debug|x86.Build.0 = Debug|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Release|Any CPU.ActiveCfg = Release|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Release|Any CPU.Build.0 = Release|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Release|x64.ActiveCfg = Release|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Release|x64.Build.0 = Release|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Release|x86.ActiveCfg = Release|Any CPU {01C93A6B-76C5-4B10-B8B9-2F173B5F9441}.Release|x86.Build.0 = Release|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Debug|Any CPU.Build.0 = Debug|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Debug|x64.ActiveCfg = Debug|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Debug|x64.Build.0 = Debug|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Debug|x86.ActiveCfg = Debug|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Debug|x86.Build.0 = Debug|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Release|Any CPU.ActiveCfg = Release|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Release|Any CPU.Build.0 = Release|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Release|x64.ActiveCfg = Release|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Release|x64.Build.0 = Release|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Release|x86.ActiveCfg = Release|Any CPU {544FE3EA-46F2-45F7-9574-D4FEA111A9C1}.Release|x86.Build.0 = Release|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Debug|Any CPU.Build.0 = Debug|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Debug|x64.ActiveCfg = Debug|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Debug|x64.Build.0 = Debug|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Debug|x86.ActiveCfg = Debug|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Debug|x86.Build.0 = Debug|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Release|Any CPU.ActiveCfg = Release|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Release|Any CPU.Build.0 = Release|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Release|x64.ActiveCfg = Release|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Release|x64.Build.0 = Release|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Release|x86.ActiveCfg = Release|Any CPU {62858A89-DA3C-4658-8219-580780D435C9}.Release|x86.Build.0 = Release|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Debug|Any CPU.Build.0 = Debug|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Debug|x64.ActiveCfg = Debug|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Debug|x64.Build.0 = Debug|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Debug|x86.ActiveCfg = Debug|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Debug|x86.Build.0 = Debug|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Release|Any CPU.ActiveCfg = Release|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Release|Any CPU.Build.0 = Release|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Release|x64.ActiveCfg = Release|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Release|x64.Build.0 = Release|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Release|x86.ActiveCfg = Release|Any CPU {3CD25499-8291-48BB-9A24-D99BC1675A0D}.Release|x86.Build.0 = Release|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Debug|Any CPU.Build.0 = Debug|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Debug|x64.ActiveCfg = Debug|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Debug|x64.Build.0 = Debug|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Debug|x86.ActiveCfg = Debug|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Debug|x86.Build.0 = Debug|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Release|Any CPU.ActiveCfg = Release|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Release|Any CPU.Build.0 = Release|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Release|x64.ActiveCfg = Release|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Release|x64.Build.0 = Release|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Release|x86.ActiveCfg = Release|Any CPU {78A6219E-EF16-4B0A-9F8B-DF1BED594C70}.Release|x86.Build.0 = Release|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Debug|Any CPU.Build.0 = Debug|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Debug|x64.ActiveCfg = Debug|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Debug|x64.Build.0 = Debug|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Debug|x86.ActiveCfg = Debug|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Debug|x86.Build.0 = Debug|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Release|Any CPU.ActiveCfg = Release|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Release|Any CPU.Build.0 = Release|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Release|x64.ActiveCfg = Release|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Release|x64.Build.0 = Release|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Release|x86.ActiveCfg = Release|Any CPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5BCE21A4-6BB8-433A-A291-C2CC71949731} EndGlobalSection EndGlobal ================================================ FILE: src/Coldairarrow.UnitTests/10.Coldairarrow.UnitTests.csproj ================================================  Debug AnyCPU {9DECBA8F-60D7-4AA3-9A35-F0A71FB36CDC} Library Properties UnitTests UnitTests v4.5.2 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False UnitTest true full false bin\Debug\ DEBUG;TRACE prompt 4 pdbonly false bin\Release\ TRACE prompt 4 ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll ..\packages\EntityFramework6.Npgsql.3.2.0\lib\net45\EntityFramework6.Npgsql.dll ..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll False ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\Npgsql.4.0.3\lib\net451\Npgsql.dll ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.0\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Threading.Tasks.Extensions.4.5.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll ..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll {62858A89-DA3C-4658-8219-580780D435C9} 04.Coldairarrow.Business {01C93A6B-76C5-4B10-B8B9-2F173B5F9441} 02.Coldairarrow.DataRepository {544FE3EA-46F2-45F7-9574-D4FEA111A9C1} 03.Coldairarrow.Entity {7095B12B-7FF2-4B6B-8C6C-654197EDAA34} 01.Coldairarrow.Util 此项目引用这台计算机上缺少的 NuGet 程序包。使用 NuGet 程序包还原可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 ================================================ FILE: src/Coldairarrow.UnitTests/App.config ================================================ 
================================================ FILE: src/Coldairarrow.UnitTests/Base_SysManage/Base_BusinessTests.cs ================================================ using Coldairarrow.Business; using Coldairarrow.DataRepository; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; using System.Data.Common; using System.Data.SqlClient; using System.Linq; namespace Coldairarrow.UnitTests { [TestClass] public class Base_BusinessTests { #region 构造函数 static Base_BusinessTests() { for (int i = 1; i <= 100; i++) { Base_UnitTest newData = new Base_UnitTest { Id = Guid.NewGuid().ToString(), Age = i, UserId = "Admin" + i, UserName = "超级管理员" + i }; _dataList.Add(newData); } } public Base_BusinessTests() { _baseBus.DeleteAll(); } #endregion #region 私有成员 private BaseBusiness _baseBus { get; } = new BaseBusiness(); private static Base_UnitTest _newData { get; } = new Base_UnitTest { Id = Guid.NewGuid().ToString(), UserId = "Admin", UserName = "超级管理员", Age = 22 }; private static List _insertList { get; } = new List { new Base_UnitTest { Id = Guid.NewGuid().ToString(), UserId = "Admin1", UserName = "超级管理员1", Age = 22 }, new Base_UnitTest { Id = Guid.NewGuid().ToString(), UserId = "Admin2", UserName = "超级管理员2", Age = 22 } }; private static List _dataList { get; } = new List(); #endregion #region 测试用例 /// /// 插入数据测试 /// [TestMethod] public void InsertTest() { //单条数据 _baseBus.Insert(_newData); var theData = _baseBus.GetIQueryable().FirstOrDefault(); Assert.AreEqual(_newData.ToJson(), theData.ToJson()); //多条数据 _baseBus.DeleteAll(); _baseBus.Insert(_insertList); var theList = _baseBus.GetList(); Assert.AreEqual(_insertList.OrderBy(X => X.Id).ToJson(), theList.OrderBy(X => X.Id).ToJson()); } /// /// 删除数据测试 /// [TestMethod] public void DeleteTest() { _baseBus.DeleteAll(); //删除表所有数据 _baseBus.Insert(_insertList); _baseBus.DeleteAll(); int count = _baseBus.GetIQueryable().Count(); Assert.AreEqual(0, count); //删除单条数据,对象形式 _baseBus.DeleteAll(); _baseBus.Insert(_newData); _baseBus.Delete(_newData); count = _baseBus.GetIQueryable().Count(); Assert.AreEqual(0, count); //删除单条数据,主键形式 _baseBus.DeleteAll(); _baseBus.Insert(_newData); _baseBus.Delete(_newData.Id); count = _baseBus.GetIQueryable().Count(); Assert.AreEqual(0, count); //删除多条数据 _baseBus.DeleteAll(); _baseBus.Insert(_insertList); _baseBus.Delete(_insertList); count = _baseBus.GetIQueryable().Count(); Assert.AreEqual(0, count); //删除多条数据,主键形式 _baseBus.DeleteAll(); _baseBus.Insert(_insertList); _baseBus.Delete(_insertList.Select(x => x.Id).ToList()); count = _baseBus.GetIQueryable().Count(); Assert.AreEqual(0, count); //删除指定数据 _baseBus.DeleteAll(); _baseBus.Insert(_insertList); _baseBus.Delete(x => x.UserId == "Admin2"); count = _baseBus.GetIQueryable().Count(); Assert.AreEqual(1, count); } /// /// 更新数据测试 /// [TestMethod] public void UpdateTest() { //更新单条数据 _baseBus.DeleteAll(); _baseBus.Insert(_newData); var updateData = _newData.DeepClone(); updateData.UserId = "Admin_Update"; _baseBus.Update(updateData); var dbUpdateData = _baseBus.GetIQueryable().FirstOrDefault(); Assert.AreEqual(updateData.ToJson(), dbUpdateData.ToJson()); //更新多条数据 _baseBus.DeleteAll(); _baseBus.Insert(_insertList); var updateList = _insertList.DeepClone(); updateList[0].UserId = "Admin3"; updateList[1].UserId = "Admin4"; _baseBus.Update(updateList); int count = _baseBus.GetIQueryable().Where(x => x.UserId == "Admin3" || x.UserId == "Admin4").Count(); Assert.AreEqual(2, count); //更新单条数据指定属性 _baseBus.DeleteAll(); _baseBus.Insert(_newData); var newUpdateData = _newData.DeepClone(); newUpdateData.UserName = "普通管理员"; newUpdateData.UserId = "xiaoming"; newUpdateData.Age = 100; _baseBus.UpdateAny(newUpdateData, new List { "UserName", "Age" }); var dbSingleData = _baseBus.GetIQueryable().FirstOrDefault(); newUpdateData.UserId = "Admin"; Assert.AreEqual(newUpdateData.ToJson(), dbSingleData.ToJson()); //更新多条数据指定属性 _baseBus.DeleteAll(); _baseBus.Insert(_insertList); var newList1 = _insertList.DeepClone(); var newList2 = _insertList.DeepClone(); newList1.ForEach(aData => { aData.Age = 100; aData.UserId = "Test"; aData.UserName = "测试"; }); newList2.ForEach(aData => { aData.Age = 100; aData.UserName = "测试"; }); _baseBus.UpdateAny(newList1, new List { "UserName", "Age" }); var dbData = _baseBus.GetList(); Assert.AreEqual(newList2.OrderBy(x => x.Id).ToJson(), dbData.OrderBy(x => x.Id).ToJson()); //更新指定条件数据 _baseBus.DeleteAll(); _baseBus.Insert(_newData); _baseBus.UpdateWhere(x => x.UserId == "Admin", x => { x.UserId = "Admin2"; }); Assert.IsTrue(_baseBus.GetIQueryable().Any(x => x.UserId == "Admin2")); } /// /// 查找数据测试 /// [TestMethod] public void SearchTest() { //GetEntity获取实体 _baseBus.DeleteAll(); _baseBus.Insert(_newData); var theData = _baseBus.GetEntity(_newData.Id); Assert.AreEqual(_newData.ToJson(), theData.ToJson()); //GetList获取表的所有数据 _baseBus.DeleteAll(); _baseBus.Insert(_insertList); var dbList = _baseBus.GetList(); Assert.AreEqual(_insertList.OrderBy(x => x.Id).ToJson(), dbList.OrderBy(x => x.Id).ToJson()); //GetIQueryable获取实体对应的表,延迟加载,主要用于支持Linq查询操作 int count = _baseBus.GetIQueryable().Where(x => x.UserId == "Admin1").Count(); Assert.AreEqual(1, count); //GetIQPagination获取分页后的数据 _baseBus.DeleteAll(); _baseBus.Insert(_dataList); Pagination pagination = new Pagination { SortField = "Age", SortType = "asc", PageIndex = 2, PageRows = 20 }; dbList = _baseBus.GetPagination(_baseBus.GetIQueryable(), pagination); var dataList = _dataList.GetPagination(pagination); Assert.AreEqual(dbList.ToJson(), dataList.ToJson()); //GetIQPagination获取分页后的数据 int pages = 0; dbList = _baseBus.GetPagination(_baseBus.GetIQueryable(), pagination.PageIndex, pagination.PageRows, pagination.SortField, pagination.SortType, ref count, ref pages); Assert.AreEqual(dbList.ToJson(), dataList.ToJson()); //GetDataTableWithSql通过Sql查询返回DataTable _baseBus.DeleteAll(); _baseBus.Insert(_insertList); var table = _baseBus.GetDataTableWithSql("select * from Base_UnitTest order by Id asc"); Assert.AreEqual(_insertList.OrderBy(x => x.Id).ToJson(), table.ToList().OrderBy(x => x.Id).ToJson()); //GetDataTableWithSql通过Sql查询返回DataTable _baseBus.DeleteAll(); _baseBus.Insert(_insertList); List paramters = new List() { new SqlParameter("@userId","Admin1") }; table = _baseBus.GetDataTableWithSql("select * from Base_UnitTest where UserId = @userId", paramters); Assert.AreEqual(_insertList.Where(x => x.UserId == "Admin1").OrderBy(x => x.Id).ToJson(), table.ToList().OrderBy(x => x.Id).ToJson()); //GetListBySql通过sql返回List _baseBus.DeleteAll(); _baseBus.Insert(_insertList); var list = _baseBus.GetListBySql("select * from Base_UnitTest order by Id asc"); Assert.AreEqual(_insertList.OrderBy(x => x.Id).ToJson(), list.OrderBy(x => x.Id).ToJson()); //GetListBySql通过sql返回List _baseBus.DeleteAll(); _baseBus.Insert(_insertList); paramters = new List() { new SqlParameter("@userId","Admin1") }; list = _baseBus.GetListBySql("select * from Base_UnitTest where UserId = @userId", paramters); Assert.AreEqual(_insertList.Where(x => x.UserId == "Admin1").OrderBy(x => x.Id).ToJson(), list.OrderBy(x => x.Id).ToJson()); } /// /// 执行SQL语句测试 /// [TestMethod] public void ExcuteSqlTest() { //ExcuteBySql执行Sql语句 _baseBus.DeleteAll(); _baseBus.Insert(_newData); string sql = "delete from Base_UnitTest"; _baseBus.ExecuteSql(sql); int count = _baseBus.GetIQueryable().Count(); Assert.AreEqual(0, count); //ExcuteBySql通过参数执行Sql语句 _baseBus.DeleteAll(); _baseBus.Insert(_newData); sql = "delete from Base_UnitTest where UserName like '%'+@name+'%'"; SqlParameter parameter = new SqlParameter("@name", "管理员"); _baseBus.ExecuteSql(sql, new List { parameter }); count = _baseBus.GetIQueryable().Count(); Assert.AreEqual(0, count); } /// /// 事务提交测试(单库) /// [TestMethod] public void TransactionTest() { //失败事务 _baseBus.DeleteAll(); _baseBus.BeginTransaction(); _baseBus.Insert(_newData); var newData2 = _newData.DeepClone(); newData2.Id = Guid.NewGuid().ToSequentialGuid(); _baseBus.Insert(newData2); bool succcess = _baseBus.EndTransaction(); Assert.AreEqual(succcess, false); //成功事务 _baseBus.DeleteAll(); _baseBus.BeginTransaction(); var newData = _newData.DeepClone(); newData.Id = Guid.NewGuid().ToString(); newData.UserId = Guid.NewGuid().ToSequentialGuid(); newData.UserName = Guid.NewGuid().ToSequentialGuid(); _baseBus.Insert(_newData); _baseBus.Insert(newData); succcess = _baseBus.EndTransaction(); int count = _baseBus.GetIQueryable().Count(); Assert.AreEqual(succcess, true); Assert.AreEqual(count, 2); } /// /// 分布式事务提交测试(跨库) /// [TestMethod] public void DistributedTransactionTest() { //失败事务 BaseBusiness _bus1 = new BaseBusiness(); BaseBusiness _bus2 = new BaseBusiness("BaseDb_Test"); _bus1.DeleteAll(); _bus2.DeleteAll(); Base_UnitTest data1 = new Base_UnitTest { Id = Guid.NewGuid().ToString(), UserId = "1", UserName = Guid.NewGuid().ToString() }; Base_UnitTest data2 = new Base_UnitTest { Id = Guid.NewGuid().ToString(), UserId = "1", UserName = Guid.NewGuid().ToString() }; Base_UnitTest data3 = new Base_UnitTest { Id = Guid.NewGuid().ToString(), UserId = "2", UserName = Guid.NewGuid().ToString() }; DistributedTransaction distributedTransaction = new DistributedTransaction(_bus1.Service, _bus2.Service); distributedTransaction.BeginTransaction(); _bus1.ExecuteSql("insert into Base_UnitTest(Id) values('10') "); _bus1.Insert(data1); _bus1.Insert(data2); _bus2.Insert(data1); _bus2.Insert(data3); bool succcess = distributedTransaction.EndTransaction(); Assert.AreEqual(succcess, false); //成功事务 distributedTransaction = new DistributedTransaction(_bus1.Service, _bus2.Service); distributedTransaction.BeginTransaction(); _bus1.ExecuteSql("insert into Base_UnitTest(Id) values('10') "); _bus1.Insert(data1); _bus1.Insert(data3); _bus2.Insert(data1); _bus2.Insert(data3); succcess = distributedTransaction.EndTransaction(); int count1 = _bus1.GetIQueryable().Count(); int count2 = _bus2.GetIQueryable().Count(); Assert.AreEqual(succcess, true); Assert.AreEqual(count1, 3); Assert.AreEqual(count2, 2); } #endregion } } ================================================ FILE: src/Coldairarrow.UnitTests/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Coldairarrow.UnitTests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Coldairarrow.UnitTests")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("9decba8f-60d7-4aa3-9a35-f0a71fb36cdc")] // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: InternalsVisibleTo("10.Coldairarrow.UnitTests.Tests")] [assembly: InternalsVisibleTo("Coldairarrow.UnitTests.Explorables")] ================================================ FILE: src/Coldairarrow.UnitTests/UnitTest.cs ================================================ using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; namespace Coldairarrow.UnitTests { [TestClass] public class UnitTest { [TestMethod] public void TestMethod1() { Assert.AreEqual("1", "1"); } } } ================================================ FILE: src/Coldairarrow.UnitTests/packages.config ================================================  ================================================ FILE: src/Coldairarrow.Util/01.Coldairarrow.Util.csproj ================================================  Debug AnyCPU {7095B12B-7FF2-4B6B-8C6C-654197EDAA34} Library Properties Coldairarrow.Util Coldairarrow.Util v4.5.2 512 true full false bin\Debug\ DEBUG;TRACE prompt 4 pdbonly false bin\Release\ TRACE prompt 4 False lib\Aspose.Cells.dll ..\packages\DotNetty.Buffers.0.6.0\lib\net45\DotNetty.Buffers.dll ..\packages\DotNetty.Codecs.0.6.0\lib\net45\DotNetty.Codecs.dll ..\packages\DotNetty.Common.0.6.0\lib\net45\DotNetty.Common.dll ..\packages\DotNetty.Transport.0.6.0\lib\net45\DotNetty.Transport.dll ..\packages\Dynamitey.2.0.9.136\lib\net40\Dynamitey.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll ..\packages\EntityFramework6.Npgsql.3.2.0\lib\net45\EntityFramework6.Npgsql.dll ..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll ..\packages\ImpromptuInterface.7.0.1\lib\net40\ImpromptuInterface.dll ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.1.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll ..\packages\Microsoft.Extensions.Logging.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.dll ..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll ..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll ..\packages\MySql.Data.Entity.6.8.8\lib\net45\MySql.Data.Entity.EF6.dll ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\Npgsql.4.0.3\lib\net451\Npgsql.dll ..\packages\Oracle.ManagedDataAccess.18.3.0\lib\net40\Oracle.ManagedDataAccess.dll ..\packages\Oracle.ManagedDataAccess.EntityFramework.18.3.0\lib\net45\Oracle.ManagedDataAccess.EntityFramework.dll ..\packages\StackExchange.Redis.1.2.4\lib\net45\StackExchange.Redis.dll ..\packages\System.Collections.Immutable.1.5.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll ..\packages\System.Linq.Dynamic.1.0.7\lib\net40\System.Linq.Dynamic.dll ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll ..\packages\System.Threading.Tasks.Extensions.4.5.1\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll ..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll ..\packages\Microsoft.AspNet.WebPages.3.2.6\lib\net45\System.Web.Helpers.dll ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll ..\packages\Microsoft.AspNet.Razor.3.2.6\lib\net45\System.Web.Razor.dll ..\packages\Microsoft.AspNet.WebPages.3.2.6\lib\net45\System.Web.WebPages.dll ..\packages\Microsoft.AspNet.WebPages.3.2.6\lib\net45\System.Web.WebPages.Deployment.dll ..\packages\Microsoft.AspNet.WebPages.3.2.6\lib\net45\System.Web.WebPages.Razor.dll ..\packages\ZXing.Net.0.16.2\lib\net45\zxing.dll ..\packages\ZXing.Net.0.16.2\lib\net45\zxing.presentation.dll Component WindowsService.cs ================================================ FILE: src/Coldairarrow.Util/01.Coldairarrow.Util.nuspec ================================================ $id$ $version$ $title$ $author$ $author$ false A Framework Util Release Test Copyright 2018 ================================================ FILE: src/Coldairarrow.Util/ApiSDK/CTCC_IOT_ApiSDK.cs ================================================ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Security.Cryptography.X509Certificates; namespace Coldairarrow.Util { /// /// 电信IOT物联网平台接口对接SKD /// public class CTCC_IOT_ApiSDK { public CTCC_IOT_ApiSDK(string appId, string appSecret, string apiRootUrl, X509Certificate2 cerFile) { _appId = appId; _appSecret = appSecret; _apiRootUrl = apiRootUrl; _cerFile = cerFile; } private string _appId { get; } private string _appSecret { get; } private string _apiRootUrl { get; } private X509Certificate _cerFile { get; } private KeyValuePair _accessTokenEndTime { get; set; } = new KeyValuePair("1", DateTime.MinValue); private string _accessToken { get { if (DateTime.Now > _accessTokenEndTime.Value) { string resData = GetAccessToken(); JObject obj = JsonConvert.DeserializeObject(resData); string accessToken = obj["accessToken"]?.ToString(); int seconds = (int)obj["expiresIn"] / 2; DateTime endTime = DateTime.Now.AddSeconds(seconds); _accessTokenEndTime = new KeyValuePair(accessToken, endTime); } return _accessTokenEndTime.Key; } } private string GetAccessToken() { string url = $"{_apiRootUrl}/iocm/app/sec/v1.1.0/login"; Dictionary paramters = new Dictionary(); paramters.Add("appId", _appId); paramters.Add("secret", _appSecret); return HttpHelper.PostData(url, paramters, null, ContentType.Form, _cerFile); } /// /// 注册直连设备 /// /// 设备IMEI号码 /// 设备Id public string RegisterDevice(string IMEI) { string url = $"{_apiRootUrl}/iocm/app/reg/v1.2.0/devices?appId={_appId}"; Dictionary headers = new Dictionary(); headers.Add("app_key", _appId); headers.Add("Authorization", $"Bearer {_accessToken}"); Dictionary paramters = new Dictionary(); paramters.Add("appId", _appId); paramters.Add("verifyCode", IMEI); paramters.Add("nodeId", IMEI); paramters.Add("timeout", 0); string resData = HttpHelper.PostData(url, paramters, headers, ContentType.Json, _cerFile); string deviceId = JsonConvert.DeserializeObject(resData)["deviceId"]?.ToString(); UpdateDeviceInfoReqDTO deviceInfo = new UpdateDeviceInfoReqDTO { name = IMEI, deviceType = "CarLock", model = "CarLockNBIOT", protocolType = "CoAP", manufacturerId = "wuxiang", manufacturerName = "wuxiang" }; ChangeDeviceInfo(deviceId, deviceInfo); return deviceId; } /// /// 删除设备 /// /// 设备Id /// public string DeleteDevice(string deviceId) { string url = $"{_apiRootUrl}/iocm/app/dm/v1.1.0/devices/{deviceId}"; Dictionary headers = new Dictionary(); headers.Add("app_key", _appId); headers.Add("Authorization", $"Bearer {_accessToken}"); Dictionary paramters = new Dictionary(); paramters.Add("deviceId", deviceId); paramters.Add("appId", _appId); string resStr = HttpHelper.RequestData(HttpMethod.Delete, url, paramters, headers, ContentType.Json, _cerFile); return resStr; } /// /// 修改设备信息 /// /// 设备ID /// 设备信息 public void ChangeDeviceInfo(string deviceId, UpdateDeviceInfoReqDTO deviceInfo) { string url = $"{_apiRootUrl}/iocm/app/dm/v1.2.0/devices/{deviceId}"; Dictionary headers = new Dictionary(); headers.Add("app_key", _appId); headers.Add("Authorization", $"Bearer {_accessToken}"); HttpHelper.RequestData("PUT", url, JsonConvert.SerializeObject(deviceInfo), "application/json", headers, _cerFile); } public string SubscribeData(string notifyType, string callBackUrl) { string url = $"{_apiRootUrl}/iocm/app/sub/v1.2.0/subscribe"; var data = new { notifyType, callbackurl = callBackUrl }; return RequestData("POST", url, data.ToJson()); } private string RequestData(string method, string url, string body) { Dictionary headers = new Dictionary(); headers.Add("app_key", _appId); headers.Add("Authorization", $"Bearer {_accessToken}"); return HttpHelper.RequestData(method, url, body, "application/json", headers, _cerFile); } public void SendCmd(string deviceId, byte[] bytes) { string url = $"{_apiRootUrl}/iocm/app/cmd/v1.4.0/deviceCommands?appId={_appId}"; Dictionary headers = new Dictionary(); headers.Add("app_key", _appId); headers.Add("Authorization", $"Bearer {_accessToken}"); Dictionary paramters = new Dictionary(); for (int i = 0; i < bytes.Length; i++) { paramters.Add($"Data{i}", bytes[i]); } var reqData = new { deviceId, expireTime = 0, command = new { serviceId = "LockData", method = "Control", paras = paramters } }; HttpHelper.RequestData("POST", url, JsonConvert.SerializeObject(reqData), "application/json", headers, _cerFile); } public void MoveLockUp(string deviceId) { } /// /// 设备信息 /// public class UpdateDeviceInfoReqDTO { /// /// 设备名 /// public string name { get; set; } /// /// 设备类型 /// public string deviceType { get; set; } /// /// 设备型号 /// public string model { get; set; } /// /// 协议类型 /// public string protocolType { get; set; } /// /// 厂商ID /// public string manufacturerId { get; set; } /// /// 厂商名 /// public string manufacturerName { get; set; } /// /// 是否冻结 /// public string mute { get; set; } = "FALSE"; } } } ================================================ FILE: src/Coldairarrow.Util/Cache/CacheHelper.cs ================================================ using System; namespace Coldairarrow.Util { /// /// 缓存帮助类 /// public class CacheHelper { /// /// 静态构造函数,初始化缓存类型 /// static CacheHelper() { SystemCache = new SystemCache(); if (GlobalSwitch.OpenRedisCache) { try { RedisCache = new RedisCache(GlobalSwitch.RedisConfig); } catch { } } switch (GlobalSwitch.CacheType) { case CacheType.SystemCache:Cache = SystemCache;break; case CacheType.RedisCache:Cache = RedisCache;break; default:throw new Exception("请指定缓存类型!"); } } /// /// 默认缓存 /// public static ICache Cache { get; } /// /// 系统缓存 /// public static ICache SystemCache { get; } /// /// Redis缓存 /// public static ICache RedisCache { get; } } } ================================================ FILE: src/Coldairarrow.Util/Cache/ICache.cs ================================================ using System; namespace Coldairarrow.Util { /// /// 缓存操作接口类 /// public interface ICache { #region 设置缓存 /// /// 设置缓存 /// /// 主键 /// 值 void SetCache(string key, object value); /// /// 设置缓存 /// 注:默认过期类型为绝对过期 /// /// 主键 /// 值 /// 过期时间间隔 void SetCache(string key, object value, TimeSpan timeout); /// /// 设置缓存 /// 注:默认过期类型为绝对过期 /// /// 主键 /// 值 /// 过期时间间隔 /// 过期类型 void SetCache(string key, object value, TimeSpan timeout, ExpireType expireType); /// /// 设置键失效时间 /// /// 键值 /// 从现在起时间间隔 void SetKeyExpire(string key, TimeSpan expire); #endregion #region 获取缓存 /// /// 获取缓存 /// /// 主键 object GetCache(string key); /// /// 获取缓存 /// /// 主键 /// 数据类型 T GetCache(string key) where T : class; /// /// 是否存在键值 /// /// 主键 /// bool ContainsKey(string key); #endregion #region 删除缓存 /// /// 清除缓存 /// /// 主键 void RemoveCache(string key); #endregion } #region 类型定义 /// /// 值信息 /// public struct ValueInfoEntry { public string Value { get; set; } public string TypeName { get; set; } public TimeSpan? ExpireTime { get; set; } public ExpireType? ExpireType { get; set; } } /// /// 过期类型 /// public enum ExpireType { /// /// 绝对过期 /// 注:即自创建一段时间后就过期 /// Absolute, /// /// 相对过期 /// 注:即该键未被访问后一段时间后过期,若此键一直被访问则过期时间自动延长 /// Relative, } #endregion } ================================================ FILE: src/Coldairarrow.Util/Cache/RedisCache.cs ================================================ using StackExchange.Redis; using System; namespace Coldairarrow.Util { /// /// Redis缓存 /// public class RedisCache : ICache { /// /// 默认构造函数 /// 注:使用默认配置,即localhost:6379,无密码 /// public RedisCache() { _databaseIndex = 0; string config = "localhost:6379"; _redisConnection = ConnectionMultiplexer.Connect(config); } /// /// 构造函数 /// /// 配置字符串 /// 数据库索引 public RedisCache(string config, int databaseIndex = 0) { _databaseIndex = databaseIndex; _redisConnection = ConnectionMultiplexer.Connect(config); } private ConnectionMultiplexer _redisConnection { get; } private IDatabase _db { get => _redisConnection.GetDatabase(_databaseIndex); } private int _databaseIndex { get; } public bool ContainsKey(string key) { return _db.KeyExists(key); } public object GetCache(string key) { object value = null; var redisValue = _db.StringGet(key); if (!redisValue.HasValue) return null; ValueInfoEntry valueEntry = redisValue.ToString().ToObject(); if (valueEntry.TypeName == typeof(string).AssemblyQualifiedName) value = valueEntry.Value; else value = valueEntry.Value.ToObject(Type.GetType(valueEntry.TypeName)); if (valueEntry.ExpireTime != null && valueEntry.ExpireType == ExpireType.Relative) SetKeyExpire(key, valueEntry.ExpireTime.Value); return value; } public T GetCache(string key) where T : class { return (T)GetCache(key); } public void SetKeyExpire(string key, TimeSpan expire) { _db.KeyExpire(key, expire); } public void RemoveCache(string key) { _db.KeyDelete(key); } public void SetCache(string key, object value) { _SetCache(key, value, null, null); } public void SetCache(string key, object value, TimeSpan timeout) { _SetCache(key, value, timeout, ExpireType.Absolute); } public void SetCache(string key, object value, TimeSpan timeout, ExpireType expireType) { _SetCache(key, value, timeout, expireType); } private void _SetCache(string key, object value, TimeSpan? timeout, ExpireType? expireType) { string jsonStr = string.Empty; if (value is string) jsonStr = value as string; else jsonStr = value.ToJson(); ValueInfoEntry entry = new ValueInfoEntry { Value = jsonStr, TypeName = value.GetType().AssemblyQualifiedName, ExpireTime = timeout, ExpireType = expireType }; string theValue = entry.ToJson(); if (timeout == null) _db.StringSet(key, theValue); else _db.StringSet(key, theValue, timeout); } } } ================================================ FILE: src/Coldairarrow.Util/Cache/SystemCache.cs ================================================ using System; using System.Web; using System.Web.Caching; namespace Coldairarrow.Util { /// /// 系统缓存帮助类 /// public class SystemCache : ICache { public object GetCache(string key) { return HttpRuntime.Cache[key]; } public T GetCache(string key) where T : class { return (T)HttpRuntime.Cache[key]; } public bool ContainsKey(string key) { return GetCache(key) != null; } public void RemoveCache(string key) { HttpRuntime.Cache.Remove(key); } public void SetKeyExpire(string key, TimeSpan expire) { object value = GetCache(key); SetCache(key, value, expire); } public void SetCache(string key, object value) { _SetCache(key, value, null, null); } public void SetCache(string key, object value, TimeSpan timeout) { _SetCache(key, value, timeout, ExpireType.Absolute); } public void SetCache(string key, object value, TimeSpan timeout, ExpireType expireType) { _SetCache(key, value, timeout, expireType); } private void _SetCache(string key, object value, TimeSpan? timeout, ExpireType? expireType) { if (timeout == null) HttpRuntime.Cache[key] = value; else { if (expireType == ExpireType.Absolute) { DateTime endTime = DateTime.Now.AddTicks(timeout.Value.Ticks); HttpRuntime.Cache.Insert(key, value, null, endTime, Cache.NoSlidingExpiration); } else { HttpRuntime.Cache.Insert(key, value, null, Cache.NoAbsoluteExpiration, timeout.Value); } } } } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/BloomFilter.cs ================================================ using System; using System.Collections; using System.Collections.Generic; namespace Coldairarrow.Util { /// /// 一个布隆过滤器 /// /// 泛型数据类型 public class BloomFilter { Random _random; int _bitSize, _numberOfHashes, _setSize; BitArray _bitArray; #region Constructors /// /// 初始化bloom滤波器并设置hash散列的最佳数目 /// /// 布隆过滤器的大小(m)默认为10E消耗100M内存 /// 集合的大小 (n)默认为1000W public BloomFilter(int bitSize=1000000000, int setSize=10000000) { _bitSize = bitSize; _bitArray = new BitArray(bitSize); _setSize = setSize; _numberOfHashes = OptimalNumberOfHashes(_bitSize, _setSize); } //hash散列函数的数量(k) public BloomFilter(int bitSize, int setSize, int numberOfHashes) { _bitSize = bitSize; _bitArray = new BitArray(bitSize); _setSize = setSize; _numberOfHashes = numberOfHashes; } #endregion #region 属性 public int NumberOfHashes { set { _numberOfHashes = value; } get { return _numberOfHashes; } } public int SetSize { set { _setSize = value; } get { return _setSize; } } public int BitSize { set { _bitSize = value; } get { return _bitSize; } } #endregion #region 公共方法 public void Add(T item) { _random = new Random(Hash(item)); for (int i = 0; i < _numberOfHashes; i++) _bitArray[_random.Next(_bitSize)] = true; } public bool Contains(T item) { _random = new Random(Hash(item)); for (int i = 0; i < _numberOfHashes; i++) { if (!_bitArray[_random.Next(_bitSize)]) return false; } return true; } //检查列表中的任何项是否可能是在集合。 //如果布隆过滤器包含列表中的任何一项,返回真 public bool ContainsAny(List items) { foreach (T item in items) { if (Contains(item)) return true; } return false; } //检查列表中的所有项目是否都在集合。 public bool ContainsAll(List items) { foreach (T item in items) { if (!Contains(item)) return false; } return true; } /// /// 计算遇到误检率的概率。 /// /// Probability of a false positive public double FalsePositiveProbability() { return Math.Pow((1 - Math.Exp(-_numberOfHashes * _setSize / (double)_bitSize)), _numberOfHashes); } #endregion #region 私有方法 private int Hash(T item) { return item.GetHashCode(); } //计算基于布隆过滤器散列的最佳数量 private int OptimalNumberOfHashes(int bitSize, int setSize) { return (int)Math.Ceiling((bitSize / setSize) * Math.Log(2.0)); } #endregion } /// /// 共享内存布隆过滤器 /// /// 泛型数据类型 public class BloomFilterWithShareMemory { Random _random; int _bitSize, _numberOfHashes, _setSize; ShareMenmory sm; #region Constructors /// /// 初始化bloom滤波器并设置hash散列的最佳数目 /// /// 布隆过滤器的大小(m)默认为10E消耗100M内存 /// 集合的大小 (n)默认为1000W public BloomFilterWithShareMemory(string bloomName,int bitSize = 1000000000, int setSize = 10000000) { sm = new ShareMenmory(bloomName, 1000000000); _bitSize = bitSize; _setSize = setSize; _numberOfHashes = OptimalNumberOfHashes(_bitSize, _setSize); } #endregion #region 属性 public int NumberOfHashes { set { _numberOfHashes = value; } get { return _numberOfHashes; } } public int SetSize { set { _setSize = value; } get { return _setSize; } } public int BitSize { set { _bitSize = value; } get { return _bitSize; } } #endregion #region 公共方法 public void Add(T item) { _random = new Random(Hash(item)); for (int i = 0; i < _numberOfHashes; i++) { int index = _random.Next(_bitSize); int j=0; int offSet=0; if((index+1) % 8==0) { j = (index + 1) / 8 - 1; } else { j = (index + 1) / 8; offSet = (index + 1) % 8 - 1; } byte[] getData = sm.Read(1, j); BitArray bitArry = new BitArray(getData); bitArry[offSet] = true; int tmp = 0; for (int k = 0; k < 8; k++) { if (bitArry[k] == true) tmp += (int)Math.Pow(2, k); } byte[] setData = new byte[1]; setData[0] = (byte)tmp; sm.Write(setData,j); } } public bool Contains(T item) { _random = new Random(Hash(item)); for (int i = 0; i < _numberOfHashes; i++) { int index = _random.Next(_bitSize); int j = 0; int offSet = 0; if ((index + 1) % 8 == 0) { j = (index + 1) / 8 - 1; } else { j = (index + 1) / 8; offSet = (index + 1) % 8 - 1; } byte[] getData = sm.Read(1, j); BitArray bitArry = new BitArray(getData); if (bitArry[offSet] == false) return false; } return true; } public void close() { sm.Close(); } //检查列表中的任何项是否可能是在集合。 //如果布隆过滤器包含列表中的任何一项,返回真 public bool ContainsAny(List items) { foreach (T item in items) { if (Contains(item)) return true; } return false; } //检查列表中的所有项目是否都在集合。 public bool ContainsAll(List items) { foreach (T item in items) { if (!Contains(item)) return false; } return true; } /// /// 计算遇到误检率的概率。 /// /// Probability of a false positive public double FalsePositiveProbability() { return Math.Pow((1 - Math.Exp(-_numberOfHashes * _setSize / (double)_bitSize)), _numberOfHashes); } #endregion #region 私有方法 private int Hash(T item) { return item.GetHashCode(); } //计算基于布隆过滤器散列的最佳数量 private int OptimalNumberOfHashes(int bitSize, int setSize) { return (int)Math.Ceiling((bitSize / setSize) * Math.Log(2.0)); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/LinqKit/ExpandableQuery.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; using System.Collections; namespace LinqKit { /// /// An IQueryable wrapper that allows us to visit the query's expression tree just before LINQ to SQL gets to it. /// This is based on the excellent work of Tomas Petricek: http://tomasp.net/blog/linq-expand.aspx /// public class ExpandableQuery : IQueryable, IOrderedQueryable, IOrderedQueryable { ExpandableQueryProvider _provider; IQueryable _inner; internal IQueryable InnerQuery { get { return _inner; } } // Original query, that we're wrapping internal ExpandableQuery (IQueryable inner) { _inner = inner; _provider = new ExpandableQueryProvider (this); } Expression IQueryable.Expression { get { return _inner.Expression; } } Type IQueryable.ElementType { get { return typeof (T); } } IQueryProvider IQueryable.Provider { get { return _provider; } } public IEnumerator GetEnumerator () { return _inner.GetEnumerator (); } IEnumerator IEnumerable.GetEnumerator () { return _inner.GetEnumerator (); } public override string ToString () { return _inner.ToString (); } } class ExpandableQueryProvider : IQueryProvider { ExpandableQuery _query; internal ExpandableQueryProvider (ExpandableQuery query) { _query = query; } // The following four methods first call ExpressionExpander to visit the expression tree, then call // upon the inner query to do the remaining work. IQueryable IQueryProvider.CreateQuery (Expression expression) { return new ExpandableQuery (_query.InnerQuery.Provider.CreateQuery (expression.Expand())); } IQueryable IQueryProvider.CreateQuery (Expression expression) { return _query.InnerQuery.Provider.CreateQuery (expression.Expand()); } TResult IQueryProvider.Execute (Expression expression) { return _query.InnerQuery.Provider.Execute (expression.Expand()); } object IQueryProvider.Execute (Expression expression) { return _query.InnerQuery.Provider.Execute (expression.Expand()); } } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/LinqKit/ExpressionExpander.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; using System.Collections.ObjectModel; using System.Reflection; namespace LinqKit { /// /// Custom expresssion visitor for ExpandableQuery. This expands calls to Expression.Compile() and /// collapses captured lambda references in subqueries which LINQ to SQL can't otherwise handle. /// class ExpressionExpander : ExpressionVisitor { // Replacement parameters - for when invoking a lambda expression. Dictionary _replaceVars = null; internal ExpressionExpander () { } private ExpressionExpander (Dictionary replaceVars) { _replaceVars = replaceVars; } protected override Expression VisitParameter (ParameterExpression p) { if ((_replaceVars != null) && (_replaceVars.ContainsKey (p))) return _replaceVars[p]; else return base.VisitParameter (p); } /// /// Flatten calls to Invoke so that Entity Framework can understand it. Calls to Invoke are generated /// by PredicateBuilder. /// protected override Expression VisitInvocation (InvocationExpression iv) { Expression target = iv.Expression; if (target is MemberExpression) target = TransformExpr ((MemberExpression)target); if (target is ConstantExpression) target = ((ConstantExpression)target).Value as Expression; LambdaExpression lambda = (LambdaExpression)target; Dictionary replaceVars; if (_replaceVars == null) replaceVars = new Dictionary (); else replaceVars = new Dictionary (_replaceVars); try { for (int i = 0; i < lambda.Parameters.Count; i++) replaceVars.Add (lambda.Parameters[i], iv.Arguments[i]); } catch (ArgumentException ex) { throw new InvalidOperationException ("Invoke cannot be called recursively - try using a temporary variable.", ex); } return new ExpressionExpander (replaceVars).Visit (lambda.Body); } protected override Expression VisitMethodCall (MethodCallExpression m) { if (m.Method.Name == "Invoke"/* && m.Method.DeclaringType == typeof (Extensions)*/) { Expression target = m.Arguments[0]; if (target is MemberExpression) target = TransformExpr ((MemberExpression)target); if (target is ConstantExpression) target = ((ConstantExpression) target).Value as Expression; LambdaExpression lambda = (LambdaExpression)target; Dictionary replaceVars; if (_replaceVars == null) replaceVars = new Dictionary (); else replaceVars = new Dictionary (_replaceVars); try { for (int i = 0; i < lambda.Parameters.Count; i++) replaceVars.Add (lambda.Parameters[i], m.Arguments[i + 1]); } catch (ArgumentException ex) { throw new InvalidOperationException ("Invoke cannot be called recursively - try using a temporary variable.", ex); } return new ExpressionExpander (replaceVars).Visit (lambda.Body); } // Expand calls to an expression's Compile() method: if (m.Method.Name == "Compile" && m.Object is MemberExpression) { var me = (MemberExpression)m.Object; Expression newExpr = TransformExpr (me); if (newExpr != me) return newExpr; } // Strip out any nested calls to AsExpandable(): if (m.Method.Name == "AsExpandable" /*&& m.Method.DeclaringType == typeof (Extensions)*/) return m.Arguments[0]; return base.VisitMethodCall (m); } protected override Expression VisitMemberAccess (MemberExpression m) { // Strip out any references to expressions captured by outer variables - LINQ to SQL can't handle these: if (m.Member.DeclaringType.Name.StartsWith ("<>")) return TransformExpr (m); return base.VisitMemberAccess (m); } Expression TransformExpr (MemberExpression input) { // Collapse captured outer variables if (input == null || !(input.Member is FieldInfo) || !input.Member.ReflectedType.IsNestedPrivate || !input.Member.ReflectedType.Name.StartsWith ("<>")) // captured outer variable return input; if (input.Expression is ConstantExpression) { object obj = ((ConstantExpression)input.Expression).Value; if (obj == null) return input; Type t = obj.GetType (); if (!t.IsNestedPrivate || !t.Name.StartsWith ("<>")) return input; FieldInfo fi = (FieldInfo)input.Member; object result = fi.GetValue (obj); if (result is Expression) return Visit ((Expression)result); } return input; } } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/LinqKit/ExpressionVisitor.cs ================================================ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; namespace LinqKit { /// /// This comes from Matt Warren's sample: /// http://blogs.msdn.com/mattwar/archive/2007/07/31/linq-building-an-iqueryable-provider-part-ii.aspx /// public abstract class ExpressionVisitor { public virtual Expression Visit (Expression exp) { if (exp == null) return exp; switch (exp.NodeType) { case ExpressionType.Negate: case ExpressionType.NegateChecked: case ExpressionType.Not: case ExpressionType.Convert: case ExpressionType.ConvertChecked: case ExpressionType.ArrayLength: case ExpressionType.Quote: case ExpressionType.TypeAs: return this.VisitUnary ((UnaryExpression)exp); case ExpressionType.Add: case ExpressionType.AddChecked: case ExpressionType.Subtract: case ExpressionType.SubtractChecked: case ExpressionType.Multiply: case ExpressionType.MultiplyChecked: case ExpressionType.Divide: case ExpressionType.Modulo: case ExpressionType.And: case ExpressionType.AndAlso: case ExpressionType.Or: case ExpressionType.OrElse: case ExpressionType.LessThan: case ExpressionType.LessThanOrEqual: case ExpressionType.GreaterThan: case ExpressionType.GreaterThanOrEqual: case ExpressionType.Equal: case ExpressionType.NotEqual: case ExpressionType.Coalesce: case ExpressionType.ArrayIndex: case ExpressionType.RightShift: case ExpressionType.LeftShift: case ExpressionType.ExclusiveOr: return this.VisitBinary ((BinaryExpression)exp); case ExpressionType.TypeIs: return this.VisitTypeIs ((TypeBinaryExpression)exp); case ExpressionType.Conditional: return this.VisitConditional ((ConditionalExpression)exp); case ExpressionType.Constant: return this.VisitConstant ((ConstantExpression)exp); case ExpressionType.Parameter: return this.VisitParameter ((ParameterExpression)exp); case ExpressionType.MemberAccess: return this.VisitMemberAccess ((MemberExpression)exp); case ExpressionType.Call: return this.VisitMethodCall ((MethodCallExpression)exp); case ExpressionType.Lambda: return this.VisitLambda ((LambdaExpression)exp); case ExpressionType.New: return this.VisitNew ((NewExpression)exp); case ExpressionType.NewArrayInit: case ExpressionType.NewArrayBounds: return this.VisitNewArray ((NewArrayExpression)exp); case ExpressionType.Invoke: return this.VisitInvocation ((InvocationExpression)exp); case ExpressionType.MemberInit: return this.VisitMemberInit ((MemberInitExpression)exp); case ExpressionType.ListInit: return this.VisitListInit ((ListInitExpression)exp); default: throw new Exception (string.Format ("Unhandled expression type: '{0}'", exp.NodeType)); } } protected virtual MemberBinding VisitBinding (MemberBinding binding) { switch (binding.BindingType) { case MemberBindingType.Assignment: return this.VisitMemberAssignment ((MemberAssignment)binding); case MemberBindingType.MemberBinding: return this.VisitMemberMemberBinding ((MemberMemberBinding)binding); case MemberBindingType.ListBinding: return this.VisitMemberListBinding ((MemberListBinding)binding); default: throw new Exception (string.Format ("Unhandled binding type '{0}'", binding.BindingType)); } } protected virtual ElementInit VisitElementInitializer (ElementInit initializer) { ReadOnlyCollection arguments = this.VisitExpressionList (initializer.Arguments); if (arguments != initializer.Arguments) { return Expression.ElementInit (initializer.AddMethod, arguments); } return initializer; } protected virtual Expression VisitUnary (UnaryExpression u) { Expression operand = this.Visit (u.Operand); if (operand != u.Operand) { return Expression.MakeUnary (u.NodeType, operand, u.Type, u.Method); } return u; } protected virtual Expression VisitBinary (BinaryExpression b) { Expression left = this.Visit (b.Left); Expression right = this.Visit (b.Right); Expression conversion = this.Visit (b.Conversion); if (left != b.Left || right != b.Right || conversion != b.Conversion) { if (b.NodeType == ExpressionType.Coalesce && b.Conversion != null) return Expression.Coalesce (left, right, conversion as LambdaExpression); else return Expression.MakeBinary (b.NodeType, left, right, b.IsLiftedToNull, b.Method); } return b; } protected virtual Expression VisitTypeIs (TypeBinaryExpression b) { Expression expr = this.Visit (b.Expression); if (expr != b.Expression) { return Expression.TypeIs (expr, b.TypeOperand); } return b; } protected virtual Expression VisitConstant (ConstantExpression c) { return c; } protected virtual Expression VisitConditional (ConditionalExpression c) { Expression test = this.Visit (c.Test); Expression ifTrue = this.Visit (c.IfTrue); Expression ifFalse = this.Visit (c.IfFalse); if (test != c.Test || ifTrue != c.IfTrue || ifFalse != c.IfFalse) { return Expression.Condition (test, ifTrue, ifFalse); } return c; } protected virtual Expression VisitParameter (ParameterExpression p) { return p; } protected virtual Expression VisitMemberAccess (MemberExpression m) { Expression exp = this.Visit (m.Expression); if (exp != m.Expression) { return Expression.MakeMemberAccess (exp, m.Member); } return m; } protected virtual Expression VisitMethodCall (MethodCallExpression m) { Expression obj = this.Visit (m.Object); IEnumerable args = this.VisitExpressionList (m.Arguments); if (obj != m.Object || args != m.Arguments) { return Expression.Call (obj, m.Method, args); } return m; } protected virtual ReadOnlyCollection VisitExpressionList (ReadOnlyCollection original) { List list = null; for (int i = 0, n = original.Count; i < n; i++) { Expression p = this.Visit (original [i]); if (list != null) { list.Add (p); } else if (p != original [i]) { list = new List (n); for (int j = 0; j < i; j++) { list.Add (original [j]); } list.Add (p); } } if (list != null) { return list.AsReadOnly (); } return original; } protected virtual MemberAssignment VisitMemberAssignment (MemberAssignment assignment) { Expression e = this.Visit (assignment.Expression); if (e != assignment.Expression) { return Expression.Bind (assignment.Member, e); } return assignment; } protected virtual MemberMemberBinding VisitMemberMemberBinding (MemberMemberBinding binding) { IEnumerable bindings = this.VisitBindingList (binding.Bindings); if (bindings != binding.Bindings) { return Expression.MemberBind (binding.Member, bindings); } return binding; } protected virtual MemberListBinding VisitMemberListBinding (MemberListBinding binding) { IEnumerable initializers = this.VisitElementInitializerList (binding.Initializers); if (initializers != binding.Initializers) { return Expression.ListBind (binding.Member, initializers); } return binding; } protected virtual IEnumerable VisitBindingList (ReadOnlyCollection original) { List list = null; for (int i = 0, n = original.Count; i < n; i++) { MemberBinding b = this.VisitBinding (original [i]); if (list != null) { list.Add (b); } else if (b != original [i]) { list = new List (n); for (int j = 0; j < i; j++) { list.Add (original [j]); } list.Add (b); } } if (list != null) return list; return original; } protected virtual IEnumerable VisitElementInitializerList (ReadOnlyCollection original) { List list = null; for (int i = 0, n = original.Count; i < n; i++) { ElementInit init = this.VisitElementInitializer (original [i]); if (list != null) { list.Add (init); } else if (init != original [i]) { list = new List (n); for (int j = 0; j < i; j++) { list.Add (original [j]); } list.Add (init); } } if (list != null) return list; return original; } protected virtual Expression VisitLambda (LambdaExpression lambda) { Expression body = this.Visit (lambda.Body); if (body != lambda.Body) { return Expression.Lambda (lambda.Type, body, lambda.Parameters); } return lambda; } protected virtual NewExpression VisitNew (NewExpression nex) { IEnumerable args = this.VisitExpressionList (nex.Arguments); if (args != nex.Arguments) { if (nex.Members != null) return Expression.New (nex.Constructor, args, nex.Members); else return Expression.New (nex.Constructor, args); } return nex; } protected virtual Expression VisitMemberInit (MemberInitExpression init) { NewExpression n = this.VisitNew (init.NewExpression); IEnumerable bindings = this.VisitBindingList (init.Bindings); if (n != init.NewExpression || bindings != init.Bindings) { return Expression.MemberInit (n, bindings); } return init; } protected virtual Expression VisitListInit (ListInitExpression init) { NewExpression n = this.VisitNew (init.NewExpression); IEnumerable initializers = this.VisitElementInitializerList (init.Initializers); if (n != init.NewExpression || initializers != init.Initializers) { return Expression.ListInit (n, initializers); } return init; } protected virtual Expression VisitNewArray (NewArrayExpression na) { IEnumerable exprs = this.VisitExpressionList (na.Expressions); if (exprs != na.Expressions) { if (na.NodeType == ExpressionType.NewArrayInit) { return Expression.NewArrayInit (na.Type.GetElementType (), exprs); } else { return Expression.NewArrayBounds (na.Type.GetElementType (), exprs); } } return na; } protected virtual Expression VisitInvocation (InvocationExpression iv) { IEnumerable args = this.VisitExpressionList (iv.Arguments); Expression expr = this.Visit (iv.Expression); if (args != iv.Arguments || expr != iv.Expression) { return Expression.Invoke (expr, args); } return iv; } } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/LinqKit/Extensions.cs ================================================ using System; using System.Reflection; using System.Collections; using System.Collections.Generic; using System.Text; using System.Runtime.CompilerServices; using System.Linq.Expressions; using System.Linq; namespace LinqKit { /// Refer to http://www.albahari.com/nutshell/linqkit.html and /// http://tomasp.net/blog/linq-expand.aspx for more information. public static class Extensions { public static IQueryable AsExpandable (this IQueryable query) { if (query is ExpandableQuery) return (ExpandableQuery)query; return new ExpandableQuery (query); } public static Expression Expand (this Expression expr) { return (Expression)new ExpressionExpander ().Visit (expr); } public static Expression Expand (this Expression expr) { return new ExpressionExpander ().Visit (expr); } public static TResult Invoke (this Expression> expr) { return expr.Compile ().Invoke (); } public static TResult Invoke (this Expression> expr, T1 arg1) { return expr.Compile ().Invoke (arg1); } public static TResult Invoke (this Expression> expr, T1 arg1, T2 arg2) { return expr.Compile ().Invoke (arg1, arg2); } public static TResult Invoke ( this Expression> expr, T1 arg1, T2 arg2, T3 arg3) { return expr.Compile ().Invoke (arg1, arg2, arg3); } public static TResult Invoke ( this Expression> expr, T1 arg1, T2 arg2, T3 arg3, T4 arg4) { return expr.Compile ().Invoke (arg1, arg2, arg3, arg4); } public static void ForEach (this IEnumerable source, Action action) { foreach (T element in source) action (element); } } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/LinqKit/Linq.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; namespace LinqKit { /// /// Another good idea by Tomas Petricek. /// See http://tomasp.net/blog/dynamic-linq-queries.aspx for information on how it's used. /// public static class Linq { // Returns the given anonymous method as a lambda expression public static Expression> Expr (Expression> expr) { return expr; } // Returns the given anonymous function as a Func delegate public static Func Func (Func expr) { return expr; } } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/ParentChildrenMapping.cs ================================================ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; namespace Coldairarrow.Util { /// /// 父子数据相互映射类 /// 注:父子数据都必须唯一,即所有父键唯一,所有子键唯一,唯一的子键能确定对应的父键,唯一的父键能确定其拥有的子键集合 /// public class ParentChildrenMapping { #region 私有成员 private ConcurrentDictionary _cToP { get; } = new ConcurrentDictionary(); private ConcurrentDictionary> _pToC { get; } = new ConcurrentDictionary>(); #endregion #region 外部接口 /// /// 添加子键 /// /// 所属父键 /// 子键 public void AddChild(string parentId, string childId) { if (string.IsNullOrEmpty(parentId)) throw new Exception("父键不能为Null或空"); if (string.IsNullOrEmpty(childId)) throw new Exception("子键不能为Null或空"); if (_cToP.ContainsKey(childId)) throw new Exception("该子键已存在!"); SynchronizedCollection children = null; if (!_pToC.ContainsKey(parentId)) { children = new SynchronizedCollection(); _pToC[parentId] = children; } else children = _pToC[parentId]; children.Add(childId); _cToP[childId] = parentId; } /// /// 删除子键 /// /// 所属父键 /// 子键 public void RemoveChild(string parentId, string childId) { if (string.IsNullOrEmpty(parentId)) throw new Exception("父键不能为Null或空"); if (string.IsNullOrEmpty(childId)) throw new Exception("子键不能为Null或空"); if (!_pToC.ContainsKey(parentId)) throw new Exception("该父键不存在"); if (!_cToP.ContainsKey(childId)) throw new Exception("该子键不存在"); var children = _pToC[parentId]; if (children == null) throw new Exception("该父键不存在该子键"); if (!children.Remove(childId)) throw new Exception("该父键不存在该子键"); _cToP.TryRemove(childId, out string value); } /// /// 删除父键 /// 注:会删除该父键以及该父键下面的所有子键 /// /// public void RemoveParent(string parentId) { if (string.IsNullOrEmpty(parentId)) throw new Exception("父键不能为Null或空"); if (!_pToC.ContainsKey(parentId)) throw new Exception("父键不存在"); _pToC.TryRemove(parentId, out SynchronizedCollection children); if (children != null) { var enumerator = children.GetEnumerator(); do { _cToP.TryRemove(enumerator.Current, out string value); } while (enumerator.MoveNext()); } } /// /// 父键是否存在 /// /// 父键 /// public bool ExistsParent(string parentId) { if (string.IsNullOrEmpty(parentId)) throw new Exception("父键不能为Null或空"); return _pToC.ContainsKey(parentId); } /// /// 子键是否存在 /// /// 子键 /// public bool ExistsChild(string childId) { if (string.IsNullOrEmpty(childId)) throw new Exception("子键不能为Null或空"); return _cToP.ContainsKey(childId); } /// /// 获取父键拥有的所有子键 /// /// 父键 /// public List GetChildren(string parentId) { if (string.IsNullOrEmpty(parentId)) throw new Exception("父键不能为Null或空"); if (!_pToC.ContainsKey(parentId)) throw new Exception("父键不存在"); return _pToC[parentId]?.ToList() ?? new List(); } /// /// 获取所有父键 /// /// public List GetAllParents() { return _pToC.Keys.ToList(); } /// /// 获取所有子键 /// /// public List GetAllChildren() { return _cToP.Keys.ToList(); } /// /// 获取父键 /// /// 子键 /// public string GetParent(string childId) { if (string.IsNullOrEmpty(childId)) throw new Exception("子键不能为Null或空"); if (!_cToP.ContainsKey(childId)) throw new Exception("该子键不存在"); return _cToP[childId]; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/SerialConnecter/SerialConnecter.cs ================================================ using System; using System.IO.Ports; namespace Coldairarrow.Util.Serial { /// /// 串口通信 /// public class SerialConnecter { #region 构造函数 /// /// 构造函数 /// /// 串口名,列如COM1,COM2等 /// 波特率 /// 数据位 /// 停止位 public SerialConnecter(string portName, int baudRate = 9600, int dataBits = 8, int stopBits = 1) { _sp = new SerialPort { PortName = portName, BaudRate = baudRate, DataBits = dataBits, StopBits = (StopBits)stopBits }; } #endregion #region 内部成员 private SerialPort _sp { get; } #endregion #region 外部接口 /// /// 开始串口 /// public void Start() { try { if (!_sp.IsOpen) { _sp.DataReceived += new SerialDataReceivedEventHandler((a, b) => { int length = _sp.BytesToRead; byte[] buffer = new byte[length]; _sp.Read(buffer, 0, buffer.Length); HandleReceiveData?.BeginInvoke(buffer, null, null); }); _sp.Open(); HandleStarted?.Invoke(); } } catch (Exception ex) { HandleException?.Invoke(ex); } } /// /// 关闭串口 /// public void Stop() { try { _sp.Close(); HandleStopped?.Invoke(); } catch (Exception ex) { HandleException?.Invoke(ex); } } /// /// 发送数据 /// /// public void Send(byte[] bytes) { try { _sp.Write(bytes, 0, bytes.Length); HandleSendData?.Invoke(bytes); } catch (Exception ex) { HandleException?.Invoke(ex); } } /// /// 串口开始后处理事件 /// public Action HandleStarted { get; set; } /// /// 串口停止后处理事件 /// public Action HandleStopped { get; set; } /// /// 回调事件 /// 接收到新的数据 /// public Action HandleReceiveData { get; set; } /// /// 数据发送后处理的事件 /// public Action HandleSendData { get; set; } /// /// 异常处理事件 /// public Action HandleException { get; set; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/ShareMemory.cs ================================================ using System; using System.Reflection; using System.Runtime.InteropServices; namespace Coldairarrow.Util { /// /// 共享内存 /// public class ShareMenmory { #region 导入类库及方法 [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, IntPtr lParam); [DllImport("Kernel32.dll", CharSet = CharSet.Auto)] public static extern IntPtr CreateFileMapping(int hFile, IntPtr lpAttributes, uint flProtect, uint dwMaxSizeHi, uint dwMaxSizeLow, string lpName); [DllImport("Kernel32.dll", CharSet = CharSet.Auto)] public static extern IntPtr OpenFileMapping(int dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, string lpName); [DllImport("Kernel32.dll", CharSet = CharSet.Auto)] public static extern IntPtr MapViewOfFile(IntPtr hFileMapping, uint dwDesiredAccess, uint dwFileOffsetHigh, uint dwFileOffsetLow, uint dwNumberOfBytesToMap); [DllImport("Kernel32.dll", CharSet = CharSet.Auto)] public static extern bool UnmapViewOfFile(IntPtr pvBaseAddress); [DllImport("Kernel32.dll", CharSet = CharSet.Auto)] public static extern bool CloseHandle(IntPtr handle); [DllImport("kernel32", EntryPoint = "GetLastError")] public static extern int GetLastError(); const int ERROR_ALREADY_EXISTS = 183; const int FILE_MAP_COPY = 0x0001; const int FILE_MAP_WRITE = 0x0002; const int FILE_MAP_READ = 0x0004; const int FILE_MAP_ALL_ACCESS = 0x0002 | 0x0004; const int PAGE_READONLY = 0x02; const int PAGE_READWRITE = 0x04; const int PAGE_WRITECOPY = 0x08; const int PAGE_EXECUTE = 0x10; const int PAGE_EXECUTE_READ = 0x20; const int PAGE_EXECUTE_READWRITE = 0x40; const int SEC_COMMIT = 0x8000000; const int SEC_IMAGE = 0x1000000; const int SEC_NOCACHE = 0x10000000; const int SEC_RESERVE = 0x4000000; const int INVALID_HANDLE_VALUE = -1; #endregion IntPtr m_hSharedMemoryFile = IntPtr.Zero; IntPtr m_pwData = IntPtr.Zero;//共享内存地址 public bool m_bAlreadyExist = false; bool m_bInit = false; long m_MemSize = 0; public ShareMenmory(string strName, long lngSize) { if (OpenExists(strName, lngSize) == false) Init(strName, lngSize); } ~ShareMenmory() { Close(); } //初始化内存 public void Init(string strName, long lngSize) { m_MemSize = lngSize; if (strName.Length > 0) { //创建内存共享体(INVALID_HANDLE_VALUE) m_hSharedMemoryFile = CreateFileMapping(INVALID_HANDLE_VALUE, IntPtr.Zero, (uint)PAGE_READWRITE, 0, (uint)lngSize, strName); if (m_hSharedMemoryFile == IntPtr.Zero) { m_bAlreadyExist = false; m_bInit = false; } else { if (GetLastError() == ERROR_ALREADY_EXISTS) //已经创建 { m_bAlreadyExist = true; } else { m_bAlreadyExist = false; } } //创建内存映射 try { m_pwData = MapViewOfFile(m_hSharedMemoryFile, FILE_MAP_WRITE, 0, 0, 0); } catch (Exception e) { Console.WriteLine(e); } if (m_pwData == IntPtr.Zero) { m_bInit = false; CloseHandle(m_hSharedMemoryFile); } else { m_bInit = true; m_bAlreadyExist = true; } } } /// /// 获取共享内存 /// /// 内存名 /// 大小 public bool OpenExists(string mapName, long Size) { try { m_hSharedMemoryFile = OpenFileMapping(0x0002, true, mapName); m_pwData = MapViewOfFile(m_hSharedMemoryFile, 0x0002, 0, 0, (uint)Size); if (m_hSharedMemoryFile == IntPtr.Zero || m_pwData == IntPtr.Zero) return false; m_MemSize = Size; m_bInit = true; m_bAlreadyExist = true; return true; } catch (Exception e) { Console.WriteLine(e); return false; } } //关闭共享内存 public void Close() { if (m_bInit) { UnmapViewOfFile(m_pwData); CloseHandle(m_hSharedMemoryFile); } } /// /// 从共享内存读数据 /// /// 数据长度 /// 指针偏移量 /// public byte[] Read(int lngSize, int ofset) { byte[] bytData = new byte[lngSize]; Marshal.Copy(m_pwData + ofset, bytData, 0, lngSize); return bytData; } /// /// 将数据写入内存中 /// /// 需要写入的数据 /// 目的内存地址偏移量 public void Write(byte[] bytData, int offset) { Marshal.Copy(bytData, 0, m_pwData + offset, bytData.Length); } } /// /// 共享内存之操作泛型实体类 /// /// 泛型参数 public class ShareMenmory { #region 常量 const int ERROR_ALREADY_EXISTS = 183; const int FILE_MAP_COPY = 0x0001; const int FILE_MAP_WRITE = 0x0002; const int FILE_MAP_READ = 0x0004; const int FILE_MAP_ALL_ACCESS = 0x0002 | 0x0004; const int PAGE_READONLY = 0x02; const int PAGE_READWRITE = 0x04; const int PAGE_WRITECOPY = 0x08; const int PAGE_EXECUTE = 0x10; const int PAGE_EXECUTE_READ = 0x20; const int PAGE_EXECUTE_READWRITE = 0x40; const int SEC_COMMIT = 0x8000000; const int SEC_IMAGE = 0x1000000; const int SEC_NOCACHE = 0x10000000; const int SEC_RESERVE = 0x4000000; const int INVALID_HANDLE_VALUE = -1; #endregion IntPtr m_hSharedMemoryFile = IntPtr.Zero;//共享内存空间指针 IntPtr m_pwData = IntPtr.Zero;//共享内存地址 public bool m_bAlreadyExist = false; bool m_bInit = false; long m_MemSize = 0; private int entityLength=0; public ShareMenmory(string strName, long lngSize) { if (OpenExists(strName, lngSize) == false) Init(strName, lngSize); Type t = typeof(T); object obj = Activator.CreateInstance(t); MethodInfo method = t.GetMethod("getLength"); entityLength = (int)method.Invoke(obj, null); } ~ShareMenmory() { Close(); } //初始化内存 public void Init(string strName, long lngSize) { m_MemSize = lngSize; if (strName.Length > 0) { //创建内存共享体(INVALID_HANDLE_VALUE) m_hSharedMemoryFile = ShareMenmory.CreateFileMapping(INVALID_HANDLE_VALUE, IntPtr.Zero, (uint)PAGE_READWRITE, 0, (uint)lngSize, strName); if (m_hSharedMemoryFile == IntPtr.Zero) { m_bAlreadyExist = false; m_bInit = false; } else { if (ShareMenmory.GetLastError() == ERROR_ALREADY_EXISTS) //已经创建 { m_bAlreadyExist = true; } else { m_bAlreadyExist = false; } } //创建内存映射 try { m_pwData = ShareMenmory.MapViewOfFile(m_hSharedMemoryFile, FILE_MAP_WRITE, 0, 0, 0); } catch (Exception e) { Console.WriteLine(e); } if (m_pwData == IntPtr.Zero) { m_bInit = false; ShareMenmory.CloseHandle(m_hSharedMemoryFile); } else { m_bInit = true; m_bAlreadyExist = true; } } } /// /// 获取共享内存 /// /// 内存名 /// 大小 public bool OpenExists(string mapName, long Size) { try { m_hSharedMemoryFile = ShareMenmory.OpenFileMapping(0x0002, true, mapName); m_pwData = ShareMenmory.MapViewOfFile(m_hSharedMemoryFile, 0x0002, 0, 0, (uint)Size); if (m_hSharedMemoryFile == IntPtr.Zero || m_pwData == IntPtr.Zero) return false; m_MemSize = Size; m_bInit = true; m_bAlreadyExist = true; return true; } catch (Exception e) { Console.WriteLine(e); return false; } } //关闭共享内存 public void Close() { if (m_bInit) { ShareMenmory.UnmapViewOfFile(m_pwData); ShareMenmory.CloseHandle(m_hSharedMemoryFile); } } /// /// 从共享内存读数据 /// /// 数据长度 /// 指针偏移量 /// public byte[] Read(int lngSize, int ofset) { byte[] bytData = new byte[lngSize]; Marshal.Copy(m_pwData + ofset, bytData, 0, lngSize); return bytData; } /// /// 将数据写入内存中 /// /// 需要写入的数据 /// 目的内存地址偏移量 public void Write(byte[] bytData, int offset) { Marshal.Copy(bytData, 0, m_pwData + offset, bytData.Length); } /// /// 获取URL /// /// 所需要获取URL的索引序号 /// public string GetUrl(int index) { int offset = 1 + index * (entityLength + 1)+8; return Extention.ToString(Read(200, offset)).Trim(); } /// /// 保存URL /// /// 保存的位置(索引序号) /// URL public void SetUrl(int index, string url) { int offset = 1 + index * (entityLength + 1) + 8; Write(url.ToBytes(), offset); } /// /// 获取状态 /// /// 索引序号 /// public string GetState(int index) { int offset = 1 + index * (entityLength + 1) + entityLength-2; return Extention.ToString(Read(1, offset)); } /// /// 设置状态 /// /// 索引序号 /// 状态(0为未爬取,1为已经爬取) public void SetState(int index,int state) { int offset = 1 + index * (entityLength + 1) + entityLength - 2; Write(state.ToString().ToBytes(),offset); } /// /// 保存实体类 /// /// 索引序号 /// 实体类型 public void SetEntity(int index,T t) { int offset = index*entityLength; Write(t.EntityToJson().ToBytes(), offset); } public T GetEntity(int index) { string str = Extention.ToString(Read(entityLength, index * entityLength)); return str.ToEntity(); } } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Sockets/SendCheckMsg.cs ================================================ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; namespace Coldairarrow.Util.Sockets { class SendCheckMsg { private ConcurrentDictionary> _msgList { get; set; } = new ConcurrentDictionary>(); public EventWaitHandle SendMsg(string connectionId, byte[] sendBytes, Func check, int timeOut) { MsgDto newMsg = new MsgDto { SendBytes = sendBytes, SendTime = DateTime.Now, WaitHandle = new AutoResetEvent(false), Check = check, TimeOut = timeOut }; Task.Run(() => { if (!_msgList.ContainsKey(connectionId)) _msgList.TryAdd(connectionId, new SynchronizedCollection()); var sendList = _msgList[connectionId]; sendList.Add(newMsg); Task.Run(() => { Thread.Sleep(timeOut); sendList.Remove(newMsg); }); }); return newMsg.WaitHandle; } public void RecMsg(string conectionId, byte[] recBytes) { DateTime time = DateTime.Now; if (!_msgList.ContainsKey(conectionId)) return; var sendList = _msgList[conectionId]; var theMsg = sendList.Where(x => x.Check(conectionId, recBytes)).OrderBy(x => x.SendTime).FirstOrDefault(); if (theMsg != null) { theMsg.WaitHandle.Set(); DeleteMsg(conectionId, theMsg); } } private void DeleteMsg(string connectionId, MsgDto msg) { if (!_msgList.ContainsKey(connectionId)) _msgList.TryAdd(connectionId,new SynchronizedCollection()); var sendList = _msgList[connectionId]; sendList.Remove(msg); } class MsgDto { public byte[] SendBytes { get; set; } public DateTime SendTime { get; set; } public EventWaitHandle WaitHandle { get; set; } public Func Check { get; set; } public int TimeOut { get; set; } } } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Sockets/TcpSocketClient.cs ================================================ using System; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; namespace Coldairarrow.Util.Sockets { /// /// TcpSocket客户端 /// public class TcpSocketClient { #region 构造函数 /// /// 构造函数,连接服务器IP地址默认为本机127.0.0.1 /// /// 监听的端口 public TcpSocketClient(int port) { _ip = "127.0.0.1"; _port = port; } /// /// 构造函数 /// /// 监听的IP地址 /// 监听的端口 public TcpSocketClient(string ip, int port) { _ip = ip; _port = port; } #endregion #region 内部成员 private Socket _socket = null; private string _ip = ""; private int _port = 0; private bool _isRec = true; private bool _isClosed = false; /// /// 开始接受客户端消息 /// private void StartRecMsg() { try { byte[] container = new byte[RecLength]; _socket.BeginReceive(container, 0, container.Length, SocketFlags.None, asyncResult => { try { int length = _socket.EndReceive(asyncResult); //马上进行下一轮接受,增加吞吐量 if (length > 0 && _isRec && IsSocketConnected() && (!_isClosed)) StartRecMsg(); if (length > 0) { byte[] recBytes = new byte[length]; Array.Copy(container, 0, recBytes, 0, length); //处理消息 HandleRecMsg?.Invoke(this, recBytes); } else Close(); } catch (Exception ex) { AccessException(ex); Close(); } }, null); } catch (Exception ex) { AccessException(ex); Close(); } } private void AccessException(Exception ex) { if (!(ex is ObjectDisposedException)) { try { HandleException?.Invoke(ex); } catch { } } } #endregion #region 外部接口 /// /// 接收区大小,单位:字节 /// public int RecLength { get; set; } = 1024; ///// ///// 开始服务,连接服务端 ///// //public bool StartClient() //{ // try // { // //实例化 套接字 (ip4寻址协议,流式传输,TCP协议) // _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); // //创建 ip对象 // IPAddress address = IPAddress.Parse(_ip); // //创建网络节点对象 包含 ip和port // IPEndPoint endpoint = new IPEndPoint(address, _port); // //连接服务端 // _socket.Connect(endpoint); // //开始接受服务器消息 // StartRecMsg(); // return true; // } // catch (Exception ex) // { // AccessException(ex); // return false; // } //} /// /// 开始服务,连接服务端 /// public bool StartClient() { try { //实例化 套接字 (ip4寻址协议,流式传输,TCP协议) _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); //创建 ip对象 IPAddress address = IPAddress.Parse(_ip); //创建网络节点对象 包含 ip和port IPEndPoint endpoint = new IPEndPoint(address, _port); //将 监听套接字 绑定到 对应的IP和端口 AutoResetEvent waitEvent = new AutoResetEvent(false); _socket.BeginConnect(endpoint, asyncResult => { try { _socket.EndConnect(asyncResult); //开始接受服务器消息 StartRecMsg(); HandleClientStarted?.Invoke(this); waitEvent.Set(); } catch (Exception ex) { AccessException(ex); ; } }, null); waitEvent.WaitOne(); return true; } catch (Exception ex) { AccessException(ex); return false; } } /// /// 关闭 /// public void StopClient() { _isRec = false; _socket.Close(); _socket.Dispose(); } /// /// 发送数据 /// /// 数据字节 public void Send(byte[] bytes) { try { _socket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, asyncResult => { try { int length = _socket.EndSend(asyncResult); HandleSendMsg?.Invoke(this, bytes); } catch (Exception ex) { AccessException(ex); } }, null); } catch (Exception ex) { AccessException(ex); } } /// /// 发送字符串(默认使用UTF-8编码) /// /// 字符串 public void Send(string msgStr) { Send(Encoding.UTF8.GetBytes(msgStr)); } /// /// 发送字符串(使用自定义编码) /// /// 字符串消息 /// 使用的编码 public void Send(string msgStr, Encoding encoding) { Send(encoding.GetBytes(msgStr)); } /// /// 传入自定义属性 /// public object Property { get; set; } ///// ///// 关闭与服务器的连接 ///// //public void Close() //{ // if (_isClosed) // return; // try // { // _isClosed = true; // _isRec = false; // if (IsSocketConnected()) // { // _socket.Disconnect(false); // } // } // catch (Exception ex) // { // AccessException(ex); // } // finally // { // try // { // _socket?.Dispose(); // HandleClientClose?.Invoke(this); // } // catch (Exception ex) // { // AccessException(ex); // } // } //} /// /// 关闭与服务器的连接 /// public void Close() { if (_isClosed) return; try { _isClosed = true; _isRec = false; _socket.BeginDisconnect(false, asyncCallback => { try { _socket.EndDisconnect(asyncCallback); } catch (Exception ex) { AccessException(ex); ; } finally { _socket.Dispose(); } }, null); } catch (ObjectDisposedException) { } catch (Exception ex) { try { AccessException(ex); ; } catch { } } finally { try { HandleClientClose?.Invoke(this); } catch (Exception ex) { AccessException(ex); ; } } } /// /// 判断是否处于已连接状态 /// /// public bool IsSocketConnected() { return !((_socket.Poll(1000, SelectMode.SelectRead) && (_socket.Available == 0)) || !_socket.Connected); } #endregion #region 事件处理 /// /// 客户端连接建立后回调 /// public Action HandleClientStarted { get; set; } /// /// 处理接受消息的委托 /// public Action HandleRecMsg { get; set; } /// /// 客户端连接发送消息后回调 /// public Action HandleSendMsg { get; set; } /// /// 客户端连接关闭后回调 /// public Action HandleClientClose { get; set; } /// /// 异常处理程序 /// public Action HandleException { get; set; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Sockets/TcpSocketConnection.cs ================================================ using System; using System.Net.Sockets; using System.Text; using System.Threading.Tasks; namespace Coldairarrow.Util.Sockets { /// /// Socket连接,双向通信 /// public class TcpSocketConnection { #region 构造函数 /// /// 构造函数 /// /// 维护的Socket对象 /// 维护此连接的服务对象 /// 接受缓冲区大小 public TcpSocketConnection(Socket socket, TcpSocketServer server, int recLength) { _socket = socket; _server = server; _recLength = recLength; _sendCheckMsg = server.GetPropertyValue("_sendCheckMsg") as SendCheckMsg; } #endregion #region 私有成员 private Socket _socket { get; } private bool _isRec { get; set; } = true; private TcpSocketServer _server { get; set; } = null; private bool _isClosed { get; set; } = false; private string _connectionId { get; set; } = Guid.NewGuid().ToString(); private SendCheckMsg _sendCheckMsg { get; } = new SendCheckMsg(); /// /// 接收区大小,单位:字节 /// private int _recLength { get; set; } private void AccessException(Exception ex) { if (!(ex is ObjectDisposedException)) { try { HandleException?.Invoke(ex); } catch { } } } #endregion #region 外部接口 /// /// 开始接受客户端消息 /// public void StartRecMsg() { try { byte[] container = new byte[_recLength]; _socket.BeginReceive(container, 0, container.Length, SocketFlags.None, asyncResult => { try { int length = _socket.EndReceive(asyncResult); //马上进行下一轮接受,增加吞吐量 if (length > 0 && _isRec && IsSocketConnected() && (!_isClosed)) StartRecMsg(); if (length > 0) { byte[] recBytes = new byte[length]; Array.Copy(container, 0, recBytes, 0, length); HandleRecMsg?.Invoke(_server, this, recBytes); } else Close(); } catch (Exception ex) { AccessException(ex); Close(); } }, null); } catch (Exception ex) { AccessException(ex); Close(); } } /// /// 发送数据 /// /// 数据字节 public void Send(byte[] bytes) { try { _socket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, asyncResult => { try { int length = _socket.EndSend(asyncResult); HandleSendMsg?.Invoke(_server, this, bytes); } catch (Exception ex) { AccessException(ex); } }, null); } catch (Exception ex) { AccessException(ex); } } /// /// 发送字符串(默认使用UTF-8编码) /// /// 字符串 public void Send(string msgStr) { Send(Encoding.UTF8.GetBytes(msgStr)); } /// /// 发送字符串(使用自定义编码) /// /// 字符串消息 /// 使用的编码 public void Send(string msgStr, Encoding encoding) { Send(encoding.GetBytes(msgStr)); } /// /// 发送数据并校验返回结果 /// /// 发送的数据 /// 确认具体确认方法 /// 发送数据到收到确认消息的时间间隔,单位为毫秒 /// public Task SendWithCheck(byte[] bytes, Func check, int timeOut) { Send(bytes); var waitHandle = _sendCheckMsg.SendMsg(ConnectionId, bytes, check, timeOut); return Task.Run(() => { var res = Task.Run(() => { waitHandle.WaitOne(); }).Wait(timeOut); return res; }); } /// /// 连接标识Id /// 注:用于标识与客户端的连接 /// public string ConnectionId { get { return _connectionId; } set { string oldConnectionId = _connectionId; _connectionId = value; _server?.SetConnectionId(this, oldConnectionId, value); } } ///// ///// 关闭当前连接 ///// //public void Close() //{ // if (_isClosed) // return; // try // { // _isClosed = true; // _server.RemoveConnection(this); // _isRec = false; // if (IsSocketConnected()) // { // _socket.Disconnect(false); // } // } // catch (Exception ex) // { // AccessException(ex); // } // finally // { // try // { // _socket?.Dispose(); // HandleClientClose?.Invoke(_server, this); // } // catch (Exception ex) // { // AccessException(ex); // } // } //} /// /// 关闭当前连接 /// public void Close() { if (_isClosed) return; try { _isClosed = true; _server.RemoveConnection(this); _isRec = false; _socket.BeginDisconnect(false, (asyncCallback) => { try { _socket.EndDisconnect(asyncCallback); } catch (Exception ex) { HandleException?.Invoke(ex); } finally { _socket.Dispose(); } }, null); } catch (Exception ex) { HandleException?.Invoke(ex); } finally { try { HandleClientClose?.Invoke(_server, this); } catch (Exception ex) { HandleException?.Invoke(ex); } } } /// /// 判断是否处于已连接状态 /// /// public bool IsSocketConnected() { return !((_socket.Poll(1000, SelectMode.SelectRead) && (_socket.Available == 0)) || !_socket.Connected); } #endregion #region 事件处理 /// /// 客户端连接接受新的消息后调用 /// public Action HandleRecMsg { get; set; } /// /// 客户端连接发送消息后回调 /// public Action HandleSendMsg { get; set; } /// /// 客户端连接关闭后回调 /// public Action HandleClientClose { get; set; } /// /// 异常处理程序 /// public Action HandleException { get; set; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Sockets/TcpSocketServer.cs ================================================ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; namespace Coldairarrow.Util.Sockets { /// /// TcpSocket服务端 /// public class TcpSocketServer { #region 构造函数 /// /// 构造函数 /// /// 监听的IP地址 /// 监听的端口 public TcpSocketServer(string ip, int port) { _ip = ip; _port = port; } /// /// 构造函数,监听IP地址默认为本机0.0.0.0 /// /// 监听的端口 public TcpSocketServer(int port) { _ip = "0.0.0.0"; _port = port; } #endregion #region 内部成员 private Socket _socket { get; set; } = null; private string _ip { get; set; } = ""; private int _port { get; set; } = 0; private bool _isListen { get; set; } = true; private void StartListen() { try { _socket.BeginAccept(asyncResult => { try { Socket newSocket = _socket.EndAccept(asyncResult); //马上进行下一轮监听,增加吞吐量 if (_isListen) StartListen(); TcpSocketConnection newConnection = new TcpSocketConnection(newSocket, this, RecLength) { HandleRecMsg = HandleRecMsg == null ? null : new Action(HandleRecMsg), HandleClientClose = HandleClientClose == null ? null : new Action(HandleClientClose), HandleSendMsg = HandleSendMsg == null ? null : new Action(HandleSendMsg), HandleException = HandleException == null ? null : new Action(HandleException) }; newConnection.HandleRecMsg += new Action((a, b, c) => { _sendCheckMsg.RecMsg(b.ConnectionId, c); }); AddConnection(newConnection); newConnection.StartRecMsg(); HandleNewClientConnected?.Invoke(this, newConnection); } catch (Exception ex) { AccessException(ex); } }, null); } catch (Exception ex) { AccessException(ex); } } private bool PortInUse(int port) { IPGlobalProperties ipProperties = IPGlobalProperties.GetIPGlobalProperties(); return ipProperties.GetActiveTcpListeners().ToList().Exists(x => x.Port == port); } private ConcurrentDictionary _connectionList { get; } = new ConcurrentDictionary(); private SendCheckMsg _sendCheckMsg { get; } = new SendCheckMsg(); private void AccessException(Exception ex) { if (!(ex is ObjectDisposedException)) { try { HandleException?.Invoke(ex); } catch { } } } #endregion #region 外部接口 /// /// 接收区大小,单位:字节 /// public int RecLength { get; set; } = 1024; /// /// 开始服务,监听客户端 /// public void StartServer() { try { //实例化套接字(ip4寻址协议,流式传输,TCP协议) _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); //创建ip对象 IPAddress address = IPAddress.Parse(_ip); //创建网络节点对象包含ip和port IPEndPoint endpoint = new IPEndPoint(address, _port); //将 监听套接字绑定到 对应的IP和端口 _socket.Bind(endpoint); //设置监听队列长度为Int32最大值(同时能够处理连接请求数量) _socket.Listen(int.MaxValue); //开始监听客户端 StartListen(); HandleServerStarted?.Invoke(this); } catch (Exception ex) { AccessException(ex); } } /// /// 停止 /// public void StopServer() { _isListen = false; _socket.Close(); _socket.Dispose(); GetAllConnections().ForEach(aCon => { aCon.Close(); }); } /// /// 设置连接标识Id /// /// 需要设置的连接对象 /// 老的标识 /// 新的标识 public void SetConnectionId(TcpSocketConnection tcpSocketConnection, string oldConnectionId, string newConnectionId) { if (!string.IsNullOrEmpty(oldConnectionId)) _connectionList.TryRemove(oldConnectionId, out TcpSocketConnection theValue); _connectionList[newConnectionId] = tcpSocketConnection; } /// /// 关闭指定客户端连接 /// /// 指定的客户端连接 public void CloseConnection(TcpSocketConnection theConnection) { theConnection.Close(); } /// /// 添加客户端连接 /// /// 需要添加的客户端连接 private void AddConnection(TcpSocketConnection theConnection) { _connectionList[theConnection.ConnectionId] = theConnection; } /// /// 删除指定的客户端连接 /// /// 指定的客户端连接 public void RemoveConnection(TcpSocketConnection theConnection) { if (!string.IsNullOrEmpty(theConnection.ConnectionId)) { var theCon = _connectionList[theConnection.ConnectionId]; if (theCon == theConnection) _connectionList.TryRemove(theConnection.ConnectionId, out TcpSocketConnection theOutValue); } } /// /// 获取客户端连接 /// /// 连接标志Id /// public TcpSocketConnection GetConnection(string connectionId) { return _connectionList[connectionId]; } /// /// 获取所有连接标志Id /// /// public List GetAllConnectionIds() { return _connectionList.Keys.ToList(); } /// /// 获取所有连接 /// /// public List GetAllConnections() { return _connectionList.Values.ToList(); } /// /// 获取客户端连接数 /// /// public int GetConnectionCount() { return _connectionList.Keys.Count; } #endregion #region 公共事件 /// /// 异常处理程序 /// public Action HandleException { get; set; } #endregion #region 服务端事件 /// /// 服务启动后执行 /// public Action HandleServerStarted { get; set; } /// /// 当新客户端连接后执行 /// public Action HandleNewClientConnected { get; set; } #endregion #region 客户端连接事件 /// /// 客户端连接接受新的消息后调用 /// public Action HandleRecMsg { get; set; } /// /// 客户端连接发送消息后回调 /// public Action HandleSendMsg { get; set; } /// /// 客户端连接关闭后回调 /// public Action HandleClientClose { get; set; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Sockets/UdpSocketClient.cs ================================================ using System; using System.Net; using System.Net.Sockets; using System.Text; namespace Coldairarrow.Util.Sockets { /// /// UdpSocket客户端 /// public class UdpSocketClient { #region 构造函数 /// /// 构造函数,指定端口号 /// /// 监听的端口 public UdpSocketClient(int port) { _port = port; } /// /// 构造函数,自动分配端口号 /// public UdpSocketClient() { _udpClient = new UdpClient(0); } #endregion #region 私有成员 private int _port { get; set; } private UdpClient _udpClient { get; set; } private void StartRecMsg() { try { _udpClient.BeginReceive(asyncCallback => { try { IPEndPoint iPEndPoint = null; byte[] bytes = _udpClient.EndReceive(asyncCallback, ref iPEndPoint); StartRecMsg(); HandleRecMsg?.BeginInvoke(this, iPEndPoint, bytes, null, null); } catch (Exception ex) { HandleException?.BeginInvoke(ex, null, null); } }, null); } catch (Exception ex) { HandleException?.BeginInvoke(ex, null, null); } } #endregion #region 外部接口 /// /// 启动服务 /// public void Start() { _udpClient = new UdpClient(_port); StartRecMsg(); HandleStarted?.BeginInvoke(null, null); } /// /// 停止服务 /// public void Stop() { _udpClient.Close(); } /// /// 发送数据 /// /// 数据 /// 目标地址 public void Send(byte[] bytes, IPEndPoint iPEndPoint) { try { _udpClient.BeginSend(bytes, bytes.Length, iPEndPoint, asyncCallback => { try { int length = _udpClient.EndSend(asyncCallback); HandleSendMsg?.BeginInvoke(this, iPEndPoint, bytes, null, null); } catch (Exception ex) { HandleException?.BeginInvoke(ex, null, null); } }, null); } catch (Exception ex) { HandleException?.BeginInvoke(ex, null, null); } } /// /// 发送数据 /// /// 数据(默认UTF-8编码发送) /// 目标地址 public void Send(string msg, IPEndPoint iPEndPoint) { Send(Encoding.UTF8.GetBytes(msg), iPEndPoint); } /// /// 发送数据 /// /// 数据(指定的编码方式) /// 目标地址 /// 指定编码 public void Send(string msg, IPEndPoint iPEndPoint, Encoding encoding) { Send(encoding.GetBytes(msg), iPEndPoint); } #endregion #region 事件处理 /// /// 处理异常 /// public Action HandleException { get; set; } /// /// 处理收到的消息 /// public Action HandleRecMsg { get; set; } /// /// 处理发送的消息 /// public Action HandleSendMsg { get; set; } /// /// 服务启动后调用 /// public Action HandleStarted { get; set; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Sockets/UdpSocketServer.cs ================================================ using System; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading.Tasks; namespace Coldairarrow.Util.Sockets { /// /// UdpSocket服务端 /// public class UdpSocketServer { #region 构造函数 /// /// 构造函数 /// /// 监听的端口 public UdpSocketServer(int port) { _port = port; } #endregion #region 私有成员 private int _port { get; set; } private UdpClient _udpClient { get; set; } private void StartRecMsg() { try { _udpClient.BeginReceive(asyncCallback => { try { IPEndPoint iPEndPoint = null; byte[] bytes = _udpClient.EndReceive(asyncCallback, ref iPEndPoint); StartRecMsg(); HandleRecMsg?.Invoke(this, iPEndPoint, bytes); } catch (Exception ex) { HandleException?.Invoke(ex); } }, null); } catch (Exception ex) { HandleException?.Invoke(ex); } } #endregion #region 外部接口 /// /// 启动服务 /// public void Start() { _udpClient = new UdpClient(_port); StartRecMsg(); HandleStarted?.Invoke(); } /// /// 停止服务 /// public void Stop() { _udpClient.Close(); } /// /// 发送数据 /// /// 数据 /// 目标地址 public void Send(byte[] bytes, IPEndPoint iPEndPoint) { try { _udpClient.BeginSend(bytes, bytes.Length, iPEndPoint, asyncCallback => { try { int length = _udpClient.EndSend(asyncCallback); HandleSendMsg?.Invoke(this, iPEndPoint, bytes); } catch (Exception ex) { HandleException?.Invoke(ex); } }, null); } catch (Exception ex) { HandleException?.Invoke(ex); } } /// /// 发送数据 /// /// 数据(默认UTF-8编码发送) /// 目标地址 public void Send(string msg, IPEndPoint iPEndPoint) { Send(Encoding.UTF8.GetBytes(msg), iPEndPoint); } /// /// 发送数据 /// /// 数据(指定的编码方式) /// 目标地址 /// 指定编码 public void Send(string msg, IPEndPoint iPEndPoint, Encoding encoding) { Send(encoding.GetBytes(msg), iPEndPoint); } #endregion #region 事件处理 /// /// 异常处理程序 /// public Action HandleException { get { return _handleException; } set { _handleException = x => { Task.Run(() => { try { value?.Invoke(x); } catch { } }); }; } } private Action _handleException; /// /// 处理收到的消息 /// public Action HandleRecMsg { get; set; } /// /// 处理发送的消息 /// public Action HandleSendMsg { get; set; } /// /// 服务启动后调用 /// public Action HandleStarted { get; set; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Sockets/WebSocketConnection.cs ================================================ using System; using System.Text; namespace Coldairarrow.Util.Sockets { /// /// WebSocket连接 /// public class WebSocketConnection { #region 构造函数 /// /// 构造函数 /// /// WebSocket端 /// TcpSocketConnection连接对象 public WebSocketConnection(WebSocketServer webSocketServer, TcpSocketConnection con) { _webSocketServer = webSocketServer; _theCon = con; } #endregion #region 私有成员 private WebSocketServer _webSocketServer { get; set; } private TcpSocketConnection _theCon { get; set; } private static byte[] PackData(string message) { byte[] contentBytes = null; byte[] temp = Encoding.UTF8.GetBytes(message); if (temp.Length < 126) { contentBytes = new byte[temp.Length + 2]; contentBytes[0] = 0x81; contentBytes[1] = (byte)temp.Length; Array.Copy(temp, 0, contentBytes, 2, temp.Length); } else if (temp.Length < 0xFFFF) { contentBytes = new byte[temp.Length + 4]; contentBytes[0] = 0x81; contentBytes[1] = 126; contentBytes[2] = (byte)(temp.Length & 0xFF); contentBytes[3] = (byte)(temp.Length >> 8 & 0xFF); Array.Copy(temp, 0, contentBytes, 4, temp.Length); } else { // 暂不处理超长内容 } return contentBytes; } #endregion #region 外部接口 /// /// 连接标识Id /// 注:用于标识与客户端的连接 /// public string ConnectionId { get { return _theCon.ConnectionId; } set { _webSocketServer.SetConnectionId(this, _theCon.ConnectionId, value); } } /// /// 发送字符串(UTF-8编码) /// /// 字符串 public void Send(string msgStr) { _theCon.Send(PackData(msgStr)); HandleSendMsg?.Invoke(_webSocketServer, this, msgStr); } /// /// 关闭当前连接 /// public void Close() { _theCon.Close(); _webSocketServer.RemoveConnection(this); HandleClientClose?.Invoke(_webSocketServer, this); } /// /// 判断是否处于已连接状态 /// /// public bool IsSocketConnected() { return _theCon.IsSocketConnected(); } #endregion #region 事件处理 /// /// 客户端连接发送消息后回调 /// public Action HandleSendMsg { get; set; } /// /// 客户端连接关闭后回调 /// public Action HandleClientClose { get; set; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Sockets/WebSocketServer.cs ================================================ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Text; namespace Coldairarrow.Util.Sockets { /// /// WebSocket服务端 /// public class WebSocketServer { #region 构造函数 /// /// 构造函数 /// 注:默认监听0.0.0.0 /// /// 监听端口 /// 数据接受区大小 public WebSocketServer(int port, int recLength = 1024) { _tcpSocketServer = new TcpSocketServer(port) { RecLength = recLength }; } #endregion #region 私有成员 private TcpSocketServer _tcpSocketServer { get; set; } private ConcurrentDictionary _connectionList { get; } = new ConcurrentDictionary(); private static bool IsHandshake(string requestStr) { return requestStr.Contains("Upgrade") && requestStr.Contains("Sec-WebSocket-Key"); } private static Dictionary GetHeaders(string requestStr) { Dictionary headers = new Dictionary(); var rows = requestStr.Split("\r\n".ToCharArray()); rows.ForEach(aRow => { if (aRow.Contains(":")) { var keyValue = aRow.Split(':'); string key = keyValue[0]; string value = keyValue[1]; value = value.Remove(0, 1); headers.Add(key, value); } }); return headers; } private static string GetWebSocketAccept(string key) { return $"{key}258EAFA5-E914-47DA-95CA-C5AB0DC85B11".ToSHA1Bytes().ToBase64String(); } private static string GetWebSocketResponse(string requestStr) { var headers = GetHeaders(requestStr); string webSocketKey = headers["Sec-WebSocket-Key"]; string accept = GetWebSocketAccept(webSocketKey); string res = $@"HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: {accept} "; return res; } private static string AnalyticData(byte[] recBytes) { int recByteLength = recBytes.Length; if (recByteLength < 2) { return string.Empty; } bool fin = (recBytes[0] & 0x80) == 0x80; // 1bit,1表示最后一帧 if (!fin) { return string.Empty;// 超过一帧暂不处理 } bool mask_flag = (recBytes[1] & 0x80) == 0x80; // 是否包含掩码 if (!mask_flag) { return string.Empty;// 不包含掩码的暂不处理 } int payload_len = recBytes[1] & 0x7F; // 数据长度 byte[] masks = new byte[4]; byte[] payload_data; if (payload_len == 126) { Array.Copy(recBytes, 4, masks, 0, 4); payload_len = (UInt16)(recBytes[2] << 8 | recBytes[3]); payload_data = new byte[payload_len]; Array.Copy(recBytes, 8, payload_data, 0, payload_len); } else if (payload_len == 127) { Array.Copy(recBytes, 10, masks, 0, 4); byte[] uInt64Bytes = new byte[8]; for (int i = 0; i < 8; i++) { uInt64Bytes[i] = recBytes[9 - i]; } UInt64 len = BitConverter.ToUInt64(uInt64Bytes, 0); payload_data = new byte[len]; for (UInt64 i = 0; i < len; i++) { payload_data[i] = recBytes[i + 14]; } } else { Array.Copy(recBytes, 2, masks, 0, 4); payload_data = new byte[payload_len]; Array.Copy(recBytes, 6, payload_data, 0, payload_len); } for (var i = 0; i < payload_len; i++) { payload_data[i] = (byte)(payload_data[i] ^ masks[i % 4]); } return Encoding.UTF8.GetString(payload_data); } private void InitServer() { _tcpSocketServer.HandleServerStarted = theServer => { HandleServerStarted?.Invoke(this); }; _tcpSocketServer.HandleException = ex => { HandleException?.Invoke(ex); }; _tcpSocketServer.HandleClientClose = (theServer, theCon) => { var webCon = GetConnection(theCon.ConnectionId); CloseConnection(webCon); HandleClientClose?.Invoke(this, webCon); }; _tcpSocketServer.HandleNewClientConnected = (theServer, theCon) => { WebSocketConnection newCon = new WebSocketConnection(this, theCon) { HandleClientClose = HandleClientClose == null ? null : new Action(HandleClientClose), HandleSendMsg = HandleSendMsg == null ? null : new Action(HandleSendMsg) }; AddConnection(newCon); HandleNewClientConnected?.Invoke(this, newCon); }; _tcpSocketServer.HandleRecMsg = (thServer, theCon, bytes) => { string recStr = bytes.ToString(Encoding.UTF8); if (IsHandshake(recStr)) { string res = GetWebSocketResponse(recStr); theCon.Send(res); } else { int opcode = new string(bytes[0].ToBinString().Copy(4, 4).ToArray()).ToInt_FromBinString(); //为关闭连接 if (opcode == 8) { GetConnection(theCon.ConnectionId).Close(); } else { string recData = AnalyticData(bytes); HandleRecMsg?.Invoke(this, GetConnection(theCon.ConnectionId), recData); } } }; } private void AddConnection(WebSocketConnection theConnection) { _connectionList[theConnection.ConnectionId] = theConnection; } #endregion #region 外部接口 /// /// 开始运行 /// public void Start() { InitServer(); _tcpSocketServer.StartServer(); } /// /// 停止运行 /// public void Stop() { _tcpSocketServer.StopServer(); } /// /// 设置连接标识Id /// /// 需要设置的连接对象 /// 老的标识 /// 新的标识 public void SetConnectionId(WebSocketConnection tcpSocketConnection, string oldConnectionId, string newConnectionId) { if (!string.IsNullOrEmpty(oldConnectionId) && !string.IsNullOrEmpty(newConnectionId)) { _connectionList.TryRemove(oldConnectionId, out WebSocketConnection theValue); _connectionList[newConnectionId] = tcpSocketConnection; _tcpSocketServer.GetConnection(oldConnectionId).ConnectionId = newConnectionId; } } /// /// 关闭指定客户端连接 /// /// 指定的客户端连接 public void CloseConnection(WebSocketConnection theConnection) { theConnection.Close(); } /// /// 删除指定的客户端连接 /// /// 指定的客户端连接 public void RemoveConnection(WebSocketConnection theConnection) { if (!string.IsNullOrEmpty(theConnection.ConnectionId)) { _connectionList.TryRemove(theConnection.ConnectionId, out WebSocketConnection theOutValue); } } /// /// 获取客户端连接 /// /// 连接标志Id /// public WebSocketConnection GetConnection(string connectionId) { return _connectionList[connectionId]; } /// /// 获取所有连接标志Id /// /// public List GetAllConnectionIds() { return _connectionList.Keys.ToList(); } /// /// 获取所有连接 /// /// public List GetAllConnections() { return _connectionList.Values.ToList(); } /// /// 获取客户端连接数 /// /// public int GetConnectionCount() { return _connectionList.Keys.Count; } #endregion #region 公共事件 /// /// 异常处理程序 /// public Action HandleException { get; set; } #endregion #region 服务端事件 /// /// 服务启动后执行 /// public Action HandleServerStarted { get; set; } /// /// 当新客户端连接后执行 /// public Action HandleNewClientConnected { get; set; } #endregion #region 客户端连接事件 /// /// 客户端连接接受新的消息后调用 /// public Action HandleRecMsg { get; set; } /// /// 客户端连接发送消息后回调 /// public Action HandleSendMsg { get; set; } /// /// 客户端连接关闭后回调 /// public Action HandleClientClose { get; set; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/TaskQeury.cs ================================================ using System; using System.Collections.Concurrent; using System.Threading; using System.Threading.Tasks; namespace Coldairarrow.Util { /// /// 任务队列 /// public class TaskQeury { #region 构造函数 /// /// 默认队列 /// 注:默认间隔时间1ms /// public TaskQeury() { _timeSpan = TimeSpan.Zero; Start(); } /// /// 间隔任务队列 /// 注:每个任务之间间隔一段时间 /// /// 间隔时间 public TaskQeury(TimeSpan timeSpan) { _timeSpan = timeSpan; Start(); } #endregion #region 私有成员 Semaphore _semaphore { get; } = new Semaphore(0, int.MaxValue); private void Start() { Task.Run(() => { while (_isRun) { _semaphore.WaitOne(); bool success = _taskList.TryDequeue(out Action task); if (success) { task?.Invoke(); } if (_timeSpan != TimeSpan.Zero) Thread.Sleep(_timeSpan); } }); } private bool _isRun { get; set; } = true; private TimeSpan _timeSpan { get; set; } private ConcurrentQueue _taskList { get; } = new ConcurrentQueue(); #endregion #region 外部接口 public void Stop() { _isRun = false; } public void Enqueue(Action task) { _taskList.Enqueue(task); _semaphore.Release(); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Wcf/IWcfHost.cs ================================================ namespace Coldairarrow.Util.Wcf { public interface IWcfHost { bool StartHost(); } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Wcf/WcfClient.cs ================================================ using System.ServiceModel; using System.ServiceModel.Channels; namespace Coldairarrow.Util.Wcf { /// /// Wcf客户端 /// public static class WcfClient { #region 外部接口 /// /// 获取服务 /// 注:速度最快,无安全校验 /// /// 服务接口 /// 服务地址 /// public static T GetService(string serviceUrl) { return GetService(serviceUrl, false, null, null); } /// /// 获取服务 /// 注:若开启安全校验则使用默认账号密码 /// /// 服务接口 /// 服务地址 /// 是否开启安全校验 /// public static T GetService(string serviceUrl,bool openSecurity) { return GetService(serviceUrl, openSecurity, null, null); } /// /// 获取服务 /// 注:自定义是否开启安全校验并指定账号密码 /// /// 服务接口 /// 服务地址 /// 是否开启安全校验 /// 账号 /// 密码 /// public static T GetService(string serviceUrl, bool openSecurity, string userName,string password) { var binding = GetBinding(openSecurity); EndpointAddress address = new EndpointAddress(serviceUrl); ChannelFactory factory = new ChannelFactory(binding, address); if (openSecurity) { // 以下设置可以忽略客户端对服务器证书的信任验证 factory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None; // 设置用户名和密码 if (string.IsNullOrEmpty(userName)) userName = WcfHelper.UserName; if (string.IsNullOrEmpty(password)) password = WcfHelper.Password; factory.Credentials.UserName.UserName = userName; factory.Credentials.UserName.Password = password; } return factory.CreateChannel(); } #endregion #region 私有成员 private static Binding GetBinding(bool openSecurity) { return WcfHelper.GetDefaultBinding(openSecurity); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Wcf/WcfHelper.cs ================================================ using System; using System.ServiceModel; using System.Text; namespace Coldairarrow.Util.Wcf { static class WcfHelper { #region 参数配置 public static string UserName { get; set; } = "DefaultWcfUserName"; public static string Password { get; set; } = "5d02d7cd745b04de1b21209f327a8d08"; #endregion #region 外部接口 /// /// 获取默认的绑定类型 /// 注:默认忽略安全校验,速度最快 /// /// public static WSHttpBinding GetDefaultBinding() { return GetDefaultBinding(false); } /// /// 获取默认的绑定类型 /// 注:是否开启安全校验,若开启安全校验,则会影响一定性能 /// /// 是否开启安全校验 /// public static WSHttpBinding GetDefaultBinding(bool openSecurity) { //设置默认绑定 WSHttpBinding defaultWSHttpBinding = new WSHttpBinding { CloseTimeout = TimeSpan.Parse("00:01:00"), OpenTimeout = TimeSpan.Parse("00:01:00"), ReceiveTimeout = TimeSpan.Parse("00:10:00"), SendTimeout = TimeSpan.Parse("00:01:00"), BypassProxyOnLocal = false, TransactionFlow = false, HostNameComparisonMode = HostNameComparisonMode.StrongWildcard, MaxBufferPoolSize = int.MaxValue, MaxReceivedMessageSize = int.MaxValue, MessageEncoding = WSMessageEncoding.Text, TextEncoding = Encoding.UTF8, UseDefaultWebProxy = true }; //数据长度 defaultWSHttpBinding.ReaderQuotas.MaxDepth = int.MaxValue; defaultWSHttpBinding.ReaderQuotas.MaxStringContentLength = int.MaxValue; defaultWSHttpBinding.ReaderQuotas.MaxArrayLength = int.MaxValue; defaultWSHttpBinding.ReaderQuotas.MaxBytesPerRead = int.MaxValue; defaultWSHttpBinding.ReaderQuotas.MaxNameTableCharCount = int.MaxValue; defaultWSHttpBinding.ReliableSession.Ordered = true; defaultWSHttpBinding.ReliableSession.InactivityTimeout = TimeSpan.Parse("00:10:00"); defaultWSHttpBinding.ReliableSession.Enabled = false; //安全协议 if (openSecurity) { defaultWSHttpBinding.Security.Mode = SecurityMode.Message; defaultWSHttpBinding.Security.Message.ClientCredentialType = MessageCredentialType.UserName; } else { defaultWSHttpBinding.Security.Mode = SecurityMode.None; defaultWSHttpBinding.Security.Message.ClientCredentialType = MessageCredentialType.None; } defaultWSHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None; defaultWSHttpBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None; return defaultWSHttpBinding; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/Wcf/WcfHost.cs ================================================ using System; using System.IdentityModel.Selectors; using System.Security.Cryptography.X509Certificates; using System.ServiceModel; using System.Threading.Tasks; namespace Coldairarrow.Util.Wcf { /// /// Wcf服务代码控制类(必须开启管理员权限) /// /// 服务接口 /// 服务处理 public class WcfHost : IWcfHost where Service : IService { #region 构造函数 /// /// 构造函数 /// /// 服务地址 /// 是否开启安全校验 /// 自定义绑定 public WcfHost(string serviceUrl = "http://127.0.0.1:14725", bool openSecurity = false, WSHttpBinding wsHttpBinding = null) { _serviceUrl = serviceUrl; OpenSecurity = openSecurity; if (wsHttpBinding == null) _wsHttpBinding = OpenSecurity ? WcfHelper.GetDefaultBinding(true) : WcfHelper.GetDefaultBinding(false); else _wsHttpBinding = wsHttpBinding; InitService(); } #endregion #region 私有成员 private ServiceHost _serviceHost { get; set; } private WSHttpBinding _wsHttpBinding { get; set; } private string _serviceUrl { get; set; } private WSHttpBinding GetDefaultBinding() { return WcfHelper.GetDefaultBinding(); } private string _userName { get; set; } private string _password { get; set; } private void InitService() { _serviceHost = new ServiceHost(typeof(Service)); _serviceHost.AddServiceEndpoint(typeof(IService), _wsHttpBinding, _serviceUrl); if (OpenSecurity) { //加密传输 _serviceHost.Credentials.ServiceCertificate.SetCertificate("CN=localhost", StoreLocation.LocalMachine, StoreName.My); ////账号密码验证 _serviceHost.Credentials.UserNameAuthentication.UserNamePasswordValidationMode = System.ServiceModel.Security.UserNamePasswordValidationMode.Custom; _serviceHost.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator = new CustUsernamepwdValidator(UserName, Password); } } #endregion #region 外部接口 /// /// 开始Wcf服务 /// public bool StartHost() { return Task.Factory.StartNew(() => { try { if (HandleHostOpened != null) _serviceHost.Opened += new EventHandler(HandleHostOpened); if (_serviceHost.State != CommunicationState.Opened) { _serviceHost.Open(); } return true; } catch (Exception ex) { HandleException?.Invoke(ex); return false; } }).Result; } /// /// 开启安全校验 /// public bool OpenSecurity { get; set; } /// /// 用户名 /// public string UserName { get => string.IsNullOrEmpty(_userName) ? WcfHelper.UserName : _userName; set => _userName = value; } /// /// 密码 /// public string Password { get => string.IsNullOrEmpty(_password) ? WcfHelper.Password : _password; set => _password = value; } #endregion #region 事件处理 /// /// 当Wcf服务开启后执行 /// public Action HandleHostOpened { get; set; } /// /// 异常处理 /// public Action HandleException { get; set; } #endregion #region 其它 /// /// 自定义账号密码校验 /// private class CustUsernamepwdValidator : UserNamePasswordValidator { public CustUsernamepwdValidator(string userName, string password) { _userName = userName; _password = password; } private string _userName { get; } private string _password { get; } public override void Validate(string userName, string password) { if (userName != _userName || password != _password) { throw new Exception("用户名或密码错误。"); } } } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/WcfMS/BaseWcfMSService.cs ================================================ namespace Coldairarrow.Util.WcfMS { /// /// 服务基类 /// public class BaseWcfMSService : IBaseWcfMSService { /// /// 是否在线 /// /// public bool IsOnline() { return true; } } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/WcfMS/IBaseWcfMSService.cs ================================================ using System.ServiceModel; namespace Coldairarrow.Util.WcfMS { /// /// 服务接口基类 /// [ServiceContract] public interface IBaseWcfMSService { [OperationContract] bool IsOnline(); } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/WcfMS/WcfMSBase.cs ================================================ using Coldairarrow.Util.Wcf; using System; using System.Collections.Concurrent; using System.Collections.Generic; namespace Coldairarrow.Util.WcfMS { /// /// 基于Wcf的微服务抽象基类 /// public abstract class WcfMSBase { #region 私有成员 protected string _projectName { get; set; } public string _redisConfig { get; set; } = "localhost:6379"; public string _ipAddress { get; set; } public bool _openSecurity { get; set; } = false; public string _userName { get; set; } public string _password { get; set; } protected string _cacheKey { get => $"{_projectName}_WcfMS"; } protected string _configCacheKey { get => $"{_cacheKey}_config"; } protected RedisCache _redisCache { get; set; } protected ConcurrentDictionary _services { get; } = new ConcurrentDictionary(); protected string BuildCacheKey(string key) { return $"{_cacheKey}_{key}"; } protected Random _random { get; } = new Random(); protected void InitParamter(WcfMSConfig config) { _projectName = config.ProjectName; _ipAddress = config.IpAddress; _openSecurity = config.OpenSecurity; _redisConfig = config.RedisConfig; _userName = config.UserName; _password = config.Password; } /// /// 获取服务 /// /// 服务地址 /// 服务接口 /// protected IService GetService(string serviceUrl) where IService : IBaseWcfMSService { IBaseWcfMSService theService = null; if (!_services.ContainsKey(serviceUrl)) { theService = WcfClient.GetService(serviceUrl, _openSecurity, _userName, _password); _services[serviceUrl] = theService; } else theService = _services[serviceUrl]; return (IService)theService; } /// /// 获取所有服务名 /// /// protected List GetAllServiceNames() { string allServicesNamesCacheKey = BuildCacheKey("allServices"); List serviceNames = _redisCache.GetCache>(allServicesNamesCacheKey); return serviceNames; } /// /// 获取服务名下的所有服务地址 /// /// 服务名 /// protected List GetServiceUrls(string serviceName) { string cacheKey = BuildCacheKey(serviceName); var serviceUrls = _redisCache.GetCache>(cacheKey); return serviceUrls; } /// /// 移除服务地址 /// /// 服务名 /// 服务地址 protected void RemoveServiceUrl(string serviceName, string serviceUrl) { string cacheKey = BuildCacheKey(serviceName); List serviceUrls = GetServiceUrls(serviceName); if (serviceUrls != null) { serviceUrls.Remove(serviceUrl); _redisCache.SetCache(cacheKey, serviceUrls); } } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/WcfMS/WcfMSClient.cs ================================================ using System; using System.Collections.Generic; namespace Coldairarrow.Util.WcfMS { /// /// 基于Wcf的微服务客户端 /// public class WcfMSClient : WcfMSBase { #region 构造函数 /// /// 构造函数 /// /// 项目名 /// redis配置 public WcfMSClient(string projectName, string redisConfig = "localhost:6379") { if (string.IsNullOrEmpty(projectName)) throw new Exception("项目名不能为空!"); _projectName = projectName; _redisCache = new RedisCache(redisConfig); WcfMSConfig config = _redisCache.GetCache(_configCacheKey); InitParamter(config); } #endregion #region 外部接口 /// /// 获取服务 /// /// 服务接口 /// public IService GetService() where IService : IBaseWcfMSService { string serviceName = typeof(IService).Name; string cacheKey = BuildCacheKey(serviceName); List urls = _redisCache.GetCache>(cacheKey); if (urls == null || urls?.Count == 0) throw new Exception("服务未注册!"); int index = _random.Next(0, urls.Count); string serviceUrl = urls[index]; return GetService(serviceUrl); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/WcfMS/WcfMSConfig.cs ================================================ namespace Coldairarrow.Util.WcfMS { /// /// 配置信息 /// public class WcfMSConfig { /// /// 项目名 /// public string ProjectName { get; set; } /// /// Redis配置 /// 注:默认为localhost:6379 /// public string RedisConfig { get; set; } = "localhost:6379"; /// /// 当前服务器Ip地址 /// 注:若不传入则获取当前内网Ip地址 /// public string IpAddress { get; set; } /// /// 是否开启传输安全校验加密 /// public bool OpenSecurity { get; set; } = false; /// /// 用户名 /// public string UserName { get; set; } /// /// 密码 /// public string Password { get; set; } } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/WcfMS/WcfMSServer.cs ================================================ using Coldairarrow.Util.Wcf; using System; using System.Collections.Generic; using System.Threading.Tasks; using System.Web; namespace Coldairarrow.Util.WcfMS { /// /// 基于Wcf的微服务服务端 /// public class WcfMSServer : WcfMSBase { #region 构造函数 /// /// 构造函数 /// /// 配置信息 public WcfMSServer(WcfMSConfig config) { if (string.IsNullOrEmpty(config.ProjectName)) throw new Exception("项目名不能为空!"); InitParamter(config); _redisCache = new RedisCache(_redisConfig); _redisCache.SetCache(_configCacheKey, config); CheckOnline(); HttpRuntime.Cache[Guid.NewGuid().ToString()] = this; } #endregion #region 私有成员 private void CheckOnline() { TimerHelper.SetInterval(() => { try { List serviceNames = GetAllServiceNames(); serviceNames?.ForEach(aServiceName => { List serviceUrls = GetServiceUrls(aServiceName); serviceUrls?.ForEach(aServiceUrl => { IBaseWcfMSService aService = GetService(aServiceUrl); Task task = Task.Factory.StartNew(() => { try { bool isOnline = aService.IsOnline(); } catch { } }); if (!task.Wait(100)) { RemoveServiceUrl(aServiceName, aServiceUrl); } }); }); } catch { } }, new TimeSpan(0, 0, 1)); } #endregion #region 外部接口 /// /// 注册服务 /// 注:自动获取一个可用端口 /// /// 服务接口 /// 服务实现 public void RegisterService() where Service : BaseWcfMSService, IBaseWcfMSService, IService where IService : IBaseWcfMSService { RegisterService(IpHelper.GetFirstAvailablePort()); } /// /// 注册服务 /// 注:指定端口 /// /// 服务接口 /// 服务实现 public void RegisterService(int port) where Service : BaseWcfMSService, IBaseWcfMSService, IService where IService : IBaseWcfMSService { string ipAddress = string.IsNullOrEmpty(_ipAddress) ? IpHelper.GetLocalIp() : _ipAddress; string serviceName = typeof(IService).Name; string cacheKey = BuildCacheKey(serviceName); string serviceUrl = $"http://{ipAddress}:{port}/{serviceName}"; WcfHost newHost = null; if (!_openSecurity) { newHost = new WcfHost(serviceUrl); } else { if (string.IsNullOrEmpty(_userName) || string.IsNullOrEmpty(_password)) newHost = new WcfHost(serviceUrl, true); else newHost = new WcfHost(serviceUrl, true) { UserName = _userName, Password = _password }; } bool succcess = newHost.StartHost(); if (!succcess) throw new Exception($"注册服务:{serviceName}到:{serviceUrl}失败!"); HttpRuntime.Cache[Guid.NewGuid().ToString()] = newHost; //更新服务地址缓存 var urls = _redisCache.GetCache>(cacheKey); if (urls == null) urls = new List(); if (!urls.Contains(serviceUrl)) urls.Add(serviceUrl); _redisCache.SetCache(cacheKey, urls); //更新该项目所有服务 string allServicesNamesCacheKey = BuildCacheKey("allServices"); List serviceNames = _redisCache.GetCache>(allServicesNamesCacheKey); if (serviceNames == null) serviceNames = new List(); if (!serviceNames.Contains(serviceName)) serviceNames.Add(serviceName); _redisCache.SetCache(allServicesNamesCacheKey, serviceNames); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/WindowsService/WindowsService.cs ================================================ using System; using System.ServiceProcess; namespace Coldairarrow.Util.WindowsService { partial class WindowsService : ServiceBase { #region 构造函数 public WindowsService() { InitializeComponent(); } #endregion #region 保护成员 protected override void OnStart(string[] args) { HandleOnStart?.BeginInvoke(args,null,null); } protected override void OnStop() { HandleOnStop?.BeginInvoke(null,null); } #endregion #region 事件处理 /// /// 当服务启动时执行操作 /// public Action HandleOnStart { get; set; } /// /// 当服务停止时执行的操作 /// public Action HandleOnStop { get; set; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/WindowsService/WindowsService.designer.cs ================================================ namespace Coldairarrow.Util.WindowsService { partial class WindowsService { /// /// 必需的设计器变量。 /// private System.ComponentModel.IContainer components = null; /// /// 清理所有正在使用的资源。 /// /// 如果应释放托管资源,为 true;否则为 false。 protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region 组件设计器生成的代码 /// /// 设计器支持所需的方法 - 不要修改 /// 使用代码编辑器修改此方法的内容。 /// private void InitializeComponent() { components = new System.ComponentModel.Container(); this.ServiceName = "WindowsService"; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/ClassLibrary/WindowsService/WindowsServiceContainer.cs ================================================ using System; using System.Collections; using System.Configuration.Install; using System.Linq; using System.Reflection; using System.ServiceProcess; namespace Coldairarrow.Util.WindowsService { /// /// Windows服务容器,提供服务安装、卸载等操作 /// public class WindowsServiceContainer { #region 构造函数 /// /// 构造函数 /// /// /// 从控制台传过来的参数 public WindowsServiceContainer(string serviceName, string[] args) { _serviceName = serviceName; _args = args; _service = new WindowsService(); } #endregion #region 私有成员 string[] _args; WindowsService _service; string _serviceName; string _displayName; string _description; private void InitSerice() { _service.HandleOnStart = HandleOnStart == null ? null : new Action(HandleOnStart); _service.HandleOnStop = HandleOnStop == null ? null : new Action(HandleOnStop); } private bool IsServiceExisted() { return ServiceController.GetServices().ToList().Exists(x => x.ServiceName == _serviceName); } private ServiceControllerStatus ServiceStatus { get => GetService().Status; } private TransactedInstaller GetInstaller() { try { TransactedInstaller installer = new TransactedInstaller(); installer.Installers.Add(new ServiceProcessInstaller { Account = ServiceAccount.LocalSystem }); installer.Installers.Add(new ServiceInstaller { ServiceName = _serviceName, DisplayName = _displayName, Description = _description, ServicesDependedOn = ServicesDependedOn, StartType = StartType }); installer.Context = new InstallContext(); installer.Context.Parameters["assemblypath"] = "\"" + Assembly.GetEntryAssembly().Location + "\" /service"; return installer; } catch (Exception ex) { HandleException?.Invoke(ex); return null; } } private ServiceController GetService() { try { if (!IsServiceExisted()) { HandleLog?.Invoke("服务不存在,无法启动!"); return null; } else { return new ServiceController(_serviceName); } } catch (Exception ex) { HandleException?.Invoke(ex); return null; } } private void StartService() { try { ServiceController service = GetService(); if (service.Status != ServiceControllerStatus.Running && service.Status != ServiceControllerStatus.StartPending) { service.Start(); service.WaitForStatus(ServiceControllerStatus.Running, new TimeSpan(0, 0, 5)); HandleLog?.Invoke("服务启动完成******"); } } catch (Exception ex) { if (ex is System.ServiceProcess.TimeoutException) HandleLog?.Invoke($@"服务5秒内未启动,服务启动超时,启动失败!"); HandleException?.Invoke(ex); } } private void StopService() { GetService().Stop(); } private void InstallService() { GetInstaller().Install(new Hashtable()); } private void UnInstallService() { try { ServiceControllerStatus status = ServiceStatus; if (status != ServiceControllerStatus.StopPending && status != ServiceControllerStatus.Stopped) StopService(); GetService().WaitForStatus(ServiceControllerStatus.Stopped, new TimeSpan(0, 0, 5)); GetInstaller().Uninstall(null); } catch (Exception ex) { if (ex is System.ServiceProcess.TimeoutException) HandleLog?.Invoke($@"服务5秒内未停止,服务停止超时,停止失败,卸载失败!"); HandleException?.Invoke(ex); } } private Action _handleLog { get; set; } #endregion #region 外部接口 /// /// 服务名 /// public string ServiceName { get => _serviceName; set => _serviceName = value; } /// /// 显示名 /// public string DisplayName { get => string.IsNullOrEmpty(_displayName) ? _serviceName : _displayName; set => _displayName = value; } /// /// 服务描述信息 /// public string Description { get => string.IsNullOrEmpty(_description) ? _serviceName : _description; set => _description = value; } /// /// 启动服务必须的前置服务,默认为空 /// public string[] ServicesDependedOn { get; set; } = new string[0]; /// /// 服务启动类型,默认为自动 /// public ServiceStartMode StartType { get; set; } = ServiceStartMode.Automatic; /// /// 开始运行 /// public void Start() { InitSerice(); try { if (_args.Length > 0) { ServiceBase.Run(_service); } else { while (true) { try { Console.WriteLine("\n请选择你要执行的操作——1:自动部署服务,2:卸载服务,3:退出"); Console.WriteLine("————————————————————"); ConsoleKey key = Console.ReadKey().Key; if (key == ConsoleKey.NumPad1 || key == ConsoleKey.D1) { if (IsServiceExisted()) { Console.WriteLine("\n检测到服务已存在,进行原服务卸载......"); UnInstallService(); Console.WriteLine("原服务卸载成功,进行安装新服务......"); InstallService(); Console.WriteLine("新服务安装成功,进行启动服务......"); } else { Console.WriteLine("\n监测到该服务不存在,进行安装此服务......"); InstallService(); Console.WriteLine("服务安装成功,进行启动服务......"); } StartService(); } else if (key == ConsoleKey.NumPad2 || key == ConsoleKey.D2) { if (IsServiceExisted()) { Console.WriteLine("\n检测到服务已存在,进行服务卸载......"); UnInstallService(); Console.WriteLine("服务卸载成功......"); } else Console.WriteLine("\n该服务未安装,无法进行卸载......"); } else if (key == ConsoleKey.NumPad3 || key == ConsoleKey.D3) { break; } } catch (Exception ex) { HandleException?.BeginInvoke(ex, null, null); } } } } catch (Exception ex) { HandleException?.Invoke(ex); } } #endregion #region 事件处理 /// /// 异常处理 /// public Action HandleException { get; set; } /// /// 日志处理 /// public Action HandleLog { get { return _handleLog ?? new Action(log => { Console.WriteLine(log); }); } set { _handleLog = value; } } /// /// 当服务启动时执行操作 /// public Action HandleOnStart { get; set; } /// /// 当服务停止时执行的操作 /// public Action HandleOnStop { get; set; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/DataAccess/DbHelper.cs ================================================ using System; using System.Collections.Generic; using System.Data; using System.Data.Common; using System.IO; namespace Coldairarrow.Util { /// /// 描述:数据库操作抽象帮助类 /// 作者:Coldairarrow /// public abstract class DbHelper { #region 构造函数 /// /// 构造函数 /// /// 数据库类型 /// 连接名或连接字符串 public DbHelper(DatabaseType dbType, string conStr) { _dbType = dbType; _conStr = DbProviderFactoryHelper.GetConStr(conStr); } #endregion #region 私有成员 /// /// 数据库类型 /// protected DatabaseType _dbType; /// /// 连接字符串 /// protected string _conStr; /// /// 实体需要引用的额外命名空间 /// protected string _extraUsingNamespace { get; set; } = string.Empty; /// /// 类型映射字典 /// protected abstract Dictionary DbTypeDic { get; } #endregion #region 外部接口 /// /// 通过数据库连接字符串和Sql语句查询返回DataTable /// /// Sql语句 /// public virtual DataTable GetDataTableWithSql(string sql) { return GetDataTableWithSql(sql, null); } /// /// 通过数据库连接字符串和Sql语句查询返回DataTable,参数化查询 /// /// Sql语句 /// 参数 /// public virtual DataTable GetDataTableWithSql(string sql, List parameters) { DbProviderFactory dbProviderFactory = DbProviderFactoryHelper.GetDbProviderFactory(_dbType); using (DbConnection conn = dbProviderFactory.CreateConnection()) { conn.ConnectionString = _conStr; if (conn.State != ConnectionState.Open) { conn.Open(); } using (DbCommand cmd = conn.CreateCommand()) { cmd.Connection = conn; cmd.CommandText = sql; cmd.CommandTimeout = 5 * 60; if (parameters != null && parameters?.Count > 0) cmd.Parameters.AddRange(parameters.ToArray()); DbDataAdapter adapter = dbProviderFactory.CreateDataAdapter(); adapter.SelectCommand = cmd; DataSet table = new DataSet(); adapter.Fill(table); cmd.Parameters.Clear(); return table.Tables[0]; } } } /// /// 通过数据库连接字符串和Sql语句查询返回List /// /// 实体类 /// Sql语句 /// public List GetListBySql(string sqlStr) { return GetDataTableWithSql(sqlStr).ToList(); } /// /// 通过数据库连接字符串和Sql语句查询返回List,参数化查询 /// /// 实体类 /// Sql语句 /// 查询参数 /// public List GetListBySql(string sqlStr, List param) { return GetDataTableWithSql(sqlStr, param).ToList(); } /// /// 执行无返回值的Sql语句 /// /// Sql语句 public int ExecuteSql(string sql) { return ExecuteSql(sql, null); } /// /// 执行无返回值的Sql语句 /// /// Sql语句 /// 查询参数 public int ExecuteSql(string sql, List paramters) { int count = 0; DbProviderFactory dbProviderFactory = DbProviderFactoryHelper.GetDbProviderFactory(_dbType); using (DbConnection conn = dbProviderFactory.CreateConnection()) { if (conn.State != ConnectionState.Open) { conn.Open(); } using (DbCommand cmd = dbProviderFactory.CreateCommand()) { cmd.Connection = conn; cmd.CommandText = sql; cmd.CommandTimeout = 5 * 60; if (paramters != null && paramters?.Count > 0) cmd.Parameters.AddRange(paramters.ToArray()); count = cmd.ExecuteNonQuery(); return count; } } } /// /// 获取数据库中的所有表 /// /// 模式(架构) /// public abstract List GetDbAllTables(string schemaName = null); /// /// 通过连接字符串和表名获取数据库表的信息 /// /// 表名 /// public abstract List GetDbTableInfo(string tableName); /// /// 将数据库类型转为对应C#数据类型 /// /// 数据类型 /// public virtual Type DbTypeStr_To_CsharpType(string dbTypeStr) { string _dbTypeStr = dbTypeStr.ToLower(); Type type = null; if (DbTypeDic.ContainsKey(_dbTypeStr)) type = DbTypeDic[_dbTypeStr]; else type = typeof(string); return type; } /// /// 生成实体文件 /// /// 表字段信息 /// 表名 /// 表描述信息 /// 文件路径(包含文件名) /// 实体命名空间 /// 架构(模式)名 public virtual void SaveEntityToFile(List infos, string tableName, string tableDescription, string filePath, string nameSpace, string schemaName = null) { string properties = ""; string schema = ""; if (!schemaName.IsNullOrEmpty()) schema = $@", Schema = ""{schemaName}"""; infos.ForEach((item, index) => { string isKey = item.IsKey ? $@" [Key, Column(Order = {index + 1})]" : ""; Type type = DbTypeStr_To_CsharpType(item.Type); string isNullable = item.IsNullable && type.IsValueType ? "?" : ""; string description = item.Description.IsNullOrEmpty() ? item.Name : item.Description; string newPropertyStr = $@" /// /// {description} /// {isKey} public {type.Name}{isNullable} {item.Name} {{ get; set; }} "; properties += newPropertyStr; }); string fileStr = $@"using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; {_extraUsingNamespace} namespace {nameSpace} {{ /// /// {tableDescription} /// [Table(""{tableName}""{schema})] public class {tableName} {{ {properties} }} }}"; FileHelper.WriteTxt(fileStr, filePath, FileMode.Create); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/DataAccess/DbHelperFactory.cs ================================================ namespace Coldairarrow.Util { /// /// 描述:数据库帮助类工厂 /// 作者:Coldairarrow /// public class DbHelperFactory { static DbHelperFactory() { _container = new IocHelper(); _container.RegisterType(DatabaseType.SqlServer.ToString()); _container.RegisterType(DatabaseType.MySql.ToString()); _container.RegisterType(DatabaseType.PostgreSql.ToString()); _container.RegisterType(DatabaseType.Oracle.ToString()); } private static IocHelper _container { get; } /// /// 获取指定的数据库帮助类 /// /// 数据库类型 /// 连接字符串 /// public static DbHelper GetDbHelper(DatabaseType dbType, string conStr) { return _container.Resolve(dbType.ToString(), conStr); } /// /// 获取指定的数据库帮助类 /// /// 数据库类型字符串 /// 连接字符串 /// public static DbHelper GetDbHelper(string dbTypeStr, string conStr) { DatabaseType dbType = DbProviderFactoryHelper.DbTypeStrToDbType(dbTypeStr); return GetDbHelper(dbType, conStr); } } } ================================================ FILE: src/Coldairarrow.Util/DataAccess/DbProviderFactoryHelper.cs ================================================ using MySql.Data.MySqlClient; using Npgsql; using Oracle.ManagedDataAccess.Client; using System; using System.Collections.Generic; using System.Data.Common; using System.Data.SqlClient; using System.Linq; namespace Coldairarrow.Util { /// /// 数据库操作提供源工厂帮助类 /// public class DbProviderFactoryHelper { #region 构造函数 static DbProviderFactoryHelper() { _invariantNames.Add(DatabaseType.SqlServer, "System.Data.SqlClient"); _invariantNames.Add(DatabaseType.MySql, "MySql.Data.MySqlClient"); _invariantNames.Add(DatabaseType.Oracle, "Oracle.ManagedDataAccess.Client"); _invariantNames.Add(DatabaseType.PostgreSql, "Npgsql"); } #endregion #region 私有成员 private static Dictionary _invariantNames { get; } = new Dictionary(); #endregion #region 外部接口 /// /// 获取提供工厂 /// /// 数据库类型 /// public static DbProviderFactory GetDbProviderFactory(DatabaseType dbType) { DbProviderFactory factory = null; switch (dbType) { case DatabaseType.SqlServer: factory = SqlClientFactory.Instance; break; case DatabaseType.MySql: factory = MySqlClientFactory.Instance; break; case DatabaseType.PostgreSql: factory = NpgsqlFactory.Instance; break; case DatabaseType.Oracle: factory = OracleClientFactory.Instance; break; default: throw new Exception("请传入有效的数据库!"); } return factory; } /// /// 获取DbConnection /// /// 数据库类型 /// public static DbConnection GetDbConnection(DatabaseType dbType) { return GetDbProviderFactory(dbType).CreateConnection(); } /// /// 获取DbCommand /// /// 数据库类型 /// public static DbCommand GetDbCommand(DatabaseType dbType) { return GetDbProviderFactory(dbType).CreateCommand(); } /// /// 获取DbParameter /// /// 数据库类型 /// public static DbParameter GetDbParameter(DatabaseType dbType) { return GetDbProviderFactory(dbType).CreateParameter(); } /// /// 获取DataAdapter /// /// 数据库类型 /// public static DataAdapter GetDataAdapter(DatabaseType dbType) { return GetDbProviderFactory(dbType).CreateDataAdapter(); } /// /// 将数据库类型字符串转换为对应的数据库类型 /// /// 数据库类型字符串 /// public static DatabaseType DbTypeStrToDbType(string dbTypeStr) { if (dbTypeStr.IsNullOrEmpty()) throw new Exception("请输入数据库类型字符串!"); else { switch (dbTypeStr.ToLower()) { case "sqlserver": return DatabaseType.SqlServer; case "mysql": return DatabaseType.MySql; case "oracle": return DatabaseType.Oracle; case "postgresql": return DatabaseType.PostgreSql; default: throw new Exception("请输入合法的数据库类型字符串!"); } } } /// /// 将数据库类型转换为对应的数据库类型字符串 /// /// 数据库类型 /// public static string DbTypeToDbTypeStr(DatabaseType dbType) { if (dbType.IsNullOrEmpty()) throw new Exception("请输入数据库类型!"); else { switch (dbType) { case DatabaseType.SqlServer: return "SqlServer"; case DatabaseType.MySql: return "MySql"; case DatabaseType.Oracle: return "Oracle"; case DatabaseType.PostgreSql: return "PostgreSql"; default: throw new Exception("请输入合法的数据库类型!"); } } } /// /// 通过连接名或连接字符串获取连接字符串 /// /// 连接名或者连接字符串 /// public static string GetConStr(string nameOrconStr) { string conStr = string.Empty; string nameOfDbcon = string.Empty; //若为连接字符串 if (nameOrconStr.Contains(";")) conStr = nameOrconStr; //若为"name=BaseDb"形式 else if (nameOrconStr.Contains("name=")) { var strArray = nameOrconStr.Split("=".ToArray()); nameOfDbcon = strArray[1]; } //为连接名 else nameOfDbcon = nameOrconStr; if (!nameOfDbcon.IsNullOrEmpty()) { conStr = ConfigHelper.GetConnectionString(nameOfDbcon); } return conStr; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/DataAccess/MySqlHelper.cs ================================================ using MySql.Data.MySqlClient; using System; using System.Collections.Generic; using System.Data; using System.Data.Common; namespace Coldairarrow.Util { /// /// MySql数据库操作帮助类 /// public class MySqlHelper : DbHelper { #region 构造函数 /// /// 构造函数 /// /// 数据库连接名或连接字符串 public MySqlHelper(string nameOrConStr) : base(DatabaseType.MySql, nameOrConStr) { } #endregion #region 私有成员 protected override Dictionary DbTypeDic { get; } = new Dictionary { { "boolean",typeof(bool)}, { "bit(1)",typeof(bool)}, { "tinyint unsigned",typeof(byte)}, { "binary",typeof(byte[])}, { "varbinary",typeof(byte[])}, { "blob",typeof(byte[])}, { "longblob",typeof(byte[])}, { "datetime",typeof(DateTime)}, { "double",typeof(double)}, { "char(36)",typeof(Guid)}, { "smallint",typeof(Int16)}, { "int",typeof(Int32)}, { "bigint",typeof(Int64)}, { "tinyint",typeof(SByte)}, { "float",typeof(Single)}, { "char",typeof(string)}, { "varchar",typeof(string)}, { "text",typeof(string)}, { "longtext",typeof(string)}, { "time",typeof(TimeSpan)} }; #endregion #region 外部接口 public override DataTable GetDataTableWithSql(string sql, List parameters) { DbProviderFactory dbProviderFactory = DbProviderFactoryHelper.GetDbProviderFactory(_dbType); using (DbConnection conn = dbProviderFactory.CreateConnection()) { conn.ConnectionString = _conStr; if (conn.State != ConnectionState.Open) { conn.Open(); } using (DbCommand cmd = conn.CreateCommand()) { cmd.Connection = conn; cmd.CommandText = sql; cmd.CommandTimeout = 5 * 60; if (parameters != null && parameters?.Count > 0) cmd.Parameters.AddRange(parameters.ToArray()); DbDataAdapter adapter = new MySqlDataAdapter(); adapter.SelectCommand = cmd; DataSet table = new DataSet(); adapter.Fill(table); cmd.Parameters.Clear(); return table.Tables[0]; } } } /// /// 获取数据库中的所有表 /// /// 模式(架构) /// public override List GetDbAllTables(string schemaName = null) { DbProviderFactory dbProviderFactory = DbProviderFactoryHelper.GetDbProviderFactory(_dbType); string dbName = string.Empty; using (DbConnection conn = dbProviderFactory.CreateConnection()) { conn.ConnectionString = _conStr; dbName = conn.Database; } string sql = @"SELECT TABLE_NAME as TableName,table_comment as Description FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = @dbName"; return GetListBySql(sql, new List { new MySqlParameter("@dbName", dbName) }); } /// /// 通过连接字符串和表名获取数据库表的信息 /// /// 表名 /// public override List GetDbTableInfo(string tableName) { string sql = @"select DISTINCT a.COLUMN_NAME as Name, a.DATA_TYPE as Type, (a.COLUMN_KEY = 'PRI') as IsKey, (a.IS_NULLABLE = 'YES') as IsNullable, a.COLUMN_COMMENT as Description from information_schema.columns a where table_name=@tableName ORDER BY a.ORDINAL_POSITION"; return GetListBySql(sql, new List { new MySqlParameter("@tableName", tableName) }); } /// /// 生成实体文件 /// /// 表字段信息 /// 表名 /// 表描述信息 /// 文件路径(包含文件名) /// 实体命名空间 /// 架构(模式)名 public override void SaveEntityToFile(List infos, string tableName, string tableDescription, string filePath, string nameSpace, string schemaName = null) { base.SaveEntityToFile(infos, tableName, tableDescription, filePath, nameSpace, schemaName); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/DataAccess/OracleHelper.cs ================================================ using Oracle.ManagedDataAccess.Client; using System; using System.Collections.Generic; using System.Data.Common; namespace Coldairarrow.Util { /// /// SqlServer数据库操作帮助类 /// public class OracleHelper : DbHelper { #region 构造函数 /// /// 构造函数 /// /// 数据库连接名或连接字符串 public OracleHelper(string nameOrConStr) : base(DatabaseType.Oracle, nameOrConStr) { } #endregion #region 私有成员 protected override Dictionary DbTypeDic { get; } = new Dictionary() { { "BFILE", typeof(byte[]) }, { "BLOB", typeof(byte[]) }, { "CHAR", typeof(string) }, { "CLOB", typeof(string) }, { "DATE", typeof(DateTime) }, { "FLOAT", typeof(decimal) }, { "INTEGER", typeof(decimal) }, { "INTERVAL YEAR TO MONTH", typeof(Int32) }, { "INTERVAL DAY TO SECOND", typeof(TimeSpan) }, { "LONG", typeof(string) }, { "LONG RAW", typeof(string[]) }, { "NCHAR", typeof(string) }, { "NCLOB", typeof(string) }, { "NUMBER", typeof(decimal) }, { "NVARCHAR2", typeof(string) }, { "RAW", typeof(byte[]) }, { "ROWID", typeof(string) }, { "TIMESTAMP", typeof(DateTime) }, { "TIMESTAMP WITH LOCAL TIME ZONE", typeof(DateTime) }, { "TIMESTAMP WITH TIME ZONE", typeof(DateTime) }, { "UNSIGNED INTEGER", typeof(decimal) }, { "VARCHAR2", typeof(string) } }; #endregion #region 外部接口 /// /// 获取数据库中的所有表 /// /// 模式(架构) /// public override List GetDbAllTables(string schemaName = null) { DbProviderFactory dbProviderFactory = DbProviderFactoryHelper.GetDbProviderFactory(_dbType); string dbName = string.Empty; OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder(_conStr); dbName = builder.UserID; if (schemaName.IsNullOrEmpty()) schemaName = dbName; string sql = @"select TABLE_NAME as ""TableName"", COMMENTS as ""Description"" from all_tab_comments where owner =:schemaName"; return GetListBySql(sql, new List { new OracleParameter("schemaName", schemaName) }); } /// /// 通过连接字符串和表名获取数据库表的信息 /// /// 表名 /// public override List GetDbTableInfo(string tableName) { string sql = @"select a.COLUMN_NAME as ""Name"", a.DATA_TYPE as ""Type"", case when a.nullable = 'N' then 0 else 1 end as ""IsNullable"", b.comments as ""Description"", case when (select count(*) from all_cons_columns c where c.table_name=a.TABLE_NAME and c.column_name=a.COLUMN_NAME and c.constraint_name= (select d.constraint_name from all_constraints d where d.table_name=c.table_name and d.constraint_type ='P') )>0 then 1 else 0 end as ""IsKey"" from All_TAB_COLS a, all_col_comments b where a.table_name = b.table_name and b.COLUMN_NAME = a.COLUMN_NAME and a.table_name = :tableName order by a.TABLE_NAME, a.COLUMN_ID"; return GetListBySql(sql, new List { new OracleParameter("table_name", tableName) }); } /// /// 生成实体文件 /// /// 表字段信息 /// 表名 /// 表描述信息 /// 文件路径(包含文件名) /// 实体命名空间 /// 架构(模式)名 public override void SaveEntityToFile(List infos, string tableName, string tableDescription, string filePath, string nameSpace, string schemaName = null) { base.SaveEntityToFile(infos, tableName, tableDescription, filePath, nameSpace, schemaName); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/DataAccess/PostgreSqlHelper.cs ================================================ using Npgsql; using NpgsqlTypes; using System; using System.Collections; using System.Collections.Generic; using System.Data.Common; using System.Net; using System.Net.NetworkInformation; namespace Coldairarrow.Util { /// /// PostgreSql数据库操作帮助类 /// public class PostgreSqlHelper : DbHelper { #region 构造函数 /// /// 构造函数 /// /// 数据库连接名或连接字符串 public PostgreSqlHelper(string nameOrConStr) : base(DatabaseType.PostgreSql, nameOrConStr) { _extraUsingNamespace = $@"using NpgsqlTypes; using System.Collections; using System.Collections.Generic; using System.Net; using System.Net.NetworkInformation; "; } #endregion #region 私有成员 protected override Dictionary DbTypeDic { get; } = new Dictionary() { { "bool", typeof(bool) }, { "int4", typeof(int) }, { "int8", typeof(long) }, { "float4", typeof(float) }, { "float8", typeof(double) }, { "numeric", typeof(double) }, { "money", typeof(decimal) }, { "text", typeof(string) }, { "varchar", typeof(string) }, { "bpchar", typeof(string) }, { "citext", typeof(string) }, { "json", typeof(string) }, { "jsonb", typeof(string) }, { "xml", typeof(string) }, { "point", typeof(NpgsqlPoint) }, { "lseg", typeof(NpgsqlLSeg) }, { "path", typeof(NpgsqlPath) }, { "polygon", typeof(NpgsqlPolygon) }, { "line", typeof(NpgsqlLine) }, { "circle", typeof(NpgsqlCircle) }, { "box", typeof(NpgsqlBox) }, { "bit(1)", typeof(bool) }, { "bit(n)", typeof(BitArray) }, { "varbit", typeof(BitArray) }, { "hstore", typeof(IDictionary) }, { "uuid", typeof(Guid) }, { "cidr", typeof(string) }, { "inet", typeof(IPAddress) }, { "macaddr", typeof(PhysicalAddress) }, { "tsquery", typeof(NpgsqlTsQuery) }, { "tsvector", typeof(NpgsqlTsVector) }, { "date", typeof(DateTime) }, { "interval", typeof(TimeSpan) }, { "timestamp", typeof(DateTime) }, { "timestamptz", typeof(DateTime) }, { "time", typeof(TimeSpan) }, { "timetz", typeof(DateTimeOffset) }, { "bytea", typeof(byte[]) }, { "oid", typeof(uint) }, { "xid", typeof(uint) }, { "cid", typeof(uint) }, { "oidvector", typeof(uint[]) }, { "name", typeof(string) }, { "(internal) char", typeof(char) }, //{ "geometry (PostGIS)", typeof(PostgisGeometry) }, { "record", typeof(object[]) }, { "composite types", typeof(object) }, { "range subtypes", typeof(object) }, { "enum types", typeof(Enum) }, { "array types", typeof(Array) }, }; #endregion #region 外部接口 /// /// 获取数据库中的所有表 /// /// 模式(架构) /// public override List GetDbAllTables(string schemaName = null) { if (schemaName.IsNullOrEmpty()) schemaName = "public"; string sql = @"(select relname as ""TableName"", cast(obj_description(relfilenode,'pg_class') as varchar) as ""Description"" from pg_class c where relkind = 'r' and relname not like 'pg_%' and relname not like 'sql_%' and relchecks=0 order by relname) UNION ALL (SELECT viewname as ""TableName"",NULL as ""Description"" FROM pg_views WHERE schemaname = @schemaName)"; return GetListBySql(sql, new List { new NpgsqlParameter("@schemaName", schemaName) }); } /// /// 通过连接字符串和表名获取数据库表的信息 /// /// 表名 /// public override List GetDbTableInfo(string tableName) { string sql = @"SELECT a.attname as ""Name"", pg_type.typname as ""Type"", (SELECT ""count""(*) from (SELECT ic.column_name as ""ColumnName"" FROM information_schema.table_constraints tc JOIN information_schema.constraint_column_usage AS ccu USING(constraint_schema, constraint_name) JOIN information_schema.columns AS ic ON ic.table_schema = tc.constraint_schema AND tc.table_name = ic.table_name AND ccu.column_name = ic.column_name where constraint_type = 'PRIMARY KEY' and tc.""table_name"" = @table_name) KeyA WHERE KeyA.""ColumnName"" = a.attname)> 0 as ""IsKey"", a.attnotnull<> True as ""IsNullable"", col_description(a.attrelid, a.attnum) as ""Description"" FROM pg_class as c,pg_attribute as a inner join pg_type on pg_type.oid = a.atttypid where c.relname = @table_name and a.attrelid = c.oid and a.attnum > 0;"; return GetListBySql(sql, new List { new NpgsqlParameter("@table_name", tableName) }); } /// /// 生成实体文件 /// /// 表字段信息 /// 表名 /// 表描述信息 /// 文件路径(包含文件名) /// 实体命名空间 /// 架构(模式)名 public override void SaveEntityToFile(List infos, string tableName, string tableDescription, string filePath, string nameSpace, string schemaName = "public") { base.SaveEntityToFile(infos, tableName, tableDescription, filePath, nameSpace, schemaName); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/DataAccess/RedisHelper.cs ================================================ using StackExchange.Redis; namespace Coldairarrow.Util { /// /// Redis帮助类 /// public class RedisHelper { /// /// 获取Redis连接 /// 注:此对象无需一直创建,建议使用单列模式 /// /// Redis服务器Ip /// 端口 /// 密码 /// public static ConnectionMultiplexer GetConnection(string serverIp = "localhost", int port = 6379, string password = null) { string config = string.Empty; config = $"{serverIp}:{port}"; if (!password.IsNullOrEmpty()) config += $",password={password}"; return GetConnection(config); } /// /// 获取Redis连接 /// 注:此对象无需一直创建,建议使用单列模式 /// /// 配置字符串 /// public static ConnectionMultiplexer GetConnection(string config) { return ConnectionMultiplexer.Connect(config); } } } ================================================ FILE: src/Coldairarrow.Util/DataAccess/SqlServerHelper.cs ================================================ using System; using System.Collections.Generic; using System.Data.Common; using System.Data.SqlClient; namespace Coldairarrow.Util { /// /// SqlServer数据库操作帮助类 /// public class SqlServerHelper : DbHelper { #region 构造函数 /// /// 构造函数 /// /// 数据库连接名或连接字符串 public SqlServerHelper(string nameOrConStr) : base(DatabaseType.SqlServer, nameOrConStr) { } #endregion #region 私有成员 protected override Dictionary DbTypeDic { get; } = new Dictionary() { { "int", typeof(Int32) }, { "text", typeof(string) }, { "bigint", typeof(Int64) }, { "binary", typeof(byte[]) }, { "bit", typeof(bool) }, { "char", typeof(string) }, { "date", typeof(DateTime) }, { "datetime", typeof(DateTime) }, { "datetime2", typeof(DateTime) }, { "decimal", typeof(decimal) }, { "float", typeof(double) }, { "image", typeof(byte[]) }, { "money", typeof(decimal) }, { "nchar", typeof(string) }, { "ntext", typeof(string) }, { "numeric", typeof(decimal) }, { "nvarchar", typeof(string) }, { "real", typeof(Single) }, { "smalldatetime", typeof(DateTime) }, { "smallint", typeof(Int16) }, { "smallmoney", typeof(decimal) }, { "timestamp", typeof(DateTime) }, { "tinyint", typeof(byte) }, { "varbinary", typeof(byte[]) }, { "varchar", typeof(string) }, { "variant", typeof(object) }, { "uniqueidentifier", typeof(Guid) }, }; #endregion #region 外部接口 /// /// 获取数据库中的所有表 /// /// 模式(架构) /// public override List GetDbAllTables(string schemaName = null) { if (schemaName.IsNullOrEmpty()) schemaName = "dbo"; string sql = @"select [TableName] = a.name, [Description] = g.value from sys.tables a left join sys.extended_properties g on (a.object_id = g.major_id AND g.minor_id = 0 AND g.name= 'MS_Description') UNION select [TableName] = a.name, [Description] = g.value from sys.views a left join sys.extended_properties g on (a.object_id = g.major_id AND g.minor_id = 0 AND g.name= 'MS_Description')"; return GetListBySql(sql); } /// /// 通过连接字符串和表名获取数据库表的信息 /// /// 表名 /// public override List GetDbTableInfo(string tableName) { string sql = @" select sys.columns.column_id as [ColumnId], sys.columns.name as [Name], sys.types.name as [Type], sys.columns.is_nullable [IsNullable], [IsIdentity]=CONVERT(BIT, (select count(*) from sys.identity_columns where sys.identity_columns.object_id = sys.columns.object_id and sys.columns.column_id = sys.identity_columns.column_id)), (select value from sys.extended_properties where sys.extended_properties.major_id = sys.columns.object_id and sys.extended_properties.minor_id = sys.columns.column_id and name='MS_Description') as [Description], [IsKey] =CONVERT(bit,(case when sys.columns.name in (select b.column_name from information_schema.table_constraints a inner join information_schema.constraint_column_usage b on a.constraint_name = b.constraint_name where a.constraint_type = 'PRIMARY KEY' and a.table_name = @table_name) then 1 else 0 end)) from sys.columns, sys.views, sys.types where sys.columns.object_id = sys.views.object_id and sys.columns.system_type_id=sys.types.system_type_id and sys.views.name=@table_name and sys.types.name !='sysname' union select sys.columns.column_id as [ColumnId], sys.columns.name as [Name], sys.types.name as [Type], sys.columns.is_nullable [IsNullable], [IsIdentity]=CONVERT(BIT, (select count(*) from sys.identity_columns where sys.identity_columns.object_id = sys.columns.object_id and sys.columns.column_id = sys.identity_columns.column_id)), (select value from sys.extended_properties where sys.extended_properties.major_id = sys.columns.object_id and sys.extended_properties.minor_id = sys.columns.column_id and name='MS_Description') as [Description], [IsKey] =CONVERT(bit,(case when sys.columns.name in (select b.column_name from information_schema.table_constraints a inner join information_schema.constraint_column_usage b on a.constraint_name = b.constraint_name where a.constraint_type = 'PRIMARY KEY' and a.table_name = @table_name) then 1 else 0 end)) from sys.columns, sys.tables, sys.types where sys.columns.object_id = sys.tables.object_id and sys.columns.system_type_id=sys.types.system_type_id and sys.tables.name=@table_name and sys.types.name !='sysname' order by sys.columns.column_id asc"; return GetListBySql(sql, new List { new SqlParameter("@table_name", tableName) }); } /// /// 生成实体文件 /// /// 表字段信息 /// 表名 /// 表描述信息 /// 文件路径(包含文件名) /// 实体命名空间 /// 架构(模式)名 public override void SaveEntityToFile(List infos, string tableName, string tableDescription, string filePath, string nameSpace, string schemaName = null) { base.SaveEntityToFile(infos, tableName, tableDescription, filePath, nameSpace, schemaName); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.ActionExecutingContext.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; namespace Coldairarrow.Util { /// /// 拓展类 /// public static partial class Extention { /// /// 获取所有AOP特性 /// /// AOP对象 /// 是否继承父类 /// public static List GetAllCustomAttributes(this ActionExecutingContext filterContext, bool inherit=true) { var actionAttrs = filterContext.ActionDescriptor.GetCustomAttributes(inherit).Select(x=>x as Attribute).ToList(); var controllerAttrs = filterContext.ActionDescriptor.ControllerDescriptor.GetCustomAttributes(inherit).Select(x=>x as Attribute).ToList(); return actionAttrs.Concat(controllerAttrs).ToList(); } /// /// 是否包含某特性 /// /// 特性类型 /// AOP对象 /// public static bool ContainsAttribute(this ActionExecutingContext filterContext) where T : Attribute { return filterContext.GetAllCustomAttributes().Any(x => x.GetType() == typeof(T)); } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.Byte.cs ================================================ using System; using System.IO; using System.Linq; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.Text; namespace Coldairarrow.Util { /// /// 拓展类 /// public static partial class Extention { /// /// byte[]转string /// 注:默认使用UTF8编码 /// /// byte[]数组 /// public static string ToString(this byte[] bytes) { return Encoding.UTF8.GetString(bytes); } /// /// byte[]转string /// /// byte[]数组 /// 指定编码 /// public static string ToString(this byte[] bytes, Encoding encoding) { return encoding.GetString(bytes); } /// /// 将byte[]转为Base64字符串 /// /// 字节数组 /// public static string ToBase64String(this byte[] bytes) { return Convert.ToBase64String(bytes); } /// /// 转为二进制字符串 /// /// 字节 /// public static string ToBinString(this byte aByte) { return new byte[] { aByte }.ToBinString(); } /// /// 转为二进制字符串 /// 注:一个字节转为8位二进制 /// /// 字节数组 /// public static string ToBinString(this byte[] bytes) { StringBuilder builder = new StringBuilder(); foreach(var aByte in bytes) { builder.Append(Convert.ToString(aByte, 2).PadLeft(8, '0')); } return builder.ToString(); } /// /// Byte数组转为对应的16进制字符串 /// /// Byte数组 /// public static string To0XString(this byte[] bytes) { StringBuilder resStr = new StringBuilder(); bytes.ToList().ForEach(aByte => { resStr.Append(aByte.ToString("x2")); }); return resStr.ToString(); } /// /// Byte数组转为对应的16进制字符串 /// /// 一个Byte /// public static string To0XString(this byte aByte) { return new byte[] { aByte }.To0XString(); } /// /// 转为ASCII字符串(一个字节对应一个字符) /// /// 字节数组 /// public static string ToASCIIString(this byte[] bytes) { StringBuilder stringBuilder = new StringBuilder(); bytes.ToList().ForEach(aByte => { stringBuilder.Append((char)aByte); }); return stringBuilder.ToString(); } /// /// 转为ASCII字符串(一个字节对应一个字符) /// /// 字节数组 /// public static string ToASCIIString(this byte aByte) { return new byte[] { aByte }.ToASCIIString(); } /// /// 获取异或值 /// 注:每个字节异或 /// /// 字节数组 /// public static byte GetXOR(this byte[] bytes) { int value = bytes[0]; for (int i = 1; i < bytes.Length; i++) { value = value ^ bytes[i]; } return (byte)value; } /// /// 将字节数组转为Int类型 /// /// 字节数组 /// public static int ToInt(this byte[] bytes) { int num = 0; for (int i = 0; i < bytes.Length; i++) { num += bytes[i] * ((int)Math.Pow(256, bytes.Length - i - 1)); } return num; } /// /// 将一个序列化后的byte[]数组还原 /// /// /// public static object ToObject(this byte[] bytes) { using (MemoryStream ms = new MemoryStream(bytes)) { IFormatter formatter = new BinaryFormatter(); return formatter.Deserialize(ms); } } /// /// 生成CRC-16/MODBUS校验码 /// 注:返回的校验码为两字节,高位在前,低位在后 /// /// 字节数组 /// public static byte[] ToCRC16_MODBUS(this byte[] bytes) { ushort[] g_McRctable_16 ={ 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 }; ushort cRc_16 = 0xFFFF; byte temp; for (int i = 0; i < bytes.Length; ++i) { temp = (byte)(cRc_16 & 0xFF); cRc_16 = (ushort)((cRc_16 >> 8) ^ g_McRctable_16[(temp ^ bytes[i]) & 0xFF]); } var resBytes = new byte[] { (byte)(cRc_16 / 256), (byte)(cRc_16 % 256) }; return resBytes; } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.DataTable.cs ================================================ using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Reflection; using System.Text; namespace Coldairarrow.Util { public static partial class Extention { /// /// DataTable转List /// /// 转换类型 /// 数据源 /// public static List ToList(this DataTable dt) { List list = new List(); //确认参数有效,若无效则返回Null if (dt == null) return list; else if (dt.Rows.Count == 0) return list; Dictionary dicField = new Dictionary(); Dictionary dicProperty = new Dictionary(); Type type = typeof(T); //创建字段字典,方便查找字段名 type.GetFields().ForEach(aFiled => { dicField.Add(aFiled.Name.ToLower(), aFiled.Name); }); //创建属性字典,方便查找属性名 type.GetProperties().ForEach(aProperty => { dicProperty.Add(aProperty.Name.ToLower(), aProperty.Name); }); for (int i = 0; i < dt.Rows.Count; i++) { //创建泛型对象 T _t = Activator.CreateInstance(); for (int j = 0; j < dt.Columns.Count; j++) { string memberKey = dt.Columns[j].ColumnName.ToLower(); //字段赋值 if (dicField.ContainsKey(memberKey)) { FieldInfo theField = type.GetField(dicField[memberKey]); var dbValue = dt.Rows[i][j]; if (dbValue.GetType() == typeof(DBNull)) dbValue = null; if (dbValue != null) { Type memberType = theField.FieldType; if (memberType.IsGenericType && memberType.GetGenericTypeDefinition().Equals(typeof(Nullable<>))) { NullableConverter newNullableConverter = new NullableConverter(memberType); dbValue = newNullableConverter.ConvertFrom(dbValue); } else { dbValue = Convert.ChangeType(dbValue, memberType); } } theField.SetValue(_t, dbValue); } //属性赋值 if (dicProperty.ContainsKey(memberKey)) { PropertyInfo theProperty = type.GetProperty(dicProperty[memberKey]); var dbValue = dt.Rows[i][j]; if (dbValue.GetType() == typeof(DBNull)) dbValue = null; if (dbValue != null) { Type memberType = theProperty.PropertyType; if (memberType.IsGenericType && memberType.GetGenericTypeDefinition().Equals(typeof(Nullable<>))) { NullableConverter newNullableConverter = new NullableConverter(memberType); dbValue = newNullableConverter.ConvertFrom(dbValue); } else { dbValue = Convert.ChangeType(dbValue, memberType); } } theProperty.SetValue(_t, dbValue); } } list.Add(_t); } return list; } /// /// DataTable转List /// /// 转换类型 /// 数据源 /// public static List EmitToList(this DataTable dt) { //确认参数有效 if (dt == null) return null; List list = new List(); var objBuilder = EmitHelper.CreateBuilder(typeof(T)); for (int i = 0; i < dt.Rows.Count; i++) { //创建泛型对象 T _t = (T)objBuilder(); //获取对象所有属性 PropertyInfo[] propertyInfo = _t.GetType().GetProperties(); for (int j = 0; j < dt.Columns.Count; j++) { foreach (PropertyInfo info in propertyInfo) { //属性名称和列名相同时赋值 if (dt.Columns[j].ColumnName.ToUpper().Equals(info.Name.ToUpper())) { if (dt.Rows[i][j] != DBNull.Value) { info.SetValue(_t, dt.Rows[i][j], null); } else { info.SetValue(_t, null, null); } break; } } } list.Add(_t); } return list; } /// ///将DataTable转换为标准的CSV字符串 /// /// 数据表 /// 返回标准的CSV public static string ToCsvStr(this DataTable dt) { //以半角逗号(即,)作分隔符,列为空也要表达其存在。 //列内容如存在半角逗号(即,)则用半角引号(即"")将该字段值包含起来。 //列内容如存在半角引号(即")则应替换成半角双引号("")转义,并用半角引号(即"")将该字段值包含起来。 StringBuilder sb = new StringBuilder(); DataColumn colum; foreach (DataRow row in dt.Rows) { for (int i = 0; i < dt.Columns.Count; i++) { colum = dt.Columns[i]; if (i != 0) sb.Append(","); if (colum.DataType == typeof(string) && row[colum].ToString().Contains(",")) { sb.Append("\"" + row[colum].ToString().Replace("\"", "\"\"") + "\""); } else sb.Append(row[colum].ToString()); } sb.AppendLine(); } return sb.ToString(); } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.DateTime.cs ================================================ using System; using System.Globalization; namespace Coldairarrow.Util { public static partial class Extention { /// /// 获取某一日期是该年中的第几周 /// /// 日期 /// 该日期在该年中的周数 public static int GetWeekOfYear(this DateTime dateTime) { GregorianCalendar gc = new GregorianCalendar(); return gc.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Monday); } /// /// 获取Js格式的timestamp /// /// 日期 /// public static long ToJsTimestamp(this DateTime dateTime) { var startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1, 0, 0, 0, 0)); long result = (dateTime.Ticks - startTime.Ticks) / 10000; //除10000调整为13位 return result; } /// /// 获取js中的getTime() /// /// 日期 /// public static Int64 JsGetTime(this DateTime dt) { Int64 retval = 0; var st = new DateTime(1970, 1, 1); TimeSpan t = (dt.ToUniversalTime() - st); retval = (Int64)(t.TotalMilliseconds + 0.5); return retval; } /// /// 返回默认时间1970-01-01 /// /// 时间日期 /// public static DateTime Default(this DateTime dt) { return DateTime.Parse("1970-01-01"); } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.Delegate.cs ================================================ using System; using System.Threading.Tasks; namespace Coldairarrow.Util { /// /// 拓展方法静态类 /// public static partial class Extention { /// /// 异步,按顺序执行第一个方法和第二个方法 /// /// 第一个方法 /// 下一个方法 public static void Done(this Action firstFunc, Action next) { DelegateHelper.RunAsync(firstFunc, next); } /// /// 异步,按顺序执行第一个方法和下一个方法 /// /// 第一个方法 /// 下一个方法 public static void Done(this Func firstFunc, Action next) { DelegateHelper.RunAsync(firstFunc, next); } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.ExpandoObject.cs ================================================ using System; using System.Collections.Generic; using System.Data; using System.Dynamic; using System.Linq; namespace Coldairarrow.Util { public static partial class Extention { /// /// 添加属性 /// /// 动态对象 /// 属性名 /// 属性值 public static void AddProperty(this ExpandoObject expandoObj,string propertyName,object value) { var obj = (IDictionary)expandoObj; if (obj.ContainsKey(propertyName)) throw new Exception("已存在该属性!"); else obj.Add(propertyName, value); } /// /// 设置属性 /// /// 动态对象 /// 属性名 /// 属性值 public static void SetProperty(this ExpandoObject expandoObj, string propertyName, object value) { var obj = (IDictionary)expandoObj; if (!obj.ContainsKey(propertyName)) obj.Add(propertyName, value); else obj[propertyName] = value; } /// /// 获取属性 /// /// 动态对象 /// 属性名 /// public static object GetProperty(this ExpandoObject expandoObj, string propertyName) { var obj = (IDictionary)expandoObj; if (!obj.ContainsKey(propertyName)) throw new Exception("不存在该属性!"); else return obj[propertyName]; } /// /// 获取所有属性 /// /// 动态对象 /// public static List GetProperties(this ExpandoObject expandoObj) { var obj = (IDictionary)expandoObj; return obj.Keys.CastToList(); } /// /// 删除属性 /// /// 动态对象 /// 属性名 public static void RemoveProperty(this ExpandoObject expandoObj, string propertyName) { var obj = (IDictionary)expandoObj; if (!obj.ContainsKey(propertyName)) throw new Exception("不存在该属性!"); else obj.Remove(propertyName); } /// /// 将动态属性对象ExpandoObject列表转为DataTable /// /// 数据源 /// public static DataTable ToDataTable(this IEnumerable dataList) { DataTable dt = new DataTable(); if (dataList.IsNullOrEmpty()) return null; else if (dataList.Count() == 0) return dt; else { var aEntity = dataList.FirstOrDefault(); var properties = aEntity.GetProperties(); properties.ForEach(aProperty => { dt.Columns.Add(aProperty); }); dataList.ForEach((aData,index) => { dt.Rows.Add(dt.NewRow()); properties.ForEach(aProperty => { dt.Rows[index][aProperty] = aData.GetProperty(aProperty); }); }); } return dt; } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.Expression.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; namespace Coldairarrow.Util { public static partial class Extention { #region 拓展BuildExtendSelectExpre方法 /// /// 组合继承属性选择表达式树,无拓展参数 /// TResult将继承TBase的所有属性 /// /// 原数据类型 /// 返回类型 /// 拓展表达式 /// public static Expression> BuildExtendSelectExpre(this Expression> expression) where TResult : TBase { return GetExtendSelectExpre>(expression); } /// /// 组合继承属性选择表达式树,1个拓展参数 /// TResult将继承TBase的所有属性 /// /// 原数据类型 /// 拓展类型1 /// 返回类型 /// 拓展表达式 /// public static Expression> BuildExtendSelectExpre(this Expression> expression) where TResult : TBase { return GetExtendSelectExpre>(expression); } /// /// 组合继承属性选择表达式树,2个拓展参数 /// TResult将继承TBase的所有属性 /// /// 原数据类型 /// 拓展类型1 /// 拓展类型2 /// 返回类型 /// 拓展表达式 /// public static Expression> BuildExtendSelectExpre(this Expression> expression) where TResult : TBase { return GetExtendSelectExpre>(expression); } /// /// 组合继承属性选择表达式树,3个拓展参数 /// TResult将继承TBase的所有属性 /// /// 原数据类型 /// 拓展类型1 /// 拓展类型2 /// 拓展类型3 /// 返回类型 /// 拓展表达式 /// public static Expression> BuildExtendSelectExpre(this Expression> expression) where TResult : TBase { return GetExtendSelectExpre>(expression); } /// /// 组合继承属性选择表达式树,4个拓展参数 /// TResult将继承TBase的所有属性 /// /// 原数据类型 /// 拓展类型1 /// 拓展类型2 /// 拓展类型3 /// 拓展类型4 /// 返回类型 /// 拓展表达式 /// public static Expression> BuildExtendSelectExpre(this Expression> expression) where TResult : TBase { return GetExtendSelectExpre>(expression); } /// /// 组合继承属性选择表达式树,5个拓展参数 /// TResult将继承TBase的所有属性 /// /// 原数据类型 /// 拓展类型1 /// 拓展类型2 /// 拓展类型3 /// 拓展类型4 /// 拓展类型5 /// 返回类型 /// 拓展表达式 /// public static Expression> BuildExtendSelectExpre(this Expression> expression) where TResult : TBase { return GetExtendSelectExpre>(expression); } /// /// 组合继承属性选择表达式树,6个拓展参数 /// TResult将继承TBase的所有属性 /// /// 原数据类型 /// 拓展类型1 /// 拓展类型2 /// 拓展类型3 /// 拓展类型4 /// 拓展类型5 /// 拓展类型6 /// 返回类型 /// 拓展表达式 /// public static Expression> BuildExtendSelectExpre(this Expression> expression) where TResult : TBase { return GetExtendSelectExpre>(expression); } /// /// 组合继承属性选择表达式树,7个拓展参数 /// TResult将继承TBase的所有属性 /// /// 原数据类型 /// 拓展类型1 /// 拓展类型2 /// 拓展类型3 /// 拓展类型4 /// 拓展类型5 /// 拓展类型6 /// 拓展类型7 /// 返回类型 /// 拓展表达式 /// public static Expression> BuildExtendSelectExpre(this Expression> expression) where TResult : TBase { return GetExtendSelectExpre>(expression); } /// /// 组合继承属性选择表达式树,8个拓展参数 /// TResult将继承TBase的所有属性 /// /// 原数据类型 /// 拓展类型1 /// 拓展类型2 /// 拓展类型3 /// 拓展类型4 /// 拓展类型5 /// 拓展类型6 /// 拓展类型7 /// 拓展类型8 /// 返回类型 /// 拓展表达式 /// public static Expression> BuildExtendSelectExpre(this Expression> expression) where TResult : TBase { return GetExtendSelectExpre>(expression); } /// /// 组合继承属性选择表达式树,9个拓展参数 /// TResult将继承TBase的所有属性 /// /// 原数据类型 /// 拓展类型1 /// 拓展类型2 /// 拓展类型3 /// 拓展类型4 /// 拓展类型5 /// 拓展类型6 /// 拓展类型7 /// 拓展类型8 /// 拓展类型9 /// 返回类型 /// 拓展表达式 /// public static Expression> BuildExtendSelectExpre(this Expression> expression) where TResult : TBase { return GetExtendSelectExpre>(expression); } #endregion #region 拓展And和Or方法 /// /// 连接表达式与运算 /// /// 参数 /// 原表达式 /// 新的表达式 /// public static Expression> And(this Expression> one, Expression> another) { //创建新参数 var newParameter = Expression.Parameter(typeof(T), "parameter"); var parameterReplacer = new ParameterReplacer(newParameter); var left = parameterReplacer.Replace(one.Body); var right = parameterReplacer.Replace(another.Body); var body = Expression.And(left, right); return Expression.Lambda>(body, newParameter); } /// /// 连接表达式或运算 /// /// 参数 /// 原表达式 /// 新表达式 /// public static Expression> Or(this Expression> one, Expression> another) { //创建新参数 var newParameter = Expression.Parameter(typeof(T), "parameter"); var parameterReplacer = new ParameterReplacer(newParameter); var left = parameterReplacer.Replace(one.Body); var right = parameterReplacer.Replace(another.Body); var body = Expression.Or(left, right); return Expression.Lambda>(body, newParameter); } #endregion #region 拓展Expression的Invoke方法 public static TResult Invoke(this Expression> expression) { return expression.Compile().Invoke(); } public static TResult Invoke(this Expression> expression, T1 arg1) { return expression.Compile().Invoke(arg1); } public static TResult Invoke(this Expression> expression, T1 arg1, T2 arg2) { return expression.Compile().Invoke(arg1, arg2); } public static TResult Invoke(this Expression> expression, T1 arg1, T2 arg2, T3 arg3) { return expression.Compile().Invoke(arg1, arg2, arg3); } public static TResult Invoke(this Expression> expression, T1 arg1, T2 arg2, T3 arg3, T4 arg4) { return expression.Compile().Invoke(arg1, arg2, arg3, arg4); } public static TResult Invoke(this Expression> expression, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) { return expression.Compile().Invoke(arg1, arg2, arg3, arg4, arg5); } public static TResult Invoke(this Expression> expression, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) { return expression.Compile().Invoke(arg1, arg2, arg3, arg4, arg5, arg6); } public static TResult Invoke(this Expression> expression, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) { return expression.Compile().Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7); } public static TResult Invoke(this Expression> expression, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) { return expression.Compile().Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); } public static TResult Invoke(this Expression> expression, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) { return expression.Compile().Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); } public static TResult Invoke(this Expression> expression, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10) { return expression.Compile().Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); } #endregion #region 私有成员 private static Expression GetExtendSelectExpre(Expression expression) { NewExpression newBody = Expression.New(typeof(TResult)); MemberInitExpression oldExpression = (MemberInitExpression)expression.Body; ParameterExpression[] oldParamters = expression.Parameters.ToArray(); List existsProperties = new List(); oldExpression.Bindings.ForEach(aBinding => { existsProperties.Add(aBinding.Member.Name); }); List bindings = oldExpression.Bindings.ToList(); typeof(TBase).GetProperties().Where(x => !existsProperties.Contains(x.Name)).ForEach(aProperty => { MemberInfo newMember = typeof(TResult).GetMember(aProperty.Name)[0]; MemberBinding newMemberBinding = Expression.Bind(newMember, Expression.PropertyOrField(oldParamters[0], aProperty.Name)); bindings.Add(newMemberBinding); }); var body = Expression.MemberInit(newBody, bindings.ToArray()); var resExpression = Expression.Lambda(body, oldParamters); return resExpression; } #endregion } /// /// 继承ExpressionVisitor类,实现参数替换统一 /// class ParameterReplacer : ExpressionVisitor { public ParameterReplacer(ParameterExpression paramExpr) { Parameter = paramExpr; } //新的表达式参数 private ParameterExpression Parameter { get; set; } public Expression Replace(Expression expr) { return this.Visit(expr); } /// /// 覆盖父方法,返回新的参数 /// /// /// protected override Expression VisitParameter(ParameterExpression p) { return Parameter; } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.Guid.cs ================================================ using System; namespace Coldairarrow.Util { public static partial class Extention { /// /// 转为有序的GUID /// 注:长度为50字符 /// /// 新的GUID /// public static string ToSequentialGuid(this Guid guid) { var timeStr = (DateTime.Now.Ticks / 10000).ToString("x8"); var newGuid = $"{timeStr.PadLeft(13, '0')}-{guid}"; return newGuid; } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.IEnumerable.cs ================================================ using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Linq; using System.Linq.Dynamic; namespace Coldairarrow.Util { public static partial class Extention { /// /// 数据替换 /// 注:支持一次性替换多个,支持所有可迭代类型,KeyValuePair键值对中Key为需要替换的数据,Value为替换后数据 /// /// 泛型 /// 数据源 /// 替换模式 /// public static IEnumerable Replace(this IEnumerable source, params KeyValuePair, IEnumerable>[] parttern) { List resList = new List(); List sourceList = source.ToList(); for (int i = 0; i < sourceList.Count; i++) { bool replaced = false; parttern.ForEach(aMatch => { var oldvalue = aMatch.Key.ToList(); var newvalue = aMatch.Value.ToList(); bool needReplace = true; for(int j = 0; j < oldvalue.Count; j++) { if (!sourceList[i + j].Equals(oldvalue[j])) needReplace = false; } if (needReplace) { resList.AddRange(newvalue); i = i + oldvalue.Count - 1; replaced = true; } }); if (!replaced) resList.Add(sourceList[i]); } return resList; } /// /// 复制序列中的数据 /// /// 泛型 /// 原数据 /// 原数据开始复制的起始位置 /// 需要复制的数据长度 /// public static IEnumerable Copy(this IEnumerable iEnumberable, int startIndex, int length) { var sourceArray = iEnumberable.ToArray(); T[] newArray = new T[length]; Array.Copy(sourceArray, startIndex, newArray, 0, length); return newArray; } /// /// 序列连接对象 /// /// 泛型 /// 原序列 /// 对象 /// public static IEnumerable Concat(this IEnumerable iEnumberable, T obj) { return iEnumberable.Concat(new T[] { obj }); } /// /// 给IEnumerable拓展ForEach方法 /// /// 模型类 /// 数据源 /// 方法 public static void ForEach(this IEnumerable iEnumberable, Action func) { foreach (var item in iEnumberable) { func(item); } } /// /// 给IEnumerable拓展ForEach方法 /// /// 模型类 /// 数据源 /// 方法 public static void ForEach(this IEnumerable iEnumberable, Action func) { var array = iEnumberable.ToArray(); for (int i = 0; i < array.Count(); i++) { func(array[i], i); } } /// /// IEnumerable转换为List'T' /// /// 参数 /// 数据源 /// public static List CastToList(this IEnumerable source) { return new List(source.Cast()); } /// /// 将IEnumerable'T'转为对应的DataTable /// /// 数据模型 /// 数据源 /// DataTable public static DataTable ToDataTable(this IEnumerable iEnumberable) { return iEnumberable.ToJson().ToDataTable(); } /// /// 获取分页数据 /// /// 泛型 /// 数据源 /// 分页参数 /// public static IEnumerable GetPagination(this IEnumerable iEnumberable, Pagination pagination) { return iEnumberable.OrderBy($@"{pagination.SortField} {pagination.SortType}").Skip((pagination.page - 1) * pagination.rows).Take(pagination.rows).ToList(); } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.IQueryable.cs ================================================ using System.Linq; using System.Linq.Dynamic; namespace Coldairarrow.Util { /// /// IQueryable"T"的拓展操作 /// 作者:Coldairarrow /// public static partial class Extention { /// /// 获取分页后的数据 /// /// 实体参数 /// IQueryable数据源 /// 当前页 /// 每页行数 /// 排序列 /// 排序类型 /// 总记录数 /// 总页数 /// public static IQueryable GetPagination(this IQueryable source, int pageIndex, int pageRows, string orderColumn, string orderType, ref int count, ref int pages) { Pagination pagination = new Pagination { page = pageIndex, rows = pageRows, sord = orderType, sidx = orderColumn }; return source.GetPagination(pagination); } /// /// 获取分页后的数据 /// /// 实体类型 /// 数据源IQueryable /// 分页参数 /// public static IQueryable GetPagination(this IQueryable source, Pagination pagination) { pagination.records = source.Count(); source = source.OrderBy($"{pagination.sidx} {pagination.sord}"); return source.Skip((pagination.page - 1) * pagination.rows).Take(pagination.rows); } /// /// 获取分页后的数据 /// /// 数据源IQueryable /// 分页参数 /// public static IQueryable GetPagination(this IQueryable source, Pagination pagination) { pagination.records = source.Count(); source = source.OrderBy($"{pagination.sidx} {pagination.sord}"); return source.Skip((pagination.page - 1) * pagination.rows).Take(pagination.rows); } /// /// 动态排序法 /// /// 实体类型 /// IQueryable数据源 /// 排序的列 /// 排序的方法 /// public static IQueryable OrderBy(this IQueryable source, string sortColumn, string sortType) { return source.OrderBy(string.Format("{0} {1}", sortColumn, sortType)); } /// /// 拓展IQueryable"T"方法操作 /// /// 数据类型 /// 数据源 /// public static IQueryable AsExpandable(this IQueryable source) { return LinqKit.Extensions.AsExpandable(source); } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.Int.cs ================================================ using System; namespace Coldairarrow.Util { public static partial class Extention { /// /// jsGetTime转为DateTime /// /// js中Date.getTime() /// public static DateTime ToDateTime_From_JsGetTime(this long jsGetTime) { DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); long lTime = long.Parse(jsGetTime + "0000"); //说明下,时间格式为13位后面补加4个"0",如果时间格式为10位则后面补加7个"0",至于为什么我也不太清楚,也是仿照人家写的代码转换的 TimeSpan toNow = new TimeSpan(lTime); DateTime dtResult = dtStart.Add(toNow); //得到转换后的时间 return dtResult; } /// /// 将数字转为对应的字节数组 /// /// 数字 /// public static byte[] ToBytes(this int num) { return BitConverter.GetBytes(num); } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.Object.cs ================================================ using Newtonsoft.Json; using System; using System.IO; using System.Reflection; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; namespace Coldairarrow.Util { public static partial class Extention { /// /// 构造函数 /// static Extention() { JsonSerializerSettings setting = new JsonSerializerSettings(); JsonConvert.DefaultSettings = new Func(() => { //日期类型默认格式化处理 setting.DateFormatHandling = DateFormatHandling.MicrosoftDateFormat; setting.DateFormatString = "yyyy-MM-dd HH:mm:ss"; return setting; }); } /// /// 将一个object对象序列化,返回一个byte[] /// /// 能序列化的对象 /// public static byte[] ToBytes(this object obj) { using (MemoryStream ms = new MemoryStream()) { IFormatter formatter = new BinaryFormatter(); formatter.Serialize(ms, obj); return ms.GetBuffer(); } } /// /// 判断是否为Null或者空 /// /// 对象 /// public static bool IsNullOrEmpty(this object obj) { if (obj == null) return true; else { string objStr = obj.ToString(); return string.IsNullOrEmpty(objStr); } } /// /// 将对象序列化成Json字符串 /// /// 需要序列化的对象 /// public static string ToJson(this object obj) { return JsonConvert.SerializeObject(obj); } /// /// 实体类转json数据,速度快 /// /// 实体类 /// public static string EntityToJson(this object t) { if (t == null) return null; string jsonStr = ""; jsonStr += "{"; PropertyInfo[] infos = t.GetType().GetProperties(); for (int i = 0; i < infos.Length; i++) { jsonStr = jsonStr + "\"" + infos[i].Name + "\":\"" + infos[i].GetValue(t).ToString() + "\""; if (i != infos.Length - 1) jsonStr += ","; } jsonStr += "}"; return jsonStr; } /// /// 深复制 /// /// 类型 /// 对象 /// public static T DeepClone(this T obj) where T : class { if (obj == null) return null; return obj.ToJson().ToObject(); } /// /// 初始化时间默认值 /// /// 对象 /// public static T InitDateTime(this T obj) where T : class { obj.GetType().GetProperties().ForEach(aProperty => { if (aProperty.PropertyType == typeof(DateTime)) { aProperty.SetValue(obj, DateTime.Now); } }); return obj; } /// /// 将对象序列化为XML字符串 /// /// 对象类型 /// 对象 /// public static string ToXmlStr(this T obj) { var jsonStr = obj.ToJson(); var xmlDoc = JsonConvert.DeserializeXmlNode(jsonStr); string xmlDocStr = xmlDoc.InnerXml; return xmlDocStr; } /// /// 将对象序列化为XML字符串 /// /// 对象类型 /// 对象 /// 根节点名(建议设为xml) /// public static string ToXmlStr(this T obj, string rootNodeName) { var jsonStr = obj.ToJson(); var xmlDoc = JsonConvert.DeserializeXmlNode(jsonStr, rootNodeName); string xmlDocStr = xmlDoc.InnerXml; return xmlDocStr; } /// /// 获取某属性值 /// /// 对象 /// 属性名 /// public static object GetPropertyValue(this object obj, string propertyName) { return obj.GetType().GetProperty(propertyName, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static).GetValue(obj); } /// /// 获取某属性值 /// /// 对象 /// 属性名 /// 值 /// public static void SetPropertyValue(this object obj, string propertyName, object value) { obj.GetType().GetProperty(propertyName, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static).SetValue(obj, value); } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.Stream.cs ================================================ using System.IO; using System.Text; namespace Coldairarrow.Util { public static partial class Extention { /// /// 将流Stream转为byte数组 /// /// /// public static byte[] ReadToBytes(this Stream stream) { stream.Seek(0, SeekOrigin.Begin); byte[] bytes = new byte[stream.Length]; stream.Read(bytes, 0, bytes.Length); stream.Seek(0, SeekOrigin.Begin); return bytes; } /// /// 将流读为字符串 /// 注:使用默认编码 /// /// 流 /// public static string ReadToString(this Stream stream) { return ReadToString(stream, Encoding.Default); } /// /// 将流读为字符串 /// 注:使用指定编码 /// /// 流 /// 指定编码 /// public static string ReadToString(this Stream stream, Encoding encoding) { string resStr = string.Empty; stream.Position = 0; var streamReader = new StreamReader(stream, encoding); resStr = streamReader.ReadToEnd(); stream.Position = 0; return resStr; } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.String.cs ================================================ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Data; using System.Globalization; using System.Linq; using System.Net; using System.Reflection; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; using System.Xml; namespace Coldairarrow.Util { public static partial class Extention { /// /// 转为字节数组 /// /// base64字符串 /// public static byte[] ToBytes_FromBase64Str(this string base64Str) { return Convert.FromBase64String(base64Str); } /// /// 转换为MD5加密后的字符串(默认加密为32位) /// /// /// public static string ToMD5String(this string str) { MD5 md5 = MD5.Create(); byte[] inputBytes = Encoding.UTF8.GetBytes(str); byte[] hashBytes = md5.ComputeHash(inputBytes); StringBuilder sb = new StringBuilder(); for (int i = 0; i < hashBytes.Length; i++) { sb.Append(hashBytes[i].ToString("x2")); } md5.Dispose(); return sb.ToString(); } /// /// Base64加密 /// 注:默认采用UTF8编码 /// /// 待加密的明文 /// 加密后的字符串 public static string Base64Encode(this string source) { return Base64Encode(source, Encoding.UTF8); } /// /// Base64加密 /// /// 待加密的明文 /// 加密采用的编码方式 /// public static string Base64Encode(this string source, Encoding encoding) { string encode = string.Empty; byte[] bytes = encoding.GetBytes(source); try { encode = Convert.ToBase64String(bytes); } catch { encode = source; } return encode; } /// /// Base64解密 /// 注:默认使用UTF8编码 /// /// 待解密的密文 /// 解密后的字符串 public static string Base64Decode(this string result) { return Base64Decode(result, Encoding.UTF8); } /// /// Base64解密 /// /// 待解密的密文 /// 解密采用的编码方式,注意和加密时采用的方式一致 /// 解密后的字符串 public static string Base64Decode(this string result, Encoding encoding) { string decode = string.Empty; byte[] bytes = Convert.FromBase64String(result); try { decode = encoding.GetString(bytes); } catch { decode = result; } return decode; } /// /// 计算SHA1摘要 /// 注:默认使用UTF8编码 /// /// 字符串 /// public static byte[] ToSHA1Bytes(this string str) { return str.ToSHA1Bytes(Encoding.UTF8); } /// /// 计算SHA1摘要 /// /// 字符串 /// 编码 /// public static byte[] ToSHA1Bytes(this string str, Encoding encoding) { SHA1 sha1 = new SHA1CryptoServiceProvider(); byte[] inputBytes = encoding.GetBytes(str); byte[] outputBytes = sha1.ComputeHash(inputBytes); return outputBytes; } /// /// 转为SHA1哈希加密字符串 /// 注:默认使用UTF8编码 /// /// 字符串 /// public static string ToSHA1String(this string str) { return str.ToSHA1String(Encoding.UTF8); } /// /// 转为SHA1哈希 /// /// 字符串 /// 编码 /// public static string ToSHA1String(this string str, Encoding encoding) { byte[] sha1Bytes = str.ToSHA1Bytes(encoding); string resStr = BitConverter.ToString(sha1Bytes); return resStr.Replace("-", "").ToLower(); } /// /// string转int /// /// 字符串 /// public static int ToInt(this string str) { str = str.Replace("\0", ""); if (string.IsNullOrEmpty(str)) return 0; return Convert.ToInt32(str); } /// /// 二进制字符串转为Int /// /// 二进制字符串 /// public static int ToInt_FromBinString(this string str) { return Convert.ToInt32(str, 2); } /// /// 将16进制字符串转为Int /// /// 数值 /// public static int ToInt0X(this string str) { int num = Int32.Parse(str, NumberStyles.HexNumber); return num; } /// /// 转换为double /// /// 字符串 /// public static double ToDouble(this string str) { return Convert.ToDouble(str); } /// /// string转byte[] /// /// 字符串 /// public static byte[] ToBytes(this string str) { return Encoding.Default.GetBytes(str); } /// /// string转byte[] /// /// 字符串 /// 需要的编码 /// public static byte[] ToBytes(this string str, Encoding theEncoding) { return theEncoding.GetBytes(str); } /// /// 将16进制字符串转为Byte数组 /// /// 16进制字符串(2个16进制字符表示一个Byte) /// public static byte[] To0XBytes(this string str) { List resBytes = new List(); for (int i = 0; i < str.Length; i = i + 2) { string numStr = $@"{str[i]}{str[i + 1]}"; resBytes.Add((byte)numStr.ToInt0X()); } return resBytes.ToArray(); } /// /// 将ASCII码形式的字符串转为对应字节数组 /// 注:一个字节一个ASCII码字符 /// /// 字符串 /// public static byte[] ToASCIIBytes(this string str) { return str.ToList().Select(x => (byte)x).ToArray(); } /// /// 转换为日期格式 /// /// /// public static DateTime ToDateTime(this string str) { return Convert.ToDateTime(str); } /// /// 将Json字符串反序列化为对象 /// /// 对象类型 /// Json字符串 /// public static T ToObject(this string jsonStr) { return JsonConvert.DeserializeObject(jsonStr); } /// /// 删除Json字符串中键中的@符号 /// /// json字符串 /// public static string RemoveAt(this string jsonStr) { Regex reg = new Regex("\"@([^ \"]*)\"\\s*:\\s*\"(([^ \"]+\\s*)*)\""); string strPatten = "\"$1\":\"$2\""; return reg.Replace(jsonStr, strPatten); } /// /// 将Json字符串反序列化为对象 /// /// json字符串 /// 对象类型 /// public static object ToObject(this string jsonStr, Type type) { return JsonConvert.DeserializeObject(jsonStr, type); } /// /// 将XML字符串反序列化为对象 /// /// 对象类型 /// XML字符串 /// public static T XmlStrToObject(this string xmlStr) { XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlStr); string jsonJsonStr = JsonConvert.SerializeXmlNode(doc); return JsonConvert.DeserializeObject(jsonJsonStr); } /// /// 将XML字符串反序列化为对象 /// /// XML字符串 /// public static JObject XmlStrToJObject(this string xmlStr) { XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlStr); string jsonJsonStr = JsonConvert.SerializeXmlNode(doc); return JsonConvert.DeserializeObject(jsonJsonStr); } /// /// 将Json字符串转为List'T' /// /// 对象类型 /// /// public static List ToList(this string jsonStr) { return string.IsNullOrEmpty(jsonStr) ? null : JsonConvert.DeserializeObject>(jsonStr); } /// /// 将Json字符串转为DataTable /// /// Json字符串 /// public static DataTable ToDataTable(this string jsonStr) { return jsonStr == null ? null : JsonConvert.DeserializeObject(jsonStr); } /// /// 将Json字符串转为JObject /// /// Json字符串 /// public static JObject ToJObject(this string jsonStr) { return jsonStr == null ? JObject.Parse("{}") : JObject.Parse(jsonStr.Replace(" ", "")); } /// /// 将Json字符串转为JArray /// /// Json字符串 /// public static JArray ToJArray(this string jsonStr) { return jsonStr == null ? JArray.Parse("[]") : JArray.Parse(jsonStr.Replace(" ", "")); } /// /// json数据转实体类,仅仅应用于单个实体类,速度非常快 /// /// 泛型参数 /// json字符串 /// public static T ToEntity(this string json) { if (json == null || json == "") return default(T); Type type = typeof(T); object obj = Activator.CreateInstance(type, null); foreach (var item in type.GetProperties()) { PropertyInfo info = obj.GetType().GetProperty(item.Name); string pattern; pattern = "\"" + item.Name + "\":\"(.*?)\""; foreach (Match match in Regex.Matches(json, pattern)) { switch (item.PropertyType.ToString()) { case "System.String": info.SetValue(obj, match.Groups[1].ToString(), null); break; case "System.Int32": info.SetValue(obj, match.Groups[1].ToString().ToInt(), null); ; break; case "System.Int64": info.SetValue(obj, Convert.ToInt64(match.Groups[1].ToString()), null); ; break; case "System.DateTime": info.SetValue(obj, Convert.ToDateTime(match.Groups[1].ToString()), null); ; break; } } } return (T)obj; } /// /// 转为首字母大写 /// /// 字符串 /// public static string ToFirstUpperStr(this string str) { return str.Substring(0, 1).ToUpper() + str.Substring(1); } /// /// 转为首字母小写 /// /// 字符串 /// public static string ToFirstLowerStr(this string str) { return str.Substring(0, 1).ToLower() + str.Substring(1); } /// /// 转为网络终结点IPEndPoint /// = /// 字符串 /// public static IPEndPoint ToIPEndPoint(this string str) { IPEndPoint iPEndPoint = null; try { string[] strArray = str.Split(':').ToArray(); string addr = strArray[0]; int port = Convert.ToInt32(strArray[1]); iPEndPoint = new IPEndPoint(IPAddress.Parse(addr), port); } catch { iPEndPoint = null; } return iPEndPoint; } /// /// 将枚举类型的文本转为枚举类型 /// /// 枚举类型 /// 枚举文本 /// public static T ToEnum(this string enumText) { var values = typeof(T).GetEnumValues().CastToList(); return values.Where(x => x.ToString() == enumText).FirstOrDefault(); } } } ================================================ FILE: src/Coldairarrow.Util/Extention/Extention.Type.cs ================================================ using System; namespace Coldairarrow.Util { public static partial class Extention { /// /// 转换为对应的Nullable'T'类型 /// /// 值类型 /// public static Type ToNullableType(this Type type) { if (type.IsValueType) { string fullName = $"System.Nullable`1[[{type.FullName}, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"; return Type.GetType(fullName); } else return type; } } } ================================================ FILE: src/Coldairarrow.Util/GlobalSwitch.cs ================================================ using System; namespace Coldairarrow.Util { /// /// 全局控制 /// public static class GlobalSwitch { #region 构造函数 static GlobalSwitch() { #if !DEBUG RunModel = RunModel.Publish; #endif } #endregion #region 参数 /// /// 项目名 /// public static string ProjectName { get; } = "Coldairarrow.Fx.Net.Easyui.GitHub"; /// /// 网站根地址 /// public static string WebRootUrl { get; set; } = "http://localhost:63612"; #endregion #region 运行 /// /// 运行模式 /// public static RunModel RunModel { get; } = RunModel.LocalTest; #endregion #region 数据库相关 /// /// 默认数据库类型 /// public static DatabaseType DatabaseType { get; } = DatabaseType.SqlServer; /// /// 默认数据库连接名 /// public static string DefaultDbConName { get; } = "BaseDb"; /// /// 默认实体命名空间 /// public static string DefaultEntityNamespace { get; } = "Coldairarrow.Entity"; #endregion #region 缓存相关 /// /// 默认缓存 /// public static CacheType CacheType { get; } = CacheType.SystemCache; /// /// Redis配置字符串 /// public static string RedisConfig { get; } = "localhost:6379"; /// /// 是否开启Redis缓存 /// public static bool OpenRedisCache { get; } = false; #endregion #region 日志相关 /// /// 日志记录方式 /// public static LoggerType LoggerType { get; set; } = LoggerType.RDBMS; /// /// ElasticSearch服务器配置 /// public static Uri[] ElasticSearchNodes { get; set; } = new Uri[] { new Uri("http://localhost:9200/") }; #endregion } /// /// 运行模式 /// public enum RunModel { /// /// 本地测试模式 /// 注:默认Admin账户,不需要登录.只有使用该模式才会有快速开发功能 /// LocalTest, /// /// 发布模式 /// Publish } /// /// 默认缓存类型 /// public enum CacheType { /// /// 系统缓存 /// SystemCache, /// /// Redis缓存 /// RedisCache } } ================================================ FILE: src/Coldairarrow.Util/Helper/AsposeOfficeHelper.cs ================================================ using Aspose.Cells; using System.Data; using System.IO; namespace Coldairarrow.Util { /// /// 使用Aspose组件的Office文件操作帮助类 /// public class AsposeOfficeHelper { /// /// 将DataTable输出为字节数组 /// /// 表格数据 /// Byte数组 public static byte[] DataTableToExcelBytes(DataTable dt) { Workbook book = new Workbook(); Worksheet sheet = book.Worksheets[0]; Cells cells = sheet.Cells; int Colnum = dt.Columns.Count;//表格列数 int Rownum = dt.Rows.Count;//表格行数 //生成行 列名行 for (int i = 0; i < Colnum; i++) { cells[0, i].PutValue(dt.Columns[i].ColumnName); } //生成数据行 for (int i = 0; i < Rownum; i++) { for (int k = 0; k < Colnum; k++) { cells[1 + i, k].PutValue(dt.Rows[i][k].ToString()); } } //自动行高,列宽 sheet.AutoFitColumns(); sheet.AutoFitRows(); //将DataTable写入内存流 var ms = new MemoryStream(); book.Save(ms, SaveFormat.Excel97To2003); return ms.ToArray(); } /// /// 从excel文件导入数据 /// 注:默认将第一行当作标题行,即不当作数据 /// /// 文件名 /// public static DataTable ReadExcel(string fileNmae) { Workbook book = new Workbook(fileNmae); Worksheet sheet = book.Worksheets[0]; Cells cells = sheet.Cells; return cells.ExportDataTableAsString(0, 0, cells.MaxDataRow + 1, cells.MaxDataColumn + 1, true); } /// /// 从excel文件导入数据 /// /// 文件名 /// 是否将第一行当作标题行 /// public static DataTable ReadExcel(string fileNmae,bool exportColumnName) { Workbook book = new Workbook(fileNmae); Worksheet sheet = book.Worksheets[0]; Cells cells = sheet.Cells; return cells.ExportDataTableAsString(0, 0, cells.MaxDataRow + 1, cells.MaxDataColumn + 1, exportColumnName); } /// /// 从excel文件字节源导入 /// 注:默认将第一行当作标题行,即不当作数据 /// /// 文件字节源 /// public static DataTable ReadExcel(byte[] fileBytes) { return ReadExcel(fileBytes, true); } /// /// 从excel文件字节源导入 /// /// 文件字节源 /// 是否将第一行当作标题行 /// 第一行索引 /// 第一列索引 /// public static DataTable ReadExcel(byte[] fileBytes, bool exportColumnName, int firstRow = 0, int firstColumn = 0) { using (MemoryStream ms = new MemoryStream(fileBytes)) { Workbook book = new Workbook(ms); Worksheet sheet = book.Worksheets[0]; Cells cells = sheet.Cells; return cells.ExportDataTableAsString(firstRow, firstColumn, cells.MaxDataRow + 1 - firstRow, cells.MaxDataColumn + 1 - firstColumn, exportColumnName); } } } } ================================================ FILE: src/Coldairarrow.Util/Helper/BaiduApiHelper.cs ================================================ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Security.Cryptography; using System.Text; using System.Web; namespace Coldairarrow.Util { /// /// 百度接口签名帮助类 /// public class BaiduApiHelper { #region 构造函数 /// /// 构造函数 /// /// 百度AccessKeyId(AK) /// 百度SecretAccessKey(SK) public BaiduApiHelper(string accessKeyId,string secretAccessKey) { _accessKeyId = accessKeyId; _secretAccessKey = secretAccessKey; } #endregion #region 内部成员 private string _accessKeyId { get; } private string _secretAccessKey { get; } private string UriEncode(string input, bool encodeSlash = false) { StringBuilder builder = new StringBuilder(); foreach (byte b in Encoding.UTF8.GetBytes(input)) { if ((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || (b >= '0' && b <= '9') || b == '_' || b == '-' || b == '~' || b == '.') { builder.Append((char)b); } else if (b == '/') { if (encodeSlash) { builder.Append("%2F"); } else { builder.Append((char)b); } } else { builder.Append('%').Append(b.ToString("X2")); } } return builder.ToString(); } private string Hex(byte[] data) { var sb = new StringBuilder(); foreach (var b in data) { sb.Append(b.ToString("x2")); } return sb.ToString(); } private string CanonicalRequest(HttpWebRequest req) { Uri uri = req.RequestUri; StringBuilder canonicalReq = new StringBuilder(); canonicalReq.Append(req.Method).Append("\n").Append(UriEncode(Uri.UnescapeDataString(uri.AbsolutePath))).Append("\n"); var parameters = HttpUtility.ParseQueryString(uri.Query); List parameterStrings = new List(); foreach (KeyValuePair entry in parameters) { parameterStrings.Add(UriEncode(entry.Key) + '=' + UriEncode(entry.Value)); } parameterStrings.Sort(); canonicalReq.Append(string.Join("&", parameterStrings.ToArray())).Append("\n"); string host = uri.Host; if (!(uri.Scheme == "https" && uri.Port == 443) && !(uri.Scheme == "http" && uri.Port == 80)) { host += ":" + uri.Port; } canonicalReq.Append("host:" + UriEncode(host)); return canonicalReq.ToString(); } #endregion #region 外部接口 /// /// 发送POST请求 /// /// 请求方法,需要大写,列如(POST) /// 主机地址列如(http://sms.bj.baidubce.com) /// 接口地址列如(/bce/v2/message) /// 参数列表 /// public string RequestData(string method,string host, string url, Dictionary paramters=null) { string ak = _accessKeyId; string sk = _secretAccessKey; DateTime now = DateTime.Now; int expirationInSeconds = 1200; HttpWebRequest req = WebRequest.Create(host + url) as HttpWebRequest; Uri uri = req.RequestUri; req.Method = method; req.ContentType = "application/json"; if (paramters != null) { Stream requestStream = req.GetRequestStream(); byte[] data = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(paramters)); requestStream.Write(data, 0, data.Length); } string signDate = now.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ssK"); string authString = "bce-auth-v1/" + ak + "/" + signDate + "/" + expirationInSeconds; string signingKey = Hex(new HMACSHA256(Encoding.UTF8.GetBytes(sk)).ComputeHash(Encoding.UTF8.GetBytes(authString))); string canonicalRequestString = CanonicalRequest(req); string signature = Hex(new HMACSHA256(Encoding.UTF8.GetBytes(signingKey)).ComputeHash(Encoding.UTF8.GetBytes(canonicalRequestString))); string authorization = authString + "/host/" + signature; req.Headers.Add("x-bce-date", signDate); req.Headers.Add(HttpRequestHeader.Authorization, authorization); HttpWebResponse res; string message = ""; try { res = req.GetResponse() as HttpWebResponse; } catch (WebException e) { res = e.Response as HttpWebResponse; } message = new StreamReader(res.GetResponseStream()).ReadToEnd(); return message; } /// /// 发送短信 /// /// 手机号码 /// 验证码 /// public static bool SendMsg(string phoneNum,string code) { try { BaiduApiHelper baiduApiHelper = new BaiduApiHelper("", ""); string host = "http://sms.bj.baidubce.com"; string url = "/bce/v2/message"; Dictionary paramters = new Dictionary(); paramters.Add("invokeId", "SGf96VPF-WBBx-qbJK"); paramters.Add("phoneNumber", phoneNum); paramters.Add("templateCode", "smsTpl:e7476122a1c24e37b3b0de19d04ae900"); paramters.Add("contentVar", new { others = "你好", code = code }); string resJsonStr = baiduApiHelper.RequestData("POST", host, url, paramters); var resJson = JsonConvert.DeserializeObject(resJsonStr); return resJson["code"]?.ToString() == "1000"; } catch { return false; } } #endregion } } ================================================ FILE: src/Coldairarrow.Util/Helper/ConfigHelper.cs ================================================ using System.Configuration; namespace Coldairarrow.Util { /// /// 配置文件帮助类 /// public class ConfigHelper { /// /// 从AppSettings获取key的值 /// /// key /// public static string GetValue(string key) { return ConfigurationManager.AppSettings[key]; } /// /// 获取连接字符串 /// /// 连接字符串名 /// public static string GetConnectionString(string nameOfCon) { return ConfigurationManager.ConnectionStrings[nameOfCon].ConnectionString; } } } ================================================ FILE: src/Coldairarrow.Util/Helper/DbSearchHelper.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic; using System.Reflection; using System.Text; namespace Coldairarrow.Util { /// /// 数据库查询帮助类 /// public static class DbSearchHelper { /// /// 获取数据库统计数据 /// /// 数据源 /// 分组的列 /// 统计的列 /// 统计方法名(Max,Min,Average,Count()) /// public static List GetDbStatisData(this IQueryable dataSource, string groupColumn, string statisColumn, string funcName) { List resData = new List(); var q = dataSource.GroupBy(groupColumn, "it") .Select($"new (it.Key as Key,{funcName}(it.{statisColumn}) as Value)") .CastToList(); foreach (dynamic aData in q) { DbStatisData newData = new DbStatisData(); resData.Add(newData); newData.Key = aData.Key; newData.Value = aData.Value; } return resData; } /// /// 获取数据库统计数据 /// /// 数据源 /// 分组的列 /// 查询的配置项 /// public static List GetDbStatisData(this IQueryable dataSource, string groupColumn, SearchEntry[] searchEntris) { if (searchEntris.Count() == 0) throw new Exception("请输入至少一个查询配置项"); StringBuilder selectStr = new StringBuilder(); selectStr.Append("new (it.Key as Key"); int count = searchEntris.Count(); searchEntris.ForEach((item, index) => { string end = ""; if (index == count - 1) end = ")"; selectStr.Append($",{item.FuncName}(it.{item.StatisColoum}) as {item.ResultName}{end}"); }); List resData = new List(); var q = dataSource.GroupBy(groupColumn, "it") .Select(selectStr.ToString()) .CastToList(); foreach (dynamic aData in q) { DynamicModel newData = new DynamicModel(); resData.Add(newData); object obj = (object)aData; Type type = obj.GetType(); newData.AddProperty("Key", type.GetProperty("Key").GetValue(obj)); searchEntris.ForEach(item => { newData.AddProperty(item.ResultName, type.GetProperty(item.ResultName).GetValue(obj)); }); } return resData; } /// /// 获取IQueryable /// /// 包含获取IQueryable方法的对象 /// 获取IQueryable的方法名 /// 实体名 /// 命名空间 /// public static IQueryable GetIQueryable(object obj, string funcName, string entityName, string nameSpace) { Type type = obj.GetType(); MethodInfo method = type.GetMethod(funcName); var entityType = Assembly.Load(nameSpace).GetTypes().Where(x => x.Name.ToLower().Contains(entityName.ToLower())).FirstOrDefault(); if (entityType.IsNullOrEmpty()) throw new Exception("请输入有效的实体名!"); var iQueryable = (IQueryable)method.MakeGenericMethod(entityType).Invoke(obj, null); return iQueryable; } } /// /// 统计数据模型 /// public class DbStatisData { /// /// 分组查询的列 /// public string Key { get; set;} /// /// 统计后的数值 /// public double? Value { get; set; } } /// /// 统计查询配置项 /// public struct SearchEntry { /// /// 统计的列 /// public string StatisColoum { get; set; } /// /// 返回数据列名 /// public string ResultName { get; set; } /// /// 统计方法名(Max,Min,Average,Count()等) /// public string FuncName { get; set; } } } ================================================ FILE: src/Coldairarrow.Util/Helper/DelegateHelper.cs ================================================ using System; using System.Threading.Tasks; namespace Coldairarrow.Util { /// /// 委托帮助类 /// public class DelegateHelper { /// /// 异步执行方法 /// /// 首先执行的方法 /// 接下来执行的方法 public static void RunAsync(Action firstFunc, Action next) { Task firstTask = new Task(() => { firstFunc(); }); firstTask.Start(); firstTask.ContinueWith(x => next()); } /// /// 异步执行方法 /// /// 首先执行的方法 /// 接下来执行的方法 public static void RunAsync(Func firstFunc, Action next) { Task firstTask = new Task(() => { return firstFunc(); }); firstTask.Start(); firstTask.ContinueWith(x => next(x.Result)); } } } ================================================ FILE: src/Coldairarrow.Util/Helper/EmitHelper.cs ================================================ using System; using System.Reflection.Emit; namespace Coldairarrow.Util { /// /// Emit反射帮助类 /// public class EmitHelper { /// /// 创建对象建造者 /// /// 对象类型 /// public static Func CreateBuilder(Type type) { DynamicMethod dm = new DynamicMethod(string.Empty, typeof(object), Type.EmptyTypes); var gen = dm.GetILGenerator(); if (type.IsValueType) { gen.DeclareLocal(type); gen.Emit(OpCodes.Ldloca_S, 0); gen.Emit(OpCodes.Initobj, type); gen.Emit(OpCodes.Ldloc_0); gen.Emit(OpCodes.Box, type); } else { gen.Emit(OpCodes.Newobj, type.GetConstructor(Type.EmptyTypes)); } gen.Emit(OpCodes.Ret); Func func = (Func)dm.CreateDelegate(typeof(Func)); return func; } } } ================================================ FILE: src/Coldairarrow.Util/Helper/ExceptionHelper.cs ================================================ using System; using System.Linq; using System.Text; namespace Coldairarrow.Util { /// /// 异常处理帮助类 /// public static class ExceptionHelper { /// /// 获取异常位置 /// /// 异常 /// private static string GetExceptionAddr(Exception e) { StringBuilder excAddrBuilder = new StringBuilder(); e?.StackTrace?.Split("\r\n".ToArray())?.ToList()?.ForEach(item => { if (item.Contains("行号") || item.Contains("line")) excAddrBuilder.Append($" {item}\r\n"); }); string addr = excAddrBuilder.ToString(); return addr.IsNullOrEmpty() ? " 无" : addr; } /// /// 获取异常消息 /// /// 捕捉的异常 /// 内部异常层级 /// private static string GetExceptionAllMsg(Exception ex, int level) { StringBuilder builder = new StringBuilder(); builder.Append($@" {level}层错误: 消息: {ex?.Message} 位置: {GetExceptionAddr(ex)} "); if (ex.InnerException != null) { builder.Append(GetExceptionAllMsg(ex.InnerException, level + 1)); } return builder.ToString(); } /// /// 获取异常消息 /// /// 捕捉的异常 /// public static string GetExceptionAllMsg(Exception ex) { return GetExceptionAllMsg(ex, 1); } } } ================================================ FILE: src/Coldairarrow.Util/Helper/FileHelper.cs ================================================ using System; using System.IO; using System.Text; using System.Text.RegularExpressions; namespace Coldairarrow.Util { /// /// 文件操作帮助类 /// public class FileHelper { #region 读操作 /// /// 判断文件是否存在 /// /// 文件目录 /// public static bool Exists(string path) { return File.Exists(path); } /// /// 获取当前程序根目录 /// /// public static string GetCurrentDir() { return AppDomain.CurrentDomain.BaseDirectory; } #endregion #region 写操作 /// /// 输出字符串到文件 /// 注:使用系统默认编码;若文件不存在则创建新的,若存在则覆盖 /// /// 内容 /// 文件路径 public static void WriteTxt(string content, string path) { WriteTxt(content, path, null, null); } /// /// 输出字符串到文件 /// 注:使用自定义编码;若文件不存在则创建新的,若存在则覆盖 /// /// 内容 /// 文件路径 /// 编码 public static void WriteTxt(string content, string path, Encoding encoding) { WriteTxt(content, path, encoding, null); } /// /// 输出字符串到文件 /// 注:使用自定义模式,使用默认编码 /// /// 内容 /// 文件路径 /// 输出方法 public static void WriteTxt(string content, string path, FileMode fileModel) { WriteTxt(content, path, null, fileModel); } /// /// 输出字符串到文件 /// 注:使用自定义编码以及写入模式 /// /// 内容 /// 文件路径 /// 字符编码 /// 写入模式 public static void WriteTxt(string content, string path, Encoding encoding, FileMode fileModel) { WriteTxt(content, path, encoding, (FileMode?)fileModel); } /// /// 输出字符串到文件 /// 注:使用自定义编码以及写入模式 /// /// 内容 /// 文件路径 /// 字符编码 /// 写入模式 private static void WriteTxt(string content, string path, Encoding encoding, FileMode? fileModel) { CheckDirectory(path); if (encoding == null) encoding = Encoding.Default; if (fileModel == null) fileModel = FileMode.Create; using (FileStream fileStream = new FileStream(path, fileModel.Value)) { using (StreamWriter streamWriter = new StreamWriter(fileStream, encoding)) { streamWriter.Write(content); streamWriter.Flush(); } } } /// /// 检验目录,若目录已存在则不变 /// /// 目录位置 public static void CheckDirectory(string path) { if (path.Contains("\\")) Directory.CreateDirectory(GetPathDirectory(path)); } /// /// 输出日志到指定文件 /// /// 日志消息 /// 日志文件位置(默认为D:\测试\a.log) public static void WriteLog(string msg, string path = @"Log.txt") { string content = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}:{msg}"; WriteTxt(content, $"{GetCurrentDir()}{content}"); } /// /// 获取文件位置中的目录位置(不包括文件名) /// /// 文件位置 /// public static string GetPathDirectory(string path) { if (!path.Contains("\\")) return GetCurrentDir(); string pathDirectory = string.Empty; string pattern = @"^(.*\\).*?$"; Match match = Regex.Match(path, pattern); return match.Groups[1].ToString(); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/Helper/FileZipHelper.cs ================================================ using ICSharpCode.SharpZipLib.Zip; using System; using System.Collections.Generic; using System.IO; namespace Coldairarrow.Util { /// /// 文件压缩帮助类 /// public class FileZipHelper { /// /// 压缩一个文件 /// /// 文件信息 /// public static byte[] ZipFile(FileEntry file) { return ZipFile(new List { file }); } /// /// 压缩多个文件 /// /// 文件信息列表 /// public static byte[] ZipFile(List files) { using (MemoryStream ms = new MemoryStream()) { using (ZipOutputStream zipStream = new ZipOutputStream(ms)) { files.ForEach(aFile => { byte[] fileBytes = aFile.FileBytes; ZipEntry entry = new ZipEntry(aFile.FileName) { DateTime = DateTime.Now, IsUnicodeText = true }; zipStream.PutNextEntry(entry); zipStream.Write(fileBytes, 0, fileBytes.Length); zipStream.CloseEntry(); }); zipStream.IsStreamOwner = false; zipStream.Finish(); zipStream.Close(); ms.Position = 0; return ms.ToArray(); } } } } } ================================================ FILE: src/Coldairarrow.Util/Helper/GuidHelper.cs ================================================ using System; namespace Coldairarrow.Util { /// /// GUID帮助类 /// public static class GuidHelper { /// /// 生成主键 /// /// public static string GenerateKey() { return Guid.NewGuid().ToSequentialGuid().ToUpper(); } } } ================================================ FILE: src/Coldairarrow.Util/Helper/HttpHelper.cs ================================================ using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System.IO.Compression; using System.Linq; using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.Text; using System.Text.RegularExpressions; using System.Web; namespace Coldairarrow.Util { /// /// Http请求操作帮助类 /// public static class HttpHelper { #region 构造函数 /// /// 静态构造函数 /// static HttpHelper() { ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; ServicePointManager.DefaultConnectionLimit = int.MaxValue; ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback((sender, certificate, chain, sslPolicyErrors) => true); } #endregion #region 外部接口 /// /// 发起GET请求 /// 注:若使用证书,推荐使用X509Certificate2的pkcs12证书 /// /// 地址 /// 参数 /// 请求头 /// 证书 /// public static string GetData(string url, Dictionary paramters = null, Dictionary headers = null, X509Certificate cerFile = null) { return RequestData(HttpMethod.Get, url, paramters, headers, ContentType.Form, cerFile); } /// /// 发起POST请求 /// 注:若使用证书,推荐使用X509Certificate2的pkcs12证书 /// /// 地址 /// 参数 /// 请求头 /// 请求的ContentType /// 证书 /// public static string PostData(string url, Dictionary paramters = null, Dictionary headers = null, ContentType contentType = ContentType.Form, X509Certificate cerFile = null) { Dictionary mapping = new Dictionary(); mapping.Add(ContentType.Form, "application/x-www-form-urlencoded"); mapping.Add(ContentType.Json, "application/json"); string body = BuildBody(paramters, contentType); return PostData(url, body, mapping[contentType], headers, cerFile); } /// /// 发起POST请求 /// 注:若使用证书,推荐使用X509Certificate2的pkcs12证书 /// /// 地址 /// 请求体 /// 请求的ContentType /// 请求头 /// 证书 /// public static string PostData(string url, string body, string contentType, Dictionary headers = null, X509Certificate cerFile = null) { return RequestData("POST", url, body, contentType, headers, cerFile); } /// /// 请求数据 /// 注:若使用证书,推荐使用X509Certificate2的pkcs12证书 /// /// 请求方法 /// URL地址 /// 参数 /// 请求头信息 /// 请求数据类型 /// 证书 /// public static string RequestData(HttpMethod method, string url, Dictionary paramters = null, Dictionary headers = null, ContentType contentType = ContentType.Form, X509Certificate cerFile = null) { if (string.IsNullOrEmpty(url)) throw new Exception("请求地址不能为NULL或空!"); string newUrl = url; if (method == HttpMethod.Get) { StringBuilder paramBuilder = new StringBuilder(); var paramList = new List>(); paramList = paramters?.ToList() ?? new List>(); for (int i = 0; i < paramList.Count; i++) { var theParamter = paramList[i]; string key = theParamter.Key; string value = theParamter.Value.ToString(); string head = string.Empty; if (i == 0 && !UrlHaveParam(url)) head = "?"; else head = "&"; paramBuilder.Append($@"{head}{key}={value}"); } newUrl = url + paramBuilder.ToString(); } string body = BuildBody(paramters, contentType); return RequestData(method.ToString().ToUpper(), newUrl, body, GetContentTypeStr(contentType), headers, cerFile); } /// /// 请求数据 /// 注:若使用证书,推荐使用X509Certificate2的pkcs12证书 /// /// 请求方法 /// 请求地址 /// 请求的body内容 /// 请求数据类型 /// 请求头 /// 证书 /// public static string RequestData(string method, string url, string body, string contentType, Dictionary headers = null, X509Certificate cerFile = null) { if (string.IsNullOrEmpty(url)) throw new Exception("请求地址不能为NULL或空!"); string newUrl = url; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(newUrl); request.Method = method.ToUpper(); request.ContentType = contentType; headers?.ForEach(aHeader => { request.Headers.Add(aHeader.Key, aHeader.Value); }); byte[] data = Encoding.UTF8.GetBytes(body); request.ContentLength = data.Length; //HTTPS证书 if (cerFile != null) request.ClientCertificates.Add(cerFile); if (method.ToUpper() != "GET") { using (Stream requestStream = request.GetRequestStream()) { requestStream.Write(data, 0, data.Length); } } using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) { int httpStatusCode = (int)response.StatusCode; using (Stream responseStream = response.GetResponseStream()) { StreamReader reader = new StreamReader(responseStream, Encoding.UTF8); string resData = reader.ReadToEnd(); return resData; } } } /// /// 获取所有请求的参数(包括get参数和post参数) /// /// 请求上下文 /// public static Dictionary GetAllRequestParams(HttpContext context) { Dictionary allParams = new Dictionary(); var request = context.Request; List paramKeys = new List(); var getParams = request.QueryString.AllKeys.ToList(); var postParams = request.Form.AllKeys.ToList(); paramKeys.AddRange(getParams); paramKeys.AddRange(postParams); paramKeys.ForEach(aParam => { allParams.Add(aParam, request[aParam]); }); string contentType = request.ContentType.ToLower(); //若为POST的application/json if (contentType.Contains("application/json")) { string str = request.InputStream.ReadToString(Encoding.UTF8); if (!str.IsNullOrEmpty()) { var obj = str.ToJObject(); foreach (var aProperty in obj) { allParams.Add(aProperty.Key, aProperty.Value); } } } return allParams; } /// /// 构建完全Url /// /// Url /// 参数 /// public static string BuildGetFullUrl(string url, Dictionary parameters = null) { StringBuilder paramBuilder = new StringBuilder(); var paramList = new List>(); paramList = parameters?.ToList(); for (int i = 0; i < paramList.Count; i++) { var theParamter = paramList[i]; string key = theParamter.Key; string value = theParamter.Value.ToString(); string head = string.Empty; if (i == 0 && !UrlHaveParam(url)) head = "?"; else head = "&"; paramBuilder.Append($@"{head}{key}={value}"); } return url + paramBuilder.ToString(); } /// /// 从URL下载图片并保存 /// /// 图片链接地址 /// 图片保存地址 static public void GetImage(string url, string path) { try { HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); req.ServicePoint.Expect100Continue = false; req.Method = "GET"; req.KeepAlive = true; HttpWebResponse rsp = (HttpWebResponse)req.GetResponse(); req.ContentType = "image/jpg"; Stream stream = null; // 以字符流的方式读取HTTP响应 stream = rsp.GetResponseStream(); Image.FromStream(stream).Save(path); // 释放资源 if (stream != null) stream.Close(); if (rsp != null) rsp.Close(); } catch (Exception e) { Console.WriteLine(e); } } /// /// 从URL获取html文档 /// /// /// public static string GetHtml(string url) { string htmlCode; for (int i = 0; i < 3; i++) { try { HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url); webRequest.Timeout = 10000; webRequest.Method = "GET"; webRequest.UserAgent = "Mozilla/4.0"; webRequest.Headers.Add("Accept-Encoding", "gzip, deflate"); HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse(); //获取目标网站的编码格式 string contentype = webResponse.Headers["Content-Type"]; Regex regex = new Regex("charset\\s*=\\s*[\\W]?\\s*([\\w-]+)", RegexOptions.IgnoreCase); //如果使用了GZip则先解压 if (webResponse.ContentEncoding.ToLower() == "gzip") { Stream streamReceive = webResponse.GetResponseStream(); MemoryStream ms = new MemoryStream(); streamReceive.CopyTo(ms); ms.Seek(0, SeekOrigin.Begin); var zipStream = new GZipStream(ms, CompressionMode.Decompress); //匹配编码格式 if (regex.IsMatch(contentype)) { Encoding ending = Encoding.GetEncoding(regex.Match(contentype).Groups[1].Value.Trim()); using (StreamReader sr = new StreamReader(zipStream, ending)) { htmlCode = sr.ReadToEnd(); } } else//匹配不到则自动转换成utf-8 { StreamReader sr = new StreamReader(zipStream, Encoding.GetEncoding("utf-8")); htmlCode = sr.ReadToEnd(); string subStr = htmlCode.Substring(0, 2000); string pattern = "charset=(.*?)\""; Encoding encoding; foreach (Match match in Regex.Matches(subStr, pattern)) { if (match.Groups[1].ToString().ToLower() == "utf-8") break; else { encoding = Encoding.GetEncoding(match.Groups[1].ToString().ToLower()); ms.Seek(0, SeekOrigin.Begin);//设置流的初始位置 var zipStream2 = new GZipStream(ms, CompressionMode.Decompress); StreamReader sr2 = new StreamReader(zipStream2, encoding); htmlCode = sr2.ReadToEnd(); } } } } else { using (Stream streamReceive = webResponse.GetResponseStream()) { using (StreamReader sr = new StreamReader(streamReceive, Encoding.Default)) { htmlCode = sr.ReadToEnd(); } } } return htmlCode; } catch (Exception e) { Console.WriteLine(e); Console.WriteLine("重试中...................."); } } return ""; } #endregion #region 内部成员 private static string BuildBody(Dictionary parameters, ContentType contentType) { StringBuilder bodyBuilder = new StringBuilder(); switch (contentType) { case ContentType.Form: { var paramList = parameters?.ToList() ?? new List>(); for (int i = 0; i < paramList.Count; i++) { var theParamter = paramList[i]; string key = theParamter.Key; string value = theParamter.Value?.ToString(); string head = string.Empty; if (i != 0) head = "&"; bodyBuilder.Append($@"{head}{key}={value}"); } }; break; case ContentType.Json: { bodyBuilder.Append(JsonConvert.SerializeObject(parameters)); }; break; default: break; } return bodyBuilder.ToString(); } private static bool UrlHaveParam(string url) { return url.Contains("?"); } private static string GetContentTypeStr(ContentType contentType) { string contentTypeStr = string.Empty; switch (contentType) { case ContentType.Form: contentTypeStr = "application/x-www-form-urlencoded"; break; case ContentType.Json: contentTypeStr = "application/json"; break; default: break; } return contentTypeStr; } #endregion } #region 类型定义 /// /// Http请求方法定义 /// public enum HttpMethod { Get, Post, Put, Delete, Head, Options, Trace, Connect } public enum ContentType { /// /// 传统Form表单,即application/x-www-form-urlencoded /// Form, /// /// 使用Json,即application/json /// Json } #endregion } ================================================ FILE: src/Coldairarrow.Util/Helper/ImgHelper.cs ================================================ using System; using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Text.RegularExpressions; using System.Web; namespace Coldairarrow.Util { /// /// 图片操作帮助类 /// public class ImgHelper { /// /// 从文件获取图片 /// /// 文件名 /// public static Image GetImgFromFile(string fileName) { return Image.FromFile(fileName); } /// /// 从base64字符串读入图片 /// /// base64字符串 /// public static Image GetImgFromBase64(string base64) { byte[] bytes = Convert.FromBase64String(base64); MemoryStream memStream = new MemoryStream(bytes); Image img = Image.FromStream(memStream); return img; } /// /// 从URL格式的Base64图片获取真正的图片 /// 即去掉data:image/jpg;base64,这样的格式 /// /// 图片Base64的URL形式 /// public static Image GetImgFromBase64Url(string base64Url) { string base64 = GetBase64String(base64Url); return GetImgFromBase64(base64); } /// /// 压缩图片 /// 注:等比压缩 /// /// 原图片 /// 压缩后宽度 /// public static Image CompressImg(Image img, int width) { return CompressImg(img, width, (int)(((double)width) / img.Width * img.Height)); } /// /// 压缩图片 /// /// 原图片 /// 压缩后宽度 /// 压缩后高度 /// public static Image CompressImg(Image img, int width, int height) { Bitmap bitmap = new Bitmap(img, width, height); return bitmap; } /// /// 将图片转为base64字符串 /// 默认使用jpg格式 /// /// 图片对象 /// public static string ToBase64String(Image img) { return ToBase64String(img, ImageFormat.Jpeg); } /// /// 将图片转为base64字符串 /// 使用指定格式 /// /// 图片对象 /// 指定格式 /// public static string ToBase64String(Image img, ImageFormat imageFormat) { MemoryStream memStream = new MemoryStream(); img.Save(memStream, imageFormat); byte[] bytes = memStream.ToArray(); string base64 = Convert.ToBase64String(bytes); return base64; } /// /// 将图片转为base64字符串 /// 默认使用jpg格式,并添加data:image/jpg;base64,前缀 /// /// 图片对象 /// public static string ToBase64StringUrl(Image img) { return "data:image/jpg;base64," + ToBase64String(img, ImageFormat.Jpeg); } /// /// 将图片转为base64字符串 /// 使用指定格式,并添加data:image/jpg;base64,前缀 /// /// 图片对象 /// 指定格式 /// public static string ToBase64StringUrl(Image img, ImageFormat imageFormat) { string base64 = ToBase64String(img, imageFormat); return $"data:image/{imageFormat.ToString().ToLower()};base64,{base64}"; } /// /// 获取真正的图片base64数据 /// 即去掉data:image/jpg;base64,这样的格式 /// /// 带前缀的base64图片字符串 /// public static string GetBase64String(string base64UrlStr) { string parttern = "^(data:image/.*?;base64,).*?$"; var match = Regex.Match(base64UrlStr, parttern); if (match.Groups.Count > 1) base64UrlStr = base64UrlStr.Replace(match.Groups[1].ToString(), ""); return base64UrlStr; } /// /// 将图片的URL或者Base64字符串转为图片并上传到服务器,返回上传后的完整图片URL /// /// URL地址或者Base64字符串 /// public static string GetImgUrl(string imgBase64OrUrl) { if (imgBase64OrUrl.Contains("data:image")) { Image img = ImgHelper.GetImgFromBase64Url(imgBase64OrUrl); string fileName = $"{GuidHelper.GenerateKey()}.jpg"; string dir = Path.Combine(HttpContext.Current.Server.MapPath("~/"), "Upload", "Img"); if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); img.Save(Path.Combine(dir, fileName)); return $"{GlobalSwitch.WebRootUrl}/Upload/Img/{fileName}"; } else return imgBase64OrUrl; } } } ================================================ FILE: src/Coldairarrow.Util/Helper/IocHelper.cs ================================================ using System; using System.Collections.Concurrent; namespace Coldairarrow.Util { /// /// Ioc容器帮助类 /// public class IocHelper { #region 私有成员 private string _lastName { get; } = "Last"; private ConcurrentDictionary> _mapping { get; } = new ConcurrentDictionary>(); #endregion #region 注册类型 /// /// 注册类型 /// /// 定义类型 /// 实现类型 public void RegisterType() where TTo : TFrom { RegisterType(typeof(TFrom), typeof(TTo), null); } /// /// 注册类型 /// /// 注册名 /// 定义类型 /// 实现类型 public void RegisterType(string name) where TTo : TFrom { RegisterType(typeof(TFrom), typeof(TTo), name); } /// /// 注册类型 /// /// 定义类型 /// 实现类型 /// 注册名 public void RegisterType(Type typeFrom, Type typeTo, string name) { ConcurrentDictionary typeMapping = null; if (!_mapping.ContainsKey(typeFrom)) { typeMapping = new ConcurrentDictionary(); _mapping[typeFrom] = typeMapping; } else typeMapping = _mapping[typeFrom]; if (name.IsNullOrEmpty()) name = _lastName; typeMapping[name] = typeTo; } #endregion #region 获取类型 /// /// 获取对象 /// /// 对象类型 /// public T Resolve() { return (T)Resolve(typeof(T), null); } /// /// 获取对象 /// /// 对象类型 /// 构造参数 /// public T Resolve(params object[] paramters) { return (T)Resolve(typeof(T), null, paramters); } /// /// 获取对象 /// /// 对象类型 /// 注册名 /// public T Resolve(string name) { return (T)Resolve(typeof(T), name); } /// /// 获取对象 /// /// 对象类型 /// 注册名 /// 构造参数 /// public T Resolve(string name, params object[] paramters) { return (T)Resolve(typeof(T), name, paramters); } /// /// 获取对象 /// /// 对象类型 /// 注册名 /// 构造参数 /// public object Resolve(Type typeFrom, string name, params object[] paramters) { if (!_mapping.ContainsKey(typeFrom)) throw new Exception("该类型未注册!"); var typeMapping = _mapping[typeFrom]; if (name.IsNullOrEmpty()) name = _lastName; if (!typeMapping.ContainsKey(name)) throw new Exception("该类型实现名为注册!"); return Activator.CreateInstance(typeMapping[name], paramters); } #endregion } } ================================================ FILE: src/Coldairarrow.Util/Helper/IpHelper.cs ================================================ using System.Collections; using System.Linq; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; namespace Coldairarrow.Util { /// /// Ip地址帮助类 /// public class IpHelper { #region 外部接口 /// /// 获取本地IP地址 /// /// public static string GetLocalIp() { return Dns.GetHostEntry(Dns.GetHostName()).AddressList .FirstOrDefault(a => a.AddressFamily == AddressFamily.InterNetwork) .ToString(); } /// /// 获取第一个可用的端口号 /// /// public static int GetFirstAvailablePort() { int BEGIN_PORT = 1024;//从这个端口开始检测 int MAX_PORT = 65535; //系统tcp/udp端口数最大是65535 for (int i = BEGIN_PORT; i < MAX_PORT; i++) { if (PortIsAvailable(i)) return i; } return -1; } /// /// 检查指定端口是否已用 /// /// /// public static bool PortIsAvailable(int port) { bool isAvailable = true; IList portUsed = PortIsUsed(); foreach (int p in portUsed) { if (p == port) { isAvailable = false; break; } } return isAvailable; } #endregion #region 私有成员 /// /// 获取操作系统已用的端口号 /// /// private static IList PortIsUsed() { //获取本地计算机的网络连接和通信统计数据的信息 IPGlobalProperties ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties(); //返回本地计算机上的所有Tcp监听程序 IPEndPoint[] ipsTCP = ipGlobalProperties.GetActiveTcpListeners(); //返回本地计算机上的所有UDP监听程序 IPEndPoint[] ipsUDP = ipGlobalProperties.GetActiveUdpListeners(); //返回本地计算机上的Internet协议版本4(IPV4 传输控制协议(TCP)连接的信息。 TcpConnectionInformation[] tcpConnInfoArray = ipGlobalProperties.GetActiveTcpConnections(); IList allPorts = new ArrayList(); foreach (IPEndPoint ep in ipsTCP) allPorts.Add(ep.Port); foreach (IPEndPoint ep in ipsUDP) allPorts.Add(ep.Port); foreach (TcpConnectionInformation conn in tcpConnInfoArray) allPorts.Add(conn.LocalEndPoint.Port); return allPorts; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/Helper/LinqHelper.cs ================================================ using System; using System.Linq.Expressions; namespace Coldairarrow.Util { /// /// Linq操作帮助类 /// public static class LinqHelper { /// /// 创建初始条件为True的表达式 /// /// /// public static Expression> True() { return x => true; } /// /// 创建初始条件为False的表达式 /// /// /// public static Expression> False() { return x => false; } } } ================================================ FILE: src/Coldairarrow.Util/Helper/LogHelper.cs ================================================ using System; using System.IO; using System.Threading.Tasks; namespace Coldairarrow.Util { /// /// 日志帮助类 /// public static class LogHelper { /// /// 写入日志到本地TXT文件 /// 注:日志文件名为"A_log.txt",目录为根目录 /// /// 日志内容 public static void WriteLog_LocalTxt(string log) { Task.Run(() => { string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "A_log.txt"); string logContent = $"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}:{log}\r\n"; File.AppendAllText(filePath, logContent); }); } } } ================================================ FILE: src/Coldairarrow.Util/Helper/LoopHelper.cs ================================================ using System; namespace Coldairarrow.Util { /// /// 循环帮助类 /// public class LoopHelper { /// /// 循环指定次数 /// /// 循环次数 /// 执行的方法 public static void Loop(int count,Action method) { for (int i = 0; i < count; i++) { method(); } } /// /// 循环指定次数 /// /// 循环次数 /// 执行的方法 public static void Loop(int count, Action method) { for (int i = 0; i < count; i++) { method(i); } } } } ================================================ FILE: src/Coldairarrow.Util/Helper/QRCodeHelper.cs ================================================ using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using ZXing; using ZXing.Common; using ZXing.QrCode.Internal; using ZXing.Rendering; namespace Coldairarrow.Util { /// /// 二维码生成帮助类 /// public class QRCodeHelper { #region 生成二维码 /// /// 生成二维码,默认边长为250px /// /// 二维码内容 /// public static Image BuildQRCode(string content) { return BuildQRCode(content, 250, Color.White, Color.Black); } /// /// 生成二维码,自定义边长 /// /// 二维码内容 /// 二维码边长px /// public static Image BuildQRCode(string content, int imgSize) { return BuildQRCode(content, imgSize, Color.White, Color.Black); } /// /// 生成二维码 /// 注:自定义边长以及颜色 /// /// 二维码内容 /// 二维码边长px /// 二维码底色 /// 二维码前景色 /// public static Image BuildQRCode(string content, int imgSize, Color background, Color foreground) { BarcodeWriter writer = new BarcodeWriter { Renderer = new BitmapRenderer { Background = background, Foreground = foreground }, Format = BarcodeFormat.QR_CODE }; writer.Options.Hints.Add(EncodeHintType.CHARACTER_SET, "UTF-8"); writer.Options.Hints.Add(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); writer.Options.Height = writer.Options.Width = imgSize; writer.Options.Margin = 0; Bitmap img = writer.Write(content); return img; } /// /// 生成二维码并添加Logo /// 注:默认生成边长为250px的二维码 /// /// 二维码内容 /// logo图片 /// public static Image BuildQRCode_Logo(string content, Image logo) { return BuildQRCode_Logo(content, 250, Color.White, Color.Black, logo); } /// /// 生成二维码并添加Logo /// 注:自定义边长 /// /// 二维码内容 /// 二维码边长px /// logo图片 /// public static Image BuildQRCode_Logo(string content, int imgSize, Image logo) { return BuildQRCode_Logo(content, imgSize, Color.White, Color.Black, logo); } /// /// 生成二维码并添加Logo /// 注:自定义边长以及颜色 /// /// 二维码内容 /// 二维码边长px /// 二维码底色 /// 二维码前景色 /// logo图片 /// public static Image BuildQRCode_Logo(string content, int imgSize, Color background, Color foreground, Image logo) { //构造二维码写码器 MultiFormatWriter writer = new MultiFormatWriter(); Dictionary hint = new Dictionary { { EncodeHintType.CHARACTER_SET, "UTF-8" }, { EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H } }; //生成二维码 BitMatrix bm = writer.encode(content, BarcodeFormat.QR_CODE, imgSize, imgSize, hint); BarcodeWriter barcodeWriter = new BarcodeWriter() { Renderer = new BitmapRenderer { Background = background, Foreground = foreground }, Format = BarcodeFormat.QR_CODE }; Bitmap map = barcodeWriter.Write(bm); //获取二维码实际尺寸(去掉二维码两边空白后的实际尺寸) int[] rectangle = bm.getEnclosingRectangle(); //计算插入图片的大小和位置 int middleW = Math.Min((int)(rectangle[2] / 3.5), logo.Width); int middleH = Math.Min((int)(rectangle[3] / 3.5), logo.Height); int middleL = (map.Width - middleW) / 2; int middleT = (map.Height - middleH) / 2; //将img转换成bmp格式,否则后面无法创建Graphics对象 Bitmap bmpimg = new Bitmap(map.Width, map.Height, PixelFormat.Format32bppArgb); using (Graphics g = Graphics.FromImage(bmpimg)) { g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; g.DrawImage(map, 0, 0); } //将二维码插入图片 Graphics myGraphic = Graphics.FromImage(bmpimg); //白底 myGraphic.FillRectangle(Brushes.White, middleL, middleT, middleW, middleH); myGraphic.DrawImage(logo, middleL, middleT, middleW, middleH); return bmpimg; } #endregion #region 生成条形码 /// /// 生成条形码 /// 注:默认宽150px,高50px /// /// 条形码内容 /// public static Image BuildBarCode(string content) { return BuildBarCode(content, 150, 50); } /// /// 生成条形码 /// 注:自定义尺寸 /// /// 条形码内容 /// 宽度px /// 高度px /// public static Image BuildBarCode(string content, int width, int height) { BarcodeWriter writer = new BarcodeWriter { //使用ITF 格式,不能被现在常用的支付宝、微信扫出来 //如果想生成可识别的可以使用 CODE_128 格式 //writer.Format = BarcodeFormat.ITF; Format = BarcodeFormat.CODE_128 }; EncodingOptions options = new EncodingOptions() { Width = width, Height = height, Margin = 2 }; writer.Options = options; Bitmap map = writer.Write(content); return map; } #endregion #region 读取码内容 /// /// 从二维码读取内容 /// /// 二维码 /// public static string ReadContent(Bitmap image) { BarcodeReader reader = new BarcodeReader(); reader.Options.CharacterSet = "UTF-8"; Result result = reader.Decode(image); return result == null ? "" : result.Text; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/Helper/RandomHelper.cs ================================================ using System; using System.Collections; using System.Collections.Generic; using System.Linq; namespace Coldairarrow.Util { /// /// Random随机数帮助类 /// public static class RandomHelper { private static Random _random { get; } = new Random(); /// /// 下一个随机数 /// /// 最小值 /// 最大值 /// public static int Next(int minValue, int maxValue) { return _random.Next(minValue, maxValue); } /// /// 下一个随机值 /// /// 值类型 /// 值的集合 /// public static T Next(IEnumerable source) { return source.ToList()[Next(0, source.Count())]; } } } ================================================ FILE: src/Coldairarrow.Util/Helper/TimerHelper.cs ================================================ using System; using System.Threading; using System.Web; namespace Coldairarrow.Util { /// /// 时间帮助类 /// public class TimerHelper { /// /// 设置一个时间间隔的循环操作 /// /// 执行的操作 /// 时间间隔 public static Timer SetInterval(Action action, TimeSpan timeSpan) { Timer threadTimer = new Timer((state => { action.Invoke(); }), null, 0, (long)timeSpan.TotalMilliseconds); HttpRuntime.Cache[Guid.NewGuid().ToString()] = threadTimer; return threadTimer; } /// /// 设置一个时间间隔的循环操作 /// /// 执行的操作 /// 时间间隔 /// 延迟一段时间后再开始循环 public static Timer SetInterval(Action action, TimeSpan timeSpan, TimeSpan dely) { Timer threadTimer = new Timer((state => { action.Invoke(); }), null, dely, timeSpan); HttpRuntime.Cache[Guid.NewGuid().ToString()] = threadTimer; return threadTimer; } /// /// 一段时间后执行操作 /// /// 需要执行的操作 /// 延时时间 public static void SetTimeout(Action action,TimeSpan dely) { if (dely == TimeSpan.Zero) action(); else { Timer timer = null; action += () => { timer.Dispose(); }; timer = SetInterval(action, new TimeSpan(0, 0, 1), dely); } } } } ================================================ FILE: src/Coldairarrow.Util/Helper/TreeHelper.cs ================================================ using System; using System.Collections.Generic; using System.Linq; namespace Coldairarrow.Util { /// /// 树结构帮助类 /// public class TreeHelper { /// /// 建造树结构 /// /// 所有的节点 /// public static List BuildTree(List allNodes) where T:TreeModel,new() { List resData = new List(); var rootNodes = allNodes.Where(x => x.ParentId == "0" || x.ParentId.IsNullOrEmpty()).ToList(); resData = rootNodes; resData.ForEach(aRootNode => { if (HaveChildren(allNodes, aRootNode.Id)) aRootNode.Children = GetChildren(allNodes, aRootNode); }); return resData; } /// /// 获取所有子节点 /// /// 树模型(TreeModel或继承它的模型) /// 所有节点列表 /// 父节点Id /// private static List GetChildren(List nodes, T parentNode) where T:TreeModel,new() { Type type = typeof(T); var properties = type.GetProperties().ToList(); List resData = new List(); var children = nodes.Where(x => x.ParentId == parentNode.Id).ToList(); children.ForEach(aChildren => { T newNode = new T(); resData.Add(newNode); //赋值属性 properties.ForEach(aProperty => { var value = aProperty.GetValue(aChildren, null); aProperty.SetValue(newNode, value); }); //设置深度 newNode.Level = parentNode.Level + 1; if (HaveChildren(nodes, aChildren.Id)) newNode.Children = GetChildren(nodes, newNode); }); return resData; } /// /// 判断当前节点是否有子节点 /// /// 树模型 /// 所有节点 /// 当前节点Id /// private static bool HaveChildren(List nodes,string nodeId) where T:TreeModel,new() { return nodes.Exists(x => x.ParentId == nodeId); } } } ================================================ FILE: src/Coldairarrow.Util/Helper/TypeBuilderHelper.cs ================================================ using System; using System.Collections.Generic; using System.Reflection; using System.Reflection.Emit; namespace Coldairarrow.Util { /// /// 运行时创建类型 /// public static class TypeBuilderHelper { /// /// 创建类型 /// /// 类型完全名,包括命名空间 /// 类型程序集名 /// 类型属性配置 /// public static Type BuildType(string typeFullName, string assemblyName, List properties) { TypeBuilder tb = GetTypeBuilder(typeFullName,assemblyName); ConstructorBuilder constructor = tb.DefineDefaultConstructor(MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName); properties.ForEach(aProperty => { AddProperty(tb, aProperty.PropertyName, aProperty.PropertyType, aProperty.CustomAttributes); }); return tb.CreateType(); } private static TypeBuilder GetTypeBuilder(string typeFullName, string assemblyName) { var an = new AssemblyName(assemblyName); AssemblyBuilder assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(an, AssemblyBuilderAccess.Run); ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule("MainModule"); TypeBuilder tb = moduleBuilder.DefineType(typeFullName, TypeAttributes.Public | TypeAttributes.Class | TypeAttributes.AutoClass | TypeAttributes.AnsiClass | TypeAttributes.BeforeFieldInit | TypeAttributes.AutoLayout, null); return tb; } private static void AddProperty(TypeBuilder tb, string propertyName, Type propertyType, List attributes) { FieldBuilder fieldBuilder = tb.DefineField("_" + propertyName, propertyType, FieldAttributes.Private); PropertyBuilder propertyBuilder = tb.DefineProperty(propertyName, PropertyAttributes.HasDefault, propertyType, null); MethodBuilder getPropMthdBldr = tb.DefineMethod("get_" + propertyName, MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.HideBySig, propertyType, Type.EmptyTypes); ILGenerator getIl = getPropMthdBldr.GetILGenerator(); getIl.Emit(OpCodes.Ldarg_0); getIl.Emit(OpCodes.Ldfld, fieldBuilder); getIl.Emit(OpCodes.Ret); MethodBuilder setPropMthdBldr = tb.DefineMethod("set_" + propertyName, MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.HideBySig, null, new[] { propertyType }); ILGenerator setIl = setPropMthdBldr.GetILGenerator(); Label modifyProperty = setIl.DefineLabel(); Label exitSet = setIl.DefineLabel(); setIl.MarkLabel(modifyProperty); setIl.Emit(OpCodes.Ldarg_0); setIl.Emit(OpCodes.Ldarg_1); setIl.Emit(OpCodes.Stfld, fieldBuilder); setIl.Emit(OpCodes.Nop); setIl.MarkLabel(exitSet); setIl.Emit(OpCodes.Ret); propertyBuilder.SetGetMethod(getPropMthdBldr); propertyBuilder.SetSetMethod(setPropMthdBldr); //设置特性 attributes?.ForEach(aAttribute => { var attribute = aAttribute.GetConstructor(new Type[] { }); var attributeBuilder = new CustomAttributeBuilder(attribute, new object[] { }); propertyBuilder.SetCustomAttribute(attributeBuilder); }); } } /// /// 类型属性配置 /// public struct PropertyConfig { /// /// 属性名 /// public string PropertyName { get; set; } /// /// 属性类型 /// public Type PropertyType { get; set; } /// /// 属性包含的自定义特性 /// public List CustomAttributes { get; set; } } } ================================================ FILE: src/Coldairarrow.Util/Helper/XmlHelper.cs ================================================ using System; using System.IO; using System.Xml.Serialization; namespace Coldairarrow.Util { /// /// XML文档操作帮助类 /// public class XmlHelper { /// /// 序列化为XML字符串 /// /// 对象 /// public static string Serialize(object obj) { Type type = obj.GetType(); MemoryStream Stream = new MemoryStream(); XmlSerializer xml = new XmlSerializer(type); try { //序列化对象 xml.Serialize(Stream, obj); } catch (InvalidOperationException) { throw; } Stream.Position = 0; StreamReader sr = new StreamReader(Stream); string str = sr.ReadToEnd(); sr.Dispose(); Stream.Dispose(); return str; } } } ================================================ FILE: src/Coldairarrow.Util/Model/AjaxResult.cs ================================================ namespace Coldairarrow.Util { /// /// Ajax请求结果 /// public class AjaxResult { /// /// 是否成功 /// public bool Success { get; set; } /// /// 错误代码: /// 1:未登录 /// 其它待定义 /// public int ErrorCode { get; set; } /// /// 返回消息 /// public string Msg { get; set; } /// /// 返回数据 /// public object Data { get; set; } } } ================================================ FILE: src/Coldairarrow.Util/Model/DatabaseType.cs ================================================ namespace Coldairarrow.Util { /// /// 数据库类型 /// public enum DatabaseType { /// /// SqlServer数据库 /// SqlServer, /// /// MySql数据库 /// MySql, /// /// Oracle数据库 /// Oracle, /// /// PostgreSql数据库 /// PostgreSql } } ================================================ FILE: src/Coldairarrow.Util/Model/DbTableInfo.cs ================================================ namespace Coldairarrow.Util { /// /// 数据库所有表的信息 /// public class DbTableInfo { /// /// 表名 /// public string TableName { get; set; } /// /// 表描述说明 /// public string Description { get { return _description.IsNullOrEmpty() ? TableName : _description; } set { _description = value; } } private string _description { get; set; } } } ================================================ FILE: src/Coldairarrow.Util/Model/DynamicModel.cs ================================================ using System.Collections.Generic; namespace Coldairarrow.Util { /// /// 动态数据模型类 /// public class DynamicModel : Dictionary { /// /// 索引器 /// public new object this[string key] { get { return GetProperty(key); } set { AddProperty(key, value); } } /// /// 添加属性 /// /// 属性名 /// 属性值 public void AddProperty(string key, object obj) { if (ContainsKey(key)) base[key] = obj; else Add(key, obj); } /// /// 设置属性值 /// /// 属性名 /// 属性值 public void SetProperty(string key, object obj) { if (ContainsKey(key)) base[key] = obj; else Add(key, obj); } /// /// 获取属性值 /// /// 属性名 /// public object GetProperty(string key) { if (ContainsKey(key)) return base[key]; else return null; } } } ================================================ FILE: src/Coldairarrow.Util/Model/EasyuiTreeDto.cs ================================================ using System.Collections.Generic; namespace Coldairarrow.Util { public class EasyuiTreeDto : TreeModel { public string id { get => Id; } public string name { get => Text; } public string text { get => Text; } public string iconCls { get; set; } public bool @checked { get; set; } = false; public string state { get; set; } = "open"; public List children { get => Children; } } } ================================================ FILE: src/Coldairarrow.Util/Model/ErrorResult.cs ================================================ namespace Coldairarrow.Util { public class ErrorResult : AjaxResult { public ErrorResult(string msg = null) { Msg = msg; Success = false; } } } ================================================ FILE: src/Coldairarrow.Util/Model/FileEntry.cs ================================================ namespace Coldairarrow.Util { /// /// 文件信息 /// public struct FileEntry { public FileEntry(string fileName,byte[] fileBytes) { FileName = fileName; FileBytes = fileBytes; } /// /// 文件名 /// public string FileName { get; set; } /// /// 文件字节 /// public byte[] FileBytes { get; set; } } } ================================================ FILE: src/Coldairarrow.Util/Model/LoggerType.cs ================================================ namespace Coldairarrow.Util { /// /// 日志操作类型 /// public enum LoggerType { /// /// 使用关系型数据库记录日志,例如SQlServer、MySQL、Oracle等 /// RDBMS, /// /// 使用ElasticSearch记录日志 /// ElasticSearch } } ================================================ FILE: src/Coldairarrow.Util/Model/Pagination.cs ================================================ using System.Diagnostics; namespace Coldairarrow.Util { /// /// 数据表格分页 /// public class Pagination { #region 构造函数 public Pagination() { _watch.Start(); _sortField = "Id"; _sortType = "asc"; PageIndex = 1; PageRows = int.MaxValue; } #endregion #region 私有成员 /// /// 当前页码 /// private int _pageIndex { get; set; } /// /// 每页行数 /// private int _pageRows { get; set; } /// /// 排序列 /// private string _sortField { get; set; } /// /// 排序类型 /// private string _sortType { get; set; } /// /// 总记录数 /// private int _recordCount { get; set; } /// /// 总页数 /// private int _pageCount { get { int pages = _recordCount / _pageRows; int pageCount = _recordCount % _pageRows == 0 ? pages : pages + 1; return pages; } } private Stopwatch _watch { get; set; } = new Stopwatch(); #endregion #region 默认方案 /// /// 当前页码 /// public int PageIndex { get => _pageIndex; set => _pageIndex = value; } /// /// 每页行数 /// public int PageRows { get => _pageRows; set => _pageRows = value; } /// /// 排序列 /// public string SortField { get => _sortField; set => _sortField = value; } /// /// 排序类型 /// public string SortType { get => _sortType; set => _sortType = value; } /// /// 总记录数 /// public int RecordCount { get => _recordCount; set => _recordCount = value; } /// /// 总页数 /// public int PageCount { get => _pageCount; } #endregion #region jqGrid方案 /// /// 当前页 /// public int page { get => _pageIndex; set => _pageIndex = value; } /// /// 每页行数 /// public int rows { get => _pageRows; set => _pageRows = value; } /// /// 排序列 /// public string sidx { get => _sortField; set => _sortField = value; } /// /// 排序类型 /// public string sord { get => _sortType; set => _sortType = value; } /// /// 总记录数 /// public int records { get => _recordCount; set => _recordCount = value; } /// /// 总页数 /// public int total { get => _pageCount; } /// /// 构建jqGrid返回的数据 /// /// 返回的数据列表 /// public object BuildTableResult_JqGrid(object dataList) { _watch.Stop(); var resData = new { rows = dataList, total = _pageCount, page = _pageIndex, records = _recordCount, costtime = _watch.ElapsedMilliseconds }; return resData; } #endregion #region layui方案 public int limit { get => _pageRows; set => _pageRows = value; } /// /// 构建Layui 返回的表格数据 /// /// 返回的数据列表 /// public object BuildTableResult_Layui(object dataList) { _watch.Stop(); var resData = new { code = 0, msg = "获取成功!", count = _recordCount, data = dataList, costtime = _watch.ElapsedMilliseconds }; return resData; } #endregion #region Easyui DataGrid方案 /// /// 排序列 /// public string sort { get => _sortField; set => _sortField = value; } /// /// 排序类型 /// public string order { get => _sortType; set => _sortType = value; } /// /// 构建DataGrid返回的数据 /// /// 返回的数据列表 /// public object BuildTableResult_DataGrid(object dataList) { _watch.Stop(); var resData = new { rows = dataList, total = _recordCount, page = _pageIndex, records = _recordCount, costtime = _watch.ElapsedMilliseconds }; return resData; } #endregion } } ================================================ FILE: src/Coldairarrow.Util/Model/SuccessResult.cs ================================================ namespace Coldairarrow.Util { public class SuccessResult:AjaxResult { public SuccessResult(object data=null) { Data = data; Success = true; } } } ================================================ FILE: src/Coldairarrow.Util/Model/TableInfo.cs ================================================ namespace Coldairarrow.Util { /// /// 数据库表信息 /// public class TableInfo { /// /// 字段Id /// public int ColumnId { get; set; } /// /// 字段名 /// public string Name { get; set; } /// /// 字段类型 /// public string Type { get; set; } /// /// 是否为主键 /// public bool IsKey { get; set; } /// /// 是否为空 /// public bool IsNullable { get; set; } /// /// 字段描述说明 /// public string Description { get { return _description.IsNullOrEmpty() ? Name : _description; } set { _description = value; } } private string _description { get; set; } } } ================================================ FILE: src/Coldairarrow.Util/Model/TreeModel.cs ================================================ using System.Collections.Generic; namespace Coldairarrow.Util { /// /// 树模型(可以作为父类) /// public class TreeModel { /// /// 唯一标识Id /// public string Id { get; set; } /// /// 数据值 /// public string Value { get; set; } /// /// 父Id /// public string ParentId { get; set; } /// /// 节点深度 /// public int? Level { get; set; } = 1; /// /// 显示的内容 /// public string Text { get; set; } /// /// 孩子节点 /// public List Children { get; set; } } } ================================================ FILE: src/Coldairarrow.Util/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Coldairarrow.Util")] [assembly: AssemblyDescription("A Very Helpful Util ClassLibrary")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Coldairarrow")] [assembly: AssemblyProduct("Coldairarrow.Util")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 会使此程序集中的类型 //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 //请将此类型的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("7095b12b-7ff2-4b6b-8c6c-654197edaa34")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.0.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")] ================================================ FILE: src/Coldairarrow.Util/WebApp/SessionHelper.cs ================================================ using System.Web; namespace Coldairarrow.Util { /// /// Session帮助类,自定义Session,解决原Session并发问题 /// public class SessionHelper { #region 私有成员 private static string CacheModuleName { get; } = "Session"; private static string _sessionId { get => HttpContext.Current.Request.Cookies[SessionCookieName].Value; } private static string BuildCacheKey(string sessionKey) { return $"{GlobalSwitch.ProjectName}_{CacheModuleName}_{_sessionId}_{sessionKey}"; } #endregion #region 外部成员 /// /// 存放Session标志的Cookie名 /// public static string SessionCookieName { get; } = $"{GlobalSwitch.ProjectName}.ASP.NET_Session_Id"; /// /// 当前Session /// public static _Session Session { get; } = new _Session(); /// /// 自定义_Session类 /// public class _Session { public object this[string index] { get { string cacheKey = BuildCacheKey(index); return CacheHelper.Cache.GetCache(cacheKey); } set { string cacheKey = BuildCacheKey(index); if (value.IsNullOrEmpty()) CacheHelper.Cache.RemoveCache(cacheKey); else CacheHelper.Cache.SetCache(cacheKey, value); } } } #endregion } } ================================================ FILE: src/Coldairarrow.Util/app.config ================================================ 
================================================ FILE: src/Coldairarrow.Util/packages.config ================================================  ================================================ FILE: src/Coldairarrow.Util/publishNuget.bat ================================================ @echo off pushd %~dp0 nuget pack 01.Coldairarrow.Util.csproj ================================================ FILE: src/Coldairarrow.Web/05.Coldairarrow.Web.csproj ================================================  Debug AnyCPU 2.0 {3CD25499-8291-48BB-9A24-D99BC1675A0D} {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties Coldairarrow.Web Coldairarrow.Web v4.5.2 true Latest true full false bin\ DEBUG;TRACE prompt 4 ES5 None True False False False True True true pdbonly false bin\ TRACE prompt 4 ..\packages\AutoMapper.6.2.2\lib\net45\AutoMapper.dll ..\packages\DotNetty.Buffers.0.6.0\lib\net45\DotNetty.Buffers.dll ..\packages\DotNetty.Codecs.0.6.0\lib\net45\DotNetty.Codecs.dll ..\packages\DotNetty.Common.0.6.0\lib\net45\DotNetty.Common.dll ..\packages\DotNetty.Transport.0.6.0\lib\net45\DotNetty.Transport.dll ..\packages\DotNettyRPC.1.5.3\lib\net45\DotNettyRPC.dll ..\packages\Dynamitey.2.0.9.136\lib\net40\Dynamitey.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll ..\packages\EntityFramework6.Npgsql.3.2.0\lib\net45\EntityFramework6.Npgsql.dll ..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll ..\packages\ImpromptuInterface.7.0.1\lib\net40\ImpromptuInterface.dll ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.1.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll ..\packages\Microsoft.Extensions.Logging.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.dll ..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll ..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll ..\packages\MySql.Data.Entity.6.8.8\lib\net45\MySql.Data.Entity.EF6.dll ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\Npgsql.4.0.3\lib\net451\Npgsql.dll ..\packages\Oracle.ManagedDataAccess.18.3.0\lib\net40\Oracle.ManagedDataAccess.dll ..\packages\Oracle.ManagedDataAccess.EntityFramework.18.3.0\lib\net45\Oracle.ManagedDataAccess.EntityFramework.dll ..\packages\System.Collections.Immutable.1.5.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll ..\packages\System.Threading.Tasks.Extensions.4.5.1\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll ..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll ..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Webpages.dll ..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Webpages.Deployment.dll ..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Webpages.Razor.dll ..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Helpers.dll ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll Designer Designer Designer Designer Global.asax getContent.ashx imageUp.ashx Web.config Web.config {62858a89-da3c-4658-8219-580780d435c9} 04.Coldairarrow.Business {01C93A6B-76C5-4B10-B8B9-2F173B5F9441} 02.Coldairarrow.DataRepository {544fe3ea-46f2-45f7-9574-d4fea111a9c1} 03.Coldairarrow.Entity {7095b12b-7ff2-4b6b-8c6c-654197edaa34} 01.Coldairarrow.Util 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) True 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 ================================================ FILE: src/Coldairarrow.Web/App_Start/01Handler/全局错误过滤/HandlerGlobalError.cs ================================================ using Coldairarrow.Business.Common; using Coldairarrow.Util; using System.Text; using System.Web.Mvc; namespace Coldairarrow.Web { /// /// 过滤处理全局错误信息 /// public class HandlerGlobalError : HandleErrorAttribute { /// /// 处理系统错误 /// /// 错误消息 public override void OnException(ExceptionContext exContext) { base.OnException(exContext); exContext.ExceptionHandled = true; exContext.HttpContext.Response.StatusCode = 200; var theEx = exContext.Exception; BusHelper.HandleException(theEx); AjaxResult res = new AjaxResult() { Success = false, Msg = theEx.Message }; exContext.Result = new ContentResult() { Content = res.ToJson(), ContentEncoding = Encoding.UTF8 }; } } } ================================================ FILE: src/Coldairarrow.Web/App_Start/01Handler/参数非空校验/CheckParamNotEmptyAttribute.cs ================================================ using Coldairarrow.Util; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Web.Mvc; namespace Coldairarrow.Web { /// /// 参数非空校验 /// public class CheckParamNotEmptyAttribute : FilterAttribute, IActionFilter { private List _paramters { get; } public CheckParamNotEmptyAttribute(params string[] paramters) { _paramters = paramters.ToList(); } /// /// Action执行之前执行 /// /// 过滤器上下文 public void OnActionExecuting(ActionExecutingContext filterContext) { var allParamters = HttpHelper.GetAllRequestParams(HttpContext.Current); var needParamters = _paramters.Where(x => { if (!allParamters.ContainsKey(x)) return true; else return allParamters[x].IsNullOrEmpty(); }).ToList(); if (needParamters.Count != 0) { AjaxResult res = new AjaxResult { Success = false, Msg = $"参数:{string.Join(",", needParamters)}不能为空!" }; filterContext.Result = new ContentResult { Content = res.ToJson(), ContentEncoding = Encoding.UTF8,ContentType= "application/json;charset=utf-8" }; } } /// /// Action执行完毕之后执行 /// /// public void OnActionExecuted(ActionExecutedContext filterContext) { } } } ================================================ FILE: src/Coldairarrow.Web/App_Start/01Handler/后台用户接口权限校验/CheckUrlPermissionAttribute.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Util; using System.Linq; using System.Text; using System.Web.Mvc; namespace Coldairarrow.Web { /// /// 校验用户接口权限 /// public class CheckUrlPermissionAttribute : FilterAttribute, IActionFilter { /// /// Action执行之前执行 /// /// 过滤器上下文 public void OnActionExecuting(ActionExecutingContext filterContext) { //若为本地测试,则不需要校验 if (GlobalSwitch.RunModel == RunModel.LocalTest) { return; } //判断是否需要校验 bool needCheck = filterContext.ContainsAttribute() && !filterContext.ContainsAttribute(); if (!needCheck) return; var allUrlPermissions = UrlPermissionManage.GetAllUrlPermissions(); string requestUrl = filterContext.HttpContext.Request.Url.ToString().ToLower(); var thePermission = allUrlPermissions.Where(x => requestUrl.Contains(x.Url.ToLower())).FirstOrDefault(); if (thePermission == null) return; string needPermission = thePermission.PermissionValue; bool hasPermission = PermissionManage.GetOperatorPermissionValues().Any(x => x.ToLower() == needPermission.ToLower()); if (hasPermission) return; else { AjaxResult res = new AjaxResult { Success = false, Msg = "权限不足!无法访问!" }; filterContext.Result = new ContentResult { Content = res.ToJson(), ContentEncoding = Encoding.UTF8 }; } } /// /// Action执行完毕之后执行 /// /// public void OnActionExecuted(ActionExecutedContext filterContext) { } } } ================================================ FILE: src/Coldairarrow.Web/App_Start/01Handler/后台用户接口权限校验/IgnoreUrlPermissionAttribute.cs ================================================ using System; namespace Coldairarrow.Web { /// /// 忽略校验用户接口权限 /// public class IgnoreUrlPermissionAttribute :Attribute { } } ================================================ FILE: src/Coldairarrow.Web/App_Start/01Handler/对外接口签名校验/CheckAppIdPermissionAttribute.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Util; using System.Linq; using System.Text; using System.Web.Mvc; namespace Coldairarrow.Web { /// /// 校验AppId接口权限 /// public class CheckAppIdPermissionAttribute : FilterAttribute, IActionFilter { /// /// Action执行之前执行 /// /// 过滤器上下文 public void OnActionExecuting(ActionExecutingContext filterContext) { //若为本地测试,则不需要校验 if (GlobalSwitch.RunModel == RunModel.LocalTest) { return; } AjaxResult res = new AjaxResult(); //判断是否需要校验 bool needCheck = filterContext.ContainsAttribute() && !filterContext.ContainsAttribute(); if (!needCheck) return; var allRequestParams = HttpHelper.GetAllRequestParams(filterContext.HttpContext.ApplicationInstance.Context); if(!allRequestParams.ContainsKey("appId")) { res.Success = false; res.Msg = "缺少appId参数!"; filterContext.Result = new ContentResult { Content = res.ToJson(), ContentEncoding = Encoding.UTF8 }; } string appId = allRequestParams["appId"]?.ToString(); var allUrlPermissions = UrlPermissionManage.GetAllUrlPermissions(); string requestUrl = filterContext.HttpContext.Request.Url.ToString().ToLower(); var thePermission = allUrlPermissions.Where(x => requestUrl.Contains(x.Url.ToLower())).FirstOrDefault(); if (thePermission == null) return; string needPermission = thePermission.PermissionValue; bool hasPermission = PermissionManage.GetAppIdPermissionValues(appId).Any(x => x.ToLower() == needPermission.ToLower()); if (hasPermission) return; else { res.Success = false; res.Msg = "权限不足!访问失败!"; filterContext.Result = new ContentResult { Content = res.ToJson(), ContentEncoding = Encoding.UTF8 }; } } /// /// Action执行完毕之后执行 /// /// public void OnActionExecuted(ActionExecutedContext filterContext) { } } } ================================================ FILE: src/Coldairarrow.Web/App_Start/01Handler/对外接口签名校验/CheckSignAttribute.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Util; using System.Web.Mvc; namespace Coldairarrow.Web { /* ==== 签名算法 ==== appId:AppAdmin appSecret:oEt6sgjgPGeA5wFX 每个接口必须参数 | appId | string | 应用Id | | time | string | 当前时间,格式为:2017-01-01 23:00:00 | | sign| string | 签名,签名算法如下 | 签名算法示例: 令: appId=xxx appSecret=xxx time=2017-01-01 23:00:00 1.对除签名外的所有请求参数按key做升序排列(字符串ASCII排序) 例如:有c=3,b=2,a=1 三个业务参数,另需要加上校验签名参数appId和time, 按key排序后为:a=1,appId=xxx,b=2,c=3,time=2017-01-01 23:00:00。 2 把参数名和参数值连接成字符串,得到拼装字符:a1appIdxxxb2c3time2017-01-01 23:00:00 3 用申请到的appSecret连接到接拼装字符串尾部,然后进行32位MD5加密,最后将到得MD5加密摘要转化成大写,即得到签名sign 示例:拼接字符串为a1appIdxxxb2c3time2017-01-01 23:00:00,appSecret为xxx,则sign=DBC4DB3A404576DB0D3D5F1F8547526B */ /// /// 校验签名 /// public class CheckSignAttribute : FilterAttribute, IActionFilter { /// /// Action执行之前执行 /// /// public void OnActionExecuting(ActionExecutingContext filterContext) { CheckSignBusiness _checkSignBusiness = new CheckSignBusiness(); //若为本地测试,则不需要校验 if (GlobalSwitch.RunModel == RunModel.LocalTest) { return; } //判断是否需要签名 bool needSign = filterContext.ContainsAttribute() && !filterContext.ContainsAttribute(); //不需要签名 if (!needSign) return; //需要签名 var checkSignRes = _checkSignBusiness.IsSecurity(filterContext.HttpContext.ApplicationInstance.Context); if (!checkSignRes.Success) { filterContext.Result = new ContentResult() { Content = checkSignRes.ToJson() }; } } /// /// Action执行完毕之后执行 /// /// public void OnActionExecuted(ActionExecutedContext filterContext) { } } } ================================================ FILE: src/Coldairarrow.Web/App_Start/01Handler/对外接口签名校验/IgnoreAppIdPermissionAttribute.cs ================================================ using System; namespace Coldairarrow.Web { /// /// 忽略校验AppId接口权限 /// public class IgnoreAppIdPermissionAttribute : Attribute { } } ================================================ FILE: src/Coldairarrow.Web/App_Start/01Handler/对外接口签名校验/IgnoreSignAttribute.cs ================================================ using System; namespace Coldairarrow.Web { /// /// 忽略接口签名校验 /// public class IgnoreSignAttribute : Attribute { } } ================================================ FILE: src/Coldairarrow.Web/App_Start/01Handler/登录校验/CheckLoginAttribute.cs ================================================ using Coldairarrow.Business.Common; using Coldairarrow.Util; using System; using System.Text; using System.Web.Mvc; namespace Coldairarrow.Web { /// /// 校验登录 /// public class CheckLoginAttribute : FilterAttribute, IActionFilter { /// /// Action执行之前执行 /// /// 过滤器上下文 public void OnActionExecuting(ActionExecutingContext filterContext) { var request = filterContext.RequestContext.HttpContext.Request; try { //若为本地测试,则不需要登录 if (GlobalSwitch.RunModel == RunModel.LocalTest) { return; } //判断是否需要登录 bool needLogin = filterContext.ContainsAttribute() && !filterContext.ContainsAttribute(); //转到登录 if (needLogin && !Operator.Logged()) { RedirectToLogin(); } else return; } catch (Exception ex) { BusHelper.HandleException(ex); RedirectToLogin(); } void RedirectToLogin() { if (request.IsAjaxRequest()) { filterContext.Result = new ContentResult { Content = new AjaxResult { Success = false, ErrorCode = 1, Msg = "未登录" }.ToJson(), ContentEncoding = Encoding.UTF8, ContentType = "application/json" }; } else { UrlHelper urlHelper = new UrlHelper(filterContext.RequestContext); string loginUrl = urlHelper.Content("~/Home/Login"); string script = $@" "; filterContext.Result = new ContentResult { Content = script, ContentType = "text/html", ContentEncoding = Encoding.UTF8 }; } } } /// /// Action执行完毕之后执行 /// /// public void OnActionExecuted(ActionExecutedContext filterContext) { } } } ================================================ FILE: src/Coldairarrow.Web/App_Start/01Handler/登录校验/IgnoreLoginAttribute.cs ================================================ using System; namespace Coldairarrow.Web { /// /// 忽略登录校验 /// public class IgnoreLoginAttribute : Attribute { } } ================================================ FILE: src/Coldairarrow.Web/App_Start/02BaseController/BaseApiController.cs ================================================ namespace Coldairarrow.Web { /// /// Mvc对外接口基控制器 /// [CheckSign] [CheckAppIdPermission] public class BaseApiController : BaseController { } } ================================================ FILE: src/Coldairarrow.Web/App_Start/02BaseController/BaseController.cs ================================================ using Coldairarrow.Business; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Text; using System.Web; using System.Web.Mvc; namespace Coldairarrow.Web { /// /// Mvc基控制器 /// public class BaseController : Controller { /// /// 在调用操作方法前调用 /// /// 请求上下文 protected override void OnActionExecuting(ActionExecutingContext filterContext) { var sessionCookie = HttpContext.Request.Cookies[SessionHelper.SessionCookieName]; if (sessionCookie.IsNullOrEmpty()) { string sessionId = Guid.NewGuid().ToString(); sessionCookie = new HttpCookie(SessionHelper.SessionCookieName, sessionId) { Expires = DateTime.MaxValue }; HttpContext.Request.Cookies.Add(sessionCookie); HttpContext.Response.Cookies.Add(sessionCookie); } //参数映射:支持application/json //var actionParameters = filterContext.ActionParameters; //var allParamters = HttpHelper.GetAllRequestParams(System.Web.HttpContext.Current); //filterContext.ActionDescriptor.GetParameters().ForEach(aParamter => //{ // string key = aParamter.ParameterName; // if (allParamters.ContainsKey(key)) // { // if (allParamters[key] != null) // actionParameters[key] = allParamters[key]?.ToJson().ToObject(aParamter.ParameterType); // } //}); } /// /// 返回JSON格式的内容 /// /// JSON字符串 /// public ContentResult JsonContent(string jsonStr) { return Content(jsonStr, "application/json", Encoding.UTF8); } /// /// 返回成功 /// /// public ContentResult Success() { AjaxResult res = new AjaxResult { Success = true, Msg = "请求成功!", Data = null }; return JsonContent(res.ToJson()); } /// /// 返回成功 /// /// 消息 /// public ContentResult Success(string msg) { AjaxResult res = new AjaxResult { Success = true, Msg = msg, Data = null }; return JsonContent(res.ToJson()); } /// /// 返回成功 /// /// 返回的数据 /// public ContentResult Success(object data) { AjaxResult res = new AjaxResult { Success = true, Msg = "请求成功!", Data = data }; return JsonContent(res.ToJson()); } /// /// 返回成功 /// /// 返回的消息 /// 返回的数据 /// public ContentResult Success(string msg, object data) { AjaxResult res = new AjaxResult { Success = true, Msg = msg, Data = data }; return JsonContent(res.ToJson()); } /// /// 返回错误 /// /// public ContentResult Error() { AjaxResult res = new AjaxResult { Success = false, Msg = "请求失败!", Data = null }; return JsonContent(res.ToJson()); } /// /// 返回错误 /// /// 错误提示 /// public ContentResult Error(string msg) { AjaxResult res = new AjaxResult { Success = false, Msg = msg, Data = null }; return JsonContent(res.ToJson()); } /// /// 返回数据表格数据 /// 注:Easyui的DataGrid /// /// 数据列表 /// 分页参数 /// public ActionResult DataTable_Easyui(object dataList, Pagination pagination) { return Content(pagination.BuildTableResult_DataGrid(dataList).ToJson()); } /// /// 当前URL是否包含某字符串 /// 注:忽略大小写 /// /// 包含的字符串 /// public bool UrlContains(string subUrl) { return Request.Url.ToString().ToLower().Contains(subUrl.ToLower()); } /// /// 写入日志 /// /// 日志内容 /// 日志类型 public static void WriteSysLog(string logContent, EnumType.LogType logType) { BaseBusiness.WriteSysLog(logContent, logType); } /// /// 写入日志 /// /// 日志内容 public void WriteSysLog(string logContent) { WriteSysLog(logContent, LogType); } /// /// 日志类型 /// 注:可通过具体控制器重写 /// public virtual EnumType.LogType LogType { get { throw new Exception("请在子类重写日志类型"); } } } } ================================================ FILE: src/Coldairarrow.Web/App_Start/02BaseController/BaseMvcController.cs ================================================ namespace Coldairarrow.Web { /// /// Mvc基控制器 /// [CheckLogin] [CheckUrlPermission] public class BaseMvcController : BaseController { } } ================================================ FILE: src/Coldairarrow.Web/App_Start/03Extentions/Extention.UrlHelper.cs ================================================ using System.IO; namespace System.Web.Mvc { public static partial class Extention { /// /// 获取最新的s文件或css文件 /// 注:解决缓存问题,只有文件修改后才会获取最新版 /// /// /// /// public static string Scrpit(this UrlHelper helper, string scriptVirtualPath) { string filePath = helper.RequestContext.HttpContext.Server.MapPath(scriptVirtualPath); FileInfo fileInfo = new FileInfo(filePath); var lastTime = fileInfo.LastWriteTime.GetHashCode(); return helper.Content($"{scriptVirtualPath}?_v={lastTime}"); } } } ================================================ FILE: src/Coldairarrow.Web/App_Start/FilterConfig.cs ================================================ using System.Web.Mvc; namespace Coldairarrow.Web { public class FilterConfig { public static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new HandlerGlobalError()); } } } ================================================ FILE: src/Coldairarrow.Web/App_Start/RouteConfig.cs ================================================ using System.Web.Mvc; using System.Web.Routing; namespace Coldairarrow.Web { public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapMvcAttributeRoutes(); /* 注册所有区域 之所以将代码从Global.ashx移到这里,有其必要性~~~. */ AreaRegistration.RegisterAllAreas(); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } } } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Base_SysManageAreaRegistration.cs ================================================ using System.Web.Mvc; namespace Coldairarrow.Web { public class Base_SysManageAreaRegistration : AreaRegistration { public override string AreaName { get { return "Base_SysManage"; } } public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Base_SysManage_default", "Base_SysManage/{controller}/{action}/{id}", new { action = "Index", id = UrlParameter.Optional } ); } } } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Controllers/Base_AppSecretController.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Web.Mvc; namespace Coldairarrow.Web { public class Base_AppSecretController : BaseMvcController { Base_AppSecretBusiness _base_AppSecretBusiness = new Base_AppSecretBusiness(); #region ͼ public ActionResult Index() { return View(); } public ActionResult Form(string id) { var theData = id.IsNullOrEmpty() ? new Base_AppSecret() : _base_AppSecretBusiness.GetTheData(id); return View(theData); } public ActionResult PermissionForm(string appId) { ViewData["appId"] = appId; return View(); } #endregion #region ȡ /// /// ȡб /// /// ѯ /// ؼ /// public ActionResult GetDataList(string condition, string keyword, Pagination pagination) { var dataList = _base_AppSecretBusiness.GetDataList(condition, keyword, pagination); return Content(pagination.BuildTableResult_DataGrid(dataList).ToJson()); } #endregion #region ύ /// /// /// /// public ActionResult SaveData(Base_AppSecret theData) { if(theData.Id.IsNullOrEmpty()) { theData.Id = Guid.NewGuid().ToSequentialGuid(); _base_AppSecretBusiness.AddData(theData); WriteSysLog($"ӦId:{theData.AppId}", EnumType.LogType.ӿԿ); } else { _base_AppSecretBusiness.UpdateData(theData); WriteSysLog($"ӦId:{theData.AppId}", EnumType.LogType.ӿԿ); } return Success(); } /// /// ɾ /// /// ɾ public ActionResult DeleteData(string ids) { var idList = ids.ToList(); _base_AppSecretBusiness.DeleteData(idList); WriteSysLog($"ɾȻΪ:{string.Join(",", idList)}ӦId", EnumType.LogType.ӿԿ); return Success("ɾɹ"); } public ActionResult SavePermission(string appId, string permissions) { PermissionManage.SetAppIdPermission(appId, permissions.ToList()); return Success(); } #endregion } } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Controllers/Base_DatabaseLinkController.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Web.Mvc; namespace Coldairarrow.Web { public class Base_DatabaseLinkController : BaseMvcController { Base_DatabaseLinkBusiness _base_DatabaseLinkBusiness = new Base_DatabaseLinkBusiness(); #region ͼ public ActionResult Index() { return View(); } public ActionResult Form(string id) { var theData = id.IsNullOrEmpty() ? new Base_DatabaseLink() : _base_DatabaseLinkBusiness.GetTheData(id); return View(theData); } #endregion #region ȡ /// /// ȡб /// /// ѯ /// ؼ /// public ActionResult GetDataList(string condition, string keyword, Pagination pagination) { var dataList = _base_DatabaseLinkBusiness.GetDataList(condition, keyword, pagination); return Content(pagination.BuildTableResult_DataGrid(dataList).ToJson()); } #endregion #region ύ /// /// /// /// public ActionResult SaveData(Base_DatabaseLink theData) { if(theData.Id.IsNullOrEmpty()) { theData.Id = Guid.NewGuid().ToSequentialGuid(); _base_DatabaseLinkBusiness.AddData(theData); } else { _base_DatabaseLinkBusiness.UpdateData(theData); } return Success(); } /// /// ɾ /// /// ɾ public ActionResult DeleteData(string ids) { _base_DatabaseLinkBusiness.DeleteData(ids.ToList()); return Success("ɾɹ"); } #endregion } } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Controllers/Base_SysLogController.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Web.Mvc; namespace Coldairarrow.Web { public class Base_SysLogController : BaseMvcController { Base_SysLogBusiness _base_SysLogBusiness = new Base_SysLogBusiness(); #region ͼ public ActionResult Index() { return View(); } #endregion #region ȡ /// /// ȡ־б /// /// ־ /// ־ /// û /// ʼʱ /// ʱ /// ҳ /// public ActionResult GetLogList( string logContent, string logType, string opUserName, DateTime? startTime, DateTime? endTime, Pagination pagination) { var dataList = _base_SysLogBusiness.GetLogList(logContent, logType, opUserName, startTime, endTime, pagination); return Content(pagination.BuildTableResult_DataGrid(dataList).ToJson()); } public ActionResult GetLogTypeList() { List logTypeList = new List(); Enum.GetNames(typeof(EnumType.LogType)).ForEach(aName => { logTypeList.Add(new { Name = aName, Value = aName }); }); return Content(logTypeList.ToJson()); } #endregion #region ύ #endregion } } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Controllers/Base_SysRoleController.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Web.Mvc; namespace Coldairarrow.Web { public class Base_SysRoleController : BaseMvcController { Base_SysRoleBusiness _base_SysRoleBusiness = new Base_SysRoleBusiness(); #region ͼ public ActionResult Index() { return View(); } public ActionResult Form(string id) { var theData = id.IsNullOrEmpty() ? new Base_SysRole() : _base_SysRoleBusiness.GetTheData(id); return View(theData); } public ActionResult PermissionForm(string roleId) { ViewData["roleId"] = roleId; return View(); } #endregion #region ȡ /// /// ȡб /// /// ѯ /// ؼ /// public ActionResult GetDataList(string condition, string keyword, Pagination pagination) { var dataList = _base_SysRoleBusiness.GetDataList(condition, keyword, pagination); return Content(pagination.BuildTableResult_DataGrid(dataList).ToJson()); } /// /// ȡɫб /// ע޷ҳ /// /// public ActionResult GetDataList_NoPagin() { Pagination pagination = new Pagination { PageIndex = 1, PageRows = int.MaxValue }; var dataList = _base_SysRoleBusiness.GetDataList(null, null, pagination); return Content(dataList.ToJson()); } #endregion #region ύ /// /// /// /// public ActionResult SaveData(Base_SysRole theData) { if (theData.Id.IsNullOrEmpty()) { theData.Id = Guid.NewGuid().ToSequentialGuid(); theData.RoleId = Guid.NewGuid().ToSequentialGuid(); _base_SysRoleBusiness.AddData(theData); } else { _base_SysRoleBusiness.UpdateData(theData); } return Success(); } /// /// ɾ /// /// ɾ public ActionResult DeleteData(string ids) { _base_SysRoleBusiness.DeleteData(ids.ToList()); PermissionManage.ClearUserPermissionCache(); return Success("ɾɹ"); } /// /// ýɫȨ /// /// ɫId /// Ȩֵ /// public ActionResult SavePermission(string roleId,string permissions) { _base_SysRoleBusiness.SavePermission(roleId, permissions.ToList()); return Success(); } #endregion } } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Controllers/Base_UserController.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System; using System.Web.Mvc; namespace Coldairarrow.Web { public class Base_UserController : BaseMvcController { Base_UserBusiness _base_UserBusiness = new Base_UserBusiness(); #region ͼ public ActionResult Index() { return View(); } public ActionResult Form(string id) { var theData = id.IsNullOrEmpty() ? new Base_User() : _base_UserBusiness.GetTheData(id); return View(theData); } public ActionResult ChangePwdForm() { return View(); } public ActionResult PermissionForm(string userId) { ViewData["userId"] = userId; return View(); } #endregion #region ȡ /// /// ȡб /// /// ѯ /// ؼ /// public ActionResult GetDataList(string condition, string keyword, Pagination pagination) { var dataList = _base_UserBusiness.GetDataList(condition, keyword, pagination); return Content(pagination.BuildTableResult_DataGrid(dataList).ToJson()); } #endregion #region ύ public ActionResult SaveData(Base_User theData, string Pwd, string RoleIdList) { if (!Pwd.IsNullOrEmpty()) theData.Password = Pwd.ToMD5String(); var roleIdList = RoleIdList.ToList(); if (theData.Id.IsNullOrEmpty()) { theData.Id = Guid.NewGuid().ToSequentialGuid(); theData.UserId = Guid.NewGuid().ToSequentialGuid(); _base_UserBusiness.AddData(theData); } else { _base_UserBusiness.UpdateData(theData); } _base_UserBusiness.SetUserRole(theData.UserId, roleIdList); return Success(); } /// /// ɾ /// /// ɾ public ActionResult DeleteData(string ids) { _base_UserBusiness.DeleteData(ids.ToList()); return Success("ɾɹ"); } /// /// /// /// /// public ActionResult ChangePwd(string oldPwd, string newPwd) { var res = _base_UserBusiness.ChangePwd(oldPwd, newPwd); return Content(res.ToJson()); } /// /// Ȩ /// /// ûId /// Ȩ /// public ActionResult SavePermission(string userId, string permissions) { PermissionManage.SetUserPermission(userId, permissions.ToList()); return Success(); } #endregion } } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Controllers/CityController.cs ================================================ using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; namespace Coldairarrow.Web { public class CityController : BaseMvcController { static CityController() { string rootPath = AppDomain.CurrentDomain.BaseDirectory; string jsonStr = System.IO.File.ReadAllText($"{rootPath}Config/Province.json"); _countryRegin = jsonStr.ToObject(); } private static CountryRegin _countryRegin { get; } = null; #region 视图功能 public ActionResult Index() { return View(); } #endregion #region 获取数据 /// /// 获取省份列表 /// /// 省份名 /// public ActionResult GetProvinceList(string q) { var predicate = LinqHelper.True(); if (!q.IsNullOrEmpty()) predicate = predicate.And(x => x.ProName.Contains(q)); return Content(_countryRegin.provinceList.Where(predicate.Compile()).ToJson()); } /// /// 获取城市列表 /// /// 城市名 /// 省份Id /// public ActionResult GetCityList(string q, string proId) { var predicate = LinqHelper.True(); if (!q.IsNullOrEmpty()) predicate = predicate.And(x => x.CityName.Contains(q)); if (!proId.IsNullOrEmpty()) predicate = predicate.And(x => x.ProID.ToString() == proId); return Content(_countryRegin.cityList.Where(predicate.Compile()).ToJson()); } /// /// 获取县城列表 /// /// 县城名 /// 城市Id /// public ActionResult GetCountyList(string q, string cityId) { var predicate = LinqHelper.True(); if (!q.IsNullOrEmpty()) predicate = predicate.And(x => x.DisName.Contains(q)); if (!cityId.IsNullOrEmpty()) predicate = predicate.And(x => x.CityID.ToString() == cityId); return Content(_countryRegin.countyList.Where(predicate.Compile()).ToJson()); } #endregion #region 提交数据 #endregion #region 数据模型 public class ProvinceListItem { /// /// /// public int ProID { get; set; } /// /// 北京市 /// public string ProName { get; set; } /// /// /// public int ProSort { get; set; } /// /// 直辖市 /// public string ProRemark { get; set; } } public class CityListItem { /// /// /// public int CityID { get; set; } /// /// 北京市 /// public string CityName { get; set; } /// /// /// public int ProID { get; set; } /// /// /// public int CitySort { get; set; } } public class CountyListItem { /// /// /// public int Id { get; set; } /// /// 县城名 /// public string DisName { get; set; } /// /// /// public int CityID { get; set; } /// /// /// public string DisSort { get; set; } } public class CountryRegin { /// /// /// public List provinceList { get; set; } /// /// /// public List cityList { get; set; } /// /// /// public List countyList { get; set; } } #endregion } } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Controllers/CommonController.cs ================================================ using System.Web.Mvc; namespace Coldairarrow.Web { public class CommonController : Controller { public ActionResult ShowBigImg(string url) { ViewData["url"] = url; return View(); } } } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Controllers/RapidDevelopmentController.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Util; using System.Web.Mvc; namespace Coldairarrow.Web { public class RapidDevelopmentController : BaseMvcController { RapidDevelopmentBusiness _rapidDevelopmentBus = new RapidDevelopmentBusiness(); #region 视图功能 public ActionResult Index() { return View(); } public ActionResult Form() { return View(); } #endregion #region 获取数据 /// /// 获取所有数据库连接 /// /// public ActionResult GetAllDbLink() { var dataList = _rapidDevelopmentBus.GetAllDbLink(); return Content(dataList.ToJson()); } /// /// 获取数据库所有表 /// /// 数据库连接Id /// public ActionResult GetDbTableList(string linkId) { Pagination pagination = new Pagination { PageIndex = 1, PageRows = int.MaxValue, RecordCount = int.MaxValue }; return Content(pagination.BuildTableResult_DataGrid(_rapidDevelopmentBus.GetDbTableList(linkId)).ToJson()); } #endregion #region 提交数据 /// /// 生成代码 /// /// 连接Id /// 区域名 /// 表列表 /// 需要生成类型 public ActionResult BuildCode(string linkId, string areaName, string tables, string buildType) { _rapidDevelopmentBus.BuildCode(linkId, areaName, tables, buildType); return Success("生成成功!"); } #endregion } } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_AppSecret/Form.cshtml ================================================ @using Coldairarrow.Entity.Base_SysManage; @using Coldairarrow.Util; @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; var obj = (Base_AppSecret)Model; var objStr = Html.Raw(obj.ToJson()); }
ӦId
ӦԿ
Ӧ
@section foottoolbar{ } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_AppSecret/Index.cshtml ================================================ @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; } @section toolbar{ ޸ ɾ } @section search{
ѯ
}
================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_AppSecret/PermissionForm.cshtml ================================================ @using Coldairarrow.Business.Base_SysManage; @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; var permissions = PermissionManage.GetAppIdPermissionModules((string)ViewData["appId"]); }
@foreach (var aModule in permissions) { }
模块 权限项 操作
@aModule.Name @foreach (var item in aModule.Items) { } 全选 全消
================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_DatabaseLink/Form.cshtml ================================================ @using Coldairarrow.Entity.Base_SysManage; @using Coldairarrow.Util; @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; var obj = (Base_DatabaseLink)Model; var objStr = Html.Raw(obj.ToJson()); }
ַ
ݿ
@section foottoolbar{ } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_DatabaseLink/Index.cshtml ================================================ @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; } @section toolbar{ ޸ ɾ } @section search{
ѯ
}
================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_SysLog/Index.cshtml ================================================ @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; } @section search{

ѯ
}
================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_SysRole/Form.cshtml ================================================ @using Coldairarrow.Entity.Base_SysManage; @using Coldairarrow.Util; @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; var obj = (Base_SysRole)Model; }
角色名
@section foottoolbar{ 保存 } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_SysRole/Index.cshtml ================================================ @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; } @section toolbar{ 添加 修改 删除 } @section search{
}
================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_SysRole/PermissionForm.cshtml ================================================ @using Coldairarrow.Business.Base_SysManage; @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; var permissions = PermissionManage.GetRolePermissionModules((string)ViewData["roleId"]); }
@foreach (var aModule in permissions) { }
模块 权限项 操作
@aModule.Name @foreach (var item in aModule.Items) { } 全选 全消
================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_User/ChangePwdForm.cshtml ================================================ @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; }
原密码
新密码
@section foottoolbar{ 保存 } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_User/Form.cshtml ================================================ @using Coldairarrow.Entity.Base_SysManage; @using Coldairarrow.Util; @using Coldairarrow.Business.Base_SysManage; @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; var obj = (Base_User)Model; string roleIdList ="[]"; if (!obj.Id.IsNullOrEmpty()) { roleIdList = Base_UserBusiness.GetUserRoleIds(obj.UserId).ToJson().Replace("\"", "'"); } string str = obj.ToJson(); var objStr = Html.Raw(obj.ToJson()); }
û
ʵ
Ա
ɫ
@section foottoolbar{ } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_User/Index.cshtml ================================================ @using Coldairarrow.Business.Base_SysManage; @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; var manage = PermissionManage.OperatorHasPermissionValue("sysuser.manage"); var manageSysPermission = PermissionManage.OperatorHasPermissionValue("sysuser.manageSysPermission"); } @section toolbar{ @if (manage) { ޸ ɾ } } @section search{
ѯ
}
================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Base_User/PermissionForm.cshtml ================================================ @using Coldairarrow.Business.Base_SysManage; @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; var permissions = PermissionManage.GetUserPermissionModules((string)ViewData["userId"]); }
@foreach (var aModule in permissions) { }
模块 权限项 操作
@aModule.Name @foreach (var item in aModule.Items) { } 全选 全消
================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/City/Index.cshtml ================================================ @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; } @section toolbar{ 添加 修改 删除 } @section search{
} ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/Common/ShowBigImg.cshtml ================================================ @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; string url = ViewData["url"] as string; } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/RapidDevelopment/Form.cshtml ================================================ @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; }
生成选项
生成区域
@section foottoolbar{ 生成 } ================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/RapidDevelopment/Index.cshtml ================================================ @{ Layout = "~/Views/Shared/_Layout_List.cshtml"; } @section search{
}
================================================ FILE: src/Coldairarrow.Web/Areas/Base_SysManage/Views/web.config ================================================ 
================================================ FILE: src/Coldairarrow.Web/Common/SystemMenuManage.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Business.Common; using Coldairarrow.Util; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Xml.Linq; namespace Coldairarrow.Web { /// /// 系统菜单管理 /// public static class SystemMenuManage { #region 构造函数 /// /// 静态构造函数 /// static SystemMenuManage() { InitAllMenu(); } #endregion #region 私有成员 private static string _configFile { get; } = "~/Config/SystemMenu.config"; private static List _allMenu { get; set; } private static void InitAllMenu() { Action SetMenuProperty = (menu, element) => { List exceptProperties = new List { "Id", "IsShow" }; menu.GetType().GetProperties().Where(x => !exceptProperties.Contains(x.Name)).ForEach(aProperty => { aProperty.SetValue(menu, element.Attribute(aProperty.Name)?.Value); }); }; string filePath = HttpContext.Current.Server.MapPath(_configFile); XElement xe = XElement.Load(filePath); List menus = new List(); xe.Elements("FirstMenu")?.ForEach(aElement1 => { Menu newMenu1 = new Menu(); menus.Add(newMenu1); SetMenuProperty(newMenu1, aElement1); newMenu1.SubMenus = new List(); aElement1.Elements("SecondMenu")?.ForEach(aElement2 => { Menu newMenu2 = new Menu(); newMenu1.SubMenus.Add(newMenu2); SetMenuProperty(newMenu2, aElement2); newMenu2.SubMenus = new List(); aElement2.Elements("ThirdMenu")?.ForEach(aElement3 => { Menu newMenu3 = new Menu(); newMenu2.SubMenus.Add(newMenu3); SetMenuProperty(newMenu3, aElement3); if (!newMenu3.Url.IsNullOrEmpty()) { newMenu3.Url = GetUrl(newMenu3.Url); } }); }); }); if (GlobalSwitch.RunModel == RunModel.LocalTest) { Menu newMenu1 = new Menu { Name = "开发", Icon = "icon_menu_prod", SubMenus = new List() }; menus.Add(newMenu1); Menu newMenu1_1 = new Menu { Name = "快速开发", SubMenus = new List() }; newMenu1.SubMenus.Add(newMenu1_1); Menu newMenu1_1_1 = new Menu { Name = "代码生成", Url = GetUrl("~/Base_SysManage/RapidDevelopment/Index") }; newMenu1_1.SubMenus.Add(newMenu1_1_1); Menu newMenu1_1_2 = new Menu { Name = "数据库连接管理", Url = GetUrl("~/Base_SysManage/Base_DatabaseLink/Index") }; newMenu1_1.SubMenus.Add(newMenu1_1_2); Menu newMenu1_1_3 = new Menu { Name = "UEditor Demo", Url = GetUrl("~/Demo/UMEditor") }; newMenu1_1.SubMenus.Add(newMenu1_1_3); Menu newMenu1_1_4 = new Menu { Name = "文件上传Demo", Url = GetUrl("~/Demo/UploadFileIndex") }; newMenu1_1.SubMenus.Add(newMenu1_1_4); } _allMenu = menus; } private static void SetSubMenuShow(List menus, List userPermissionValues, int level) { if (level >= 4) return; menus?.ForEach(aMenu => { if (!aMenu.Permission.IsNullOrEmpty() && !userPermissionValues.Contains(aMenu.Permission)) { aMenu.IsShow = false; return; } else { SetSubMenuShow(aMenu.SubMenus, userPermissionValues, level + 1); } if ((!aMenu?.SubMenus?.Any(x => x.IsShow)) ?? false) aMenu.IsShow = false; }); } private static string GetUrl(string virtualUrl) { UrlHelper urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext); return urlHelper.Content(virtualUrl); } #endregion #region 外部接口 /// /// 获取系统所有菜单 /// /// public static List GetAllSysMenu() { return _allMenu.DeepClone(); } /// /// 获取用户菜单 /// /// public static List GetOperatorMenu() { List resList = GetAllSysMenu(); if (Operator.IsAdmin()) return resList; var userPermissions = PermissionManage.GetUserPermissionValues(Operator.UserId); SetSubMenuShow(resList, userPermissions, 1); return resList; } #endregion } #region 数据模型 public class Menu { #region 属性 public string Id { get; set; } = Guid.NewGuid().ToString(); public string Name { get; set; } public string Icon { get; set; } public string Url { get; set; } public string Permission { get; set; } public bool IsShow { get; set; } = true; public List SubMenus { get; set; } #endregion #region 前端映射 #endregion } #endregion } ================================================ FILE: src/Coldairarrow.Web/Config/NingboGeojson.json ================================================ {"type":"FeatureCollection","features":[{"type":"Feature","properties":{"name":"江北区"},"geometry":{"type":"MultiPolygon","coordinates":[[[[121.387412,29.965169],[121.392638,29.990177],[121.404337,29.988507],[121.40652,29.997022],[121.414636,30.001017],[121.413431,30.005558],[121.406386,30.007481],[121.409596,30.015704],[121.405771,30.020355],[121.412743,30.029163],[121.408772,30.031799],[121.431891,30.039959],[121.432632,30.050212],[121.44736,30.057457],[121.471699,30.057124],[121.482953,30.062812],[121.489486,30.059986],[121.489934,30.054707],[121.486673,30.043068],[121.476673,30.040559],[121.475727,30.035026],[121.492957,30.01292],[121.495223,30.003708],[121.499789,30.002208],[121.491031,30.000763],[121.489533,29.99753],[121.494784,29.993415],[121.508432,29.993521],[121.521135,29.988293],[121.536642,29.993304],[121.552407,29.981679],[121.560244,29.970767],[121.564254,29.971807],[121.568522,29.964431],[121.575147,29.965852],[121.579771,29.96228],[121.59006,29.947843],[121.599506,29.942252],[121.603147,29.944685],[121.606573,29.942742],[121.610965,29.919035],[121.618846,29.918828],[121.623888,29.922741],[121.628391,29.918834],[121.6477,29.917384],[121.650294,29.912551],[121.641597,29.903993],[121.638014,29.909125],[121.631567,29.910641],[121.58063,29.895962],[121.573202,29.890597],[121.565459,29.877969],[121.550791,29.895352],[121.536351,29.894458],[121.53724,29.913426],[121.532415,29.914241],[121.518481,29.907848],[121.510247,29.922625],[121.503462,29.928027],[121.495806,29.927096],[121.488561,29.912823],[121.481925,29.911905],[121.461986,29.929495],[121.460388,29.940761],[121.429383,29.934784],[121.418378,29.951517],[121.405985,29.949542],[121.393573,29.956954],[121.380794,29.954598],[121.36565,29.961516],[121.387412,29.965169]]]]}},{"type":"Feature","properties":{"name":"北仑区"},"geometry":{"type":"MultiPolygon","coordinates":[[[[122.189017,29.927109],[122.036491,29.930543],[121.973575,29.977423],[121.881844,29.952631],[121.804198,30.002687],[121.772373,29.979493],[121.759152,29.978893],[121.740663,29.970773],[121.72803,29.951599],[121.705959,29.949978],[121.689322,29.926646],[121.668255,29.921457],[121.659271,29.912934],[121.671739,29.906589],[121.674668,29.900468],[121.671698,29.897614],[121.681751,29.890255],[121.678745,29.87633],[121.6892,29.865337],[121.684897,29.862481],[121.690675,29.856958],[121.708514,29.86266],[121.734512,29.878826],[121.740736,29.880016],[121.746586,29.875736],[121.748337,29.857453],[121.752599,29.858794],[121.7558,29.851668],[121.765801,29.848511],[121.769781,29.841374],[121.782012,29.83975],[121.788535,29.834999],[121.791336,29.819665],[121.799922,29.821035],[121.814019,29.812331],[121.827255,29.794886],[121.826024,29.788645],[121.831688,29.785467],[121.829197,29.78113],[121.841914,29.774603],[121.842028,29.769105],[121.846043,29.769413],[121.858584,29.757089],[121.870971,29.753635],[121.870769,29.747939],[121.904689,29.743752],[121.915693,29.706842],[121.940819,29.723455],[121.95582,29.754322],[122.005522,29.763079],[122.136022,29.859767],[122.189017,29.927109]]]]}},{"type":"Feature","properties":{"name":"鄞州区"},"geometry":{"type":"MultiPolygon","coordinates":[[[[121.468323,29.777719],[121.469011,29.791274],[121.471982,29.791116],[121.47555,29.797514],[121.482608,29.79293],[121.485022,29.798096],[121.49294,29.7951],[121.498669,29.805368],[121.507901,29.796727],[121.51317,29.796523],[121.51422,29.801279],[121.509574,29.808616],[121.52356,29.81087],[121.517174,29.819124],[121.53053,29.817325],[121.519967,29.831423],[121.532226,29.832845],[121.533167,29.842621],[121.541545,29.84771],[121.542542,29.854441],[121.552826,29.857813],[121.562275,29.867045],[121.571024,29.888002],[121.578563,29.894908],[121.631567,29.910641],[121.638014,29.909125],[121.641597,29.903993],[121.650294,29.912551],[121.659271,29.912934],[121.671739,29.906589],[121.674668,29.900468],[121.671698,29.897614],[121.681751,29.890255],[121.678745,29.87633],[121.6892,29.865337],[121.684897,29.862481],[121.690675,29.856958],[121.708514,29.86266],[121.734512,29.878826],[121.740736,29.880016],[121.746586,29.875736],[121.748337,29.857453],[121.752599,29.858794],[121.7558,29.851668],[121.765801,29.848511],[121.769781,29.841374],[121.782012,29.83975],[121.788535,29.834999],[121.791336,29.819665],[121.799922,29.821035],[121.814019,29.812331],[121.827255,29.794886],[121.826024,29.788645],[121.831688,29.785467],[121.829197,29.78113],[121.841914,29.774603],[121.842028,29.769105],[121.846043,29.769413],[121.858584,29.757089],[121.870971,29.753635],[121.870769,29.747939],[121.904689,29.743752],[121.915693,29.706842],[121.859812,29.668296],[121.803987,29.645556],[121.786374,29.625912],[121.764559,29.638217],[121.717076,29.639208],[121.707375,29.63682],[121.698954,29.639592],[121.682636,29.638092],[121.676417,29.631489],[121.66147,29.625997],[121.650932,29.626655],[121.630483,29.641582],[121.606664,29.629992],[121.592227,29.628343],[121.589443,29.636108],[121.572283,29.641538],[121.564985,29.650628],[121.567672,29.667262],[121.584496,29.693252],[121.583356,29.702099],[121.560994,29.709837],[121.548747,29.70783],[121.534505,29.716086],[121.504032,29.711352],[121.485356,29.71257],[121.479899,29.730204],[121.478749,29.756611],[121.468323,29.777719]]]]}},{"type":"Feature","properties":{"name":"奉化区"},"geometry":{"type":"MultiPolygon","coordinates":[[[[121.786374,29.625912],[121.764559,29.638217],[121.717076,29.639208],[121.707375,29.63682],[121.698954,29.639592],[121.682636,29.638092],[121.676417,29.631489],[121.66147,29.625997],[121.650932,29.626655],[121.630483,29.641582],[121.606664,29.629992],[121.590752,29.629044],[121.589443,29.636108],[121.572283,29.641538],[121.564985,29.650628],[121.567672,29.667262],[121.584496,29.693252],[121.583356,29.702099],[121.560994,29.709837],[121.548747,29.70783],[121.534505,29.716086],[121.504032,29.711352],[121.485356,29.71257],[121.479899,29.730204],[121.478749,29.756611],[121.468323,29.777719],[121.469011,29.791274],[121.465069,29.793657],[121.463005,29.788607],[121.457156,29.785844],[121.453466,29.792037],[121.449295,29.790716],[121.458863,29.782577],[121.458667,29.776478],[121.443994,29.77897],[121.438651,29.776523],[121.438834,29.762657],[121.429454,29.761833],[121.427818,29.749465],[121.405871,29.750006],[121.399666,29.739453],[121.368342,29.739095],[121.34358,29.727824],[121.330983,29.72895],[121.313712,29.735668],[121.297794,29.736468],[121.271774,29.730416],[121.257655,29.736324],[121.237082,29.727994],[121.232601,29.729475],[121.2309,29.734438],[121.209254,29.731795],[121.204643,29.748719],[121.195334,29.742399],[121.196221,29.730547],[121.182762,29.727313],[121.167808,29.713],[121.143926,29.703664],[121.137741,29.691236],[121.138262,29.685159],[121.130958,29.683827],[121.124897,29.676886],[121.116393,29.677927],[121.112183,29.686488],[121.102919,29.685997],[121.096365,29.69645],[121.080073,29.697092],[121.074765,29.712492],[121.071455,29.713759],[121.061994,29.706369],[121.056214,29.690227],[121.064072,29.690072],[121.080109,29.667245],[121.081426,29.639807],[121.092912,29.634455],[121.099365,29.636279],[121.110024,29.628654],[121.111782,29.619967],[121.108334,29.607486],[121.111291,29.5974],[121.104372,29.587504],[121.111286,29.584168],[121.117927,29.571823],[121.117456,29.561172],[121.136322,29.559913],[121.149604,29.547729],[121.174632,29.543144],[121.206327,29.543804],[121.219212,29.536509],[121.230856,29.539098],[121.228541,29.535472],[121.234638,29.530291],[121.236831,29.519122],[121.228128,29.512721],[121.22907,29.50038],[121.23373,29.496832],[121.224894,29.483787],[121.224866,29.469974],[121.220006,29.467828],[121.221696,29.459435],[121.229501,29.454699],[121.221468,29.443792],[121.220287,29.426119],[121.231643,29.42181],[121.23825,29.413019],[121.249262,29.415488],[121.256678,29.422071],[121.276705,29.453478],[121.275685,29.465628],[121.29157,29.482615],[121.309557,29.479057],[121.33237,29.49738],[121.334179,29.504391],[121.35081,29.499083],[121.36302,29.490388],[121.375688,29.491217],[121.398287,29.519746],[121.398842,29.525216],[121.403672,29.527426],[121.414544,29.524252],[121.428236,29.512761],[121.4468,29.518434],[121.449122,29.523493],[121.454369,29.524919],[121.479977,29.511916],[121.487427,29.504122],[121.540114,29.503525],[121.566671,29.49917],[121.597051,29.518026],[121.660056,29.529843],[121.718957,29.550694],[121.771516,29.603824],[121.786374,29.625912]]]]}},{"type":"Feature","properties":{"name":"象山县"},"geometry":{"type":"MultiPolygon","coordinates":[[[[122.256515,28.848889],[122.23118,28.845519],[122.070579,28.854017],[122.021187,28.859791],[121.983639,28.858717],[121.971382,28.863665],[121.793813,29.005017],[121.760714,29.109327],[121.792947,29.205764],[121.806187,29.27289],[121.785135,29.282474],[121.757614,29.278483],[121.758429,29.293977],[121.748696,29.324103],[121.755211,29.336398],[121.749873,29.353381],[121.730003,29.368272],[121.732226,29.398784],[121.726928,29.414463],[121.719252,29.410399],[121.70444,29.415864],[121.695566,29.404515],[121.687978,29.409687],[121.66998,29.414587],[121.665261,29.428431],[121.648428,29.445351],[121.633743,29.45134],[121.628671,29.457247],[121.618503,29.450928],[121.592221,29.453069],[121.578618,29.475823],[121.573972,29.501319],[121.597051,29.518026],[121.660056,29.529843],[121.718957,29.550694],[121.771516,29.603824],[121.803987,29.645556],[121.859812,29.668296],[121.940819,29.723455],[121.946098,29.734217],[122.017829,29.681819],[122.024244,29.666318],[122.069007,29.645677],[122.108125,29.60727],[122.152777,29.574314],[122.19313,29.559481],[122.165667,29.536475],[122.162796,29.52357],[122.166649,29.501227],[122.175224,29.489706],[122.186988,29.484362],[122.243358,29.496142],[122.262739,29.494518],[122.277238,29.485466],[122.287641,29.470185],[122.285676,29.454499],[122.275258,29.441495],[122.258241,29.430973],[122.234686,29.261346],[122.216516,29.084663],[122.218449,29.03641],[122.228273,28.974432],[122.242812,28.951203],[122.266162,28.93792],[122.302829,28.909722],[122.313801,28.895626],[122.31692,28.880329],[122.312823,28.869109],[122.302546,28.859077],[122.256515,28.848889]]]]}},{"type":"Feature","properties":{"name":"镇海区"},"geometry":{"type":"MultiPolygon","coordinates":[[[[121.489486,30.059986],[121.507074,30.058642],[121.529233,30.065512],[121.537213,30.061223],[121.554113,30.061409],[121.570336,30.049317],[121.584128,30.045045],[121.611899,30.048379],[121.628693,30.074111],[121.730195,30.118619],[121.766394,30.054817],[121.784404,30.038796],[121.793187,30.022777],[121.795543,30.010173],[121.804198,30.002687],[121.772373,29.979493],[121.759152,29.978893],[121.740663,29.970773],[121.72803,29.951599],[121.705959,29.949978],[121.689322,29.926646],[121.668255,29.921457],[121.65855,29.91159],[121.650294,29.912551],[121.6477,29.917384],[121.6275,29.919091],[121.623888,29.922741],[121.612435,29.918466],[121.608697,29.921473],[121.606573,29.942742],[121.603147,29.944685],[121.599506,29.942252],[121.59006,29.947843],[121.579771,29.96228],[121.575147,29.965852],[121.568522,29.964431],[121.567966,29.968231],[121.563879,29.971987],[121.560244,29.970767],[121.544458,29.988645],[121.535717,29.993598],[121.521135,29.988293],[121.508432,29.993521],[121.494784,29.993415],[121.489533,29.99753],[121.491031,30.000763],[121.499789,30.002208],[121.495223,30.003708],[121.492957,30.01292],[121.475622,30.037516],[121.476673,30.040559],[121.486673,30.043068],[121.489486,30.059986]]]]}},{"type":"Feature","properties":{"name":"余姚市"},"geometry":{"type":"MultiPolygon","coordinates":[[[[120.932552,30.17289],[120.89995,30.233836],[120.886508,30.249979],[120.964072,30.285865],[121.061806,30.351503],[121.085982,30.276193],[121.106424,30.289227],[121.104299,30.27508],[121.091072,30.267586],[121.08594,30.256452],[121.068405,30.250202],[121.06235,30.244402],[121.065241,30.242589],[121.068531,30.247381],[121.095695,30.254654],[121.10079,30.25309],[121.110584,30.216927],[121.103905,30.213043],[121.105638,30.186077],[121.112178,30.185534],[121.118308,30.17677],[121.143249,30.170778],[121.147216,30.175187],[121.190979,30.174339],[121.194695,30.174681],[121.196016,30.179084],[121.219483,30.180879],[121.225378,30.178798],[121.228217,30.168796],[121.236063,30.162447],[121.234778,30.156629],[121.22221,30.152544],[121.20991,30.136702],[121.181731,30.128423],[121.17959,30.123482],[121.193449,30.103217],[121.192323,30.096244],[121.197759,30.088814],[121.209589,30.089478],[121.216623,30.080138],[121.226797,30.076106],[121.267067,30.082055],[121.28339,30.076809],[121.316536,30.08015],[121.343582,30.073999],[121.359173,30.074814],[121.371554,30.06711],[121.385938,30.072193],[121.396469,30.070064],[121.401891,30.076778],[121.408006,30.069762],[121.417688,30.07408],[121.419401,30.07182],[121.408839,30.063116],[121.409662,30.055344],[121.419091,30.050397],[121.432632,30.050212],[121.430439,30.046298],[121.433024,30.04085],[121.408256,30.030906],[121.412743,30.029163],[121.405771,30.020355],[121.409596,30.015704],[121.406386,30.007481],[121.413859,30.005188],[121.413711,29.999694],[121.40652,29.997022],[121.403453,29.988077],[121.392638,29.990177],[121.387412,29.965169],[121.365617,29.961837],[121.380794,29.954598],[121.395823,29.956023],[121.381843,29.932592],[121.388612,29.918517],[121.361486,29.900235],[121.352326,29.906213],[121.328852,29.908915],[121.328418,29.919995],[121.321944,29.915527],[121.321507,29.923257],[121.314595,29.92293],[121.304253,29.913166],[121.304225,29.903937],[121.289649,29.90003],[121.270683,29.900477],[121.263539,29.892465],[121.258405,29.892453],[121.256073,29.885776],[121.246626,29.88255],[121.239348,29.858582],[121.232203,29.851574],[121.201646,29.832437],[121.189129,29.830816],[121.172147,29.79819],[121.174459,29.793435],[121.170532,29.793738],[121.15273,29.779339],[121.157538,29.76762],[121.154284,29.751094],[121.164249,29.735646],[121.176129,29.735118],[121.195334,29.742399],[121.19701,29.731979],[121.177798,29.724265],[121.166041,29.711949],[121.143926,29.703664],[121.137741,29.691236],[121.138262,29.685159],[121.130958,29.683827],[121.124897,29.676886],[121.116393,29.677927],[121.112183,29.686488],[121.102919,29.685997],[121.096365,29.69645],[121.080073,29.697092],[121.074765,29.712492],[121.071455,29.713759],[121.061994,29.706369],[121.051753,29.685538],[121.028898,29.676244],[121.00408,29.679167],[120.995818,29.685601],[120.998531,29.691398],[121.019482,29.695209],[121.012143,29.704378],[121.014983,29.714775],[121.036857,29.720356],[121.041983,29.724375],[121.029498,29.733815],[121.030555,29.738573],[121.042327,29.746613],[121.029403,29.763034],[121.048728,29.76781],[121.067189,29.786154],[121.075516,29.783631],[121.095724,29.793435],[121.101273,29.804143],[121.110651,29.809135],[121.101751,29.822288],[121.111661,29.840151],[121.109487,29.845012],[121.096816,29.849849],[121.090955,29.855682],[121.079506,29.856076],[121.071434,29.864586],[121.06723,29.865094],[121.064866,29.859837],[121.06211,29.860987],[121.036982,29.878934],[121.037912,29.884274],[121.032581,29.885767],[121.021848,29.900353],[121.028582,29.903046],[121.037035,29.916803],[121.036177,29.924526],[121.046249,29.935502],[121.049724,29.961339],[121.057475,29.966018],[121.072326,29.967417],[121.081675,29.976786],[121.091033,29.979072],[121.097001,29.993406],[121.087835,29.997477],[121.082864,30.007],[121.076435,30.010843],[121.065187,30.00788],[121.058298,30.016972],[121.050071,30.007935],[121.0436,30.021453],[121.032511,30.018108],[121.019421,30.023969],[121.017091,30.029358],[121.006596,30.026075],[120.998023,30.032135],[120.997243,30.059322],[120.975787,30.07621],[120.979058,30.084638],[120.972804,30.096359],[120.964896,30.100954],[120.955318,30.097363],[120.947352,30.106605],[120.943541,30.11921],[120.935861,30.120036],[120.944712,30.131941],[120.932552,30.17289]]]]}},{"type":"Feature","properties":{"name":"海曙区"},"geometry":{"type":"MultiPolygon","coordinates":[[[[121.152521,29.775275],[121.15273,29.779339],[121.170532,29.793738],[121.174459,29.793435],[121.172147,29.79819],[121.189129,29.830816],[121.201646,29.832437],[121.232203,29.851574],[121.239348,29.858582],[121.246626,29.88255],[121.256073,29.885776],[121.258405,29.892453],[121.263539,29.892465],[121.273116,29.901109],[121.284073,29.899488],[121.304225,29.903937],[121.304253,29.913166],[121.314595,29.92293],[121.320981,29.923662],[121.321348,29.915751],[121.329138,29.918787],[121.328852,29.908915],[121.352326,29.906213],[121.363797,29.900136],[121.388612,29.918517],[121.381843,29.932592],[121.395823,29.956023],[121.405985,29.949542],[121.419635,29.950888],[121.429383,29.934784],[121.460388,29.940761],[121.461986,29.929495],[121.481925,29.911905],[121.488561,29.912823],[121.494335,29.925706],[121.500073,29.928364],[121.510247,29.922625],[121.518481,29.907848],[121.536141,29.913986],[121.536351,29.894458],[121.550791,29.895352],[121.566557,29.877994],[121.556932,29.861133],[121.542542,29.854441],[121.541545,29.84771],[121.533167,29.842621],[121.532226,29.832845],[121.519967,29.831423],[121.53053,29.817325],[121.517174,29.819124],[121.52356,29.81087],[121.509574,29.808616],[121.51422,29.801279],[121.51317,29.796523],[121.507901,29.796727],[121.498669,29.805368],[121.49294,29.7951],[121.485022,29.798096],[121.482608,29.79293],[121.47555,29.797514],[121.471982,29.791116],[121.465069,29.793657],[121.463005,29.788607],[121.457156,29.785844],[121.453466,29.792037],[121.450035,29.791497],[121.450072,29.787771],[121.458863,29.782577],[121.458667,29.776478],[121.440821,29.778075],[121.438834,29.762657],[121.429454,29.761833],[121.427818,29.749465],[121.405871,29.750006],[121.399666,29.739453],[121.368342,29.739095],[121.34358,29.727824],[121.330983,29.72895],[121.313712,29.735668],[121.297794,29.736468],[121.271774,29.730416],[121.257655,29.736324],[121.237082,29.727994],[121.232601,29.729475],[121.2309,29.734438],[121.209254,29.731795],[121.204643,29.748719],[121.179062,29.73602],[121.1649,29.735367],[121.155193,29.748009],[121.157538,29.76762],[121.152521,29.775275]]]]}},{"type":"Feature","properties":{"name":"宁海县"},"geometry":{"type":"MultiPolygon","coordinates":[[[[121.202061,29.332932],[121.199699,29.348843],[121.203857,29.348668],[121.236424,29.369899],[121.232813,29.385039],[121.233314,29.396864],[121.237443,29.40031],[121.231643,29.42181],[121.23825,29.413019],[121.25431,29.419543],[121.276705,29.453478],[121.274768,29.463787],[121.280053,29.470997],[121.293062,29.483836],[121.308129,29.478735],[121.317147,29.483315],[121.320014,29.489221],[121.333464,29.498647],[121.334179,29.504391],[121.35081,29.499083],[121.36302,29.490388],[121.375688,29.491217],[121.398287,29.519746],[121.398842,29.525216],[121.403672,29.527426],[121.414544,29.524252],[121.428236,29.512761],[121.4468,29.518434],[121.449122,29.523493],[121.454369,29.524919],[121.493044,29.503009],[121.540114,29.503525],[121.560823,29.498527],[121.573972,29.501319],[121.578618,29.475823],[121.590635,29.453956],[121.618503,29.450928],[121.628671,29.457247],[121.633743,29.45134],[121.648428,29.445351],[121.651212,29.439573],[121.664393,29.429653],[121.66998,29.414587],[121.687978,29.409687],[121.695566,29.404515],[121.70444,29.415864],[121.719252,29.410399],[121.726928,29.414463],[121.732226,29.398784],[121.730003,29.368272],[121.749873,29.353381],[121.755211,29.336398],[121.748696,29.324103],[121.758429,29.293977],[121.757614,29.278483],[121.785135,29.282474],[121.806187,29.27289],[121.792947,29.205764],[121.760714,29.109327],[121.715852,29.13161],[121.589657,29.176402],[121.572474,29.178623],[121.564667,29.176417],[121.541296,29.142731],[121.534541,29.140972],[121.493724,29.144279],[121.479509,29.149397],[121.463845,29.159975],[121.44287,29.165554],[121.413375,29.162813],[121.399559,29.160062],[121.383915,29.143763],[121.372656,29.142238],[121.367591,29.145655],[121.361381,29.140676],[121.352452,29.140107],[121.344844,29.129803],[121.33388,29.126847],[121.320747,29.114233],[121.316036,29.114007],[121.313853,29.120415],[121.308479,29.121361],[121.29421,29.105903],[121.274322,29.111436],[121.260413,29.123128],[121.264167,29.127525],[121.266881,29.146607],[121.262458,29.152535],[121.269958,29.160196],[121.259196,29.164479],[121.256341,29.172201],[121.239047,29.185313],[121.240387,29.199703],[121.232383,29.203993],[121.231328,29.208556],[121.225768,29.20985],[121.226763,29.21492],[121.198479,29.209048],[121.186655,29.211895],[121.181442,29.209554],[121.172148,29.214441],[121.177335,29.225891],[121.172271,29.239084],[121.177965,29.236717],[121.177988,29.239063],[121.176772,29.250454],[121.168806,29.252166],[121.174314,29.267083],[121.185006,29.264325],[121.188505,29.269427],[121.181178,29.278084],[121.184157,29.289778],[121.187815,29.292072],[121.185128,29.295029],[121.192741,29.303384],[121.206122,29.309156],[121.206302,29.318109],[121.202281,29.319894],[121.195688,29.316287],[121.192812,29.322457],[121.198984,29.325631],[121.202061,29.332932]]]]}},{"type":"Feature","properties":{"name":"慈溪市"},"geometry":{"type":"MultiPolygon","coordinates":[[[[121.730195,30.118619],[121.628693,30.074111],[121.611899,30.048379],[121.588209,30.044533],[121.570336,30.049317],[121.554113,30.061409],[121.537213,30.061223],[121.529233,30.065512],[121.499556,30.057626],[121.48193,30.062823],[121.471699,30.057124],[121.44759,30.057499],[121.435083,30.050428],[121.422574,30.049773],[121.407957,30.057731],[121.408839,30.063116],[121.418917,30.06891],[121.418535,30.073741],[121.408006,30.069762],[121.401891,30.076778],[121.396469,30.070064],[121.385938,30.072193],[121.374931,30.066992],[121.359173,30.074814],[121.343582,30.073999],[121.316536,30.08015],[121.28339,30.076809],[121.267067,30.082055],[121.232134,30.076201],[121.219749,30.077949],[121.209589,30.089478],[121.197759,30.088814],[121.192323,30.096244],[121.193449,30.103217],[121.17971,30.124462],[121.184476,30.130577],[121.20991,30.136702],[121.22221,30.152544],[121.234778,30.156629],[121.236063,30.162447],[121.228217,30.168796],[121.225378,30.178798],[121.219483,30.180879],[121.196016,30.179084],[121.194695,30.174681],[121.190979,30.174339],[121.147216,30.175187],[121.143249,30.170778],[121.118308,30.17677],[121.112178,30.185534],[121.105638,30.186077],[121.103905,30.213043],[121.110584,30.216927],[121.10079,30.25309],[121.095695,30.254654],[121.068531,30.247381],[121.065241,30.242589],[121.06235,30.244402],[121.068405,30.250202],[121.08594,30.256452],[121.091072,30.267586],[121.104299,30.27508],[121.106424,30.289227],[121.085982,30.276193],[121.061806,30.351503],[121.117503,30.401863],[121.162765,30.434],[121.192873,30.448523],[121.230739,30.456479],[121.271225,30.459168],[121.330078,30.442894],[121.390673,30.402657],[121.450503,30.338983],[121.530038,30.262913],[121.648084,30.187272],[121.730195,30.118619]]]]}}]} ================================================ FILE: src/Coldairarrow.Web/Config/Permission.config ================================================  ================================================ FILE: src/Coldairarrow.Web/Config/Province.json ================================================ { "provinceList": [ { "ProID": 1, "ProName": "北京市", "ProSort": 1, "ProRemark": "直辖市" }, { "ProID": 2, "ProName": "天津市", "ProSort": 2, "ProRemark": "直辖市" }, { "ProID": 3, "ProName": "河北省", "ProSort": 5, "ProRemark": "省份" }, { "ProID": 4, "ProName": "山西省", "ProSort": 6, "ProRemark": "省份" }, { "ProID": 5, "ProName": "内蒙古自治区", "ProSort": 32, "ProRemark": "自治区" }, { "ProID": 6, "ProName": "辽宁省", "ProSort": 8, "ProRemark": "省份" }, { "ProID": 7, "ProName": "吉林省", "ProSort": 9, "ProRemark": "省份" }, { "ProID": 8, "ProName": "黑龙江省", "ProSort": 10, "ProRemark": "省份" }, { "ProID": 9, "ProName": "上海市", "ProSort": 3, "ProRemark": "直辖市" }, { "ProID": 10, "ProName": "江苏省", "ProSort": 11, "ProRemark": "省份" }, { "ProID": 11, "ProName": "浙江省", "ProSort": 12, "ProRemark": "省份" }, { "ProID": 12, "ProName": "安徽省", "ProSort": 13, "ProRemark": "省份" }, { "ProID": 13, "ProName": "福建省", "ProSort": 14, "ProRemark": "省份" }, { "ProID": 14, "ProName": "江西省", "ProSort": 15, "ProRemark": "省份" }, { "ProID": 15, "ProName": "山东省", "ProSort": 16, "ProRemark": "省份" }, { "ProID": 16, "ProName": "河南省", "ProSort": 17, "ProRemark": "省份" }, { "ProID": 17, "ProName": "湖北省", "ProSort": 18, "ProRemark": "省份" }, { "ProID": 18, "ProName": "湖南省", "ProSort": 19, "ProRemark": "省份" }, { "ProID": 19, "ProName": "广东省", "ProSort": 20, "ProRemark": "省份" }, { "ProID": 20, "ProName": "海南省", "ProSort": 24, "ProRemark": "省份" }, { "ProID": 21, "ProName": "广西壮族自治区", "ProSort": 28, "ProRemark": "自治区" }, { "ProID": 22, "ProName": "甘肃省", "ProSort": 21, "ProRemark": "省份" }, { "ProID": 23, "ProName": "陕西省", "ProSort": 27, "ProRemark": "省份" }, { "ProID": 24, "ProName": "新 疆维吾尔自治区", "ProSort": 31, "ProRemark": "自治区" }, { "ProID": 25, "ProName": "青海省", "ProSort": 26, "ProRemark": "省份" }, { "ProID": 26, "ProName": "宁夏回族自治区", "ProSort": 30, "ProRemark": "自治区" }, { "ProID": 27, "ProName": "重庆市", "ProSort": 4, "ProRemark": "直辖市" }, { "ProID": 28, "ProName": "四川省", "ProSort": 22, "ProRemark": "省份" }, { "ProID": 29, "ProName": "贵州省", "ProSort": 23, "ProRemark": "省份" }, { "ProID": 30, "ProName": "云南省", "ProSort": 25, "ProRemark": "省份" }, { "ProID": 31, "ProName": "西藏自治区", "ProSort": 29, "ProRemark": "自治区" }, { "ProID": 32, "ProName": "台湾省", "ProSort": 7, "ProRemark": "省份" }, { "ProID": 33, "ProName": "澳门特别行政区", "ProSort": 33, "ProRemark": "特别行政区" }, { "ProID": 34, "ProName": "香港特别行政区", "ProSort": 34, "ProRemark": "特别行政区" } ], "cityList": [ { "CityID": 1, "CityName": "北京市", "ProID": 1, "CitySort": 1 }, { "CityID": 2, "CityName": "天津市", "ProID": 2, "CitySort": 2 }, { "CityID": 3, "CityName": "上海市", "ProID": 9, "CitySort": 3 }, { "CityID": 4, "CityName": "重庆市", "ProID": 27, "CitySort": 4 }, { "CityID": 5, "CityName": "邯郸市", "ProID": 3, "CitySort": 5 }, { "CityID": 6, "CityName": "石家庄市", "ProID": 3, "CitySort": 6 }, { "CityID": 7, "CityName": "保定市", "ProID": 3, "CitySort": 7 }, { "CityID": 8, "CityName": "张家口市", "ProID": 3, "CitySort": 8 }, { "CityID": 9, "CityName": "承德市", "ProID": 3, "CitySort": 9 }, { "CityID": 10, "CityName": "唐山市", "ProID": 3, "CitySort": 10 }, { "CityID": 11, "CityName": "廊坊市", "ProID": 3, "CitySort": 11 }, { "CityID": 12, "CityName": "沧州市", "ProID": 3, "CitySort": 12 }, { "CityID": 13, "CityName": "衡水市", "ProID": 3, "CitySort": 13 }, { "CityID": 14, "CityName": "邢台市", "ProID": 3, "CitySort": 14 }, { "CityID": 16, "CityName": "朔州市", "ProID": 4, "CitySort": 16 }, { "CityID": 17, "CityName": "忻州市", "ProID": 4, "CitySort": 17 }, { "CityID": 18, "CityName": "太原市", "ProID": 4, "CitySort": 18 }, { "CityID": 19, "CityName": "大同市", "ProID": 4, "CitySort": 19 }, { "CityID": 20, "CityName": "阳泉市", "ProID": 4, "CitySort": 20 }, { "CityID": 21, "CityName": "晋中市", "ProID": 4, "CitySort": 21 }, { "CityID": 22, "CityName": "长治市", "ProID": 4, "CitySort": 22 }, { "CityID": 23, "CityName": "晋城市", "ProID": 4, "CitySort": 23 }, { "CityID": 24, "CityName": "临汾市", "ProID": 4, "CitySort": 24 }, { "CityID": 25, "CityName": "吕梁市", "ProID": 4, "CitySort": 25 }, { "CityID": 26, "CityName": "运城市", "ProID": 4, "CitySort": 26 }, { "CityID": 27, "CityName": "沈阳市", "ProID": 6, "CitySort": 27 }, { "CityID": 28, "CityName": "铁岭市", "ProID": 6, "CitySort": 28 }, { "CityID": 29, "CityName": "大连市", "ProID": 6, "CitySort": 29 }, { "CityID": 30, "CityName": "鞍山市", "ProID": 6, "CitySort": 30 }, { "CityID": 31, "CityName": "抚顺市", "ProID": 6, "CitySort": 31 }, { "CityID": 32, "CityName": "本溪市", "ProID": 6, "CitySort": 32 }, { "CityID": 33, "CityName": "丹东市", "ProID": 6, "CitySort": 33 }, { "CityID": 34, "CityName": "锦州市", "ProID": 6, "CitySort": 34 }, { "CityID": 35, "CityName": "营口市", "ProID": 6, "CitySort": 35 }, { "CityID": 36, "CityName": "阜新市", "ProID": 6, "CitySort": 36 }, { "CityID": 37, "CityName": "辽阳市", "ProID": 6, "CitySort": 37 }, { "CityID": 38, "CityName": "朝阳市", "ProID": 6, "CitySort": 38 }, { "CityID": 39, "CityName": "盘锦市", "ProID": 6, "CitySort": 39 }, { "CityID": 40, "CityName": "葫芦岛市", "ProID": 6, "CitySort": 40 }, { "CityID": 41, "CityName": "长春市", "ProID": 7, "CitySort": 41 }, { "CityID": 42, "CityName": "吉林市", "ProID": 7, "CitySort": 42 }, { "CityID": 43, "CityName": "延边朝鲜族自治州", "ProID": 7, "CitySort": 43 }, { "CityID": 44, "CityName": "四平市", "ProID": 7, "CitySort": 44 }, { "CityID": 45, "CityName": "通化市", "ProID": 7, "CitySort": 45 }, { "CityID": 46, "CityName": "白城市", "ProID": 7, "CitySort": 46 }, { "CityID": 47, "CityName": "辽源市", "ProID": 7, "CitySort": 47 }, { "CityID": 48, "CityName": "松原市", "ProID": 7, "CitySort": 48 }, { "CityID": 49, "CityName": "白山市", "ProID": 7, "CitySort": 49 }, { "CityID": 50, "CityName": "哈尔滨市", "ProID": 8, "CitySort": 50 }, { "CityID": 51, "CityName": "齐齐哈尔市", "ProID": 8, "CitySort": 51 }, { "CityID": 52, "CityName": "鸡西市", "ProID": 8, "CitySort": 52 }, { "CityID": 53, "CityName": "牡丹江市", "ProID": 8, "CitySort": 53 }, { "CityID": 54, "CityName": "七台河市", "ProID": 8, "CitySort": 54 }, { "CityID": 55, "CityName": "佳木斯市", "ProID": 8, "CitySort": 55 }, { "CityID": 56, "CityName": "鹤岗市", "ProID": 8, "CitySort": 56 }, { "CityID": 57, "CityName": "双鸭山市", "ProID": 8, "CitySort": 57 }, { "CityID": 58, "CityName": "绥化市", "ProID": 8, "CitySort": 58 }, { "CityID": 59, "CityName": "黑河市", "ProID": 8, "CitySort": 59 }, { "CityID": 60, "CityName": "大兴安岭地区", "ProID": 8, "CitySort": 60 }, { "CityID": 61, "CityName": "伊春市", "ProID": 8, "CitySort": 61 }, { "CityID": 62, "CityName": "大庆市", "ProID": 8, "CitySort": 62 }, { "CityID": 63, "CityName": "南京市", "ProID": 10, "CitySort": 63 }, { "CityID": 64, "CityName": "无锡市", "ProID": 10, "CitySort": 64 }, { "CityID": 65, "CityName": "镇江市", "ProID": 10, "CitySort": 65 }, { "CityID": 66, "CityName": "苏州市", "ProID": 10, "CitySort": 66 }, { "CityID": 67, "CityName": "南通市", "ProID": 10, "CitySort": 67 }, { "CityID": 68, "CityName": "扬州市", "ProID": 10, "CitySort": 68 }, { "CityID": 69, "CityName": "盐城市", "ProID": 10, "CitySort": 69 }, { "CityID": 70, "CityName": "徐州市", "ProID": 10, "CitySort": 70 }, { "CityID": 71, "CityName": "淮安市", "ProID": 10, "CitySort": 71 }, { "CityID": 72, "CityName": "连云港市", "ProID": 10, "CitySort": 72 }, { "CityID": 73, "CityName": "常州市", "ProID": 10, "CitySort": 73 }, { "CityID": 74, "CityName": "泰州市", "ProID": 10, "CitySort": 74 }, { "CityID": 75, "CityName": "宿迁市", "ProID": 10, "CitySort": 75 }, { "CityID": 76, "CityName": "舟山市", "ProID": 11, "CitySort": 76 }, { "CityID": 77, "CityName": "衢州市", "ProID": 11, "CitySort": 77 }, { "CityID": 78, "CityName": "杭州市", "ProID": 11, "CitySort": 78 }, { "CityID": 79, "CityName": "湖州市", "ProID": 11, "CitySort": 79 }, { "CityID": 80, "CityName": "嘉兴市", "ProID": 11, "CitySort": 80 }, { "CityID": 81, "CityName": "宁波市", "ProID": 11, "CitySort": 81 }, { "CityID": 82, "CityName": "绍兴市", "ProID": 11, "CitySort": 82 }, { "CityID": 83, "CityName": "温州市", "ProID": 11, "CitySort": 83 }, { "CityID": 84, "CityName": "丽水市", "ProID": 11, "CitySort": 84 }, { "CityID": 85, "CityName": "金华市", "ProID": 11, "CitySort": 85 }, { "CityID": 86, "CityName": "台州市", "ProID": 11, "CitySort": 86 }, { "CityID": 87, "CityName": "合肥市", "ProID": 12, "CitySort": 87 }, { "CityID": 88, "CityName": "芜湖市", "ProID": 12, "CitySort": 88 }, { "CityID": 89, "CityName": "蚌埠市", "ProID": 12, "CitySort": 89 }, { "CityID": 90, "CityName": "淮南市", "ProID": 12, "CitySort": 90 }, { "CityID": 91, "CityName": "马鞍山市", "ProID": 12, "CitySort": 91 }, { "CityID": 92, "CityName": "淮北市", "ProID": 12, "CitySort": 92 }, { "CityID": 93, "CityName": "铜陵市", "ProID": 12, "CitySort": 93 }, { "CityID": 94, "CityName": "安庆市", "ProID": 12, "CitySort": 94 }, { "CityID": 95, "CityName": "黄山市", "ProID": 12, "CitySort": 95 }, { "CityID": 96, "CityName": "滁州市", "ProID": 12, "CitySort": 96 }, { "CityID": 97, "CityName": "阜阳市", "ProID": 12, "CitySort": 97 }, { "CityID": 98, "CityName": "宿州市", "ProID": 12, "CitySort": 98 }, { "CityID": 99, "CityName": "巢湖市", "ProID": 12, "CitySort": 99 }, { "CityID": 100, "CityName": "六安市", "ProID": 12, "CitySort": 100 }, { "CityID": 101, "CityName": "亳州市", "ProID": 12, "CitySort": 101 }, { "CityID": 102, "CityName": "池州市", "ProID": 12, "CitySort": 102 }, { "CityID": 103, "CityName": "宣城市", "ProID": 12, "CitySort": 103 }, { "CityID": 104, "CityName": "福州市", "ProID": 13, "CitySort": 104 }, { "CityID": 105, "CityName": "厦门市", "ProID": 13, "CitySort": 105 }, { "CityID": 106, "CityName": "宁德市", "ProID": 13, "CitySort": 106 }, { "CityID": 107, "CityName": "莆田市", "ProID": 13, "CitySort": 107 }, { "CityID": 108, "CityName": "泉州市", "ProID": 13, "CitySort": 108 }, { "CityID": 109, "CityName": "漳州市", "ProID": 13, "CitySort": 109 }, { "CityID": 110, "CityName": "龙岩市", "ProID": 13, "CitySort": 110 }, { "CityID": 111, "CityName": "三明市", "ProID": 13, "CitySort": 111 }, { "CityID": 112, "CityName": "南平市", "ProID": 13, "CitySort": 112 }, { "CityID": 113, "CityName": "鹰潭市", "ProID": 14, "CitySort": 113 }, { "CityID": 114, "CityName": "新余市", "ProID": 14, "CitySort": 114 }, { "CityID": 115, "CityName": "南昌市", "ProID": 14, "CitySort": 115 }, { "CityID": 116, "CityName": "九江市", "ProID": 14, "CitySort": 116 }, { "CityID": 117, "CityName": "上饶市", "ProID": 14, "CitySort": 117 }, { "CityID": 118, "CityName": "抚州市", "ProID": 14, "CitySort": 118 }, { "CityID": 119, "CityName": "宜春市", "ProID": 14, "CitySort": 119 }, { "CityID": 120, "CityName": "吉安市", "ProID": 14, "CitySort": 120 }, { "CityID": 121, "CityName": "赣州市", "ProID": 14, "CitySort": 121 }, { "CityID": 122, "CityName": "景德镇市", "ProID": 14, "CitySort": 122 }, { "CityID": 123, "CityName": "萍乡市", "ProID": 14, "CitySort": 123 }, { "CityID": 124, "CityName": "菏泽市", "ProID": 15, "CitySort": 124 }, { "CityID": 125, "CityName": "济南市", "ProID": 15, "CitySort": 125 }, { "CityID": 126, "CityName": "青岛市", "ProID": 15, "CitySort": 126 }, { "CityID": 127, "CityName": "淄博市", "ProID": 15, "CitySort": 127 }, { "CityID": 128, "CityName": "德州市", "ProID": 15, "CitySort": 128 }, { "CityID": 129, "CityName": "烟台市", "ProID": 15, "CitySort": 129 }, { "CityID": 130, "CityName": "潍坊市", "ProID": 15, "CitySort": 130 }, { "CityID": 131, "CityName": "济宁市", "ProID": 15, "CitySort": 131 }, { "CityID": 132, "CityName": "泰安市", "ProID": 15, "CitySort": 132 }, { "CityID": 133, "CityName": "临沂市", "ProID": 15, "CitySort": 133 }, { "CityID": 134, "CityName": "滨州市", "ProID": 15, "CitySort": 134 }, { "CityID": 135, "CityName": "东营市", "ProID": 15, "CitySort": 135 }, { "CityID": 136, "CityName": "威海市", "ProID": 15, "CitySort": 136 }, { "CityID": 137, "CityName": "枣庄市", "ProID": 15, "CitySort": 137 }, { "CityID": 138, "CityName": "日照市", "ProID": 15, "CitySort": 138 }, { "CityID": 139, "CityName": "莱芜市", "ProID": 15, "CitySort": 139 }, { "CityID": 140, "CityName": "聊城市", "ProID": 15, "CitySort": 140 }, { "CityID": 141, "CityName": "商丘市", "ProID": 16, "CitySort": 141 }, { "CityID": 142, "CityName": "郑州市", "ProID": 16, "CitySort": 142 }, { "CityID": 143, "CityName": "安阳市", "ProID": 16, "CitySort": 143 }, { "CityID": 144, "CityName": "新乡市", "ProID": 16, "CitySort": 144 }, { "CityID": 145, "CityName": "许昌市", "ProID": 16, "CitySort": 145 }, { "CityID": 146, "CityName": "平顶山市", "ProID": 16, "CitySort": 146 }, { "CityID": 147, "CityName": "信阳市", "ProID": 16, "CitySort": 147 }, { "CityID": 148, "CityName": "南阳市", "ProID": 16, "CitySort": 148 }, { "CityID": 149, "CityName": "开封市", "ProID": 16, "CitySort": 149 }, { "CityID": 150, "CityName": "洛阳市", "ProID": 16, "CitySort": 150 }, { "CityID": 151, "CityName": "济源市", "ProID": 16, "CitySort": 151 }, { "CityID": 152, "CityName": "焦作市", "ProID": 16, "CitySort": 152 }, { "CityID": 153, "CityName": "鹤壁市", "ProID": 16, "CitySort": 153 }, { "CityID": 154, "CityName": "濮阳市", "ProID": 16, "CitySort": 154 }, { "CityID": 155, "CityName": "周口市", "ProID": 16, "CitySort": 155 }, { "CityID": 156, "CityName": "漯河市", "ProID": 16, "CitySort": 156 }, { "CityID": 157, "CityName": "驻马店市", "ProID": 16, "CitySort": 157 }, { "CityID": 158, "CityName": "三门峡市", "ProID": 16, "CitySort": 158 }, { "CityID": 159, "CityName": "武汉市", "ProID": 17, "CitySort": 159 }, { "CityID": 160, "CityName": "襄樊市", "ProID": 17, "CitySort": 160 }, { "CityID": 161, "CityName": "鄂州市", "ProID": 17, "CitySort": 161 }, { "CityID": 162, "CityName": "孝感市", "ProID": 17, "CitySort": 162 }, { "CityID": 163, "CityName": "黄冈市", "ProID": 17, "CitySort": 163 }, { "CityID": 164, "CityName": "黄石市", "ProID": 17, "CitySort": 164 }, { "CityID": 165, "CityName": "咸宁市", "ProID": 17, "CitySort": 165 }, { "CityID": 166, "CityName": "荆州市", "ProID": 17, "CitySort": 166 }, { "CityID": 167, "CityName": "宜昌市", "ProID": 17, "CitySort": 167 }, { "CityID": 168, "CityName": "恩施土家族苗族自治州", "ProID": 17, "CitySort": 168 }, { "CityID": 169, "CityName": "神农架林区", "ProID": 17, "CitySort": 169 }, { "CityID": 170, "CityName": "十堰市", "ProID": 17, "CitySort": 170 }, { "CityID": 171, "CityName": "随州市", "ProID": 17, "CitySort": 171 }, { "CityID": 172, "CityName": "荆门市", "ProID": 17, "CitySort": 172 }, { "CityID": 173, "CityName": "仙桃市", "ProID": 17, "CitySort": 173 }, { "CityID": 174, "CityName": "天门市", "ProID": 17, "CitySort": 174 }, { "CityID": 175, "CityName": "潜江市", "ProID": 17, "CitySort": 175 }, { "CityID": 176, "CityName": "岳阳市", "ProID": 18, "CitySort": 176 }, { "CityID": 177, "CityName": "长沙市", "ProID": 18, "CitySort": 177 }, { "CityID": 178, "CityName": "湘潭市", "ProID": 18, "CitySort": 178 }, { "CityID": 179, "CityName": "株洲市", "ProID": 18, "CitySort": 179 }, { "CityID": 180, "CityName": "衡阳市", "ProID": 18, "CitySort": 180 }, { "CityID": 181, "CityName": "郴州市", "ProID": 18, "CitySort": 181 }, { "CityID": 182, "CityName": "常德市", "ProID": 18, "CitySort": 182 }, { "CityID": 183, "CityName": "益阳市", "ProID": 18, "CitySort": 183 }, { "CityID": 184, "CityName": "娄底市", "ProID": 18, "CitySort": 184 }, { "CityID": 185, "CityName": "邵阳市", "ProID": 18, "CitySort": 185 }, { "CityID": 186, "CityName": "湘西土家族苗族自治州", "ProID": 18, "CitySort": 186 }, { "CityID": 187, "CityName": "张家界市", "ProID": 18, "CitySort": 187 }, { "CityID": 188, "CityName": "怀化市", "ProID": 18, "CitySort": 188 }, { "CityID": 189, "CityName": "永州市", "ProID": 18, "CitySort": 189 }, { "CityID": 190, "CityName": "广州市", "ProID": 19, "CitySort": 190 }, { "CityID": 191, "CityName": "汕尾市", "ProID": 19, "CitySort": 191 }, { "CityID": 192, "CityName": "阳江市", "ProID": 19, "CitySort": 192 }, { "CityID": 193, "CityName": "揭阳市", "ProID": 19, "CitySort": 193 }, { "CityID": 194, "CityName": "茂名市", "ProID": 19, "CitySort": 194 }, { "CityID": 195, "CityName": "惠州市", "ProID": 19, "CitySort": 195 }, { "CityID": 196, "CityName": "江门市", "ProID": 19, "CitySort": 196 }, { "CityID": 197, "CityName": "韶关市", "ProID": 19, "CitySort": 197 }, { "CityID": 198, "CityName": "梅州市", "ProID": 19, "CitySort": 198 }, { "CityID": 199, "CityName": "汕头市", "ProID": 19, "CitySort": 199 }, { "CityID": 200, "CityName": "深圳市", "ProID": 19, "CitySort": 200 }, { "CityID": 201, "CityName": "珠海市", "ProID": 19, "CitySort": 201 }, { "CityID": 202, "CityName": "佛山市", "ProID": 19, "CitySort": 202 }, { "CityID": 203, "CityName": "肇庆市", "ProID": 19, "CitySort": 203 }, { "CityID": 204, "CityName": "湛江市", "ProID": 19, "CitySort": 204 }, { "CityID": 205, "CityName": "中山市", "ProID": 19, "CitySort": 205 }, { "CityID": 206, "CityName": "河源市", "ProID": 19, "CitySort": 206 }, { "CityID": 207, "CityName": "清远市", "ProID": 19, "CitySort": 207 }, { "CityID": 208, "CityName": "云浮市", "ProID": 19, "CitySort": 208 }, { "CityID": 209, "CityName": "潮州市", "ProID": 19, "CitySort": 209 }, { "CityID": 210, "CityName": "东莞市", "ProID": 19, "CitySort": 210 }, { "CityID": 211, "CityName": "兰州市", "ProID": 22, "CitySort": 211 }, { "CityID": 212, "CityName": "金昌市", "ProID": 22, "CitySort": 212 }, { "CityID": 213, "CityName": "白银市", "ProID": 22, "CitySort": 213 }, { "CityID": 214, "CityName": "天水市", "ProID": 22, "CitySort": 214 }, { "CityID": 215, "CityName": "嘉峪关市", "ProID": 22, "CitySort": 215 }, { "CityID": 216, "CityName": "武威市", "ProID": 22, "CitySort": 216 }, { "CityID": 217, "CityName": "张掖市", "ProID": 22, "CitySort": 217 }, { "CityID": 218, "CityName": "平凉市", "ProID": 22, "CitySort": 218 }, { "CityID": 219, "CityName": "酒泉市", "ProID": 22, "CitySort": 219 }, { "CityID": 220, "CityName": "庆阳市", "ProID": 22, "CitySort": 220 }, { "CityID": 221, "CityName": "定西市", "ProID": 22, "CitySort": 221 }, { "CityID": 222, "CityName": "陇南市", "ProID": 22, "CitySort": 222 }, { "CityID": 223, "CityName": "临夏回族自治州", "ProID": 22, "CitySort": 223 }, { "CityID": 224, "CityName": "甘南藏族自治州", "ProID": 22, "CitySort": 224 }, { "CityID": 225, "CityName": "成都市", "ProID": 28, "CitySort": 225 }, { "CityID": 226, "CityName": "攀枝花市", "ProID": 28, "CitySort": 226 }, { "CityID": 227, "CityName": "自贡市", "ProID": 28, "CitySort": 227 }, { "CityID": 228, "CityName": "绵阳市", "ProID": 28, "CitySort": 228 }, { "CityID": 229, "CityName": "南充市", "ProID": 28, "CitySort": 229 }, { "CityID": 230, "CityName": "达州市", "ProID": 28, "CitySort": 230 }, { "CityID": 231, "CityName": "遂宁市", "ProID": 28, "CitySort": 231 }, { "CityID": 232, "CityName": "广安市", "ProID": 28, "CitySort": 232 }, { "CityID": 233, "CityName": "巴中市", "ProID": 28, "CitySort": 233 }, { "CityID": 234, "CityName": "泸州市", "ProID": 28, "CitySort": 234 }, { "CityID": 235, "CityName": "宜宾市", "ProID": 28, "CitySort": 235 }, { "CityID": 236, "CityName": "资阳市", "ProID": 28, "CitySort": 236 }, { "CityID": 237, "CityName": "内江市", "ProID": 28, "CitySort": 237 }, { "CityID": 238, "CityName": "乐山市", "ProID": 28, "CitySort": 238 }, { "CityID": 239, "CityName": "眉山市", "ProID": 28, "CitySort": 239 }, { "CityID": 240, "CityName": "凉山彝族自治州", "ProID": 28, "CitySort": 240 }, { "CityID": 241, "CityName": "雅安市", "ProID": 28, "CitySort": 241 }, { "CityID": 242, "CityName": "甘孜藏族自治州", "ProID": 28, "CitySort": 242 }, { "CityID": 243, "CityName": "阿坝藏族羌族自治州", "ProID": 28, "CitySort": 243 }, { "CityID": 244, "CityName": "德阳市", "ProID": 28, "CitySort": 244 }, { "CityID": 245, "CityName": "广元市", "ProID": 28, "CitySort": 245 }, { "CityID": 246, "CityName": "贵阳市", "ProID": 29, "CitySort": 246 }, { "CityID": 247, "CityName": "遵义市", "ProID": 29, "CitySort": 247 }, { "CityID": 248, "CityName": "安顺市", "ProID": 29, "CitySort": 248 }, { "CityID": 249, "CityName": "黔南布依族苗族自治州", "ProID": 29, "CitySort": 249 }, { "CityID": 250, "CityName": "黔东南苗族侗族自治州", "ProID": 29, "CitySort": 250 }, { "CityID": 251, "CityName": "铜仁地区", "ProID": 29, "CitySort": 251 }, { "CityID": 252, "CityName": "毕节地区", "ProID": 29, "CitySort": 252 }, { "CityID": 253, "CityName": "六盘水市", "ProID": 29, "CitySort": 253 }, { "CityID": 254, "CityName": "黔西南布依族苗族自治州", "ProID": 29, "CitySort": 254 }, { "CityID": 255, "CityName": "海口市", "ProID": 20, "CitySort": 255 }, { "CityID": 256, "CityName": "三亚市", "ProID": 20, "CitySort": 256 }, { "CityID": 257, "CityName": "五指山市", "ProID": 20, "CitySort": 257 }, { "CityID": 258, "CityName": "琼海市", "ProID": 20, "CitySort": 258 }, { "CityID": 259, "CityName": "儋州市", "ProID": 20, "CitySort": 259 }, { "CityID": 260, "CityName": "文昌市", "ProID": 20, "CitySort": 260 }, { "CityID": 261, "CityName": "万宁市", "ProID": 20, "CitySort": 261 }, { "CityID": 262, "CityName": "东方市", "ProID": 20, "CitySort": 262 }, { "CityID": 263, "CityName": "澄迈县", "ProID": 20, "CitySort": 263 }, { "CityID": 264, "CityName": "定安县", "ProID": 20, "CitySort": 264 }, { "CityID": 265, "CityName": "屯昌县", "ProID": 20, "CitySort": 265 }, { "CityID": 266, "CityName": "临高县", "ProID": 20, "CitySort": 266 }, { "CityID": 267, "CityName": "白沙黎族自治县", "ProID": 20, "CitySort": 267 }, { "CityID": 268, "CityName": "昌江黎族自治县", "ProID": 20, "CitySort": 268 }, { "CityID": 269, "CityName": "乐东黎族自治县", "ProID": 20, "CitySort": 269 }, { "CityID": 270, "CityName": "陵水黎族自治县", "ProID": 20, "CitySort": 270 }, { "CityID": 271, "CityName": "保亭黎族苗族自治县", "ProID": 20, "CitySort": 271 }, { "CityID": 272, "CityName": "琼中黎族苗族自治县", "ProID": 20, "CitySort": 272 }, { "CityID": 273, "CityName": "西双版纳傣族自治州", "ProID": 30, "CitySort": 273 }, { "CityID": 274, "CityName": "德宏傣族景颇族自治州", "ProID": 30, "CitySort": 274 }, { "CityID": 275, "CityName": "昭通市", "ProID": 30, "CitySort": 275 }, { "CityID": 276, "CityName": "昆明市", "ProID": 30, "CitySort": 276 }, { "CityID": 277, "CityName": "大理白族自治州", "ProID": 30, "CitySort": 277 }, { "CityID": 278, "CityName": "红河哈尼族彝族自治州", "ProID": 30, "CitySort": 278 }, { "CityID": 279, "CityName": "曲靖市", "ProID": 30, "CitySort": 279 }, { "CityID": 280, "CityName": "保山市", "ProID": 30, "CitySort": 280 }, { "CityID": 281, "CityName": "文山壮族苗族自治州", "ProID": 30, "CitySort": 281 }, { "CityID": 282, "CityName": "玉溪市", "ProID": 30, "CitySort": 282 }, { "CityID": 283, "CityName": "楚雄彝族自治州", "ProID": 30, "CitySort": 283 }, { "CityID": 284, "CityName": "普洱市", "ProID": 30, "CitySort": 284 }, { "CityID": 285, "CityName": "临沧市", "ProID": 30, "CitySort": 285 }, { "CityID": 286, "CityName": "怒江傈傈族自治州", "ProID": 30, "CitySort": 286 }, { "CityID": 287, "CityName": "迪庆藏族自治州", "ProID": 30, "CitySort": 287 }, { "CityID": 288, "CityName": "丽江市", "ProID": 30, "CitySort": 288 }, { "CityID": 289, "CityName": "海北藏族自治州", "ProID": 25, "CitySort": 289 }, { "CityID": 290, "CityName": "西宁市", "ProID": 25, "CitySort": 290 }, { "CityID": 291, "CityName": "海东地区", "ProID": 25, "CitySort": 291 }, { "CityID": 292, "CityName": "黄南藏族自治州", "ProID": 25, "CitySort": 292 }, { "CityID": 293, "CityName": "海南藏族自治州", "ProID": 25, "CitySort": 293 }, { "CityID": 294, "CityName": "果洛藏族自治州", "ProID": 25, "CitySort": 294 }, { "CityID": 295, "CityName": "玉树藏族自治州", "ProID": 25, "CitySort": 295 }, { "CityID": 296, "CityName": "海西蒙古族藏族自治州", "ProID": 25, "CitySort": 296 }, { "CityID": 297, "CityName": "西安市", "ProID": 23, "CitySort": 297 }, { "CityID": 298, "CityName": "咸阳市", "ProID": 23, "CitySort": 298 }, { "CityID": 299, "CityName": "延安市", "ProID": 23, "CitySort": 299 }, { "CityID": 300, "CityName": "榆林市", "ProID": 23, "CitySort": 300 }, { "CityID": 301, "CityName": "渭南市", "ProID": 23, "CitySort": 301 }, { "CityID": 302, "CityName": "商洛市", "ProID": 23, "CitySort": 302 }, { "CityID": 303, "CityName": "安康市", "ProID": 23, "CitySort": 303 }, { "CityID": 304, "CityName": "汉中市", "ProID": 23, "CitySort": 304 }, { "CityID": 305, "CityName": "宝鸡市", "ProID": 23, "CitySort": 305 }, { "CityID": 306, "CityName": "铜川市", "ProID": 23, "CitySort": 306 }, { "CityID": 307, "CityName": "防城港市", "ProID": 21, "CitySort": 307 }, { "CityID": 308, "CityName": "南宁市", "ProID": 21, "CitySort": 308 }, { "CityID": 309, "CityName": "崇左市", "ProID": 21, "CitySort": 309 }, { "CityID": 310, "CityName": "来宾市", "ProID": 21, "CitySort": 310 }, { "CityID": 311, "CityName": "柳州市", "ProID": 21, "CitySort": 311 }, { "CityID": 312, "CityName": "桂林市", "ProID": 21, "CitySort": 312 }, { "CityID": 313, "CityName": "梧州市", "ProID": 21, "CitySort": 313 }, { "CityID": 314, "CityName": "贺州市", "ProID": 21, "CitySort": 314 }, { "CityID": 315, "CityName": "贵港市", "ProID": 21, "CitySort": 315 }, { "CityID": 316, "CityName": "玉林市", "ProID": 21, "CitySort": 316 }, { "CityID": 317, "CityName": "百色市", "ProID": 21, "CitySort": 317 }, { "CityID": 318, "CityName": "钦州市", "ProID": 21, "CitySort": 318 }, { "CityID": 319, "CityName": "河池市", "ProID": 21, "CitySort": 319 }, { "CityID": 320, "CityName": "北海市", "ProID": 21, "CitySort": 320 }, { "CityID": 321, "CityName": "拉萨市", "ProID": 31, "CitySort": 321 }, { "CityID": 322, "CityName": "日喀则地区", "ProID": 31, "CitySort": 322 }, { "CityID": 323, "CityName": "山南地区", "ProID": 31, "CitySort": 323 }, { "CityID": 324, "CityName": "林芝地区", "ProID": 31, "CitySort": 324 }, { "CityID": 325, "CityName": "昌都地区", "ProID": 31, "CitySort": 325 }, { "CityID": 326, "CityName": "那曲地区", "ProID": 31, "CitySort": 326 }, { "CityID": 327, "CityName": "阿里地区", "ProID": 31, "CitySort": 327 }, { "CityID": 328, "CityName": "银川市", "ProID": 26, "CitySort": 328 }, { "CityID": 329, "CityName": "石嘴山市", "ProID": 26, "CitySort": 329 }, { "CityID": 330, "CityName": "吴忠市", "ProID": 26, "CitySort": 330 }, { "CityID": 331, "CityName": "固原市", "ProID": 26, "CitySort": 331 }, { "CityID": 332, "CityName": "中卫市", "ProID": 26, "CitySort": 332 }, { "CityID": 333, "CityName": "塔城地区", "ProID": 24, "CitySort": 333 }, { "CityID": 334, "CityName": "哈密地区", "ProID": 24, "CitySort": 334 }, { "CityID": 335, "CityName": "和田地区", "ProID": 24, "CitySort": 335 }, { "CityID": 336, "CityName": "阿勒泰地区", "ProID": 24, "CitySort": 336 }, { "CityID": 337, "CityName": "克孜勒苏柯尔克孜自治州", "ProID": 24, "CitySort": 337 }, { "CityID": 338, "CityName": "博尔塔拉蒙古自治州", "ProID": 24, "CitySort": 338 }, { "CityID": 339, "CityName": "克拉玛依市", "ProID": 24, "CitySort": 339 }, { "CityID": 340, "CityName": "乌鲁木齐市", "ProID": 24, "CitySort": 340 }, { "CityID": 341, "CityName": "石河子市", "ProID": 24, "CitySort": 341 }, { "CityID": 342, "CityName": "昌吉回族自治州", "ProID": 24, "CitySort": 342 }, { "CityID": 343, "CityName": "五家渠市", "ProID": 24, "CitySort": 343 }, { "CityID": 344, "CityName": "吐鲁番地区", "ProID": 24, "CitySort": 344 }, { "CityID": 345, "CityName": "巴音郭楞蒙古自治州", "ProID": 24, "CitySort": 345 }, { "CityID": 346, "CityName": "阿克苏地区", "ProID": 24, "CitySort": 346 }, { "CityID": 347, "CityName": "阿拉尔市", "ProID": 24, "CitySort": 347 }, { "CityID": 348, "CityName": "喀什地区", "ProID": 24, "CitySort": 348 }, { "CityID": 349, "CityName": "图木舒克市", "ProID": 24, "CitySort": 349 }, { "CityID": 350, "CityName": "伊犁哈萨克自治州", "ProID": 24, "CitySort": 350 }, { "CityID": 351, "CityName": "呼伦贝尔市", "ProID": 5, "CitySort": 351 }, { "CityID": 352, "CityName": "呼和浩特市", "ProID": 5, "CitySort": 352 }, { "CityID": 353, "CityName": "包头市", "ProID": 5, "CitySort": 353 }, { "CityID": 354, "CityName": "乌海市", "ProID": 5, "CitySort": 354 }, { "CityID": 355, "CityName": "乌兰察布市", "ProID": 5, "CitySort": 355 }, { "CityID": 356, "CityName": "通辽市", "ProID": 5, "CitySort": 356 }, { "CityID": 357, "CityName": "赤峰市", "ProID": 5, "CitySort": 357 }, { "CityID": 358, "CityName": "鄂尔多斯市", "ProID": 5, "CitySort": 358 }, { "CityID": 359, "CityName": "巴彦淖尔市", "ProID": 5, "CitySort": 359 }, { "CityID": 360, "CityName": "锡林郭勒盟", "ProID": 5, "CitySort": 360 }, { "CityID": 361, "CityName": "兴安盟", "ProID": 5, "CitySort": 361 }, { "CityID": 362, "CityName": "阿拉善盟", "ProID": 5, "CitySort": 362 }, { "CityID": 363, "CityName": "台北市", "ProID": 32, "CitySort": 363 }, { "CityID": 364, "CityName": "高雄市", "ProID": 32, "CitySort": 364 }, { "CityID": 365, "CityName": "基隆市", "ProID": 32, "CitySort": 365 }, { "CityID": 366, "CityName": "台中市", "ProID": 32, "CitySort": 366 }, { "CityID": 367, "CityName": "台南市", "ProID": 32, "CitySort": 367 }, { "CityID": 368, "CityName": "新竹市", "ProID": 32, "CitySort": 368 }, { "CityID": 369, "CityName": "嘉义市", "ProID": 32, "CitySort": 369 }, { "CityID": 370, "CityName": "澳门特别行政区", "ProID": 33, "CitySort": 370 }, { "CityID": 371, "CityName": "香港特别行政区", "ProID": 34, "CitySort": 371 } ], "countyList": [ { "Id": 1, "DisName": "东城区", "CityID": 1, "DisSort": null }, { "Id": 2, "DisName": "西城区", "CityID": 1, "DisSort": null }, { "Id": 3, "DisName": "崇文区", "CityID": 1, "DisSort": null }, { "Id": 4, "DisName": "宣武区", "CityID": 1, "DisSort": null }, { "Id": 5, "DisName": "朝阳区", "CityID": 1, "DisSort": null }, { "Id": 6, "DisName": "丰台区", "CityID": 1, "DisSort": null }, { "Id": 7, "DisName": "石景山区", "CityID": 1, "DisSort": null }, { "Id": 8, "DisName": "海淀区", "CityID": 1, "DisSort": null }, { "Id": 9, "DisName": "门头沟区", "CityID": 1, "DisSort": null }, { "Id": 10, "DisName": "房山区", "CityID": 1, "DisSort": null }, { "Id": 11, "DisName": "通州区", "CityID": 1, "DisSort": null }, { "Id": 12, "DisName": "顺义区", "CityID": 1, "DisSort": null }, { "Id": 13, "DisName": "昌平区", "CityID": 1, "DisSort": null }, { "Id": 14, "DisName": "大兴区", "CityID": 1, "DisSort": null }, { "Id": 15, "DisName": "怀柔区", "CityID": 1, "DisSort": null }, { "Id": 16, "DisName": "平谷区", "CityID": 1, "DisSort": null }, { "Id": 17, "DisName": "密云县", "CityID": 1, "DisSort": null }, { "Id": 18, "DisName": "延庆县", "CityID": 1, "DisSort": null }, { "Id": 19, "DisName": "和平区", "CityID": 2, "DisSort": null }, { "Id": 20, "DisName": "河东区", "CityID": 2, "DisSort": null }, { "Id": 21, "DisName": "河西区", "CityID": 2, "DisSort": null }, { "Id": 22, "DisName": "南开区", "CityID": 2, "DisSort": null }, { "Id": 23, "DisName": "河北区", "CityID": 2, "DisSort": null }, { "Id": 24, "DisName": "红桥区", "CityID": 2, "DisSort": null }, { "Id": 25, "DisName": "塘沽区", "CityID": 2, "DisSort": null }, { "Id": 26, "DisName": "汉沽区", "CityID": 2, "DisSort": null }, { "Id": 27, "DisName": "大港区", "CityID": 2, "DisSort": null }, { "Id": 28, "DisName": "东丽区", "CityID": 2, "DisSort": null }, { "Id": 29, "DisName": "西青区", "CityID": 2, "DisSort": null }, { "Id": 30, "DisName": "津南区", "CityID": 2, "DisSort": null }, { "Id": 31, "DisName": "北辰区", "CityID": 2, "DisSort": null }, { "Id": 32, "DisName": "武清区", "CityID": 2, "DisSort": null }, { "Id": 33, "DisName": "宝坻区", "CityID": 2, "DisSort": null }, { "Id": 34, "DisName": "宁河县", "CityID": 2, "DisSort": null }, { "Id": 35, "DisName": "静海县", "CityID": 2, "DisSort": null }, { "Id": 36, "DisName": "蓟县", "CityID": 2, "DisSort": null }, { "Id": 37, "DisName": "黄浦区", "CityID": 3, "DisSort": null }, { "Id": 38, "DisName": "卢湾区", "CityID": 3, "DisSort": null }, { "Id": 39, "DisName": "徐汇区", "CityID": 3, "DisSort": null }, { "Id": 40, "DisName": "长宁区", "CityID": 3, "DisSort": null }, { "Id": 41, "DisName": "静安区", "CityID": 3, "DisSort": null }, { "Id": 42, "DisName": "普陀区", "CityID": 3, "DisSort": null }, { "Id": 43, "DisName": "闸北区", "CityID": 3, "DisSort": null }, { "Id": 44, "DisName": "虹口区", "CityID": 3, "DisSort": null }, { "Id": 45, "DisName": "杨浦区", "CityID": 3, "DisSort": null }, { "Id": 46, "DisName": "闵行区", "CityID": 3, "DisSort": null }, { "Id": 47, "DisName": "宝山区", "CityID": 3, "DisSort": null }, { "Id": 48, "DisName": "嘉定区", "CityID": 3, "DisSort": null }, { "Id": 49, "DisName": "浦东新区", "CityID": 3, "DisSort": null }, { "Id": 50, "DisName": "金山区", "CityID": 3, "DisSort": null }, { "Id": 51, "DisName": "松江区", "CityID": 3, "DisSort": null }, { "Id": 52, "DisName": "青浦区", "CityID": 3, "DisSort": null }, { "Id": 53, "DisName": "南汇区", "CityID": 3, "DisSort": null }, { "Id": 54, "DisName": "奉贤区", "CityID": 3, "DisSort": null }, { "Id": 55, "DisName": "崇明县", "CityID": 3, "DisSort": null }, { "Id": 56, "DisName": "万州区", "CityID": 4, "DisSort": null }, { "Id": 57, "DisName": "涪陵区", "CityID": 4, "DisSort": null }, { "Id": 58, "DisName": "渝中区", "CityID": 4, "DisSort": null }, { "Id": 59, "DisName": "大渡口区", "CityID": 4, "DisSort": null }, { "Id": 60, "DisName": "江北区", "CityID": 4, "DisSort": null }, { "Id": 61, "DisName": "沙坪坝区", "CityID": 4, "DisSort": null }, { "Id": 62, "DisName": "九龙坡区", "CityID": 4, "DisSort": null }, { "Id": 63, "DisName": "南岸区", "CityID": 4, "DisSort": null }, { "Id": 64, "DisName": "北碚区", "CityID": 4, "DisSort": null }, { "Id": 65, "DisName": "万盛区", "CityID": 4, "DisSort": null }, { "Id": 66, "DisName": "双桥区", "CityID": 4, "DisSort": null }, { "Id": 67, "DisName": "渝北区", "CityID": 4, "DisSort": null }, { "Id": 68, "DisName": "巴南区", "CityID": 4, "DisSort": null }, { "Id": 69, "DisName": "黔江区", "CityID": 4, "DisSort": null }, { "Id": 70, "DisName": "长寿区", "CityID": 4, "DisSort": null }, { "Id": 71, "DisName": "江津区", "CityID": 4, "DisSort": null }, { "Id": 72, "DisName": "合川区", "CityID": 4, "DisSort": null }, { "Id": 73, "DisName": "永川区", "CityID": 4, "DisSort": null }, { "Id": 74, "DisName": "南川区", "CityID": 4, "DisSort": null }, { "Id": 75, "DisName": "綦江县", "CityID": 4, "DisSort": null }, { "Id": 76, "DisName": "潼南县", "CityID": 4, "DisSort": null }, { "Id": 77, "DisName": "铜梁县", "CityID": 4, "DisSort": null }, { "Id": 78, "DisName": "大足县", "CityID": 4, "DisSort": null }, { "Id": 79, "DisName": "荣昌县", "CityID": 4, "DisSort": null }, { "Id": 80, "DisName": "璧山县", "CityID": 4, "DisSort": null }, { "Id": 81, "DisName": "梁平县", "CityID": 4, "DisSort": null }, { "Id": 82, "DisName": "城口县", "CityID": 4, "DisSort": null }, { "Id": 83, "DisName": "丰都县", "CityID": 4, "DisSort": null }, { "Id": 84, "DisName": "垫江县", "CityID": 4, "DisSort": null }, { "Id": 85, "DisName": "武隆县", "CityID": 4, "DisSort": null }, { "Id": 86, "DisName": "忠县", "CityID": 4, "DisSort": null }, { "Id": 87, "DisName": "开县", "CityID": 4, "DisSort": null }, { "Id": 88, "DisName": "云阳县", "CityID": 4, "DisSort": null }, { "Id": 89, "DisName": "奉节县", "CityID": 4, "DisSort": null }, { "Id": 90, "DisName": "巫山县", "CityID": 4, "DisSort": null }, { "Id": 91, "DisName": "巫溪县", "CityID": 4, "DisSort": null }, { "Id": 92, "DisName": "石柱土家族自治县", "CityID": 4, "DisSort": null }, { "Id": 93, "DisName": "秀山土家族苗族自治县", "CityID": 4, "DisSort": null }, { "Id": 94, "DisName": "酉阳土家族苗族自治县", "CityID": 4, "DisSort": null }, { "Id": 95, "DisName": "彭水苗族土家族自治县", "CityID": 4, "DisSort": null }, { "Id": 96, "DisName": "邯山区", "CityID": 5, "DisSort": null }, { "Id": 97, "DisName": "丛台区", "CityID": 5, "DisSort": null }, { "Id": 98, "DisName": "复兴区", "CityID": 5, "DisSort": null }, { "Id": 99, "DisName": "峰峰矿区", "CityID": 5, "DisSort": null }, { "Id": 100, "DisName": "邯郸县", "CityID": 5, "DisSort": null }, { "Id": 101, "DisName": "临漳县", "CityID": 5, "DisSort": null }, { "Id": 102, "DisName": "成安县", "CityID": 5, "DisSort": null }, { "Id": 103, "DisName": "大名县", "CityID": 5, "DisSort": null }, { "Id": 104, "DisName": "涉县", "CityID": 5, "DisSort": null }, { "Id": 105, "DisName": "磁县", "CityID": 5, "DisSort": null }, { "Id": 106, "DisName": "肥乡县", "CityID": 5, "DisSort": null }, { "Id": 107, "DisName": "永年县", "CityID": 5, "DisSort": null }, { "Id": 108, "DisName": "邱县", "CityID": 5, "DisSort": null }, { "Id": 109, "DisName": "鸡泽县", "CityID": 5, "DisSort": null }, { "Id": 110, "DisName": "广平县", "CityID": 5, "DisSort": null }, { "Id": 111, "DisName": "馆陶县", "CityID": 5, "DisSort": null }, { "Id": 112, "DisName": "魏县", "CityID": 5, "DisSort": null }, { "Id": 113, "DisName": "曲周县", "CityID": 5, "DisSort": null }, { "Id": 114, "DisName": "武安市", "CityID": 5, "DisSort": null }, { "Id": 115, "DisName": "长安区", "CityID": 6, "DisSort": null }, { "Id": 116, "DisName": "桥东区", "CityID": 6, "DisSort": null }, { "Id": 117, "DisName": "桥西区", "CityID": 6, "DisSort": null }, { "Id": 118, "DisName": "新华区", "CityID": 6, "DisSort": null }, { "Id": 119, "DisName": "井陉矿区", "CityID": 6, "DisSort": null }, { "Id": 120, "DisName": "裕华区", "CityID": 6, "DisSort": null }, { "Id": 121, "DisName": "井陉县", "CityID": 6, "DisSort": null }, { "Id": 122, "DisName": "正定县", "CityID": 6, "DisSort": null }, { "Id": 123, "DisName": "栾城县", "CityID": 6, "DisSort": null }, { "Id": 124, "DisName": "行唐县", "CityID": 6, "DisSort": null }, { "Id": 125, "DisName": "灵寿县", "CityID": 6, "DisSort": null }, { "Id": 126, "DisName": "高邑县", "CityID": 6, "DisSort": null }, { "Id": 127, "DisName": "深泽县", "CityID": 6, "DisSort": null }, { "Id": 128, "DisName": "赞皇县", "CityID": 6, "DisSort": null }, { "Id": 129, "DisName": "无极县", "CityID": 6, "DisSort": null }, { "Id": 130, "DisName": "平山县", "CityID": 6, "DisSort": null }, { "Id": 131, "DisName": "元氏县", "CityID": 6, "DisSort": null }, { "Id": 132, "DisName": "赵县", "CityID": 6, "DisSort": null }, { "Id": 133, "DisName": "辛集市", "CityID": 6, "DisSort": null }, { "Id": 134, "DisName": "藁城市", "CityID": 6, "DisSort": null }, { "Id": 135, "DisName": "晋州市", "CityID": 6, "DisSort": null }, { "Id": 136, "DisName": "新乐市", "CityID": 6, "DisSort": null }, { "Id": 137, "DisName": "鹿泉市", "CityID": 6, "DisSort": null }, { "Id": 138, "DisName": "新市区", "CityID": 7, "DisSort": null }, { "Id": 139, "DisName": "北市区", "CityID": 7, "DisSort": null }, { "Id": 140, "DisName": "南市区", "CityID": 7, "DisSort": null }, { "Id": 141, "DisName": "满城县", "CityID": 7, "DisSort": null }, { "Id": 142, "DisName": "清苑县", "CityID": 7, "DisSort": null }, { "Id": 143, "DisName": "涞水县", "CityID": 7, "DisSort": null }, { "Id": 144, "DisName": "阜平县", "CityID": 7, "DisSort": null }, { "Id": 145, "DisName": "徐水县", "CityID": 7, "DisSort": null }, { "Id": 146, "DisName": "定兴县", "CityID": 7, "DisSort": null }, { "Id": 147, "DisName": "唐县", "CityID": 7, "DisSort": null }, { "Id": 148, "DisName": "高阳县", "CityID": 7, "DisSort": null }, { "Id": 149, "DisName": "容城县", "CityID": 7, "DisSort": null }, { "Id": 150, "DisName": "涞源县", "CityID": 7, "DisSort": null }, { "Id": 151, "DisName": "望都县", "CityID": 7, "DisSort": null }, { "Id": 152, "DisName": "安新县", "CityID": 7, "DisSort": null }, { "Id": 153, "DisName": "易县", "CityID": 7, "DisSort": null }, { "Id": 154, "DisName": "曲阳县", "CityID": 7, "DisSort": null }, { "Id": 155, "DisName": "蠡县", "CityID": 7, "DisSort": null }, { "Id": 156, "DisName": "顺平县", "CityID": 7, "DisSort": null }, { "Id": 157, "DisName": "博野县", "CityID": 7, "DisSort": null }, { "Id": 158, "DisName": "雄县", "CityID": 7, "DisSort": null }, { "Id": 159, "DisName": "涿州市", "CityID": 7, "DisSort": null }, { "Id": 160, "DisName": "定州市", "CityID": 7, "DisSort": null }, { "Id": 161, "DisName": "安国市", "CityID": 7, "DisSort": null }, { "Id": 162, "DisName": "高碑店市", "CityID": 7, "DisSort": null }, { "Id": 163, "DisName": "桥东区", "CityID": 8, "DisSort": null }, { "Id": 164, "DisName": "桥西区", "CityID": 8, "DisSort": null }, { "Id": 165, "DisName": "宣化区", "CityID": 8, "DisSort": null }, { "Id": 166, "DisName": "下花园区", "CityID": 8, "DisSort": null }, { "Id": 167, "DisName": "宣化县", "CityID": 8, "DisSort": null }, { "Id": 168, "DisName": "张北县", "CityID": 8, "DisSort": null }, { "Id": 169, "DisName": "康保县", "CityID": 8, "DisSort": null }, { "Id": 170, "DisName": "沽源县", "CityID": 8, "DisSort": null }, { "Id": 171, "DisName": "尚义县", "CityID": 8, "DisSort": null }, { "Id": 172, "DisName": "蔚县", "CityID": 8, "DisSort": null }, { "Id": 173, "DisName": "阳原县", "CityID": 8, "DisSort": null }, { "Id": 174, "DisName": "怀安县", "CityID": 8, "DisSort": null }, { "Id": 175, "DisName": "万全县", "CityID": 8, "DisSort": null }, { "Id": 176, "DisName": "怀来县", "CityID": 8, "DisSort": null }, { "Id": 177, "DisName": "涿鹿县", "CityID": 8, "DisSort": null }, { "Id": 178, "DisName": "赤城县", "CityID": 8, "DisSort": null }, { "Id": 179, "DisName": "崇礼县", "CityID": 8, "DisSort": null }, { "Id": 180, "DisName": "双桥区", "CityID": 9, "DisSort": null }, { "Id": 181, "DisName": "双滦区", "CityID": 9, "DisSort": null }, { "Id": 182, "DisName": "鹰手营子矿区", "CityID": 9, "DisSort": null }, { "Id": 183, "DisName": "承德县", "CityID": 9, "DisSort": null }, { "Id": 184, "DisName": "兴隆县", "CityID": 9, "DisSort": null }, { "Id": 185, "DisName": "平泉县", "CityID": 9, "DisSort": null }, { "Id": 186, "DisName": "滦平县", "CityID": 9, "DisSort": null }, { "Id": 187, "DisName": "隆化县", "CityID": 9, "DisSort": null }, { "Id": 188, "DisName": "丰宁满族自治县", "CityID": 9, "DisSort": null }, { "Id": 189, "DisName": "宽城满族自治县", "CityID": 9, "DisSort": null }, { "Id": 190, "DisName": "围场满族蒙古族自治县", "CityID": 9, "DisSort": null }, { "Id": 191, "DisName": "路南区", "CityID": 10, "DisSort": null }, { "Id": 192, "DisName": "路北区", "CityID": 10, "DisSort": null }, { "Id": 193, "DisName": "古冶区", "CityID": 10, "DisSort": null }, { "Id": 194, "DisName": "开平区", "CityID": 10, "DisSort": null }, { "Id": 195, "DisName": "丰南区", "CityID": 10, "DisSort": null }, { "Id": 196, "DisName": "丰润区", "CityID": 10, "DisSort": null }, { "Id": 197, "DisName": "滦县", "CityID": 10, "DisSort": null }, { "Id": 198, "DisName": "滦南县", "CityID": 10, "DisSort": null }, { "Id": 199, "DisName": "乐亭县", "CityID": 10, "DisSort": null }, { "Id": 200, "DisName": "迁西县", "CityID": 10, "DisSort": null }, { "Id": 201, "DisName": "玉田县", "CityID": 10, "DisSort": null }, { "Id": 202, "DisName": "唐海县", "CityID": 10, "DisSort": null }, { "Id": 203, "DisName": "遵化市", "CityID": 10, "DisSort": null }, { "Id": 204, "DisName": "迁安市", "CityID": 10, "DisSort": null }, { "Id": 205, "DisName": "安次区", "CityID": 11, "DisSort": null }, { "Id": 206, "DisName": "广阳区", "CityID": 11, "DisSort": null }, { "Id": 207, "DisName": "固安县", "CityID": 11, "DisSort": null }, { "Id": 208, "DisName": "永清县", "CityID": 11, "DisSort": null }, { "Id": 209, "DisName": "香河县", "CityID": 11, "DisSort": null }, { "Id": 210, "DisName": "大城县", "CityID": 11, "DisSort": null }, { "Id": 211, "DisName": "文安县", "CityID": 11, "DisSort": null }, { "Id": 212, "DisName": "大厂回族自治县", "CityID": 11, "DisSort": null }, { "Id": 213, "DisName": "霸州市", "CityID": 11, "DisSort": null }, { "Id": 214, "DisName": "三河市", "CityID": 11, "DisSort": null }, { "Id": 215, "DisName": "新华区", "CityID": 12, "DisSort": null }, { "Id": 216, "DisName": "运河区", "CityID": 12, "DisSort": null }, { "Id": 217, "DisName": "沧县", "CityID": 12, "DisSort": null }, { "Id": 218, "DisName": "青县", "CityID": 12, "DisSort": null }, { "Id": 219, "DisName": "东光县", "CityID": 12, "DisSort": null }, { "Id": 220, "DisName": "海兴县", "CityID": 12, "DisSort": null }, { "Id": 221, "DisName": "盐山县", "CityID": 12, "DisSort": null }, { "Id": 222, "DisName": "肃宁县", "CityID": 12, "DisSort": null }, { "Id": 223, "DisName": "南皮县", "CityID": 12, "DisSort": null }, { "Id": 224, "DisName": "吴桥县", "CityID": 12, "DisSort": null }, { "Id": 225, "DisName": "献县", "CityID": 12, "DisSort": null }, { "Id": 226, "DisName": "孟村回族自治县", "CityID": 12, "DisSort": null }, { "Id": 227, "DisName": "泊头市", "CityID": 12, "DisSort": null }, { "Id": 228, "DisName": "任丘市", "CityID": 12, "DisSort": null }, { "Id": 229, "DisName": "黄骅市", "CityID": 12, "DisSort": null }, { "Id": 230, "DisName": "河间市", "CityID": 12, "DisSort": null }, { "Id": 231, "DisName": "桃城区", "CityID": 13, "DisSort": null }, { "Id": 232, "DisName": "枣强县", "CityID": 13, "DisSort": null }, { "Id": 233, "DisName": "武邑县", "CityID": 13, "DisSort": null }, { "Id": 234, "DisName": "武强县", "CityID": 13, "DisSort": null }, { "Id": 235, "DisName": "饶阳县", "CityID": 13, "DisSort": null }, { "Id": 236, "DisName": "安平县", "CityID": 13, "DisSort": null }, { "Id": 237, "DisName": "故城县", "CityID": 13, "DisSort": null }, { "Id": 238, "DisName": "景县", "CityID": 13, "DisSort": null }, { "Id": 239, "DisName": "阜城县", "CityID": 13, "DisSort": null }, { "Id": 240, "DisName": "冀州市", "CityID": 13, "DisSort": null }, { "Id": 241, "DisName": "深州市", "CityID": 13, "DisSort": null }, { "Id": 242, "DisName": "桥东区", "CityID": 14, "DisSort": null }, { "Id": 243, "DisName": "桥西区", "CityID": 14, "DisSort": null }, { "Id": 244, "DisName": "邢台县", "CityID": 14, "DisSort": null }, { "Id": 245, "DisName": "临城县", "CityID": 14, "DisSort": null }, { "Id": 246, "DisName": "内丘县", "CityID": 14, "DisSort": null }, { "Id": 247, "DisName": "柏乡县", "CityID": 14, "DisSort": null }, { "Id": 248, "DisName": "隆尧县", "CityID": 14, "DisSort": null }, { "Id": 249, "DisName": "任县", "CityID": 14, "DisSort": null }, { "Id": 250, "DisName": "南和县", "CityID": 14, "DisSort": null }, { "Id": 251, "DisName": "宁晋县", "CityID": 14, "DisSort": null }, { "Id": 252, "DisName": "巨鹿县", "CityID": 14, "DisSort": null }, { "Id": 253, "DisName": "新河县", "CityID": 14, "DisSort": null }, { "Id": 254, "DisName": "广宗县", "CityID": 14, "DisSort": null }, { "Id": 255, "DisName": "平乡县", "CityID": 14, "DisSort": null }, { "Id": 256, "DisName": "威县", "CityID": 14, "DisSort": null }, { "Id": 257, "DisName": "清河县", "CityID": 14, "DisSort": null }, { "Id": 258, "DisName": "临西县", "CityID": 14, "DisSort": null }, { "Id": 259, "DisName": "南宫市", "CityID": 14, "DisSort": null }, { "Id": 260, "DisName": "沙河市", "CityID": 14, "DisSort": null }, { "Id": 261, "DisName": "海港区", "CityID": 15, "DisSort": null }, { "Id": 262, "DisName": "山海关区", "CityID": 15, "DisSort": null }, { "Id": 263, "DisName": "北戴河区", "CityID": 15, "DisSort": null }, { "Id": 264, "DisName": "青龙满族自治县", "CityID": 15, "DisSort": null }, { "Id": 265, "DisName": "昌黎县", "CityID": 15, "DisSort": null }, { "Id": 266, "DisName": "抚宁县", "CityID": 15, "DisSort": null }, { "Id": 267, "DisName": "卢龙县", "CityID": 15, "DisSort": null }, { "Id": 268, "DisName": "朔城区", "CityID": 16, "DisSort": null }, { "Id": 269, "DisName": "平鲁区", "CityID": 16, "DisSort": null }, { "Id": 270, "DisName": "山阴县", "CityID": 16, "DisSort": null }, { "Id": 271, "DisName": "应县", "CityID": 16, "DisSort": null }, { "Id": 272, "DisName": "右玉县", "CityID": 16, "DisSort": null }, { "Id": 273, "DisName": "怀仁县", "CityID": 16, "DisSort": null }, { "Id": 274, "DisName": "忻府区", "CityID": 17, "DisSort": null }, { "Id": 275, "DisName": "定襄县", "CityID": 17, "DisSort": null }, { "Id": 276, "DisName": "五台县", "CityID": 17, "DisSort": null }, { "Id": 277, "DisName": "代县", "CityID": 17, "DisSort": null }, { "Id": 278, "DisName": "繁峙县", "CityID": 17, "DisSort": null }, { "Id": 279, "DisName": "宁武县", "CityID": 17, "DisSort": null }, { "Id": 280, "DisName": "静乐县", "CityID": 17, "DisSort": null }, { "Id": 281, "DisName": "神池县", "CityID": 17, "DisSort": null }, { "Id": 282, "DisName": "五寨县", "CityID": 17, "DisSort": null }, { "Id": 283, "DisName": "岢岚县", "CityID": 17, "DisSort": null }, { "Id": 284, "DisName": "河曲县", "CityID": 17, "DisSort": null }, { "Id": 285, "DisName": "保德县", "CityID": 17, "DisSort": null }, { "Id": 286, "DisName": "偏关县", "CityID": 17, "DisSort": null }, { "Id": 287, "DisName": "原平市", "CityID": 17, "DisSort": null }, { "Id": 288, "DisName": "小店区", "CityID": 18, "DisSort": null }, { "Id": 289, "DisName": "迎泽区", "CityID": 18, "DisSort": null }, { "Id": 290, "DisName": "杏花岭区", "CityID": 18, "DisSort": null }, { "Id": 291, "DisName": "尖草坪区", "CityID": 18, "DisSort": null }, { "Id": 292, "DisName": "万柏林区", "CityID": 18, "DisSort": null }, { "Id": 293, "DisName": "晋源区", "CityID": 18, "DisSort": null }, { "Id": 294, "DisName": "清徐县", "CityID": 18, "DisSort": null }, { "Id": 295, "DisName": "阳曲县", "CityID": 18, "DisSort": null }, { "Id": 296, "DisName": "娄烦县", "CityID": 18, "DisSort": null }, { "Id": 297, "DisName": "古交市", "CityID": 18, "DisSort": null }, { "Id": 298, "DisName": "矿区", "CityID": 19, "DisSort": null }, { "Id": 299, "DisName": "南郊区", "CityID": 19, "DisSort": null }, { "Id": 300, "DisName": "新荣区", "CityID": 19, "DisSort": null }, { "Id": 301, "DisName": "阳高县", "CityID": 19, "DisSort": null }, { "Id": 302, "DisName": "天镇县", "CityID": 19, "DisSort": null }, { "Id": 303, "DisName": "广灵县", "CityID": 19, "DisSort": null }, { "Id": 304, "DisName": "灵丘县", "CityID": 19, "DisSort": null }, { "Id": 305, "DisName": "浑源县", "CityID": 19, "DisSort": null }, { "Id": 306, "DisName": "左云县", "CityID": 19, "DisSort": null }, { "Id": 307, "DisName": "大同县", "CityID": 19, "DisSort": null }, { "Id": 308, "DisName": "矿区", "CityID": 20, "DisSort": null }, { "Id": 309, "DisName": "平定县", "CityID": 20, "DisSort": null }, { "Id": 310, "DisName": "盂县", "CityID": 20, "DisSort": null }, { "Id": 311, "DisName": "榆次区", "CityID": 21, "DisSort": null }, { "Id": 312, "DisName": "榆社县", "CityID": 21, "DisSort": null }, { "Id": 313, "DisName": "左权县", "CityID": 21, "DisSort": null }, { "Id": 314, "DisName": "和顺县", "CityID": 21, "DisSort": null }, { "Id": 315, "DisName": "昔阳县", "CityID": 21, "DisSort": null }, { "Id": 316, "DisName": "寿阳县", "CityID": 21, "DisSort": null }, { "Id": 317, "DisName": "太谷县", "CityID": 21, "DisSort": null }, { "Id": 318, "DisName": "祁县", "CityID": 21, "DisSort": null }, { "Id": 319, "DisName": "平遥县", "CityID": 21, "DisSort": null }, { "Id": 320, "DisName": "灵石县", "CityID": 21, "DisSort": null }, { "Id": 321, "DisName": "介休市", "CityID": 21, "DisSort": null }, { "Id": 322, "DisName": "长治县", "CityID": 22, "DisSort": null }, { "Id": 323, "DisName": "襄垣县", "CityID": 22, "DisSort": null }, { "Id": 324, "DisName": "屯留县", "CityID": 22, "DisSort": null }, { "Id": 325, "DisName": "平顺县", "CityID": 22, "DisSort": null }, { "Id": 326, "DisName": "黎城县", "CityID": 22, "DisSort": null }, { "Id": 327, "DisName": "壶关县", "CityID": 22, "DisSort": null }, { "Id": 328, "DisName": "长子县", "CityID": 22, "DisSort": null }, { "Id": 329, "DisName": "武乡县", "CityID": 22, "DisSort": null }, { "Id": 330, "DisName": "沁县", "CityID": 22, "DisSort": null }, { "Id": 331, "DisName": "沁源县", "CityID": 22, "DisSort": null }, { "Id": 332, "DisName": "潞城市", "CityID": 22, "DisSort": null }, { "Id": 333, "DisName": "沁水县", "CityID": 23, "DisSort": null }, { "Id": 334, "DisName": "阳城县", "CityID": 23, "DisSort": null }, { "Id": 335, "DisName": "陵川县", "CityID": 23, "DisSort": null }, { "Id": 336, "DisName": "泽州县", "CityID": 23, "DisSort": null }, { "Id": 337, "DisName": "高平市", "CityID": 23, "DisSort": null }, { "Id": 338, "DisName": "尧都区", "CityID": 24, "DisSort": null }, { "Id": 339, "DisName": "曲沃县", "CityID": 24, "DisSort": null }, { "Id": 340, "DisName": "翼城县", "CityID": 24, "DisSort": null }, { "Id": 341, "DisName": "襄汾县", "CityID": 24, "DisSort": null }, { "Id": 342, "DisName": "洪洞县", "CityID": 24, "DisSort": null }, { "Id": 343, "DisName": "古县", "CityID": 24, "DisSort": null }, { "Id": 344, "DisName": "安泽县", "CityID": 24, "DisSort": null }, { "Id": 345, "DisName": "浮山县", "CityID": 24, "DisSort": null }, { "Id": 346, "DisName": "吉县", "CityID": 24, "DisSort": null }, { "Id": 347, "DisName": "乡宁县", "CityID": 24, "DisSort": null }, { "Id": 348, "DisName": "大宁县", "CityID": 24, "DisSort": null }, { "Id": 349, "DisName": "隰县", "CityID": 24, "DisSort": null }, { "Id": 350, "DisName": "永和县", "CityID": 24, "DisSort": null }, { "Id": 351, "DisName": "蒲县", "CityID": 24, "DisSort": null }, { "Id": 352, "DisName": "汾西县", "CityID": 24, "DisSort": null }, { "Id": 353, "DisName": "侯马市", "CityID": 24, "DisSort": null }, { "Id": 354, "DisName": "霍州市", "CityID": 24, "DisSort": null }, { "Id": 355, "DisName": "离石区", "CityID": 25, "DisSort": null }, { "Id": 356, "DisName": "文水县", "CityID": 25, "DisSort": null }, { "Id": 357, "DisName": "交城县", "CityID": 25, "DisSort": null }, { "Id": 358, "DisName": "兴县", "CityID": 25, "DisSort": null }, { "Id": 359, "DisName": "临县", "CityID": 25, "DisSort": null }, { "Id": 360, "DisName": "柳林县", "CityID": 25, "DisSort": null }, { "Id": 361, "DisName": "石楼县", "CityID": 25, "DisSort": null }, { "Id": 362, "DisName": "岚县", "CityID": 25, "DisSort": null }, { "Id": 363, "DisName": "方山县", "CityID": 25, "DisSort": null }, { "Id": 364, "DisName": "中阳县", "CityID": 25, "DisSort": null }, { "Id": 365, "DisName": "交口县", "CityID": 25, "DisSort": null }, { "Id": 366, "DisName": "孝义市", "CityID": 25, "DisSort": null }, { "Id": 367, "DisName": "汾阳市", "CityID": 25, "DisSort": null }, { "Id": 368, "DisName": "盐湖区", "CityID": 26, "DisSort": null }, { "Id": 369, "DisName": "临猗县", "CityID": 26, "DisSort": null }, { "Id": 370, "DisName": "万荣县", "CityID": 26, "DisSort": null }, { "Id": 371, "DisName": "闻喜县", "CityID": 26, "DisSort": null }, { "Id": 372, "DisName": "稷山县", "CityID": 26, "DisSort": null }, { "Id": 373, "DisName": "新绛县", "CityID": 26, "DisSort": null }, { "Id": 374, "DisName": "绛县", "CityID": 26, "DisSort": null }, { "Id": 375, "DisName": "垣曲县", "CityID": 26, "DisSort": null }, { "Id": 376, "DisName": "夏县", "CityID": 26, "DisSort": null }, { "Id": 377, "DisName": "平陆县", "CityID": 26, "DisSort": null }, { "Id": 378, "DisName": "芮城县", "CityID": 26, "DisSort": null }, { "Id": 379, "DisName": "永济市", "CityID": 26, "DisSort": null }, { "Id": 380, "DisName": "河津市", "CityID": 26, "DisSort": null }, { "Id": 381, "DisName": "和平区", "CityID": 27, "DisSort": null }, { "Id": 382, "DisName": "沈河区", "CityID": 27, "DisSort": null }, { "Id": 383, "DisName": "大东区", "CityID": 27, "DisSort": null }, { "Id": 384, "DisName": "皇姑区", "CityID": 27, "DisSort": null }, { "Id": 385, "DisName": "铁西区", "CityID": 27, "DisSort": null }, { "Id": 386, "DisName": "苏家屯区", "CityID": 27, "DisSort": null }, { "Id": 387, "DisName": "东陵区", "CityID": 27, "DisSort": null }, { "Id": 388, "DisName": "沈北新区", "CityID": 27, "DisSort": null }, { "Id": 389, "DisName": "于洪区", "CityID": 27, "DisSort": null }, { "Id": 390, "DisName": "辽中县", "CityID": 27, "DisSort": null }, { "Id": 391, "DisName": "康平县", "CityID": 27, "DisSort": null }, { "Id": 392, "DisName": "法库县", "CityID": 27, "DisSort": null }, { "Id": 393, "DisName": "新民市", "CityID": 27, "DisSort": null }, { "Id": 394, "DisName": "银州区", "CityID": 28, "DisSort": null }, { "Id": 395, "DisName": "清河区", "CityID": 28, "DisSort": null }, { "Id": 396, "DisName": "铁岭县", "CityID": 28, "DisSort": null }, { "Id": 397, "DisName": "西丰县", "CityID": 28, "DisSort": null }, { "Id": 398, "DisName": "昌图县", "CityID": 28, "DisSort": null }, { "Id": 399, "DisName": "调兵山市", "CityID": 28, "DisSort": null }, { "Id": 400, "DisName": "开原市", "CityID": 28, "DisSort": null }, { "Id": 401, "DisName": "长海县", "CityID": 29, "DisSort": null }, { "Id": 402, "DisName": "旅顺口区", "CityID": 29, "DisSort": null }, { "Id": 403, "DisName": "中山区", "CityID": 29, "DisSort": null }, { "Id": 404, "DisName": "西岗区", "CityID": 29, "DisSort": null }, { "Id": 405, "DisName": "沙河口区", "CityID": 29, "DisSort": null }, { "Id": 406, "DisName": "甘井子区", "CityID": 29, "DisSort": null }, { "Id": 407, "DisName": "金州区", "CityID": 29, "DisSort": null }, { "Id": 408, "DisName": "普兰店市", "CityID": 29, "DisSort": null }, { "Id": 409, "DisName": "瓦房店市", "CityID": 29, "DisSort": null }, { "Id": 410, "DisName": "庄河市", "CityID": 29, "DisSort": null }, { "Id": 411, "DisName": "铁东区", "CityID": 30, "DisSort": null }, { "Id": 412, "DisName": "铁西区", "CityID": 30, "DisSort": null }, { "Id": 413, "DisName": "立山区", "CityID": 30, "DisSort": null }, { "Id": 414, "DisName": "千山区", "CityID": 30, "DisSort": null }, { "Id": 415, "DisName": "台安县", "CityID": 30, "DisSort": null }, { "Id": 416, "DisName": "岫岩满族自治县", "CityID": 30, "DisSort": null }, { "Id": 417, "DisName": "海城市", "CityID": 30, "DisSort": null }, { "Id": 418, "DisName": "新抚区", "CityID": 31, "DisSort": null }, { "Id": 419, "DisName": "东洲区", "CityID": 31, "DisSort": null }, { "Id": 420, "DisName": "望花区", "CityID": 31, "DisSort": null }, { "Id": 421, "DisName": "顺城区", "CityID": 31, "DisSort": null }, { "Id": 422, "DisName": "抚顺县", "CityID": 31, "DisSort": null }, { "Id": 423, "DisName": "新宾满族自治县", "CityID": 31, "DisSort": null }, { "Id": 424, "DisName": "清原满族自治县", "CityID": 31, "DisSort": null }, { "Id": 425, "DisName": "平山区", "CityID": 32, "DisSort": null }, { "Id": 426, "DisName": "溪湖区", "CityID": 32, "DisSort": null }, { "Id": 427, "DisName": "明山区", "CityID": 32, "DisSort": null }, { "Id": 428, "DisName": "南芬区", "CityID": 32, "DisSort": null }, { "Id": 429, "DisName": "本溪满族自治县", "CityID": 32, "DisSort": null }, { "Id": 430, "DisName": "桓仁满族自治县", "CityID": 32, "DisSort": null }, { "Id": 431, "DisName": "元宝区", "CityID": 33, "DisSort": null }, { "Id": 432, "DisName": "振兴区", "CityID": 33, "DisSort": null }, { "Id": 433, "DisName": "振安区", "CityID": 33, "DisSort": null }, { "Id": 434, "DisName": "宽甸满族自治县", "CityID": 33, "DisSort": null }, { "Id": 435, "DisName": "东港市", "CityID": 33, "DisSort": null }, { "Id": 436, "DisName": "凤城市", "CityID": 33, "DisSort": null }, { "Id": 437, "DisName": "古塔区", "CityID": 34, "DisSort": null }, { "Id": 438, "DisName": "凌河区", "CityID": 34, "DisSort": null }, { "Id": 439, "DisName": "太和区", "CityID": 34, "DisSort": null }, { "Id": 440, "DisName": "黑山县", "CityID": 34, "DisSort": null }, { "Id": 441, "DisName": "义县", "CityID": 34, "DisSort": null }, { "Id": 442, "DisName": "凌海市", "CityID": 34, "DisSort": null }, { "Id": 443, "DisName": "北镇市", "CityID": 34, "DisSort": null }, { "Id": 444, "DisName": "站前区", "CityID": 35, "DisSort": null }, { "Id": 445, "DisName": "西市区", "CityID": 35, "DisSort": null }, { "Id": 446, "DisName": "鮁鱼圈区", "CityID": 35, "DisSort": null }, { "Id": 447, "DisName": "老边区", "CityID": 35, "DisSort": null }, { "Id": 448, "DisName": "盖州市", "CityID": 35, "DisSort": null }, { "Id": 449, "DisName": "大石桥市", "CityID": 35, "DisSort": null }, { "Id": 450, "DisName": "海州区", "CityID": 36, "DisSort": null }, { "Id": 451, "DisName": "新邱区", "CityID": 36, "DisSort": null }, { "Id": 452, "DisName": "太平区", "CityID": 36, "DisSort": null }, { "Id": 453, "DisName": "清河门区", "CityID": 36, "DisSort": null }, { "Id": 454, "DisName": "细河区", "CityID": 36, "DisSort": null }, { "Id": 455, "DisName": "阜新蒙古族自治县", "CityID": 36, "DisSort": null }, { "Id": 456, "DisName": "彰武县", "CityID": 36, "DisSort": null }, { "Id": 457, "DisName": "白塔区", "CityID": 37, "DisSort": null }, { "Id": 458, "DisName": "文圣区", "CityID": 37, "DisSort": null }, { "Id": 459, "DisName": "宏伟区", "CityID": 37, "DisSort": null }, { "Id": 460, "DisName": "弓长岭区", "CityID": 37, "DisSort": null }, { "Id": 461, "DisName": "太子河区", "CityID": 37, "DisSort": null }, { "Id": 462, "DisName": "辽阳县", "CityID": 37, "DisSort": null }, { "Id": 463, "DisName": "灯塔市", "CityID": 37, "DisSort": null }, { "Id": 464, "DisName": "双塔区", "CityID": 38, "DisSort": null }, { "Id": 465, "DisName": "龙城区", "CityID": 38, "DisSort": null }, { "Id": 466, "DisName": "朝阳县", "CityID": 38, "DisSort": null }, { "Id": 467, "DisName": "建平县", "CityID": 38, "DisSort": null }, { "Id": 468, "DisName": "喀喇沁左翼蒙古族自治县", "CityID": 38, "DisSort": null }, { "Id": 469, "DisName": "北票市", "CityID": 38, "DisSort": null }, { "Id": 470, "DisName": "凌源市", "CityID": 38, "DisSort": null }, { "Id": 471, "DisName": "双台子区", "CityID": 39, "DisSort": null }, { "Id": 472, "DisName": "兴隆台区", "CityID": 39, "DisSort": null }, { "Id": 473, "DisName": "大洼县", "CityID": 39, "DisSort": null }, { "Id": 474, "DisName": "盘山县", "CityID": 39, "DisSort": null }, { "Id": 475, "DisName": "连山区", "CityID": 40, "DisSort": null }, { "Id": 476, "DisName": "龙港区", "CityID": 40, "DisSort": null }, { "Id": 477, "DisName": "南票区", "CityID": 40, "DisSort": null }, { "Id": 478, "DisName": "绥中县", "CityID": 40, "DisSort": null }, { "Id": 479, "DisName": "建昌县", "CityID": 40, "DisSort": null }, { "Id": 480, "DisName": "兴城市", "CityID": 40, "DisSort": null }, { "Id": 481, "DisName": "南关区", "CityID": 41, "DisSort": null }, { "Id": 482, "DisName": "宽城区", "CityID": 41, "DisSort": null }, { "Id": 483, "DisName": "朝阳区", "CityID": 41, "DisSort": null }, { "Id": 484, "DisName": "二道区", "CityID": 41, "DisSort": null }, { "Id": 485, "DisName": "绿园区", "CityID": 41, "DisSort": null }, { "Id": 486, "DisName": "双阳区", "CityID": 41, "DisSort": null }, { "Id": 487, "DisName": "农安县", "CityID": 41, "DisSort": null }, { "Id": 488, "DisName": "九台市", "CityID": 41, "DisSort": null }, { "Id": 489, "DisName": "榆树市", "CityID": 41, "DisSort": null }, { "Id": 490, "DisName": "德惠市", "CityID": 41, "DisSort": null }, { "Id": 491, "DisName": "昌邑区", "CityID": 42, "DisSort": null }, { "Id": 492, "DisName": "龙潭区", "CityID": 42, "DisSort": null }, { "Id": 493, "DisName": "船营区", "CityID": 42, "DisSort": null }, { "Id": 494, "DisName": "丰满区", "CityID": 42, "DisSort": null }, { "Id": 495, "DisName": "永吉县", "CityID": 42, "DisSort": null }, { "Id": 496, "DisName": "蛟河市", "CityID": 42, "DisSort": null }, { "Id": 497, "DisName": "桦甸市", "CityID": 42, "DisSort": null }, { "Id": 498, "DisName": "舒兰市", "CityID": 42, "DisSort": null }, { "Id": 499, "DisName": "磐石市", "CityID": 42, "DisSort": null }, { "Id": 500, "DisName": "延吉市", "CityID": 43, "DisSort": null }, { "Id": 501, "DisName": "图们市", "CityID": 43, "DisSort": null }, { "Id": 502, "DisName": "敦化市", "CityID": 43, "DisSort": null }, { "Id": 503, "DisName": "珲春市", "CityID": 43, "DisSort": null }, { "Id": 504, "DisName": "龙井市", "CityID": 43, "DisSort": null }, { "Id": 505, "DisName": "和龙市", "CityID": 43, "DisSort": null }, { "Id": 506, "DisName": "汪清县", "CityID": 43, "DisSort": null }, { "Id": 507, "DisName": "安图县", "CityID": 43, "DisSort": null }, { "Id": 508, "DisName": "铁西区", "CityID": 44, "DisSort": null }, { "Id": 509, "DisName": "铁东区", "CityID": 44, "DisSort": null }, { "Id": 510, "DisName": "梨树县", "CityID": 44, "DisSort": null }, { "Id": 511, "DisName": "伊通满族自治县", "CityID": 44, "DisSort": null }, { "Id": 512, "DisName": "公主岭市", "CityID": 44, "DisSort": null }, { "Id": 513, "DisName": "双辽市", "CityID": 44, "DisSort": null }, { "Id": 514, "DisName": "东昌区", "CityID": 45, "DisSort": null }, { "Id": 515, "DisName": "二道江区", "CityID": 45, "DisSort": null }, { "Id": 516, "DisName": "通化县", "CityID": 45, "DisSort": null }, { "Id": 517, "DisName": "辉南县", "CityID": 45, "DisSort": null }, { "Id": 518, "DisName": "柳河县", "CityID": 45, "DisSort": null }, { "Id": 519, "DisName": "梅河口市", "CityID": 45, "DisSort": null }, { "Id": 520, "DisName": "集安市", "CityID": 45, "DisSort": null }, { "Id": 521, "DisName": "洮北区", "CityID": 46, "DisSort": null }, { "Id": 522, "DisName": "镇赉县", "CityID": 46, "DisSort": null }, { "Id": 523, "DisName": "通榆县", "CityID": 46, "DisSort": null }, { "Id": 524, "DisName": "洮南市", "CityID": 46, "DisSort": null }, { "Id": 525, "DisName": "大安市", "CityID": 46, "DisSort": null }, { "Id": 526, "DisName": "龙山区", "CityID": 47, "DisSort": null }, { "Id": 527, "DisName": "西安区", "CityID": 47, "DisSort": null }, { "Id": 528, "DisName": "东丰县", "CityID": 47, "DisSort": null }, { "Id": 529, "DisName": "东辽县", "CityID": 47, "DisSort": null }, { "Id": 530, "DisName": "宁江区", "CityID": 48, "DisSort": null }, { "Id": 531, "DisName": "前郭尔罗斯蒙古族自治县", "CityID": 48, "DisSort": null }, { "Id": 532, "DisName": "长岭县", "CityID": 48, "DisSort": null }, { "Id": 533, "DisName": "乾安县", "CityID": 48, "DisSort": null }, { "Id": 534, "DisName": "扶余县", "CityID": 48, "DisSort": null }, { "Id": 535, "DisName": "八道江区", "CityID": 49, "DisSort": null }, { "Id": 536, "DisName": "江源区", "CityID": 49, "DisSort": null }, { "Id": 537, "DisName": "抚松县", "CityID": 49, "DisSort": null }, { "Id": 538, "DisName": "靖宇县", "CityID": 49, "DisSort": null }, { "Id": 539, "DisName": "长白朝鲜族自治县", "CityID": 49, "DisSort": null }, { "Id": 540, "DisName": "临江市", "CityID": 49, "DisSort": null }, { "Id": 541, "DisName": "道里区", "CityID": 50, "DisSort": null }, { "Id": 542, "DisName": "南岗区", "CityID": 50, "DisSort": null }, { "Id": 543, "DisName": "道外区", "CityID": 50, "DisSort": null }, { "Id": 544, "DisName": "平房区", "CityID": 50, "DisSort": null }, { "Id": 545, "DisName": "松北区", "CityID": 50, "DisSort": null }, { "Id": 546, "DisName": "香坊区", "CityID": 50, "DisSort": null }, { "Id": 547, "DisName": "呼兰区", "CityID": 50, "DisSort": null }, { "Id": 548, "DisName": "阿城区", "CityID": 50, "DisSort": null }, { "Id": 549, "DisName": "依兰县", "CityID": 50, "DisSort": null }, { "Id": 550, "DisName": "方正县", "CityID": 50, "DisSort": null }, { "Id": 551, "DisName": "宾县", "CityID": 50, "DisSort": null }, { "Id": 552, "DisName": "巴彦县", "CityID": 50, "DisSort": null }, { "Id": 553, "DisName": "木兰县", "CityID": 50, "DisSort": null }, { "Id": 554, "DisName": "通河县", "CityID": 50, "DisSort": null }, { "Id": 555, "DisName": "延寿县", "CityID": 50, "DisSort": null }, { "Id": 556, "DisName": "双城市", "CityID": 50, "DisSort": null }, { "Id": 557, "DisName": "尚志市", "CityID": 50, "DisSort": null }, { "Id": 558, "DisName": "五常市", "CityID": 50, "DisSort": null }, { "Id": 559, "DisName": "龙沙区", "CityID": 51, "DisSort": null }, { "Id": 560, "DisName": "建华区", "CityID": 51, "DisSort": null }, { "Id": 561, "DisName": "铁锋区", "CityID": 51, "DisSort": null }, { "Id": 562, "DisName": "昂昂溪区", "CityID": 51, "DisSort": null }, { "Id": 563, "DisName": "富拉尔基区", "CityID": 51, "DisSort": null }, { "Id": 564, "DisName": "碾子山区", "CityID": 51, "DisSort": null }, { "Id": 565, "DisName": "梅里斯达翰尔族区", "CityID": 51, "DisSort": null }, { "Id": 566, "DisName": "龙江县", "CityID": 51, "DisSort": null }, { "Id": 567, "DisName": "依安县", "CityID": 51, "DisSort": null }, { "Id": 568, "DisName": "泰来县", "CityID": 51, "DisSort": null }, { "Id": 569, "DisName": "甘南县", "CityID": 51, "DisSort": null }, { "Id": 570, "DisName": "富裕县", "CityID": 51, "DisSort": null }, { "Id": 571, "DisName": "克山县", "CityID": 51, "DisSort": null }, { "Id": 572, "DisName": "克东县", "CityID": 51, "DisSort": null }, { "Id": 573, "DisName": "拜泉县", "CityID": 51, "DisSort": null }, { "Id": 574, "DisName": "讷河市", "CityID": 51, "DisSort": null }, { "Id": 575, "DisName": "鸡冠区", "CityID": 52, "DisSort": null }, { "Id": 576, "DisName": "恒山区", "CityID": 52, "DisSort": null }, { "Id": 577, "DisName": "滴道区", "CityID": 52, "DisSort": null }, { "Id": 578, "DisName": "梨树区", "CityID": 52, "DisSort": null }, { "Id": 579, "DisName": "城子河区", "CityID": 52, "DisSort": null }, { "Id": 580, "DisName": "麻山区", "CityID": 52, "DisSort": null }, { "Id": 581, "DisName": "鸡东县", "CityID": 52, "DisSort": null }, { "Id": 582, "DisName": "虎林市", "CityID": 52, "DisSort": null }, { "Id": 583, "DisName": "密山市", "CityID": 52, "DisSort": null }, { "Id": 584, "DisName": "东安区", "CityID": 53, "DisSort": null }, { "Id": 585, "DisName": "阳明区", "CityID": 53, "DisSort": null }, { "Id": 586, "DisName": "爱民区", "CityID": 53, "DisSort": null }, { "Id": 587, "DisName": "西安区", "CityID": 53, "DisSort": null }, { "Id": 588, "DisName": "东宁县", "CityID": 53, "DisSort": null }, { "Id": 589, "DisName": "林口县", "CityID": 53, "DisSort": null }, { "Id": 590, "DisName": "绥芬河市", "CityID": 53, "DisSort": null }, { "Id": 591, "DisName": "海林市", "CityID": 53, "DisSort": null }, { "Id": 592, "DisName": "宁安市", "CityID": 53, "DisSort": null }, { "Id": 593, "DisName": "穆棱市", "CityID": 53, "DisSort": null }, { "Id": 594, "DisName": "新兴区", "CityID": 54, "DisSort": null }, { "Id": 595, "DisName": "桃山区", "CityID": 54, "DisSort": null }, { "Id": 596, "DisName": "茄子河区", "CityID": 54, "DisSort": null }, { "Id": 597, "DisName": "勃利县", "CityID": 54, "DisSort": null }, { "Id": 598, "DisName": "向阳区", "CityID": 55, "DisSort": null }, { "Id": 599, "DisName": "前进区", "CityID": 55, "DisSort": null }, { "Id": 600, "DisName": "东风区", "CityID": 55, "DisSort": null }, { "Id": 601, "DisName": "桦南县", "CityID": 55, "DisSort": null }, { "Id": 602, "DisName": "桦川县", "CityID": 55, "DisSort": null }, { "Id": 603, "DisName": "汤原县", "CityID": 55, "DisSort": null }, { "Id": 604, "DisName": "抚远县", "CityID": 55, "DisSort": null }, { "Id": 605, "DisName": "同江市", "CityID": 55, "DisSort": null }, { "Id": 606, "DisName": "富锦市", "CityID": 55, "DisSort": null }, { "Id": 607, "DisName": "向阳区", "CityID": 56, "DisSort": null }, { "Id": 608, "DisName": "工农区", "CityID": 56, "DisSort": null }, { "Id": 609, "DisName": "南山区", "CityID": 56, "DisSort": null }, { "Id": 610, "DisName": "兴安区", "CityID": 56, "DisSort": null }, { "Id": 611, "DisName": "东山区", "CityID": 56, "DisSort": null }, { "Id": 612, "DisName": "兴山区", "CityID": 56, "DisSort": null }, { "Id": 613, "DisName": "萝北县", "CityID": 56, "DisSort": null }, { "Id": 614, "DisName": "绥滨县", "CityID": 56, "DisSort": null }, { "Id": 615, "DisName": "尖山区", "CityID": 57, "DisSort": null }, { "Id": 616, "DisName": "岭东区", "CityID": 57, "DisSort": null }, { "Id": 617, "DisName": "四方台区", "CityID": 57, "DisSort": null }, { "Id": 618, "DisName": "宝山区", "CityID": 57, "DisSort": null }, { "Id": 619, "DisName": "集贤县", "CityID": 57, "DisSort": null }, { "Id": 620, "DisName": "友谊县", "CityID": 57, "DisSort": null }, { "Id": 621, "DisName": "宝清县", "CityID": 57, "DisSort": null }, { "Id": 622, "DisName": "饶河县", "CityID": 57, "DisSort": null }, { "Id": 623, "DisName": "北林区", "CityID": 58, "DisSort": null }, { "Id": 624, "DisName": "望奎县", "CityID": 58, "DisSort": null }, { "Id": 625, "DisName": "兰西县", "CityID": 58, "DisSort": null }, { "Id": 626, "DisName": "青冈县", "CityID": 58, "DisSort": null }, { "Id": 627, "DisName": "庆安县", "CityID": 58, "DisSort": null }, { "Id": 628, "DisName": "明水县", "CityID": 58, "DisSort": null }, { "Id": 629, "DisName": "绥棱县", "CityID": 58, "DisSort": null }, { "Id": 630, "DisName": "安达市", "CityID": 58, "DisSort": null }, { "Id": 631, "DisName": "肇东市", "CityID": 58, "DisSort": null }, { "Id": 632, "DisName": "海伦市", "CityID": 58, "DisSort": null }, { "Id": 633, "DisName": "爱辉区", "CityID": 59, "DisSort": null }, { "Id": 634, "DisName": "嫩江县", "CityID": 59, "DisSort": null }, { "Id": 635, "DisName": "逊克县", "CityID": 59, "DisSort": null }, { "Id": 636, "DisName": "孙吴县", "CityID": 59, "DisSort": null }, { "Id": 637, "DisName": "北安市", "CityID": 59, "DisSort": null }, { "Id": 638, "DisName": "五大连池市", "CityID": 59, "DisSort": null }, { "Id": 639, "DisName": "呼玛县", "CityID": 60, "DisSort": null }, { "Id": 640, "DisName": "塔河县", "CityID": 60, "DisSort": null }, { "Id": 641, "DisName": "漠河县", "CityID": 60, "DisSort": null }, { "Id": 642, "DisName": "伊春区", "CityID": 61, "DisSort": null }, { "Id": 643, "DisName": "南岔区", "CityID": 61, "DisSort": null }, { "Id": 644, "DisName": "友好区", "CityID": 61, "DisSort": null }, { "Id": 645, "DisName": "西林区", "CityID": 61, "DisSort": null }, { "Id": 646, "DisName": "翠峦区", "CityID": 61, "DisSort": null }, { "Id": 647, "DisName": "新青区", "CityID": 61, "DisSort": null }, { "Id": 648, "DisName": "美溪区", "CityID": 61, "DisSort": null }, { "Id": 649, "DisName": "金山屯区", "CityID": 61, "DisSort": null }, { "Id": 650, "DisName": "五营区", "CityID": 61, "DisSort": null }, { "Id": 651, "DisName": "乌马河区", "CityID": 61, "DisSort": null }, { "Id": 652, "DisName": "汤旺河区", "CityID": 61, "DisSort": null }, { "Id": 653, "DisName": "带岭区", "CityID": 61, "DisSort": null }, { "Id": 654, "DisName": "乌伊岭区", "CityID": 61, "DisSort": null }, { "Id": 655, "DisName": "红星区", "CityID": 61, "DisSort": null }, { "Id": 656, "DisName": "上甘岭区", "CityID": 61, "DisSort": null }, { "Id": 657, "DisName": "嘉荫县", "CityID": 61, "DisSort": null }, { "Id": 658, "DisName": "铁力市", "CityID": 61, "DisSort": null }, { "Id": 659, "DisName": "萨尔图区", "CityID": 62, "DisSort": null }, { "Id": 660, "DisName": "龙凤区", "CityID": 62, "DisSort": null }, { "Id": 661, "DisName": "让胡路区", "CityID": 62, "DisSort": null }, { "Id": 662, "DisName": "红岗区", "CityID": 62, "DisSort": null }, { "Id": 663, "DisName": "大同区", "CityID": 62, "DisSort": null }, { "Id": 664, "DisName": "肇州县", "CityID": 62, "DisSort": null }, { "Id": 665, "DisName": "肇源县", "CityID": 62, "DisSort": null }, { "Id": 666, "DisName": "林甸县", "CityID": 62, "DisSort": null }, { "Id": 667, "DisName": "杜尔伯特蒙古族自治县", "CityID": 62, "DisSort": null }, { "Id": 668, "DisName": "江宁区", "CityID": 63, "DisSort": null }, { "Id": 669, "DisName": "浦口区", "CityID": 63, "DisSort": null }, { "Id": 670, "DisName": "玄武区", "CityID": 63, "DisSort": null }, { "Id": 671, "DisName": "白下区", "CityID": 63, "DisSort": null }, { "Id": 672, "DisName": "秦淮区", "CityID": 63, "DisSort": null }, { "Id": 673, "DisName": "建邺区", "CityID": 63, "DisSort": null }, { "Id": 674, "DisName": "鼓楼区", "CityID": 63, "DisSort": null }, { "Id": 675, "DisName": "下关区", "CityID": 63, "DisSort": null }, { "Id": 676, "DisName": "栖霞区", "CityID": 63, "DisSort": null }, { "Id": 677, "DisName": "雨花台区", "CityID": 63, "DisSort": null }, { "Id": 678, "DisName": "六合区", "CityID": 63, "DisSort": null }, { "Id": 679, "DisName": "溧水县", "CityID": 63, "DisSort": null }, { "Id": 680, "DisName": "高淳县", "CityID": 63, "DisSort": null }, { "Id": 681, "DisName": "崇安区", "CityID": 64, "DisSort": null }, { "Id": 682, "DisName": "南长区", "CityID": 64, "DisSort": null }, { "Id": 683, "DisName": "北塘区", "CityID": 64, "DisSort": null }, { "Id": 684, "DisName": "锡山区", "CityID": 64, "DisSort": null }, { "Id": 685, "DisName": "惠山区", "CityID": 64, "DisSort": null }, { "Id": 686, "DisName": "滨湖区", "CityID": 64, "DisSort": null }, { "Id": 687, "DisName": "江阴市", "CityID": 64, "DisSort": null }, { "Id": 688, "DisName": "宜兴市", "CityID": 64, "DisSort": null }, { "Id": 689, "DisName": "京口区", "CityID": 65, "DisSort": null }, { "Id": 690, "DisName": "润州区", "CityID": 65, "DisSort": null }, { "Id": 691, "DisName": "丹徒区", "CityID": 65, "DisSort": null }, { "Id": 692, "DisName": "丹阳市", "CityID": 65, "DisSort": null }, { "Id": 693, "DisName": "扬中市", "CityID": 65, "DisSort": null }, { "Id": 694, "DisName": "句容市", "CityID": 65, "DisSort": null }, { "Id": 695, "DisName": "沧浪区", "CityID": 66, "DisSort": null }, { "Id": 696, "DisName": "常熟市", "CityID": 66, "DisSort": null }, { "Id": 697, "DisName": "平江区", "CityID": 66, "DisSort": null }, { "Id": 698, "DisName": "金阊区", "CityID": 66, "DisSort": null }, { "Id": 699, "DisName": "虎丘区", "CityID": 66, "DisSort": null }, { "Id": 700, "DisName": "昆山市", "CityID": 66, "DisSort": null }, { "Id": 701, "DisName": "太仓市", "CityID": 66, "DisSort": null }, { "Id": 702, "DisName": "吴江市", "CityID": 66, "DisSort": null }, { "Id": 703, "DisName": "吴中区", "CityID": 66, "DisSort": null }, { "Id": 704, "DisName": "相城区", "CityID": 66, "DisSort": null }, { "Id": 705, "DisName": "张家港市", "CityID": 66, "DisSort": null }, { "Id": 706, "DisName": "崇川区", "CityID": 67, "DisSort": null }, { "Id": 707, "DisName": "港闸区", "CityID": 67, "DisSort": null }, { "Id": 708, "DisName": "海安县", "CityID": 67, "DisSort": null }, { "Id": 709, "DisName": "如东县", "CityID": 67, "DisSort": null }, { "Id": 710, "DisName": "启东市", "CityID": 67, "DisSort": null }, { "Id": 711, "DisName": "如皋市", "CityID": 67, "DisSort": null }, { "Id": 712, "DisName": "通州市", "CityID": 67, "DisSort": null }, { "Id": 713, "DisName": "海门市", "CityID": 67, "DisSort": null }, { "Id": 714, "DisName": "高邮市", "CityID": 68, "DisSort": null }, { "Id": 715, "DisName": "广陵区", "CityID": 68, "DisSort": null }, { "Id": 716, "DisName": "邗江区", "CityID": 68, "DisSort": null }, { "Id": 717, "DisName": "维扬区", "CityID": 68, "DisSort": null }, { "Id": 718, "DisName": "宝应县", "CityID": 68, "DisSort": null }, { "Id": 719, "DisName": "江都市", "CityID": 68, "DisSort": null }, { "Id": 720, "DisName": "仪征市", "CityID": 68, "DisSort": null }, { "Id": 721, "DisName": "亭湖区", "CityID": 69, "DisSort": null }, { "Id": 722, "DisName": "盐都区", "CityID": 69, "DisSort": null }, { "Id": 723, "DisName": "响水县", "CityID": 69, "DisSort": null }, { "Id": 724, "DisName": "滨海县", "CityID": 69, "DisSort": null }, { "Id": 725, "DisName": "阜宁县", "CityID": 69, "DisSort": null }, { "Id": 726, "DisName": "射阳县", "CityID": 69, "DisSort": null }, { "Id": 727, "DisName": "建湖县", "CityID": 69, "DisSort": null }, { "Id": 728, "DisName": "东台市", "CityID": 69, "DisSort": null }, { "Id": 729, "DisName": "大丰市", "CityID": 69, "DisSort": null }, { "Id": 730, "DisName": "鼓楼区", "CityID": 70, "DisSort": null }, { "Id": 731, "DisName": "云龙区", "CityID": 70, "DisSort": null }, { "Id": 732, "DisName": "九里区", "CityID": 70, "DisSort": null }, { "Id": 733, "DisName": "贾汪区", "CityID": 70, "DisSort": null }, { "Id": 734, "DisName": "泉山区", "CityID": 70, "DisSort": null }, { "Id": 735, "DisName": "丰县", "CityID": 70, "DisSort": null }, { "Id": 736, "DisName": "沛县", "CityID": 70, "DisSort": null }, { "Id": 737, "DisName": "铜山县", "CityID": 70, "DisSort": null }, { "Id": 738, "DisName": "睢宁县", "CityID": 70, "DisSort": null }, { "Id": 739, "DisName": "新沂市", "CityID": 70, "DisSort": null }, { "Id": 740, "DisName": "邳州市", "CityID": 70, "DisSort": null }, { "Id": 741, "DisName": "清河区", "CityID": 71, "DisSort": null }, { "Id": 742, "DisName": "楚州区", "CityID": 71, "DisSort": null }, { "Id": 743, "DisName": "淮阴区", "CityID": 71, "DisSort": null }, { "Id": 744, "DisName": "清浦区", "CityID": 71, "DisSort": null }, { "Id": 745, "DisName": "涟水县", "CityID": 71, "DisSort": null }, { "Id": 746, "DisName": "洪泽县", "CityID": 71, "DisSort": null }, { "Id": 747, "DisName": "盱眙县", "CityID": 71, "DisSort": null }, { "Id": 748, "DisName": "金湖县", "CityID": 71, "DisSort": null }, { "Id": 749, "DisName": "连云区", "CityID": 72, "DisSort": null }, { "Id": 750, "DisName": "新浦区", "CityID": 72, "DisSort": null }, { "Id": 751, "DisName": "海州区", "CityID": 72, "DisSort": null }, { "Id": 752, "DisName": "赣榆县", "CityID": 72, "DisSort": null }, { "Id": 753, "DisName": "东海县", "CityID": 72, "DisSort": null }, { "Id": 754, "DisName": "灌云县", "CityID": 72, "DisSort": null }, { "Id": 755, "DisName": "灌南县", "CityID": 72, "DisSort": null }, { "Id": 756, "DisName": "天宁区", "CityID": 73, "DisSort": null }, { "Id": 757, "DisName": "钟楼区", "CityID": 73, "DisSort": null }, { "Id": 758, "DisName": "戚墅堰区", "CityID": 73, "DisSort": null }, { "Id": 759, "DisName": "新北区", "CityID": 73, "DisSort": null }, { "Id": 760, "DisName": "武进区", "CityID": 73, "DisSort": null }, { "Id": 761, "DisName": "溧阳市", "CityID": 73, "DisSort": null }, { "Id": 762, "DisName": "金坛市", "CityID": 73, "DisSort": null }, { "Id": 763, "DisName": "海陵区", "CityID": 74, "DisSort": null }, { "Id": 764, "DisName": "高港区", "CityID": 74, "DisSort": null }, { "Id": 765, "DisName": "兴化市", "CityID": 74, "DisSort": null }, { "Id": 766, "DisName": "靖江市", "CityID": 74, "DisSort": null }, { "Id": 767, "DisName": "泰兴市", "CityID": 74, "DisSort": null }, { "Id": 768, "DisName": "姜堰市", "CityID": 74, "DisSort": null }, { "Id": 769, "DisName": "宿城区", "CityID": 75, "DisSort": null }, { "Id": 770, "DisName": "宿豫区", "CityID": 75, "DisSort": null }, { "Id": 771, "DisName": "沭阳县", "CityID": 75, "DisSort": null }, { "Id": 772, "DisName": "泗阳县", "CityID": 75, "DisSort": null }, { "Id": 773, "DisName": "泗洪县", "CityID": 75, "DisSort": null }, { "Id": 774, "DisName": "定海区", "CityID": 76, "DisSort": null }, { "Id": 775, "DisName": "普陀区", "CityID": 76, "DisSort": null }, { "Id": 776, "DisName": "岱山县", "CityID": 76, "DisSort": null }, { "Id": 777, "DisName": "嵊泗县", "CityID": 76, "DisSort": null }, { "Id": 778, "DisName": "柯城区", "CityID": 77, "DisSort": null }, { "Id": 779, "DisName": "衢江区", "CityID": 77, "DisSort": null }, { "Id": 780, "DisName": "常山县", "CityID": 77, "DisSort": null }, { "Id": 781, "DisName": "开化县", "CityID": 77, "DisSort": null }, { "Id": 782, "DisName": "龙游县", "CityID": 77, "DisSort": null }, { "Id": 783, "DisName": "江山市", "CityID": 77, "DisSort": null }, { "Id": 784, "DisName": "上城区", "CityID": 78, "DisSort": null }, { "Id": 785, "DisName": "下城区", "CityID": 78, "DisSort": null }, { "Id": 786, "DisName": "江干区", "CityID": 78, "DisSort": null }, { "Id": 787, "DisName": "拱墅区", "CityID": 78, "DisSort": null }, { "Id": 788, "DisName": "西湖区", "CityID": 78, "DisSort": null }, { "Id": 789, "DisName": "滨江区", "CityID": 78, "DisSort": null }, { "Id": 790, "DisName": "余杭区", "CityID": 78, "DisSort": null }, { "Id": 791, "DisName": "桐庐县", "CityID": 78, "DisSort": null }, { "Id": 792, "DisName": "淳安县", "CityID": 78, "DisSort": null }, { "Id": 793, "DisName": "建德市", "CityID": 78, "DisSort": null }, { "Id": 794, "DisName": "富阳市", "CityID": 78, "DisSort": null }, { "Id": 795, "DisName": "临安市", "CityID": 78, "DisSort": null }, { "Id": 796, "DisName": "萧山区", "CityID": 78, "DisSort": null }, { "Id": 797, "DisName": "吴兴区", "CityID": 79, "DisSort": null }, { "Id": 798, "DisName": "南浔区", "CityID": 79, "DisSort": null }, { "Id": 799, "DisName": "德清县", "CityID": 79, "DisSort": null }, { "Id": 800, "DisName": "长兴县", "CityID": 79, "DisSort": null }, { "Id": 801, "DisName": "安吉县", "CityID": 79, "DisSort": null }, { "Id": 802, "DisName": " 南湖区", "CityID": 80, "DisSort": null }, { "Id": 803, "DisName": " 秀洲区", "CityID": 80, "DisSort": null }, { "Id": 804, "DisName": " 嘉善县", "CityID": 80, "DisSort": null }, { "Id": 805, "DisName": " 海盐县", "CityID": 80, "DisSort": null }, { "Id": 806, "DisName": " 海宁市", "CityID": 80, "DisSort": null }, { "Id": 807, "DisName": " 平湖市", "CityID": 80, "DisSort": null }, { "Id": 808, "DisName": " 桐乡市 ", "CityID": 80, "DisSort": null }, { "Id": 809, "DisName": "海曙区", "CityID": 81, "DisSort": null }, { "Id": 811, "DisName": "江北区", "CityID": 81, "DisSort": null }, { "Id": 812, "DisName": "北仑区", "CityID": 81, "DisSort": null }, { "Id": 813, "DisName": "镇海区", "CityID": 81, "DisSort": null }, { "Id": 814, "DisName": "鄞州区", "CityID": 81, "DisSort": null }, { "Id": 815, "DisName": "象山县", "CityID": 81, "DisSort": null }, { "Id": 816, "DisName": "宁海县", "CityID": 81, "DisSort": null }, { "Id": 817, "DisName": "余姚市", "CityID": 81, "DisSort": null }, { "Id": 818, "DisName": "慈溪市", "CityID": 81, "DisSort": null }, { "Id": 819, "DisName": "奉化区", "CityID": 81, "DisSort": null }, { "Id": 820, "DisName": "越城区", "CityID": 82, "DisSort": null }, { "Id": 821, "DisName": "绍兴县", "CityID": 82, "DisSort": null }, { "Id": 822, "DisName": "新昌县", "CityID": 82, "DisSort": null }, { "Id": 823, "DisName": "诸暨市", "CityID": 82, "DisSort": null }, { "Id": 824, "DisName": "上虞市", "CityID": 82, "DisSort": null }, { "Id": 825, "DisName": "嵊州市", "CityID": 82, "DisSort": null }, { "Id": 826, "DisName": "鹿城区", "CityID": 83, "DisSort": null }, { "Id": 827, "DisName": "龙湾区", "CityID": 83, "DisSort": null }, { "Id": 828, "DisName": "瓯海区", "CityID": 83, "DisSort": null }, { "Id": 829, "DisName": "洞头县", "CityID": 83, "DisSort": null }, { "Id": 830, "DisName": "永嘉县", "CityID": 83, "DisSort": null }, { "Id": 831, "DisName": "平阳县", "CityID": 83, "DisSort": null }, { "Id": 832, "DisName": "苍南县", "CityID": 83, "DisSort": null }, { "Id": 833, "DisName": "文成县", "CityID": 83, "DisSort": null }, { "Id": 834, "DisName": "泰顺县", "CityID": 83, "DisSort": null }, { "Id": 835, "DisName": "瑞安市", "CityID": 83, "DisSort": null }, { "Id": 836, "DisName": "乐清市", "CityID": 83, "DisSort": null }, { "Id": 837, "DisName": "莲都区", "CityID": 84, "DisSort": null }, { "Id": 838, "DisName": "青田县", "CityID": 84, "DisSort": null }, { "Id": 839, "DisName": "缙云县", "CityID": 84, "DisSort": null }, { "Id": 840, "DisName": "遂昌县", "CityID": 84, "DisSort": null }, { "Id": 841, "DisName": "松阳县", "CityID": 84, "DisSort": null }, { "Id": 842, "DisName": "云和县", "CityID": 84, "DisSort": null }, { "Id": 843, "DisName": "庆元县", "CityID": 84, "DisSort": null }, { "Id": 844, "DisName": "景宁畲族自治县", "CityID": 84, "DisSort": null }, { "Id": 845, "DisName": "龙泉市", "CityID": 84, "DisSort": null }, { "Id": 846, "DisName": "婺城区", "CityID": 85, "DisSort": null }, { "Id": 847, "DisName": "金东区", "CityID": 85, "DisSort": null }, { "Id": 848, "DisName": "武义县", "CityID": 85, "DisSort": null }, { "Id": 849, "DisName": "浦江县", "CityID": 85, "DisSort": null }, { "Id": 850, "DisName": "磐安县", "CityID": 85, "DisSort": null }, { "Id": 851, "DisName": "兰溪市", "CityID": 85, "DisSort": null }, { "Id": 852, "DisName": "义乌市", "CityID": 85, "DisSort": null }, { "Id": 853, "DisName": "东阳市", "CityID": 85, "DisSort": null }, { "Id": 854, "DisName": "永康市", "CityID": 85, "DisSort": null }, { "Id": 855, "DisName": "椒江区", "CityID": 86, "DisSort": null }, { "Id": 856, "DisName": "黄岩区", "CityID": 86, "DisSort": null }, { "Id": 857, "DisName": "路桥区", "CityID": 86, "DisSort": null }, { "Id": 858, "DisName": "玉环县", "CityID": 86, "DisSort": null }, { "Id": 859, "DisName": "三门县", "CityID": 86, "DisSort": null }, { "Id": 860, "DisName": "天台县", "CityID": 86, "DisSort": null }, { "Id": 861, "DisName": "仙居县", "CityID": 86, "DisSort": null }, { "Id": 862, "DisName": "温岭市", "CityID": 86, "DisSort": null }, { "Id": 863, "DisName": "临海市", "CityID": 86, "DisSort": null }, { "Id": 864, "DisName": "瑶海区", "CityID": 87, "DisSort": null }, { "Id": 865, "DisName": "庐阳区", "CityID": 87, "DisSort": null }, { "Id": 866, "DisName": "蜀山区", "CityID": 87, "DisSort": null }, { "Id": 867, "DisName": "包河区", "CityID": 87, "DisSort": null }, { "Id": 868, "DisName": "长丰县", "CityID": 87, "DisSort": null }, { "Id": 869, "DisName": "肥东县", "CityID": 87, "DisSort": null }, { "Id": 870, "DisName": "肥西县", "CityID": 87, "DisSort": null }, { "Id": 871, "DisName": "镜湖区", "CityID": 88, "DisSort": null }, { "Id": 872, "DisName": "弋江区", "CityID": 88, "DisSort": null }, { "Id": 873, "DisName": "鸠江区", "CityID": 88, "DisSort": null }, { "Id": 874, "DisName": "三山区", "CityID": 88, "DisSort": null }, { "Id": 875, "DisName": "芜湖县", "CityID": 88, "DisSort": null }, { "Id": 876, "DisName": "繁昌县", "CityID": 88, "DisSort": null }, { "Id": 877, "DisName": "南陵县", "CityID": 88, "DisSort": null }, { "Id": 878, "DisName": "龙子湖区", "CityID": 89, "DisSort": null }, { "Id": 879, "DisName": "蚌山区", "CityID": 89, "DisSort": null }, { "Id": 880, "DisName": "禹会区", "CityID": 89, "DisSort": null }, { "Id": 881, "DisName": "淮上区", "CityID": 89, "DisSort": null }, { "Id": 882, "DisName": "怀远县", "CityID": 89, "DisSort": null }, { "Id": 883, "DisName": "五河县", "CityID": 89, "DisSort": null }, { "Id": 884, "DisName": "固镇县", "CityID": 89, "DisSort": null }, { "Id": 885, "DisName": "大通区", "CityID": 90, "DisSort": null }, { "Id": 886, "DisName": "田家庵区", "CityID": 90, "DisSort": null }, { "Id": 887, "DisName": "谢家集区", "CityID": 90, "DisSort": null }, { "Id": 888, "DisName": "八公山区", "CityID": 90, "DisSort": null }, { "Id": 889, "DisName": "潘集区", "CityID": 90, "DisSort": null }, { "Id": 890, "DisName": "凤台县", "CityID": 90, "DisSort": null }, { "Id": 891, "DisName": "金家庄区", "CityID": 91, "DisSort": null }, { "Id": 892, "DisName": "花山区", "CityID": 91, "DisSort": null }, { "Id": 893, "DisName": "雨山区", "CityID": 91, "DisSort": null }, { "Id": 894, "DisName": "当涂县", "CityID": 91, "DisSort": null }, { "Id": 895, "DisName": "杜集区", "CityID": 92, "DisSort": null }, { "Id": 896, "DisName": "相山区", "CityID": 92, "DisSort": null }, { "Id": 897, "DisName": "烈山区", "CityID": 92, "DisSort": null }, { "Id": 898, "DisName": "濉溪县 ", "CityID": 92, "DisSort": null }, { "Id": 899, "DisName": "铜官山区", "CityID": 93, "DisSort": null }, { "Id": 900, "DisName": "狮子山区", "CityID": 93, "DisSort": null }, { "Id": 901, "DisName": "铜陵县", "CityID": 93, "DisSort": null }, { "Id": 902, "DisName": "迎江区", "CityID": 94, "DisSort": null }, { "Id": 903, "DisName": "大观区", "CityID": 94, "DisSort": null }, { "Id": 904, "DisName": "宜秀区", "CityID": 94, "DisSort": null }, { "Id": 905, "DisName": "怀宁县", "CityID": 94, "DisSort": null }, { "Id": 906, "DisName": "枞阳县", "CityID": 94, "DisSort": null }, { "Id": 907, "DisName": "潜山县", "CityID": 94, "DisSort": null }, { "Id": 908, "DisName": "太湖县", "CityID": 94, "DisSort": null }, { "Id": 909, "DisName": "宿松县", "CityID": 94, "DisSort": null }, { "Id": 910, "DisName": "望江县", "CityID": 94, "DisSort": null }, { "Id": 911, "DisName": "岳西县", "CityID": 94, "DisSort": null }, { "Id": 912, "DisName": "桐城市", "CityID": 94, "DisSort": null }, { "Id": 913, "DisName": "屯溪区", "CityID": 95, "DisSort": null }, { "Id": 914, "DisName": "黄山区", "CityID": 95, "DisSort": null }, { "Id": 915, "DisName": "徽州区", "CityID": 95, "DisSort": null }, { "Id": 916, "DisName": "歙县", "CityID": 95, "DisSort": null }, { "Id": 917, "DisName": "休宁县", "CityID": 95, "DisSort": null }, { "Id": 918, "DisName": "黟县", "CityID": 95, "DisSort": null }, { "Id": 919, "DisName": "祁门县", "CityID": 95, "DisSort": null }, { "Id": 920, "DisName": "琅琊区", "CityID": 96, "DisSort": null }, { "Id": 921, "DisName": "南谯区", "CityID": 96, "DisSort": null }, { "Id": 922, "DisName": "来安县", "CityID": 96, "DisSort": null }, { "Id": 923, "DisName": "全椒县", "CityID": 96, "DisSort": null }, { "Id": 924, "DisName": "定远县", "CityID": 96, "DisSort": null }, { "Id": 925, "DisName": "凤阳县", "CityID": 96, "DisSort": null }, { "Id": 926, "DisName": "天长市", "CityID": 96, "DisSort": null }, { "Id": 927, "DisName": "明光市", "CityID": 96, "DisSort": null }, { "Id": 928, "DisName": "颍州区", "CityID": 97, "DisSort": null }, { "Id": 929, "DisName": "颍东区", "CityID": 97, "DisSort": null }, { "Id": 930, "DisName": "颍泉区", "CityID": 97, "DisSort": null }, { "Id": 931, "DisName": "临泉县", "CityID": 97, "DisSort": null }, { "Id": 932, "DisName": "太和县", "CityID": 97, "DisSort": null }, { "Id": 933, "DisName": "阜南县", "CityID": 97, "DisSort": null }, { "Id": 934, "DisName": "颍上县", "CityID": 97, "DisSort": null }, { "Id": 935, "DisName": "界首市", "CityID": 97, "DisSort": null }, { "Id": 936, "DisName": "埇桥区", "CityID": 98, "DisSort": null }, { "Id": 937, "DisName": "砀山县", "CityID": 98, "DisSort": null }, { "Id": 938, "DisName": "萧县", "CityID": 98, "DisSort": null }, { "Id": 939, "DisName": "灵璧县", "CityID": 98, "DisSort": null }, { "Id": 940, "DisName": "泗县 ", "CityID": 98, "DisSort": null }, { "Id": 941, "DisName": "居巢区", "CityID": 99, "DisSort": null }, { "Id": 942, "DisName": "庐江县", "CityID": 99, "DisSort": null }, { "Id": 943, "DisName": "无为县", "CityID": 99, "DisSort": null }, { "Id": 944, "DisName": "含山县", "CityID": 99, "DisSort": null }, { "Id": 945, "DisName": "和县 ", "CityID": 99, "DisSort": null }, { "Id": 946, "DisName": "金安区", "CityID": 100, "DisSort": null }, { "Id": 947, "DisName": "裕安区", "CityID": 100, "DisSort": null }, { "Id": 948, "DisName": "寿县", "CityID": 100, "DisSort": null }, { "Id": 949, "DisName": "霍邱县", "CityID": 100, "DisSort": null }, { "Id": 950, "DisName": "舒城县", "CityID": 100, "DisSort": null }, { "Id": 951, "DisName": "金寨县", "CityID": 100, "DisSort": null }, { "Id": 952, "DisName": "霍山县", "CityID": 100, "DisSort": null }, { "Id": 953, "DisName": "谯城区", "CityID": 101, "DisSort": null }, { "Id": 954, "DisName": "涡阳县", "CityID": 101, "DisSort": null }, { "Id": 955, "DisName": "蒙城县", "CityID": 101, "DisSort": null }, { "Id": 956, "DisName": "利辛县", "CityID": 101, "DisSort": null }, { "Id": 957, "DisName": "贵池区", "CityID": 102, "DisSort": null }, { "Id": 958, "DisName": "东至县", "CityID": 102, "DisSort": null }, { "Id": 959, "DisName": "石台县", "CityID": 102, "DisSort": null }, { "Id": 960, "DisName": "青阳县", "CityID": 102, "DisSort": null }, { "Id": 961, "DisName": "宣州区", "CityID": 103, "DisSort": null }, { "Id": 962, "DisName": "郎溪县", "CityID": 103, "DisSort": null }, { "Id": 963, "DisName": "广德县", "CityID": 103, "DisSort": null }, { "Id": 964, "DisName": "泾县", "CityID": 103, "DisSort": null }, { "Id": 965, "DisName": "绩溪县", "CityID": 103, "DisSort": null }, { "Id": 966, "DisName": "旌德县", "CityID": 103, "DisSort": null }, { "Id": 967, "DisName": "宁国市", "CityID": 103, "DisSort": null }, { "Id": 968, "DisName": "鼓楼区", "CityID": 104, "DisSort": null }, { "Id": 969, "DisName": "台江区", "CityID": 104, "DisSort": null }, { "Id": 970, "DisName": "仓山区", "CityID": 104, "DisSort": null }, { "Id": 971, "DisName": "马尾区", "CityID": 104, "DisSort": null }, { "Id": 972, "DisName": "晋安区", "CityID": 104, "DisSort": null }, { "Id": 973, "DisName": "闽侯县", "CityID": 104, "DisSort": null }, { "Id": 974, "DisName": "连江县", "CityID": 104, "DisSort": null }, { "Id": 975, "DisName": "罗源县", "CityID": 104, "DisSort": null }, { "Id": 976, "DisName": "闽清县", "CityID": 104, "DisSort": null }, { "Id": 977, "DisName": "永泰县", "CityID": 104, "DisSort": null }, { "Id": 978, "DisName": "平潭县", "CityID": 104, "DisSort": null }, { "Id": 979, "DisName": "福清市", "CityID": 104, "DisSort": null }, { "Id": 980, "DisName": "长乐市", "CityID": 104, "DisSort": null }, { "Id": 981, "DisName": "思明区", "CityID": 105, "DisSort": null }, { "Id": 982, "DisName": "海沧区", "CityID": 105, "DisSort": null }, { "Id": 983, "DisName": "湖里区", "CityID": 105, "DisSort": null }, { "Id": 984, "DisName": "集美区", "CityID": 105, "DisSort": null }, { "Id": 985, "DisName": "同安区", "CityID": 105, "DisSort": null }, { "Id": 986, "DisName": "翔安区", "CityID": 105, "DisSort": null }, { "Id": 987, "DisName": "蕉城区", "CityID": 106, "DisSort": null }, { "Id": 988, "DisName": "霞浦县", "CityID": 106, "DisSort": null }, { "Id": 989, "DisName": "古田县", "CityID": 106, "DisSort": null }, { "Id": 990, "DisName": "屏南县", "CityID": 106, "DisSort": null }, { "Id": 991, "DisName": "寿宁县", "CityID": 106, "DisSort": null }, { "Id": 992, "DisName": "周宁县", "CityID": 106, "DisSort": null }, { "Id": 993, "DisName": "柘荣县", "CityID": 106, "DisSort": null }, { "Id": 994, "DisName": "福安市", "CityID": 106, "DisSort": null }, { "Id": 995, "DisName": "福鼎市", "CityID": 106, "DisSort": null }, { "Id": 996, "DisName": "城厢区", "CityID": 107, "DisSort": null }, { "Id": 997, "DisName": "涵江区", "CityID": 107, "DisSort": null }, { "Id": 998, "DisName": "荔城区", "CityID": 107, "DisSort": null }, { "Id": 999, "DisName": "秀屿区", "CityID": 107, "DisSort": null }, { "Id": 1000, "DisName": "仙游县", "CityID": 107, "DisSort": null }, { "Id": 1001, "DisName": "鲤城区", "CityID": 108, "DisSort": null }, { "Id": 1002, "DisName": "丰泽区", "CityID": 108, "DisSort": null }, { "Id": 1003, "DisName": "洛江区", "CityID": 108, "DisSort": null }, { "Id": 1004, "DisName": "泉港区", "CityID": 108, "DisSort": null }, { "Id": 1005, "DisName": "惠安县", "CityID": 108, "DisSort": null }, { "Id": 1006, "DisName": "安溪县", "CityID": 108, "DisSort": null }, { "Id": 1007, "DisName": "永春县", "CityID": 108, "DisSort": null }, { "Id": 1008, "DisName": "德化县", "CityID": 108, "DisSort": null }, { "Id": 1009, "DisName": "石狮市", "CityID": 108, "DisSort": null }, { "Id": 1010, "DisName": "晋江市", "CityID": 108, "DisSort": null }, { "Id": 1011, "DisName": "南安市", "CityID": 108, "DisSort": null }, { "Id": 1012, "DisName": "芗城区", "CityID": 109, "DisSort": null }, { "Id": 1013, "DisName": "龙文区", "CityID": 109, "DisSort": null }, { "Id": 1014, "DisName": "云霄县", "CityID": 109, "DisSort": null }, { "Id": 1015, "DisName": "漳浦县", "CityID": 109, "DisSort": null }, { "Id": 1016, "DisName": "诏安县", "CityID": 109, "DisSort": null }, { "Id": 1017, "DisName": "长泰县", "CityID": 109, "DisSort": null }, { "Id": 1018, "DisName": "东山县", "CityID": 109, "DisSort": null }, { "Id": 1019, "DisName": "南靖县", "CityID": 109, "DisSort": null }, { "Id": 1020, "DisName": "平和县", "CityID": 109, "DisSort": null }, { "Id": 1021, "DisName": "华安县", "CityID": 109, "DisSort": null }, { "Id": 1022, "DisName": "龙海市", "CityID": 109, "DisSort": null }, { "Id": 1023, "DisName": "新罗区", "CityID": 110, "DisSort": null }, { "Id": 1024, "DisName": "长汀县", "CityID": 110, "DisSort": null }, { "Id": 1025, "DisName": "永定县", "CityID": 110, "DisSort": null }, { "Id": 1026, "DisName": "上杭县", "CityID": 110, "DisSort": null }, { "Id": 1027, "DisName": "武平县", "CityID": 110, "DisSort": null }, { "Id": 1028, "DisName": "连城县", "CityID": 110, "DisSort": null }, { "Id": 1029, "DisName": "漳平市", "CityID": 110, "DisSort": null }, { "Id": 1030, "DisName": "梅列区", "CityID": 111, "DisSort": null }, { "Id": 1031, "DisName": "三元区", "CityID": 111, "DisSort": null }, { "Id": 1032, "DisName": "明溪县", "CityID": 111, "DisSort": null }, { "Id": 1033, "DisName": "清流县", "CityID": 111, "DisSort": null }, { "Id": 1034, "DisName": "宁化县", "CityID": 111, "DisSort": null }, { "Id": 1035, "DisName": "大田县", "CityID": 111, "DisSort": null }, { "Id": 1036, "DisName": "尤溪县", "CityID": 111, "DisSort": null }, { "Id": 1037, "DisName": "沙县", "CityID": 111, "DisSort": null }, { "Id": 1038, "DisName": "将乐县", "CityID": 111, "DisSort": null }, { "Id": 1039, "DisName": "泰宁县", "CityID": 111, "DisSort": null }, { "Id": 1040, "DisName": "建宁县", "CityID": 111, "DisSort": null }, { "Id": 1041, "DisName": "永安市", "CityID": 111, "DisSort": null }, { "Id": 1042, "DisName": "延平区", "CityID": 112, "DisSort": null }, { "Id": 1043, "DisName": "顺昌县", "CityID": 112, "DisSort": null }, { "Id": 1044, "DisName": "浦城县", "CityID": 112, "DisSort": null }, { "Id": 1045, "DisName": "光泽县", "CityID": 112, "DisSort": null }, { "Id": 1046, "DisName": "松溪县", "CityID": 112, "DisSort": null }, { "Id": 1047, "DisName": "政和县", "CityID": 112, "DisSort": null }, { "Id": 1048, "DisName": "邵武市", "CityID": 112, "DisSort": null }, { "Id": 1049, "DisName": "武夷山市", "CityID": 112, "DisSort": null }, { "Id": 1050, "DisName": "建瓯市", "CityID": 112, "DisSort": null }, { "Id": 1051, "DisName": "建阳市", "CityID": 112, "DisSort": null }, { "Id": 1052, "DisName": "月湖区", "CityID": 113, "DisSort": null }, { "Id": 1053, "DisName": "余江县", "CityID": 113, "DisSort": null }, { "Id": 1054, "DisName": "贵溪市", "CityID": 113, "DisSort": null }, { "Id": 1055, "DisName": "渝水区", "CityID": 114, "DisSort": null }, { "Id": 1056, "DisName": "分宜县", "CityID": 114, "DisSort": null }, { "Id": 1057, "DisName": "东湖区", "CityID": 115, "DisSort": null }, { "Id": 1058, "DisName": "西湖区", "CityID": 115, "DisSort": null }, { "Id": 1059, "DisName": "青云谱区", "CityID": 115, "DisSort": null }, { "Id": 1060, "DisName": "湾里区", "CityID": 115, "DisSort": null }, { "Id": 1061, "DisName": "青山湖区", "CityID": 115, "DisSort": null }, { "Id": 1062, "DisName": "南昌县", "CityID": 115, "DisSort": null }, { "Id": 1063, "DisName": "新建县", "CityID": 115, "DisSort": null }, { "Id": 1064, "DisName": "安义县", "CityID": 115, "DisSort": null }, { "Id": 1065, "DisName": "进贤县", "CityID": 115, "DisSort": null }, { "Id": 1066, "DisName": "庐山区", "CityID": 116, "DisSort": null }, { "Id": 1067, "DisName": "浔阳区", "CityID": 116, "DisSort": null }, { "Id": 1068, "DisName": "九江县", "CityID": 116, "DisSort": null }, { "Id": 1069, "DisName": "武宁县", "CityID": 116, "DisSort": null }, { "Id": 1070, "DisName": "修水县", "CityID": 116, "DisSort": null }, { "Id": 1071, "DisName": "永修县", "CityID": 116, "DisSort": null }, { "Id": 1072, "DisName": "德安县", "CityID": 116, "DisSort": null }, { "Id": 1073, "DisName": "星子县", "CityID": 116, "DisSort": null }, { "Id": 1074, "DisName": "都昌县", "CityID": 116, "DisSort": null }, { "Id": 1075, "DisName": "湖口县", "CityID": 116, "DisSort": null }, { "Id": 1076, "DisName": "彭泽县", "CityID": 116, "DisSort": null }, { "Id": 1077, "DisName": "瑞昌市", "CityID": 116, "DisSort": null }, { "Id": 1078, "DisName": "信州区", "CityID": 117, "DisSort": null }, { "Id": 1079, "DisName": "上饶县", "CityID": 117, "DisSort": null }, { "Id": 1080, "DisName": "广丰县", "CityID": 117, "DisSort": null }, { "Id": 1081, "DisName": "玉山县", "CityID": 117, "DisSort": null }, { "Id": 1082, "DisName": "铅山县", "CityID": 117, "DisSort": null }, { "Id": 1083, "DisName": "横峰县", "CityID": 117, "DisSort": null }, { "Id": 1084, "DisName": "弋阳县", "CityID": 117, "DisSort": null }, { "Id": 1085, "DisName": "余干县", "CityID": 117, "DisSort": null }, { "Id": 1086, "DisName": "鄱阳县", "CityID": 117, "DisSort": null }, { "Id": 1087, "DisName": "万年县", "CityID": 117, "DisSort": null }, { "Id": 1088, "DisName": "婺源县", "CityID": 117, "DisSort": null }, { "Id": 1089, "DisName": "德兴市", "CityID": 117, "DisSort": null }, { "Id": 1090, "DisName": "临川区", "CityID": 118, "DisSort": null }, { "Id": 1091, "DisName": "南城县", "CityID": 118, "DisSort": null }, { "Id": 1092, "DisName": "黎川县", "CityID": 118, "DisSort": null }, { "Id": 1093, "DisName": "南丰县", "CityID": 118, "DisSort": null }, { "Id": 1094, "DisName": "崇仁县", "CityID": 118, "DisSort": null }, { "Id": 1095, "DisName": "乐安县", "CityID": 118, "DisSort": null }, { "Id": 1096, "DisName": "宜黄县", "CityID": 118, "DisSort": null }, { "Id": 1097, "DisName": "金溪县", "CityID": 118, "DisSort": null }, { "Id": 1098, "DisName": "资溪县", "CityID": 118, "DisSort": null }, { "Id": 1099, "DisName": "东乡县", "CityID": 118, "DisSort": null }, { "Id": 1100, "DisName": "广昌县", "CityID": 118, "DisSort": null }, { "Id": 1101, "DisName": "袁州区", "CityID": 119, "DisSort": null }, { "Id": 1102, "DisName": "奉新县", "CityID": 119, "DisSort": null }, { "Id": 1103, "DisName": "万载县", "CityID": 119, "DisSort": null }, { "Id": 1104, "DisName": "上高县", "CityID": 119, "DisSort": null }, { "Id": 1105, "DisName": "宜丰县", "CityID": 119, "DisSort": null }, { "Id": 1106, "DisName": "靖安县", "CityID": 119, "DisSort": null }, { "Id": 1107, "DisName": "铜鼓县", "CityID": 119, "DisSort": null }, { "Id": 1108, "DisName": "丰城市", "CityID": 119, "DisSort": null }, { "Id": 1109, "DisName": "樟树市", "CityID": 119, "DisSort": null }, { "Id": 1110, "DisName": "高安市", "CityID": 119, "DisSort": null }, { "Id": 1111, "DisName": "吉州区", "CityID": 120, "DisSort": null }, { "Id": 1112, "DisName": "青原区", "CityID": 120, "DisSort": null }, { "Id": 1113, "DisName": "吉安县", "CityID": 120, "DisSort": null }, { "Id": 1114, "DisName": "吉水县", "CityID": 120, "DisSort": null }, { "Id": 1115, "DisName": "峡江县", "CityID": 120, "DisSort": null }, { "Id": 1116, "DisName": "新干县", "CityID": 120, "DisSort": null }, { "Id": 1117, "DisName": "永丰县", "CityID": 120, "DisSort": null }, { "Id": 1118, "DisName": "泰和县", "CityID": 120, "DisSort": null }, { "Id": 1119, "DisName": "遂川县", "CityID": 120, "DisSort": null }, { "Id": 1120, "DisName": "万安县", "CityID": 120, "DisSort": null }, { "Id": 1121, "DisName": "安福县", "CityID": 120, "DisSort": null }, { "Id": 1122, "DisName": "永新县", "CityID": 120, "DisSort": null }, { "Id": 1123, "DisName": "井冈山市", "CityID": 120, "DisSort": null }, { "Id": 1124, "DisName": "章贡区", "CityID": 121, "DisSort": null }, { "Id": 1125, "DisName": "赣县", "CityID": 121, "DisSort": null }, { "Id": 1126, "DisName": "信丰县", "CityID": 121, "DisSort": null }, { "Id": 1127, "DisName": "大余县", "CityID": 121, "DisSort": null }, { "Id": 1128, "DisName": "上犹县", "CityID": 121, "DisSort": null }, { "Id": 1129, "DisName": "崇义县", "CityID": 121, "DisSort": null }, { "Id": 1130, "DisName": "安远县", "CityID": 121, "DisSort": null }, { "Id": 1131, "DisName": "龙南县", "CityID": 121, "DisSort": null }, { "Id": 1132, "DisName": "定南县", "CityID": 121, "DisSort": null }, { "Id": 1133, "DisName": "全南县", "CityID": 121, "DisSort": null }, { "Id": 1134, "DisName": "宁都县", "CityID": 121, "DisSort": null }, { "Id": 1135, "DisName": "于都县", "CityID": 121, "DisSort": null }, { "Id": 1136, "DisName": "兴国县", "CityID": 121, "DisSort": null }, { "Id": 1137, "DisName": "会昌县", "CityID": 121, "DisSort": null }, { "Id": 1138, "DisName": "寻乌县", "CityID": 121, "DisSort": null }, { "Id": 1139, "DisName": "石城县", "CityID": 121, "DisSort": null }, { "Id": 1140, "DisName": "瑞金市", "CityID": 121, "DisSort": null }, { "Id": 1141, "DisName": "南康市", "CityID": 121, "DisSort": null }, { "Id": 1142, "DisName": "昌江区", "CityID": 122, "DisSort": null }, { "Id": 1143, "DisName": "珠山区", "CityID": 122, "DisSort": null }, { "Id": 1144, "DisName": "浮梁县", "CityID": 122, "DisSort": null }, { "Id": 1145, "DisName": "乐平市", "CityID": 122, "DisSort": null }, { "Id": 1146, "DisName": "安源区", "CityID": 123, "DisSort": null }, { "Id": 1147, "DisName": "湘东区", "CityID": 123, "DisSort": null }, { "Id": 1148, "DisName": "莲花县", "CityID": 123, "DisSort": null }, { "Id": 1149, "DisName": "上栗县", "CityID": 123, "DisSort": null }, { "Id": 1150, "DisName": "芦溪县", "CityID": 123, "DisSort": null }, { "Id": 1151, "DisName": "牡丹区", "CityID": 124, "DisSort": null }, { "Id": 1152, "DisName": "曹县", "CityID": 124, "DisSort": null }, { "Id": 1153, "DisName": "单县", "CityID": 124, "DisSort": null }, { "Id": 1154, "DisName": "成武县", "CityID": 124, "DisSort": null }, { "Id": 1155, "DisName": "巨野县", "CityID": 124, "DisSort": null }, { "Id": 1156, "DisName": "郓城县", "CityID": 124, "DisSort": null }, { "Id": 1157, "DisName": "鄄城县", "CityID": 124, "DisSort": null }, { "Id": 1158, "DisName": "定陶县", "CityID": 124, "DisSort": null }, { "Id": 1159, "DisName": "东明县", "CityID": 124, "DisSort": null }, { "Id": 1160, "DisName": "历下区", "CityID": 125, "DisSort": null }, { "Id": 1161, "DisName": "市中区", "CityID": 125, "DisSort": null }, { "Id": 1162, "DisName": "槐荫区", "CityID": 125, "DisSort": null }, { "Id": 1163, "DisName": "天桥区", "CityID": 125, "DisSort": null }, { "Id": 1164, "DisName": "历城区", "CityID": 125, "DisSort": null }, { "Id": 1165, "DisName": "长清区", "CityID": 125, "DisSort": null }, { "Id": 1166, "DisName": "平阴县", "CityID": 125, "DisSort": null }, { "Id": 1167, "DisName": "济阳县", "CityID": 125, "DisSort": null }, { "Id": 1168, "DisName": "商河县", "CityID": 125, "DisSort": null }, { "Id": 1169, "DisName": "章丘市", "CityID": 125, "DisSort": null }, { "Id": 1170, "DisName": "市南区", "CityID": 126, "DisSort": null }, { "Id": 1171, "DisName": "市北区", "CityID": 126, "DisSort": null }, { "Id": 1172, "DisName": "四方区", "CityID": 126, "DisSort": null }, { "Id": 1173, "DisName": "黄岛区", "CityID": 126, "DisSort": null }, { "Id": 1174, "DisName": "崂山区", "CityID": 126, "DisSort": null }, { "Id": 1175, "DisName": "李沧区", "CityID": 126, "DisSort": null }, { "Id": 1176, "DisName": "城阳区", "CityID": 126, "DisSort": null }, { "Id": 1177, "DisName": "胶州市", "CityID": 126, "DisSort": null }, { "Id": 1178, "DisName": "即墨市", "CityID": 126, "DisSort": null }, { "Id": 1179, "DisName": "平度市", "CityID": 126, "DisSort": null }, { "Id": 1180, "DisName": "胶南市", "CityID": 126, "DisSort": null }, { "Id": 1181, "DisName": "莱西市", "CityID": 126, "DisSort": null }, { "Id": 1182, "DisName": "淄川区", "CityID": 127, "DisSort": null }, { "Id": 1183, "DisName": "张店区", "CityID": 127, "DisSort": null }, { "Id": 1184, "DisName": "博山区", "CityID": 127, "DisSort": null }, { "Id": 1185, "DisName": "临淄区", "CityID": 127, "DisSort": null }, { "Id": 1186, "DisName": "周村区", "CityID": 127, "DisSort": null }, { "Id": 1187, "DisName": "桓台县", "CityID": 127, "DisSort": null }, { "Id": 1188, "DisName": "高青县", "CityID": 127, "DisSort": null }, { "Id": 1189, "DisName": "沂源县", "CityID": 127, "DisSort": null }, { "Id": 1190, "DisName": "德城区", "CityID": 128, "DisSort": null }, { "Id": 1191, "DisName": "陵县", "CityID": 128, "DisSort": null }, { "Id": 1192, "DisName": "宁津县", "CityID": 128, "DisSort": null }, { "Id": 1193, "DisName": "庆云县", "CityID": 128, "DisSort": null }, { "Id": 1194, "DisName": "临邑县", "CityID": 128, "DisSort": null }, { "Id": 1195, "DisName": "齐河县", "CityID": 128, "DisSort": null }, { "Id": 1196, "DisName": "平原县", "CityID": 128, "DisSort": null }, { "Id": 1197, "DisName": "夏津县", "CityID": 128, "DisSort": null }, { "Id": 1198, "DisName": "武城县", "CityID": 128, "DisSort": null }, { "Id": 1199, "DisName": "乐陵市", "CityID": 128, "DisSort": null }, { "Id": 1200, "DisName": "禹城市", "CityID": 128, "DisSort": null }, { "Id": 1201, "DisName": "芝罘区", "CityID": 129, "DisSort": null }, { "Id": 1202, "DisName": "福山区", "CityID": 129, "DisSort": null }, { "Id": 1203, "DisName": "牟平区", "CityID": 129, "DisSort": null }, { "Id": 1204, "DisName": "莱山区", "CityID": 129, "DisSort": null }, { "Id": 1205, "DisName": "长岛县", "CityID": 129, "DisSort": null }, { "Id": 1206, "DisName": "龙口市", "CityID": 129, "DisSort": null }, { "Id": 1207, "DisName": "莱阳市", "CityID": 129, "DisSort": null }, { "Id": 1208, "DisName": "莱州市", "CityID": 129, "DisSort": null }, { "Id": 1209, "DisName": "蓬莱市", "CityID": 129, "DisSort": null }, { "Id": 1210, "DisName": "招远市", "CityID": 129, "DisSort": null }, { "Id": 1211, "DisName": "栖霞市", "CityID": 129, "DisSort": null }, { "Id": 1212, "DisName": "海阳市", "CityID": 129, "DisSort": null }, { "Id": 1213, "DisName": "潍城区", "CityID": 130, "DisSort": null }, { "Id": 1214, "DisName": "寒亭区", "CityID": 130, "DisSort": null }, { "Id": 1215, "DisName": "坊子区", "CityID": 130, "DisSort": null }, { "Id": 1216, "DisName": "奎文区", "CityID": 130, "DisSort": null }, { "Id": 1217, "DisName": "临朐县", "CityID": 130, "DisSort": null }, { "Id": 1218, "DisName": "昌乐县", "CityID": 130, "DisSort": null }, { "Id": 1219, "DisName": "青州市", "CityID": 130, "DisSort": null }, { "Id": 1220, "DisName": "诸城市", "CityID": 130, "DisSort": null }, { "Id": 1221, "DisName": "寿光市", "CityID": 130, "DisSort": null }, { "Id": 1222, "DisName": "安丘市", "CityID": 130, "DisSort": null }, { "Id": 1223, "DisName": "高密市", "CityID": 130, "DisSort": null }, { "Id": 1224, "DisName": "昌邑市", "CityID": 130, "DisSort": null }, { "Id": 1225, "DisName": "市中区", "CityID": 131, "DisSort": null }, { "Id": 1226, "DisName": "任城区", "CityID": 131, "DisSort": null }, { "Id": 1227, "DisName": "微山县", "CityID": 131, "DisSort": null }, { "Id": 1228, "DisName": "鱼台县", "CityID": 131, "DisSort": null }, { "Id": 1229, "DisName": "金乡县", "CityID": 131, "DisSort": null }, { "Id": 1230, "DisName": "嘉祥县", "CityID": 131, "DisSort": null }, { "Id": 1231, "DisName": "汶上县", "CityID": 131, "DisSort": null }, { "Id": 1232, "DisName": "泗水县", "CityID": 131, "DisSort": null }, { "Id": 1233, "DisName": "梁山县", "CityID": 131, "DisSort": null }, { "Id": 1234, "DisName": "曲阜市", "CityID": 131, "DisSort": null }, { "Id": 1235, "DisName": "兖州市", "CityID": 131, "DisSort": null }, { "Id": 1236, "DisName": "邹城市", "CityID": 131, "DisSort": null }, { "Id": 1237, "DisName": "泰山区", "CityID": 132, "DisSort": null }, { "Id": 1238, "DisName": "岱岳区", "CityID": 132, "DisSort": null }, { "Id": 1239, "DisName": "宁阳县", "CityID": 132, "DisSort": null }, { "Id": 1240, "DisName": "东平县", "CityID": 132, "DisSort": null }, { "Id": 1241, "DisName": "新泰市", "CityID": 132, "DisSort": null }, { "Id": 1242, "DisName": "肥城市", "CityID": 132, "DisSort": null }, { "Id": 1243, "DisName": "兰山区", "CityID": 133, "DisSort": null }, { "Id": 1244, "DisName": "罗庄区", "CityID": 133, "DisSort": null }, { "Id": 1245, "DisName": "河东区", "CityID": 133, "DisSort": null }, { "Id": 1246, "DisName": "沂南县", "CityID": 133, "DisSort": null }, { "Id": 1247, "DisName": "郯城县", "CityID": 133, "DisSort": null }, { "Id": 1248, "DisName": "沂水县", "CityID": 133, "DisSort": null }, { "Id": 1249, "DisName": "苍山县", "CityID": 133, "DisSort": null }, { "Id": 1250, "DisName": "费县", "CityID": 133, "DisSort": null }, { "Id": 1251, "DisName": "平邑县", "CityID": 133, "DisSort": null }, { "Id": 1252, "DisName": "莒南县", "CityID": 133, "DisSort": null }, { "Id": 1253, "DisName": "蒙阴县", "CityID": 133, "DisSort": null }, { "Id": 1254, "DisName": "临沭县", "CityID": 133, "DisSort": null }, { "Id": 1255, "DisName": "滨城区", "CityID": 134, "DisSort": null }, { "Id": 1256, "DisName": "惠民县", "CityID": 134, "DisSort": null }, { "Id": 1257, "DisName": "阳信县", "CityID": 134, "DisSort": null }, { "Id": 1258, "DisName": "无棣县", "CityID": 134, "DisSort": null }, { "Id": 1259, "DisName": "沾化县", "CityID": 134, "DisSort": null }, { "Id": 1260, "DisName": "博兴县", "CityID": 134, "DisSort": null }, { "Id": 1261, "DisName": "邹平县", "CityID": 134, "DisSort": null }, { "Id": 1262, "DisName": "东营区", "CityID": 135, "DisSort": null }, { "Id": 1263, "DisName": "河口区", "CityID": 135, "DisSort": null }, { "Id": 1264, "DisName": "垦利县", "CityID": 135, "DisSort": null }, { "Id": 1265, "DisName": "利津县", "CityID": 135, "DisSort": null }, { "Id": 1266, "DisName": "广饶县", "CityID": 135, "DisSort": null }, { "Id": 1267, "DisName": "环翠区", "CityID": 136, "DisSort": null }, { "Id": 1268, "DisName": "文登市", "CityID": 136, "DisSort": null }, { "Id": 1269, "DisName": "荣成市", "CityID": 136, "DisSort": null }, { "Id": 1270, "DisName": "乳山市", "CityID": 136, "DisSort": null }, { "Id": 1271, "DisName": "市中区", "CityID": 137, "DisSort": null }, { "Id": 1272, "DisName": "薛城区", "CityID": 137, "DisSort": null }, { "Id": 1273, "DisName": "峄城区", "CityID": 137, "DisSort": null }, { "Id": 1274, "DisName": "台儿庄区", "CityID": 137, "DisSort": null }, { "Id": 1275, "DisName": "山亭区", "CityID": 137, "DisSort": null }, { "Id": 1276, "DisName": "滕州市", "CityID": 137, "DisSort": null }, { "Id": 1277, "DisName": "东港区", "CityID": 138, "DisSort": null }, { "Id": 1278, "DisName": "岚山区", "CityID": 138, "DisSort": null }, { "Id": 1279, "DisName": "五莲县", "CityID": 138, "DisSort": null }, { "Id": 1280, "DisName": "莒县", "CityID": 138, "DisSort": null }, { "Id": 1281, "DisName": "莱城区", "CityID": 139, "DisSort": null }, { "Id": 1282, "DisName": "钢城区", "CityID": 139, "DisSort": null }, { "Id": 1283, "DisName": "东昌府区", "CityID": 140, "DisSort": null }, { "Id": 1284, "DisName": "阳谷县", "CityID": 140, "DisSort": null }, { "Id": 1285, "DisName": "莘县", "CityID": 140, "DisSort": null }, { "Id": 1286, "DisName": "茌平县", "CityID": 140, "DisSort": null }, { "Id": 1287, "DisName": "东阿县", "CityID": 140, "DisSort": null }, { "Id": 1288, "DisName": "冠县", "CityID": 140, "DisSort": null }, { "Id": 1289, "DisName": "高唐县", "CityID": 140, "DisSort": null }, { "Id": 1290, "DisName": "临清市", "CityID": 140, "DisSort": null }, { "Id": 1291, "DisName": "梁园区", "CityID": 141, "DisSort": null }, { "Id": 1292, "DisName": "睢阳区", "CityID": 141, "DisSort": null }, { "Id": 1293, "DisName": "民权县", "CityID": 141, "DisSort": null }, { "Id": 1294, "DisName": "睢县", "CityID": 141, "DisSort": null }, { "Id": 1295, "DisName": "宁陵县", "CityID": 141, "DisSort": null }, { "Id": 1296, "DisName": "柘城县", "CityID": 141, "DisSort": null }, { "Id": 1297, "DisName": "虞城县", "CityID": 141, "DisSort": null }, { "Id": 1298, "DisName": "夏邑县", "CityID": 141, "DisSort": null }, { "Id": 1299, "DisName": "永城市", "CityID": 141, "DisSort": null }, { "Id": 1300, "DisName": "中原区", "CityID": 142, "DisSort": null }, { "Id": 1301, "DisName": "二七区", "CityID": 142, "DisSort": null }, { "Id": 1302, "DisName": "管城回族区", "CityID": 142, "DisSort": null }, { "Id": 1303, "DisName": "金水区", "CityID": 142, "DisSort": null }, { "Id": 1304, "DisName": "上街区", "CityID": 142, "DisSort": null }, { "Id": 1305, "DisName": "惠济区", "CityID": 142, "DisSort": null }, { "Id": 1306, "DisName": "中牟县", "CityID": 142, "DisSort": null }, { "Id": 1307, "DisName": "巩义市", "CityID": 142, "DisSort": null }, { "Id": 1308, "DisName": "荥阳市", "CityID": 142, "DisSort": null }, { "Id": 1309, "DisName": "新密市", "CityID": 142, "DisSort": null }, { "Id": 1310, "DisName": "新郑市", "CityID": 142, "DisSort": null }, { "Id": 1311, "DisName": "登封市", "CityID": 142, "DisSort": null }, { "Id": 1312, "DisName": "文峰区", "CityID": 143, "DisSort": null }, { "Id": 1313, "DisName": "北关区", "CityID": 143, "DisSort": null }, { "Id": 1314, "DisName": "殷都区", "CityID": 143, "DisSort": null }, { "Id": 1315, "DisName": "龙安区", "CityID": 143, "DisSort": null }, { "Id": 1316, "DisName": "安阳县", "CityID": 143, "DisSort": null }, { "Id": 1317, "DisName": "汤阴县", "CityID": 143, "DisSort": null }, { "Id": 1318, "DisName": "滑县", "CityID": 143, "DisSort": null }, { "Id": 1319, "DisName": "内黄县", "CityID": 143, "DisSort": null }, { "Id": 1320, "DisName": "林州市", "CityID": 143, "DisSort": null }, { "Id": 1321, "DisName": "红旗区", "CityID": 144, "DisSort": null }, { "Id": 1322, "DisName": "卫滨区", "CityID": 144, "DisSort": null }, { "Id": 1323, "DisName": "凤泉区", "CityID": 144, "DisSort": null }, { "Id": 1324, "DisName": "牧野区", "CityID": 144, "DisSort": null }, { "Id": 1325, "DisName": "新乡县", "CityID": 144, "DisSort": null }, { "Id": 1326, "DisName": "获嘉县", "CityID": 144, "DisSort": null }, { "Id": 1327, "DisName": "原阳县", "CityID": 144, "DisSort": null }, { "Id": 1328, "DisName": "延津县", "CityID": 144, "DisSort": null }, { "Id": 1329, "DisName": "封丘县", "CityID": 144, "DisSort": null }, { "Id": 1330, "DisName": "长垣县", "CityID": 144, "DisSort": null }, { "Id": 1331, "DisName": "卫辉市", "CityID": 144, "DisSort": null }, { "Id": 1332, "DisName": "辉县市", "CityID": 144, "DisSort": null }, { "Id": 1333, "DisName": "魏都区", "CityID": 145, "DisSort": null }, { "Id": 1334, "DisName": "许昌县", "CityID": 145, "DisSort": null }, { "Id": 1335, "DisName": "鄢陵县", "CityID": 145, "DisSort": null }, { "Id": 1336, "DisName": "襄城县", "CityID": 145, "DisSort": null }, { "Id": 1337, "DisName": "禹州市", "CityID": 145, "DisSort": null }, { "Id": 1338, "DisName": "长葛市", "CityID": 145, "DisSort": null }, { "Id": 1339, "DisName": "新华区", "CityID": 146, "DisSort": null }, { "Id": 1340, "DisName": "卫东区", "CityID": 146, "DisSort": null }, { "Id": 1341, "DisName": "石龙区", "CityID": 146, "DisSort": null }, { "Id": 1342, "DisName": "湛河区", "CityID": 146, "DisSort": null }, { "Id": 1343, "DisName": "宝丰县", "CityID": 146, "DisSort": null }, { "Id": 1344, "DisName": "叶县", "CityID": 146, "DisSort": null }, { "Id": 1345, "DisName": "鲁山县", "CityID": 146, "DisSort": null }, { "Id": 1346, "DisName": "郏县", "CityID": 146, "DisSort": null }, { "Id": 1347, "DisName": "舞钢市", "CityID": 146, "DisSort": null }, { "Id": 1348, "DisName": "汝州市", "CityID": 146, "DisSort": null }, { "Id": 1349, "DisName": "浉河区", "CityID": 147, "DisSort": null }, { "Id": 1350, "DisName": "平桥区", "CityID": 147, "DisSort": null }, { "Id": 1351, "DisName": "罗山县", "CityID": 147, "DisSort": null }, { "Id": 1352, "DisName": "光山县", "CityID": 147, "DisSort": null }, { "Id": 1353, "DisName": "新县", "CityID": 147, "DisSort": null }, { "Id": 1354, "DisName": "商城县", "CityID": 147, "DisSort": null }, { "Id": 1355, "DisName": "固始县", "CityID": 147, "DisSort": null }, { "Id": 1356, "DisName": "潢川县", "CityID": 147, "DisSort": null }, { "Id": 1357, "DisName": "淮滨县", "CityID": 147, "DisSort": null }, { "Id": 1358, "DisName": "息县", "CityID": 147, "DisSort": null }, { "Id": 1359, "DisName": "宛城区", "CityID": 148, "DisSort": null }, { "Id": 1360, "DisName": "卧龙区", "CityID": 148, "DisSort": null }, { "Id": 1361, "DisName": "南召县", "CityID": 148, "DisSort": null }, { "Id": 1362, "DisName": "方城县", "CityID": 148, "DisSort": null }, { "Id": 1363, "DisName": "西峡县", "CityID": 148, "DisSort": null }, { "Id": 1364, "DisName": "镇平县", "CityID": 148, "DisSort": null }, { "Id": 1365, "DisName": "内乡县", "CityID": 148, "DisSort": null }, { "Id": 1366, "DisName": "淅川县", "CityID": 148, "DisSort": null }, { "Id": 1367, "DisName": "社旗县", "CityID": 148, "DisSort": null }, { "Id": 1368, "DisName": "唐河县", "CityID": 148, "DisSort": null }, { "Id": 1369, "DisName": "新野县", "CityID": 148, "DisSort": null }, { "Id": 1370, "DisName": "桐柏县", "CityID": 148, "DisSort": null }, { "Id": 1371, "DisName": "邓州市", "CityID": 148, "DisSort": null }, { "Id": 1372, "DisName": "龙亭区", "CityID": 149, "DisSort": null }, { "Id": 1373, "DisName": "顺河回族区", "CityID": 149, "DisSort": null }, { "Id": 1374, "DisName": "鼓楼区", "CityID": 149, "DisSort": null }, { "Id": 1375, "DisName": "禹王台区", "CityID": 149, "DisSort": null }, { "Id": 1376, "DisName": "金明区", "CityID": 149, "DisSort": null }, { "Id": 1377, "DisName": "杞县", "CityID": 149, "DisSort": null }, { "Id": 1378, "DisName": "通许县", "CityID": 149, "DisSort": null }, { "Id": 1379, "DisName": "尉氏县", "CityID": 149, "DisSort": null }, { "Id": 1380, "DisName": "开封县", "CityID": 149, "DisSort": null }, { "Id": 1381, "DisName": "兰考县", "CityID": 149, "DisSort": null }, { "Id": 1382, "DisName": "老城区", "CityID": 150, "DisSort": null }, { "Id": 1383, "DisName": "西工区", "CityID": 150, "DisSort": null }, { "Id": 1384, "DisName": "瀍河回族区", "CityID": 150, "DisSort": null }, { "Id": 1385, "DisName": "涧西区", "CityID": 150, "DisSort": null }, { "Id": 1386, "DisName": "吉利区", "CityID": 150, "DisSort": null }, { "Id": 1387, "DisName": "洛龙区", "CityID": 150, "DisSort": null }, { "Id": 1388, "DisName": "孟津县", "CityID": 150, "DisSort": null }, { "Id": 1389, "DisName": "新安县", "CityID": 150, "DisSort": null }, { "Id": 1390, "DisName": "栾川县", "CityID": 150, "DisSort": null }, { "Id": 1391, "DisName": "嵩县", "CityID": 150, "DisSort": null }, { "Id": 1392, "DisName": "汝阳县", "CityID": 150, "DisSort": null }, { "Id": 1393, "DisName": "宜阳县", "CityID": 150, "DisSort": null }, { "Id": 1394, "DisName": "洛宁县", "CityID": 150, "DisSort": null }, { "Id": 1395, "DisName": "伊川县", "CityID": 150, "DisSort": null }, { "Id": 1396, "DisName": "偃师市", "CityID": 150, "DisSort": null }, { "Id": 1397, "DisName": "解放区", "CityID": 152, "DisSort": null }, { "Id": 1398, "DisName": "中站区", "CityID": 152, "DisSort": null }, { "Id": 1399, "DisName": "马村区", "CityID": 152, "DisSort": null }, { "Id": 1400, "DisName": "山阳区", "CityID": 152, "DisSort": null }, { "Id": 1401, "DisName": "修武县", "CityID": 152, "DisSort": null }, { "Id": 1402, "DisName": "博爱县", "CityID": 152, "DisSort": null }, { "Id": 1403, "DisName": "武陟县", "CityID": 152, "DisSort": null }, { "Id": 1404, "DisName": "温县", "CityID": 152, "DisSort": null }, { "Id": 1405, "DisName": "沁阳市", "CityID": 152, "DisSort": null }, { "Id": 1406, "DisName": "孟州市", "CityID": 152, "DisSort": null }, { "Id": 1407, "DisName": "鹤山区", "CityID": 153, "DisSort": null }, { "Id": 1408, "DisName": "山城区", "CityID": 153, "DisSort": null }, { "Id": 1409, "DisName": "淇滨区", "CityID": 153, "DisSort": null }, { "Id": 1410, "DisName": "浚县", "CityID": 153, "DisSort": null }, { "Id": 1411, "DisName": "淇县", "CityID": 153, "DisSort": null }, { "Id": 1412, "DisName": "华龙区", "CityID": 154, "DisSort": null }, { "Id": 1413, "DisName": "清丰县", "CityID": 154, "DisSort": null }, { "Id": 1414, "DisName": "南乐县", "CityID": 154, "DisSort": null }, { "Id": 1415, "DisName": "范县", "CityID": 154, "DisSort": null }, { "Id": 1416, "DisName": "台前县", "CityID": 154, "DisSort": null }, { "Id": 1417, "DisName": "濮阳县", "CityID": 154, "DisSort": null }, { "Id": 1418, "DisName": "川汇区", "CityID": 155, "DisSort": null }, { "Id": 1419, "DisName": "扶沟县", "CityID": 155, "DisSort": null }, { "Id": 1420, "DisName": "西华县", "CityID": 155, "DisSort": null }, { "Id": 1421, "DisName": "商水县", "CityID": 155, "DisSort": null }, { "Id": 1422, "DisName": "沈丘县", "CityID": 155, "DisSort": null }, { "Id": 1423, "DisName": "郸城县", "CityID": 155, "DisSort": null }, { "Id": 1424, "DisName": "淮阳县", "CityID": 155, "DisSort": null }, { "Id": 1425, "DisName": "太康县", "CityID": 155, "DisSort": null }, { "Id": 1426, "DisName": "鹿邑县", "CityID": 155, "DisSort": null }, { "Id": 1427, "DisName": "项城市", "CityID": 155, "DisSort": null }, { "Id": 1428, "DisName": "源汇区", "CityID": 156, "DisSort": null }, { "Id": 1429, "DisName": "郾城区", "CityID": 156, "DisSort": null }, { "Id": 1430, "DisName": "召陵区", "CityID": 156, "DisSort": null }, { "Id": 1431, "DisName": "舞阳县", "CityID": 156, "DisSort": null }, { "Id": 1432, "DisName": "临颍县", "CityID": 156, "DisSort": null }, { "Id": 1433, "DisName": "驿城区", "CityID": 157, "DisSort": null }, { "Id": 1434, "DisName": "西平县", "CityID": 157, "DisSort": null }, { "Id": 1435, "DisName": "上蔡县", "CityID": 157, "DisSort": null }, { "Id": 1436, "DisName": "平舆县", "CityID": 157, "DisSort": null }, { "Id": 1437, "DisName": "正阳县", "CityID": 157, "DisSort": null }, { "Id": 1438, "DisName": "确山县", "CityID": 157, "DisSort": null }, { "Id": 1439, "DisName": "泌阳县", "CityID": 157, "DisSort": null }, { "Id": 1440, "DisName": "汝南县", "CityID": 157, "DisSort": null }, { "Id": 1441, "DisName": "遂平县", "CityID": 157, "DisSort": null }, { "Id": 1442, "DisName": "新蔡县", "CityID": 157, "DisSort": null }, { "Id": 1443, "DisName": "湖滨区", "CityID": 158, "DisSort": null }, { "Id": 1444, "DisName": "渑池县", "CityID": 158, "DisSort": null }, { "Id": 1445, "DisName": "陕县", "CityID": 158, "DisSort": null }, { "Id": 1446, "DisName": "卢氏县", "CityID": 158, "DisSort": null }, { "Id": 1447, "DisName": "义马市", "CityID": 158, "DisSort": null }, { "Id": 1448, "DisName": "灵宝市", "CityID": 158, "DisSort": null }, { "Id": 1449, "DisName": "江岸区", "CityID": 159, "DisSort": null }, { "Id": 1450, "DisName": "江汉区", "CityID": 159, "DisSort": null }, { "Id": 1451, "DisName": "硚口区", "CityID": 159, "DisSort": null }, { "Id": 1452, "DisName": "汉阳区", "CityID": 159, "DisSort": null }, { "Id": 1453, "DisName": "武昌区", "CityID": 159, "DisSort": null }, { "Id": 1454, "DisName": "青山区", "CityID": 159, "DisSort": null }, { "Id": 1455, "DisName": "洪山区", "CityID": 159, "DisSort": null }, { "Id": 1456, "DisName": "东西湖区", "CityID": 159, "DisSort": null }, { "Id": 1457, "DisName": "汉南区", "CityID": 159, "DisSort": null }, { "Id": 1458, "DisName": "蔡甸区", "CityID": 159, "DisSort": null }, { "Id": 1459, "DisName": "江夏区", "CityID": 159, "DisSort": null }, { "Id": 1460, "DisName": "黄陂区", "CityID": 159, "DisSort": null }, { "Id": 1461, "DisName": "新洲区", "CityID": 159, "DisSort": null }, { "Id": 1462, "DisName": "襄城区", "CityID": 160, "DisSort": null }, { "Id": 1463, "DisName": "樊城区", "CityID": 160, "DisSort": null }, { "Id": 1464, "DisName": "襄阳区", "CityID": 160, "DisSort": null }, { "Id": 1465, "DisName": "南漳县", "CityID": 160, "DisSort": null }, { "Id": 1466, "DisName": "谷城县", "CityID": 160, "DisSort": null }, { "Id": 1467, "DisName": "保康县", "CityID": 160, "DisSort": null }, { "Id": 1468, "DisName": "老河口市", "CityID": 160, "DisSort": null }, { "Id": 1469, "DisName": "枣阳市", "CityID": 160, "DisSort": null }, { "Id": 1470, "DisName": "宜城市", "CityID": 160, "DisSort": null }, { "Id": 1471, "DisName": "梁子湖区", "CityID": 161, "DisSort": null }, { "Id": 1472, "DisName": "华容区", "CityID": 161, "DisSort": null }, { "Id": 1473, "DisName": "鄂城区", "CityID": 161, "DisSort": null }, { "Id": 1474, "DisName": "孝南区", "CityID": 162, "DisSort": null }, { "Id": 1475, "DisName": "孝昌县", "CityID": 162, "DisSort": null }, { "Id": 1476, "DisName": "大悟县", "CityID": 162, "DisSort": null }, { "Id": 1477, "DisName": "云梦县", "CityID": 162, "DisSort": null }, { "Id": 1478, "DisName": "应城市", "CityID": 162, "DisSort": null }, { "Id": 1479, "DisName": "安陆市", "CityID": 162, "DisSort": null }, { "Id": 1480, "DisName": "汉川市", "CityID": 162, "DisSort": null }, { "Id": 1481, "DisName": "黄州区", "CityID": 163, "DisSort": null }, { "Id": 1482, "DisName": "团风县", "CityID": 163, "DisSort": null }, { "Id": 1483, "DisName": "红安县", "CityID": 163, "DisSort": null }, { "Id": 1484, "DisName": "罗田县", "CityID": 163, "DisSort": null }, { "Id": 1485, "DisName": "英山县", "CityID": 163, "DisSort": null }, { "Id": 1486, "DisName": "浠水县", "CityID": 163, "DisSort": null }, { "Id": 1487, "DisName": "蕲春县", "CityID": 163, "DisSort": null }, { "Id": 1488, "DisName": "黄梅县", "CityID": 163, "DisSort": null }, { "Id": 1489, "DisName": "麻城市", "CityID": 163, "DisSort": null }, { "Id": 1490, "DisName": "武穴市", "CityID": 163, "DisSort": null }, { "Id": 1491, "DisName": "黄石港区", "CityID": 164, "DisSort": null }, { "Id": 1492, "DisName": "西塞山区", "CityID": 164, "DisSort": null }, { "Id": 1493, "DisName": "下陆区", "CityID": 164, "DisSort": null }, { "Id": 1494, "DisName": "铁山区", "CityID": 164, "DisSort": null }, { "Id": 1495, "DisName": "阳新县", "CityID": 164, "DisSort": null }, { "Id": 1496, "DisName": "大冶市", "CityID": 164, "DisSort": null }, { "Id": 1497, "DisName": "咸安区", "CityID": 165, "DisSort": null }, { "Id": 1498, "DisName": "嘉鱼县", "CityID": 165, "DisSort": null }, { "Id": 1499, "DisName": "通城县", "CityID": 165, "DisSort": null }, { "Id": 1500, "DisName": "崇阳县", "CityID": 165, "DisSort": null }, { "Id": 1501, "DisName": "通山县", "CityID": 165, "DisSort": null }, { "Id": 1502, "DisName": "赤壁市", "CityID": 165, "DisSort": null }, { "Id": 1503, "DisName": "沙市区", "CityID": 166, "DisSort": null }, { "Id": 1504, "DisName": "荆州区", "CityID": 166, "DisSort": null }, { "Id": 1505, "DisName": "公安县", "CityID": 166, "DisSort": null }, { "Id": 1506, "DisName": "监利县", "CityID": 166, "DisSort": null }, { "Id": 1507, "DisName": "江陵县", "CityID": 166, "DisSort": null }, { "Id": 1508, "DisName": "石首市", "CityID": 166, "DisSort": null }, { "Id": 1509, "DisName": "洪湖市", "CityID": 166, "DisSort": null }, { "Id": 1510, "DisName": "松滋市", "CityID": 166, "DisSort": null }, { "Id": 1511, "DisName": "西陵区", "CityID": 167, "DisSort": null }, { "Id": 1512, "DisName": "伍家岗区", "CityID": 167, "DisSort": null }, { "Id": 1513, "DisName": "点军区", "CityID": 167, "DisSort": null }, { "Id": 1514, "DisName": "猇亭区", "CityID": 167, "DisSort": null }, { "Id": 1515, "DisName": "夷陵区", "CityID": 167, "DisSort": null }, { "Id": 1516, "DisName": "远安县", "CityID": 167, "DisSort": null }, { "Id": 1517, "DisName": "兴山县", "CityID": 167, "DisSort": null }, { "Id": 1518, "DisName": "秭归县", "CityID": 167, "DisSort": null }, { "Id": 1519, "DisName": "长阳土家族自治县", "CityID": 167, "DisSort": null }, { "Id": 1520, "DisName": "五峰土家族自治县", "CityID": 167, "DisSort": null }, { "Id": 1521, "DisName": "宜都市", "CityID": 167, "DisSort": null }, { "Id": 1522, "DisName": "当阳市", "CityID": 167, "DisSort": null }, { "Id": 1523, "DisName": "枝江市", "CityID": 167, "DisSort": null }, { "Id": 1524, "DisName": "恩施市", "CityID": 168, "DisSort": null }, { "Id": 1525, "DisName": "利川市", "CityID": 168, "DisSort": null }, { "Id": 1526, "DisName": "建始县", "CityID": 168, "DisSort": null }, { "Id": 1527, "DisName": "巴东县", "CityID": 168, "DisSort": null }, { "Id": 1528, "DisName": "宣恩县", "CityID": 168, "DisSort": null }, { "Id": 1529, "DisName": "咸丰县", "CityID": 168, "DisSort": null }, { "Id": 1530, "DisName": "来凤县", "CityID": 168, "DisSort": null }, { "Id": 1531, "DisName": "鹤峰县", "CityID": 168, "DisSort": null }, { "Id": 1532, "DisName": "茅箭区", "CityID": 170, "DisSort": null }, { "Id": 1533, "DisName": "张湾区", "CityID": 170, "DisSort": null }, { "Id": 1534, "DisName": "郧县", "CityID": 170, "DisSort": null }, { "Id": 1535, "DisName": "郧西县", "CityID": 170, "DisSort": null }, { "Id": 1536, "DisName": "竹山县", "CityID": 170, "DisSort": null }, { "Id": 1537, "DisName": "竹溪县", "CityID": 170, "DisSort": null }, { "Id": 1538, "DisName": "房县", "CityID": 170, "DisSort": null }, { "Id": 1539, "DisName": "丹江口市", "CityID": 170, "DisSort": null }, { "Id": 1540, "DisName": "曾都区", "CityID": 171, "DisSort": null }, { "Id": 1541, "DisName": "广水市", "CityID": 171, "DisSort": null }, { "Id": 1542, "DisName": "东宝区", "CityID": 172, "DisSort": null }, { "Id": 1543, "DisName": "掇刀区", "CityID": 172, "DisSort": null }, { "Id": 1544, "DisName": "京山县", "CityID": 172, "DisSort": null }, { "Id": 1545, "DisName": "沙洋县", "CityID": 172, "DisSort": null }, { "Id": 1546, "DisName": "钟祥市", "CityID": 172, "DisSort": null }, { "Id": 1547, "DisName": "岳阳楼区", "CityID": 176, "DisSort": null }, { "Id": 1548, "DisName": "云溪区", "CityID": 176, "DisSort": null }, { "Id": 1549, "DisName": "君山区", "CityID": 176, "DisSort": null }, { "Id": 1550, "DisName": "岳阳县", "CityID": 176, "DisSort": null }, { "Id": 1551, "DisName": "华容县", "CityID": 176, "DisSort": null }, { "Id": 1552, "DisName": "湘阴县", "CityID": 176, "DisSort": null }, { "Id": 1553, "DisName": "平江县", "CityID": 176, "DisSort": null }, { "Id": 1554, "DisName": "汨罗市", "CityID": 176, "DisSort": null }, { "Id": 1555, "DisName": "临湘市", "CityID": 176, "DisSort": null }, { "Id": 1556, "DisName": "芙蓉区", "CityID": 177, "DisSort": null }, { "Id": 1557, "DisName": "天心区", "CityID": 177, "DisSort": null }, { "Id": 1558, "DisName": "岳麓区", "CityID": 177, "DisSort": null }, { "Id": 1559, "DisName": "开福区", "CityID": 177, "DisSort": null }, { "Id": 1560, "DisName": "雨花区", "CityID": 177, "DisSort": null }, { "Id": 1561, "DisName": "长沙县", "CityID": 177, "DisSort": null }, { "Id": 1562, "DisName": "望城县", "CityID": 177, "DisSort": null }, { "Id": 1563, "DisName": "宁乡县", "CityID": 177, "DisSort": null }, { "Id": 1564, "DisName": "浏阳市", "CityID": 177, "DisSort": null }, { "Id": 1565, "DisName": "雨湖区", "CityID": 178, "DisSort": null }, { "Id": 1566, "DisName": "岳塘区", "CityID": 178, "DisSort": null }, { "Id": 1567, "DisName": "湘潭县", "CityID": 178, "DisSort": null }, { "Id": 1568, "DisName": "湘乡市", "CityID": 178, "DisSort": null }, { "Id": 1569, "DisName": "韶山市", "CityID": 178, "DisSort": null }, { "Id": 1570, "DisName": "荷塘区", "CityID": 179, "DisSort": null }, { "Id": 1571, "DisName": "芦淞区", "CityID": 179, "DisSort": null }, { "Id": 1572, "DisName": "石峰区", "CityID": 179, "DisSort": null }, { "Id": 1573, "DisName": "天元区", "CityID": 179, "DisSort": null }, { "Id": 1574, "DisName": "株洲县", "CityID": 179, "DisSort": null }, { "Id": 1575, "DisName": "攸县", "CityID": 179, "DisSort": null }, { "Id": 1576, "DisName": "茶陵县", "CityID": 179, "DisSort": null }, { "Id": 1577, "DisName": "炎陵县", "CityID": 179, "DisSort": null }, { "Id": 1578, "DisName": "醴陵市", "CityID": 179, "DisSort": null }, { "Id": 1579, "DisName": "珠晖区", "CityID": 180, "DisSort": null }, { "Id": 1580, "DisName": "雁峰区", "CityID": 180, "DisSort": null }, { "Id": 1581, "DisName": "石鼓区", "CityID": 180, "DisSort": null }, { "Id": 1582, "DisName": "蒸湘区", "CityID": 180, "DisSort": null }, { "Id": 1583, "DisName": "南岳区", "CityID": 180, "DisSort": null }, { "Id": 1584, "DisName": "衡阳县", "CityID": 180, "DisSort": null }, { "Id": 1585, "DisName": "衡南县", "CityID": 180, "DisSort": null }, { "Id": 1586, "DisName": "衡山县", "CityID": 180, "DisSort": null }, { "Id": 1587, "DisName": "衡东县", "CityID": 180, "DisSort": null }, { "Id": 1588, "DisName": "祁东县", "CityID": 180, "DisSort": null }, { "Id": 1589, "DisName": "耒阳市", "CityID": 180, "DisSort": null }, { "Id": 1590, "DisName": "常宁市", "CityID": 180, "DisSort": null }, { "Id": 1591, "DisName": "北湖区", "CityID": 181, "DisSort": null }, { "Id": 1592, "DisName": "苏仙区", "CityID": 181, "DisSort": null }, { "Id": 1593, "DisName": "桂阳县", "CityID": 181, "DisSort": null }, { "Id": 1594, "DisName": "宜章县", "CityID": 181, "DisSort": null }, { "Id": 1595, "DisName": "永兴县", "CityID": 181, "DisSort": null }, { "Id": 1596, "DisName": "嘉禾县", "CityID": 181, "DisSort": null }, { "Id": 1597, "DisName": "临武县", "CityID": 181, "DisSort": null }, { "Id": 1598, "DisName": "汝城县", "CityID": 181, "DisSort": null }, { "Id": 1599, "DisName": "桂东县", "CityID": 181, "DisSort": null }, { "Id": 1600, "DisName": "安仁县", "CityID": 181, "DisSort": null }, { "Id": 1601, "DisName": "资兴市", "CityID": 181, "DisSort": null }, { "Id": 1602, "DisName": "武陵区", "CityID": 182, "DisSort": null }, { "Id": 1603, "DisName": "鼎城区", "CityID": 182, "DisSort": null }, { "Id": 1604, "DisName": "安乡县", "CityID": 182, "DisSort": null }, { "Id": 1605, "DisName": "汉寿县", "CityID": 182, "DisSort": null }, { "Id": 1606, "DisName": "澧县", "CityID": 182, "DisSort": null }, { "Id": 1607, "DisName": "临澧县", "CityID": 182, "DisSort": null }, { "Id": 1608, "DisName": "桃源县", "CityID": 182, "DisSort": null }, { "Id": 1609, "DisName": "石门县", "CityID": 182, "DisSort": null }, { "Id": 1610, "DisName": "津市市", "CityID": 182, "DisSort": null }, { "Id": 1611, "DisName": "资阳区", "CityID": 183, "DisSort": null }, { "Id": 1612, "DisName": "赫山区", "CityID": 183, "DisSort": null }, { "Id": 1613, "DisName": "南县", "CityID": 183, "DisSort": null }, { "Id": 1614, "DisName": "桃江县", "CityID": 183, "DisSort": null }, { "Id": 1615, "DisName": "安化县", "CityID": 183, "DisSort": null }, { "Id": 1616, "DisName": "沅江市", "CityID": 183, "DisSort": null }, { "Id": 1617, "DisName": "娄星区", "CityID": 184, "DisSort": null }, { "Id": 1618, "DisName": "双峰县", "CityID": 184, "DisSort": null }, { "Id": 1619, "DisName": "新化县", "CityID": 184, "DisSort": null }, { "Id": 1620, "DisName": "冷水江市", "CityID": 184, "DisSort": null }, { "Id": 1621, "DisName": "涟源市", "CityID": 184, "DisSort": null }, { "Id": 1622, "DisName": "双清区", "CityID": 185, "DisSort": null }, { "Id": 1623, "DisName": "大祥区", "CityID": 185, "DisSort": null }, { "Id": 1624, "DisName": "北塔区", "CityID": 185, "DisSort": null }, { "Id": 1625, "DisName": "邵东县", "CityID": 185, "DisSort": null }, { "Id": 1626, "DisName": "新邵县", "CityID": 185, "DisSort": null }, { "Id": 1627, "DisName": "邵阳县", "CityID": 185, "DisSort": null }, { "Id": 1628, "DisName": "隆回县", "CityID": 185, "DisSort": null }, { "Id": 1629, "DisName": "洞口县", "CityID": 185, "DisSort": null }, { "Id": 1630, "DisName": "绥宁县", "CityID": 185, "DisSort": null }, { "Id": 1631, "DisName": "新宁县", "CityID": 185, "DisSort": null }, { "Id": 1632, "DisName": "城步苗族自治县", "CityID": 185, "DisSort": null }, { "Id": 1633, "DisName": "武冈市", "CityID": 185, "DisSort": null }, { "Id": 1634, "DisName": "吉首市", "CityID": 186, "DisSort": null }, { "Id": 1635, "DisName": "泸溪县", "CityID": 186, "DisSort": null }, { "Id": 1636, "DisName": "凤凰县", "CityID": 186, "DisSort": null }, { "Id": 1637, "DisName": "花垣县", "CityID": 186, "DisSort": null }, { "Id": 1638, "DisName": "保靖县", "CityID": 186, "DisSort": null }, { "Id": 1639, "DisName": "古丈县", "CityID": 186, "DisSort": null }, { "Id": 1640, "DisName": "永顺县", "CityID": 186, "DisSort": null }, { "Id": 1641, "DisName": "龙山县", "CityID": 186, "DisSort": null }, { "Id": 1642, "DisName": "永定区", "CityID": 187, "DisSort": null }, { "Id": 1643, "DisName": "武陵源区", "CityID": 187, "DisSort": null }, { "Id": 1644, "DisName": "慈利县", "CityID": 187, "DisSort": null }, { "Id": 1645, "DisName": "桑植县", "CityID": 187, "DisSort": null }, { "Id": 1646, "DisName": "鹤城区", "CityID": 188, "DisSort": null }, { "Id": 1647, "DisName": "中方县", "CityID": 188, "DisSort": null }, { "Id": 1648, "DisName": "沅陵县", "CityID": 188, "DisSort": null }, { "Id": 1649, "DisName": "辰溪县", "CityID": 188, "DisSort": null }, { "Id": 1650, "DisName": "溆浦县", "CityID": 188, "DisSort": null }, { "Id": 1651, "DisName": "会同县", "CityID": 188, "DisSort": null }, { "Id": 1652, "DisName": "麻阳苗族自治县", "CityID": 188, "DisSort": null }, { "Id": 1653, "DisName": "新晃侗族自治县", "CityID": 188, "DisSort": null }, { "Id": 1654, "DisName": "芷江侗族自治县", "CityID": 188, "DisSort": null }, { "Id": 1655, "DisName": "靖州苗族侗族自治县", "CityID": 188, "DisSort": null }, { "Id": 1656, "DisName": "通道侗族自治县", "CityID": 188, "DisSort": null }, { "Id": 1657, "DisName": "洪江市", "CityID": 188, "DisSort": null }, { "Id": 1658, "DisName": "零陵区", "CityID": 189, "DisSort": null }, { "Id": 1659, "DisName": "冷水滩区", "CityID": 189, "DisSort": null }, { "Id": 1660, "DisName": "祁阳县", "CityID": 189, "DisSort": null }, { "Id": 1661, "DisName": "东安县", "CityID": 189, "DisSort": null }, { "Id": 1662, "DisName": "双牌县", "CityID": 189, "DisSort": null }, { "Id": 1663, "DisName": "道县", "CityID": 189, "DisSort": null }, { "Id": 1664, "DisName": "江永县", "CityID": 189, "DisSort": null }, { "Id": 1665, "DisName": "宁远县", "CityID": 189, "DisSort": null }, { "Id": 1666, "DisName": "蓝山县", "CityID": 189, "DisSort": null }, { "Id": 1667, "DisName": "新田县", "CityID": 189, "DisSort": null }, { "Id": 1668, "DisName": "江华瑶族自治县", "CityID": 189, "DisSort": null }, { "Id": 1669, "DisName": "从化市", "CityID": 190, "DisSort": null }, { "Id": 1670, "DisName": "荔湾区", "CityID": 190, "DisSort": null }, { "Id": 1671, "DisName": "越秀区", "CityID": 190, "DisSort": null }, { "Id": 1672, "DisName": "海珠区", "CityID": 190, "DisSort": null }, { "Id": 1673, "DisName": "天河区", "CityID": 190, "DisSort": null }, { "Id": 1674, "DisName": "白云区", "CityID": 190, "DisSort": null }, { "Id": 1675, "DisName": "花都区", "CityID": 190, "DisSort": null }, { "Id": 1676, "DisName": "黄埔区", "CityID": 190, "DisSort": null }, { "Id": 1677, "DisName": "萝岗区", "CityID": 190, "DisSort": null }, { "Id": 1678, "DisName": "南沙区", "CityID": 190, "DisSort": null }, { "Id": 1679, "DisName": "番禺区", "CityID": 190, "DisSort": null }, { "Id": 1680, "DisName": "增城市", "CityID": 190, "DisSort": null }, { "Id": 1681, "DisName": "海丰县", "CityID": 191, "DisSort": null }, { "Id": 1682, "DisName": "陆河县", "CityID": 191, "DisSort": null }, { "Id": 1683, "DisName": "陆丰市", "CityID": 191, "DisSort": null }, { "Id": 1684, "DisName": "江城区", "CityID": 192, "DisSort": null }, { "Id": 1685, "DisName": "阳西县", "CityID": 192, "DisSort": null }, { "Id": 1686, "DisName": "阳东县", "CityID": 192, "DisSort": null }, { "Id": 1687, "DisName": "阳春市", "CityID": 192, "DisSort": null }, { "Id": 1688, "DisName": "榕城区", "CityID": 193, "DisSort": null }, { "Id": 1689, "DisName": "揭东县", "CityID": 193, "DisSort": null }, { "Id": 1690, "DisName": "揭西县", "CityID": 193, "DisSort": null }, { "Id": 1691, "DisName": "惠来县", "CityID": 193, "DisSort": null }, { "Id": 1692, "DisName": "普宁市", "CityID": 193, "DisSort": null }, { "Id": 1693, "DisName": "茂南区", "CityID": 194, "DisSort": null }, { "Id": 1694, "DisName": "茂港区", "CityID": 194, "DisSort": null }, { "Id": 1695, "DisName": "电白县", "CityID": 194, "DisSort": null }, { "Id": 1696, "DisName": "高州市", "CityID": 194, "DisSort": null }, { "Id": 1697, "DisName": "化州市", "CityID": 194, "DisSort": null }, { "Id": 1698, "DisName": "信宜市", "CityID": 194, "DisSort": null }, { "Id": 1699, "DisName": "惠城区", "CityID": 195, "DisSort": null }, { "Id": 1700, "DisName": "惠阳区", "CityID": 195, "DisSort": null }, { "Id": 1701, "DisName": "博罗县", "CityID": 195, "DisSort": null }, { "Id": 1702, "DisName": "惠东县", "CityID": 195, "DisSort": null }, { "Id": 1703, "DisName": "龙门县", "CityID": 195, "DisSort": null }, { "Id": 1704, "DisName": "蓬江区", "CityID": 196, "DisSort": null }, { "Id": 1705, "DisName": "江海区", "CityID": 196, "DisSort": null }, { "Id": 1706, "DisName": "新会区", "CityID": 196, "DisSort": null }, { "Id": 1707, "DisName": "台山市", "CityID": 196, "DisSort": null }, { "Id": 1708, "DisName": "开平市", "CityID": 196, "DisSort": null }, { "Id": 1709, "DisName": "鹤山市", "CityID": 196, "DisSort": null }, { "Id": 1710, "DisName": "恩平市", "CityID": 196, "DisSort": null }, { "Id": 1711, "DisName": "武江区", "CityID": 197, "DisSort": null }, { "Id": 1712, "DisName": "浈江区", "CityID": 197, "DisSort": null }, { "Id": 1713, "DisName": "曲江区", "CityID": 197, "DisSort": null }, { "Id": 1714, "DisName": "始兴县", "CityID": 197, "DisSort": null }, { "Id": 1715, "DisName": "仁化县", "CityID": 197, "DisSort": null }, { "Id": 1716, "DisName": "翁源县", "CityID": 197, "DisSort": null }, { "Id": 1717, "DisName": "乳源瑶族自治县", "CityID": 197, "DisSort": null }, { "Id": 1718, "DisName": "新丰县", "CityID": 197, "DisSort": null }, { "Id": 1719, "DisName": "乐昌市", "CityID": 197, "DisSort": null }, { "Id": 1720, "DisName": "南雄市", "CityID": 197, "DisSort": null }, { "Id": 1721, "DisName": "梅江区", "CityID": 198, "DisSort": null }, { "Id": 1722, "DisName": "梅县", "CityID": 198, "DisSort": null }, { "Id": 1723, "DisName": "大埔县", "CityID": 198, "DisSort": null }, { "Id": 1724, "DisName": "丰顺县", "CityID": 198, "DisSort": null }, { "Id": 1725, "DisName": "五华县", "CityID": 198, "DisSort": null }, { "Id": 1726, "DisName": "平远县", "CityID": 198, "DisSort": null }, { "Id": 1727, "DisName": "蕉岭县", "CityID": 198, "DisSort": null }, { "Id": 1728, "DisName": "兴宁市", "CityID": 198, "DisSort": null }, { "Id": 1729, "DisName": "龙湖区", "CityID": 199, "DisSort": null }, { "Id": 1730, "DisName": "金平区", "CityID": 199, "DisSort": null }, { "Id": 1731, "DisName": "濠江区", "CityID": 199, "DisSort": null }, { "Id": 1732, "DisName": "潮阳区", "CityID": 199, "DisSort": null }, { "Id": 1733, "DisName": "潮南区", "CityID": 199, "DisSort": null }, { "Id": 1734, "DisName": "澄海区", "CityID": 199, "DisSort": null }, { "Id": 1735, "DisName": "南澳县", "CityID": 199, "DisSort": null }, { "Id": 1736, "DisName": "罗湖区", "CityID": 200, "DisSort": null }, { "Id": 1737, "DisName": "福田区", "CityID": 200, "DisSort": null }, { "Id": 1738, "DisName": "南山区", "CityID": 200, "DisSort": null }, { "Id": 1739, "DisName": "宝安区", "CityID": 200, "DisSort": null }, { "Id": 1740, "DisName": "龙岗区", "CityID": 200, "DisSort": null }, { "Id": 1741, "DisName": "盐田区", "CityID": 200, "DisSort": null }, { "Id": 1742, "DisName": "香洲区", "CityID": 201, "DisSort": null }, { "Id": 1743, "DisName": "斗门区", "CityID": 201, "DisSort": null }, { "Id": 1744, "DisName": "金湾区", "CityID": 201, "DisSort": null }, { "Id": 1745, "DisName": "禅城区", "CityID": 202, "DisSort": null }, { "Id": 1746, "DisName": "南海区", "CityID": 202, "DisSort": null }, { "Id": 1747, "DisName": "顺德区", "CityID": 202, "DisSort": null }, { "Id": 1748, "DisName": "三水区", "CityID": 202, "DisSort": null }, { "Id": 1749, "DisName": "高明区", "CityID": 202, "DisSort": null }, { "Id": 1750, "DisName": "端州区", "CityID": 203, "DisSort": null }, { "Id": 1751, "DisName": "鼎湖区", "CityID": 203, "DisSort": null }, { "Id": 1752, "DisName": "广宁县", "CityID": 203, "DisSort": null }, { "Id": 1753, "DisName": "怀集县", "CityID": 203, "DisSort": null }, { "Id": 1754, "DisName": "封开县", "CityID": 203, "DisSort": null }, { "Id": 1755, "DisName": "德庆县", "CityID": 203, "DisSort": null }, { "Id": 1756, "DisName": "高要市", "CityID": 203, "DisSort": null }, { "Id": 1757, "DisName": "四会市", "CityID": 203, "DisSort": null }, { "Id": 1758, "DisName": "赤坎区", "CityID": 204, "DisSort": null }, { "Id": 1759, "DisName": "霞山区", "CityID": 204, "DisSort": null }, { "Id": 1760, "DisName": "坡头区", "CityID": 204, "DisSort": null }, { "Id": 1761, "DisName": "麻章区", "CityID": 204, "DisSort": null }, { "Id": 1762, "DisName": "遂溪县", "CityID": 204, "DisSort": null }, { "Id": 1763, "DisName": "徐闻县", "CityID": 204, "DisSort": null }, { "Id": 1764, "DisName": "廉江市", "CityID": 204, "DisSort": null }, { "Id": 1765, "DisName": "雷州市", "CityID": 204, "DisSort": null }, { "Id": 1766, "DisName": "吴川市", "CityID": 204, "DisSort": null }, { "Id": 1767, "DisName": "源城区", "CityID": 206, "DisSort": null }, { "Id": 1768, "DisName": "紫金县", "CityID": 206, "DisSort": null }, { "Id": 1769, "DisName": "龙川县", "CityID": 206, "DisSort": null }, { "Id": 1770, "DisName": "连平县", "CityID": 206, "DisSort": null }, { "Id": 1771, "DisName": "和平县", "CityID": 206, "DisSort": null }, { "Id": 1772, "DisName": "东源县", "CityID": 206, "DisSort": null }, { "Id": 1773, "DisName": "清城区", "CityID": 207, "DisSort": null }, { "Id": 1774, "DisName": "佛冈县", "CityID": 207, "DisSort": null }, { "Id": 1775, "DisName": "阳山县", "CityID": 207, "DisSort": null }, { "Id": 1776, "DisName": "连山壮族瑶族自治县", "CityID": 207, "DisSort": null }, { "Id": 1777, "DisName": "连南瑶族自治县", "CityID": 207, "DisSort": null }, { "Id": 1778, "DisName": "清新县", "CityID": 207, "DisSort": null }, { "Id": 1779, "DisName": "英德市", "CityID": 207, "DisSort": null }, { "Id": 1780, "DisName": "连州市", "CityID": 207, "DisSort": null }, { "Id": 1781, "DisName": "云城区", "CityID": 208, "DisSort": null }, { "Id": 1782, "DisName": "新兴县", "CityID": 208, "DisSort": null }, { "Id": 1783, "DisName": "郁南县", "CityID": 208, "DisSort": null }, { "Id": 1784, "DisName": "云安县", "CityID": 208, "DisSort": null }, { "Id": 1785, "DisName": "罗定市", "CityID": 208, "DisSort": null }, { "Id": 1786, "DisName": "湘桥区", "CityID": 209, "DisSort": null }, { "Id": 1787, "DisName": "潮安县", "CityID": 209, "DisSort": null }, { "Id": 1788, "DisName": "饶平县", "CityID": 209, "DisSort": null }, { "Id": 1789, "DisName": "城关区", "CityID": 211, "DisSort": null }, { "Id": 1790, "DisName": "七里河区", "CityID": 211, "DisSort": null }, { "Id": 1791, "DisName": "西固区", "CityID": 211, "DisSort": null }, { "Id": 1792, "DisName": "安宁区", "CityID": 211, "DisSort": null }, { "Id": 1793, "DisName": "红古区", "CityID": 211, "DisSort": null }, { "Id": 1794, "DisName": "永登县", "CityID": 211, "DisSort": null }, { "Id": 1795, "DisName": "皋兰县", "CityID": 211, "DisSort": null }, { "Id": 1796, "DisName": "榆中县", "CityID": 211, "DisSort": null }, { "Id": 1797, "DisName": "金川区", "CityID": 212, "DisSort": null }, { "Id": 1798, "DisName": "永昌县", "CityID": 212, "DisSort": null }, { "Id": 1799, "DisName": "白银区", "CityID": 213, "DisSort": null }, { "Id": 1800, "DisName": "平川区", "CityID": 213, "DisSort": null }, { "Id": 1801, "DisName": "靖远县", "CityID": 213, "DisSort": null }, { "Id": 1802, "DisName": "会宁县", "CityID": 213, "DisSort": null }, { "Id": 1803, "DisName": "景泰县", "CityID": 213, "DisSort": null }, { "Id": 1804, "DisName": "秦州区", "CityID": 214, "DisSort": null }, { "Id": 1805, "DisName": "麦积区", "CityID": 214, "DisSort": null }, { "Id": 1806, "DisName": "清水县", "CityID": 214, "DisSort": null }, { "Id": 1807, "DisName": "秦安县", "CityID": 214, "DisSort": null }, { "Id": 1808, "DisName": "甘谷县", "CityID": 214, "DisSort": null }, { "Id": 1809, "DisName": "武山县", "CityID": 214, "DisSort": null }, { "Id": 1810, "DisName": "张家川回族自治县", "CityID": 214, "DisSort": null }, { "Id": 1811, "DisName": "凉州区", "CityID": 216, "DisSort": null }, { "Id": 1812, "DisName": "民勤县", "CityID": 216, "DisSort": null }, { "Id": 1813, "DisName": "古浪县", "CityID": 216, "DisSort": null }, { "Id": 1814, "DisName": "天祝藏族自治县", "CityID": 216, "DisSort": null }, { "Id": 1815, "DisName": "甘州区", "CityID": 217, "DisSort": null }, { "Id": 1816, "DisName": "肃南裕固族自治县", "CityID": 217, "DisSort": null }, { "Id": 1817, "DisName": "民乐县", "CityID": 217, "DisSort": null }, { "Id": 1818, "DisName": "临泽县", "CityID": 217, "DisSort": null }, { "Id": 1819, "DisName": "高台县", "CityID": 217, "DisSort": null }, { "Id": 1820, "DisName": "山丹县", "CityID": 217, "DisSort": null }, { "Id": 1821, "DisName": "崆峒区", "CityID": 218, "DisSort": null }, { "Id": 1822, "DisName": "泾川县", "CityID": 218, "DisSort": null }, { "Id": 1823, "DisName": "灵台县", "CityID": 218, "DisSort": null }, { "Id": 1824, "DisName": "崇信县", "CityID": 218, "DisSort": null }, { "Id": 1825, "DisName": "华亭县", "CityID": 218, "DisSort": null }, { "Id": 1826, "DisName": "庄浪县", "CityID": 218, "DisSort": null }, { "Id": 1827, "DisName": "静宁县", "CityID": 218, "DisSort": null }, { "Id": 1828, "DisName": "肃州区", "CityID": 219, "DisSort": null }, { "Id": 1829, "DisName": "金塔县", "CityID": 219, "DisSort": null }, { "Id": 1830, "DisName": "瓜州县", "CityID": 219, "DisSort": null }, { "Id": 1831, "DisName": "肃北蒙古族自治县", "CityID": 219, "DisSort": null }, { "Id": 1832, "DisName": "阿克塞哈萨克族自治县", "CityID": 219, "DisSort": null }, { "Id": 1833, "DisName": "玉门市", "CityID": 219, "DisSort": null }, { "Id": 1834, "DisName": "敦煌市", "CityID": 219, "DisSort": null }, { "Id": 1835, "DisName": "西峰区", "CityID": 220, "DisSort": null }, { "Id": 1836, "DisName": "庆城县", "CityID": 220, "DisSort": null }, { "Id": 1837, "DisName": "环县", "CityID": 220, "DisSort": null }, { "Id": 1838, "DisName": "华池县", "CityID": 220, "DisSort": null }, { "Id": 1839, "DisName": "合水县", "CityID": 220, "DisSort": null }, { "Id": 1840, "DisName": "正宁县", "CityID": 220, "DisSort": null }, { "Id": 1841, "DisName": "宁县", "CityID": 220, "DisSort": null }, { "Id": 1842, "DisName": "镇原县", "CityID": 220, "DisSort": null }, { "Id": 1843, "DisName": "安定区", "CityID": 221, "DisSort": null }, { "Id": 1844, "DisName": "通渭县", "CityID": 221, "DisSort": null }, { "Id": 1845, "DisName": "陇西县", "CityID": 221, "DisSort": null }, { "Id": 1846, "DisName": "渭源县", "CityID": 221, "DisSort": null }, { "Id": 1847, "DisName": "临洮县", "CityID": 221, "DisSort": null }, { "Id": 1848, "DisName": "漳县", "CityID": 221, "DisSort": null }, { "Id": 1849, "DisName": "岷县", "CityID": 221, "DisSort": null }, { "Id": 1850, "DisName": "武都区", "CityID": 222, "DisSort": null }, { "Id": 1851, "DisName": "成县", "CityID": 222, "DisSort": null }, { "Id": 1852, "DisName": "文县", "CityID": 222, "DisSort": null }, { "Id": 1853, "DisName": "宕昌县", "CityID": 222, "DisSort": null }, { "Id": 1854, "DisName": "康县", "CityID": 222, "DisSort": null }, { "Id": 1855, "DisName": "西和县", "CityID": 222, "DisSort": null }, { "Id": 1856, "DisName": "礼县", "CityID": 222, "DisSort": null }, { "Id": 1857, "DisName": "徽县", "CityID": 222, "DisSort": null }, { "Id": 1858, "DisName": "两当县", "CityID": 222, "DisSort": null }, { "Id": 1859, "DisName": "临夏市", "CityID": 223, "DisSort": null }, { "Id": 1860, "DisName": "临夏县", "CityID": 223, "DisSort": null }, { "Id": 1861, "DisName": "康乐县", "CityID": 223, "DisSort": null }, { "Id": 1862, "DisName": "永靖县", "CityID": 223, "DisSort": null }, { "Id": 1863, "DisName": "广河县", "CityID": 223, "DisSort": null }, { "Id": 1864, "DisName": "和政县", "CityID": 223, "DisSort": null }, { "Id": 1865, "DisName": "东乡族自治县", "CityID": 223, "DisSort": null }, { "Id": 1866, "DisName": "积石山保安族东乡族撒拉族自治县", "CityID": 223, "DisSort": null }, { "Id": 1867, "DisName": "合作市", "CityID": 224, "DisSort": null }, { "Id": 1868, "DisName": "临潭县", "CityID": 224, "DisSort": null }, { "Id": 1869, "DisName": "卓尼县", "CityID": 224, "DisSort": null }, { "Id": 1870, "DisName": "舟曲县", "CityID": 224, "DisSort": null }, { "Id": 1871, "DisName": "迭部县", "CityID": 224, "DisSort": null }, { "Id": 1872, "DisName": "玛曲县", "CityID": 224, "DisSort": null }, { "Id": 1873, "DisName": "碌曲县", "CityID": 224, "DisSort": null }, { "Id": 1874, "DisName": "夏河县", "CityID": 224, "DisSort": null }, { "Id": 1875, "DisName": "锦江区", "CityID": 225, "DisSort": null }, { "Id": 1876, "DisName": "青羊区", "CityID": 225, "DisSort": null }, { "Id": 1877, "DisName": "金牛区", "CityID": 225, "DisSort": null }, { "Id": 1878, "DisName": "武侯区", "CityID": 225, "DisSort": null }, { "Id": 1879, "DisName": "成华区", "CityID": 225, "DisSort": null }, { "Id": 1880, "DisName": "龙泉驿区", "CityID": 225, "DisSort": null }, { "Id": 1881, "DisName": "青白江区", "CityID": 225, "DisSort": null }, { "Id": 1882, "DisName": "新都区", "CityID": 225, "DisSort": null }, { "Id": 1883, "DisName": "温江区", "CityID": 225, "DisSort": null }, { "Id": 1884, "DisName": "金堂县", "CityID": 225, "DisSort": null }, { "Id": 1885, "DisName": "双流县", "CityID": 225, "DisSort": null }, { "Id": 1886, "DisName": "郫县", "CityID": 225, "DisSort": null }, { "Id": 1887, "DisName": "大邑县", "CityID": 225, "DisSort": null }, { "Id": 1888, "DisName": "蒲江县", "CityID": 225, "DisSort": null }, { "Id": 1889, "DisName": "新津县", "CityID": 225, "DisSort": null }, { "Id": 1890, "DisName": "都江堰市", "CityID": 225, "DisSort": null }, { "Id": 1891, "DisName": "彭州市", "CityID": 225, "DisSort": null }, { "Id": 1892, "DisName": "邛崃市", "CityID": 225, "DisSort": null }, { "Id": 1893, "DisName": "崇州市", "CityID": 225, "DisSort": null }, { "Id": 1894, "DisName": "东区", "CityID": 226, "DisSort": null }, { "Id": 1895, "DisName": "西区", "CityID": 226, "DisSort": null }, { "Id": 1896, "DisName": "仁和区", "CityID": 226, "DisSort": null }, { "Id": 1897, "DisName": "米易县", "CityID": 226, "DisSort": null }, { "Id": 1898, "DisName": "盐边县", "CityID": 226, "DisSort": null }, { "Id": 1899, "DisName": "自流井区", "CityID": 227, "DisSort": null }, { "Id": 1900, "DisName": "贡井区", "CityID": 227, "DisSort": null }, { "Id": 1901, "DisName": "大安区", "CityID": 227, "DisSort": null }, { "Id": 1902, "DisName": "沿滩区", "CityID": 227, "DisSort": null }, { "Id": 1903, "DisName": "荣县", "CityID": 227, "DisSort": null }, { "Id": 1904, "DisName": "富顺县", "CityID": 227, "DisSort": null }, { "Id": 1905, "DisName": "涪城区", "CityID": 228, "DisSort": null }, { "Id": 1906, "DisName": "游仙区", "CityID": 228, "DisSort": null }, { "Id": 1907, "DisName": "三台县", "CityID": 228, "DisSort": null }, { "Id": 1908, "DisName": "盐亭县", "CityID": 228, "DisSort": null }, { "Id": 1909, "DisName": "安县", "CityID": 228, "DisSort": null }, { "Id": 1910, "DisName": "梓潼县", "CityID": 228, "DisSort": null }, { "Id": 1911, "DisName": "北川羌族自治县", "CityID": 228, "DisSort": null }, { "Id": 1912, "DisName": "平武县", "CityID": 228, "DisSort": null }, { "Id": 1913, "DisName": "江油市", "CityID": 228, "DisSort": null }, { "Id": 1914, "DisName": "顺庆区", "CityID": 229, "DisSort": null }, { "Id": 1915, "DisName": "高坪区", "CityID": 229, "DisSort": null }, { "Id": 1916, "DisName": "嘉陵区", "CityID": 229, "DisSort": null }, { "Id": 1917, "DisName": "南部县", "CityID": 229, "DisSort": null }, { "Id": 1918, "DisName": "营山县", "CityID": 229, "DisSort": null }, { "Id": 1919, "DisName": "蓬安县", "CityID": 229, "DisSort": null }, { "Id": 1920, "DisName": "仪陇县", "CityID": 229, "DisSort": null }, { "Id": 1921, "DisName": "西充县", "CityID": 229, "DisSort": null }, { "Id": 1922, "DisName": "阆中市", "CityID": 229, "DisSort": null }, { "Id": 1923, "DisName": "通川区", "CityID": 230, "DisSort": null }, { "Id": 1924, "DisName": "达县", "CityID": 230, "DisSort": null }, { "Id": 1925, "DisName": "宣汉县", "CityID": 230, "DisSort": null }, { "Id": 1926, "DisName": "开江县", "CityID": 230, "DisSort": null }, { "Id": 1927, "DisName": "大竹县", "CityID": 230, "DisSort": null }, { "Id": 1928, "DisName": "渠县", "CityID": 230, "DisSort": null }, { "Id": 1929, "DisName": "万源市", "CityID": 230, "DisSort": null }, { "Id": 1930, "DisName": "船山区", "CityID": 231, "DisSort": null }, { "Id": 1931, "DisName": "安居区", "CityID": 231, "DisSort": null }, { "Id": 1932, "DisName": "蓬溪县", "CityID": 231, "DisSort": null }, { "Id": 1933, "DisName": "射洪县", "CityID": 231, "DisSort": null }, { "Id": 1934, "DisName": "大英县", "CityID": 231, "DisSort": null }, { "Id": 1935, "DisName": "广安区", "CityID": 232, "DisSort": null }, { "Id": 1936, "DisName": "岳池县", "CityID": 232, "DisSort": null }, { "Id": 1937, "DisName": "武胜县", "CityID": 232, "DisSort": null }, { "Id": 1938, "DisName": "邻水县", "CityID": 232, "DisSort": null }, { "Id": 1939, "DisName": "华蓥市", "CityID": 232, "DisSort": null }, { "Id": 1940, "DisName": "巴州区", "CityID": 233, "DisSort": null }, { "Id": 1941, "DisName": "通江县", "CityID": 233, "DisSort": null }, { "Id": 1942, "DisName": "南江县", "CityID": 233, "DisSort": null }, { "Id": 1943, "DisName": "平昌县", "CityID": 233, "DisSort": null }, { "Id": 1944, "DisName": "江阳区", "CityID": 234, "DisSort": null }, { "Id": 1945, "DisName": "纳溪区", "CityID": 234, "DisSort": null }, { "Id": 1946, "DisName": "龙马潭区", "CityID": 234, "DisSort": null }, { "Id": 1947, "DisName": "泸县", "CityID": 234, "DisSort": null }, { "Id": 1948, "DisName": "合江县", "CityID": 234, "DisSort": null }, { "Id": 1949, "DisName": "叙永县", "CityID": 234, "DisSort": null }, { "Id": 1950, "DisName": "古蔺县", "CityID": 234, "DisSort": null }, { "Id": 1951, "DisName": "翠屏区", "CityID": 235, "DisSort": null }, { "Id": 1952, "DisName": "宜宾县", "CityID": 235, "DisSort": null }, { "Id": 1953, "DisName": "南溪县", "CityID": 235, "DisSort": null }, { "Id": 1954, "DisName": "江安县", "CityID": 235, "DisSort": null }, { "Id": 1955, "DisName": "长宁县", "CityID": 235, "DisSort": null }, { "Id": 1956, "DisName": "高县", "CityID": 235, "DisSort": null }, { "Id": 1957, "DisName": "珙县", "CityID": 235, "DisSort": null }, { "Id": 1958, "DisName": "筠连县", "CityID": 235, "DisSort": null }, { "Id": 1959, "DisName": "兴文县", "CityID": 235, "DisSort": null }, { "Id": 1960, "DisName": "屏山县", "CityID": 235, "DisSort": null }, { "Id": 1961, "DisName": "雁江区", "CityID": 236, "DisSort": null }, { "Id": 1962, "DisName": "安岳县", "CityID": 236, "DisSort": null }, { "Id": 1963, "DisName": "乐至县", "CityID": 236, "DisSort": null }, { "Id": 1964, "DisName": "简阳市", "CityID": 236, "DisSort": null }, { "Id": 1965, "DisName": "市中区", "CityID": 237, "DisSort": null }, { "Id": 1966, "DisName": "东兴区", "CityID": 237, "DisSort": null }, { "Id": 1967, "DisName": "威远县", "CityID": 237, "DisSort": null }, { "Id": 1968, "DisName": "资中县", "CityID": 237, "DisSort": null }, { "Id": 1969, "DisName": "隆昌县", "CityID": 237, "DisSort": null }, { "Id": 1970, "DisName": "市中区", "CityID": 238, "DisSort": null }, { "Id": 1971, "DisName": "沙湾区", "CityID": 238, "DisSort": null }, { "Id": 1972, "DisName": "五通桥区", "CityID": 238, "DisSort": null }, { "Id": 1973, "DisName": "金口河区", "CityID": 238, "DisSort": null }, { "Id": 1974, "DisName": "犍为县", "CityID": 238, "DisSort": null }, { "Id": 1975, "DisName": "井研县", "CityID": 238, "DisSort": null }, { "Id": 1976, "DisName": "夹江县", "CityID": 238, "DisSort": null }, { "Id": 1977, "DisName": "沐川县", "CityID": 238, "DisSort": null }, { "Id": 1978, "DisName": "峨边彝族自治县", "CityID": 238, "DisSort": null }, { "Id": 1979, "DisName": "马边彝族自治县", "CityID": 238, "DisSort": null }, { "Id": 1980, "DisName": "峨眉山市", "CityID": 238, "DisSort": null }, { "Id": 1981, "DisName": "东坡区", "CityID": 239, "DisSort": null }, { "Id": 1982, "DisName": "仁寿县", "CityID": 239, "DisSort": null }, { "Id": 1983, "DisName": "彭山县", "CityID": 239, "DisSort": null }, { "Id": 1984, "DisName": "洪雅县", "CityID": 239, "DisSort": null }, { "Id": 1985, "DisName": "丹棱县", "CityID": 239, "DisSort": null }, { "Id": 1986, "DisName": "青神县", "CityID": 239, "DisSort": null }, { "Id": 1987, "DisName": "西昌市", "CityID": 240, "DisSort": null }, { "Id": 1988, "DisName": "木里藏族自治县", "CityID": 240, "DisSort": null }, { "Id": 1989, "DisName": "盐源县", "CityID": 240, "DisSort": null }, { "Id": 1990, "DisName": "德昌县", "CityID": 240, "DisSort": null }, { "Id": 1991, "DisName": "会理县", "CityID": 240, "DisSort": null }, { "Id": 1992, "DisName": "会东县", "CityID": 240, "DisSort": null }, { "Id": 1993, "DisName": "宁南县", "CityID": 240, "DisSort": null }, { "Id": 1994, "DisName": "普格县", "CityID": 240, "DisSort": null }, { "Id": 1995, "DisName": "布拖县", "CityID": 240, "DisSort": null }, { "Id": 1996, "DisName": "金阳县", "CityID": 240, "DisSort": null }, { "Id": 1997, "DisName": "昭觉县", "CityID": 240, "DisSort": null }, { "Id": 1998, "DisName": "喜德县", "CityID": 240, "DisSort": null }, { "Id": 1999, "DisName": "冕宁县", "CityID": 240, "DisSort": null }, { "Id": 2000, "DisName": "越西县", "CityID": 240, "DisSort": null }, { "Id": 2001, "DisName": "甘洛县", "CityID": 240, "DisSort": null }, { "Id": 2002, "DisName": "美姑县", "CityID": 240, "DisSort": null }, { "Id": 2003, "DisName": "雷波县", "CityID": 240, "DisSort": null }, { "Id": 2004, "DisName": "雨城区", "CityID": 241, "DisSort": null }, { "Id": 2005, "DisName": "名山县", "CityID": 241, "DisSort": null }, { "Id": 2006, "DisName": "荥经县", "CityID": 241, "DisSort": null }, { "Id": 2007, "DisName": "汉源县", "CityID": 241, "DisSort": null }, { "Id": 2008, "DisName": "石棉县", "CityID": 241, "DisSort": null }, { "Id": 2009, "DisName": "天全县", "CityID": 241, "DisSort": null }, { "Id": 2010, "DisName": "芦山县", "CityID": 241, "DisSort": null }, { "Id": 2011, "DisName": "宝兴县", "CityID": 241, "DisSort": null }, { "Id": 2012, "DisName": "康定县", "CityID": 242, "DisSort": null }, { "Id": 2013, "DisName": "泸定县", "CityID": 242, "DisSort": null }, { "Id": 2014, "DisName": "丹巴县", "CityID": 242, "DisSort": null }, { "Id": 2015, "DisName": "九龙县", "CityID": 242, "DisSort": null }, { "Id": 2016, "DisName": "雅江县", "CityID": 242, "DisSort": null }, { "Id": 2017, "DisName": "道孚县", "CityID": 242, "DisSort": null }, { "Id": 2018, "DisName": "炉霍县", "CityID": 242, "DisSort": null }, { "Id": 2019, "DisName": "甘孜县", "CityID": 242, "DisSort": null }, { "Id": 2020, "DisName": "新龙县", "CityID": 242, "DisSort": null }, { "Id": 2021, "DisName": "德格县", "CityID": 242, "DisSort": null }, { "Id": 2022, "DisName": "白玉县", "CityID": 242, "DisSort": null }, { "Id": 2023, "DisName": "石渠县", "CityID": 242, "DisSort": null }, { "Id": 2024, "DisName": "色达县", "CityID": 242, "DisSort": null }, { "Id": 2025, "DisName": "理塘县", "CityID": 242, "DisSort": null }, { "Id": 2026, "DisName": "巴塘县", "CityID": 242, "DisSort": null }, { "Id": 2027, "DisName": "乡城县", "CityID": 242, "DisSort": null }, { "Id": 2028, "DisName": "稻城县", "CityID": 242, "DisSort": null }, { "Id": 2029, "DisName": "得荣县", "CityID": 242, "DisSort": null }, { "Id": 2030, "DisName": "汶川县", "CityID": 243, "DisSort": null }, { "Id": 2031, "DisName": "理县", "CityID": 243, "DisSort": null }, { "Id": 2032, "DisName": "茂县", "CityID": 243, "DisSort": null }, { "Id": 2033, "DisName": "松潘县", "CityID": 243, "DisSort": null }, { "Id": 2034, "DisName": "九寨沟县", "CityID": 243, "DisSort": null }, { "Id": 2035, "DisName": "金川县", "CityID": 243, "DisSort": null }, { "Id": 2036, "DisName": "小金县", "CityID": 243, "DisSort": null }, { "Id": 2037, "DisName": "黑水县", "CityID": 243, "DisSort": null }, { "Id": 2038, "DisName": "马尔康县", "CityID": 243, "DisSort": null }, { "Id": 2039, "DisName": "壤塘县", "CityID": 243, "DisSort": null }, { "Id": 2040, "DisName": "阿坝县", "CityID": 243, "DisSort": null }, { "Id": 2041, "DisName": "若尔盖县", "CityID": 243, "DisSort": null }, { "Id": 2042, "DisName": "红原县", "CityID": 243, "DisSort": null }, { "Id": 2043, "DisName": "旌阳区", "CityID": 244, "DisSort": null }, { "Id": 2044, "DisName": "中江县", "CityID": 244, "DisSort": null }, { "Id": 2045, "DisName": "罗江县", "CityID": 244, "DisSort": null }, { "Id": 2046, "DisName": "广汉市", "CityID": 244, "DisSort": null }, { "Id": 2047, "DisName": "什邡市", "CityID": 244, "DisSort": null }, { "Id": 2048, "DisName": "绵竹市", "CityID": 244, "DisSort": null }, { "Id": 2049, "DisName": "市中区", "CityID": 245, "DisSort": null }, { "Id": 2050, "DisName": "元坝区", "CityID": 245, "DisSort": null }, { "Id": 2051, "DisName": "朝天区", "CityID": 245, "DisSort": null }, { "Id": 2052, "DisName": "旺苍县", "CityID": 245, "DisSort": null }, { "Id": 2053, "DisName": "青川县", "CityID": 245, "DisSort": null }, { "Id": 2054, "DisName": "剑阁县", "CityID": 245, "DisSort": null }, { "Id": 2055, "DisName": "苍溪县", "CityID": 245, "DisSort": null }, { "Id": 2056, "DisName": "南明区", "CityID": 246, "DisSort": null }, { "Id": 2057, "DisName": "云岩区", "CityID": 246, "DisSort": null }, { "Id": 2058, "DisName": "花溪区", "CityID": 246, "DisSort": null }, { "Id": 2059, "DisName": "乌当区", "CityID": 246, "DisSort": null }, { "Id": 2060, "DisName": "白云区", "CityID": 246, "DisSort": null }, { "Id": 2061, "DisName": "小河区", "CityID": 246, "DisSort": null }, { "Id": 2062, "DisName": "开阳县", "CityID": 246, "DisSort": null }, { "Id": 2063, "DisName": "息烽县", "CityID": 246, "DisSort": null }, { "Id": 2064, "DisName": "修文县", "CityID": 246, "DisSort": null }, { "Id": 2065, "DisName": "清镇市", "CityID": 246, "DisSort": null }, { "Id": 2066, "DisName": "红花岗区", "CityID": 247, "DisSort": null }, { "Id": 2067, "DisName": "汇川区", "CityID": 247, "DisSort": null }, { "Id": 2068, "DisName": "遵义县", "CityID": 247, "DisSort": null }, { "Id": 2069, "DisName": "桐梓县", "CityID": 247, "DisSort": null }, { "Id": 2070, "DisName": "绥阳县", "CityID": 247, "DisSort": null }, { "Id": 2071, "DisName": "正安县", "CityID": 247, "DisSort": null }, { "Id": 2072, "DisName": "道真仡佬族苗族自治县", "CityID": 247, "DisSort": null }, { "Id": 2073, "DisName": "务川仡佬族苗族自治县", "CityID": 247, "DisSort": null }, { "Id": 2074, "DisName": "凤冈县", "CityID": 247, "DisSort": null }, { "Id": 2075, "DisName": "湄潭县", "CityID": 247, "DisSort": null }, { "Id": 2076, "DisName": "余庆县", "CityID": 247, "DisSort": null }, { "Id": 2077, "DisName": "习水县", "CityID": 247, "DisSort": null }, { "Id": 2078, "DisName": "赤水市", "CityID": 247, "DisSort": null }, { "Id": 2079, "DisName": "仁怀市", "CityID": 247, "DisSort": null }, { "Id": 2080, "DisName": "西秀区", "CityID": 248, "DisSort": null }, { "Id": 2081, "DisName": "平坝县", "CityID": 248, "DisSort": null }, { "Id": 2082, "DisName": "普定县", "CityID": 248, "DisSort": null }, { "Id": 2083, "DisName": "镇宁布依族苗族自治县", "CityID": 248, "DisSort": null }, { "Id": 2084, "DisName": "关岭布依族苗族自治县", "CityID": 248, "DisSort": null }, { "Id": 2085, "DisName": "紫云苗族布依族自治县", "CityID": 248, "DisSort": null }, { "Id": 2086, "DisName": "都匀市", "CityID": 249, "DisSort": null }, { "Id": 2087, "DisName": "福泉市", "CityID": 249, "DisSort": null }, { "Id": 2088, "DisName": "荔波县", "CityID": 249, "DisSort": null }, { "Id": 2089, "DisName": "贵定县", "CityID": 249, "DisSort": null }, { "Id": 2090, "DisName": "瓮安县", "CityID": 249, "DisSort": null }, { "Id": 2091, "DisName": "独山县", "CityID": 249, "DisSort": null }, { "Id": 2092, "DisName": "平塘县", "CityID": 249, "DisSort": null }, { "Id": 2093, "DisName": "罗甸县", "CityID": 249, "DisSort": null }, { "Id": 2094, "DisName": "长顺县", "CityID": 249, "DisSort": null }, { "Id": 2095, "DisName": "龙里县", "CityID": 249, "DisSort": null }, { "Id": 2096, "DisName": "惠水县", "CityID": 249, "DisSort": null }, { "Id": 2097, "DisName": "三都水族自治县", "CityID": 249, "DisSort": null }, { "Id": 2098, "DisName": "凯里市", "CityID": 250, "DisSort": null }, { "Id": 2099, "DisName": "黄平县", "CityID": 250, "DisSort": null }, { "Id": 2100, "DisName": "施秉县", "CityID": 250, "DisSort": null }, { "Id": 2101, "DisName": "三穗县", "CityID": 250, "DisSort": null }, { "Id": 2102, "DisName": "镇远县", "CityID": 250, "DisSort": null }, { "Id": 2103, "DisName": "岑巩县", "CityID": 250, "DisSort": null }, { "Id": 2104, "DisName": "天柱县", "CityID": 250, "DisSort": null }, { "Id": 2105, "DisName": "锦屏县", "CityID": 250, "DisSort": null }, { "Id": 2106, "DisName": "剑河县", "CityID": 250, "DisSort": null }, { "Id": 2107, "DisName": "台江县", "CityID": 250, "DisSort": null }, { "Id": 2108, "DisName": "黎平县", "CityID": 250, "DisSort": null }, { "Id": 2109, "DisName": "榕江县", "CityID": 250, "DisSort": null }, { "Id": 2110, "DisName": "从江县", "CityID": 250, "DisSort": null }, { "Id": 2111, "DisName": "雷山县", "CityID": 250, "DisSort": null }, { "Id": 2112, "DisName": "麻江县", "CityID": 250, "DisSort": null }, { "Id": 2113, "DisName": "丹寨县", "CityID": 250, "DisSort": null }, { "Id": 2114, "DisName": "铜仁市", "CityID": 251, "DisSort": null }, { "Id": 2115, "DisName": "江口县", "CityID": 251, "DisSort": null }, { "Id": 2116, "DisName": "玉屏侗族自治县", "CityID": 251, "DisSort": null }, { "Id": 2117, "DisName": "石阡县", "CityID": 251, "DisSort": null }, { "Id": 2118, "DisName": "思南县", "CityID": 251, "DisSort": null }, { "Id": 2119, "DisName": "印江土家族苗族自治县", "CityID": 251, "DisSort": null }, { "Id": 2120, "DisName": "德江县", "CityID": 251, "DisSort": null }, { "Id": 2121, "DisName": "沿河土家族自治县", "CityID": 251, "DisSort": null }, { "Id": 2122, "DisName": "松桃苗族自治县", "CityID": 251, "DisSort": null }, { "Id": 2123, "DisName": "万山特区", "CityID": 251, "DisSort": null }, { "Id": 2124, "DisName": "毕节市", "CityID": 252, "DisSort": null }, { "Id": 2125, "DisName": "大方县", "CityID": 252, "DisSort": null }, { "Id": 2126, "DisName": "黔西县", "CityID": 252, "DisSort": null }, { "Id": 2127, "DisName": "金沙县", "CityID": 252, "DisSort": null }, { "Id": 2128, "DisName": "织金县", "CityID": 252, "DisSort": null }, { "Id": 2129, "DisName": "纳雍县", "CityID": 252, "DisSort": null }, { "Id": 2130, "DisName": "威宁彝族回族苗族自治县", "CityID": 252, "DisSort": null }, { "Id": 2131, "DisName": "赫章县", "CityID": 252, "DisSort": null }, { "Id": 2132, "DisName": "钟山区", "CityID": 253, "DisSort": null }, { "Id": 2133, "DisName": "六枝特区", "CityID": 253, "DisSort": null }, { "Id": 2134, "DisName": "水城县", "CityID": 253, "DisSort": null }, { "Id": 2135, "DisName": "盘县", "CityID": 253, "DisSort": null }, { "Id": 2136, "DisName": "兴义市", "CityID": 254, "DisSort": null }, { "Id": 2137, "DisName": "兴仁县", "CityID": 254, "DisSort": null }, { "Id": 2138, "DisName": "普安县", "CityID": 254, "DisSort": null }, { "Id": 2139, "DisName": "晴隆县", "CityID": 254, "DisSort": null }, { "Id": 2140, "DisName": "贞丰县", "CityID": 254, "DisSort": null }, { "Id": 2141, "DisName": "望谟县", "CityID": 254, "DisSort": null }, { "Id": 2142, "DisName": "册亨县", "CityID": 254, "DisSort": null }, { "Id": 2143, "DisName": "安龙县", "CityID": 254, "DisSort": null }, { "Id": 2144, "DisName": "秀英区", "CityID": 255, "DisSort": null }, { "Id": 2145, "DisName": "龙华区", "CityID": 255, "DisSort": null }, { "Id": 2146, "DisName": "琼山区", "CityID": 255, "DisSort": null }, { "Id": 2147, "DisName": "美兰区", "CityID": 255, "DisSort": null }, { "Id": 2148, "DisName": "景洪市", "CityID": 273, "DisSort": null }, { "Id": 2149, "DisName": "勐海县", "CityID": 273, "DisSort": null }, { "Id": 2150, "DisName": "勐腊县", "CityID": 273, "DisSort": null }, { "Id": 2151, "DisName": "瑞丽市", "CityID": 274, "DisSort": null }, { "Id": 2152, "DisName": "潞西市", "CityID": 274, "DisSort": null }, { "Id": 2153, "DisName": "梁河县", "CityID": 274, "DisSort": null }, { "Id": 2154, "DisName": "盈江县", "CityID": 274, "DisSort": null }, { "Id": 2155, "DisName": "陇川县", "CityID": 274, "DisSort": null }, { "Id": 2156, "DisName": "昭阳区", "CityID": 275, "DisSort": null }, { "Id": 2157, "DisName": "鲁甸县", "CityID": 275, "DisSort": null }, { "Id": 2158, "DisName": "巧家县", "CityID": 275, "DisSort": null }, { "Id": 2159, "DisName": "盐津县", "CityID": 275, "DisSort": null }, { "Id": 2160, "DisName": "大关县", "CityID": 275, "DisSort": null }, { "Id": 2161, "DisName": "永善县", "CityID": 275, "DisSort": null }, { "Id": 2162, "DisName": "绥江县", "CityID": 275, "DisSort": null }, { "Id": 2163, "DisName": "镇雄县", "CityID": 275, "DisSort": null }, { "Id": 2164, "DisName": "彝良县", "CityID": 275, "DisSort": null }, { "Id": 2165, "DisName": "威信县", "CityID": 275, "DisSort": null }, { "Id": 2166, "DisName": "水富县", "CityID": 275, "DisSort": null }, { "Id": 2167, "DisName": "五华区", "CityID": 276, "DisSort": null }, { "Id": 2168, "DisName": "盘龙区", "CityID": 276, "DisSort": null }, { "Id": 2169, "DisName": "官渡区", "CityID": 276, "DisSort": null }, { "Id": 2170, "DisName": "西山区", "CityID": 276, "DisSort": null }, { "Id": 2171, "DisName": "东川区", "CityID": 276, "DisSort": null }, { "Id": 2172, "DisName": "呈贡县", "CityID": 276, "DisSort": null }, { "Id": 2173, "DisName": "晋宁县", "CityID": 276, "DisSort": null }, { "Id": 2174, "DisName": "富民县", "CityID": 276, "DisSort": null }, { "Id": 2175, "DisName": "宜良县", "CityID": 276, "DisSort": null }, { "Id": 2176, "DisName": "石林彝族自治县", "CityID": 276, "DisSort": null }, { "Id": 2177, "DisName": "嵩明县", "CityID": 276, "DisSort": null }, { "Id": 2178, "DisName": "禄劝彝族苗族自治县", "CityID": 276, "DisSort": null }, { "Id": 2179, "DisName": "寻甸回族彝族自治县", "CityID": 276, "DisSort": null }, { "Id": 2180, "DisName": "安宁市", "CityID": 276, "DisSort": null }, { "Id": 2181, "DisName": "大理市", "CityID": 277, "DisSort": null }, { "Id": 2182, "DisName": "漾濞彝族自治县", "CityID": 277, "DisSort": null }, { "Id": 2183, "DisName": "祥云县", "CityID": 277, "DisSort": null }, { "Id": 2184, "DisName": "宾川县", "CityID": 277, "DisSort": null }, { "Id": 2185, "DisName": "弥渡县", "CityID": 277, "DisSort": null }, { "Id": 2186, "DisName": "南涧彝族自治县", "CityID": 277, "DisSort": null }, { "Id": 2187, "DisName": "巍山彝族回族自治县", "CityID": 277, "DisSort": null }, { "Id": 2188, "DisName": "永平县", "CityID": 277, "DisSort": null }, { "Id": 2189, "DisName": "云龙县", "CityID": 277, "DisSort": null }, { "Id": 2190, "DisName": "洱源县", "CityID": 277, "DisSort": null }, { "Id": 2191, "DisName": "剑川县", "CityID": 277, "DisSort": null }, { "Id": 2192, "DisName": "鹤庆县", "CityID": 277, "DisSort": null }, { "Id": 2193, "DisName": "个旧市", "CityID": 278, "DisSort": null }, { "Id": 2194, "DisName": "开远市", "CityID": 278, "DisSort": null }, { "Id": 2195, "DisName": "蒙自县", "CityID": 278, "DisSort": null }, { "Id": 2196, "DisName": "屏边苗族自治县", "CityID": 278, "DisSort": null }, { "Id": 2197, "DisName": "建水县", "CityID": 278, "DisSort": null }, { "Id": 2198, "DisName": "石屏县", "CityID": 278, "DisSort": null }, { "Id": 2199, "DisName": "弥勒县", "CityID": 278, "DisSort": null }, { "Id": 2200, "DisName": "泸西县", "CityID": 278, "DisSort": null }, { "Id": 2201, "DisName": "元阳县", "CityID": 278, "DisSort": null }, { "Id": 2202, "DisName": "红河县", "CityID": 278, "DisSort": null }, { "Id": 2203, "DisName": "金平苗族瑶族傣族自治县", "CityID": 278, "DisSort": null }, { "Id": 2204, "DisName": "绿春县", "CityID": 278, "DisSort": null }, { "Id": 2205, "DisName": "河口瑶族自治县", "CityID": 278, "DisSort": null }, { "Id": 2206, "DisName": "麒麟区", "CityID": 279, "DisSort": null }, { "Id": 2207, "DisName": "马龙县", "CityID": 279, "DisSort": null }, { "Id": 2208, "DisName": "陆良县", "CityID": 279, "DisSort": null }, { "Id": 2209, "DisName": "师宗县", "CityID": 279, "DisSort": null }, { "Id": 2210, "DisName": "罗平县", "CityID": 279, "DisSort": null }, { "Id": 2211, "DisName": "富源县", "CityID": 279, "DisSort": null }, { "Id": 2212, "DisName": "会泽县", "CityID": 279, "DisSort": null }, { "Id": 2213, "DisName": "沾益县", "CityID": 279, "DisSort": null }, { "Id": 2214, "DisName": "宣威市", "CityID": 279, "DisSort": null }, { "Id": 2215, "DisName": "隆阳区", "CityID": 280, "DisSort": null }, { "Id": 2216, "DisName": "施甸县", "CityID": 280, "DisSort": null }, { "Id": 2217, "DisName": "腾冲县", "CityID": 280, "DisSort": null }, { "Id": 2218, "DisName": "龙陵县", "CityID": 280, "DisSort": null }, { "Id": 2219, "DisName": "昌宁县", "CityID": 280, "DisSort": null }, { "Id": 2220, "DisName": "文山县", "CityID": 281, "DisSort": null }, { "Id": 2221, "DisName": "砚山县", "CityID": 281, "DisSort": null }, { "Id": 2222, "DisName": "西畴县", "CityID": 281, "DisSort": null }, { "Id": 2223, "DisName": "麻栗坡县", "CityID": 281, "DisSort": null }, { "Id": 2224, "DisName": "马关县", "CityID": 281, "DisSort": null }, { "Id": 2225, "DisName": "丘北县", "CityID": 281, "DisSort": null }, { "Id": 2226, "DisName": "广南县", "CityID": 281, "DisSort": null }, { "Id": 2227, "DisName": "富宁县", "CityID": 281, "DisSort": null }, { "Id": 2228, "DisName": "红塔区", "CityID": 282, "DisSort": null }, { "Id": 2229, "DisName": "江川县", "CityID": 282, "DisSort": null }, { "Id": 2230, "DisName": "澄江县", "CityID": 282, "DisSort": null }, { "Id": 2231, "DisName": "通海县", "CityID": 282, "DisSort": null }, { "Id": 2232, "DisName": "华宁县", "CityID": 282, "DisSort": null }, { "Id": 2233, "DisName": "易门县", "CityID": 282, "DisSort": null }, { "Id": 2234, "DisName": "峨山彝族自治县", "CityID": 282, "DisSort": null }, { "Id": 2235, "DisName": "新平彝族傣族自治县", "CityID": 282, "DisSort": null }, { "Id": 2236, "DisName": "元江哈尼族彝族傣族自治县", "CityID": 282, "DisSort": null }, { "Id": 2237, "DisName": "楚雄市", "CityID": 283, "DisSort": null }, { "Id": 2238, "DisName": "双柏县", "CityID": 283, "DisSort": null }, { "Id": 2239, "DisName": "牟定县", "CityID": 283, "DisSort": null }, { "Id": 2240, "DisName": "南华县", "CityID": 283, "DisSort": null }, { "Id": 2241, "DisName": "姚安县", "CityID": 283, "DisSort": null }, { "Id": 2242, "DisName": "大姚县", "CityID": 283, "DisSort": null }, { "Id": 2243, "DisName": "永仁县", "CityID": 283, "DisSort": null }, { "Id": 2244, "DisName": "元谋县", "CityID": 283, "DisSort": null }, { "Id": 2245, "DisName": "武定县", "CityID": 283, "DisSort": null }, { "Id": 2246, "DisName": "禄丰县", "CityID": 283, "DisSort": null }, { "Id": 2247, "DisName": "思茅区", "CityID": 284, "DisSort": null }, { "Id": 2248, "DisName": "宁洱哈尼族彝族自治县", "CityID": 284, "DisSort": null }, { "Id": 2249, "DisName": "墨江哈尼族自治县", "CityID": 284, "DisSort": null }, { "Id": 2250, "DisName": "景东彝族自治县", "CityID": 284, "DisSort": null }, { "Id": 2251, "DisName": "景谷傣族彝族自治县", "CityID": 284, "DisSort": null }, { "Id": 2252, "DisName": "镇沅彝族哈尼族拉祜族自治县", "CityID": 284, "DisSort": null }, { "Id": 2253, "DisName": "江城哈尼族彝族自治县", "CityID": 284, "DisSort": null }, { "Id": 2254, "DisName": "孟连傣族拉祜族佤族自治县", "CityID": 284, "DisSort": null }, { "Id": 2255, "DisName": "澜沧拉祜族自治县", "CityID": 284, "DisSort": null }, { "Id": 2256, "DisName": "西盟佤族自治县", "CityID": 284, "DisSort": null }, { "Id": 2257, "DisName": "临翔区", "CityID": 285, "DisSort": null }, { "Id": 2258, "DisName": "凤庆县", "CityID": 285, "DisSort": null }, { "Id": 2259, "DisName": "云县", "CityID": 285, "DisSort": null }, { "Id": 2260, "DisName": "永德县", "CityID": 285, "DisSort": null }, { "Id": 2261, "DisName": "镇康县", "CityID": 285, "DisSort": null }, { "Id": 2262, "DisName": "双江拉祜族佤族布朗族傣族自治县", "CityID": 285, "DisSort": null }, { "Id": 2263, "DisName": "耿马傣族佤族自治县", "CityID": 285, "DisSort": null }, { "Id": 2264, "DisName": "沧源佤族自治县", "CityID": 285, "DisSort": null }, { "Id": 2265, "DisName": "泸水县", "CityID": 286, "DisSort": null }, { "Id": 2266, "DisName": "福贡县", "CityID": 286, "DisSort": null }, { "Id": 2267, "DisName": "贡山独龙族怒族自治县", "CityID": 286, "DisSort": null }, { "Id": 2268, "DisName": "兰坪白族普米族自治县", "CityID": 286, "DisSort": null }, { "Id": 2269, "DisName": "香格里拉县", "CityID": 287, "DisSort": null }, { "Id": 2270, "DisName": "德钦县", "CityID": 287, "DisSort": null }, { "Id": 2271, "DisName": "维西傈僳族自治县", "CityID": 287, "DisSort": null }, { "Id": 2272, "DisName": "古城区", "CityID": 288, "DisSort": null }, { "Id": 2273, "DisName": "玉龙纳西族自治县", "CityID": 288, "DisSort": null }, { "Id": 2274, "DisName": "永胜县", "CityID": 288, "DisSort": null }, { "Id": 2275, "DisName": "华坪县", "CityID": 288, "DisSort": null }, { "Id": 2276, "DisName": "宁蒗彝族自治县", "CityID": 288, "DisSort": null }, { "Id": 2277, "DisName": "门源回族自治县", "CityID": 289, "DisSort": null }, { "Id": 2278, "DisName": "祁连县", "CityID": 289, "DisSort": null }, { "Id": 2279, "DisName": "海晏县", "CityID": 289, "DisSort": null }, { "Id": 2280, "DisName": "刚察县", "CityID": 289, "DisSort": null }, { "Id": 2281, "DisName": "城东区", "CityID": 290, "DisSort": null }, { "Id": 2282, "DisName": "城中区", "CityID": 290, "DisSort": null }, { "Id": 2283, "DisName": "城西区", "CityID": 290, "DisSort": null }, { "Id": 2284, "DisName": "城北区", "CityID": 290, "DisSort": null }, { "Id": 2285, "DisName": "大通回族土族自治县", "CityID": 290, "DisSort": null }, { "Id": 2286, "DisName": "湟中县", "CityID": 290, "DisSort": null }, { "Id": 2287, "DisName": "湟源县", "CityID": 290, "DisSort": null }, { "Id": 2288, "DisName": "平安县", "CityID": 291, "DisSort": null }, { "Id": 2289, "DisName": "民和回族土族自治县", "CityID": 291, "DisSort": null }, { "Id": 2290, "DisName": "乐都县", "CityID": 291, "DisSort": null }, { "Id": 2291, "DisName": "互助土族自治县", "CityID": 291, "DisSort": null }, { "Id": 2292, "DisName": "化隆回族自治县", "CityID": 291, "DisSort": null }, { "Id": 2293, "DisName": "循化撒拉族自治县", "CityID": 291, "DisSort": null }, { "Id": 2294, "DisName": "同仁县", "CityID": 292, "DisSort": null }, { "Id": 2295, "DisName": "尖扎县", "CityID": 292, "DisSort": null }, { "Id": 2296, "DisName": "泽库县", "CityID": 292, "DisSort": null }, { "Id": 2297, "DisName": "河南蒙古族自治县", "CityID": 292, "DisSort": null }, { "Id": 2298, "DisName": "共和县", "CityID": 293, "DisSort": null }, { "Id": 2299, "DisName": "同德县", "CityID": 293, "DisSort": null }, { "Id": 2300, "DisName": "贵德县", "CityID": 293, "DisSort": null }, { "Id": 2301, "DisName": "兴海县", "CityID": 293, "DisSort": null }, { "Id": 2302, "DisName": "贵南县", "CityID": 293, "DisSort": null }, { "Id": 2303, "DisName": "玛沁县", "CityID": 294, "DisSort": null }, { "Id": 2304, "DisName": "班玛县", "CityID": 294, "DisSort": null }, { "Id": 2305, "DisName": "甘德县", "CityID": 294, "DisSort": null }, { "Id": 2306, "DisName": "达日县", "CityID": 294, "DisSort": null }, { "Id": 2307, "DisName": "久治县", "CityID": 294, "DisSort": null }, { "Id": 2308, "DisName": "玛多县", "CityID": 294, "DisSort": null }, { "Id": 2309, "DisName": "玉树县", "CityID": 295, "DisSort": null }, { "Id": 2310, "DisName": "杂多县", "CityID": 295, "DisSort": null }, { "Id": 2311, "DisName": "称多县", "CityID": 295, "DisSort": null }, { "Id": 2312, "DisName": "治多县", "CityID": 295, "DisSort": null }, { "Id": 2313, "DisName": "囊谦县", "CityID": 295, "DisSort": null }, { "Id": 2314, "DisName": "曲麻莱县", "CityID": 295, "DisSort": null }, { "Id": 2315, "DisName": "格尔木市", "CityID": 296, "DisSort": null }, { "Id": 2316, "DisName": "德令哈市", "CityID": 296, "DisSort": null }, { "Id": 2317, "DisName": "乌兰县", "CityID": 296, "DisSort": null }, { "Id": 2318, "DisName": "都兰县", "CityID": 296, "DisSort": null }, { "Id": 2319, "DisName": "天峻县", "CityID": 296, "DisSort": null }, { "Id": 2320, "DisName": "新城区", "CityID": 297, "DisSort": null }, { "Id": 2321, "DisName": "碑林区", "CityID": 297, "DisSort": null }, { "Id": 2322, "DisName": "莲湖区", "CityID": 297, "DisSort": null }, { "Id": 2323, "DisName": "灞桥区", "CityID": 297, "DisSort": null }, { "Id": 2324, "DisName": "未央区", "CityID": 297, "DisSort": null }, { "Id": 2325, "DisName": "雁塔区", "CityID": 297, "DisSort": null }, { "Id": 2326, "DisName": "阎良区", "CityID": 297, "DisSort": null }, { "Id": 2327, "DisName": "临潼区", "CityID": 297, "DisSort": null }, { "Id": 2328, "DisName": "长安区", "CityID": 297, "DisSort": null }, { "Id": 2329, "DisName": "蓝田县", "CityID": 297, "DisSort": null }, { "Id": 2330, "DisName": "周至县", "CityID": 297, "DisSort": null }, { "Id": 2331, "DisName": "户县", "CityID": 297, "DisSort": null }, { "Id": 2332, "DisName": "高陵县", "CityID": 297, "DisSort": null }, { "Id": 2333, "DisName": "秦都区", "CityID": 298, "DisSort": null }, { "Id": 2334, "DisName": "杨陵区", "CityID": 298, "DisSort": null }, { "Id": 2335, "DisName": "渭城区", "CityID": 298, "DisSort": null }, { "Id": 2336, "DisName": "三原县", "CityID": 298, "DisSort": null }, { "Id": 2337, "DisName": "泾阳县", "CityID": 298, "DisSort": null }, { "Id": 2338, "DisName": "乾县", "CityID": 298, "DisSort": null }, { "Id": 2339, "DisName": "礼泉县", "CityID": 298, "DisSort": null }, { "Id": 2340, "DisName": "永寿县", "CityID": 298, "DisSort": null }, { "Id": 2341, "DisName": "彬县", "CityID": 298, "DisSort": null }, { "Id": 2342, "DisName": "长武县", "CityID": 298, "DisSort": null }, { "Id": 2343, "DisName": "旬邑县", "CityID": 298, "DisSort": null }, { "Id": 2344, "DisName": "淳化县", "CityID": 298, "DisSort": null }, { "Id": 2345, "DisName": "武功县", "CityID": 298, "DisSort": null }, { "Id": 2346, "DisName": "兴平市", "CityID": 298, "DisSort": null }, { "Id": 2347, "DisName": "宝塔区", "CityID": 299, "DisSort": null }, { "Id": 2348, "DisName": "延长县", "CityID": 299, "DisSort": null }, { "Id": 2349, "DisName": "延川县", "CityID": 299, "DisSort": null }, { "Id": 2350, "DisName": "子长县", "CityID": 299, "DisSort": null }, { "Id": 2351, "DisName": "安塞县", "CityID": 299, "DisSort": null }, { "Id": 2352, "DisName": "志丹县", "CityID": 299, "DisSort": null }, { "Id": 2353, "DisName": "吴起县", "CityID": 299, "DisSort": null }, { "Id": 2354, "DisName": "甘泉县", "CityID": 299, "DisSort": null }, { "Id": 2355, "DisName": "富县", "CityID": 299, "DisSort": null }, { "Id": 2356, "DisName": "洛川县", "CityID": 299, "DisSort": null }, { "Id": 2357, "DisName": "宜川县", "CityID": 299, "DisSort": null }, { "Id": 2358, "DisName": "黄龙县", "CityID": 299, "DisSort": null }, { "Id": 2359, "DisName": "黄陵县", "CityID": 299, "DisSort": null }, { "Id": 2360, "DisName": "榆阳区", "CityID": 300, "DisSort": null }, { "Id": 2361, "DisName": "神木县", "CityID": 300, "DisSort": null }, { "Id": 2362, "DisName": "府谷县", "CityID": 300, "DisSort": null }, { "Id": 2363, "DisName": "横山县", "CityID": 300, "DisSort": null }, { "Id": 2364, "DisName": "靖边县", "CityID": 300, "DisSort": null }, { "Id": 2365, "DisName": "定边县", "CityID": 300, "DisSort": null }, { "Id": 2366, "DisName": "绥德县", "CityID": 300, "DisSort": null }, { "Id": 2367, "DisName": "米脂县", "CityID": 300, "DisSort": null }, { "Id": 2368, "DisName": "佳县", "CityID": 300, "DisSort": null }, { "Id": 2369, "DisName": "吴堡县", "CityID": 300, "DisSort": null }, { "Id": 2370, "DisName": "清涧县", "CityID": 300, "DisSort": null }, { "Id": 2371, "DisName": "子洲县", "CityID": 300, "DisSort": null }, { "Id": 2372, "DisName": "临渭区", "CityID": 301, "DisSort": null }, { "Id": 2373, "DisName": "华县", "CityID": 301, "DisSort": null }, { "Id": 2374, "DisName": "潼关县", "CityID": 301, "DisSort": null }, { "Id": 2375, "DisName": "大荔县", "CityID": 301, "DisSort": null }, { "Id": 2376, "DisName": "合阳县", "CityID": 301, "DisSort": null }, { "Id": 2377, "DisName": "澄城县", "CityID": 301, "DisSort": null }, { "Id": 2378, "DisName": "蒲城县", "CityID": 301, "DisSort": null }, { "Id": 2379, "DisName": "白水县", "CityID": 301, "DisSort": null }, { "Id": 2380, "DisName": "富平县", "CityID": 301, "DisSort": null }, { "Id": 2381, "DisName": "韩城市", "CityID": 301, "DisSort": null }, { "Id": 2382, "DisName": "华阴市", "CityID": 301, "DisSort": null }, { "Id": 2383, "DisName": "商州区", "CityID": 302, "DisSort": null }, { "Id": 2384, "DisName": "洛南县", "CityID": 302, "DisSort": null }, { "Id": 2385, "DisName": "丹凤县", "CityID": 302, "DisSort": null }, { "Id": 2386, "DisName": "商南县", "CityID": 302, "DisSort": null }, { "Id": 2387, "DisName": "山阳县", "CityID": 302, "DisSort": null }, { "Id": 2388, "DisName": "镇安县", "CityID": 302, "DisSort": null }, { "Id": 2389, "DisName": "柞水县", "CityID": 302, "DisSort": null }, { "Id": 2390, "DisName": "汉滨区", "CityID": 303, "DisSort": null }, { "Id": 2391, "DisName": "汉阴县", "CityID": 303, "DisSort": null }, { "Id": 2392, "DisName": "石泉县", "CityID": 303, "DisSort": null }, { "Id": 2393, "DisName": "宁陕县", "CityID": 303, "DisSort": null }, { "Id": 2394, "DisName": "紫阳县", "CityID": 303, "DisSort": null }, { "Id": 2395, "DisName": "岚皋县", "CityID": 303, "DisSort": null }, { "Id": 2396, "DisName": "平利县", "CityID": 303, "DisSort": null }, { "Id": 2397, "DisName": "镇坪县", "CityID": 303, "DisSort": null }, { "Id": 2398, "DisName": "旬阳县", "CityID": 303, "DisSort": null }, { "Id": 2399, "DisName": "白河县", "CityID": 303, "DisSort": null }, { "Id": 2400, "DisName": "汉台区", "CityID": 304, "DisSort": null }, { "Id": 2401, "DisName": "南郑县", "CityID": 304, "DisSort": null }, { "Id": 2402, "DisName": "城固县", "CityID": 304, "DisSort": null }, { "Id": 2403, "DisName": "洋县", "CityID": 304, "DisSort": null }, { "Id": 2404, "DisName": "西乡县", "CityID": 304, "DisSort": null }, { "Id": 2405, "DisName": "勉县", "CityID": 304, "DisSort": null }, { "Id": 2406, "DisName": "宁强县", "CityID": 304, "DisSort": null }, { "Id": 2407, "DisName": "略阳县", "CityID": 304, "DisSort": null }, { "Id": 2408, "DisName": "镇巴县", "CityID": 304, "DisSort": null }, { "Id": 2409, "DisName": "留坝县", "CityID": 304, "DisSort": null }, { "Id": 2410, "DisName": "佛坪县", "CityID": 304, "DisSort": null }, { "Id": 2411, "DisName": "渭滨区", "CityID": 305, "DisSort": null }, { "Id": 2412, "DisName": "金台区", "CityID": 305, "DisSort": null }, { "Id": 2413, "DisName": "陈仓区", "CityID": 305, "DisSort": null }, { "Id": 2414, "DisName": "凤翔县", "CityID": 305, "DisSort": null }, { "Id": 2415, "DisName": "岐山县", "CityID": 305, "DisSort": null }, { "Id": 2416, "DisName": "扶风县", "CityID": 305, "DisSort": null }, { "Id": 2417, "DisName": "眉县", "CityID": 305, "DisSort": null }, { "Id": 2418, "DisName": "陇县", "CityID": 305, "DisSort": null }, { "Id": 2419, "DisName": "千阳县", "CityID": 305, "DisSort": null }, { "Id": 2420, "DisName": "麟游县", "CityID": 305, "DisSort": null }, { "Id": 2421, "DisName": "凤县", "CityID": 305, "DisSort": null }, { "Id": 2422, "DisName": "太白县", "CityID": 305, "DisSort": null }, { "Id": 2423, "DisName": "王益区", "CityID": 306, "DisSort": null }, { "Id": 2424, "DisName": "印台区", "CityID": 306, "DisSort": null }, { "Id": 2425, "DisName": "耀州区", "CityID": 306, "DisSort": null }, { "Id": 2426, "DisName": "宜君县", "CityID": 306, "DisSort": null }, { "Id": 2427, "DisName": "港口区", "CityID": 307, "DisSort": null }, { "Id": 2428, "DisName": "防城区", "CityID": 307, "DisSort": null }, { "Id": 2429, "DisName": "上思县", "CityID": 307, "DisSort": null }, { "Id": 2430, "DisName": "东兴市", "CityID": 307, "DisSort": null }, { "Id": 2431, "DisName": "兴宁区", "CityID": 308, "DisSort": null }, { "Id": 2432, "DisName": "青秀区", "CityID": 308, "DisSort": null }, { "Id": 2433, "DisName": "江南区", "CityID": 308, "DisSort": null }, { "Id": 2434, "DisName": "西乡塘区", "CityID": 308, "DisSort": null }, { "Id": 2435, "DisName": "良庆区", "CityID": 308, "DisSort": null }, { "Id": 2436, "DisName": "邕宁区", "CityID": 308, "DisSort": null }, { "Id": 2437, "DisName": "武鸣县", "CityID": 308, "DisSort": null }, { "Id": 2438, "DisName": "隆安县", "CityID": 308, "DisSort": null }, { "Id": 2439, "DisName": "马山县", "CityID": 308, "DisSort": null }, { "Id": 2440, "DisName": "上林县", "CityID": 308, "DisSort": null }, { "Id": 2441, "DisName": "宾阳县", "CityID": 308, "DisSort": null }, { "Id": 2442, "DisName": "横县", "CityID": 308, "DisSort": null }, { "Id": 2443, "DisName": "江洲区", "CityID": 309, "DisSort": null }, { "Id": 2444, "DisName": "扶绥县", "CityID": 309, "DisSort": null }, { "Id": 2445, "DisName": "宁明县", "CityID": 309, "DisSort": null }, { "Id": 2446, "DisName": "龙州县", "CityID": 309, "DisSort": null }, { "Id": 2447, "DisName": "大新县", "CityID": 309, "DisSort": null }, { "Id": 2448, "DisName": "天等县", "CityID": 309, "DisSort": null }, { "Id": 2449, "DisName": "凭祥市", "CityID": 309, "DisSort": null }, { "Id": 2450, "DisName": "兴宾区", "CityID": 310, "DisSort": null }, { "Id": 2451, "DisName": "忻城县", "CityID": 310, "DisSort": null }, { "Id": 2452, "DisName": "象州县", "CityID": 310, "DisSort": null }, { "Id": 2453, "DisName": "武宣县", "CityID": 310, "DisSort": null }, { "Id": 2454, "DisName": "金秀瑶族自治县", "CityID": 310, "DisSort": null }, { "Id": 2455, "DisName": "合山市", "CityID": 310, "DisSort": null }, { "Id": 2456, "DisName": "城中区", "CityID": 311, "DisSort": null }, { "Id": 2457, "DisName": "鱼峰区", "CityID": 311, "DisSort": null }, { "Id": 2458, "DisName": "柳南区", "CityID": 311, "DisSort": null }, { "Id": 2459, "DisName": "柳北区", "CityID": 311, "DisSort": null }, { "Id": 2460, "DisName": "柳江县", "CityID": 311, "DisSort": null }, { "Id": 2461, "DisName": "柳城县", "CityID": 311, "DisSort": null }, { "Id": 2462, "DisName": "鹿寨县", "CityID": 311, "DisSort": null }, { "Id": 2463, "DisName": "融安县", "CityID": 311, "DisSort": null }, { "Id": 2464, "DisName": "融水苗族自治县", "CityID": 311, "DisSort": null }, { "Id": 2465, "DisName": "三江侗族自治县", "CityID": 311, "DisSort": null }, { "Id": 2466, "DisName": "秀峰区", "CityID": 312, "DisSort": null }, { "Id": 2467, "DisName": "叠彩区", "CityID": 312, "DisSort": null }, { "Id": 2468, "DisName": "象山区", "CityID": 312, "DisSort": null }, { "Id": 2469, "DisName": "七星区", "CityID": 312, "DisSort": null }, { "Id": 2470, "DisName": "雁山区", "CityID": 312, "DisSort": null }, { "Id": 2471, "DisName": "阳朔县", "CityID": 312, "DisSort": null }, { "Id": 2472, "DisName": "临桂县", "CityID": 312, "DisSort": null }, { "Id": 2473, "DisName": "灵川县", "CityID": 312, "DisSort": null }, { "Id": 2474, "DisName": "全州县", "CityID": 312, "DisSort": null }, { "Id": 2475, "DisName": "兴安县", "CityID": 312, "DisSort": null }, { "Id": 2476, "DisName": "永福县", "CityID": 312, "DisSort": null }, { "Id": 2477, "DisName": "灌阳县", "CityID": 312, "DisSort": null }, { "Id": 2478, "DisName": "龙胜各族自治县", "CityID": 312, "DisSort": null }, { "Id": 2479, "DisName": "资源县", "CityID": 312, "DisSort": null }, { "Id": 2480, "DisName": "平乐县", "CityID": 312, "DisSort": null }, { "Id": 2481, "DisName": "荔浦县", "CityID": 312, "DisSort": null }, { "Id": 2482, "DisName": "恭城瑶族自治县", "CityID": 312, "DisSort": null }, { "Id": 2483, "DisName": "万秀区", "CityID": 313, "DisSort": null }, { "Id": 2484, "DisName": "碟山区", "CityID": 313, "DisSort": null }, { "Id": 2485, "DisName": "长洲区", "CityID": 313, "DisSort": null }, { "Id": 2486, "DisName": "苍梧县", "CityID": 313, "DisSort": null }, { "Id": 2487, "DisName": "藤县", "CityID": 313, "DisSort": null }, { "Id": 2488, "DisName": "蒙山县", "CityID": 313, "DisSort": null }, { "Id": 2489, "DisName": "岑溪市", "CityID": 313, "DisSort": null }, { "Id": 2490, "DisName": "八步区", "CityID": 314, "DisSort": null }, { "Id": 2491, "DisName": "昭平县", "CityID": 314, "DisSort": null }, { "Id": 2492, "DisName": "钟山县", "CityID": 314, "DisSort": null }, { "Id": 2493, "DisName": "富川瑶族自治县", "CityID": 314, "DisSort": null }, { "Id": 2494, "DisName": "港北区", "CityID": 315, "DisSort": null }, { "Id": 2495, "DisName": "港南区", "CityID": 315, "DisSort": null }, { "Id": 2496, "DisName": "覃塘区", "CityID": 315, "DisSort": null }, { "Id": 2497, "DisName": "平南县", "CityID": 315, "DisSort": null }, { "Id": 2498, "DisName": "桂平市", "CityID": 315, "DisSort": null }, { "Id": 2499, "DisName": "玉州区", "CityID": 316, "DisSort": null }, { "Id": 2500, "DisName": "容县", "CityID": 316, "DisSort": null }, { "Id": 2501, "DisName": "陆川县", "CityID": 316, "DisSort": null }, { "Id": 2502, "DisName": "博白县", "CityID": 316, "DisSort": null }, { "Id": 2503, "DisName": "兴业县", "CityID": 316, "DisSort": null }, { "Id": 2504, "DisName": "北流市", "CityID": 316, "DisSort": null }, { "Id": 2505, "DisName": "右江区", "CityID": 317, "DisSort": null }, { "Id": 2506, "DisName": "田阳县", "CityID": 317, "DisSort": null }, { "Id": 2507, "DisName": "田东县", "CityID": 317, "DisSort": null }, { "Id": 2508, "DisName": "平果县", "CityID": 317, "DisSort": null }, { "Id": 2509, "DisName": "德保县", "CityID": 317, "DisSort": null }, { "Id": 2510, "DisName": "靖西县", "CityID": 317, "DisSort": null }, { "Id": 2511, "DisName": "那坡县", "CityID": 317, "DisSort": null }, { "Id": 2512, "DisName": "凌云县", "CityID": 317, "DisSort": null }, { "Id": 2513, "DisName": "乐业县", "CityID": 317, "DisSort": null }, { "Id": 2514, "DisName": "田林县", "CityID": 317, "DisSort": null }, { "Id": 2515, "DisName": "西林县", "CityID": 317, "DisSort": null }, { "Id": 2516, "DisName": "隆林各族自治县", "CityID": 317, "DisSort": null }, { "Id": 2517, "DisName": "钦南区", "CityID": 318, "DisSort": null }, { "Id": 2518, "DisName": "钦北区", "CityID": 318, "DisSort": null }, { "Id": 2519, "DisName": "灵山县", "CityID": 318, "DisSort": null }, { "Id": 2520, "DisName": "浦北县", "CityID": 318, "DisSort": null }, { "Id": 2521, "DisName": "金城江区", "CityID": 319, "DisSort": null }, { "Id": 2522, "DisName": "南丹县", "CityID": 319, "DisSort": null }, { "Id": 2523, "DisName": "天峨县", "CityID": 319, "DisSort": null }, { "Id": 2524, "DisName": "凤山县", "CityID": 319, "DisSort": null }, { "Id": 2525, "DisName": "东兰县", "CityID": 319, "DisSort": null }, { "Id": 2526, "DisName": "罗城仫佬族自治县", "CityID": 319, "DisSort": null }, { "Id": 2527, "DisName": "环江毛南族自治县", "CityID": 319, "DisSort": null }, { "Id": 2528, "DisName": "巴马瑶族自治县", "CityID": 319, "DisSort": null }, { "Id": 2529, "DisName": "都安瑶族自治县", "CityID": 319, "DisSort": null }, { "Id": 2530, "DisName": "大化瑶族自治县", "CityID": 319, "DisSort": null }, { "Id": 2531, "DisName": "宜州市", "CityID": 319, "DisSort": null }, { "Id": 2532, "DisName": "海城区", "CityID": 320, "DisSort": null }, { "Id": 2533, "DisName": "银海区", "CityID": 320, "DisSort": null }, { "Id": 2534, "DisName": "铁山港区", "CityID": 320, "DisSort": null }, { "Id": 2535, "DisName": "合浦县", "CityID": 320, "DisSort": null }, { "Id": 2536, "DisName": "城关区", "CityID": 321, "DisSort": null }, { "Id": 2537, "DisName": "林周县", "CityID": 321, "DisSort": null }, { "Id": 2538, "DisName": "当雄县", "CityID": 321, "DisSort": null }, { "Id": 2539, "DisName": "尼木县", "CityID": 321, "DisSort": null }, { "Id": 2540, "DisName": "曲水县", "CityID": 321, "DisSort": null }, { "Id": 2541, "DisName": "堆龙德庆县", "CityID": 321, "DisSort": null }, { "Id": 2542, "DisName": "达孜县", "CityID": 321, "DisSort": null }, { "Id": 2543, "DisName": "墨竹工卡县", "CityID": 321, "DisSort": null }, { "Id": 2544, "DisName": "日喀则市", "CityID": 322, "DisSort": null }, { "Id": 2545, "DisName": "南木林县", "CityID": 322, "DisSort": null }, { "Id": 2546, "DisName": "江孜县", "CityID": 322, "DisSort": null }, { "Id": 2547, "DisName": "定日县", "CityID": 322, "DisSort": null }, { "Id": 2548, "DisName": "萨迦县", "CityID": 322, "DisSort": null }, { "Id": 2549, "DisName": "拉孜县", "CityID": 322, "DisSort": null }, { "Id": 2550, "DisName": "昂仁县", "CityID": 322, "DisSort": null }, { "Id": 2551, "DisName": "谢通门县", "CityID": 322, "DisSort": null }, { "Id": 2552, "DisName": "白朗县", "CityID": 322, "DisSort": null }, { "Id": 2553, "DisName": "仁布县", "CityID": 322, "DisSort": null }, { "Id": 2554, "DisName": "康马县", "CityID": 322, "DisSort": null }, { "Id": 2555, "DisName": "定结县", "CityID": 322, "DisSort": null }, { "Id": 2556, "DisName": "仲巴县", "CityID": 322, "DisSort": null }, { "Id": 2557, "DisName": "亚东县", "CityID": 322, "DisSort": null }, { "Id": 2558, "DisName": "吉隆县", "CityID": 322, "DisSort": null }, { "Id": 2559, "DisName": "聂拉木县", "CityID": 322, "DisSort": null }, { "Id": 2560, "DisName": "萨嘎县", "CityID": 322, "DisSort": null }, { "Id": 2561, "DisName": "岗巴县", "CityID": 322, "DisSort": null }, { "Id": 2562, "DisName": "乃东县", "CityID": 323, "DisSort": null }, { "Id": 2563, "DisName": "扎囊县", "CityID": 323, "DisSort": null }, { "Id": 2564, "DisName": "贡嘎县", "CityID": 323, "DisSort": null }, { "Id": 2565, "DisName": "桑日县", "CityID": 323, "DisSort": null }, { "Id": 2566, "DisName": "琼结县", "CityID": 323, "DisSort": null }, { "Id": 2567, "DisName": "曲松县", "CityID": 323, "DisSort": null }, { "Id": 2568, "DisName": "措美县", "CityID": 323, "DisSort": null }, { "Id": 2569, "DisName": "洛扎县", "CityID": 323, "DisSort": null }, { "Id": 2570, "DisName": "加查县", "CityID": 323, "DisSort": null }, { "Id": 2571, "DisName": "隆子县", "CityID": 323, "DisSort": null }, { "Id": 2572, "DisName": "错那县", "CityID": 323, "DisSort": null }, { "Id": 2573, "DisName": "浪卡子县", "CityID": 323, "DisSort": null }, { "Id": 2574, "DisName": "林芝县", "CityID": 324, "DisSort": null }, { "Id": 2575, "DisName": "工布江达县", "CityID": 324, "DisSort": null }, { "Id": 2576, "DisName": "米林县", "CityID": 324, "DisSort": null }, { "Id": 2577, "DisName": "墨脱县", "CityID": 324, "DisSort": null }, { "Id": 2578, "DisName": "波密县", "CityID": 324, "DisSort": null }, { "Id": 2579, "DisName": "察隅县", "CityID": 324, "DisSort": null }, { "Id": 2580, "DisName": "朗县", "CityID": 324, "DisSort": null }, { "Id": 2581, "DisName": "昌都县", "CityID": 325, "DisSort": null }, { "Id": 2582, "DisName": "江达县", "CityID": 325, "DisSort": null }, { "Id": 2583, "DisName": "贡觉县", "CityID": 325, "DisSort": null }, { "Id": 2584, "DisName": "类乌齐县", "CityID": 325, "DisSort": null }, { "Id": 2585, "DisName": "丁青县", "CityID": 325, "DisSort": null }, { "Id": 2586, "DisName": "察雅县", "CityID": 325, "DisSort": null }, { "Id": 2587, "DisName": "八宿县", "CityID": 325, "DisSort": null }, { "Id": 2588, "DisName": "左贡县", "CityID": 325, "DisSort": null }, { "Id": 2589, "DisName": "芒康县", "CityID": 325, "DisSort": null }, { "Id": 2590, "DisName": "洛隆县", "CityID": 325, "DisSort": null }, { "Id": 2591, "DisName": "边坝县", "CityID": 325, "DisSort": null }, { "Id": 2592, "DisName": "那曲县", "CityID": 326, "DisSort": null }, { "Id": 2593, "DisName": "嘉黎县", "CityID": 326, "DisSort": null }, { "Id": 2594, "DisName": "比如县", "CityID": 326, "DisSort": null }, { "Id": 2595, "DisName": "聂荣县", "CityID": 326, "DisSort": null }, { "Id": 2596, "DisName": "安多县", "CityID": 326, "DisSort": null }, { "Id": 2597, "DisName": "申扎县", "CityID": 326, "DisSort": null }, { "Id": 2598, "DisName": "索县", "CityID": 326, "DisSort": null }, { "Id": 2599, "DisName": "班戈县", "CityID": 326, "DisSort": null }, { "Id": 2600, "DisName": "巴青县", "CityID": 326, "DisSort": null }, { "Id": 2601, "DisName": "尼玛县", "CityID": 326, "DisSort": null }, { "Id": 2602, "DisName": "普兰县", "CityID": 327, "DisSort": null }, { "Id": 2603, "DisName": "札达县", "CityID": 327, "DisSort": null }, { "Id": 2604, "DisName": "噶尔县", "CityID": 327, "DisSort": null }, { "Id": 2605, "DisName": "日土县", "CityID": 327, "DisSort": null }, { "Id": 2606, "DisName": "革吉县", "CityID": 327, "DisSort": null }, { "Id": 2607, "DisName": "改则县", "CityID": 327, "DisSort": null }, { "Id": 2608, "DisName": "措勤县", "CityID": 327, "DisSort": null }, { "Id": 2609, "DisName": "兴庆区", "CityID": 328, "DisSort": null }, { "Id": 2610, "DisName": "西夏区", "CityID": 328, "DisSort": null }, { "Id": 2611, "DisName": "金凤区", "CityID": 328, "DisSort": null }, { "Id": 2612, "DisName": "永宁县", "CityID": 328, "DisSort": null }, { "Id": 2613, "DisName": "贺兰县", "CityID": 328, "DisSort": null }, { "Id": 2614, "DisName": "灵武市", "CityID": 328, "DisSort": null }, { "Id": 2615, "DisName": "大武口区", "CityID": 329, "DisSort": null }, { "Id": 2616, "DisName": "惠农区", "CityID": 329, "DisSort": null }, { "Id": 2617, "DisName": "平罗县", "CityID": 329, "DisSort": null }, { "Id": 2618, "DisName": "利通区", "CityID": 330, "DisSort": null }, { "Id": 2619, "DisName": "盐池县", "CityID": 330, "DisSort": null }, { "Id": 2620, "DisName": "同心县", "CityID": 330, "DisSort": null }, { "Id": 2621, "DisName": "青铜峡市", "CityID": 330, "DisSort": null }, { "Id": 2622, "DisName": "原州区", "CityID": 331, "DisSort": null }, { "Id": 2623, "DisName": "西吉县", "CityID": 331, "DisSort": null }, { "Id": 2624, "DisName": "隆德县", "CityID": 331, "DisSort": null }, { "Id": 2625, "DisName": "泾源县", "CityID": 331, "DisSort": null }, { "Id": 2626, "DisName": "彭阳县", "CityID": 331, "DisSort": null }, { "Id": 2627, "DisName": "沙坡头区", "CityID": 332, "DisSort": null }, { "Id": 2628, "DisName": "中宁县", "CityID": 332, "DisSort": null }, { "Id": 2629, "DisName": "海原县", "CityID": 332, "DisSort": null }, { "Id": 2630, "DisName": "塔城市", "CityID": 333, "DisSort": null }, { "Id": 2631, "DisName": "乌苏市", "CityID": 333, "DisSort": null }, { "Id": 2632, "DisName": "额敏县", "CityID": 333, "DisSort": null }, { "Id": 2633, "DisName": "沙湾县", "CityID": 333, "DisSort": null }, { "Id": 2634, "DisName": "托里县", "CityID": 333, "DisSort": null }, { "Id": 2635, "DisName": "裕民县", "CityID": 333, "DisSort": null }, { "Id": 2636, "DisName": "和布克赛尔蒙古自治县", "CityID": 333, "DisSort": null }, { "Id": 2637, "DisName": "哈密市", "CityID": 334, "DisSort": null }, { "Id": 2638, "DisName": "巴里坤哈萨克自治县", "CityID": 334, "DisSort": null }, { "Id": 2639, "DisName": "伊吾县", "CityID": 334, "DisSort": null }, { "Id": 2640, "DisName": "和田市", "CityID": 335, "DisSort": null }, { "Id": 2641, "DisName": "和田县", "CityID": 335, "DisSort": null }, { "Id": 2642, "DisName": "墨玉县", "CityID": 335, "DisSort": null }, { "Id": 2643, "DisName": "皮山县", "CityID": 335, "DisSort": null }, { "Id": 2644, "DisName": "洛浦县", "CityID": 335, "DisSort": null }, { "Id": 2645, "DisName": "策勒县", "CityID": 335, "DisSort": null }, { "Id": 2646, "DisName": "于田县", "CityID": 335, "DisSort": null }, { "Id": 2647, "DisName": "民丰县", "CityID": 335, "DisSort": null }, { "Id": 2648, "DisName": "阿勒泰市", "CityID": 336, "DisSort": null }, { "Id": 2649, "DisName": "布尔津县", "CityID": 336, "DisSort": null }, { "Id": 2650, "DisName": "富蕴县", "CityID": 336, "DisSort": null }, { "Id": 2651, "DisName": "福海县", "CityID": 336, "DisSort": null }, { "Id": 2652, "DisName": "哈巴河县", "CityID": 336, "DisSort": null }, { "Id": 2653, "DisName": "青河县", "CityID": 336, "DisSort": null }, { "Id": 2654, "DisName": "吉木乃县", "CityID": 336, "DisSort": null }, { "Id": 2655, "DisName": "阿图什市", "CityID": 337, "DisSort": null }, { "Id": 2656, "DisName": "阿克陶县", "CityID": 337, "DisSort": null }, { "Id": 2657, "DisName": "阿合奇县", "CityID": 337, "DisSort": null }, { "Id": 2658, "DisName": "乌恰县", "CityID": 337, "DisSort": null }, { "Id": 2659, "DisName": "博乐市", "CityID": 338, "DisSort": null }, { "Id": 2660, "DisName": "精河县", "CityID": 338, "DisSort": null }, { "Id": 2661, "DisName": "温泉县", "CityID": 338, "DisSort": null }, { "Id": 2662, "DisName": "独山子区", "CityID": 339, "DisSort": null }, { "Id": 2663, "DisName": "克拉玛依区", "CityID": 339, "DisSort": null }, { "Id": 2664, "DisName": "白碱滩区", "CityID": 339, "DisSort": null }, { "Id": 2665, "DisName": "乌尔禾区", "CityID": 339, "DisSort": null }, { "Id": 2666, "DisName": "天山区", "CityID": 340, "DisSort": null }, { "Id": 2667, "DisName": "沙依巴克区", "CityID": 340, "DisSort": null }, { "Id": 2668, "DisName": "新市区", "CityID": 340, "DisSort": null }, { "Id": 2669, "DisName": "水磨沟区", "CityID": 340, "DisSort": null }, { "Id": 2670, "DisName": "头屯河区", "CityID": 340, "DisSort": null }, { "Id": 2671, "DisName": "达坂城区", "CityID": 340, "DisSort": null }, { "Id": 2672, "DisName": "米东区", "CityID": 340, "DisSort": null }, { "Id": 2673, "DisName": "乌鲁木齐县", "CityID": 340, "DisSort": null }, { "Id": 2674, "DisName": "昌吉市", "CityID": 342, "DisSort": null }, { "Id": 2675, "DisName": "阜康市", "CityID": 342, "DisSort": null }, { "Id": 2676, "DisName": "呼图壁县", "CityID": 342, "DisSort": null }, { "Id": 2677, "DisName": "玛纳斯县", "CityID": 342, "DisSort": null }, { "Id": 2678, "DisName": "奇台县", "CityID": 342, "DisSort": null }, { "Id": 2679, "DisName": "吉木萨尔县", "CityID": 342, "DisSort": null }, { "Id": 2680, "DisName": "木垒哈萨克自治县", "CityID": 342, "DisSort": null }, { "Id": 2681, "DisName": "吐鲁番市", "CityID": 344, "DisSort": null }, { "Id": 2682, "DisName": "鄯善县", "CityID": 344, "DisSort": null }, { "Id": 2683, "DisName": "托克逊县", "CityID": 344, "DisSort": null }, { "Id": 2684, "DisName": "库尔勒市", "CityID": 345, "DisSort": null }, { "Id": 2685, "DisName": "轮台县", "CityID": 345, "DisSort": null }, { "Id": 2686, "DisName": "尉犁县", "CityID": 345, "DisSort": null }, { "Id": 2687, "DisName": "若羌县", "CityID": 345, "DisSort": null }, { "Id": 2688, "DisName": "且末县", "CityID": 345, "DisSort": null }, { "Id": 2689, "DisName": "焉耆回族自治县", "CityID": 345, "DisSort": null }, { "Id": 2690, "DisName": "和静县", "CityID": 345, "DisSort": null }, { "Id": 2691, "DisName": "和硕县", "CityID": 345, "DisSort": null }, { "Id": 2692, "DisName": "博湖县", "CityID": 345, "DisSort": null }, { "Id": 2693, "DisName": "阿克苏市", "CityID": 346, "DisSort": null }, { "Id": 2694, "DisName": "温宿县", "CityID": 346, "DisSort": null }, { "Id": 2695, "DisName": "库车县", "CityID": 346, "DisSort": null }, { "Id": 2696, "DisName": "沙雅县", "CityID": 346, "DisSort": null }, { "Id": 2697, "DisName": "新和县", "CityID": 346, "DisSort": null }, { "Id": 2698, "DisName": "拜城县", "CityID": 346, "DisSort": null }, { "Id": 2699, "DisName": "乌什县", "CityID": 346, "DisSort": null }, { "Id": 2700, "DisName": "阿瓦提县", "CityID": 346, "DisSort": null }, { "Id": 2701, "DisName": "柯坪县", "CityID": 346, "DisSort": null }, { "Id": 2702, "DisName": "喀什市", "CityID": 348, "DisSort": null }, { "Id": 2703, "DisName": "疏附县", "CityID": 348, "DisSort": null }, { "Id": 2704, "DisName": "疏勒县", "CityID": 348, "DisSort": null }, { "Id": 2705, "DisName": "英吉沙县", "CityID": 348, "DisSort": null }, { "Id": 2706, "DisName": "泽普县", "CityID": 348, "DisSort": null }, { "Id": 2707, "DisName": "莎车县", "CityID": 348, "DisSort": null }, { "Id": 2708, "DisName": "叶城县", "CityID": 348, "DisSort": null }, { "Id": 2709, "DisName": "麦盖提县", "CityID": 348, "DisSort": null }, { "Id": 2710, "DisName": "岳普湖县", "CityID": 348, "DisSort": null }, { "Id": 2711, "DisName": "伽师县", "CityID": 348, "DisSort": null }, { "Id": 2712, "DisName": "巴楚县", "CityID": 348, "DisSort": null }, { "Id": 2713, "DisName": "塔什库尔干塔吉克自治县", "CityID": 348, "DisSort": null }, { "Id": 2714, "DisName": "伊宁市", "CityID": 350, "DisSort": null }, { "Id": 2715, "DisName": "奎屯市", "CityID": 350, "DisSort": null }, { "Id": 2716, "DisName": "伊宁县", "CityID": 350, "DisSort": null }, { "Id": 2717, "DisName": "察布查尔锡伯自治县", "CityID": 350, "DisSort": null }, { "Id": 2718, "DisName": "霍城县", "CityID": 350, "DisSort": null }, { "Id": 2719, "DisName": "巩留县", "CityID": 350, "DisSort": null }, { "Id": 2720, "DisName": "新源县", "CityID": 350, "DisSort": null }, { "Id": 2721, "DisName": "昭苏县", "CityID": 350, "DisSort": null }, { "Id": 2722, "DisName": "特克斯县", "CityID": 350, "DisSort": null }, { "Id": 2723, "DisName": "尼勒克县", "CityID": 350, "DisSort": null }, { "Id": 2724, "DisName": "海拉尔区", "CityID": 351, "DisSort": null }, { "Id": 2725, "DisName": "阿荣旗", "CityID": 351, "DisSort": null }, { "Id": 2726, "DisName": "莫力达瓦达斡尔族自治旗", "CityID": 351, "DisSort": null }, { "Id": 2727, "DisName": "鄂伦春自治旗", "CityID": 351, "DisSort": null }, { "Id": 2728, "DisName": "鄂温克族自治旗", "CityID": 351, "DisSort": null }, { "Id": 2729, "DisName": "陈巴尔虎旗", "CityID": 351, "DisSort": null }, { "Id": 2730, "DisName": "新巴尔虎左旗", "CityID": 351, "DisSort": null }, { "Id": 2731, "DisName": "新巴尔虎右旗", "CityID": 351, "DisSort": null }, { "Id": 2732, "DisName": "满洲里市", "CityID": 351, "DisSort": null }, { "Id": 2733, "DisName": "牙克石市", "CityID": 351, "DisSort": null }, { "Id": 2734, "DisName": "扎兰屯市", "CityID": 351, "DisSort": null }, { "Id": 2735, "DisName": "额尔古纳市", "CityID": 351, "DisSort": null }, { "Id": 2736, "DisName": "根河市", "CityID": 351, "DisSort": null }, { "Id": 2737, "DisName": "新城区", "CityID": 352, "DisSort": null }, { "Id": 2738, "DisName": "回民区", "CityID": 352, "DisSort": null }, { "Id": 2739, "DisName": "玉泉区", "CityID": 352, "DisSort": null }, { "Id": 2740, "DisName": "赛罕区", "CityID": 352, "DisSort": null }, { "Id": 2741, "DisName": "土默特左旗", "CityID": 352, "DisSort": null }, { "Id": 2742, "DisName": "托克托县", "CityID": 352, "DisSort": null }, { "Id": 2743, "DisName": "和林格尔县", "CityID": 352, "DisSort": null }, { "Id": 2744, "DisName": "清水河县", "CityID": 352, "DisSort": null }, { "Id": 2745, "DisName": "武川县", "CityID": 352, "DisSort": null }, { "Id": 2746, "DisName": "东河区", "CityID": 353, "DisSort": null }, { "Id": 2747, "DisName": "昆都仑区", "CityID": 353, "DisSort": null }, { "Id": 2748, "DisName": "青山区", "CityID": 353, "DisSort": null }, { "Id": 2749, "DisName": "石拐区", "CityID": 353, "DisSort": null }, { "Id": 2750, "DisName": "白云鄂博矿区", "CityID": 353, "DisSort": null }, { "Id": 2751, "DisName": "九原区", "CityID": 353, "DisSort": null }, { "Id": 2752, "DisName": "土默特右旗", "CityID": 353, "DisSort": null }, { "Id": 2753, "DisName": "固阳县", "CityID": 353, "DisSort": null }, { "Id": 2754, "DisName": "达尔罕茂明安联合旗", "CityID": 353, "DisSort": null }, { "Id": 2755, "DisName": "海勃湾区", "CityID": 354, "DisSort": null }, { "Id": 2756, "DisName": "海南区", "CityID": 354, "DisSort": null }, { "Id": 2757, "DisName": "乌达区", "CityID": 354, "DisSort": null }, { "Id": 2758, "DisName": "集宁区", "CityID": 355, "DisSort": null }, { "Id": 2759, "DisName": "卓资县", "CityID": 355, "DisSort": null }, { "Id": 2760, "DisName": "化德县", "CityID": 355, "DisSort": null }, { "Id": 2761, "DisName": "商都县", "CityID": 355, "DisSort": null }, { "Id": 2762, "DisName": "兴和县", "CityID": 355, "DisSort": null }, { "Id": 2763, "DisName": "凉城县", "CityID": 355, "DisSort": null }, { "Id": 2764, "DisName": "察哈尔右翼前旗", "CityID": 355, "DisSort": null }, { "Id": 2765, "DisName": "察哈尔右翼中旗", "CityID": 355, "DisSort": null }, { "Id": 2766, "DisName": "察哈尔右翼后旗", "CityID": 355, "DisSort": null }, { "Id": 2767, "DisName": "四子王旗", "CityID": 355, "DisSort": null }, { "Id": 2768, "DisName": "丰镇市", "CityID": 355, "DisSort": null }, { "Id": 2769, "DisName": "科尔沁区", "CityID": 356, "DisSort": null }, { "Id": 2770, "DisName": "科尔沁左翼中旗", "CityID": 356, "DisSort": null }, { "Id": 2771, "DisName": "科尔沁左翼后旗", "CityID": 356, "DisSort": null }, { "Id": 2772, "DisName": "开鲁县", "CityID": 356, "DisSort": null }, { "Id": 2773, "DisName": "库伦旗", "CityID": 356, "DisSort": null }, { "Id": 2774, "DisName": "奈曼旗", "CityID": 356, "DisSort": null }, { "Id": 2775, "DisName": "扎鲁特旗", "CityID": 356, "DisSort": null }, { "Id": 2776, "DisName": "霍林郭勒市", "CityID": 356, "DisSort": null }, { "Id": 2777, "DisName": "红山区", "CityID": 357, "DisSort": null }, { "Id": 2778, "DisName": "元宝山区", "CityID": 357, "DisSort": null }, { "Id": 2779, "DisName": "松山区", "CityID": 357, "DisSort": null }, { "Id": 2780, "DisName": "阿鲁科尔沁旗", "CityID": 357, "DisSort": null }, { "Id": 2781, "DisName": "巴林左旗", "CityID": 357, "DisSort": null }, { "Id": 2782, "DisName": "巴林右旗", "CityID": 357, "DisSort": null }, { "Id": 2783, "DisName": "林西县", "CityID": 357, "DisSort": null }, { "Id": 2784, "DisName": "克什克腾旗", "CityID": 357, "DisSort": null }, { "Id": 2785, "DisName": "翁牛特旗", "CityID": 357, "DisSort": null }, { "Id": 2786, "DisName": "喀喇沁旗", "CityID": 357, "DisSort": null }, { "Id": 2787, "DisName": "宁城县", "CityID": 357, "DisSort": null }, { "Id": 2788, "DisName": "敖汉旗", "CityID": 357, "DisSort": null }, { "Id": 2789, "DisName": "东胜区", "CityID": 358, "DisSort": null }, { "Id": 2790, "DisName": "达拉特旗", "CityID": 358, "DisSort": null }, { "Id": 2791, "DisName": "准格尔旗", "CityID": 358, "DisSort": null }, { "Id": 2792, "DisName": "鄂托克前旗", "CityID": 358, "DisSort": null }, { "Id": 2793, "DisName": "鄂托克旗", "CityID": 358, "DisSort": null }, { "Id": 2794, "DisName": "杭锦旗", "CityID": 358, "DisSort": null }, { "Id": 2795, "DisName": "乌审旗", "CityID": 358, "DisSort": null }, { "Id": 2796, "DisName": "伊金霍洛旗", "CityID": 358, "DisSort": null }, { "Id": 2797, "DisName": "临河区", "CityID": 359, "DisSort": null }, { "Id": 2798, "DisName": "五原县", "CityID": 359, "DisSort": null }, { "Id": 2799, "DisName": "磴口县", "CityID": 359, "DisSort": null }, { "Id": 2800, "DisName": "乌拉特前旗", "CityID": 359, "DisSort": null }, { "Id": 2801, "DisName": "乌拉特中旗", "CityID": 359, "DisSort": null }, { "Id": 2802, "DisName": "乌拉特后旗", "CityID": 359, "DisSort": null }, { "Id": 2803, "DisName": "杭锦后旗", "CityID": 359, "DisSort": null }, { "Id": 2804, "DisName": "二连浩特市", "CityID": 360, "DisSort": null }, { "Id": 2805, "DisName": "锡林浩特市", "CityID": 360, "DisSort": null }, { "Id": 2806, "DisName": "阿巴嘎旗", "CityID": 360, "DisSort": null }, { "Id": 2807, "DisName": "苏尼特左旗", "CityID": 360, "DisSort": null }, { "Id": 2808, "DisName": "苏尼特右旗", "CityID": 360, "DisSort": null }, { "Id": 2809, "DisName": "东乌珠穆沁旗", "CityID": 360, "DisSort": null }, { "Id": 2810, "DisName": "西乌珠穆沁旗", "CityID": 360, "DisSort": null }, { "Id": 2811, "DisName": "太仆寺旗", "CityID": 360, "DisSort": null }, { "Id": 2812, "DisName": "镶黄旗", "CityID": 360, "DisSort": null }, { "Id": 2813, "DisName": "正镶白旗", "CityID": 360, "DisSort": null }, { "Id": 2814, "DisName": "正蓝旗", "CityID": 360, "DisSort": null }, { "Id": 2815, "DisName": "多伦县", "CityID": 360, "DisSort": null }, { "Id": 2816, "DisName": "乌兰浩特市", "CityID": 361, "DisSort": null }, { "Id": 2817, "DisName": "阿尔山市", "CityID": 361, "DisSort": null }, { "Id": 2818, "DisName": "科尔沁右翼前旗", "CityID": 361, "DisSort": null }, { "Id": 2819, "DisName": "科尔沁右翼中旗", "CityID": 361, "DisSort": null }, { "Id": 2820, "DisName": "扎赉特旗", "CityID": 361, "DisSort": null }, { "Id": 2821, "DisName": "突泉县", "CityID": 361, "DisSort": null }, { "Id": 2822, "DisName": "阿拉善左旗", "CityID": 362, "DisSort": null }, { "Id": 2823, "DisName": "阿拉善右旗", "CityID": 362, "DisSort": null }, { "Id": 2824, "DisName": "额济纳旗", "CityID": 362, "DisSort": null } ] } ================================================ FILE: src/Coldairarrow.Web/Config/SystemMenu.config ================================================  ================================================ FILE: src/Coldairarrow.Web/Config/UrlPermission.config ================================================  ================================================ FILE: src/Coldairarrow.Web/Config/database.config ================================================  ================================================ FILE: src/Coldairarrow.Web/Config/system.config ================================================  ================================================ FILE: src/Coldairarrow.Web/Controllers/DemoController.cs ================================================ using Coldairarrow.Util; using System.IO; using System.Web.Mvc; namespace Coldairarrow.Web.Controllers { public class DemoController : BaseController { #region 视图 public ActionResult UMEditor() { return View(); } public ActionResult UploadFileIndex() { return View(); } public ActionResult UploadFileForm() { return View(); } public ActionResult UploadImgView() { return View(); } #endregion #region 接口 public ActionResult UploadFile(string fileBase64, string fileName,string data) { byte[] bytes = fileBase64.ToBytes_FromBase64Str(); string fileDir = System.Web.HttpContext.Current.Server.MapPath("~/Upload/File"); if (!Directory.Exists(fileDir)) Directory.CreateDirectory(fileDir); string filePath = Path.Combine(fileDir, fileName); using (FileStream fileStream = new FileStream(filePath, FileMode.Create)) { using (MemoryStream m = new MemoryStream(bytes)) { m.WriteTo(fileStream); } } return Success(); } public ActionResult UploadImg(string fileName, string data) { //byte[] bytes = ImgHelper.GetBase64String(data).ToBytes_FromBase64Str(); var url = ImgHelper.GetImgUrl(data); //string fileDir = System.Web.HttpContext.Current.Server.MapPath("~/Upload/File"); //if (!Directory.Exists(fileDir)) // Directory.CreateDirectory(fileDir); //string filePath = Path.Combine(fileDir, fileName); //using (FileStream fileStream = new FileStream(filePath, FileMode.Create)) //{ // using (MemoryStream m = new MemoryStream(bytes)) // { // m.WriteTo(fileStream); // } //} var res = new { success=true, src=url }; return JsonContent(res.ToJson()); } #endregion } } ================================================ FILE: src/Coldairarrow.Web/Controllers/HomeController.cs ================================================ using Coldairarrow.Business.Base_SysManage; using Coldairarrow.Business.Common; using Coldairarrow.Util; using System.Web.Mvc; namespace Coldairarrow.Web { public class HomeController : BaseMvcController { HomeBusiness _homeBus { get; } = new HomeBusiness(); #region 视图功能 public ActionResult Index() { return View(); } [IgnoreLogin] public ActionResult Login() { if (Operator.Logged()) { string loginUrl = Url.Content("~/"); string script = $@" "; return Content(script); } return View(); } public ActionResult Desktop() { return View(); } public ActionResult Test() { return View(); } #endregion #region 获取数据 #endregion #region 提交数据 [IgnoreLogin] public ActionResult SubmitLogin(string userName, string password) { AjaxResult res = _homeBus.SubmitLogin(userName, password); return Content(res.ToJson()); } /// /// 注销 /// public ActionResult Logout() { Operator.Logout(); return Success("注销成功!"); } #endregion } } ================================================ FILE: src/Coldairarrow.Web/Controllers/TestController.cs ================================================ using Coldairarrow.Business; using Coldairarrow.DotNettyRPC; using System.Web.Mvc; namespace Coldairarrow.Web { public interface IHello { string SayHello(string msg); } public class Hello : IHello { public string SayHello(string msg) { return msg; } } public class TestController : BaseController { public ActionResult Index() { return View(); } [CheckParamNotEmpty("aa")] public ActionResult Test() { return Success(); } } } ================================================ FILE: src/Coldairarrow.Web/Download/_.txt ================================================ ================================================ FILE: src/Coldairarrow.Web/Global.asax ================================================ <%@ Application Codebehind="Global.asax.cs" Inherits="Coldairarrow.Web.MvcApplication" Language="C#" %> ================================================ FILE: src/Coldairarrow.Web/Global.asax.cs ================================================ using AutoMapper; using Coldairarrow.Business.Base_SysManage; using Coldairarrow.DataRepository; using Coldairarrow.Entity.Base_SysManage; using Coldairarrow.Util; using System.Linq; using System.Threading.Tasks; using System.Web; using System.Web.Mvc; using System.Web.Routing; namespace Coldairarrow.Web { public class MvcApplication : HttpApplication { /// /// 程序启动时执行 /// 注:重新编译后执行 /// protected void Application_Start() { //注册路由 RouteConfig.RegisterRoutes(RouteTable.Routes); //注册全局异常捕捉器 FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); InitAutoMapper(); InitEF(); } /// /// 初始化AutoMapper /// private void InitAutoMapper() { Mapper.Initialize(cfg => { cfg.CreateMap(); }); } /// /// EF预热 /// private void InitEF() { Task.Run(() => { var db = DbFactory.GetRepository(); db.GetIQueryable().ToList(); }); } } } ================================================ FILE: src/Coldairarrow.Web/Properties/AssemblyInfo.cs ================================================ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过下列特性集 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Coldairarrow.Web")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Coldairarrow.Web")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 会使此程序集中的类型 // 对 COM 组件不可见。如果需要 // 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID [assembly: Guid("3cd25499-8291-48bb-9a24-d99bc1675a0d")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 内部版本号 // 修订版本 // // 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值, // 方法是按如下所示使用 "*": [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] ================================================ FILE: src/Coldairarrow.Web/Properties/PublishProfiles/FolderProfile.pubxml ================================================ FileSystem FileSystem Release Any CPU True False C:\Users\Coldairarrow\Desktop\Web True True False False DonotMerge ================================================ FILE: src/Coldairarrow.Web/Scripts/business/requestbusiness.js ================================================ //构建请求参数,使用默认签名 function buildRequestParam(businessParam) { var appId = config.appId; var appSecret = config.appSecret; var requestParam = {}; Object.keys(businessParam).forEach(function (aKey) { requestParam[aKey] = businessParam[aKey]; }); requestParam["appId"] = appId; requestParam["time"] = (new Date()).format("yyyy-MM-dd hh:mm:ss"); var signBuilder = ""; Object.keys(requestParam).sort().forEach(function (aKey) { var value = ""; if (requestParam[aKey]) { value = requestParam[aKey]; } signBuilder += (aKey + value) }); signBuilder += appSecret; var sign = md5(signBuilder).toUpperCase(); requestParam["sign"] = sign; return requestParam; } ================================================ FILE: src/Coldairarrow.Web/Scripts/config.js ================================================ //前端配置信息 var config = { //应用Id appId: "AppTest", //应用密钥 appSecret: "7c109ae2-cc14-4328-9cb9-3f8c0433cfb2", //百度地图使用的key BaiduMapKey: '6BRpIPAF8Z87yrIwoPiSK7kykvGtp2wg' }; ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/datagrid-cellediting.js ================================================ $.extend($.fn.datagrid.methods, { editCell: function (jq, param) { return jq.each(function () { var opts = $(this).datagrid('options'); var fields = $(this).datagrid('getColumnFields', true).concat($(this).datagrid('getColumnFields')); for (var i = 0; i < fields.length; i++) { var col = $(this).datagrid('getColumnOption', fields[i]); col.editor1 = col.editor; if (fields[i] != param.field) { col.editor = null; } } $(this).datagrid('beginEdit', param.index); var ed = $(this).datagrid('getEditor', param); if (ed) { if ($(ed.target).hasClass('textbox-f')) { $(ed.target).textbox('textbox').focus(); } else { $(ed.target).focus(); } } for (var i = 0; i < fields.length; i++) { var col = $(this).datagrid('getColumnOption', fields[i]); col.editor = col.editor1; } }); }, enableCellEditing: function (jq) { return jq.each(function () { var dg = $(this); var opts = dg.datagrid('options'); opts.oldOnClickCell = opts.onClickCell; opts.onClickCell = function (index, field) { if (opts.editIndex != undefined) { if (dg.datagrid('validateRow', opts.editIndex)) { dg.datagrid('endEdit', opts.editIndex); opts.editIndex = undefined; } else { return; } } dg.datagrid('selectRow', index).datagrid('editCell', { index: index, field: field }); opts.editIndex = index; opts.oldOnClickCell.call(this, index, field); } }); } }); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/easyloader.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function(){ var _1={draggable:{js:"jquery.draggable.js"},droppable:{js:"jquery.droppable.js"},resizable:{js:"jquery.resizable.js"},linkbutton:{js:"jquery.linkbutton.js",css:"linkbutton.css"},progressbar:{js:"jquery.progressbar.js",css:"progressbar.css"},tooltip:{js:"jquery.tooltip.js",css:"tooltip.css"},pagination:{js:"jquery.pagination.js",css:"pagination.css",dependencies:["linkbutton"]},datagrid:{js:"jquery.datagrid.js",css:"datagrid.css",dependencies:["panel","resizable","linkbutton","pagination"]},treegrid:{js:"jquery.treegrid.js",css:"tree.css",dependencies:["datagrid"]},propertygrid:{js:"jquery.propertygrid.js",css:"propertygrid.css",dependencies:["datagrid"]},datalist:{js:"jquery.datalist.js",css:"datalist.css",dependencies:["datagrid"]},panel:{js:"jquery.panel.js",css:"panel.css"},window:{js:"jquery.window.js",css:"window.css",dependencies:["resizable","draggable","panel"]},dialog:{js:"jquery.dialog.js",css:"dialog.css",dependencies:["linkbutton","window"]},messager:{js:"jquery.messager.js",css:"messager.css",dependencies:["linkbutton","dialog","progressbar"]},layout:{js:"jquery.layout.js",css:"layout.css",dependencies:["resizable","panel"]},form:{js:"jquery.form.js"},menu:{js:"jquery.menu.js",css:"menu.css"},tabs:{js:"jquery.tabs.js",css:"tabs.css",dependencies:["panel","linkbutton"]},menubutton:{js:"jquery.menubutton.js",css:"menubutton.css",dependencies:["linkbutton","menu"]},splitbutton:{js:"jquery.splitbutton.js",css:"splitbutton.css",dependencies:["menubutton"]},switchbutton:{js:"jquery.switchbutton.js",css:"switchbutton.css"},accordion:{js:"jquery.accordion.js",css:"accordion.css",dependencies:["panel"]},calendar:{js:"jquery.calendar.js",css:"calendar.css"},textbox:{js:"jquery.textbox.js",css:"textbox.css",dependencies:["validatebox","linkbutton"]},passwordbox:{js:"jquery.passwordbox.js",css:"passwordbox.css",dependencies:["textbox"]},filebox:{js:"jquery.filebox.js",css:"filebox.css",dependencies:["textbox"]},combo:{js:"jquery.combo.js",css:"combo.css",dependencies:["panel","textbox"]},combobox:{js:"jquery.combobox.js",css:"combobox.css",dependencies:["combo"]},combotree:{js:"jquery.combotree.js",dependencies:["combo","tree"]},combogrid:{js:"jquery.combogrid.js",dependencies:["combo","datagrid"]},combotreegrid:{js:"jquery.combotreegrid.js",dependencies:["combo","treegrid"]},tagbox:{js:"jquery.tagbox.js",dependencies:["combobox"]},validatebox:{js:"jquery.validatebox.js",css:"validatebox.css",dependencies:["tooltip"]},numberbox:{js:"jquery.numberbox.js",dependencies:["textbox"]},searchbox:{js:"jquery.searchbox.js",css:"searchbox.css",dependencies:["menubutton","textbox"]},spinner:{js:"jquery.spinner.js",css:"spinner.css",dependencies:["textbox"]},numberspinner:{js:"jquery.numberspinner.js",dependencies:["spinner","numberbox"]},timespinner:{js:"jquery.timespinner.js",dependencies:["spinner"]},tree:{js:"jquery.tree.js",css:"tree.css",dependencies:["draggable","droppable"]},datebox:{js:"jquery.datebox.js",css:"datebox.css",dependencies:["calendar","combo"]},datetimebox:{js:"jquery.datetimebox.js",dependencies:["datebox","timespinner"]},slider:{js:"jquery.slider.js",dependencies:["draggable"]},parser:{js:"jquery.parser.js"},mobile:{js:"jquery.mobile.js"}}; var _2={"af":"easyui-lang-af.js","ar":"easyui-lang-ar.js","bg":"easyui-lang-bg.js","ca":"easyui-lang-ca.js","cs":"easyui-lang-cs.js","cz":"easyui-lang-cz.js","da":"easyui-lang-da.js","de":"easyui-lang-de.js","el":"easyui-lang-el.js","en":"easyui-lang-en.js","es":"easyui-lang-es.js","fr":"easyui-lang-fr.js","it":"easyui-lang-it.js","jp":"easyui-lang-jp.js","nl":"easyui-lang-nl.js","pl":"easyui-lang-pl.js","pt_BR":"easyui-lang-pt_BR.js","ru":"easyui-lang-ru.js","sv_SE":"easyui-lang-sv_SE.js","tr":"easyui-lang-tr.js","zh_CN":"easyui-lang-zh_CN.js","zh_TW":"easyui-lang-zh_TW.js"}; var _3={}; function _4(_5,_6){ var _7=false; var _8=document.createElement("script"); _8.type="text/javascript"; _8.language="javascript"; _8.src=_5; _8.onload=_8.onreadystatechange=function(){ if(!_7&&(!_8.readyState||_8.readyState=="loaded"||_8.readyState=="complete")){ _7=true; _8.onload=_8.onreadystatechange=null; if(_6){ _6.call(_8); } } }; document.getElementsByTagName("head")[0].appendChild(_8); }; function _9(_a,_b){ _4(_a,function(){ document.getElementsByTagName("head")[0].removeChild(this); if(_b){ _b(); } }); }; function _c(_d,_e){ var _f=document.createElement("link"); _f.rel="stylesheet"; _f.type="text/css"; _f.media="screen"; _f.href=_d; document.getElementsByTagName("head")[0].appendChild(_f); if(_e){ _e.call(_f); } }; function _10(_11,_12){ _3[_11]="loading"; var _13=_1[_11]; var _14="loading"; var _15=(easyloader.css&&_13["css"])?"loading":"loaded"; if(easyloader.css&&_13["css"]){ if(/^http/i.test(_13["css"])){ var url=_13["css"]; }else{ var url=easyloader.base+"themes/"+easyloader.theme+"/"+_13["css"]; } _c(url,function(){ _15="loaded"; if(_14=="loaded"&&_15=="loaded"){ _16(); } }); } if(/^http/i.test(_13["js"])){ var url=_13["js"]; }else{ var url=easyloader.base+"plugins/"+_13["js"]; } _4(url,function(){ _14="loaded"; if(_14=="loaded"&&_15=="loaded"){ _16(); } }); function _16(){ _3[_11]="loaded"; easyloader.onProgress(_11); if(_12){ _12(); } }; }; function _17(_18,_19){ var mm=[]; var _1a=false; if(typeof _18=="string"){ add(_18); }else{ for(var i=0;i<_18.length;i++){ add(_18[i]); } } function add(_1b){ if(!_1[_1b]){ return; } var d=_1[_1b]["dependencies"]; if(d){ for(var i=0;i.panel>.accordion-header"); if(_9.length){ _7=$(_9[0]).css("height","")._outerHeight(); } if(!isNaN(parseInt(_5.height))){ _8=cc.height()-_7*_9.length; } _a(true,_8-_a(false)+1); function _a(_b,_c){ var _d=0; for(var i=0;i<_6.length;i++){ var p=_6[i]; var h=p.panel("header")._outerHeight(_7); if(p.panel("options").collapsible==_b){ var _e=isNaN(_c)?undefined:(_c+_7*h.length); p.panel("resize",{width:cc.width(),height:(_b?_e:undefined)}); _d+=p.panel("panel").outerHeight()-_7*h.length; } } return _d; }; }; function _f(_10,_11,_12,all){ var _13=$.data(_10,"accordion").panels; var pp=[]; for(var i=0;i<_13.length;i++){ var p=_13[i]; if(_11){ if(p.panel("options")[_11]==_12){ pp.push(p); } }else{ if(p[0]==$(_12)[0]){ return i; } } } if(_11){ return all?pp:(pp.length?pp[0]:null); }else{ return -1; } }; function _14(_15){ return _f(_15,"collapsed",false,true); }; function _16(_17){ var pp=_14(_17); return pp.length?pp[0]:null; }; function _18(_19,_1a){ return _f(_19,null,_1a); }; function _1b(_1c,_1d){ var _1e=$.data(_1c,"accordion").panels; if(typeof _1d=="number"){ if(_1d<0||_1d>=_1e.length){ return null; }else{ return _1e[_1d]; } } return _f(_1c,"title",_1d); }; function _1f(_20){ var _21=$.data(_20,"accordion").options; var cc=$(_20); if(_21.border){ cc.removeClass("accordion-noborder"); }else{ cc.addClass("accordion-noborder"); } }; function _22(_23){ var _24=$.data(_23,"accordion"); var cc=$(_23); cc.addClass("accordion"); _24.panels=[]; cc.children("div").each(function(){ var _25=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)}); var pp=$(this); _24.panels.push(pp); _27(_23,pp,_25); }); cc.bind("_resize",function(e,_26){ if($(this).hasClass("easyui-fluid")||_26){ _1(_23); } return false; }); }; function _27(_28,pp,_29){ var _2a=$.data(_28,"accordion").options; pp.panel($.extend({},{collapsible:true,minimizable:false,maximizable:false,closable:false,doSize:false,collapsed:true,headerCls:"accordion-header",bodyCls:"accordion-body"},_29,{onBeforeExpand:function(){ if(_29.onBeforeExpand){ if(_29.onBeforeExpand.call(this)==false){ return false; } } if(!_2a.multiple){ var all=$.grep(_14(_28),function(p){ return p.panel("options").collapsible; }); for(var i=0;i").addClass("accordion-collapse accordion-expand").appendTo(_2e); t.bind("click",function(){ _2f(pp); return false; }); pp.panel("options").collapsible?t.show():t.hide(); _2d.click(function(){ _2f(pp); return false; }); function _2f(p){ var _30=p.panel("options"); if(_30.collapsible){ var _31=_18(_28,p); if(_30.collapsed){ _32(_28,_31); }else{ _33(_28,_31); } } }; }; function _32(_34,_35){ var p=_1b(_34,_35); if(!p){ return; } _36(_34); var _37=$.data(_34,"accordion").options; p.panel("expand",_37.animate); }; function _33(_38,_39){ var p=_1b(_38,_39); if(!p){ return; } _36(_38); var _3a=$.data(_38,"accordion").options; p.panel("collapse",_3a.animate); }; function _3b(_3c){ var _3d=$.data(_3c,"accordion").options; var p=_f(_3c,"selected",true); if(p){ _3e(_18(_3c,p)); }else{ _3e(_3d.selected); } function _3e(_3f){ var _40=_3d.animate; _3d.animate=false; _32(_3c,_3f); _3d.animate=_40; }; }; function _36(_41){ var _42=$.data(_41,"accordion").panels; for(var i=0;i<_42.length;i++){ _42[i].stop(true,true); } }; function add(_43,_44){ var _45=$.data(_43,"accordion"); var _46=_45.options; var _47=_45.panels; if(_44.selected==undefined){ _44.selected=true; } _36(_43); var pp=$("
").appendTo(_43); _47.push(pp); _27(_43,pp,_44); _1(_43); _46.onAdd.call(_43,_44.title,_47.length-1); if(_44.selected){ _32(_43,_47.length-1); } }; function _48(_49,_4a){ var _4b=$.data(_49,"accordion"); var _4c=_4b.options; var _4d=_4b.panels; _36(_49); var _4e=_1b(_49,_4a); var _4f=_4e.panel("options").title; var _50=_18(_49,_4e); if(!_4e){ return; } if(_4c.onBeforeRemove.call(_49,_4f,_50)==false){ return; } _4d.splice(_50,1); _4e.panel("destroy"); if(_4d.length){ _1(_49); var _51=_16(_49); if(!_51){ _32(_49,0); } } _4c.onRemove.call(_49,_4f,_50); }; $.fn.accordion=function(_52,_53){ if(typeof _52=="string"){ return $.fn.accordion.methods[_52](this,_53); } _52=_52||{}; return this.each(function(){ var _54=$.data(this,"accordion"); if(_54){ $.extend(_54.options,_52); }else{ $.data(this,"accordion",{options:$.extend({},$.fn.accordion.defaults,$.fn.accordion.parseOptions(this),_52),accordion:$(this).addClass("accordion"),panels:[]}); _22(this); } _1f(this); _1(this); _3b(this); }); }; $.fn.accordion.methods={options:function(jq){ return $.data(jq[0],"accordion").options; },panels:function(jq){ return $.data(jq[0],"accordion").panels; },resize:function(jq,_55){ return jq.each(function(){ _1(this,_55); }); },getSelections:function(jq){ return _14(jq[0]); },getSelected:function(jq){ return _16(jq[0]); },getPanel:function(jq,_56){ return _1b(jq[0],_56); },getPanelIndex:function(jq,_57){ return _18(jq[0],_57); },select:function(jq,_58){ return jq.each(function(){ _32(this,_58); }); },unselect:function(jq,_59){ return jq.each(function(){ _33(this,_59); }); },add:function(jq,_5a){ return jq.each(function(){ add(this,_5a); }); },remove:function(jq,_5b){ return jq.each(function(){ _48(this,_5b); }); }}; $.fn.accordion.parseOptions=function(_5c){ var t=$(_5c); return $.extend({},$.parser.parseOptions(_5c,["width","height",{fit:"boolean",border:"boolean",animate:"boolean",multiple:"boolean",selected:"number"}])); }; $.fn.accordion.defaults={width:"auto",height:"auto",fit:false,border:true,animate:true,multiple:false,selected:0,onSelect:function(_5d,_5e){ },onUnselect:function(_5f,_60){ },onAdd:function(_61,_62){ },onBeforeRemove:function(_63,_64){ },onRemove:function(_65,_66){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.calendar.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2,_3){ var _4=$.data(_2,"calendar").options; var t=$(_2); if(_3){ $.extend(_4,{width:_3.width,height:_3.height}); } t._size(_4,t.parent()); t.find(".calendar-body")._outerHeight(t.height()-t.find(".calendar-header")._outerHeight()); if(t.find(".calendar-menu").is(":visible")){ _5(_2); } }; function _6(_7){ $(_7).addClass("calendar").html("
"+"
"+"
"+"
"+"
"+"
"+""+"
"+"
"+"
"+"
"+"
"+""+""+""+"
"+"
"+"
"+"
"+"
"); $(_7).bind("_resize",function(e,_8){ if($(this).hasClass("easyui-fluid")||_8){ _1(_7); } return false; }); }; function _9(_a){ var _b=$.data(_a,"calendar").options; var _c=$(_a).find(".calendar-menu"); _c.find(".calendar-menu-year").unbind(".calendar").bind("keypress.calendar",function(e){ if(e.keyCode==13){ _d(true); } }); $(_a).unbind(".calendar").bind("mouseover.calendar",function(e){ var t=_e(e.target); if(t.hasClass("calendar-nav")||t.hasClass("calendar-text")||(t.hasClass("calendar-day")&&!t.hasClass("calendar-disabled"))){ t.addClass("calendar-nav-hover"); } }).bind("mouseout.calendar",function(e){ var t=_e(e.target); if(t.hasClass("calendar-nav")||t.hasClass("calendar-text")||(t.hasClass("calendar-day")&&!t.hasClass("calendar-disabled"))){ t.removeClass("calendar-nav-hover"); } }).bind("click.calendar",function(e){ var t=_e(e.target); if(t.hasClass("calendar-menu-next")||t.hasClass("calendar-nextyear")){ _f(1); }else{ if(t.hasClass("calendar-menu-prev")||t.hasClass("calendar-prevyear")){ _f(-1); }else{ if(t.hasClass("calendar-menu-month")){ _c.find(".calendar-selected").removeClass("calendar-selected"); t.addClass("calendar-selected"); _d(true); }else{ if(t.hasClass("calendar-prevmonth")){ _10(-1); }else{ if(t.hasClass("calendar-nextmonth")){ _10(1); }else{ if(t.hasClass("calendar-text")){ if(_c.is(":visible")){ _c.hide(); }else{ _5(_a); } }else{ if(t.hasClass("calendar-day")){ if(t.hasClass("calendar-disabled")){ return; } var _11=_b.current; t.closest("div.calendar-body").find(".calendar-selected").removeClass("calendar-selected"); t.addClass("calendar-selected"); var _12=t.attr("abbr").split(","); var y=parseInt(_12[0]); var m=parseInt(_12[1]); var d=parseInt(_12[2]); _b.current=new Date(y,m-1,d); _b.onSelect.call(_a,_b.current); if(!_11||_11.getTime()!=_b.current.getTime()){ _b.onChange.call(_a,_b.current,_11); } if(_b.year!=y||_b.month!=m){ _b.year=y; _b.month=m; _19(_a); } } } } } } } } }); function _e(t){ var day=$(t).closest(".calendar-day"); if(day.length){ return day; }else{ return $(t); } }; function _d(_13){ var _14=$(_a).find(".calendar-menu"); var _15=_14.find(".calendar-menu-year").val(); var _16=_14.find(".calendar-selected").attr("abbr"); if(!isNaN(_15)){ _b.year=parseInt(_15); _b.month=parseInt(_16); _19(_a); } if(_13){ _14.hide(); } }; function _f(_17){ _b.year+=_17; _19(_a); _c.find(".calendar-menu-year").val(_b.year); }; function _10(_18){ _b.month+=_18; if(_b.month>12){ _b.year++; _b.month=1; }else{ if(_b.month<1){ _b.year--; _b.month=12; } } _19(_a); _c.find("td.calendar-selected").removeClass("calendar-selected"); _c.find("td:eq("+(_b.month-1)+")").addClass("calendar-selected"); }; }; function _5(_1a){ var _1b=$.data(_1a,"calendar").options; $(_1a).find(".calendar-menu").show(); if($(_1a).find(".calendar-menu-month-inner").is(":empty")){ $(_1a).find(".calendar-menu-month-inner").empty(); var t=$("
").appendTo($(_1a).find(".calendar-menu-month-inner")); var idx=0; for(var i=0;i<3;i++){ var tr=$("").appendTo(t); for(var j=0;j<4;j++){ $("").html(_1b.months[idx++]).attr("abbr",idx).appendTo(tr); } } } var _1c=$(_1a).find(".calendar-body"); var _1d=$(_1a).find(".calendar-menu"); var _1e=_1d.find(".calendar-menu-year-inner"); var _1f=_1d.find(".calendar-menu-month-inner"); _1e.find("input").val(_1b.year).focus(); _1f.find("td.calendar-selected").removeClass("calendar-selected"); _1f.find("td:eq("+(_1b.month-1)+")").addClass("calendar-selected"); _1d._outerWidth(_1c._outerWidth()); _1d._outerHeight(_1c._outerHeight()); _1f._outerHeight(_1d.height()-_1e._outerHeight()); }; function _20(_21,_22,_23){ var _24=$.data(_21,"calendar").options; var _25=[]; var _26=new Date(_22,_23,0).getDate(); for(var i=1;i<=_26;i++){ _25.push([_22,_23,i]); } var _27=[],_28=[]; var _29=-1; while(_25.length>0){ var _2a=_25.shift(); _28.push(_2a); var day=new Date(_2a[0],_2a[1]-1,_2a[2]).getDay(); if(_29==day){ day=0; }else{ if(day==(_24.firstDay==0?7:_24.firstDay)-1){ _27.push(_28); _28=[]; } } _29=day; } if(_28.length){ _27.push(_28); } var _2b=_27[0]; if(_2b.length<7){ while(_2b.length<7){ var _2c=_2b[0]; var _2a=new Date(_2c[0],_2c[1]-1,_2c[2]-1); _2b.unshift([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]); } }else{ var _2c=_2b[0]; var _28=[]; for(var i=1;i<=7;i++){ var _2a=new Date(_2c[0],_2c[1]-1,_2c[2]-i); _28.unshift([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]); } _27.unshift(_28); } var _2d=_27[_27.length-1]; while(_2d.length<7){ var _2e=_2d[_2d.length-1]; var _2a=new Date(_2e[0],_2e[1]-1,_2e[2]+1); _2d.push([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]); } if(_27.length<6){ var _2e=_2d[_2d.length-1]; var _28=[]; for(var i=1;i<=7;i++){ var _2a=new Date(_2e[0],_2e[1]-1,_2e[2]+i); _28.push([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]); } _27.push(_28); } return _27; }; function _19(_2f){ var _30=$.data(_2f,"calendar").options; if(_30.current&&!_30.validator.call(_2f,_30.current)){ _30.current=null; } var now=new Date(); var _31=now.getFullYear()+","+(now.getMonth()+1)+","+now.getDate(); var _32=_30.current?(_30.current.getFullYear()+","+(_30.current.getMonth()+1)+","+_30.current.getDate()):""; var _33=6-_30.firstDay; var _34=_33+1; if(_33>=7){ _33-=7; } if(_34>=7){ _34-=7; } $(_2f).find(".calendar-title span").html(_30.months[_30.month-1]+" "+_30.year); var _35=$(_2f).find("div.calendar-body"); _35.children("table").remove(); var _36=[""]; _36.push(""); if(_30.showWeek){ _36.push(""); } for(var i=_30.firstDay;i<_30.weeks.length;i++){ _36.push(""); } for(var i=0;i<_30.firstDay;i++){ _36.push(""); } _36.push(""); _36.push(""); var _37=_20(_2f,_30.year,_30.month); for(var i=0;i<_37.length;i++){ var _38=_37[i]; var cls=""; if(i==0){ cls="calendar-first"; }else{ if(i==_37.length-1){ cls="calendar-last"; } } _36.push(""); if(_30.showWeek){ var _39=_30.getWeekNumber(new Date(_38[0][0],parseInt(_38[0][1])-1,_38[0][2])); _36.push(""); } for(var j=0;j<_38.length;j++){ var day=_38[j]; var s=day[0]+","+day[1]+","+day[2]; var _3a=new Date(day[0],parseInt(day[1])-1,day[2]); var d=_30.formatter.call(_2f,_3a); var css=_30.styler.call(_2f,_3a); var _3b=""; var _3c=""; if(typeof css=="string"){ _3c=css; }else{ if(css){ _3b=css["class"]||""; _3c=css["style"]||""; } } var cls="calendar-day"; if(!(_30.year==day[0]&&_30.month==day[1])){ cls+=" calendar-other-month"; } if(s==_31){ cls+=" calendar-today"; } if(s==_32){ cls+=" calendar-selected"; } if(j==_33){ cls+=" calendar-saturday"; }else{ if(j==_34){ cls+=" calendar-sunday"; } } if(j==0){ cls+=" calendar-first"; }else{ if(j==_38.length-1){ cls+=" calendar-last"; } } cls+=" "+_3b; if(!_30.validator.call(_2f,_3a)){ cls+=" calendar-disabled"; } _36.push(""); } _36.push(""); } _36.push(""); _36.push("
"+_30.weekNumberHeader+""+_30.weeks[i]+""+_30.weeks[i]+"
"+_39+""+d+"
"); _35.append(_36.join("")); _35.children("table.calendar-dtable").prependTo(_35); _30.onNavigate.call(_2f,_30.year,_30.month); }; $.fn.calendar=function(_3d,_3e){ if(typeof _3d=="string"){ return $.fn.calendar.methods[_3d](this,_3e); } _3d=_3d||{}; return this.each(function(){ var _3f=$.data(this,"calendar"); if(_3f){ $.extend(_3f.options,_3d); }else{ _3f=$.data(this,"calendar",{options:$.extend({},$.fn.calendar.defaults,$.fn.calendar.parseOptions(this),_3d)}); _6(this); } if(_3f.options.border==false){ $(this).addClass("calendar-noborder"); } _1(this); _9(this); _19(this); $(this).find("div.calendar-menu").hide(); }); }; $.fn.calendar.methods={options:function(jq){ return $.data(jq[0],"calendar").options; },resize:function(jq,_40){ return jq.each(function(){ _1(this,_40); }); },moveTo:function(jq,_41){ return jq.each(function(){ if(!_41){ var now=new Date(); $(this).calendar({year:now.getFullYear(),month:now.getMonth()+1,current:_41}); return; } var _42=$(this).calendar("options"); if(_42.validator.call(this,_41)){ var _43=_42.current; $(this).calendar({year:_41.getFullYear(),month:_41.getMonth()+1,current:_41}); if(!_43||_43.getTime()!=_41.getTime()){ _42.onChange.call(this,_42.current,_43); } } }); }}; $.fn.calendar.parseOptions=function(_44){ var t=$(_44); return $.extend({},$.parser.parseOptions(_44,["weekNumberHeader",{firstDay:"number",fit:"boolean",border:"boolean",showWeek:"boolean"}])); }; $.fn.calendar.defaults={width:180,height:180,fit:false,border:true,showWeek:false,firstDay:0,weeks:["S","M","T","W","T","F","S"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],year:new Date().getFullYear(),month:new Date().getMonth()+1,current:(function(){ var d=new Date(); return new Date(d.getFullYear(),d.getMonth(),d.getDate()); })(),weekNumberHeader:"",getWeekNumber:function(_45){ var _46=new Date(_45.getTime()); _46.setDate(_46.getDate()+4-(_46.getDay()||7)); var _47=_46.getTime(); _46.setMonth(0); _46.setDate(1); return Math.floor(Math.round((_47-_46)/86400000)/7)+1; },formatter:function(_48){ return _48.getDate(); },styler:function(_49){ return ""; },validator:function(_4a){ return true; },onSelect:function(_4b){ },onChange:function(_4c,_4d){ },onNavigate:function(_4e,_4f){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.combo.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ $(function(){ $(document).unbind(".combo").bind("mousedown.combo mousewheel.combo",function(e){ var p=$(e.target).closest("span.combo,div.combo-p,div.menu"); if(p.length){ _1(p); return; } $("body>div.combo-p>div.combo-panel:visible").panel("close"); }); }); function _2(_3){ var _4=$.data(_3,"combo"); var _5=_4.options; if(!_4.panel){ _4.panel=$("
").appendTo("body"); _4.panel.panel({minWidth:_5.panelMinWidth,maxWidth:_5.panelMaxWidth,minHeight:_5.panelMinHeight,maxHeight:_5.panelMaxHeight,doSize:false,closed:true,cls:"combo-p",style:{position:"absolute",zIndex:10},onOpen:function(){ var _6=$(this).panel("options").comboTarget; var _7=$.data(_6,"combo"); if(_7){ _7.options.onShowPanel.call(_6); } },onBeforeClose:function(){ _1($(this).parent()); },onClose:function(){ var _8=$(this).panel("options").comboTarget; var _9=$(_8).data("combo"); if(_9){ _9.options.onHidePanel.call(_8); } }}); } var _a=$.extend(true,[],_5.icons); if(_5.hasDownArrow){ _a.push({iconCls:"combo-arrow",handler:function(e){ _f(e.data.target); }}); } $(_3).addClass("combo-f").textbox($.extend({},_5,{icons:_a,onChange:function(){ }})); $(_3).attr("comboName",$(_3).attr("textboxName")); _4.combo=$(_3).next(); _4.combo.addClass("combo"); }; function _b(_c){ var _d=$.data(_c,"combo"); var _e=_d.options; var p=_d.panel; if(p.is(":visible")){ p.panel("close"); } if(!_e.cloned){ p.panel("destroy"); } $(_c).textbox("destroy"); }; function _f(_10){ var _11=$.data(_10,"combo").panel; if(_11.is(":visible")){ var _12=_11.combo("combo"); _13(_12); if(_12!=_10){ $(_10).combo("showPanel"); } }else{ var p=$(_10).closest("div.combo-p").children(".combo-panel"); $("div.combo-panel:visible").not(_11).not(p).panel("close"); $(_10).combo("showPanel"); } $(_10).combo("textbox").focus(); }; function _1(_14){ $(_14).find(".combo-f").each(function(){ var p=$(this).combo("panel"); if(p.is(":visible")){ p.panel("close"); } }); }; function _15(e){ var _16=e.data.target; var _17=$.data(_16,"combo"); var _18=_17.options; if(!_18.editable){ _f(_16); }else{ var p=$(_16).closest("div.combo-p").children(".combo-panel"); $("div.combo-panel:visible").not(p).each(function(){ var _19=$(this).combo("combo"); if(_19!=_16){ _13(_19); } }); } }; function _1a(e){ var _1b=e.data.target; var t=$(_1b); var _1c=t.data("combo"); var _1d=t.combo("options"); _1c.panel.panel("options").comboTarget=_1b; switch(e.keyCode){ case 38: _1d.keyHandler.up.call(_1b,e); break; case 40: _1d.keyHandler.down.call(_1b,e); break; case 37: _1d.keyHandler.left.call(_1b,e); break; case 39: _1d.keyHandler.right.call(_1b,e); break; case 13: e.preventDefault(); _1d.keyHandler.enter.call(_1b,e); return false; case 9: case 27: _13(_1b); break; default: if(_1d.editable){ if(_1c.timer){ clearTimeout(_1c.timer); } _1c.timer=setTimeout(function(){ var q=t.combo("getText"); if(_1c.previousText!=q){ _1c.previousText=q; t.combo("showPanel"); _1d.keyHandler.query.call(_1b,q,e); t.combo("validate"); } },_1d.delay); } } }; function _1e(_1f){ var _20=$.data(_1f,"combo"); var _21=_20.combo; var _22=_20.panel; var _23=$(_1f).combo("options"); var _24=_22.panel("options"); _24.comboTarget=_1f; if(_24.closed){ _22.panel("panel").show().css({zIndex:($.fn.menu?$.fn.menu.defaults.zIndex++:($.fn.window?$.fn.window.defaults.zIndex++:99)),left:-999999}); _22.panel("resize",{width:(_23.panelWidth?_23.panelWidth:_21._outerWidth()),height:_23.panelHeight}); _22.panel("panel").hide(); _22.panel("open"); } (function(){ if(_24.comboTarget==_1f&&_22.is(":visible")){ _22.panel("move",{left:_25(),top:_26()}); setTimeout(arguments.callee,200); } })(); function _25(){ var _27=_21.offset().left; if(_23.panelAlign=="right"){ _27+=_21._outerWidth()-_22._outerWidth(); } if(_27+_22._outerWidth()>$(window)._outerWidth()+$(document).scrollLeft()){ _27=$(window)._outerWidth()+$(document).scrollLeft()-_22._outerWidth(); } if(_27<0){ _27=0; } return _27; }; function _26(){ var top=_21.offset().top+_21._outerHeight(); if(top+_22._outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){ top=_21.offset().top-_22._outerHeight(); } if(top<$(document).scrollTop()){ top=_21.offset().top+_21._outerHeight(); } return top; }; }; function _13(_28){ var _29=$.data(_28,"combo").panel; _29.panel("close"); }; function _2a(_2b,_2c){ var _2d=$.data(_2b,"combo"); var _2e=$(_2b).textbox("getText"); if(_2e!=_2c){ $(_2b).textbox("setText",_2c); } _2d.previousText=_2c; }; function _2f(_30){ var _31=$.data(_30,"combo"); var _32=_31.options; var _33=_31.combo; var _34=[]; _33.find(".textbox-value").each(function(){ _34.push($(this).val()); }); if(_32.multivalue){ return _34; }else{ return _34.length?_34[0].split(_32.separator):_34; } }; function _35(_36,_37){ var _38=$.data(_36,"combo"); var _39=_38.options; var _3a=_38.combo; if(!$.isArray(_37)){ _37=_37.split(_39.separator); } var _3b=_2f(_36); _3a.find(".textbox-value").remove(); if(_37.length){ if(_39.multivalue){ for(var i=0;i<_37.length;i++){ _3c(_37[i]); } }else{ _3c(_37.join(_39.separator)); } } function _3c(_3d){ var _3e=$(_36).attr("textboxName")||""; var _3f=$("").appendTo(_3a); _3f.attr("name",_3e); if(_39.disabled){ _3f.attr("disabled","disabled"); } _3f.val(_3d); }; var _40=(function(){ if(_3b.length!=_37.length){ return true; } for(var i=0;i<_37.length;i++){ if(_37[i]!=_3b[i]){ return true; } } return false; })(); if(_40){ $(_36).val(_37.join(_39.separator)); if(_39.multiple){ _39.onChange.call(_36,_37,_3b); }else{ _39.onChange.call(_36,_37[0],_3b[0]); } $(_36).closest("form").trigger("_change",[_36]); } }; function _41(_42){ var _43=_2f(_42); return _43[0]; }; function _44(_45,_46){ _35(_45,[_46]); }; function _47(_48){ var _49=$.data(_48,"combo").options; var _4a=_49.onChange; _49.onChange=function(){ }; if(_49.multiple){ _35(_48,_49.value?_49.value:[]); }else{ _44(_48,_49.value); } _49.onChange=_4a; }; $.fn.combo=function(_4b,_4c){ if(typeof _4b=="string"){ var _4d=$.fn.combo.methods[_4b]; if(_4d){ return _4d(this,_4c); }else{ return this.textbox(_4b,_4c); } } _4b=_4b||{}; return this.each(function(){ var _4e=$.data(this,"combo"); if(_4e){ $.extend(_4e.options,_4b); if(_4b.value!=undefined){ _4e.options.originalValue=_4b.value; } }else{ _4e=$.data(this,"combo",{options:$.extend({},$.fn.combo.defaults,$.fn.combo.parseOptions(this),_4b),previousText:""}); _4e.options.originalValue=_4e.options.value; } _2(this); _47(this); }); }; $.fn.combo.methods={options:function(jq){ var _4f=jq.textbox("options"); return $.extend($.data(jq[0],"combo").options,{width:_4f.width,height:_4f.height,disabled:_4f.disabled,readonly:_4f.readonly}); },cloneFrom:function(jq,_50){ return jq.each(function(){ $(this).textbox("cloneFrom",_50); $.data(this,"combo",{options:$.extend(true,{cloned:true},$(_50).combo("options")),combo:$(this).next(),panel:$(_50).combo("panel")}); $(this).addClass("combo-f").attr("comboName",$(this).attr("textboxName")); }); },combo:function(jq){ return jq.closest(".combo-panel").panel("options").comboTarget; },panel:function(jq){ return $.data(jq[0],"combo").panel; },destroy:function(jq){ return jq.each(function(){ _b(this); }); },showPanel:function(jq){ return jq.each(function(){ _1e(this); }); },hidePanel:function(jq){ return jq.each(function(){ _13(this); }); },clear:function(jq){ return jq.each(function(){ $(this).textbox("setText",""); var _51=$.data(this,"combo").options; if(_51.multiple){ $(this).combo("setValues",[]); }else{ $(this).combo("setValue",""); } }); },reset:function(jq){ return jq.each(function(){ var _52=$.data(this,"combo").options; if(_52.multiple){ $(this).combo("setValues",_52.originalValue); }else{ $(this).combo("setValue",_52.originalValue); } }); },setText:function(jq,_53){ return jq.each(function(){ _2a(this,_53); }); },getValues:function(jq){ return _2f(jq[0]); },setValues:function(jq,_54){ return jq.each(function(){ _35(this,_54); }); },getValue:function(jq){ return _41(jq[0]); },setValue:function(jq,_55){ return jq.each(function(){ _44(this,_55); }); }}; $.fn.combo.parseOptions=function(_56){ var t=$(_56); return $.extend({},$.fn.textbox.parseOptions(_56),$.parser.parseOptions(_56,["separator","panelAlign",{panelWidth:"number",hasDownArrow:"boolean",delay:"number",reversed:"boolean",multivalue:"boolean",selectOnNavigation:"boolean"},{panelMinWidth:"number",panelMaxWidth:"number",panelMinHeight:"number",panelMaxHeight:"number"}]),{panelHeight:(t.attr("panelHeight")=="auto"?"auto":parseInt(t.attr("panelHeight"))||undefined),multiple:(t.attr("multiple")?true:undefined)}); }; $.fn.combo.defaults=$.extend({},$.fn.textbox.defaults,{inputEvents:{click:_15,keydown:_1a,paste:_1a,drop:_1a},panelWidth:null,panelHeight:200,panelMinWidth:null,panelMaxWidth:null,panelMinHeight:null,panelMaxHeight:null,panelAlign:"left",reversed:false,multiple:false,multivalue:true,selectOnNavigation:true,separator:",",hasDownArrow:true,delay:200,keyHandler:{up:function(e){ },down:function(e){ },left:function(e){ },right:function(e){ },enter:function(e){ },query:function(q,e){ }},onShowPanel:function(){ },onHidePanel:function(){ },onChange:function(_57,_58){ }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.combobox.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2,_3){ var _4=$.data(_2,"combobox"); return $.easyui.indexOfArray(_4.data,_4.options.valueField,_3); }; function _5(_6,_7){ var _8=$.data(_6,"combobox").options; var _9=$(_6).combo("panel"); var _a=_8.finder.getEl(_6,_7); if(_a.length){ if(_a.position().top<=0){ var h=_9.scrollTop()+_a.position().top; _9.scrollTop(h); }else{ if(_a.position().top+_a.outerHeight()>_9.height()){ var h=_9.scrollTop()+_a.position().top+_a.outerHeight()-_9.height(); _9.scrollTop(h); } } } _9.triggerHandler("scroll"); }; function _b(_c,_d){ var _e=$.data(_c,"combobox").options; var _f=$(_c).combobox("panel"); var _10=_f.children("div.combobox-item-hover"); if(!_10.length){ _10=_f.children("div.combobox-item-selected"); } _10.removeClass("combobox-item-hover"); var _11="div.combobox-item:visible:not(.combobox-item-disabled):first"; var _12="div.combobox-item:visible:not(.combobox-item-disabled):last"; if(!_10.length){ _10=_f.children(_d=="next"?_11:_12); }else{ if(_d=="next"){ _10=_10.nextAll(_11); if(!_10.length){ _10=_f.children(_11); } }else{ _10=_10.prevAll(_11); if(!_10.length){ _10=_f.children(_12); } } } if(_10.length){ _10.addClass("combobox-item-hover"); var row=_e.finder.getRow(_c,_10); if(row){ $(_c).combobox("scrollTo",row[_e.valueField]); if(_e.selectOnNavigation){ _13(_c,row[_e.valueField]); } } } }; function _13(_14,_15,_16){ var _17=$.data(_14,"combobox").options; var _18=$(_14).combo("getValues"); if($.inArray(_15+"",_18)==-1){ if(_17.multiple){ _18.push(_15); }else{ _18=[_15]; } _19(_14,_18,_16); } }; function _1a(_1b,_1c){ var _1d=$.data(_1b,"combobox").options; var _1e=$(_1b).combo("getValues"); var _1f=$.inArray(_1c+"",_1e); if(_1f>=0){ _1e.splice(_1f,1); _19(_1b,_1e); } }; function _19(_20,_21,_22){ var _23=$.data(_20,"combobox").options; var _24=$(_20).combo("panel"); if(!$.isArray(_21)){ _21=_21.split(_23.separator); } if(!_23.multiple){ _21=_21.length?[_21[0]]:[""]; } var _25=$(_20).combo("getValues"); if(_24.is(":visible")){ _24.find(".combobox-item-selected").each(function(){ var row=_23.finder.getRow(_20,$(this)); if(row){ if($.easyui.indexOfArray(_25,row[_23.valueField])==-1){ $(this).removeClass("combobox-item-selected"); } } }); } $.map(_25,function(v){ if($.easyui.indexOfArray(_21,v)==-1){ var el=_23.finder.getEl(_20,v); if(el.hasClass("combobox-item-selected")){ el.removeClass("combobox-item-selected"); _23.onUnselect.call(_20,_23.finder.getRow(_20,v)); } } }); var _26=null; var vv=[],ss=[]; for(var i=0;i<_21.length;i++){ var v=_21[i]; var s=v; var row=_23.finder.getRow(_20,v); if(row){ s=row[_23.textField]; _26=row; var el=_23.finder.getEl(_20,v); if(!el.hasClass("combobox-item-selected")){ el.addClass("combobox-item-selected"); _23.onSelect.call(_20,row); } } vv.push(v); ss.push(s); } if(!_22){ $(_20).combo("setText",ss.join(_23.separator)); } if(_23.showItemIcon){ var tb=$(_20).combobox("textbox"); tb.removeClass("textbox-bgicon "+_23.textboxIconCls); if(_26&&_26.iconCls){ tb.addClass("textbox-bgicon "+_26.iconCls); _23.textboxIconCls=_26.iconCls; } } $(_20).combo("setValues",vv); _24.triggerHandler("scroll"); }; function _27(_28,_29,_2a){ var _2b=$.data(_28,"combobox"); var _2c=_2b.options; _2b.data=_2c.loadFilter.call(_28,_29); _2c.view.render.call(_2c.view,_28,$(_28).combo("panel"),_2b.data); var vv=$(_28).combobox("getValues"); $.easyui.forEach(_2b.data,false,function(row){ if(row["selected"]){ $.easyui.addArrayItem(vv,row[_2c.valueField]+""); } }); if(_2c.multiple){ _19(_28,vv,_2a); }else{ _19(_28,vv.length?[vv[vv.length-1]]:[],_2a); } _2c.onLoadSuccess.call(_28,_29); }; function _2d(_2e,url,_2f,_30){ var _31=$.data(_2e,"combobox").options; if(url){ _31.url=url; } _2f=$.extend({},_31.queryParams,_2f||{}); if(_31.onBeforeLoad.call(_2e,_2f)==false){ return; } _31.loader.call(_2e,_2f,function(_32){ _27(_2e,_32,_30); },function(){ _31.onLoadError.apply(this,arguments); }); }; function _33(_34,q){ var _35=$.data(_34,"combobox"); var _36=_35.options; var _37=$(); var qq=_36.multiple?q.split(_36.separator):[q]; if(_36.mode=="remote"){ _38(qq); _2d(_34,null,{q:q},true); }else{ var _39=$(_34).combo("panel"); _39.find(".combobox-item-hover").removeClass("combobox-item-hover"); _39.find(".combobox-item,.combobox-group").hide(); var _3a=_35.data; var vv=[]; $.map(qq,function(q){ q=$.trim(q); var _3b=q; var _3c=undefined; _37=$(); for(var i=0;i<_3a.length;i++){ var row=_3a[i]; if(_36.filter.call(_34,q,row)){ var v=row[_36.valueField]; var s=row[_36.textField]; var g=row[_36.groupField]; var _3d=_36.finder.getEl(_34,v).show(); if(s.toLowerCase()==q.toLowerCase()){ _3b=v; if(_36.reversed){ _37=_3d; }else{ _13(_34,v,true); } } if(_36.groupField&&_3c!=g){ _36.finder.getGroupEl(_34,g).show(); _3c=g; } } } vv.push(_3b); }); _38(vv); } function _38(vv){ if(_36.reversed){ _37.addClass("combobox-item-hover"); }else{ _19(_34,_36.multiple?(q?vv:[]):vv,true); } }; }; function _3e(_3f){ var t=$(_3f); var _40=t.combobox("options"); var _41=t.combobox("panel"); var _42=_41.children("div.combobox-item-hover"); if(_42.length){ _42.removeClass("combobox-item-hover"); var row=_40.finder.getRow(_3f,_42); var _43=row[_40.valueField]; if(_40.multiple){ if(_42.hasClass("combobox-item-selected")){ t.combobox("unselect",_43); }else{ t.combobox("select",_43); } }else{ t.combobox("select",_43); } } var vv=[]; $.map(t.combobox("getValues"),function(v){ if(_1(_3f,v)>=0){ vv.push(v); } }); t.combobox("setValues",vv); if(!_40.multiple){ t.combobox("hidePanel"); } }; function _44(_45){ var _46=$.data(_45,"combobox"); var _47=_46.options; $(_45).addClass("combobox-f"); $(_45).combo($.extend({},_47,{onShowPanel:function(){ $(this).combo("panel").find("div.combobox-item:hidden,div.combobox-group:hidden").show(); _19(this,$(this).combobox("getValues"),true); $(this).combobox("scrollTo",$(this).combobox("getValue")); _47.onShowPanel.call(this); }})); var p=$(_45).combo("panel"); p.unbind(".combobox"); for(var _48 in _47.panelEvents){ p.bind(_48+".combobox",{target:_45},_47.panelEvents[_48]); } }; function _49(e){ $(this).children("div.combobox-item-hover").removeClass("combobox-item-hover"); var _4a=$(e.target).closest("div.combobox-item"); if(!_4a.hasClass("combobox-item-disabled")){ _4a.addClass("combobox-item-hover"); } e.stopPropagation(); }; function _4b(e){ $(e.target).closest("div.combobox-item").removeClass("combobox-item-hover"); e.stopPropagation(); }; function _4c(e){ var _4d=$(this).panel("options").comboTarget; if(!_4d){ return; } var _4e=$(_4d).combobox("options"); var _4f=$(e.target).closest("div.combobox-item"); if(!_4f.length||_4f.hasClass("combobox-item-disabled")){ return; } var row=_4e.finder.getRow(_4d,_4f); if(!row){ return; } if(_4e.blurTimer){ clearTimeout(_4e.blurTimer); _4e.blurTimer=null; } _4e.onClick.call(_4d,row); var _50=row[_4e.valueField]; if(_4e.multiple){ if(_4f.hasClass("combobox-item-selected")){ _1a(_4d,_50); }else{ _13(_4d,_50); } }else{ $(_4d).combobox("setValue",_50).combobox("hidePanel"); } e.stopPropagation(); }; function _51(e){ var _52=$(this).panel("options").comboTarget; if(!_52){ return; } var _53=$(_52).combobox("options"); if(_53.groupPosition=="sticky"){ var _54=$(this).children(".combobox-stick"); if(!_54.length){ _54=$("
").appendTo(this); } _54.hide(); var _55=$(_52).data("combobox"); $(this).children(".combobox-group:visible").each(function(){ var g=$(this); var _56=_53.finder.getGroup(_52,g); var _57=_55.data[_56.startIndex+_56.count-1]; var _58=_53.finder.getEl(_52,_57[_53.valueField]); if(g.position().top<0&&_58.position().top>0){ _54.show().html(g.html()); return false; } }); } }; $.fn.combobox=function(_59,_5a){ if(typeof _59=="string"){ var _5b=$.fn.combobox.methods[_59]; if(_5b){ return _5b(this,_5a); }else{ return this.combo(_59,_5a); } } _59=_59||{}; return this.each(function(){ var _5c=$.data(this,"combobox"); if(_5c){ $.extend(_5c.options,_59); }else{ _5c=$.data(this,"combobox",{options:$.extend({},$.fn.combobox.defaults,$.fn.combobox.parseOptions(this),_59),data:[]}); } _44(this); if(_5c.options.data){ _27(this,_5c.options.data); }else{ var _5d=$.fn.combobox.parseData(this); if(_5d.length){ _27(this,_5d); } } _2d(this); }); }; $.fn.combobox.methods={options:function(jq){ var _5e=jq.combo("options"); return $.extend($.data(jq[0],"combobox").options,{width:_5e.width,height:_5e.height,originalValue:_5e.originalValue,disabled:_5e.disabled,readonly:_5e.readonly}); },cloneFrom:function(jq,_5f){ return jq.each(function(){ $(this).combo("cloneFrom",_5f); $.data(this,"combobox",$(_5f).data("combobox")); $(this).addClass("combobox-f").attr("comboboxName",$(this).attr("textboxName")); }); },getData:function(jq){ return $.data(jq[0],"combobox").data; },setValues:function(jq,_60){ return jq.each(function(){ _19(this,_60); }); },setValue:function(jq,_61){ return jq.each(function(){ _19(this,$.isArray(_61)?_61:[_61]); }); },clear:function(jq){ return jq.each(function(){ _19(this,[]); }); },reset:function(jq){ return jq.each(function(){ var _62=$(this).combobox("options"); if(_62.multiple){ $(this).combobox("setValues",_62.originalValue); }else{ $(this).combobox("setValue",_62.originalValue); } }); },loadData:function(jq,_63){ return jq.each(function(){ _27(this,_63); }); },reload:function(jq,url){ return jq.each(function(){ if(typeof url=="string"){ _2d(this,url); }else{ if(url){ var _64=$(this).combobox("options"); _64.queryParams=url; } _2d(this); } }); },select:function(jq,_65){ return jq.each(function(){ _13(this,_65); }); },unselect:function(jq,_66){ return jq.each(function(){ _1a(this,_66); }); },scrollTo:function(jq,_67){ return jq.each(function(){ _5(this,_67); }); }}; $.fn.combobox.parseOptions=function(_68){ var t=$(_68); return $.extend({},$.fn.combo.parseOptions(_68),$.parser.parseOptions(_68,["valueField","textField","groupField","groupPosition","mode","method","url",{showItemIcon:"boolean",limitToList:"boolean"}])); }; $.fn.combobox.parseData=function(_69){ var _6a=[]; var _6b=$(_69).combobox("options"); $(_69).children().each(function(){ if(this.tagName.toLowerCase()=="optgroup"){ var _6c=$(this).attr("label"); $(this).children().each(function(){ _6d(this,_6c); }); }else{ _6d(this); } }); return _6a; function _6d(el,_6e){ var t=$(el); var row={}; row[_6b.valueField]=t.attr("value")!=undefined?t.attr("value"):t.text(); row[_6b.textField]=t.text(); row["selected"]=t.is(":selected"); row["disabled"]=t.is(":disabled"); if(_6e){ _6b.groupField=_6b.groupField||"group"; row[_6b.groupField]=_6e; } _6a.push(row); }; }; var _6f=0; var _70={render:function(_71,_72,_73){ var _74=$.data(_71,"combobox"); var _75=_74.options; _6f++; _74.itemIdPrefix="_easyui_combobox_i"+_6f; _74.groupIdPrefix="_easyui_combobox_g"+_6f; _74.groups=[]; var dd=[]; var _76=undefined; for(var i=0;i<_73.length;i++){ var row=_73[i]; var v=row[_75.valueField]+""; var s=row[_75.textField]; var g=row[_75.groupField]; if(g){ if(_76!=g){ _76=g; _74.groups.push({value:g,startIndex:i,count:1}); dd.push("
"); dd.push(_75.groupFormatter?_75.groupFormatter.call(_71,g):g); dd.push("
"); }else{ _74.groups[_74.groups.length-1].count++; } }else{ _76=undefined; } var cls="combobox-item"+(row.disabled?" combobox-item-disabled":"")+(g?" combobox-gitem":""); dd.push("
"); if(_75.showItemIcon&&row.iconCls){ dd.push(""); } dd.push(_75.formatter?_75.formatter.call(_71,row):s); dd.push("
"); } $(_72).html(dd.join("")); }}; $.fn.combobox.defaults=$.extend({},$.fn.combo.defaults,{valueField:"value",textField:"text",groupPosition:"static",groupField:null,groupFormatter:function(_77){ return _77; },mode:"local",method:"post",url:null,data:null,queryParams:{},showItemIcon:false,limitToList:false,view:_70,keyHandler:{up:function(e){ _b(this,"prev"); e.preventDefault(); },down:function(e){ _b(this,"next"); e.preventDefault(); },left:function(e){ },right:function(e){ },enter:function(e){ _3e(this); },query:function(q,e){ _33(this,q); }},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ var _78=e.data.target; var _79=$(_78).combobox("options"); if(_79.reversed||_79.limitToList){ if(_79.blurTimer){ clearTimeout(_79.blurTimer); } _79.blurTimer=setTimeout(function(){ var _7a=$(_78).parent().length; if(_7a){ if(_79.reversed){ $(_78).combobox("setValues",$(_78).combobox("getValues")); }else{ if(_79.limitToList){ _3e(_78); } } _79.blurTimer=null; } },50); } }}),panelEvents:{mouseover:_49,mouseout:_4b,click:_4c,scroll:_51},filter:function(q,row){ var _7b=$(this).combobox("options"); return row[_7b.textField].toLowerCase().indexOf(q.toLowerCase())>=0; },formatter:function(row){ var _7c=$(this).combobox("options"); return row[_7c.textField]; },loader:function(_7d,_7e,_7f){ var _80=$(this).combobox("options"); if(!_80.url){ return false; } $.ajax({type:_80.method,url:_80.url,data:_7d,dataType:"json",success:function(_81){ _7e(_81); },error:function(){ _7f.apply(this,arguments); }}); },loadFilter:function(_82){ return _82; },finder:{getEl:function(_83,_84){ var _85=_1(_83,_84); var id=$.data(_83,"combobox").itemIdPrefix+"_"+_85; return $("#"+id); },getGroupEl:function(_86,_87){ var _88=$.data(_86,"combobox"); var _89=$.easyui.indexOfArray(_88.groups,"value",_87); var id=_88.groupIdPrefix+"_"+_89; return $("#"+id); },getGroup:function(_8a,p){ var _8b=$.data(_8a,"combobox"); var _8c=p.attr("id").substr(_8b.groupIdPrefix.length+1); return _8b.groups[parseInt(_8c)]; },getRow:function(_8d,p){ var _8e=$.data(_8d,"combobox"); var _8f=(p instanceof $)?p.attr("id").substr(_8e.itemIdPrefix.length+1):_1(_8d,p); return _8e.data[parseInt(_8f)]; }},onBeforeLoad:function(_90){ },onLoadSuccess:function(_91){ },onLoadError:function(){ },onSelect:function(_92){ },onUnselect:function(_93){ },onClick:function(_94){ }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.combogrid.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"combogrid"); var _4=_3.options; var _5=_3.grid; $(_2).addClass("combogrid-f").combo($.extend({},_4,{onShowPanel:function(){ _20(this,$(this).combogrid("getValues"),true); var p=$(this).combogrid("panel"); var _6=p.outerHeight()-p.height(); var _7=p._size("minHeight"); var _8=p._size("maxHeight"); var dg=$(this).combogrid("grid"); dg.datagrid("resize",{width:"100%",height:(isNaN(parseInt(_4.panelHeight))?"auto":"100%"),minHeight:(_7?_7-_6:""),maxHeight:(_8?_8-_6:"")}); var _9=dg.datagrid("getSelected"); if(_9){ dg.datagrid("scrollTo",dg.datagrid("getRowIndex",_9)); } _4.onShowPanel.call(this); }})); var _a=$(_2).combo("panel"); if(!_5){ _5=$("
").appendTo(_a); _3.grid=_5; } _5.datagrid($.extend({},_4,{border:false,singleSelect:(!_4.multiple),onLoadSuccess:_b,onClickRow:_c,onSelect:_d("onSelect"),onUnselect:_d("onUnselect"),onSelectAll:_d("onSelectAll"),onUnselectAll:_d("onUnselectAll")})); function _e(dg){ return $(dg).closest(".combo-panel").panel("options").comboTarget||_2; }; function _b(_f){ var _10=_e(this); var _11=$(_10).data("combogrid"); var _12=_11.options; var _13=$(_10).combo("getValues"); _20(_10,_13,_11.remainText); _12.onLoadSuccess.call(this,_f); }; function _c(_14,row){ var _15=_e(this); var _16=$(_15).data("combogrid"); var _17=_16.options; _16.remainText=false; _18.call(this); if(!_17.multiple){ $(_15).combo("hidePanel"); } _17.onClickRow.call(this,_14,row); }; function _d(_19){ return function(_1a,row){ var _1b=_e(this); var _1c=$(_1b).combogrid("options"); if(_19=="onUnselectAll"){ if(_1c.multiple){ _18.call(this); } }else{ _18.call(this); } _1c[_19].call(this,_1a,row); }; }; function _18(){ var dg=$(this); var _1d=_e(dg); var _1e=$(_1d).data("combogrid"); var _1f=_1e.options; var vv=$.map(dg.datagrid("getSelections"),function(row){ return row[_1f.idField]; }); vv=vv.concat(_1f.unselectedValues); _20(_1d,vv,_1e.remainText); }; }; function nav(_21,dir){ var _22=$.data(_21,"combogrid"); var _23=_22.options; var _24=_22.grid; var _25=_24.datagrid("getRows").length; if(!_25){ return; } var tr=_23.finder.getTr(_24[0],null,"highlight"); if(!tr.length){ tr=_23.finder.getTr(_24[0],null,"selected"); } var _26; if(!tr.length){ _26=(dir=="next"?0:_25-1); }else{ var _26=parseInt(tr.attr("datagrid-row-index")); _26+=(dir=="next"?1:-1); if(_26<0){ _26=_25-1; } if(_26>=_25){ _26=0; } } _24.datagrid("highlightRow",_26); if(_23.selectOnNavigation){ _22.remainText=false; _24.datagrid("selectRow",_26); } }; function _20(_27,_28,_29){ var _2a=$.data(_27,"combogrid"); var _2b=_2a.options; var _2c=_2a.grid; var _2d=$(_27).combo("getValues"); var _2e=$(_27).combo("options"); var _2f=_2e.onChange; _2e.onChange=function(){ }; var _30=_2c.datagrid("options"); var _31=_30.onSelect; var _32=_30.onUnselectAll; _30.onSelect=_30.onUnselectAll=function(){ }; if(!$.isArray(_28)){ _28=_28.split(_2b.separator); } if(!_2b.multiple){ _28=_28.length?[_28[0]]:[""]; } var vv=$.map(_28,function(_33){ return String(_33); }); vv=$.grep(vv,function(v,_34){ return _34===$.inArray(v,vv); }); var _35=$.grep(_2c.datagrid("getSelections"),function(row,_36){ return $.inArray(String(row[_2b.idField]),vv)>=0; }); _2c.datagrid("clearSelections"); _2c.data("datagrid").selectedRows=_35; var ss=[]; _2b.unselectedValues=[]; $.map(vv,function(v){ var _37=_2c.datagrid("getRowIndex",v); if(_37>=0){ _2c.datagrid("selectRow",_37); }else{ _2b.unselectedValues.push(v); } ss.push(_38(v,_2c.datagrid("getRows"))||_38(v,_35)||_38(v,_2b.mappingRows)||v); }); $(_27).combo("setValues",_2d); _2e.onChange=_2f; _30.onSelect=_31; _30.onUnselectAll=_32; if(!_29){ var s=ss.join(_2b.separator); if($(_27).combo("getText")!=s){ $(_27).combo("setText",s); } } $(_27).combo("setValues",_28); function _38(_39,a){ var _3a=$.easyui.getArrayItem(a,_2b.idField,_39); return _3a?_3a[_2b.textField]:undefined; }; }; function _3b(_3c,q){ var _3d=$.data(_3c,"combogrid"); var _3e=_3d.options; var _3f=_3d.grid; _3d.remainText=true; var qq=_3e.multiple?q.split(_3e.separator):[q]; qq=$.grep(qq,function(q){ return $.trim(q)!=""; }); if(_3e.mode=="remote"){ _40(qq); _3f.datagrid("load",$.extend({},_3e.queryParams,{q:q})); }else{ _3f.datagrid("highlightRow",-1); var _41=_3f.datagrid("getRows"); var vv=[]; $.map(qq,function(q){ q=$.trim(q); var _42=q; _43(_3e.mappingRows,q); _43(_3f.datagrid("getSelections"),q); var _44=_43(_41,q); if(_44>=0){ if(_3e.reversed){ _3f.datagrid("highlightRow",_44); } }else{ $.map(_41,function(row,i){ if(_3e.filter.call(_3c,q,row)){ _3f.datagrid("highlightRow",i); } }); } }); _40(vv); } function _43(_45,q){ for(var i=0;i<_45.length;i++){ var row=_45[i]; if((row[_3e.textField]||"").toLowerCase()==q.toLowerCase()){ vv.push(row[_3e.idField]); return i; } } return -1; }; function _40(vv){ if(!_3e.reversed){ _20(_3c,vv,true); } }; }; function _46(_47){ var _48=$.data(_47,"combogrid"); var _49=_48.options; var _4a=_48.grid; var tr=_49.finder.getTr(_4a[0],null,"highlight"); _48.remainText=false; if(tr.length){ var _4b=parseInt(tr.attr("datagrid-row-index")); if(_49.multiple){ if(tr.hasClass("datagrid-row-selected")){ _4a.datagrid("unselectRow",_4b); }else{ _4a.datagrid("selectRow",_4b); } }else{ _4a.datagrid("selectRow",_4b); } } var vv=[]; $.map(_4a.datagrid("getSelections"),function(row){ vv.push(row[_49.idField]); }); $.map(_49.unselectedValues,function(v){ if($.easyui.indexOfArray(_49.mappingRows,_49.idField,v)>=0){ $.easyui.addArrayItem(vv,v); } }); $(_47).combogrid("setValues",vv); if(!_49.multiple){ $(_47).combogrid("hidePanel"); } }; $.fn.combogrid=function(_4c,_4d){ if(typeof _4c=="string"){ var _4e=$.fn.combogrid.methods[_4c]; if(_4e){ return _4e(this,_4d); }else{ return this.combo(_4c,_4d); } } _4c=_4c||{}; return this.each(function(){ var _4f=$.data(this,"combogrid"); if(_4f){ $.extend(_4f.options,_4c); }else{ _4f=$.data(this,"combogrid",{options:$.extend({},$.fn.combogrid.defaults,$.fn.combogrid.parseOptions(this),_4c)}); } _1(this); }); }; $.fn.combogrid.methods={options:function(jq){ var _50=jq.combo("options"); return $.extend($.data(jq[0],"combogrid").options,{width:_50.width,height:_50.height,originalValue:_50.originalValue,disabled:_50.disabled,readonly:_50.readonly}); },cloneFrom:function(jq,_51){ return jq.each(function(){ $(this).combo("cloneFrom",_51); $.data(this,"combogrid",{options:$.extend(true,{cloned:true},$(_51).combogrid("options")),combo:$(this).next(),panel:$(_51).combo("panel"),grid:$(_51).combogrid("grid")}); }); },grid:function(jq){ return $.data(jq[0],"combogrid").grid; },setValues:function(jq,_52){ return jq.each(function(){ var _53=$(this).combogrid("options"); if($.isArray(_52)){ _52=$.map(_52,function(_54){ if(_54&&typeof _54=="object"){ $.easyui.addArrayItem(_53.mappingRows,_53.idField,_54); return _54[_53.idField]; }else{ return _54; } }); } _20(this,_52); }); },setValue:function(jq,_55){ return jq.each(function(){ $(this).combogrid("setValues",$.isArray(_55)?_55:[_55]); }); },clear:function(jq){ return jq.each(function(){ $(this).combogrid("setValues",[]); }); },reset:function(jq){ return jq.each(function(){ var _56=$(this).combogrid("options"); if(_56.multiple){ $(this).combogrid("setValues",_56.originalValue); }else{ $(this).combogrid("setValue",_56.originalValue); } }); }}; $.fn.combogrid.parseOptions=function(_57){ var t=$(_57); return $.extend({},$.fn.combo.parseOptions(_57),$.fn.datagrid.parseOptions(_57),$.parser.parseOptions(_57,["idField","textField","mode"])); }; $.fn.combogrid.defaults=$.extend({},$.fn.combo.defaults,$.fn.datagrid.defaults,{loadMsg:null,idField:null,textField:null,unselectedValues:[],mappingRows:[],mode:"local",keyHandler:{up:function(e){ nav(this,"prev"); e.preventDefault(); },down:function(e){ nav(this,"next"); e.preventDefault(); },left:function(e){ },right:function(e){ },enter:function(e){ _46(this); },query:function(q,e){ _3b(this,q); }},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ var _58=e.data.target; var _59=$(_58).combogrid("options"); if(_59.reversed){ $(_58).combogrid("setValues",$(_58).combogrid("getValues")); } }}),filter:function(q,row){ var _5a=$(this).combogrid("options"); return (row[_5a.textField]||"").toLowerCase().indexOf(q.toLowerCase())>=0; }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.combotree.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"combotree"); var _4=_3.options; var _5=_3.tree; $(_2).addClass("combotree-f"); $(_2).combo($.extend({},_4,{onShowPanel:function(){ if(_4.editable){ _5.tree("doFilter",""); } _4.onShowPanel.call(this); }})); var _6=$(_2).combo("panel"); if(!_5){ _5=$("
    ").appendTo(_6); _3.tree=_5; } _5.tree($.extend({},_4,{checkbox:_4.multiple,onLoadSuccess:function(_7,_8){ var _9=$(_2).combotree("getValues"); if(_4.multiple){ $.map(_5.tree("getChecked"),function(_a){ $.easyui.addArrayItem(_9,_a.id); }); } _15(_2,_9,_3.remainText); _4.onLoadSuccess.call(this,_7,_8); },onClick:function(_b){ if(_4.multiple){ $(this).tree(_b.checked?"uncheck":"check",_b.target); }else{ $(_2).combo("hidePanel"); } _3.remainText=false; _e(_2); _4.onClick.call(this,_b); },onCheck:function(_c,_d){ _3.remainText=false; _e(_2); _4.onCheck.call(this,_c,_d); }})); }; function _e(_f){ var _10=$.data(_f,"combotree"); var _11=_10.options; var _12=_10.tree; var vv=[]; if(_11.multiple){ vv=$.map(_12.tree("getChecked"),function(_13){ return _13.id; }); }else{ var _14=_12.tree("getSelected"); if(_14){ vv.push(_14.id); } } vv=vv.concat(_11.unselectedValues); _15(_f,vv,_10.remainText); }; function _15(_16,_17,_18){ var _19=$.data(_16,"combotree"); var _1a=_19.options; var _1b=_19.tree; var _1c=_1b.tree("options"); var _1d=_1c.onBeforeCheck; var _1e=_1c.onCheck; var _1f=_1c.onSelect; _1c.onBeforeCheck=_1c.onCheck=_1c.onSelect=function(){ }; if(!$.isArray(_17)){ _17=_17.split(_1a.separator); } if(!_1a.multiple){ _17=_17.length?[_17[0]]:[""]; } var vv=$.map(_17,function(_20){ return String(_20); }); _1b.find("div.tree-node-selected").removeClass("tree-node-selected"); $.map(_1b.tree("getChecked"),function(_21){ if($.inArray(String(_21.id),vv)==-1){ _1b.tree("uncheck",_21.target); } }); var ss=[]; _1a.unselectedValues=[]; $.map(vv,function(v){ var _22=_1b.tree("find",v); if(_22){ _1b.tree("check",_22.target).tree("select",_22.target); ss.push(_22.text); }else{ ss.push(_23(v,_1a.mappingRows)||v); _1a.unselectedValues.push(v); } }); if(_1a.multiple){ $.map(_1b.tree("getChecked"),function(_24){ var id=String(_24.id); if($.inArray(id,vv)==-1){ vv.push(id); ss.push(_24.text); } }); } _1c.onBeforeCheck=_1d; _1c.onCheck=_1e; _1c.onSelect=_1f; if(!_18){ var s=ss.join(_1a.separator); if($(_16).combo("getText")!=s){ $(_16).combo("setText",s); } } $(_16).combo("setValues",vv); function _23(_25,a){ var _26=$.easyui.getArrayItem(a,"id",_25); return _26?_26.text:undefined; }; }; function _27(_28,q){ var _29=$.data(_28,"combotree"); var _2a=_29.options; var _2b=_29.tree; _29.remainText=true; _2b.tree("doFilter",_2a.multiple?q.split(_2a.separator):q); }; function _2c(_2d){ var _2e=$.data(_2d,"combotree"); _2e.remainText=false; $(_2d).combotree("setValues",$(_2d).combotree("getValues")); $(_2d).combotree("hidePanel"); }; $.fn.combotree=function(_2f,_30){ if(typeof _2f=="string"){ var _31=$.fn.combotree.methods[_2f]; if(_31){ return _31(this,_30); }else{ return this.combo(_2f,_30); } } _2f=_2f||{}; return this.each(function(){ var _32=$.data(this,"combotree"); if(_32){ $.extend(_32.options,_2f); }else{ $.data(this,"combotree",{options:$.extend({},$.fn.combotree.defaults,$.fn.combotree.parseOptions(this),_2f)}); } _1(this); }); }; $.fn.combotree.methods={options:function(jq){ var _33=jq.combo("options"); return $.extend($.data(jq[0],"combotree").options,{width:_33.width,height:_33.height,originalValue:_33.originalValue,disabled:_33.disabled,readonly:_33.readonly}); },clone:function(jq,_34){ var t=jq.combo("clone",_34); t.data("combotree",{options:$.extend(true,{},jq.combotree("options")),tree:jq.combotree("tree")}); return t; },tree:function(jq){ return $.data(jq[0],"combotree").tree; },loadData:function(jq,_35){ return jq.each(function(){ var _36=$.data(this,"combotree").options; _36.data=_35; var _37=$.data(this,"combotree").tree; _37.tree("loadData",_35); }); },reload:function(jq,url){ return jq.each(function(){ var _38=$.data(this,"combotree").options; var _39=$.data(this,"combotree").tree; if(url){ _38.url=url; } _39.tree({url:_38.url}); }); },setValues:function(jq,_3a){ return jq.each(function(){ var _3b=$(this).combotree("options"); if($.isArray(_3a)){ _3a=$.map(_3a,function(_3c){ if(_3c&&typeof _3c=="object"){ $.easyui.addArrayItem(_3b.mappingRows,"id",_3c); return _3c.id; }else{ return _3c; } }); } _15(this,_3a); }); },setValue:function(jq,_3d){ return jq.each(function(){ $(this).combotree("setValues",$.isArray(_3d)?_3d:[_3d]); }); },clear:function(jq){ return jq.each(function(){ $(this).combotree("setValues",[]); }); },reset:function(jq){ return jq.each(function(){ var _3e=$(this).combotree("options"); if(_3e.multiple){ $(this).combotree("setValues",_3e.originalValue); }else{ $(this).combotree("setValue",_3e.originalValue); } }); }}; $.fn.combotree.parseOptions=function(_3f){ return $.extend({},$.fn.combo.parseOptions(_3f),$.fn.tree.parseOptions(_3f)); }; $.fn.combotree.defaults=$.extend({},$.fn.combo.defaults,$.fn.tree.defaults,{editable:false,unselectedValues:[],mappingRows:[],keyHandler:{up:function(e){ },down:function(e){ },left:function(e){ },right:function(e){ },enter:function(e){ _2c(this); },query:function(q,e){ _27(this,q); }}}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.combotreegrid.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"combotreegrid"); var _4=_3.options; $(_2).addClass("combotreegrid-f").combo($.extend({},_4,{onShowPanel:function(){ var p=$(this).combotreegrid("panel"); var _5=p.outerHeight()-p.height(); var _6=p._size("minHeight"); var _7=p._size("maxHeight"); var dg=$(this).combotreegrid("grid"); dg.treegrid("resize",{width:"100%",height:(isNaN(parseInt(_4.panelHeight))?"auto":"100%"),minHeight:(_6?_6-_5:""),maxHeight:(_7?_7-_5:"")}); var _8=dg.treegrid("getSelected"); if(_8){ dg.treegrid("scrollTo",_8[_4.idField]); } _4.onShowPanel.call(this); }})); if(!_3.grid){ var _9=$(_2).combo("panel"); _3.grid=$("
    ").appendTo(_9); } _3.grid.treegrid($.extend({},_4,{border:false,checkbox:_4.multiple,onLoadSuccess:function(_a,_b){ var _c=$(_2).combotreegrid("getValues"); if(_4.multiple){ $.map($(this).treegrid("getCheckedNodes"),function(_d){ $.easyui.addArrayItem(_c,_d[_4.idField]); }); } _16(_2,_c); _4.onLoadSuccess.call(this,_a,_b); _3.remainText=false; },onClickRow:function(_e){ if(_4.multiple){ $(this).treegrid(_e.checked?"uncheckNode":"checkNode",_e[_4.idField]); $(this).treegrid("unselect",_e[_4.idField]); }else{ $(_2).combo("hidePanel"); } _11(_2); _4.onClickRow.call(this,_e); },onCheckNode:function(_f,_10){ _11(_2); _4.onCheckNode.call(this,_f,_10); }})); }; function _11(_12){ var _13=$.data(_12,"combotreegrid"); var _14=_13.options; var _15=_13.grid; var vv=[]; if(_14.multiple){ vv=$.map(_15.treegrid("getCheckedNodes"),function(row){ return row[_14.idField]; }); }else{ var row=_15.treegrid("getSelected"); if(row){ vv.push(row[_14.idField]); } } vv=vv.concat(_14.unselectedValues); _16(_12,vv); }; function _16(_17,_18){ var _19=$.data(_17,"combotreegrid"); var _1a=_19.options; var _1b=_19.grid; if(!$.isArray(_18)){ _18=_18.split(_1a.separator); } if(!_1a.multiple){ _18=_18.length?[_18[0]]:[""]; } var vv=$.map(_18,function(_1c){ return String(_1c); }); vv=$.grep(vv,function(v,_1d){ return _1d===$.inArray(v,vv); }); var _1e=_1b.treegrid("getSelected"); if(_1e){ _1b.treegrid("unselect",_1e[_1a.idField]); } $.map(_1b.treegrid("getCheckedNodes"),function(row){ if($.inArray(String(row[_1a.idField]),vv)==-1){ _1b.treegrid("uncheckNode",row[_1a.idField]); } }); var ss=[]; _1a.unselectedValues=[]; $.map(vv,function(v){ var row=_1b.treegrid("find",v); if(row){ if(_1a.multiple){ _1b.treegrid("checkNode",v); }else{ _1b.treegrid("select",v); } ss.push(row[_1a.treeField]); }else{ ss.push(_1f(v,_1a.mappingRows)||v); _1a.unselectedValues.push(v); } }); if(_1a.multiple){ $.map(_1b.treegrid("getCheckedNodes"),function(row){ var id=String(row[_1a.idField]); if($.inArray(id,vv)==-1){ vv.push(id); ss.push(row[_1a.treeField]); } }); } if(!_19.remainText){ var s=ss.join(_1a.separator); if($(_17).combo("getText")!=s){ $(_17).combo("setText",s); } } $(_17).combo("setValues",vv); function _1f(_20,a){ var _21=$.easyui.getArrayItem(a,_1a.idField,_20); return _21?_21[_1a.treeField]:undefined; }; }; function _22(_23,q){ var _24=$.data(_23,"combotreegrid"); var _25=_24.options; var _26=_24.grid; _24.remainText=true; _26.treegrid("clearSelections").treegrid("clearChecked").treegrid("highlightRow",-1); if(_25.mode=="remote"){ $(_23).combotreegrid("clear"); _26.treegrid("load",$.extend({},_25.queryParams,{q:q})); }else{ if(q){ var _27=_26.treegrid("getData"); var vv=[]; var qq=_25.multiple?q.split(_25.separator):[q]; $.map(qq,function(q){ q=$.trim(q); if(q){ var v=undefined; $.easyui.forEach(_27,true,function(row){ if(q.toLowerCase()==String(row[_25.treeField]).toLowerCase()){ v=row[_25.idField]; return false; }else{ if(_25.filter.call(_23,q,row)){ _26.treegrid("expandTo",row[_25.idField]); _26.treegrid("highlightRow",row[_25.idField]); return false; } } }); if(v==undefined){ $.easyui.forEach(_25.mappingRows,false,function(row){ if(q.toLowerCase()==String(row[_25.treeField])){ v=row[_25.idField]; return false; } }); } if(v!=undefined){ vv.push(v); } } }); _16(_23,vv); _24.remainText=false; } } }; function _28(_29){ _11(_29); }; $.fn.combotreegrid=function(_2a,_2b){ if(typeof _2a=="string"){ var _2c=$.fn.combotreegrid.methods[_2a]; if(_2c){ return _2c(this,_2b); }else{ return this.combo(_2a,_2b); } } _2a=_2a||{}; return this.each(function(){ var _2d=$.data(this,"combotreegrid"); if(_2d){ $.extend(_2d.options,_2a); }else{ _2d=$.data(this,"combotreegrid",{options:$.extend({},$.fn.combotreegrid.defaults,$.fn.combotreegrid.parseOptions(this),_2a)}); } _1(this); }); }; $.fn.combotreegrid.methods={options:function(jq){ var _2e=jq.combo("options"); return $.extend($.data(jq[0],"combotreegrid").options,{width:_2e.width,height:_2e.height,originalValue:_2e.originalValue,disabled:_2e.disabled,readonly:_2e.readonly}); },grid:function(jq){ return $.data(jq[0],"combotreegrid").grid; },setValues:function(jq,_2f){ return jq.each(function(){ var _30=$(this).combotreegrid("options"); if($.isArray(_2f)){ _2f=$.map(_2f,function(_31){ if(_31&&typeof _31=="object"){ $.easyui.addArrayItem(_30.mappingRows,_30.idField,_31); return _31[_30.idField]; }else{ return _31; } }); } _16(this,_2f); }); },setValue:function(jq,_32){ return jq.each(function(){ $(this).combotreegrid("setValues",$.isArray(_32)?_32:[_32]); }); },clear:function(jq){ return jq.each(function(){ $(this).combotreegrid("setValues",[]); }); },reset:function(jq){ return jq.each(function(){ var _33=$(this).combotreegrid("options"); if(_33.multiple){ $(this).combotreegrid("setValues",_33.originalValue); }else{ $(this).combotreegrid("setValue",_33.originalValue); } }); }}; $.fn.combotreegrid.parseOptions=function(_34){ var t=$(_34); return $.extend({},$.fn.combo.parseOptions(_34),$.fn.treegrid.parseOptions(_34),$.parser.parseOptions(_34,["mode",{limitToGrid:"boolean"}])); }; $.fn.combotreegrid.defaults=$.extend({},$.fn.combo.defaults,$.fn.treegrid.defaults,{editable:false,singleSelect:true,limitToGrid:false,unselectedValues:[],mappingRows:[],mode:"local",keyHandler:{up:function(e){ },down:function(e){ },left:function(e){ },right:function(e){ },enter:function(e){ _28(this); },query:function(q,e){ _22(this,q); }},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ var _35=e.data.target; var _36=$(_35).combotreegrid("options"); if(_36.limitToGrid){ _28(_35); } }}),filter:function(q,row){ var _37=$(this).combotreegrid("options"); return (row[_37.treeField]||"").toLowerCase().indexOf(q.toLowerCase())>=0; }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.datagrid.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ var _1=0; function _2(a,o){ return $.easyui.indexOfArray(a,o); }; function _3(a,o,id){ $.easyui.removeArrayItem(a,o,id); }; function _4(a,o,r){ $.easyui.addArrayItem(a,o,r); }; function _5(_6,aa){ return $.data(_6,"treegrid")?aa.slice(1):aa; }; function _7(_8){ var _9=$.data(_8,"datagrid"); var _a=_9.options; var _b=_9.panel; var dc=_9.dc; var ss=null; if(_a.sharedStyleSheet){ ss=typeof _a.sharedStyleSheet=="boolean"?"head":_a.sharedStyleSheet; }else{ ss=_b.closest("div.datagrid-view"); if(!ss.length){ ss=dc.view; } } var cc=$(ss); var _c=$.data(cc[0],"ss"); if(!_c){ _c=$.data(cc[0],"ss",{cache:{},dirty:[]}); } return {add:function(_d){ var ss=[""); $(ss.join("\n")).appendTo(cc); cc.children("style[easyui]:not(:last)").remove(); },getRule:function(_10){ var _11=cc.children("style[easyui]:last")[0]; var _12=_11.styleSheet?_11.styleSheet:(_11.sheet||document.styleSheets[document.styleSheets.length-1]); var _13=_12.cssRules||_12.rules; return _13[_10]; },set:function(_14,_15){ var _16=_c.cache[_14]; if(_16){ _16.width=_15; var _17=this.getRule(_16.index); if(_17){ _17.style["width"]=_15; } } },remove:function(_18){ var tmp=[]; for(var s in _c.cache){ if(s.indexOf(_18)==-1){ tmp.push([s,_c.cache[s].width]); } } _c.cache={}; this.add(tmp); },dirty:function(_19){ if(_19){ _c.dirty.push(_19); } },clean:function(){ for(var i=0;i<_c.dirty.length;i++){ this.remove(_c.dirty[i]); } _c.dirty=[]; }}; }; function _1a(_1b,_1c){ var _1d=$.data(_1b,"datagrid"); var _1e=_1d.options; var _1f=_1d.panel; if(_1c){ $.extend(_1e,_1c); } if(_1e.fit==true){ var p=_1f.panel("panel").parent(); _1e.width=p.width(); _1e.height=p.height(); } _1f.panel("resize",_1e); }; function _20(_21){ var _22=$.data(_21,"datagrid"); var _23=_22.options; var dc=_22.dc; var _24=_22.panel; var _25=_24.width(); var _26=_24.height(); var _27=dc.view; var _28=dc.view1; var _29=dc.view2; var _2a=_28.children("div.datagrid-header"); var _2b=_29.children("div.datagrid-header"); var _2c=_2a.find("table"); var _2d=_2b.find("table"); _27.width(_25); var _2e=_2a.children("div.datagrid-header-inner").show(); _28.width(_2e.find("table").width()); if(!_23.showHeader){ _2e.hide(); } _29.width(_25-_28._outerWidth()); _28.children()._outerWidth(_28.width()); _29.children()._outerWidth(_29.width()); var all=_2a.add(_2b).add(_2c).add(_2d); all.css("height",""); var hh=Math.max(_2c.height(),_2d.height()); all._outerHeight(hh); _27.children(".datagrid-empty").css("top",hh+"px"); dc.body1.add(dc.body2).children("table.datagrid-btable-frozen").css({position:"absolute",top:dc.header2._outerHeight()}); var _2f=dc.body2.children("table.datagrid-btable-frozen")._outerHeight(); var _30=_2f+_2b._outerHeight()+_29.children(".datagrid-footer")._outerHeight(); _24.children(":not(.datagrid-view,.datagrid-mask,.datagrid-mask-msg)").each(function(){ _30+=$(this)._outerHeight(); }); var _31=_24.outerHeight()-_24.height(); var _32=_24._size("minHeight")||""; var _33=_24._size("maxHeight")||""; _28.add(_29).children("div.datagrid-body").css({marginTop:_2f,height:(isNaN(parseInt(_23.height))?"":(_26-_30)),minHeight:(_32?_32-_31-_30:""),maxHeight:(_33?_33-_31-_30:"")}); _27.height(_29.height()); }; function _34(_35,_36,_37){ var _38=$.data(_35,"datagrid").data.rows; var _39=$.data(_35,"datagrid").options; var dc=$.data(_35,"datagrid").dc; if(!dc.body1.is(":empty")&&(!_39.nowrap||_39.autoRowHeight||_37)){ if(_36!=undefined){ var tr1=_39.finder.getTr(_35,_36,"body",1); var tr2=_39.finder.getTr(_35,_36,"body",2); _3a(tr1,tr2); }else{ var tr1=_39.finder.getTr(_35,0,"allbody",1); var tr2=_39.finder.getTr(_35,0,"allbody",2); _3a(tr1,tr2); if(_39.showFooter){ var tr1=_39.finder.getTr(_35,0,"allfooter",1); var tr2=_39.finder.getTr(_35,0,"allfooter",2); _3a(tr1,tr2); } } } _20(_35); if(_39.height=="auto"){ var _3b=dc.body1.parent(); var _3c=dc.body2; var _3d=_3e(_3c); var _3f=_3d.height; if(_3d.width>_3c.width()){ _3f+=18; } _3f-=parseInt(_3c.css("marginTop"))||0; _3b.height(_3f); _3c.height(_3f); dc.view.height(dc.view2.height()); } dc.body2.triggerHandler("scroll"); function _3a(_40,_41){ for(var i=0;i<_41.length;i++){ var tr1=$(_40[i]); var tr2=$(_41[i]); tr1.css("height",""); tr2.css("height",""); var _42=Math.max(tr1.height(),tr2.height()); tr1.css("height",_42); tr2.css("height",_42); } }; function _3e(cc){ var _43=0; var _44=0; $(cc).children().each(function(){ var c=$(this); if(c.is(":visible")){ _44+=c._outerHeight(); if(_43"); } _4a(true); _4a(false); _20(_46); function _4a(_4b){ var _4c=_4b?1:2; var tr=_49.finder.getTr(_46,_47,"body",_4c); (_4b?dc.body1:dc.body2).children("table.datagrid-btable-frozen").append(tr); }; }; function _4d(_4e,_4f){ function _50(){ var _51=[]; var _52=[]; $(_4e).children("thead").each(function(){ var opt=$.parser.parseOptions(this,[{frozen:"boolean"}]); $(this).find("tr").each(function(){ var _53=[]; $(this).find("th").each(function(){ var th=$(this); var col=$.extend({},$.parser.parseOptions(this,["id","field","align","halign","order","width",{sortable:"boolean",checkbox:"boolean",resizable:"boolean",fixed:"boolean"},{rowspan:"number",colspan:"number"}]),{title:(th.html()||undefined),hidden:(th.attr("hidden")?true:undefined),formatter:(th.attr("formatter")?eval(th.attr("formatter")):undefined),styler:(th.attr("styler")?eval(th.attr("styler")):undefined),sorter:(th.attr("sorter")?eval(th.attr("sorter")):undefined)}); if(col.width&&String(col.width).indexOf("%")==-1){ col.width=parseInt(col.width); } if(th.attr("editor")){ var s=$.trim(th.attr("editor")); if(s.substr(0,1)=="{"){ col.editor=eval("("+s+")"); }else{ col.editor=s; } } _53.push(col); }); opt.frozen?_51.push(_53):_52.push(_53); }); }); return [_51,_52]; }; var _54=$("
    "+"
    "+"
    "+"
    "+"
    "+"
    "+"
    "+"
    "+"
    "+"
    "+""+"
    "+"
    "+"
    "+"
    "+"
    "+"
    "+"
    "+"
    "+""+"
    "+"
    "+"
    "+"
    ").insertAfter(_4e); _54.panel({doSize:false,cls:"datagrid"}); $(_4e).addClass("datagrid-f").hide().appendTo(_54.children("div.datagrid-view")); var cc=_50(); var _55=_54.children("div.datagrid-view"); var _56=_55.children("div.datagrid-view1"); var _57=_55.children("div.datagrid-view2"); return {panel:_54,frozenColumns:cc[0],columns:cc[1],dc:{view:_55,view1:_56,view2:_57,header1:_56.children("div.datagrid-header").children("div.datagrid-header-inner"),header2:_57.children("div.datagrid-header").children("div.datagrid-header-inner"),body1:_56.children("div.datagrid-body").children("div.datagrid-body-inner"),body2:_57.children("div.datagrid-body"),footer1:_56.children("div.datagrid-footer").children("div.datagrid-footer-inner"),footer2:_57.children("div.datagrid-footer").children("div.datagrid-footer-inner")}}; }; function _58(_59){ var _5a=$.data(_59,"datagrid"); var _5b=_5a.options; var dc=_5a.dc; var _5c=_5a.panel; _5a.ss=$(_59).datagrid("createStyleSheet"); _5c.panel($.extend({},_5b,{id:null,doSize:false,onResize:function(_5d,_5e){ if($.data(_59,"datagrid")){ _20(_59); $(_59).datagrid("fitColumns"); _5b.onResize.call(_5c,_5d,_5e); } },onExpand:function(){ if($.data(_59,"datagrid")){ $(_59).datagrid("fixRowHeight").datagrid("fitColumns"); _5b.onExpand.call(_5c); } }})); _5a.rowIdPrefix="datagrid-row-r"+(++_1); _5a.cellClassPrefix="datagrid-cell-c"+_1; _5f(dc.header1,_5b.frozenColumns,true); _5f(dc.header2,_5b.columns,false); _60(); dc.header1.add(dc.header2).css("display",_5b.showHeader?"block":"none"); dc.footer1.add(dc.footer2).css("display",_5b.showFooter?"block":"none"); if(_5b.toolbar){ if($.isArray(_5b.toolbar)){ $("div.datagrid-toolbar",_5c).remove(); var tb=$("
    ").prependTo(_5c); var tr=tb.find("tr"); for(var i=0;i<_5b.toolbar.length;i++){ var btn=_5b.toolbar[i]; if(btn=="-"){ $("
    ").appendTo(tr); }else{ var td=$("").appendTo(tr); var _61=$("").appendTo(td); _61[0].onclick=eval(btn.handler||function(){ }); _61.linkbutton($.extend({},btn,{plain:true})); } } }else{ $(_5b.toolbar).addClass("datagrid-toolbar").prependTo(_5c); $(_5b.toolbar).show(); } }else{ $("div.datagrid-toolbar",_5c).remove(); } $("div.datagrid-pager",_5c).remove(); if(_5b.pagination){ var _62=$("
    "); if(_5b.pagePosition=="bottom"){ _62.appendTo(_5c); }else{ if(_5b.pagePosition=="top"){ _62.addClass("datagrid-pager-top").prependTo(_5c); }else{ var _63=$("
    ").prependTo(_5c); _62.appendTo(_5c); _62=_62.add(_63); } } _62.pagination({total:0,pageNumber:_5b.pageNumber,pageSize:_5b.pageSize,pageList:_5b.pageList,onSelectPage:function(_64,_65){ _5b.pageNumber=_64||1; _5b.pageSize=_65; _62.pagination("refresh",{pageNumber:_64,pageSize:_65}); _bf(_59); }}); _5b.pageSize=_62.pagination("options").pageSize; } function _5f(_66,_67,_68){ if(!_67){ return; } $(_66).show(); $(_66).empty(); var tmp=$("
    ").appendTo("body"); tmp._outerWidth(99); var _69=100-parseInt(tmp[0].style.width); tmp.remove(); var _6a=[]; var _6b=[]; var _6c=[]; if(_5b.sortName){ _6a=_5b.sortName.split(","); _6b=_5b.sortOrder.split(","); } var t=$("
    ").appendTo(_66); for(var i=0;i<_67.length;i++){ var tr=$("").appendTo($("tbody",t)); var _6d=_67[i]; for(var j=0;j<_6d.length;j++){ var col=_6d[j]; var _6e=""; if(col.rowspan){ _6e+="rowspan=\""+col.rowspan+"\" "; } if(col.colspan){ _6e+="colspan=\""+col.colspan+"\" "; if(!col.id){ col.id=["datagrid-td-group"+_1,i,j].join("-"); } } if(col.id){ _6e+="id=\""+col.id+"\""; } var td=$("").appendTo(tr); if(col.checkbox){ td.attr("field",col.field); $("
    ").html("").appendTo(td); }else{ if(col.field){ td.attr("field",col.field); td.append("
    "); td.find("span:first").html(col.title); var _6f=td.find("div.datagrid-cell"); var pos=_2(_6a,col.field); if(pos>=0){ _6f.addClass("datagrid-sort-"+_6b[pos]); } if(col.sortable){ _6f.addClass("datagrid-sort"); } if(col.resizable==false){ _6f.attr("resizable","false"); } if(col.width){ var _70=$.parser.parseValue("width",col.width,dc.view,_5b.scrollbarSize+(_5b.rownumbers?_5b.rownumberWidth:0)); col.deltaWidth=_69; col.boxWidth=_70-_69; }else{ col.auto=true; } _6f.css("text-align",(col.halign||col.align||"")); col.cellClass=_5a.cellClassPrefix+"-"+col.field.replace(/[\.|\s]/g,"-"); _6f.addClass(col.cellClass); }else{ $("
    ").html(col.title).appendTo(td); } } if(col.hidden){ td.hide(); _6c.push(col.field); } } } if(_68&&_5b.rownumbers){ var td=$("
    "); if($("tr",t).length==0){ td.wrap("").parent().appendTo($("tbody",t)); }else{ td.prependTo($("tr:first",t)); } } for(var i=0;i<_6c.length;i++){ _c1(_59,_6c[i],-1); } }; function _60(){ var _71=[[".datagrid-header-rownumber",(_5b.rownumberWidth-1)+"px"],[".datagrid-cell-rownumber",(_5b.rownumberWidth-1)+"px"]]; var _72=_73(_59,true).concat(_73(_59)); for(var i=0;i<_72.length;i++){ var col=_74(_59,_72[i]); if(col&&!col.checkbox){ _71.push(["."+col.cellClass,col.boxWidth?col.boxWidth+"px":"auto"]); } } _5a.ss.add(_71); _5a.ss.dirty(_5a.cellSelectorPrefix); _5a.cellSelectorPrefix="."+_5a.cellClassPrefix; }; }; function _75(_76){ var _77=$.data(_76,"datagrid"); var _78=_77.panel; var _79=_77.options; var dc=_77.dc; var _7a=dc.header1.add(dc.header2); _7a.unbind(".datagrid"); for(var _7b in _79.headerEvents){ _7a.bind(_7b+".datagrid",_79.headerEvents[_7b]); } var _7c=_7a.find("div.datagrid-cell"); var _7d=_79.resizeHandle=="right"?"e":(_79.resizeHandle=="left"?"w":"e,w"); _7c.each(function(){ $(this).resizable({handles:_7d,disabled:($(this).attr("resizable")?$(this).attr("resizable")=="false":false),minWidth:25,onStartResize:function(e){ _77.resizing=true; _7a.css("cursor",$("body").css("cursor")); if(!_77.proxy){ _77.proxy=$("
    ").appendTo(dc.view); } _77.proxy.css({left:e.pageX-$(_78).offset().left-1,display:"none"}); setTimeout(function(){ if(_77.proxy){ _77.proxy.show(); } },500); },onResize:function(e){ _77.proxy.css({left:e.pageX-$(_78).offset().left-1,display:"block"}); return false; },onStopResize:function(e){ _7a.css("cursor",""); $(this).css("height",""); var _7e=$(this).parent().attr("field"); var col=_74(_76,_7e); col.width=$(this)._outerWidth(); col.boxWidth=col.width-col.deltaWidth; col.auto=undefined; $(this).css("width",""); $(_76).datagrid("fixColumnSize",_7e); _77.proxy.remove(); _77.proxy=null; if($(this).parents("div:first.datagrid-header").parent().hasClass("datagrid-view1")){ _20(_76); } $(_76).datagrid("fitColumns"); _79.onResizeColumn.call(_76,_7e,col.width); setTimeout(function(){ _77.resizing=false; },0); }}); }); var bb=dc.body1.add(dc.body2); bb.unbind(); for(var _7b in _79.rowEvents){ bb.bind(_7b,_79.rowEvents[_7b]); } dc.body1.bind("mousewheel DOMMouseScroll",function(e){ e.preventDefault(); var e1=e.originalEvent||window.event; var _7f=e1.wheelDelta||e1.detail*(-1); if("deltaY" in e1){ _7f=e1.deltaY*-1; } var dg=$(e.target).closest("div.datagrid-view").children(".datagrid-f"); var dc=dg.data("datagrid").dc; dc.body2.scrollTop(dc.body2.scrollTop()-_7f); }); dc.body2.bind("scroll",function(){ var b1=dc.view1.children("div.datagrid-body"); b1.scrollTop($(this).scrollTop()); var c1=dc.body1.children(":first"); var c2=dc.body2.children(":first"); if(c1.length&&c2.length){ var _80=c1.offset().top; var _81=c2.offset().top; if(_80!=_81){ b1.scrollTop(b1.scrollTop()+_80-_81); } } dc.view2.children("div.datagrid-header,div.datagrid-footer")._scrollLeft($(this)._scrollLeft()); dc.body2.children("table.datagrid-btable-frozen").css("left",-$(this)._scrollLeft()); }); }; function _82(_83){ return function(e){ var td=$(e.target).closest("td[field]"); if(td.length){ var _84=_85(td); if(!$(_84).data("datagrid").resizing&&_83){ td.addClass("datagrid-header-over"); }else{ td.removeClass("datagrid-header-over"); } } }; }; function _86(e){ var _87=_85(e.target); var _88=$(_87).datagrid("options"); var ck=$(e.target).closest("input[type=checkbox]"); if(ck.length){ if(_88.singleSelect&&_88.selectOnCheck){ return false; } if(ck.is(":checked")){ _89(_87); }else{ _8a(_87); } e.stopPropagation(); }else{ var _8b=$(e.target).closest(".datagrid-cell"); if(_8b.length){ var p1=_8b.offset().left+5; var p2=_8b.offset().left+_8b._outerWidth()-5; if(e.pageXp1){ _8c(_87,_8b.parent().attr("field")); } } } }; function _8d(e){ var _8e=_85(e.target); var _8f=$(_8e).datagrid("options"); var _90=$(e.target).closest(".datagrid-cell"); if(_90.length){ var p1=_90.offset().left+5; var p2=_90.offset().left+_90._outerWidth()-5; var _91=_8f.resizeHandle=="right"?(e.pageX>p2):(_8f.resizeHandle=="left"?(e.pageXp2)); if(_91){ var _92=_90.parent().attr("field"); var col=_74(_8e,_92); if(col.resizable==false){ return; } $(_8e).datagrid("autoSizeColumn",_92); col.auto=false; } } }; function _93(e){ var _94=_85(e.target); var _95=$(_94).datagrid("options"); var td=$(e.target).closest("td[field]"); _95.onHeaderContextMenu.call(_94,e,td.attr("field")); }; function _96(_97){ return function(e){ var tr=_98(e.target); if(!tr){ return; } var _99=_85(tr); if($.data(_99,"datagrid").resizing){ return; } var _9a=_9b(tr); if(_97){ _9c(_99,_9a); }else{ var _9d=$.data(_99,"datagrid").options; _9d.finder.getTr(_99,_9a).removeClass("datagrid-row-over"); } }; }; function _9e(e){ var tr=_98(e.target); if(!tr){ return; } var _9f=_85(tr); var _a0=$.data(_9f,"datagrid").options; var _a1=_9b(tr); var tt=$(e.target); if(tt.parent().hasClass("datagrid-cell-check")){ if(_a0.singleSelect&&_a0.selectOnCheck){ tt._propAttr("checked",!tt.is(":checked")); _a2(_9f,_a1); }else{ if(tt.is(":checked")){ tt._propAttr("checked",false); _a2(_9f,_a1); }else{ tt._propAttr("checked",true); _a3(_9f,_a1); } } }else{ var row=_a0.finder.getRow(_9f,_a1); var td=tt.closest("td[field]",tr); if(td.length){ var _a4=td.attr("field"); _a0.onClickCell.call(_9f,_a1,_a4,row[_a4]); } if(_a0.singleSelect==true){ _a5(_9f,_a1); }else{ if(_a0.ctrlSelect){ if(e.ctrlKey){ if(tr.hasClass("datagrid-row-selected")){ _a6(_9f,_a1); }else{ _a5(_9f,_a1); } }else{ if(e.shiftKey){ $(_9f).datagrid("clearSelections"); var _a7=Math.min(_a0.lastSelectedIndex||0,_a1); var _a8=Math.max(_a0.lastSelectedIndex||0,_a1); for(var i=_a7;i<=_a8;i++){ _a5(_9f,i); } }else{ $(_9f).datagrid("clearSelections"); _a5(_9f,_a1); _a0.lastSelectedIndex=_a1; } } }else{ if(tr.hasClass("datagrid-row-selected")){ _a6(_9f,_a1); }else{ _a5(_9f,_a1); } } } _a0.onClickRow.apply(_9f,_5(_9f,[_a1,row])); } }; function _a9(e){ var tr=_98(e.target); if(!tr){ return; } var _aa=_85(tr); var _ab=$.data(_aa,"datagrid").options; var _ac=_9b(tr); var row=_ab.finder.getRow(_aa,_ac); var td=$(e.target).closest("td[field]",tr); if(td.length){ var _ad=td.attr("field"); _ab.onDblClickCell.call(_aa,_ac,_ad,row[_ad]); } _ab.onDblClickRow.apply(_aa,_5(_aa,[_ac,row])); }; function _ae(e){ var tr=_98(e.target); if(tr){ var _af=_85(tr); var _b0=$.data(_af,"datagrid").options; var _b1=_9b(tr); var row=_b0.finder.getRow(_af,_b1); _b0.onRowContextMenu.call(_af,e,_b1,row); }else{ var _b2=_98(e.target,".datagrid-body"); if(_b2){ var _af=_85(_b2); var _b0=$.data(_af,"datagrid").options; _b0.onRowContextMenu.call(_af,e,-1,null); } } }; function _85(t){ return $(t).closest("div.datagrid-view").children(".datagrid-f")[0]; }; function _98(t,_b3){ var tr=$(t).closest(_b3||"tr.datagrid-row"); if(tr.length&&tr.parent().length){ return tr; }else{ return undefined; } }; function _9b(tr){ if(tr.attr("datagrid-row-index")){ return parseInt(tr.attr("datagrid-row-index")); }else{ return tr.attr("node-id"); } }; function _8c(_b4,_b5){ var _b6=$.data(_b4,"datagrid"); var _b7=_b6.options; _b5=_b5||{}; var _b8={sortName:_b7.sortName,sortOrder:_b7.sortOrder}; if(typeof _b5=="object"){ $.extend(_b8,_b5); } var _b9=[]; var _ba=[]; if(_b8.sortName){ _b9=_b8.sortName.split(","); _ba=_b8.sortOrder.split(","); } if(typeof _b5=="string"){ var _bb=_b5; var col=_74(_b4,_bb); if(!col.sortable||_b6.resizing){ return; } var _bc=col.order||"asc"; var pos=_2(_b9,_bb); if(pos>=0){ var _bd=_ba[pos]=="asc"?"desc":"asc"; if(_b7.multiSort&&_bd==_bc){ _b9.splice(pos,1); _ba.splice(pos,1); }else{ _ba[pos]=_bd; } }else{ if(_b7.multiSort){ _b9.push(_bb); _ba.push(_bc); }else{ _b9=[_bb]; _ba=[_bc]; } } _b8.sortName=_b9.join(","); _b8.sortOrder=_ba.join(","); } if(_b7.onBeforeSortColumn.call(_b4,_b8.sortName,_b8.sortOrder)==false){ return; } $.extend(_b7,_b8); var dc=_b6.dc; var _be=dc.header1.add(dc.header2); _be.find("div.datagrid-cell").removeClass("datagrid-sort-asc datagrid-sort-desc"); for(var i=0;i<_b9.length;i++){ var col=_74(_b4,_b9[i]); _be.find("div."+col.cellClass).addClass("datagrid-sort-"+_ba[i]); } if(_b7.remoteSort){ _bf(_b4); }else{ _c0(_b4,$(_b4).datagrid("getData")); } _b7.onSortColumn.call(_b4,_b7.sortName,_b7.sortOrder); }; function _c1(_c2,_c3,_c4){ _c5(true); _c5(false); function _c5(_c6){ var aa=_c7(_c2,_c6); if(aa.length){ var _c8=aa[aa.length-1]; var _c9=_2(_c8,_c3); if(_c9>=0){ for(var _ca=0;_ca=_d0.find("table").width()){ dc.body2.css("overflow-x","hidden"); } function _d3(){ if(!_cf.fitColumns){ return; } if(!_ce.leftWidth){ _ce.leftWidth=0; } var _d4=0; var cc=[]; var _d5=_73(_cd,false); for(var i=0;i<_d5.length;i++){ var col=_74(_cd,_d5[i]); if(_d6(col)){ _d4+=col.width; cc.push({field:col.field,col:col,addingWidth:0}); } } if(!_d4){ return; } cc[cc.length-1].addingWidth-=_ce.leftWidth; var _d7=_d0.children("div.datagrid-header-inner").show(); var _d8=_d0.width()-_d0.find("table").width()-_cf.scrollbarSize+_ce.leftWidth; var _d9=_d8/_d4; if(!_cf.showHeader){ _d7.hide(); } for(var i=0;i0){ c.col.boxWidth+=c.addingWidth; c.col.width+=c.addingWidth; } } _ce.leftWidth=_d8; $(_cd).datagrid("fixColumnSize"); }; function _d2(){ var _db=false; var _dc=_73(_cd,true).concat(_73(_cd,false)); $.map(_dc,function(_dd){ var col=_74(_cd,_dd); if(String(col.width||"").indexOf("%")>=0){ var _de=$.parser.parseValue("width",col.width,dc.view,_cf.scrollbarSize+(_cf.rownumbers?_cf.rownumberWidth:0))-col.deltaWidth; if(_de>0){ col.boxWidth=_de; _db=true; } } }); if(_db){ $(_cd).datagrid("fixColumnSize"); } }; function _d1(fit){ var _df=dc.header1.add(dc.header2).find(".datagrid-cell-group"); if(_df.length){ _df.each(function(){ $(this)._outerWidth(fit?$(this).parent().width():10); }); if(fit){ _20(_cd); } } }; function _d6(col){ if(String(col.width||"").indexOf("%")>=0){ return false; } if(!col.hidden&&!col.checkbox&&!col.auto&&!col.fixed){ return true; } }; }; function _e0(_e1,_e2){ var _e3=$.data(_e1,"datagrid"); var _e4=_e3.options; var dc=_e3.dc; var tmp=$("
    ").appendTo("body"); if(_e2){ _1a(_e2); $(_e1).datagrid("fitColumns"); }else{ var _e5=false; var _e6=_73(_e1,true).concat(_73(_e1,false)); for(var i=0;i<_e6.length;i++){ var _e2=_e6[i]; var col=_74(_e1,_e2); if(col.auto){ _1a(_e2); _e5=true; } } if(_e5){ $(_e1).datagrid("fitColumns"); } } tmp.remove(); function _1a(_e7){ var _e8=dc.view.find("div.datagrid-header td[field=\""+_e7+"\"] div.datagrid-cell"); _e8.css("width",""); var col=$(_e1).datagrid("getColumnOption",_e7); col.width=undefined; col.boxWidth=undefined; col.auto=true; $(_e1).datagrid("fixColumnSize",_e7); var _e9=Math.max(_ea("header"),_ea("allbody"),_ea("allfooter"))+1; _e8._outerWidth(_e9-1); col.width=_e9; col.boxWidth=parseInt(_e8[0].style.width); col.deltaWidth=_e9-col.boxWidth; _e8.css("width",""); $(_e1).datagrid("fixColumnSize",_e7); _e4.onResizeColumn.call(_e1,_e7,col.width); function _ea(_eb){ var _ec=0; if(_eb=="header"){ _ec=_ed(_e8); }else{ _e4.finder.getTr(_e1,0,_eb).find("td[field=\""+_e7+"\"] div.datagrid-cell").each(function(){ var w=_ed($(this)); if(_ec1){ var col=_74(_f8,td.attr("field")); var _fa=col.boxWidth+col.deltaWidth-1; for(var i=1;i<_f9;i++){ td=td.next(); col=_74(_f8,td.attr("field")); _fa+=col.boxWidth+col.deltaWidth; } $(this).children("div.datagrid-cell")._outerWidth(_fa); } }); }; function _f6(_fb){ var dc=$.data(_fb,"datagrid").dc; dc.view.find("div.datagrid-editable").each(function(){ var _fc=$(this); var _fd=_fc.parent().attr("field"); var col=$(_fb).datagrid("getColumnOption",_fd); _fc._outerWidth(col.boxWidth+col.deltaWidth-1); var ed=$.data(this,"datagrid.editor"); if(ed.actions.resize){ ed.actions.resize(ed.target,_fc.width()); } }); }; function _74(_fe,_ff){ function find(_100){ if(_100){ for(var i=0;i<_100.length;i++){ var cc=_100[i]; for(var j=0;j=0){ var _109=col.field||col.id||""; for(var c=0;c<(col.colspan||1);c++){ for(var r=0;r<(col.rowspan||1);r++){ aa[_106+r][_107]=_109; } _107++; } } }); } return aa; function _105(){ var _10a=0; $.map(_103[0]||[],function(col){ _10a+=col.colspan||1; }); return _10a; }; function _108(a){ for(var i=0;ib?1:-1); }; r=_111(r1[sn],r2[sn])*(so=="asc"?1:-1); if(r!=0){ return r; } } return r; }); } if(opts.view.onBeforeRender){ opts.view.onBeforeRender.call(opts.view,_10d,data.rows); } opts.view.render.call(opts.view,_10d,dc.body2,false); opts.view.render.call(opts.view,_10d,dc.body1,true); if(opts.showFooter){ opts.view.renderFooter.call(opts.view,_10d,dc.footer2,false); opts.view.renderFooter.call(opts.view,_10d,dc.footer1,true); } if(opts.view.onAfterRender){ opts.view.onAfterRender.call(opts.view,_10d); } _10e.ss.clean(); var _112=$(_10d).datagrid("getPager"); if(_112.length){ var _113=_112.pagination("options"); if(_113.total!=data.total){ _112.pagination("refresh",{total:data.total}); if(opts.pageNumber!=_113.pageNumber&&_113.pageNumber>0){ opts.pageNumber=_113.pageNumber; _bf(_10d); } } } _34(_10d); dc.body2.triggerHandler("scroll"); $(_10d).datagrid("setSelectionState"); $(_10d).datagrid("autoSizeColumn"); opts.onLoadSuccess.call(_10d,data); }; function _114(_115){ var _116=$.data(_115,"datagrid"); var opts=_116.options; var dc=_116.dc; dc.header1.add(dc.header2).find("input[type=checkbox]")._propAttr("checked",false); if(opts.idField){ var _117=$.data(_115,"treegrid")?true:false; var _118=opts.onSelect; var _119=opts.onCheck; opts.onSelect=opts.onCheck=function(){ }; var rows=opts.finder.getRows(_115); for(var i=0;i_12a.height()-18){ _12a.scrollTop(_12a.scrollTop()+top+tr._outerHeight()-_12a.height()+18); } } } }; function _9c(_12c,_12d){ var _12e=$.data(_12c,"datagrid"); var opts=_12e.options; opts.finder.getTr(_12c,_12e.highlightIndex).removeClass("datagrid-row-over"); opts.finder.getTr(_12c,_12d).addClass("datagrid-row-over"); _12e.highlightIndex=_12d; }; function _a5(_12f,_130,_131){ var _132=$.data(_12f,"datagrid"); var opts=_132.options; var row=opts.finder.getRow(_12f,_130); if(opts.onBeforeSelect.apply(_12f,_5(_12f,[_130,row]))==false){ return; } if(opts.singleSelect){ _133(_12f,true); _132.selectedRows=[]; } if(!_131&&opts.checkOnSelect){ _a2(_12f,_130,true); } if(opts.idField){ _4(_132.selectedRows,opts.idField,row); } opts.finder.getTr(_12f,_130).addClass("datagrid-row-selected"); opts.onSelect.apply(_12f,_5(_12f,[_130,row])); _125(_12f,_130); }; function _a6(_134,_135,_136){ var _137=$.data(_134,"datagrid"); var dc=_137.dc; var opts=_137.options; var row=opts.finder.getRow(_134,_135); if(opts.onBeforeUnselect.apply(_134,_5(_134,[_135,row]))==false){ return; } if(!_136&&opts.checkOnSelect){ _a3(_134,_135,true); } opts.finder.getTr(_134,_135).removeClass("datagrid-row-selected"); if(opts.idField){ _3(_137.selectedRows,opts.idField,row[opts.idField]); } opts.onUnselect.apply(_134,_5(_134,[_135,row])); }; function _138(_139,_13a){ var _13b=$.data(_139,"datagrid"); var opts=_13b.options; var rows=opts.finder.getRows(_139); var _13c=$.data(_139,"datagrid").selectedRows; if(!_13a&&opts.checkOnSelect){ _89(_139,true); } opts.finder.getTr(_139,"","allbody").addClass("datagrid-row-selected"); if(opts.idField){ for(var _13d=0;_13d"); cell.children("table").bind("click dblclick contextmenu",function(e){ e.stopPropagation(); }); $.data(cell[0],"datagrid.editor",{actions:_172,target:_172.init(cell.find("td"),$.extend({height:opts.editorHeight},_171)),field:_16f,type:_170,oldHtml:_173}); } } }); _34(_16d,_16e,true); }; function _164(_175,_176){ var opts=$.data(_175,"datagrid").options; var tr=opts.finder.getTr(_175,_176); tr.children("td").each(function(){ var cell=$(this).find("div.datagrid-editable"); if(cell.length){ var ed=$.data(cell[0],"datagrid.editor"); if(ed.actions.destroy){ ed.actions.destroy(ed.target); } cell.html(ed.oldHtml); $.removeData(cell[0],"datagrid.editor"); cell.removeClass("datagrid-editable"); cell.css("width",""); } }); }; function _157(_177,_178){ var tr=$.data(_177,"datagrid").options.finder.getTr(_177,_178); if(!tr.hasClass("datagrid-row-editing")){ return true; } var vbox=tr.find(".validatebox-text"); vbox.validatebox("validate"); vbox.trigger("mouseleave"); var _179=tr.find(".validatebox-invalid"); return _179.length==0; }; function _17a(_17b,_17c){ var _17d=$.data(_17b,"datagrid").insertedRows; var _17e=$.data(_17b,"datagrid").deletedRows; var _17f=$.data(_17b,"datagrid").updatedRows; if(!_17c){ var rows=[]; rows=rows.concat(_17d); rows=rows.concat(_17e); rows=rows.concat(_17f); return rows; }else{ if(_17c=="inserted"){ return _17d; }else{ if(_17c=="deleted"){ return _17e; }else{ if(_17c=="updated"){ return _17f; } } } } return []; }; function _180(_181,_182){ var _183=$.data(_181,"datagrid"); var opts=_183.options; var data=_183.data; var _184=_183.insertedRows; var _185=_183.deletedRows; $(_181).datagrid("cancelEdit",_182); var row=opts.finder.getRow(_181,_182); if(_2(_184,row)>=0){ _3(_184,row); }else{ _185.push(row); } _3(_183.selectedRows,opts.idField,row[opts.idField]); _3(_183.checkedRows,opts.idField,row[opts.idField]); opts.view.deleteRow.call(opts.view,_181,_182); if(opts.height=="auto"){ _34(_181); } $(_181).datagrid("getPager").pagination("refresh",{total:data.total}); }; function _186(_187,_188){ var data=$.data(_187,"datagrid").data; var view=$.data(_187,"datagrid").options.view; var _189=$.data(_187,"datagrid").insertedRows; view.insertRow.call(view,_187,_188.index,_188.row); _189.push(_188.row); $(_187).datagrid("getPager").pagination("refresh",{total:data.total}); }; function _18a(_18b,row){ var data=$.data(_18b,"datagrid").data; var view=$.data(_18b,"datagrid").options.view; var _18c=$.data(_18b,"datagrid").insertedRows; view.insertRow.call(view,_18b,null,row); _18c.push(row); $(_18b).datagrid("getPager").pagination("refresh",{total:data.total}); }; function _18d(_18e,_18f){ var _190=$.data(_18e,"datagrid"); var opts=_190.options; var row=opts.finder.getRow(_18e,_18f.index); var _191=false; _18f.row=_18f.row||{}; for(var _192 in _18f.row){ if(row[_192]!==_18f.row[_192]){ _191=true; break; } } if(_191){ if(_2(_190.insertedRows,row)==-1){ if(_2(_190.updatedRows,row)==-1){ _190.updatedRows.push(row); } } opts.view.updateRow.call(opts.view,_18e,_18f.index,_18f.row); } }; function _193(_194){ var _195=$.data(_194,"datagrid"); var data=_195.data; var rows=data.rows; var _196=[]; for(var i=0;i=0){ (_1a3=="s"?_a5:_a2)(_19a,_1a4,true); } } }; for(var i=0;i0){ $(this).datagrid("loadData",data); }else{ opts.view.setEmptyMsg(this); $(this).datagrid("autoSizeColumn"); } } _bf(this); }); }; function _1b4(_1b5){ var _1b6={}; $.map(_1b5,function(name){ _1b6[name]=_1b7(name); }); return _1b6; function _1b7(name){ function isA(_1b8){ return $.data($(_1b8)[0],name)!=undefined; }; return {init:function(_1b9,_1ba){ var _1bb=$("").appendTo(_1b9); if(_1bb[name]&&name!="text"){ return _1bb[name](_1ba); }else{ return _1bb; } },destroy:function(_1bc){ if(isA(_1bc,name)){ $(_1bc)[name]("destroy"); } },getValue:function(_1bd){ if(isA(_1bd,name)){ var opts=$(_1bd)[name]("options"); if(opts.multiple){ return $(_1bd)[name]("getValues").join(opts.separator); }else{ return $(_1bd)[name]("getValue"); } }else{ return $(_1bd).val(); } },setValue:function(_1be,_1bf){ if(isA(_1be,name)){ var opts=$(_1be)[name]("options"); if(opts.multiple){ if(_1bf){ $(_1be)[name]("setValues",_1bf.split(opts.separator)); }else{ $(_1be)[name]("clear"); } }else{ $(_1be)[name]("setValue",_1bf); } }else{ $(_1be).val(_1bf); } },resize:function(_1c0,_1c1){ if(isA(_1c0,name)){ $(_1c0)[name]("resize",_1c1); }else{ $(_1c0)._size({width:_1c1,height:$.fn.datagrid.defaults.editorHeight}); } }}; }; }; var _1c2=$.extend({},_1b4(["text","textbox","passwordbox","filebox","numberbox","numberspinner","combobox","combotree","combogrid","combotreegrid","datebox","datetimebox","timespinner","datetimespinner"]),{textarea:{init:function(_1c3,_1c4){ var _1c5=$("").appendTo(_1c3); _1c5.css("vertical-align","middle")._outerHeight(_1c4.height); return _1c5; },getValue:function(_1c6){ return $(_1c6).val(); },setValue:function(_1c7,_1c8){ $(_1c7).val(_1c8); },resize:function(_1c9,_1ca){ $(_1c9)._outerWidth(_1ca); }},checkbox:{init:function(_1cb,_1cc){ var _1cd=$("").appendTo(_1cb); _1cd.val(_1cc.on); _1cd.attr("offval",_1cc.off); return _1cd; },getValue:function(_1ce){ if($(_1ce).is(":checked")){ return $(_1ce).val(); }else{ return $(_1ce).attr("offval"); } },setValue:function(_1cf,_1d0){ var _1d1=false; if($(_1cf).val()==_1d0){ _1d1=true; } $(_1cf)._propAttr("checked",_1d1); }},validatebox:{init:function(_1d2,_1d3){ var _1d4=$("").appendTo(_1d2); _1d4.validatebox(_1d3); return _1d4; },destroy:function(_1d5){ $(_1d5).validatebox("destroy"); },getValue:function(_1d6){ return $(_1d6).val(); },setValue:function(_1d7,_1d8){ $(_1d7).val(_1d8); },resize:function(_1d9,_1da){ $(_1d9)._outerWidth(_1da)._outerHeight($.fn.datagrid.defaults.editorHeight); }}}); $.fn.datagrid.methods={options:function(jq){ var _1db=$.data(jq[0],"datagrid").options; var _1dc=$.data(jq[0],"datagrid").panel.panel("options"); var opts=$.extend(_1db,{width:_1dc.width,height:_1dc.height,closed:_1dc.closed,collapsed:_1dc.collapsed,minimized:_1dc.minimized,maximized:_1dc.maximized}); return opts; },setSelectionState:function(jq){ return jq.each(function(){ _114(this); }); },createStyleSheet:function(jq){ return _7(jq[0]); },getPanel:function(jq){ return $.data(jq[0],"datagrid").panel; },getPager:function(jq){ return $.data(jq[0],"datagrid").panel.children("div.datagrid-pager"); },getColumnFields:function(jq,_1dd){ return _73(jq[0],_1dd); },getColumnOption:function(jq,_1de){ return _74(jq[0],_1de); },resize:function(jq,_1df){ return jq.each(function(){ _1a(this,_1df); }); },load:function(jq,_1e0){ return jq.each(function(){ var opts=$(this).datagrid("options"); if(typeof _1e0=="string"){ opts.url=_1e0; _1e0=null; } opts.pageNumber=1; var _1e1=$(this).datagrid("getPager"); _1e1.pagination("refresh",{pageNumber:1}); _bf(this,_1e0); }); },reload:function(jq,_1e2){ return jq.each(function(){ var opts=$(this).datagrid("options"); if(typeof _1e2=="string"){ opts.url=_1e2; _1e2=null; } _bf(this,_1e2); }); },reloadFooter:function(jq,_1e3){ return jq.each(function(){ var opts=$.data(this,"datagrid").options; var dc=$.data(this,"datagrid").dc; if(_1e3){ $.data(this,"datagrid").footer=_1e3; } if(opts.showFooter){ opts.view.renderFooter.call(opts.view,this,dc.footer2,false); opts.view.renderFooter.call(opts.view,this,dc.footer1,true); if(opts.view.onAfterRender){ opts.view.onAfterRender.call(opts.view,this); } $(this).datagrid("fixRowHeight"); } }); },loading:function(jq){ return jq.each(function(){ var opts=$.data(this,"datagrid").options; $(this).datagrid("getPager").pagination("loading"); if(opts.loadMsg){ var _1e4=$(this).datagrid("getPanel"); if(!_1e4.children("div.datagrid-mask").length){ $("
    ").appendTo(_1e4); var msg=$("
    ").html(opts.loadMsg).appendTo(_1e4); msg._outerHeight(40); msg.css({marginLeft:(-msg.outerWidth()/2),lineHeight:(msg.height()+"px")}); } } }); },loaded:function(jq){ return jq.each(function(){ $(this).datagrid("getPager").pagination("loaded"); var _1e5=$(this).datagrid("getPanel"); _1e5.children("div.datagrid-mask-msg").remove(); _1e5.children("div.datagrid-mask").remove(); }); },fitColumns:function(jq){ return jq.each(function(){ _cc(this); }); },fixColumnSize:function(jq,_1e6){ return jq.each(function(){ _ef(this,_1e6); }); },fixRowHeight:function(jq,_1e7){ return jq.each(function(){ _34(this,_1e7); }); },freezeRow:function(jq,_1e8){ return jq.each(function(){ _45(this,_1e8); }); },autoSizeColumn:function(jq,_1e9){ return jq.each(function(){ _e0(this,_1e9); }); },loadData:function(jq,data){ return jq.each(function(){ _c0(this,data); _193(this); }); },getData:function(jq){ return $.data(jq[0],"datagrid").data; },getRows:function(jq){ return $.data(jq[0],"datagrid").data.rows; },getFooterRows:function(jq){ return $.data(jq[0],"datagrid").footer; },getRowIndex:function(jq,id){ return _11c(jq[0],id); },getChecked:function(jq){ return _122(jq[0]); },getSelected:function(jq){ var rows=_11f(jq[0]); return rows.length>0?rows[0]:null; },getSelections:function(jq){ return _11f(jq[0]); },clearSelections:function(jq){ return jq.each(function(){ var _1ea=$.data(this,"datagrid"); var _1eb=_1ea.selectedRows; var _1ec=_1ea.checkedRows; _1eb.splice(0,_1eb.length); _133(this); if(_1ea.options.checkOnSelect){ _1ec.splice(0,_1ec.length); } }); },clearChecked:function(jq){ return jq.each(function(){ var _1ed=$.data(this,"datagrid"); var _1ee=_1ed.selectedRows; var _1ef=_1ed.checkedRows; _1ef.splice(0,_1ef.length); _8a(this); if(_1ed.options.selectOnCheck){ _1ee.splice(0,_1ee.length); } }); },scrollTo:function(jq,_1f0){ return jq.each(function(){ _125(this,_1f0); }); },highlightRow:function(jq,_1f1){ return jq.each(function(){ _9c(this,_1f1); _125(this,_1f1); }); },selectAll:function(jq){ return jq.each(function(){ _138(this); }); },unselectAll:function(jq){ return jq.each(function(){ _133(this); }); },selectRow:function(jq,_1f2){ return jq.each(function(){ _a5(this,_1f2); }); },selectRecord:function(jq,id){ return jq.each(function(){ var opts=$.data(this,"datagrid").options; if(opts.idField){ var _1f3=_11c(this,id); if(_1f3>=0){ $(this).datagrid("selectRow",_1f3); } } }); },unselectRow:function(jq,_1f4){ return jq.each(function(){ _a6(this,_1f4); }); },checkRow:function(jq,_1f5){ return jq.each(function(){ _a2(this,_1f5); }); },uncheckRow:function(jq,_1f6){ return jq.each(function(){ _a3(this,_1f6); }); },checkAll:function(jq){ return jq.each(function(){ _89(this); }); },uncheckAll:function(jq){ return jq.each(function(){ _8a(this); }); },beginEdit:function(jq,_1f7){ return jq.each(function(){ _152(this,_1f7); }); },endEdit:function(jq,_1f8){ return jq.each(function(){ _158(this,_1f8,false); }); },cancelEdit:function(jq,_1f9){ return jq.each(function(){ _158(this,_1f9,true); }); },getEditors:function(jq,_1fa){ return _165(jq[0],_1fa); },getEditor:function(jq,_1fb){ return _169(jq[0],_1fb); },refreshRow:function(jq,_1fc){ return jq.each(function(){ var opts=$.data(this,"datagrid").options; opts.view.refreshRow.call(opts.view,this,_1fc); }); },validateRow:function(jq,_1fd){ return _157(jq[0],_1fd); },updateRow:function(jq,_1fe){ return jq.each(function(){ _18d(this,_1fe); }); },appendRow:function(jq,row){ return jq.each(function(){ _18a(this,row); }); },insertRow:function(jq,_1ff){ return jq.each(function(){ _186(this,_1ff); }); },deleteRow:function(jq,_200){ return jq.each(function(){ _180(this,_200); }); },getChanges:function(jq,_201){ return _17a(jq[0],_201); },acceptChanges:function(jq){ return jq.each(function(){ _197(this); }); },rejectChanges:function(jq){ return jq.each(function(){ _199(this); }); },mergeCells:function(jq,_202){ return jq.each(function(){ _1ab(this,_202); }); },showColumn:function(jq,_203){ return jq.each(function(){ var col=$(this).datagrid("getColumnOption",_203); if(col.hidden){ col.hidden=false; $(this).datagrid("getPanel").find("td[field=\""+_203+"\"]").show(); _c1(this,_203,1); $(this).datagrid("fitColumns"); } }); },hideColumn:function(jq,_204){ return jq.each(function(){ var col=$(this).datagrid("getColumnOption",_204); if(!col.hidden){ col.hidden=true; $(this).datagrid("getPanel").find("td[field=\""+_204+"\"]").hide(); _c1(this,_204,-1); $(this).datagrid("fitColumns"); } }); },sort:function(jq,_205){ return jq.each(function(){ _8c(this,_205); }); },gotoPage:function(jq,_206){ return jq.each(function(){ var _207=this; var page,cb; if(typeof _206=="object"){ page=_206.page; cb=_206.callback; }else{ page=_206; } $(_207).datagrid("options").pageNumber=page; $(_207).datagrid("getPager").pagination("refresh",{pageNumber:page}); _bf(_207,null,function(){ if(cb){ cb.call(_207,page); } }); }); }}; $.fn.datagrid.parseOptions=function(_208){ var t=$(_208); return $.extend({},$.fn.panel.parseOptions(_208),$.parser.parseOptions(_208,["url","toolbar","idField","sortName","sortOrder","pagePosition","resizeHandle",{sharedStyleSheet:"boolean",fitColumns:"boolean",autoRowHeight:"boolean",striped:"boolean",nowrap:"boolean"},{rownumbers:"boolean",singleSelect:"boolean",ctrlSelect:"boolean",checkOnSelect:"boolean",selectOnCheck:"boolean"},{pagination:"boolean",pageSize:"number",pageNumber:"number"},{multiSort:"boolean",remoteSort:"boolean",showHeader:"boolean",showFooter:"boolean"},{scrollbarSize:"number"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined),loadMsg:(t.attr("loadMsg")!=undefined?t.attr("loadMsg"):undefined),rowStyler:(t.attr("rowStyler")?eval(t.attr("rowStyler")):undefined)}); }; $.fn.datagrid.parseData=function(_209){ var t=$(_209); var data={total:0,rows:[]}; var _20a=t.datagrid("getColumnFields",true).concat(t.datagrid("getColumnFields",false)); t.find("tbody tr").each(function(){ data.total++; var row={}; $.extend(row,$.parser.parseOptions(this,["iconCls","state"])); for(var i=0;i<_20a.length;i++){ row[_20a[i]]=$(this).find("td:eq("+i+")").html(); } data.rows.push(row); }); return data; }; var _20b={render:function(_20c,_20d,_20e){ var rows=$(_20c).datagrid("getRows"); $(_20d).html(this.renderTable(_20c,0,rows,_20e)); },renderFooter:function(_20f,_210,_211){ var opts=$.data(_20f,"datagrid").options; var rows=$.data(_20f,"datagrid").footer||[]; var _212=$(_20f).datagrid("getColumnFields",_211); var _213=[""]; for(var i=0;i"); _213.push(this.renderRow.call(this,_20f,_212,_211,i,rows[i])); _213.push(""); } _213.push("
    "); $(_210).html(_213.join("")); },renderTable:function(_214,_215,rows,_216){ var _217=$.data(_214,"datagrid"); var opts=_217.options; if(_216){ if(!(opts.rownumbers||(opts.frozenColumns&&opts.frozenColumns.length))){ return ""; } } var _218=$(_214).datagrid("getColumnFields",_216); var _219=[""]; for(var i=0;i"); _219.push(this.renderRow.call(this,_214,_218,_216,_215,row)); _219.push(""); _215++; } _219.push("
    "); return _219.join(""); },renderRow:function(_21c,_21d,_21e,_21f,_220){ var opts=$.data(_21c,"datagrid").options; var cc=[]; if(_21e&&opts.rownumbers){ var _221=_21f+1; if(opts.pagination){ _221+=(opts.pageNumber-1)*opts.pageSize; } cc.push("
    "+_221+"
    "); } for(var i=0;i<_21d.length;i++){ var _222=_21d[i]; var col=$(_21c).datagrid("getColumnOption",_222); if(col){ var _223=_220[_222]; var css=col.styler?(col.styler(_223,_220,_21f)||""):""; var cs=this.getStyleValue(css); var cls=cs.c?"class=\""+cs.c+"\"":""; var _224=col.hidden?"style=\"display:none;"+cs.s+"\"":(cs.s?"style=\""+cs.s+"\"":""); cc.push(""); var _224=""; if(!col.checkbox){ if(col.align){ _224+="text-align:"+col.align+";"; } if(!opts.nowrap){ _224+="white-space:normal;height:auto;"; }else{ if(opts.autoRowHeight){ _224+="height:auto;"; } } } cc.push("
    "); if(col.checkbox){ cc.push(""); }else{ if(col.formatter){ cc.push(col.formatter(_223,_220,_21f)); }else{ cc.push(_223); } } cc.push("
    "); cc.push(""); } } return cc.join(""); },getStyleValue:function(css){ var _225=""; var _226=""; if(typeof css=="string"){ _226=css; }else{ if(css){ _225=css["class"]||""; _226=css["style"]||""; } } return {c:_225,s:_226}; },refreshRow:function(_227,_228){ this.updateRow.call(this,_227,_228,{}); },updateRow:function(_229,_22a,row){ var opts=$.data(_229,"datagrid").options; var _22b=opts.finder.getRow(_229,_22a); $.extend(_22b,row); var cs=_22c.call(this,_22a); var _22d=cs.s; var cls="datagrid-row "+(_22a%2&&opts.striped?"datagrid-row-alt ":" ")+cs.c; function _22c(_22e){ var css=opts.rowStyler?opts.rowStyler.call(_229,_22e,_22b):""; return this.getStyleValue(css); }; function _22f(_230){ var tr=opts.finder.getTr(_229,_22a,"body",(_230?1:2)); if(!tr.length){ return; } var _231=$(_229).datagrid("getColumnFields",_230); var _232=tr.find("div.datagrid-cell-check input[type=checkbox]").is(":checked"); tr.html(this.renderRow.call(this,_229,_231,_230,_22a,_22b)); var _233=(tr.hasClass("datagrid-row-checked")?" datagrid-row-checked":"")+(tr.hasClass("datagrid-row-selected")?" datagrid-row-selected":""); tr.attr("style",_22d).attr("class",cls+_233); if(_232){ tr.find("div.datagrid-cell-check input[type=checkbox]")._propAttr("checked",true); } }; _22f.call(this,true); _22f.call(this,false); $(_229).datagrid("fixRowHeight",_22a); },insertRow:function(_234,_235,row){ var _236=$.data(_234,"datagrid"); var opts=_236.options; var dc=_236.dc; var data=_236.data; if(_235==undefined||_235==null){ _235=data.rows.length; } if(_235>data.rows.length){ _235=data.rows.length; } function _237(_238){ var _239=_238?1:2; for(var i=data.rows.length-1;i>=_235;i--){ var tr=opts.finder.getTr(_234,i,"body",_239); tr.attr("datagrid-row-index",i+1); tr.attr("id",_236.rowIdPrefix+"-"+_239+"-"+(i+1)); if(_238&&opts.rownumbers){ var _23a=i+2; if(opts.pagination){ _23a+=(opts.pageNumber-1)*opts.pageSize; } tr.find("div.datagrid-cell-rownumber").html(_23a); } if(opts.striped){ tr.removeClass("datagrid-row-alt").addClass((i+1)%2?"datagrid-row-alt":""); } } }; function _23b(_23c){ var _23d=_23c?1:2; var _23e=$(_234).datagrid("getColumnFields",_23c); var _23f=_236.rowIdPrefix+"-"+_23d+"-"+_235; var tr=""; if(_235>=data.rows.length){ if(data.rows.length){ opts.finder.getTr(_234,"","last",_23d).after(tr); }else{ var cc=_23c?dc.body1:dc.body2; cc.html(""+tr+"
    "); } }else{ opts.finder.getTr(_234,_235+1,"body",_23d).before(tr); } }; _237.call(this,true); _237.call(this,false); _23b.call(this,true); _23b.call(this,false); data.total+=1; data.rows.splice(_235,0,row); this.setEmptyMsg(_234); this.refreshRow.call(this,_234,_235); },deleteRow:function(_240,_241){ var _242=$.data(_240,"datagrid"); var opts=_242.options; var data=_242.data; function _243(_244){ var _245=_244?1:2; for(var i=_241+1;i").appendTo(_24c.dc.view); d.html(opts.emptyMsg).css("top",h+"px"); } } },renderEmptyRow:function(_24e){ var cols=$.map($(_24e).datagrid("getColumnFields"),function(_24f){ return $(_24e).datagrid("getColumnOption",_24f); }); $.map(cols,function(col){ col.formatter1=col.formatter; col.styler1=col.styler; col.formatter=col.styler=undefined; }); var _250=$.data(_24e,"datagrid").dc.body2; _250.html(this.renderTable(_24e,0,[{}],false)); _250.find("tbody *").css({height:1,borderColor:"transparent",background:"transparent"}); var tr=_250.find(".datagrid-row"); tr.removeClass("datagrid-row").removeAttr("datagrid-row-index"); tr.find(".datagrid-cell,.datagrid-cell-check").empty(); $.map(cols,function(col){ col.formatter=col.formatter1; col.styler=col.styler1; col.formatter1=col.styler1=undefined; }); }}; $.fn.datagrid.defaults=$.extend({},$.fn.panel.defaults,{sharedStyleSheet:false,frozenColumns:undefined,columns:undefined,fitColumns:false,resizeHandle:"right",autoRowHeight:true,toolbar:null,striped:false,method:"post",nowrap:true,idField:null,url:null,data:null,loadMsg:"Processing, please wait ...",emptyMsg:"",rownumbers:false,singleSelect:false,ctrlSelect:false,selectOnCheck:true,checkOnSelect:true,pagination:false,pagePosition:"bottom",pageNumber:1,pageSize:10,pageList:[10,20,30,40,50],queryParams:{},sortName:null,sortOrder:"asc",multiSort:false,remoteSort:true,showHeader:true,showFooter:false,scrollbarSize:18,rownumberWidth:30,editorHeight:24,headerEvents:{mouseover:_82(true),mouseout:_82(false),click:_86,dblclick:_8d,contextmenu:_93},rowEvents:{mouseover:_96(true),mouseout:_96(false),click:_9e,dblclick:_a9,contextmenu:_ae},rowStyler:function(_251,_252){ },loader:function(_253,_254,_255){ var opts=$(this).datagrid("options"); if(!opts.url){ return false; } $.ajax({type:opts.method,url:opts.url,data:_253,dataType:"json",success:function(data){ _254(data); },error:function(){ _255.apply(this,arguments); }}); },loadFilter:function(data){ return data; },editors:_1c2,finder:{getTr:function(_256,_257,type,_258){ type=type||"body"; _258=_258||0; var _259=$.data(_256,"datagrid"); var dc=_259.dc; var opts=_259.options; if(_258==0){ var tr1=opts.finder.getTr(_256,_257,type,1); var tr2=opts.finder.getTr(_256,_257,type,2); return tr1.add(tr2); }else{ if(type=="body"){ var tr=$("#"+_259.rowIdPrefix+"-"+_258+"-"+_257); if(!tr.length){ tr=(_258==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index="+_257+"]"); } return tr; }else{ if(type=="footer"){ return (_258==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index="+_257+"]"); }else{ if(type=="selected"){ return (_258==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-selected"); }else{ if(type=="highlight"){ return (_258==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-over"); }else{ if(type=="checked"){ return (_258==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-checked"); }else{ if(type=="editing"){ return (_258==1?dc.body1:dc.body2).find(">table>tbody>tr.datagrid-row-editing"); }else{ if(type=="last"){ return (_258==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index]:last"); }else{ if(type=="allbody"){ return (_258==1?dc.body1:dc.body2).find(">table>tbody>tr[datagrid-row-index]"); }else{ if(type=="allfooter"){ return (_258==1?dc.footer1:dc.footer2).find(">table>tbody>tr[datagrid-row-index]"); } } } } } } } } } } },getRow:function(_25a,p){ var _25b=(typeof p=="object")?p.attr("datagrid-row-index"):p; return $.data(_25a,"datagrid").data.rows[parseInt(_25b)]; },getRows:function(_25c){ return $(_25c).datagrid("getRows"); }},view:_20b,onBeforeLoad:function(_25d){ },onLoadSuccess:function(){ },onLoadError:function(){ },onClickRow:function(_25e,_25f){ },onDblClickRow:function(_260,_261){ },onClickCell:function(_262,_263,_264){ },onDblClickCell:function(_265,_266,_267){ },onBeforeSortColumn:function(sort,_268){ },onSortColumn:function(sort,_269){ },onResizeColumn:function(_26a,_26b){ },onBeforeSelect:function(_26c,_26d){ },onSelect:function(_26e,_26f){ },onBeforeUnselect:function(_270,_271){ },onUnselect:function(_272,_273){ },onSelectAll:function(rows){ },onUnselectAll:function(rows){ },onBeforeCheck:function(_274,_275){ },onCheck:function(_276,_277){ },onBeforeUncheck:function(_278,_279){ },onUncheck:function(_27a,_27b){ },onCheckAll:function(rows){ },onUncheckAll:function(rows){ },onBeforeEdit:function(_27c,_27d){ },onBeginEdit:function(_27e,_27f){ },onEndEdit:function(_280,_281,_282){ },onAfterEdit:function(_283,_284,_285){ },onCancelEdit:function(_286,_287){ },onHeaderContextMenu:function(e,_288){ },onRowContextMenu:function(e,_289,_28a){ }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.datalist.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"datalist").options; $(_2).datagrid($.extend({},_3,{cls:"datalist"+(_3.lines?" datalist-lines":""),frozenColumns:(_3.frozenColumns&&_3.frozenColumns.length)?_3.frozenColumns:(_3.checkbox?[[{field:"_ck",checkbox:true}]]:undefined),columns:(_3.columns&&_3.columns.length)?_3.columns:[[{field:_3.textField,width:"100%",formatter:function(_4,_5,_6){ return _3.textFormatter?_3.textFormatter(_4,_5,_6):_4; }}]]})); }; var _7=$.extend({},$.fn.datagrid.defaults.view,{render:function(_8,_9,_a){ var _b=$.data(_8,"datagrid"); var _c=_b.options; if(_c.groupField){ var g=this.groupRows(_8,_b.data.rows); this.groups=g.groups; _b.data.rows=g.rows; var _d=[]; for(var i=0;i"); if(!_11){ _15.push(""); _15.push(_13.groupFormatter.call(_e,_10.value,_10.rows)); _15.push(""); } _15.push(""); _15.push(this.renderTable(_e,_10.startIndex,_10.rows,_11)); return _15.join(""); },groupRows:function(_16,_17){ var _18=$.data(_16,"datagrid"); var _19=_18.options; var _1a=[]; for(var i=0;i<_17.length;i++){ var row=_17[i]; var _1b=_1c(row[_19.groupField]); if(!_1b){ _1b={value:row[_19.groupField],rows:[row]}; _1a.push(_1b); }else{ _1b.rows.push(row); } } var _1d=0; var _17=[]; for(var i=0;i<_1a.length;i++){ var _1b=_1a[i]; _1b.startIndex=_1d; _1d+=_1b.rows.length; _17=_17.concat(_1b.rows); } return {groups:_1a,rows:_17}; function _1c(_1e){ for(var i=0;i<_1a.length;i++){ var _1f=_1a[i]; if(_1f.value==_1e){ return _1f; } } return null; }; }}); $.fn.datalist=function(_20,_21){ if(typeof _20=="string"){ var _22=$.fn.datalist.methods[_20]; if(_22){ return _22(this,_21); }else{ return this.datagrid(_20,_21); } } _20=_20||{}; return this.each(function(){ var _23=$.data(this,"datalist"); if(_23){ $.extend(_23.options,_20); }else{ var _24=$.extend({},$.fn.datalist.defaults,$.fn.datalist.parseOptions(this),_20); _24.columns=$.extend(true,[],_24.columns); _23=$.data(this,"datalist",{options:_24}); } _1(this); if(!_23.options.data){ var _25=$.fn.datalist.parseData(this); if(_25.total){ $(this).datalist("loadData",_25); } } }); }; $.fn.datalist.methods={options:function(jq){ return $.data(jq[0],"datalist").options; }}; $.fn.datalist.parseOptions=function(_26){ return $.extend({},$.fn.datagrid.parseOptions(_26),$.parser.parseOptions(_26,["valueField","textField","groupField",{checkbox:"boolean",lines:"boolean"}])); }; $.fn.datalist.parseData=function(_27){ var _28=$.data(_27,"datalist").options; var _29={total:0,rows:[]}; $(_27).children().each(function(){ var _2a=$.parser.parseOptions(this,["value","group"]); var row={}; var _2b=$(this).html(); row[_28.valueField]=_2a.value!=undefined?_2a.value:_2b; row[_28.textField]=_2b; if(_28.groupField){ row[_28.groupField]=_2a.group; } _29.total++; _29.rows.push(row); }); return _29; }; $.fn.datalist.defaults=$.extend({},$.fn.datagrid.defaults,{fitColumns:true,singleSelect:true,showHeader:false,checkbox:false,lines:false,valueField:"value",textField:"text",groupField:"",view:_7,textFormatter:function(_2c,row){ return _2c; },groupFormatter:function(_2d,_2e){ return _2d; }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.datebox.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"datebox"); var _4=_3.options; $(_2).addClass("datebox-f").combo($.extend({},_4,{onShowPanel:function(){ _5(this); _6(this); _7(this); _18(this,$(this).datebox("getText"),true); _4.onShowPanel.call(this); }})); if(!_3.calendar){ var _8=$(_2).combo("panel").css("overflow","hidden"); _8.panel("options").onBeforeDestroy=function(){ var c=$(this).find(".calendar-shared"); if(c.length){ c.insertBefore(c[0].pholder); } }; var cc=$("
    ").prependTo(_8); if(_4.sharedCalendar){ var c=$(_4.sharedCalendar); if(!c[0].pholder){ c[0].pholder=$("
    ").insertAfter(c); } c.addClass("calendar-shared").appendTo(cc); if(!c.hasClass("calendar")){ c.calendar(); } _3.calendar=c; }else{ _3.calendar=$("
    ").appendTo(cc).calendar(); } $.extend(_3.calendar.calendar("options"),{fit:true,border:false,onSelect:function(_9){ var _a=this.target; var _b=$(_a).datebox("options"); _18(_a,_b.formatter.call(_a,_9)); $(_a).combo("hidePanel"); _b.onSelect.call(_a,_9); }}); } $(_2).combo("textbox").parent().addClass("datebox"); $(_2).datebox("initValue",_4.value); function _5(_c){ var _d=$(_c).datebox("options"); var _e=$(_c).combo("panel"); _e.unbind(".datebox").bind("click.datebox",function(e){ if($(e.target).hasClass("datebox-button-a")){ var _f=parseInt($(e.target).attr("datebox-button-index")); _d.buttons[_f].handler.call(e.target,_c); } }); }; function _6(_10){ var _11=$(_10).combo("panel"); if(_11.children("div.datebox-button").length){ return; } var _12=$("
    ").appendTo(_11); var tr=_12.find("tr"); for(var i=0;i<_4.buttons.length;i++){ var td=$("").appendTo(tr); var btn=_4.buttons[i]; var t=$("").html($.isFunction(btn.text)?btn.text(_10):btn.text).appendTo(td); t.attr("datebox-button-index",i); } tr.find("td").css("width",(100/_4.buttons.length)+"%"); }; function _7(_13){ var _14=$(_13).combo("panel"); var cc=_14.children("div.datebox-calendar-inner"); _14.children()._outerWidth(_14.width()); _3.calendar.appendTo(cc); _3.calendar[0].target=_13; if(_4.panelHeight!="auto"){ var _15=_14.height(); _14.children().not(cc).each(function(){ _15-=$(this).outerHeight(); }); cc._outerHeight(_15); } _3.calendar.calendar("resize"); }; }; function _16(_17,q){ _18(_17,q,true); }; function _19(_1a){ var _1b=$.data(_1a,"datebox"); var _1c=_1b.options; var _1d=_1b.calendar.calendar("options").current; if(_1d){ _18(_1a,_1c.formatter.call(_1a,_1d)); $(_1a).combo("hidePanel"); } }; function _18(_1e,_1f,_20){ var _21=$.data(_1e,"datebox"); var _22=_21.options; var _23=_21.calendar; _23.calendar("moveTo",_22.parser.call(_1e,_1f)); if(_20){ $(_1e).combo("setValue",_1f); }else{ if(_1f){ _1f=_22.formatter.call(_1e,_23.calendar("options").current); } $(_1e).combo("setText",_1f).combo("setValue",_1f); } }; $.fn.datebox=function(_24,_25){ if(typeof _24=="string"){ var _26=$.fn.datebox.methods[_24]; if(_26){ return _26(this,_25); }else{ return this.combo(_24,_25); } } _24=_24||{}; return this.each(function(){ var _27=$.data(this,"datebox"); if(_27){ $.extend(_27.options,_24); }else{ $.data(this,"datebox",{options:$.extend({},$.fn.datebox.defaults,$.fn.datebox.parseOptions(this),_24)}); } _1(this); }); }; $.fn.datebox.methods={options:function(jq){ var _28=jq.combo("options"); return $.extend($.data(jq[0],"datebox").options,{width:_28.width,height:_28.height,originalValue:_28.originalValue,disabled:_28.disabled,readonly:_28.readonly}); },cloneFrom:function(jq,_29){ return jq.each(function(){ $(this).combo("cloneFrom",_29); $.data(this,"datebox",{options:$.extend(true,{},$(_29).datebox("options")),calendar:$(_29).datebox("calendar")}); $(this).addClass("datebox-f"); }); },calendar:function(jq){ return $.data(jq[0],"datebox").calendar; },initValue:function(jq,_2a){ return jq.each(function(){ var _2b=$(this).datebox("options"); var _2c=_2b.value; if(_2c){ _2c=_2b.formatter.call(this,_2b.parser.call(this,_2c)); } $(this).combo("initValue",_2c).combo("setText",_2c); }); },setValue:function(jq,_2d){ return jq.each(function(){ _18(this,_2d); }); },reset:function(jq){ return jq.each(function(){ var _2e=$(this).datebox("options"); $(this).datebox("setValue",_2e.originalValue); }); }}; $.fn.datebox.parseOptions=function(_2f){ return $.extend({},$.fn.combo.parseOptions(_2f),$.parser.parseOptions(_2f,["sharedCalendar"])); }; $.fn.datebox.defaults=$.extend({},$.fn.combo.defaults,{panelWidth:180,panelHeight:"auto",sharedCalendar:null,keyHandler:{up:function(e){ },down:function(e){ },left:function(e){ },right:function(e){ },enter:function(e){ _19(this); },query:function(q,e){ _16(this,q); }},currentText:"Today",closeText:"Close",okText:"Ok",buttons:[{text:function(_30){ return $(_30).datebox("options").currentText; },handler:function(_31){ var now=new Date(); $(_31).datebox("calendar").calendar({year:now.getFullYear(),month:now.getMonth()+1,current:new Date(now.getFullYear(),now.getMonth(),now.getDate())}); _19(_31); }},{text:function(_32){ return $(_32).datebox("options").closeText; },handler:function(_33){ $(this).closest("div.combo-panel").panel("close"); }}],formatter:function(_34){ var y=_34.getFullYear(); var m=_34.getMonth()+1; var d=_34.getDate(); return (m<10?("0"+m):m)+"/"+(d<10?("0"+d):d)+"/"+y; },parser:function(s){ if(!s){ return new Date(); } var ss=s.split("/"); var m=parseInt(ss[0],10); var d=parseInt(ss[1],10); var y=parseInt(ss[2],10); if(!isNaN(y)&&!isNaN(m)&&!isNaN(d)){ return new Date(y,m-1,d); }else{ return new Date(); } },onSelect:function(_35){ }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.datetimebox.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"datetimebox"); var _4=_3.options; $(_2).datebox($.extend({},_4,{onShowPanel:function(){ var _5=$(this).datetimebox("getValue"); _d(this,_5,true); _4.onShowPanel.call(this); },formatter:$.fn.datebox.defaults.formatter,parser:$.fn.datebox.defaults.parser})); $(_2).removeClass("datebox-f").addClass("datetimebox-f"); $(_2).datebox("calendar").calendar({onSelect:function(_6){ _4.onSelect.call(this.target,_6); }}); if(!_3.spinner){ var _7=$(_2).datebox("panel"); var p=$("
    ").insertAfter(_7.children("div.datebox-calendar-inner")); _3.spinner=p.children("input"); } _3.spinner.timespinner({width:_4.spinnerWidth,showSeconds:_4.showSeconds,separator:_4.timeSeparator}); $(_2).datetimebox("initValue",_4.value); }; function _8(_9){ var c=$(_9).datetimebox("calendar"); var t=$(_9).datetimebox("spinner"); var _a=c.calendar("options").current; return new Date(_a.getFullYear(),_a.getMonth(),_a.getDate(),t.timespinner("getHours"),t.timespinner("getMinutes"),t.timespinner("getSeconds")); }; function _b(_c,q){ _d(_c,q,true); }; function _e(_f){ var _10=$.data(_f,"datetimebox").options; var _11=_8(_f); _d(_f,_10.formatter.call(_f,_11)); $(_f).combo("hidePanel"); }; function _d(_12,_13,_14){ var _15=$.data(_12,"datetimebox").options; $(_12).combo("setValue",_13); if(!_14){ if(_13){ var _16=_15.parser.call(_12,_13); $(_12).combo("setText",_15.formatter.call(_12,_16)); $(_12).combo("setValue",_15.formatter.call(_12,_16)); }else{ $(_12).combo("setText",_13); } } var _16=_15.parser.call(_12,_13); $(_12).datetimebox("calendar").calendar("moveTo",_16); $(_12).datetimebox("spinner").timespinner("setValue",_17(_16)); function _17(_18){ function _19(_1a){ return (_1a<10?"0":"")+_1a; }; var tt=[_19(_18.getHours()),_19(_18.getMinutes())]; if(_15.showSeconds){ tt.push(_19(_18.getSeconds())); } return tt.join($(_12).datetimebox("spinner").timespinner("options").separator); }; }; $.fn.datetimebox=function(_1b,_1c){ if(typeof _1b=="string"){ var _1d=$.fn.datetimebox.methods[_1b]; if(_1d){ return _1d(this,_1c); }else{ return this.datebox(_1b,_1c); } } _1b=_1b||{}; return this.each(function(){ var _1e=$.data(this,"datetimebox"); if(_1e){ $.extend(_1e.options,_1b); }else{ $.data(this,"datetimebox",{options:$.extend({},$.fn.datetimebox.defaults,$.fn.datetimebox.parseOptions(this),_1b)}); } _1(this); }); }; $.fn.datetimebox.methods={options:function(jq){ var _1f=jq.datebox("options"); return $.extend($.data(jq[0],"datetimebox").options,{originalValue:_1f.originalValue,disabled:_1f.disabled,readonly:_1f.readonly}); },cloneFrom:function(jq,_20){ return jq.each(function(){ $(this).datebox("cloneFrom",_20); $.data(this,"datetimebox",{options:$.extend(true,{},$(_20).datetimebox("options")),spinner:$(_20).datetimebox("spinner")}); $(this).removeClass("datebox-f").addClass("datetimebox-f"); }); },spinner:function(jq){ return $.data(jq[0],"datetimebox").spinner; },initValue:function(jq,_21){ return jq.each(function(){ var _22=$(this).datetimebox("options"); var _23=_22.value; if(_23){ _23=_22.formatter.call(this,_22.parser.call(this,_23)); } $(this).combo("initValue",_23).combo("setText",_23); }); },setValue:function(jq,_24){ return jq.each(function(){ _d(this,_24); }); },reset:function(jq){ return jq.each(function(){ var _25=$(this).datetimebox("options"); $(this).datetimebox("setValue",_25.originalValue); }); }}; $.fn.datetimebox.parseOptions=function(_26){ var t=$(_26); return $.extend({},$.fn.datebox.parseOptions(_26),$.parser.parseOptions(_26,["timeSeparator","spinnerWidth",{showSeconds:"boolean"}])); }; $.fn.datetimebox.defaults=$.extend({},$.fn.datebox.defaults,{spinnerWidth:"100%",showSeconds:true,timeSeparator:":",keyHandler:{up:function(e){ },down:function(e){ },left:function(e){ },right:function(e){ },enter:function(e){ _e(this); },query:function(q,e){ _b(this,q); }},buttons:[{text:function(_27){ return $(_27).datetimebox("options").currentText; },handler:function(_28){ var _29=$(_28).datetimebox("options"); _d(_28,_29.formatter.call(_28,new Date())); $(_28).datetimebox("hidePanel"); }},{text:function(_2a){ return $(_2a).datetimebox("options").okText; },handler:function(_2b){ _e(_2b); }},{text:function(_2c){ return $(_2c).datetimebox("options").closeText; },handler:function(_2d){ $(_2d).datetimebox("hidePanel"); }}],formatter:function(_2e){ var h=_2e.getHours(); var M=_2e.getMinutes(); var s=_2e.getSeconds(); function _2f(_30){ return (_30<10?"0":"")+_30; }; var _31=$(this).datetimebox("spinner").timespinner("options").separator; var r=$.fn.datebox.defaults.formatter(_2e)+" "+_2f(h)+_31+_2f(M); if($(this).datetimebox("options").showSeconds){ r+=_31+_2f(s); } return r; },parser:function(s){ if($.trim(s)==""){ return new Date(); } var dt=s.split(" "); var d=$.fn.datebox.defaults.parser(dt[0]); if(dt.length<2){ return d; } var _32=$(this).datetimebox("spinner").timespinner("options").separator; var tt=dt[1].split(_32); var _33=parseInt(tt[0],10)||0; var _34=parseInt(tt[1],10)||0; var _35=parseInt(tt[2],10)||0; return new Date(d.getFullYear(),d.getMonth(),d.getDate(),_33,_34,_35); }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.datetimespinner.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"datetimespinner").options; $(_2).addClass("datetimespinner-f").timespinner(_3); }; $.fn.datetimespinner=function(_4,_5){ if(typeof _4=="string"){ var _6=$.fn.datetimespinner.methods[_4]; if(_6){ return _6(this,_5); }else{ return this.timespinner(_4,_5); } } _4=_4||{}; return this.each(function(){ var _7=$.data(this,"datetimespinner"); if(_7){ $.extend(_7.options,_4); }else{ $.data(this,"datetimespinner",{options:$.extend({},$.fn.datetimespinner.defaults,$.fn.datetimespinner.parseOptions(this),_4)}); } _1(this); }); }; $.fn.datetimespinner.methods={options:function(jq){ var _8=jq.timespinner("options"); return $.extend($.data(jq[0],"datetimespinner").options,{width:_8.width,value:_8.value,originalValue:_8.originalValue,disabled:_8.disabled,readonly:_8.readonly}); }}; $.fn.datetimespinner.parseOptions=function(_9){ return $.extend({},$.fn.timespinner.parseOptions(_9),$.parser.parseOptions(_9,[])); }; $.fn.datetimespinner.defaults=$.extend({},$.fn.timespinner.defaults,{formatter:function(_a){ if(!_a){ return ""; } return $.fn.datebox.defaults.formatter.call(this,_a)+" "+$.fn.timespinner.defaults.formatter.call(this,_a); },parser:function(s){ s=$.trim(s); if(!s){ return null; } var dt=s.split(" "); var _b=$.fn.datebox.defaults.parser.call(this,dt[0]); if(dt.length<2){ return _b; } var _c=$.fn.timespinner.defaults.parser.call(this,dt[1]); return new Date(_b.getFullYear(),_b.getMonth(),_b.getDate(),_c.getHours(),_c.getMinutes(),_c.getSeconds()); },selections:[[0,2],[3,5],[6,10],[11,13],[14,16],[17,19]]}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.dialog.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"dialog").options; _3.inited=false; $(_2).window($.extend({},_3,{onResize:function(w,h){ if(_3.inited){ _b(this); _3.onResize.call(this,w,h); } }})); var _4=$(_2).window("window"); if(_3.toolbar){ if($.isArray(_3.toolbar)){ $(_2).siblings("div.dialog-toolbar").remove(); var _5=$("
    ").appendTo(_4); var tr=_5.find("tr"); for(var i=0;i<_3.toolbar.length;i++){ var _6=_3.toolbar[i]; if(_6=="-"){ $("
    ").appendTo(tr); }else{ var td=$("").appendTo(tr); var _7=$("").appendTo(td); _7[0].onclick=eval(_6.handler||function(){ }); _7.linkbutton($.extend({},_6,{plain:true})); } } }else{ $(_3.toolbar).addClass("dialog-toolbar").appendTo(_4); $(_3.toolbar).show(); } }else{ $(_2).siblings("div.dialog-toolbar").remove(); } if(_3.buttons){ if($.isArray(_3.buttons)){ $(_2).siblings("div.dialog-button").remove(); var _8=$("
    ").appendTo(_4); for(var i=0;i<_3.buttons.length;i++){ var p=_3.buttons[i]; var _9=$("").appendTo(_8); if(p.handler){ _9[0].onclick=p.handler; } _9.linkbutton(p); } }else{ $(_3.buttons).addClass("dialog-button").appendTo(_4); $(_3.buttons).show(); } }else{ $(_2).siblings("div.dialog-button").remove(); } _3.inited=true; var _a=_3.closed; _4.show(); $(_2).window("resize"); if(_a){ _4.hide(); } }; function _b(_c,_d){ var t=$(_c); var _e=t.dialog("options"); var _f=_e.noheader; var tb=t.siblings(".dialog-toolbar"); var bb=t.siblings(".dialog-button"); tb.insertBefore(_c).css({borderTopWidth:(_f?1:0),top:(_f?tb.length:0)}); bb.insertAfter(_c); tb.add(bb)._outerWidth(t._outerWidth()).find(".easyui-fluid:visible").each(function(){ $(this).triggerHandler("_resize"); }); var _10=tb._outerHeight()+bb._outerHeight(); if(!isNaN(parseInt(_e.height))){ t._outerHeight(t._outerHeight()-_10); }else{ var _11=t._size("min-height"); if(_11){ t._size("min-height",_11-_10); } var _12=t._size("max-height"); if(_12){ t._size("max-height",_12-_10); } } var _13=$.data(_c,"window").shadow; if(_13){ var cc=t.panel("panel"); _13.css({width:cc._outerWidth(),height:cc._outerHeight()}); } }; $.fn.dialog=function(_14,_15){ if(typeof _14=="string"){ var _16=$.fn.dialog.methods[_14]; if(_16){ return _16(this,_15); }else{ return this.window(_14,_15); } } _14=_14||{}; return this.each(function(){ var _17=$.data(this,"dialog"); if(_17){ $.extend(_17.options,_14); }else{ $.data(this,"dialog",{options:$.extend({},$.fn.dialog.defaults,$.fn.dialog.parseOptions(this),_14)}); } _1(this); }); }; $.fn.dialog.methods={options:function(jq){ var _18=$.data(jq[0],"dialog").options; var _19=jq.panel("options"); $.extend(_18,{width:_19.width,height:_19.height,left:_19.left,top:_19.top,closed:_19.closed,collapsed:_19.collapsed,minimized:_19.minimized,maximized:_19.maximized}); return _18; },dialog:function(jq){ return jq.window("window"); }}; $.fn.dialog.parseOptions=function(_1a){ var t=$(_1a); return $.extend({},$.fn.window.parseOptions(_1a),$.parser.parseOptions(_1a,["toolbar","buttons"]),{toolbar:(t.children(".dialog-toolbar").length?t.children(".dialog-toolbar").removeClass("dialog-toolbar"):undefined),buttons:(t.children(".dialog-button").length?t.children(".dialog-button").removeClass("dialog-button"):undefined)}); }; $.fn.dialog.defaults=$.extend({},$.fn.window.defaults,{title:"New Dialog",collapsible:false,minimizable:false,maximizable:false,resizable:false,toolbar:null,buttons:null}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.draggable.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(e){ var _2=$.data(e.data.target,"draggable"); var _3=_2.options; var _4=_2.proxy; var _5=e.data; var _6=_5.startLeft+e.pageX-_5.startX; var _7=_5.startTop+e.pageY-_5.startY; if(_4){ if(_4.parent()[0]==document.body){ if(_3.deltaX!=null&&_3.deltaX!=undefined){ _6=e.pageX+_3.deltaX; }else{ _6=e.pageX-e.data.offsetWidth; } if(_3.deltaY!=null&&_3.deltaY!=undefined){ _7=e.pageY+_3.deltaY; }else{ _7=e.pageY-e.data.offsetHeight; } }else{ if(_3.deltaX!=null&&_3.deltaX!=undefined){ _6+=e.data.offsetWidth+_3.deltaX; } if(_3.deltaY!=null&&_3.deltaY!=undefined){ _7+=e.data.offsetHeight+_3.deltaY; } } } if(e.data.parent!=document.body){ _6+=$(e.data.parent).scrollLeft(); _7+=$(e.data.parent).scrollTop(); } if(_3.axis=="h"){ _5.left=_6; }else{ if(_3.axis=="v"){ _5.top=_7; }else{ _5.left=_6; _5.top=_7; } } }; function _8(e){ var _9=$.data(e.data.target,"draggable"); var _a=_9.options; var _b=_9.proxy; if(!_b){ _b=$(e.data.target); } _b.css({left:e.data.left,top:e.data.top}); $("body").css("cursor",_a.cursor); }; function _c(e){ if(!$.fn.draggable.isDragging){ return false; } var _d=$.data(e.data.target,"draggable"); var _e=_d.options; var _f=$(".droppable:visible").filter(function(){ return e.data.target!=this; }).filter(function(){ var _10=$.data(this,"droppable").options.accept; if(_10){ return $(_10).filter(function(){ return this==e.data.target; }).length>0; }else{ return true; } }); _d.droppables=_f; var _11=_d.proxy; if(!_11){ if(_e.proxy){ if(_e.proxy=="clone"){ _11=$(e.data.target).clone().insertAfter(e.data.target); }else{ _11=_e.proxy.call(e.data.target,e.data.target); } _d.proxy=_11; }else{ _11=$(e.data.target); } } _11.css("position","absolute"); _1(e); _8(e); _e.onStartDrag.call(e.data.target,e); return false; }; function _12(e){ if(!$.fn.draggable.isDragging){ return false; } var _13=$.data(e.data.target,"draggable"); _1(e); if(_13.options.onDrag.call(e.data.target,e)!=false){ _8(e); } var _14=e.data.target; _13.droppables.each(function(){ var _15=$(this); if(_15.droppable("options").disabled){ return; } var p2=_15.offset(); if(e.pageX>p2.left&&e.pageXp2.top&&e.pageYp2.left&&e.pageXp2.top&&e.pageY_2b.options.edge; }; }); }; $.fn.draggable.methods={options:function(jq){ return $.data(jq[0],"draggable").options; },proxy:function(jq){ return $.data(jq[0],"draggable").proxy; },enable:function(jq){ return jq.each(function(){ $(this).draggable({disabled:false}); }); },disable:function(jq){ return jq.each(function(){ $(this).draggable({disabled:true}); }); }}; $.fn.draggable.parseOptions=function(_30){ var t=$(_30); return $.extend({},$.parser.parseOptions(_30,["cursor","handle","axis",{"revert":"boolean","deltaX":"number","deltaY":"number","edge":"number","delay":"number"}]),{disabled:(t.attr("disabled")?true:undefined)}); }; $.fn.draggable.defaults={proxy:null,revert:false,cursor:"move",deltaX:null,deltaY:null,handle:null,disabled:false,edge:0,axis:null,delay:100,onBeforeDrag:function(e){ },onStartDrag:function(e){ },onDrag:function(e){ },onStopDrag:function(e){ }}; $.fn.draggable.isDragging=false; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.droppable.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ $(_2).addClass("droppable"); $(_2).bind("_dragenter",function(e,_3){ $.data(_2,"droppable").options.onDragEnter.apply(_2,[e,_3]); }); $(_2).bind("_dragleave",function(e,_4){ $.data(_2,"droppable").options.onDragLeave.apply(_2,[e,_4]); }); $(_2).bind("_dragover",function(e,_5){ $.data(_2,"droppable").options.onDragOver.apply(_2,[e,_5]); }); $(_2).bind("_drop",function(e,_6){ $.data(_2,"droppable").options.onDrop.apply(_2,[e,_6]); }); }; $.fn.droppable=function(_7,_8){ if(typeof _7=="string"){ return $.fn.droppable.methods[_7](this,_8); } _7=_7||{}; return this.each(function(){ var _9=$.data(this,"droppable"); if(_9){ $.extend(_9.options,_7); }else{ _1(this); $.data(this,"droppable",{options:$.extend({},$.fn.droppable.defaults,$.fn.droppable.parseOptions(this),_7)}); } }); }; $.fn.droppable.methods={options:function(jq){ return $.data(jq[0],"droppable").options; },enable:function(jq){ return jq.each(function(){ $(this).droppable({disabled:false}); }); },disable:function(jq){ return jq.each(function(){ $(this).droppable({disabled:true}); }); }}; $.fn.droppable.parseOptions=function(_a){ var t=$(_a); return $.extend({},$.parser.parseOptions(_a,["accept"]),{disabled:(t.attr("disabled")?true:undefined)}); }; $.fn.droppable.defaults={accept:null,disabled:false,onDragEnter:function(e,_b){ },onDragOver:function(e,_c){ },onDragLeave:function(e,_d){ },onDrop:function(e,_e){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.filebox.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ var _1=0; function _2(_3){ var _4=$.data(_3,"filebox"); var _5=_4.options; _5.fileboxId="filebox_file_id_"+(++_1); $(_3).addClass("filebox-f").textbox(_5); $(_3).textbox("textbox").attr("readonly","readonly"); _4.filebox=$(_3).next().addClass("filebox"); var _6=_7(_3); var _8=$(_3).filebox("button"); if(_8.length){ $("").appendTo(_8); if(_8.linkbutton("options").disabled){ _6.attr("disabled","disabled"); }else{ _6.removeAttr("disabled"); } } }; function _7(_9){ var _a=$.data(_9,"filebox"); var _b=_a.options; _a.filebox.find(".textbox-value").remove(); _b.oldValue=""; var _c=$("").appendTo(_a.filebox); _c.attr("id",_b.fileboxId).attr("name",$(_9).attr("textboxName")||""); _c.attr("accept",_b.accept); if(_b.multiple){ _c.attr("multiple","multiple"); } _c.change(function(){ var _d=this.value; if(this.files){ _d=$.map(this.files,function(_e){ return _e.name; }).join(_b.separator); } $(_9).filebox("setText",_d); _b.onChange.call(_9,_d,_b.oldValue); _b.oldValue=_d; }); return _c; }; $.fn.filebox=function(_f,_10){ if(typeof _f=="string"){ var _11=$.fn.filebox.methods[_f]; if(_11){ return _11(this,_10); }else{ return this.textbox(_f,_10); } } _f=_f||{}; return this.each(function(){ var _12=$.data(this,"filebox"); if(_12){ $.extend(_12.options,_f); }else{ $.data(this,"filebox",{options:$.extend({},$.fn.filebox.defaults,$.fn.filebox.parseOptions(this),_f)}); } _2(this); }); }; $.fn.filebox.methods={options:function(jq){ var _13=jq.textbox("options"); return $.extend($.data(jq[0],"filebox").options,{width:_13.width,value:_13.value,originalValue:_13.originalValue,disabled:_13.disabled,readonly:_13.readonly}); },clear:function(jq){ return jq.each(function(){ $(this).textbox("clear"); _7(this); }); },reset:function(jq){ return jq.each(function(){ $(this).filebox("clear"); }); },setValue:function(jq){ return jq; },setValues:function(jq){ return jq; }}; $.fn.filebox.parseOptions=function(_14){ var t=$(_14); return $.extend({},$.fn.textbox.parseOptions(_14),$.parser.parseOptions(_14,["accept","separator"]),{multiple:(t.attr("multiple")?true:undefined)}); }; $.fn.filebox.defaults=$.extend({},$.fn.textbox.defaults,{buttonIcon:null,buttonText:"Choose File",buttonAlign:"right",inputEvents:{},accept:"",separator:",",multiple:false}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.form.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2,_3){ var _4=$.data(_2,"form").options; $.extend(_4,_3||{}); var _5=$.extend({},_4.queryParams); if(_4.onSubmit.call(_2,_5)==false){ return; } var _6=$(_2).find(".textbox-text:focus"); _6.triggerHandler("blur"); _6.focus(); var _7=null; if(_4.dirty){ var ff=[]; $.map(_4.dirtyFields,function(f){ if($(f).hasClass("textbox-f")){ $(f).next().find(".textbox-value").each(function(){ ff.push(this); }); }else{ ff.push(f); } }); _7=$(_2).find("input[name]:enabled,textarea[name]:enabled,select[name]:enabled").filter(function(){ return $.inArray(this,ff)==-1; }); _7.attr("disabled","disabled"); } if(_4.ajax){ if(_4.iframe){ _8(_2,_5); }else{ if(window.FormData!==undefined){ _9(_2,_5); }else{ _8(_2,_5); } } }else{ $(_2).submit(); } if(_4.dirty){ _7.removeAttr("disabled"); } }; function _8(_a,_b){ var _c=$.data(_a,"form").options; var _d="easyui_frame_"+(new Date().getTime()); var _e=$("").appendTo("body"); _e.attr("src",window.ActiveXObject?"javascript:false":"about:blank"); _e.css({position:"absolute",top:-1000,left:-1000}); _e.bind("load",cb); _f(_b); function _f(_10){ var _11=$(_a); if(_c.url){ _11.attr("action",_c.url); } var t=_11.attr("target"),a=_11.attr("action"); _11.attr("target",_d); var _12=$(); try{ for(var n in _10){ var _13=$("").val(_10[n]).appendTo(_11); _12=_12.add(_13); } _14(); _11[0].submit(); } finally{ _11.attr("action",a); t?_11.attr("target",t):_11.removeAttr("target"); _12.remove(); } }; function _14(){ var f=$("#"+_d); if(!f.length){ return; } try{ var s=f.contents()[0].readyState; if(s&&s.toLowerCase()=="uninitialized"){ setTimeout(_14,100); } } catch(e){ cb(); } }; var _15=10; function cb(){ var f=$("#"+_d); if(!f.length){ return; } f.unbind(); var _16=""; try{ var _17=f.contents().find("body"); _16=_17.html(); if(_16==""){ if(--_15){ setTimeout(cb,100); return; } } var ta=_17.find(">textarea"); if(ta.length){ _16=ta.val(); }else{ var pre=_17.find(">pre"); if(pre.length){ _16=pre.html(); } } } catch(e){ } _c.success.call(_a,_16); setTimeout(function(){ f.unbind(); f.remove(); },100); }; }; function _9(_18,_19){ var _1a=$.data(_18,"form").options; var _1b=new FormData($(_18)[0]); for(var _1c in _19){ _1b.append(_1c,_19[_1c]); } $.ajax({url:_1a.url,type:"post",xhr:function(){ var xhr=$.ajaxSettings.xhr(); if(xhr.upload){ xhr.upload.addEventListener("progress",function(e){ if(e.lengthComputable){ var _1d=e.total; var _1e=e.loaded||e.position; var _1f=Math.ceil(_1e*100/_1d); _1a.onProgress.call(_18,_1f); } },false); } return xhr; },data:_1b,dataType:"html",cache:false,contentType:false,processData:false,complete:function(res){ _1a.success.call(_18,res.responseText); }}); }; function _20(_21,_22){ var _23=$.data(_21,"form").options; if(typeof _22=="string"){ var _24={}; if(_23.onBeforeLoad.call(_21,_24)==false){ return; } $.ajax({url:_22,data:_24,dataType:"json",success:function(_25){ _26(_25); },error:function(){ _23.onLoadError.apply(_21,arguments); }}); }else{ _26(_22); } function _26(_27){ var _28=$(_21); for(var _29 in _27){ var val=_27[_29]; if(!_2a(_29,val)){ if(!_2b(_29,val)){ _28.find("input[name=\""+_29+"\"]").val(val); _28.find("textarea[name=\""+_29+"\"]").val(val); _28.find("select[name=\""+_29+"\"]").val(val); } } } _23.onLoadSuccess.call(_21,_27); _28.form("validate"); }; function _2a(_2c,val){ var cc=$(_21).find("[switchbuttonName=\""+_2c+"\"]"); if(cc.length){ cc.switchbutton("uncheck"); cc.each(function(){ if(_2d($(this).switchbutton("options").value,val)){ $(this).switchbutton("check"); } }); return true; } cc=$(_21).find("input[name=\""+_2c+"\"][type=radio], input[name=\""+_2c+"\"][type=checkbox]"); if(cc.length){ cc._propAttr("checked",false); cc.each(function(){ if(_2d($(this).val(),val)){ $(this)._propAttr("checked",true); } }); return true; } return false; }; function _2d(v,val){ if(v==String(val)||$.inArray(v,$.isArray(val)?val:[val])>=0){ return true; }else{ return false; } }; function _2b(_2e,val){ var _2f=$(_21).find("[textboxName=\""+_2e+"\"],[sliderName=\""+_2e+"\"]"); if(_2f.length){ for(var i=0;i<_23.fieldTypes.length;i++){ var _30=_23.fieldTypes[i]; var _31=_2f.data(_30); if(_31){ if(_31.options.multiple||_31.options.range){ _2f[_30]("setValues",val); }else{ _2f[_30]("setValue",val); } return true; } } } return false; }; }; function _32(_33){ $("input,select,textarea",_33).each(function(){ if($(this).hasClass("textbox-value")){ return; } var t=this.type,tag=this.tagName.toLowerCase(); if(t=="text"||t=="hidden"||t=="password"||tag=="textarea"){ this.value=""; }else{ if(t=="file"){ var _34=$(this); if(!_34.hasClass("textbox-value")){ var _35=_34.clone().val(""); _35.insertAfter(_34); if(_34.data("validatebox")){ _34.validatebox("destroy"); _35.validatebox(); }else{ _34.remove(); } } }else{ if(t=="checkbox"||t=="radio"){ this.checked=false; }else{ if(tag=="select"){ this.selectedIndex=-1; } } } } }); var tmp=$(); var _36=$(_33); var _37=$.data(_33,"form").options; for(var i=0;i<_37.fieldTypes.length;i++){ var _38=_37.fieldTypes[i]; var _39=_36.find("."+_38+"-f").not(tmp); if(_39.length&&_39[_38]){ _39[_38]("clear"); tmp=tmp.add(_39); } } _36.form("validate"); }; function _3a(_3b){ _3b.reset(); var _3c=$(_3b); var _3d=$.data(_3b,"form").options; for(var i=_3d.fieldTypes.length-1;i>=0;i--){ var _3e=_3d.fieldTypes[i]; var _3f=_3c.find("."+_3e+"-f"); if(_3f.length&&_3f[_3e]){ _3f[_3e]("reset"); } } _3c.form("validate"); }; function _40(_41){ var _42=$.data(_41,"form").options; $(_41).unbind(".form"); if(_42.ajax){ $(_41).bind("submit.form",function(){ setTimeout(function(){ _1(_41,_42); },0); return false; }); } $(_41).bind("_change.form",function(e,t){ if($.inArray(t,_42.dirtyFields)==-1){ _42.dirtyFields.push(t); } _42.onChange.call(this,t); }).bind("change.form",function(e){ var t=e.target; if(!$(t).hasClass("textbox-text")){ if($.inArray(t,_42.dirtyFields)==-1){ _42.dirtyFields.push(t); } _42.onChange.call(this,t); } }); _43(_41,_42.novalidate); }; function _44(_45,_46){ _46=_46||{}; var _47=$.data(_45,"form"); if(_47){ $.extend(_47.options,_46); }else{ $.data(_45,"form",{options:$.extend({},$.fn.form.defaults,$.fn.form.parseOptions(_45),_46)}); } }; function _48(_49){ if($.fn.validatebox){ var t=$(_49); t.find(".validatebox-text:not(:disabled)").validatebox("validate"); var _4a=t.find(".validatebox-invalid"); _4a.filter(":not(:disabled):first").focus(); return _4a.length==0; } return true; }; function _43(_4b,_4c){ var _4d=$.data(_4b,"form").options; _4d.novalidate=_4c; $(_4b).find(".validatebox-text:not(:disabled)").validatebox(_4c?"disableValidation":"enableValidation"); }; $.fn.form=function(_4e,_4f){ if(typeof _4e=="string"){ this.each(function(){ _44(this); }); return $.fn.form.methods[_4e](this,_4f); } return this.each(function(){ _44(this,_4e); _40(this); }); }; $.fn.form.methods={options:function(jq){ return $.data(jq[0],"form").options; },submit:function(jq,_50){ return jq.each(function(){ _1(this,_50); }); },load:function(jq,_51){ return jq.each(function(){ _20(this,_51); }); },clear:function(jq){ return jq.each(function(){ _32(this); }); },reset:function(jq){ return jq.each(function(){ _3a(this); }); },validate:function(jq){ return _48(jq[0]); },disableValidation:function(jq){ return jq.each(function(){ _43(this,true); }); },enableValidation:function(jq){ return jq.each(function(){ _43(this,false); }); },resetValidation:function(jq){ return jq.each(function(){ $(this).find(".validatebox-text:not(:disabled)").validatebox("resetValidation"); }); },resetDirty:function(jq){ return jq.each(function(){ $(this).form("options").dirtyFields=[]; }); }}; $.fn.form.parseOptions=function(_52){ var t=$(_52); return $.extend({},$.parser.parseOptions(_52,[{ajax:"boolean",dirty:"boolean"}]),{url:(t.attr("action")?t.attr("action"):undefined)}); }; $.fn.form.defaults={fieldTypes:["combobox","combotree","combogrid","combotreegrid","datetimebox","datebox","combo","datetimespinner","timespinner","numberspinner","spinner","slider","searchbox","numberbox","passwordbox","filebox","textbox","switchbutton"],novalidate:false,ajax:true,iframe:true,dirty:false,dirtyFields:[],url:null,queryParams:{},onSubmit:function(_53){ return $(this).form("validate"); },onProgress:function(_54){ },success:function(_55){ },onBeforeLoad:function(_56){ },onLoadSuccess:function(_57){ },onLoadError:function(){ },onChange:function(_58){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.layout.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ var _1=false; function _2(_3,_4){ var _5=$.data(_3,"layout"); var _6=_5.options; var _7=_5.panels; var cc=$(_3); if(_4){ $.extend(_6,{width:_4.width,height:_4.height}); } if(_3.tagName.toLowerCase()=="body"){ cc._size("fit"); }else{ cc._size(_6); } var _8={top:0,left:0,width:cc.width(),height:cc.height()}; _9(_a(_7.expandNorth)?_7.expandNorth:_7.north,"n"); _9(_a(_7.expandSouth)?_7.expandSouth:_7.south,"s"); _b(_a(_7.expandEast)?_7.expandEast:_7.east,"e"); _b(_a(_7.expandWest)?_7.expandWest:_7.west,"w"); _7.center.panel("resize",_8); function _9(pp,_c){ if(!pp.length||!_a(pp)){ return; } var _d=pp.panel("options"); pp.panel("resize",{width:cc.width(),height:_d.height}); var _e=pp.panel("panel").outerHeight(); pp.panel("move",{left:0,top:(_c=="n"?0:cc.height()-_e)}); _8.height-=_e; if(_c=="n"){ _8.top+=_e; if(!_d.split&&_d.border){ _8.top--; } } if(!_d.split&&_d.border){ _8.height++; } }; function _b(pp,_f){ if(!pp.length||!_a(pp)){ return; } var _10=pp.panel("options"); pp.panel("resize",{width:_10.width,height:_8.height}); var _11=pp.panel("panel").outerWidth(); pp.panel("move",{left:(_f=="e"?cc.width()-_11:0),top:_8.top}); _8.width-=_11; if(_f=="w"){ _8.left+=_11; if(!_10.split&&_10.border){ _8.left--; } } if(!_10.split&&_10.border){ _8.width++; } }; }; function _12(_13){ var cc=$(_13); cc.addClass("layout"); function _14(el){ var _15=$.fn.layout.parsePanelOptions(el); if("north,south,east,west,center".indexOf(_15.region)>=0){ _19(_13,_15,el); } }; var _16=cc.layout("options"); var _17=_16.onAdd; _16.onAdd=function(){ }; cc.find(">div,>form>div").each(function(){ _14(this); }); _16.onAdd=_17; cc.append("
    "); cc.bind("_resize",function(e,_18){ if($(this).hasClass("easyui-fluid")||_18){ _2(_13); } return false; }); }; function _19(_1a,_1b,el){ _1b.region=_1b.region||"center"; var _1c=$.data(_1a,"layout").panels; var cc=$(_1a); var dir=_1b.region; if(_1c[dir].length){ return; } var pp=$(el); if(!pp.length){ pp=$("
    ").appendTo(cc); } var _1d=$.extend({},$.fn.layout.paneldefaults,{width:(pp.length?parseInt(pp[0].style.width)||pp.outerWidth():"auto"),height:(pp.length?parseInt(pp[0].style.height)||pp.outerHeight():"auto"),doSize:false,collapsible:true,onOpen:function(){ var _1e=$(this).panel("header").children("div.panel-tool"); _1e.children("a.panel-tool-collapse").hide(); var _1f={north:"up",south:"down",east:"right",west:"left"}; if(!_1f[dir]){ return; } var _20="layout-button-"+_1f[dir]; var t=_1e.children("a."+_20); if(!t.length){ t=$("").addClass(_20).appendTo(_1e); t.bind("click",{dir:dir},function(e){ _2d(_1a,e.data.dir); return false; }); } $(this).panel("options").collapsible?t.show():t.hide(); }},_1b,{cls:((_1b.cls||"")+" layout-panel layout-panel-"+dir),bodyCls:((_1b.bodyCls||"")+" layout-body")}); pp.panel(_1d); _1c[dir]=pp; var _21={north:"s",south:"n",east:"w",west:"e"}; var _22=pp.panel("panel"); if(pp.panel("options").split){ _22.addClass("layout-split-"+dir); } _22.resizable($.extend({},{handles:(_21[dir]||""),disabled:(!pp.panel("options").split),onStartResize:function(e){ _1=true; if(dir=="north"||dir=="south"){ var _23=$(">div.layout-split-proxy-v",_1a); }else{ var _23=$(">div.layout-split-proxy-h",_1a); } var top=0,_24=0,_25=0,_26=0; var pos={display:"block"}; if(dir=="north"){ pos.top=parseInt(_22.css("top"))+_22.outerHeight()-_23.height(); pos.left=parseInt(_22.css("left")); pos.width=_22.outerWidth(); pos.height=_23.height(); }else{ if(dir=="south"){ pos.top=parseInt(_22.css("top")); pos.left=parseInt(_22.css("left")); pos.width=_22.outerWidth(); pos.height=_23.height(); }else{ if(dir=="east"){ pos.top=parseInt(_22.css("top"))||0; pos.left=parseInt(_22.css("left"))||0; pos.width=_23.width(); pos.height=_22.outerHeight(); }else{ if(dir=="west"){ pos.top=parseInt(_22.css("top"))||0; pos.left=_22.outerWidth()-_23.width(); pos.width=_23.width(); pos.height=_22.outerHeight(); } } } } _23.css(pos); $("
    ").css({left:0,top:0,width:cc.width(),height:cc.height()}).appendTo(cc); },onResize:function(e){ if(dir=="north"||dir=="south"){ var _27=$(">div.layout-split-proxy-v",_1a); _27.css("top",e.pageY-$(_1a).offset().top-_27.height()/2); }else{ var _27=$(">div.layout-split-proxy-h",_1a); _27.css("left",e.pageX-$(_1a).offset().left-_27.width()/2); } return false; },onStopResize:function(e){ cc.children("div.layout-split-proxy-v,div.layout-split-proxy-h").hide(); pp.panel("resize",e.data); _2(_1a); _1=false; cc.find(">div.layout-mask").remove(); }},_1b)); cc.layout("options").onAdd.call(_1a,dir); }; function _28(_29,_2a){ var _2b=$.data(_29,"layout").panels; if(_2b[_2a].length){ _2b[_2a].panel("destroy"); _2b[_2a]=$(); var _2c="expand"+_2a.substring(0,1).toUpperCase()+_2a.substring(1); if(_2b[_2c]){ _2b[_2c].panel("destroy"); _2b[_2c]=undefined; } $(_29).layout("options").onRemove.call(_29,_2a); } }; function _2d(_2e,_2f,_30){ if(_30==undefined){ _30="normal"; } var _31=$.data(_2e,"layout").panels; var p=_31[_2f]; var _32=p.panel("options"); if(_32.onBeforeCollapse.call(p)==false){ return; } var _33="expand"+_2f.substring(0,1).toUpperCase()+_2f.substring(1); if(!_31[_33]){ _31[_33]=_34(_2f); var ep=_31[_33].panel("panel"); if(!_32.expandMode){ ep.css("cursor","default"); }else{ ep.bind("click",function(){ if(_32.expandMode=="dock"){ _41(_2e,_2f); }else{ p.panel("expand",false).panel("open"); var _35=_36(); p.panel("resize",_35.collapse); p.panel("panel").animate(_35.expand,function(){ $(this).unbind(".layout").bind("mouseleave.layout",{region:_2f},function(e){ if(_1==true){ return; } if($("body>div.combo-p>div.combo-panel:visible").length){ return; } _2d(_2e,e.data.region); }); $(_2e).layout("options").onExpand.call(_2e,_2f); }); } return false; }); } } var _37=_36(); if(!_a(_31[_33])){ _31.center.panel("resize",_37.resizeC); } p.panel("panel").animate(_37.collapse,_30,function(){ p.panel("collapse",false).panel("close"); _31[_33].panel("open").panel("resize",_37.expandP); $(this).unbind(".layout"); $(_2e).layout("options").onCollapse.call(_2e,_2f); }); function _34(dir){ var _38={"east":"left","west":"right","north":"down","south":"up"}; var _39=(_32.region=="north"||_32.region=="south"); var _3a="layout-button-"+_38[dir]; var p=$("
    ").appendTo(_2e); p.panel($.extend({},$.fn.layout.paneldefaults,{cls:("layout-expand layout-expand-"+dir),title:" ",iconCls:(_32.hideCollapsedContent?null:_32.iconCls),closed:true,minWidth:0,minHeight:0,doSize:false,region:_32.region,collapsedSize:_32.collapsedSize,noheader:(!_39&&_32.hideExpandTool),tools:((_39&&_32.hideExpandTool)?null:[{iconCls:_3a,handler:function(){ _41(_2e,_2f); return false; }}])})); if(!_32.hideCollapsedContent){ var _3b=typeof _32.collapsedContent=="function"?_32.collapsedContent.call(p[0],_32.title):_32.collapsedContent; _39?p.panel("setTitle",_3b):p.html(_3b); } p.panel("panel").hover(function(){ $(this).addClass("layout-expand-over"); },function(){ $(this).removeClass("layout-expand-over"); }); return p; }; function _36(){ var cc=$(_2e); var _3c=_31.center.panel("options"); var _3d=_32.collapsedSize; if(_2f=="east"){ var _3e=p.panel("panel")._outerWidth(); var _3f=_3c.width+_3e-_3d; if(_32.split||!_32.border){ _3f++; } return {resizeC:{width:_3f},expand:{left:cc.width()-_3e},expandP:{top:_3c.top,left:cc.width()-_3d,width:_3d,height:_3c.height},collapse:{left:cc.width(),top:_3c.top,height:_3c.height}}; }else{ if(_2f=="west"){ var _3e=p.panel("panel")._outerWidth(); var _3f=_3c.width+_3e-_3d; if(_32.split||!_32.border){ _3f++; } return {resizeC:{width:_3f,left:_3d-1},expand:{left:0},expandP:{left:0,top:_3c.top,width:_3d,height:_3c.height},collapse:{left:-_3e,top:_3c.top,height:_3c.height}}; }else{ if(_2f=="north"){ var _40=p.panel("panel")._outerHeight(); var hh=_3c.height; if(!_a(_31.expandNorth)){ hh+=_40-_3d+((_32.split||!_32.border)?1:0); } _31.east.add(_31.west).add(_31.expandEast).add(_31.expandWest).panel("resize",{top:_3d-1,height:hh}); return {resizeC:{top:_3d-1,height:hh},expand:{top:0},expandP:{top:0,left:0,width:cc.width(),height:_3d},collapse:{top:-_40,width:cc.width()}}; }else{ if(_2f=="south"){ var _40=p.panel("panel")._outerHeight(); var hh=_3c.height; if(!_a(_31.expandSouth)){ hh+=_40-_3d+((_32.split||!_32.border)?1:0); } _31.east.add(_31.west).add(_31.expandEast).add(_31.expandWest).panel("resize",{height:hh}); return {resizeC:{height:hh},expand:{top:cc.height()-_40},expandP:{top:cc.height()-_3d,left:0,width:cc.width(),height:_3d},collapse:{top:cc.height(),width:cc.width()}}; } } } } }; }; function _41(_42,_43){ var _44=$.data(_42,"layout").panels; var p=_44[_43]; var _45=p.panel("options"); if(_45.onBeforeExpand.call(p)==false){ return; } var _46="expand"+_43.substring(0,1).toUpperCase()+_43.substring(1); if(_44[_46]){ _44[_46].panel("close"); p.panel("panel").stop(true,true); p.panel("expand",false).panel("open"); var _47=_48(); p.panel("resize",_47.collapse); p.panel("panel").animate(_47.expand,function(){ _2(_42); $(_42).layout("options").onExpand.call(_42,_43); }); } function _48(){ var cc=$(_42); var _49=_44.center.panel("options"); if(_43=="east"&&_44.expandEast){ return {collapse:{left:cc.width(),top:_49.top,height:_49.height},expand:{left:cc.width()-p.panel("panel")._outerWidth()}}; }else{ if(_43=="west"&&_44.expandWest){ return {collapse:{left:-p.panel("panel")._outerWidth(),top:_49.top,height:_49.height},expand:{left:0}}; }else{ if(_43=="north"&&_44.expandNorth){ return {collapse:{top:-p.panel("panel")._outerHeight(),width:cc.width()},expand:{top:0}}; }else{ if(_43=="south"&&_44.expandSouth){ return {collapse:{top:cc.height(),width:cc.width()},expand:{top:cc.height()-p.panel("panel")._outerHeight()}}; } } } } }; }; function _a(pp){ if(!pp){ return false; } if(pp.length){ return pp.panel("panel").is(":visible"); }else{ return false; } }; function _4a(_4b){ var _4c=$.data(_4b,"layout"); var _4d=_4c.options; var _4e=_4c.panels; var _4f=_4d.onCollapse; _4d.onCollapse=function(){ }; _50("east"); _50("west"); _50("north"); _50("south"); _4d.onCollapse=_4f; function _50(_51){ var p=_4e[_51]; if(p.length&&p.panel("options").collapsed){ _2d(_4b,_51,0); } }; }; function _52(_53,_54,_55){ var p=$(_53).layout("panel",_54); p.panel("options").split=_55; var cls="layout-split-"+_54; var _56=p.panel("panel").removeClass(cls); if(_55){ _56.addClass(cls); } _56.resizable({disabled:(!_55)}); _2(_53); }; $.fn.layout=function(_57,_58){ if(typeof _57=="string"){ return $.fn.layout.methods[_57](this,_58); } _57=_57||{}; return this.each(function(){ var _59=$.data(this,"layout"); if(_59){ $.extend(_59.options,_57); }else{ var _5a=$.extend({},$.fn.layout.defaults,$.fn.layout.parseOptions(this),_57); $.data(this,"layout",{options:_5a,panels:{center:$(),north:$(),south:$(),east:$(),west:$()}}); _12(this); } _2(this); _4a(this); }); }; $.fn.layout.methods={options:function(jq){ return $.data(jq[0],"layout").options; },resize:function(jq,_5b){ return jq.each(function(){ _2(this,_5b); }); },panel:function(jq,_5c){ return $.data(jq[0],"layout").panels[_5c]; },collapse:function(jq,_5d){ return jq.each(function(){ _2d(this,_5d); }); },expand:function(jq,_5e){ return jq.each(function(){ _41(this,_5e); }); },add:function(jq,_5f){ return jq.each(function(){ _19(this,_5f); _2(this); if($(this).layout("panel",_5f.region).panel("options").collapsed){ _2d(this,_5f.region,0); } }); },remove:function(jq,_60){ return jq.each(function(){ _28(this,_60); _2(this); }); },split:function(jq,_61){ return jq.each(function(){ _52(this,_61,true); }); },unsplit:function(jq,_62){ return jq.each(function(){ _52(this,_62,false); }); }}; $.fn.layout.parseOptions=function(_63){ return $.extend({},$.parser.parseOptions(_63,[{fit:"boolean"}])); }; $.fn.layout.defaults={fit:false,onExpand:function(_64){ },onCollapse:function(_65){ },onAdd:function(_66){ },onRemove:function(_67){ }}; $.fn.layout.parsePanelOptions=function(_68){ var t=$(_68); return $.extend({},$.fn.panel.parseOptions(_68),$.parser.parseOptions(_68,["region",{split:"boolean",collpasedSize:"number",minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number"}])); }; $.fn.layout.paneldefaults=$.extend({},$.fn.panel.defaults,{region:null,split:false,collapsedSize:28,expandMode:"float",hideExpandTool:false,hideCollapsedContent:true,collapsedContent:function(_69){ var p=$(this); var _6a=p.panel("options"); if(_6a.region=="north"||_6a.region=="south"){ return _69; } var _6b=_6a.collapsedSize-2; var _6c=(_6b-16)/2; _6c=_6b-_6c; var cc=[]; if(_6a.iconCls){ cc.push("
    "); } cc.push("
    "); cc.push(_69); cc.push("
    "); return cc.join(""); },minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.linkbutton.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2,_3){ var _4=$.data(_2,"linkbutton").options; if(_3){ $.extend(_4,_3); } if(_4.width||_4.height||_4.fit){ var _5=$(_2); var _6=_5.parent(); var _7=_5.is(":visible"); if(!_7){ var _8=$("
    ").insertBefore(_2); var _9={position:_5.css("position"),display:_5.css("display"),left:_5.css("left")}; _5.appendTo("body"); _5.css({position:"absolute",display:"inline-block",left:-20000}); } _5._size(_4,_6); var _a=_5.find(".l-btn-left"); _a.css("margin-top",0); _a.css("margin-top",parseInt((_5.height()-_a.height())/2)+"px"); if(!_7){ _5.insertAfter(_8); _5.css(_9); _8.remove(); } } }; function _b(_c){ var _d=$.data(_c,"linkbutton").options; var t=$(_c).empty(); t.addClass("l-btn").removeClass("l-btn-plain l-btn-selected l-btn-plain-selected l-btn-outline"); t.removeClass("l-btn-small l-btn-medium l-btn-large").addClass("l-btn-"+_d.size); if(_d.plain){ t.addClass("l-btn-plain"); } if(_d.outline){ t.addClass("l-btn-outline"); } if(_d.selected){ t.addClass(_d.plain?"l-btn-selected l-btn-plain-selected":"l-btn-selected"); } t.attr("group",_d.group||""); t.attr("id",_d.id||""); var _e=$("").appendTo(t); if(_d.text){ $("").html(_d.text).appendTo(_e); }else{ $(" ").appendTo(_e); } if(_d.iconCls){ $(" ").addClass(_d.iconCls).appendTo(_e); _e.addClass("l-btn-icon-"+_d.iconAlign); } t.unbind(".linkbutton").bind("focus.linkbutton",function(){ if(!_d.disabled){ $(this).addClass("l-btn-focus"); } }).bind("blur.linkbutton",function(){ $(this).removeClass("l-btn-focus"); }).bind("click.linkbutton",function(){ if(!_d.disabled){ if(_d.toggle){ if(_d.selected){ $(this).linkbutton("unselect"); }else{ $(this).linkbutton("select"); } } _d.onClick.call(this); } }); _f(_c,_d.selected); _10(_c,_d.disabled); }; function _f(_11,_12){ var _13=$.data(_11,"linkbutton").options; if(_12){ if(_13.group){ $("a.l-btn[group=\""+_13.group+"\"]").each(function(){ var o=$(this).linkbutton("options"); if(o.toggle){ $(this).removeClass("l-btn-selected l-btn-plain-selected"); o.selected=false; } }); } $(_11).addClass(_13.plain?"l-btn-selected l-btn-plain-selected":"l-btn-selected"); _13.selected=true; }else{ if(!_13.group){ $(_11).removeClass("l-btn-selected l-btn-plain-selected"); _13.selected=false; } } }; function _10(_14,_15){ var _16=$.data(_14,"linkbutton"); var _17=_16.options; $(_14).removeClass("l-btn-disabled l-btn-plain-disabled"); if(_15){ _17.disabled=true; var _18=$(_14).attr("href"); if(_18){ _16.href=_18; $(_14).attr("href","javascript:;"); } if(_14.onclick){ _16.onclick=_14.onclick; _14.onclick=null; } _17.plain?$(_14).addClass("l-btn-disabled l-btn-plain-disabled"):$(_14).addClass("l-btn-disabled"); }else{ _17.disabled=false; if(_16.href){ $(_14).attr("href",_16.href); } if(_16.onclick){ _14.onclick=_16.onclick; } } }; $.fn.linkbutton=function(_19,_1a){ if(typeof _19=="string"){ return $.fn.linkbutton.methods[_19](this,_1a); } _19=_19||{}; return this.each(function(){ var _1b=$.data(this,"linkbutton"); if(_1b){ $.extend(_1b.options,_19); }else{ $.data(this,"linkbutton",{options:$.extend({},$.fn.linkbutton.defaults,$.fn.linkbutton.parseOptions(this),_19)}); $(this).removeAttr("disabled"); $(this).bind("_resize",function(e,_1c){ if($(this).hasClass("easyui-fluid")||_1c){ _1(this); } return false; }); } _b(this); _1(this); }); }; $.fn.linkbutton.methods={options:function(jq){ return $.data(jq[0],"linkbutton").options; },resize:function(jq,_1d){ return jq.each(function(){ _1(this,_1d); }); },enable:function(jq){ return jq.each(function(){ _10(this,false); }); },disable:function(jq){ return jq.each(function(){ _10(this,true); }); },select:function(jq){ return jq.each(function(){ _f(this,true); }); },unselect:function(jq){ return jq.each(function(){ _f(this,false); }); }}; $.fn.linkbutton.parseOptions=function(_1e){ var t=$(_1e); return $.extend({},$.parser.parseOptions(_1e,["id","iconCls","iconAlign","group","size","text",{plain:"boolean",toggle:"boolean",selected:"boolean",outline:"boolean"}]),{disabled:(t.attr("disabled")?true:undefined),text:($.trim(t.html())||undefined),iconCls:(t.attr("icon")||t.attr("iconCls"))}); }; $.fn.linkbutton.defaults={id:null,disabled:false,toggle:false,selected:false,outline:false,group:null,plain:false,text:"",iconCls:null,iconAlign:"left",size:"small",onClick:function(){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.menu.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ $(function(){ $(document).unbind(".menu").bind("mousedown.menu",function(e){ var m=$(e.target).closest("div.menu,div.combo-p"); if(m.length){ return; } $("body>div.menu-top:visible").not(".menu-inline").menu("hide"); _1($("body>div.menu:visible").not(".menu-inline")); }); }); function _2(_3){ var _4=$.data(_3,"menu").options; $(_3).addClass("menu-top"); _4.inline?$(_3).addClass("menu-inline"):$(_3).appendTo("body"); $(_3).bind("_resize",function(e,_5){ if($(this).hasClass("easyui-fluid")||_5){ $(_3).menu("resize",_3); } return false; }); var _6=_7($(_3)); for(var i=0;i<_6.length;i++){ _b(_3,_6[i]); } function _7(_8){ var _9=[]; _8.addClass("menu"); _9.push(_8); if(!_8.hasClass("menu-content")){ _8.children("div").each(function(){ var _a=$(this).children("div"); if(_a.length){ _a.appendTo("body"); this.submenu=_a; var mm=_7(_a); _9=_9.concat(mm); } }); } return _9; }; }; function _b(_c,_d){ var _e=$(_d).addClass("menu"); if(!_e.data("menu")){ _e.data("menu",{options:$.parser.parseOptions(_e[0],["width","height"])}); } if(!_e.hasClass("menu-content")){ _e.children("div").each(function(){ _f(_c,this); }); $("
    ").prependTo(_e); } _10(_c,_e); if(!_e.hasClass("menu-inline")){ _e.hide(); } _11(_c,_e); }; function _f(_12,div,_13){ var _14=$(div); var _15=$.extend({},$.parser.parseOptions(_14[0],["id","name","iconCls","href",{separator:"boolean"}]),{disabled:(_14.attr("disabled")?true:undefined),text:$.trim(_14.html()),onclick:_14[0].onclick},_13||{}); _15.onclick=_15.onclick||_15.handler||null; _14.data("menuitem",{options:_15}); if(_15.separator){ _14.addClass("menu-sep"); } if(!_14.hasClass("menu-sep")){ _14.addClass("menu-item"); _14.empty().append($("
    ").html(_15.text)); if(_15.iconCls){ $("
    ").addClass(_15.iconCls).appendTo(_14); } if(_15.id){ _14.attr("id",_15.id); } if(_15.onclick){ if(typeof _15.onclick=="string"){ _14.attr("onclick",_15.onclick); }else{ _14[0].onclick=eval(_15.onclick); } } if(_15.disabled){ _16(_12,_14[0],true); } if(_14[0].submenu){ $("
    ").appendTo(_14); } } }; function _10(_17,_18){ var _19=$.data(_17,"menu").options; var _1a=_18.attr("style")||""; var _1b=_18.is(":visible"); _18.css({display:"block",left:-10000,height:"auto",overflow:"hidden"}); _18.find(".menu-item").each(function(){ $(this)._outerHeight(_19.itemHeight); $(this).find(".menu-text").css({height:(_19.itemHeight-2)+"px",lineHeight:(_19.itemHeight-2)+"px"}); }); _18.removeClass("menu-noline").addClass(_19.noline?"menu-noline":""); var _1c=_18.data("menu").options; var _1d=_1c.width; var _1e=_1c.height; if(isNaN(parseInt(_1d))){ _1d=0; _18.find("div.menu-text").each(function(){ if(_1d<$(this).outerWidth()){ _1d=$(this).outerWidth(); } }); _1d=_1d?_1d+40:""; } var _1f=_18.outerHeight(); if(isNaN(parseInt(_1e))){ _1e=_1f; if(_18.hasClass("menu-top")&&_19.alignTo){ var at=$(_19.alignTo); var h1=at.offset().top-$(document).scrollTop(); var h2=$(window)._outerHeight()+$(document).scrollTop()-at.offset().top-at._outerHeight(); _1e=Math.min(_1e,Math.max(h1,h2)); }else{ if(_1e>$(window)._outerHeight()){ _1e=$(window).height(); } } } _18.attr("style",_1a); _18.show(); _18._size($.extend({},_1c,{width:_1d,height:_1e,minWidth:_1c.minWidth||_19.minWidth,maxWidth:_1c.maxWidth||_19.maxWidth})); _18.find(".easyui-fluid").triggerHandler("_resize",[true]); _18.css("overflow",_18.outerHeight()<_1f?"auto":"hidden"); _18.children("div.menu-line")._outerHeight(_1f-2); if(!_1b){ _18.hide(); } }; function _11(_20,_21){ var _22=$.data(_20,"menu"); var _23=_22.options; _21.unbind(".menu"); for(var _24 in _23.events){ _21.bind(_24+".menu",{target:_20},_23.events[_24]); } }; function _25(e){ var _26=e.data.target; var _27=$.data(_26,"menu"); if(_27.timer){ clearTimeout(_27.timer); _27.timer=null; } }; function _28(e){ var _29=e.data.target; var _2a=$.data(_29,"menu"); if(_2a.options.hideOnUnhover){ _2a.timer=setTimeout(function(){ _2b(_29,$(_29).hasClass("menu-inline")); },_2a.options.duration); } }; function _2c(e){ var _2d=e.data.target; var _2e=$(e.target).closest(".menu-item"); if(_2e.length){ _2e.siblings().each(function(){ if(this.submenu){ _1(this.submenu); } $(this).removeClass("menu-active"); }); _2e.addClass("menu-active"); if(_2e.hasClass("menu-item-disabled")){ _2e.addClass("menu-active-disabled"); return; } var _2f=_2e[0].submenu; if(_2f){ $(_2d).menu("show",{menu:_2f,parent:_2e}); } } }; function _30(e){ var _31=$(e.target).closest(".menu-item"); if(_31.length){ _31.removeClass("menu-active menu-active-disabled"); var _32=_31[0].submenu; if(_32){ if(e.pageX>=parseInt(_32.css("left"))){ _31.addClass("menu-active"); }else{ _1(_32); } }else{ _31.removeClass("menu-active"); } } }; function _33(e){ var _34=e.data.target; var _35=$(e.target).closest(".menu-item"); if(_35.length){ var _36=$(_34).data("menu").options; var _37=_35.data("menuitem").options; if(_37.disabled){ return; } if(!_35[0].submenu){ _2b(_34,_36.inline); if(_37.href){ location.href=_37.href; } } _35.trigger("mouseenter"); _36.onClick.call(_34,$(_34).menu("getItem",_35[0])); } }; function _2b(_38,_39){ var _3a=$.data(_38,"menu"); if(_3a){ if($(_38).is(":visible")){ _1($(_38)); if(_39){ $(_38).show(); }else{ _3a.options.onHide.call(_38); } } } return false; }; function _3b(_3c,_3d){ _3d=_3d||{}; var _3e,top; var _3f=$.data(_3c,"menu").options; var _40=$(_3d.menu||_3c); $(_3c).menu("resize",_40[0]); if(_40.hasClass("menu-top")){ $.extend(_3f,_3d); _3e=_3f.left; top=_3f.top; if(_3f.alignTo){ var at=$(_3f.alignTo); _3e=at.offset().left; top=at.offset().top+at._outerHeight(); if(_3f.align=="right"){ _3e+=at.outerWidth()-_40.outerWidth(); } } if(_3e+_40.outerWidth()>$(window)._outerWidth()+$(document)._scrollLeft()){ _3e=$(window)._outerWidth()+$(document).scrollLeft()-_40.outerWidth()-5; } if(_3e<0){ _3e=0; } top=_41(top,_3f.alignTo); }else{ var _42=_3d.parent; _3e=_42.offset().left+_42.outerWidth()-2; if(_3e+_40.outerWidth()+5>$(window)._outerWidth()+$(document).scrollLeft()){ _3e=_42.offset().left-_40.outerWidth()+2; } top=_41(_42.offset().top-3); } function _41(top,_43){ if(top+_40.outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){ if(_43){ top=$(_43).offset().top-_40._outerHeight(); }else{ top=$(window)._outerHeight()+$(document).scrollTop()-_40.outerHeight(); } } if(top<0){ top=0; } return top; }; _40.css(_3f.position.call(_3c,_40[0],_3e,top)); _40.show(0,function(){ if(!_40[0].shadow){ _40[0].shadow=$("
    ").insertAfter(_40); } _40[0].shadow.css({display:(_40.hasClass("menu-inline")?"none":"block"),zIndex:$.fn.menu.defaults.zIndex++,left:_40.css("left"),top:_40.css("top"),width:_40.outerWidth(),height:_40.outerHeight()}); _40.css("z-index",$.fn.menu.defaults.zIndex++); if(_40.hasClass("menu-top")){ _3f.onShow.call(_3c); } }); }; function _1(_44){ if(_44&&_44.length){ _45(_44); _44.find("div.menu-item").each(function(){ if(this.submenu){ _1(this.submenu); } $(this).removeClass("menu-active"); }); } function _45(m){ m.stop(true,true); if(m[0].shadow){ m[0].shadow.hide(); } m.hide(); }; }; function _46(_47,_48){ var _49=null; var tmp=$("
    "); function _4a(_4b){ _4b.children("div.menu-item").each(function(){ var _4c=$(_47).menu("getItem",this); var s=tmp.empty().html(_4c.text).text(); if(_48==$.trim(s)){ _49=_4c; }else{ if(this.submenu&&!_49){ _4a(this.submenu); } } }); }; _4a($(_47)); tmp.remove(); return _49; }; function _16(_4d,_4e,_4f){ var t=$(_4e); if(t.hasClass("menu-item")){ var _50=t.data("menuitem").options; _50.disabled=_4f; if(_4f){ t.addClass("menu-item-disabled"); t[0].onclick=null; }else{ t.removeClass("menu-item-disabled"); t[0].onclick=_50.onclick; } } }; function _51(_52,_53){ var _54=$.data(_52,"menu").options; var _55=$(_52); if(_53.parent){ if(!_53.parent.submenu){ var _56=$("
    ").appendTo("body"); _53.parent.submenu=_56; $("
    ").appendTo(_53.parent); _b(_52,_56); } _55=_53.parent.submenu; } var div=$("
    ").appendTo(_55); _f(_52,div,_53); }; function _57(_58,_59){ function _5a(el){ if(el.submenu){ el.submenu.children("div.menu-item").each(function(){ _5a(this); }); var _5b=el.submenu[0].shadow; if(_5b){ _5b.remove(); } el.submenu.remove(); } $(el).remove(); }; _5a(_59); }; function _5c(_5d,_5e,_5f){ var _60=$(_5e).parent(); if(_5f){ $(_5e).show(); }else{ $(_5e).hide(); } _10(_5d,_60); }; function _61(_62){ $(_62).children("div.menu-item").each(function(){ _57(_62,this); }); if(_62.shadow){ _62.shadow.remove(); } $(_62).remove(); }; $.fn.menu=function(_63,_64){ if(typeof _63=="string"){ return $.fn.menu.methods[_63](this,_64); } _63=_63||{}; return this.each(function(){ var _65=$.data(this,"menu"); if(_65){ $.extend(_65.options,_63); }else{ _65=$.data(this,"menu",{options:$.extend({},$.fn.menu.defaults,$.fn.menu.parseOptions(this),_63)}); _2(this); } $(this).css({left:_65.options.left,top:_65.options.top}); }); }; $.fn.menu.methods={options:function(jq){ return $.data(jq[0],"menu").options; },show:function(jq,pos){ return jq.each(function(){ _3b(this,pos); }); },hide:function(jq){ return jq.each(function(){ _2b(this); }); },destroy:function(jq){ return jq.each(function(){ _61(this); }); },setText:function(jq,_66){ return jq.each(function(){ var _67=$(_66.target).data("menuitem").options; _67.text=_66.text; $(_66.target).children("div.menu-text").html(_66.text); }); },setIcon:function(jq,_68){ return jq.each(function(){ var _69=$(_68.target).data("menuitem").options; _69.iconCls=_68.iconCls; $(_68.target).children("div.menu-icon").remove(); if(_68.iconCls){ $("
    ").addClass(_68.iconCls).appendTo(_68.target); } }); },getItem:function(jq,_6a){ var _6b=$(_6a).data("menuitem").options; return $.extend({},_6b,{target:$(_6a)[0]}); },findItem:function(jq,_6c){ return _46(jq[0],_6c); },appendItem:function(jq,_6d){ return jq.each(function(){ _51(this,_6d); }); },removeItem:function(jq,_6e){ return jq.each(function(){ _57(this,_6e); }); },enableItem:function(jq,_6f){ return jq.each(function(){ _16(this,_6f,false); }); },disableItem:function(jq,_70){ return jq.each(function(){ _16(this,_70,true); }); },showItem:function(jq,_71){ return jq.each(function(){ _5c(this,_71,true); }); },hideItem:function(jq,_72){ return jq.each(function(){ _5c(this,_72,false); }); },resize:function(jq,_73){ return jq.each(function(){ _10(this,_73?$(_73):$(this)); }); }}; $.fn.menu.parseOptions=function(_74){ return $.extend({},$.parser.parseOptions(_74,[{minWidth:"number",itemHeight:"number",duration:"number",hideOnUnhover:"boolean"},{fit:"boolean",inline:"boolean",noline:"boolean"}])); }; $.fn.menu.defaults={zIndex:110000,left:0,top:0,alignTo:null,align:"left",minWidth:120,itemHeight:22,duration:100,hideOnUnhover:true,inline:false,fit:false,noline:false,events:{mouseenter:_25,mouseleave:_28,mouseover:_2c,mouseout:_30,click:_33},position:function(_75,_76,top){ return {left:_76,top:top}; },onShow:function(){ },onHide:function(){ },onClick:function(_77){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.menubutton.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"menubutton").options; var _4=$(_2); _4.linkbutton(_3); if(_3.hasDownArrow){ _4.removeClass(_3.cls.btn1+" "+_3.cls.btn2).addClass("m-btn"); _4.removeClass("m-btn-small m-btn-medium m-btn-large").addClass("m-btn-"+_3.size); var _5=_4.find(".l-btn-left"); $("").addClass(_3.cls.arrow).appendTo(_5); $("").addClass("m-btn-line").appendTo(_5); } $(_2).menubutton("resize"); if(_3.menu){ $(_3.menu).menu({duration:_3.duration}); var _6=$(_3.menu).menu("options"); var _7=_6.onShow; var _8=_6.onHide; $.extend(_6,{onShow:function(){ var _9=$(this).menu("options"); var _a=$(_9.alignTo); var _b=_a.menubutton("options"); _a.addClass((_b.plain==true)?_b.cls.btn2:_b.cls.btn1); _7.call(this); },onHide:function(){ var _c=$(this).menu("options"); var _d=$(_c.alignTo); var _e=_d.menubutton("options"); _d.removeClass((_e.plain==true)?_e.cls.btn2:_e.cls.btn1); _8.call(this); }}); } }; function _f(_10){ var _11=$.data(_10,"menubutton").options; var btn=$(_10); var t=btn.find("."+_11.cls.trigger); if(!t.length){ t=btn; } t.unbind(".menubutton"); var _12=null; t.bind("click.menubutton",function(){ if(!_13()){ _14(_10); return false; } }).bind("mouseenter.menubutton",function(){ if(!_13()){ _12=setTimeout(function(){ _14(_10); },_11.duration); return false; } }).bind("mouseleave.menubutton",function(){ if(_12){ clearTimeout(_12); } $(_11.menu).triggerHandler("mouseleave"); }); function _13(){ return $(_10).linkbutton("options").disabled; }; }; function _14(_15){ var _16=$(_15).menubutton("options"); if(_16.disabled||!_16.menu){ return; } $("body>div.menu-top").menu("hide"); var btn=$(_15); var mm=$(_16.menu); if(mm.length){ mm.menu("options").alignTo=btn; mm.menu("show",{alignTo:btn,align:_16.menuAlign}); } btn.blur(); }; $.fn.menubutton=function(_17,_18){ if(typeof _17=="string"){ var _19=$.fn.menubutton.methods[_17]; if(_19){ return _19(this,_18); }else{ return this.linkbutton(_17,_18); } } _17=_17||{}; return this.each(function(){ var _1a=$.data(this,"menubutton"); if(_1a){ $.extend(_1a.options,_17); }else{ $.data(this,"menubutton",{options:$.extend({},$.fn.menubutton.defaults,$.fn.menubutton.parseOptions(this),_17)}); $(this).removeAttr("disabled"); } _1(this); _f(this); }); }; $.fn.menubutton.methods={options:function(jq){ var _1b=jq.linkbutton("options"); return $.extend($.data(jq[0],"menubutton").options,{toggle:_1b.toggle,selected:_1b.selected,disabled:_1b.disabled}); },destroy:function(jq){ return jq.each(function(){ var _1c=$(this).menubutton("options"); if(_1c.menu){ $(_1c.menu).menu("destroy"); } $(this).remove(); }); }}; $.fn.menubutton.parseOptions=function(_1d){ var t=$(_1d); return $.extend({},$.fn.linkbutton.parseOptions(_1d),$.parser.parseOptions(_1d,["menu",{plain:"boolean",hasDownArrow:"boolean",duration:"number"}])); }; $.fn.menubutton.defaults=$.extend({},$.fn.linkbutton.defaults,{plain:true,hasDownArrow:true,menu:null,menuAlign:"left",duration:100,cls:{btn1:"m-btn-active",btn2:"m-btn-plain-active",arrow:"m-btn-downarrow",trigger:"m-btn"}}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.messager.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(){ $(document).unbind(".messager").bind("keydown.messager",function(e){ if(e.keyCode==27){ $("body").children("div.messager-window").children("div.messager-body").each(function(){ $(this).dialog("close"); }); }else{ if(e.keyCode==9){ var _2=$("body").children("div.messager-window"); if(!_2.length){ return; } var _3=_2.find(".messager-input,.messager-button .l-btn"); for(var i=0;i<_3.length;i++){ if($(_3[i]).is(":focus")){ $(_3[i>=_3.length-1?0:i+1]).focus(); return false; } } }else{ if(e.keyCode==13){ var _4=$(e.target).closest("input.messager-input"); if(_4.length){ var _5=_4.closest(".messager-body"); _6(_5,_4.val()); } } } } }); }; function _7(){ $(document).unbind(".messager"); }; function _8(_9){ var _a=$.extend({},$.messager.defaults,{modal:false,shadow:false,draggable:false,resizable:false,closed:true,style:{left:"",top:"",right:0,zIndex:$.fn.window.defaults.zIndex++,bottom:-document.body.scrollTop-document.documentElement.scrollTop},title:"",width:250,height:100,minHeight:0,showType:"slide",showSpeed:600,content:_9.msg,timeout:4000},_9); var _b=$("
    ").appendTo("body"); _b.dialog($.extend({},_a,{noheader:(_a.title?false:true),openAnimation:(_a.showType),closeAnimation:(_a.showType=="show"?"hide":_a.showType),openDuration:_a.showSpeed,closeDuration:_a.showSpeed,onOpen:function(){ _b.dialog("dialog").hover(function(){ if(_a.timer){ clearTimeout(_a.timer); } },function(){ _c(); }); _c(); function _c(){ if(_a.timeout>0){ _a.timer=setTimeout(function(){ if(_b.length&&_b.data("dialog")){ _b.dialog("close"); } },_a.timeout); } }; if(_9.onOpen){ _9.onOpen.call(this); }else{ _a.onOpen.call(this); } },onClose:function(){ if(_a.timer){ clearTimeout(_a.timer); } if(_9.onClose){ _9.onClose.call(this); }else{ _a.onClose.call(this); } _b.dialog("destroy"); }})); _b.dialog("dialog").css(_a.style); _b.dialog("open"); return _b; }; function _d(_e){ _1(); var _f=$("
    ").appendTo("body"); _f.dialog($.extend({},_e,{noheader:(_e.title?false:true),onClose:function(){ _7(); if(_e.onClose){ _e.onClose.call(this); } setTimeout(function(){ _f.dialog("destroy"); },100); }})); var win=_f.dialog("dialog").addClass("messager-window"); win.find(".dialog-button").addClass("messager-button").find("a:first").focus(); return _f; }; function _6(dlg,_10){ dlg.dialog("close"); dlg.dialog("options").fn(_10); }; $.messager={show:function(_11){ return _8(_11); },alert:function(_12,msg,_13,fn){ var _14=typeof _12=="object"?_12:{title:_12,msg:msg,icon:_13,fn:fn}; var cls=_14.icon?"messager-icon messager-"+_14.icon:""; _14=$.extend({},$.messager.defaults,{content:"
    "+"
    "+_14.msg+"
    "+"
    "},_14); if(!_14.buttons){ _14.buttons=[{text:_14.ok,onClick:function(){ _6(dlg); }}]; } var dlg=_d(_14); return dlg; },confirm:function(_15,msg,fn){ var _16=typeof _15=="object"?_15:{title:_15,msg:msg,fn:fn}; _16=$.extend({},$.messager.defaults,{content:"
    "+"
    "+_16.msg+"
    "+"
    "},_16); if(!_16.buttons){ _16.buttons=[{text:_16.ok,onClick:function(){ _6(dlg,true); }},{text:_16.cancel,onClick:function(){ _6(dlg,false); }}]; } var dlg=_d(_16); return dlg; },prompt:function(_17,msg,fn){ var _18=typeof _17=="object"?_17:{title:_17,msg:msg,fn:fn}; _18=$.extend({},$.messager.defaults,{content:"
    "+"
    "+_18.msg+"
    "+"
    "+"
    "+"
    "},_18); if(!_18.buttons){ _18.buttons=[{text:_18.ok,onClick:function(){ _6(dlg,dlg.find(".messager-input").val()); }},{text:_18.cancel,onClick:function(){ _6(dlg); }}]; } var dlg=_d(_18); dlg.find(".messager-input").focus(); return dlg; },progress:function(_19){ var _1a={bar:function(){ return $("body>div.messager-window").find("div.messager-p-bar"); },close:function(){ var dlg=$("body>div.messager-window>div.messager-body:has(div.messager-progress)"); if(dlg.length){ dlg.dialog("close"); } }}; if(typeof _19=="string"){ var _1b=_1a[_19]; return _1b(); } _19=_19||{}; var _1c=$.extend({},{title:"",minHeight:0,content:undefined,msg:"",text:undefined,interval:300},_19); var dlg=_d($.extend({},$.messager.defaults,{content:"
    "+_1c.msg+"
    ",closable:false,doSize:false},_1c,{onClose:function(){ if(this.timer){ clearInterval(this.timer); } if(_19.onClose){ _19.onClose.call(this); }else{ $.messager.defaults.onClose.call(this); } }})); var bar=dlg.find("div.messager-p-bar"); bar.progressbar({text:_1c.text}); dlg.dialog("resize"); if(_1c.interval){ dlg[0].timer=setInterval(function(){ var v=bar.progressbar("getValue"); v+=10; if(v>100){ v=0; } bar.progressbar("setValue",v); },_1c.interval); } return dlg; }}; $.messager.defaults=$.extend({},$.fn.dialog.defaults,{ok:"Ok",cancel:"Cancel",width:300,height:"auto",minHeight:150,modal:true,collapsible:false,minimizable:false,maximizable:false,resizable:false,fn:function(){ }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.mobile.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ $.fn.navpanel=function(_1,_2){ if(typeof _1=="string"){ var _3=$.fn.navpanel.methods[_1]; return _3?_3(this,_2):this.panel(_1,_2); }else{ _1=_1||{}; return this.each(function(){ var _4=$.data(this,"navpanel"); if(_4){ $.extend(_4.options,_1); }else{ _4=$.data(this,"navpanel",{options:$.extend({},$.fn.navpanel.defaults,$.fn.navpanel.parseOptions(this),_1)}); } $(this).panel(_4.options); }); } }; $.fn.navpanel.methods={options:function(jq){ return $.data(jq[0],"navpanel").options; }}; $.fn.navpanel.parseOptions=function(_5){ return $.extend({},$.fn.panel.parseOptions(_5),$.parser.parseOptions(_5,[])); }; $.fn.navpanel.defaults=$.extend({},$.fn.panel.defaults,{fit:true,border:false,cls:"navpanel"}); $.parser.plugins.push("navpanel"); })(jQuery); (function($){ $(function(){ $.mobile.init(); }); $.mobile={defaults:{animation:"slide",direction:"left",reverseDirections:{up:"down",down:"up",left:"right",right:"left"}},panels:[],init:function(_6){ $.mobile.panels=[]; var _7=$(_6||"body").children(".navpanel:visible"); if(_7.length){ _7.not(":first").children(".panel-body").navpanel("close"); var p=_7.eq(0).children(".panel-body"); $.mobile.panels.push({panel:p,animation:$.mobile.defaults.animation,direction:$.mobile.defaults.direction}); } $(document).unbind(".mobile").bind("click.mobile",function(e){ var a=$(e.target).closest("a"); if(a.length){ var _8=$.parser.parseOptions(a[0],["animation","direction",{back:"boolean"}]); if(_8.back){ $.mobile.back(); e.preventDefault(); }else{ var _9=$.trim(a.attr("href")); if(/^#/.test(_9)){ var to=$(_9); if(to.length&&to.hasClass("panel-body")){ $.mobile.go(to,_8.animation,_8.direction); e.preventDefault(); } } } } }); $(window).unbind(".mobile").bind("hashchange.mobile",function(){ var _a=$.mobile.panels.length; if(_a>1){ var _b=location.hash; var p=$.mobile.panels[_a-2]; if(!_b||_b=="#&"+p.panel.attr("id")){ $.mobile._back(); } } }); },nav:function(_c,to,_d,_e){ if(window.WebKitAnimationEvent){ _d=_d!=undefined?_d:$.mobile.defaults.animation; _e=_e!=undefined?_e:$.mobile.defaults.direction; var _f="m-"+_d+(_e?"-"+_e:""); var p1=$(_c).panel("open").panel("resize").panel("panel"); var p2=$(to).panel("open").panel("resize").panel("panel"); p1.add(p2).bind("webkitAnimationEnd",function(){ $(this).unbind("webkitAnimationEnd"); var p=$(this).children(".panel-body"); if($(this).hasClass("m-in")){ p.panel("open").panel("resize"); }else{ p.panel("close"); } $(this).removeClass(_f+" m-in m-out"); }); p2.addClass(_f+" m-in"); p1.addClass(_f+" m-out"); }else{ $(to).panel("open").panel("resize"); $(_c).panel("close"); } },_go:function(_10,_11,_12){ _11=_11!=undefined?_11:$.mobile.defaults.animation; _12=_12!=undefined?_12:$.mobile.defaults.direction; var _13=$.mobile.panels[$.mobile.panels.length-1].panel; var to=$(_10); if(_13[0]!=to[0]){ $.mobile.nav(_13,to,_11,_12); $.mobile.panels.push({panel:to,animation:_11,direction:_12}); } },_back:function(){ if($.mobile.panels.length<2){ return; } var p1=$.mobile.panels.pop(); var p2=$.mobile.panels[$.mobile.panels.length-1]; var _14=p1.animation; var _15=$.mobile.defaults.reverseDirections[p1.direction]||""; $.mobile.nav(p1.panel,p2.panel,_14,_15); },go:function(_16,_17,_18){ _17=_17!=undefined?_17:$.mobile.defaults.animation; _18=_18!=undefined?_18:$.mobile.defaults.direction; location.hash="#&"+$(_16).attr("id"); $.mobile._go(_16,_17,_18); },back:function(){ history.go(-1); }}; $.map(["validatebox","textbox","passwordbox","filebox","searchbox","combo","combobox","combogrid","combotree","combotreegrid","datebox","datetimebox","numberbox","spinner","numberspinner","timespinner","datetimespinner"],function(_19){ if($.fn[_19]){ $.extend($.fn[_19].defaults,{iconWidth:28,tipPosition:"bottom"}); } }); $.map(["spinner","numberspinner","timespinner","datetimespinner"],function(_1a){ if($.fn[_1a]){ $.extend($.fn[_1a].defaults,{iconWidth:56,spinAlign:"horizontal"}); } }); if($.fn.menu){ $.extend($.fn.menu.defaults,{itemHeight:30,noline:true}); } })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.numberbox.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"numberbox"); var _4=_3.options; $(_2).addClass("numberbox-f").textbox(_4); $(_2).textbox("textbox").css({imeMode:"disabled"}); $(_2).attr("numberboxName",$(_2).attr("textboxName")); _3.numberbox=$(_2).next(); _3.numberbox.addClass("numberbox"); var _5=_4.parser.call(_2,_4.value); var _6=_4.formatter.call(_2,_5); $(_2).numberbox("initValue",_5).numberbox("setText",_6); }; function _7(_8,_9){ var _a=$.data(_8,"numberbox"); var _b=_a.options; _b.value=parseFloat(_9); var _9=_b.parser.call(_8,_9); var _c=_b.formatter.call(_8,_9); _b.value=_9; $(_8).textbox("setText",_c).textbox("setValue",_9); _c=_b.formatter.call(_8,$(_8).textbox("getValue")); $(_8).textbox("setText",_c); }; $.fn.numberbox=function(_d,_e){ if(typeof _d=="string"){ var _f=$.fn.numberbox.methods[_d]; if(_f){ return _f(this,_e); }else{ return this.textbox(_d,_e); } } _d=_d||{}; return this.each(function(){ var _10=$.data(this,"numberbox"); if(_10){ $.extend(_10.options,_d); }else{ _10=$.data(this,"numberbox",{options:$.extend({},$.fn.numberbox.defaults,$.fn.numberbox.parseOptions(this),_d)}); } _1(this); }); }; $.fn.numberbox.methods={options:function(jq){ var _11=jq.data("textbox")?jq.textbox("options"):{}; return $.extend($.data(jq[0],"numberbox").options,{width:_11.width,originalValue:_11.originalValue,disabled:_11.disabled,readonly:_11.readonly}); },fix:function(jq){ return jq.each(function(){ var _12=$(this).numberbox("options"); _12.value=null; var _13=_12.parser.call(this,$(this).numberbox("getText")); $(this).numberbox("setValue",_13); }); },setValue:function(jq,_14){ return jq.each(function(){ _7(this,_14); }); },clear:function(jq){ return jq.each(function(){ $(this).textbox("clear"); $(this).numberbox("options").value=""; }); },reset:function(jq){ return jq.each(function(){ $(this).textbox("reset"); $(this).numberbox("setValue",$(this).numberbox("getValue")); }); }}; $.fn.numberbox.parseOptions=function(_15){ var t=$(_15); return $.extend({},$.fn.textbox.parseOptions(_15),$.parser.parseOptions(_15,["decimalSeparator","groupSeparator","suffix",{min:"number",max:"number",precision:"number"}]),{prefix:(t.attr("prefix")?t.attr("prefix"):undefined)}); }; $.fn.numberbox.defaults=$.extend({},$.fn.textbox.defaults,{inputEvents:{keypress:function(e){ var _16=e.data.target; var _17=$(_16).numberbox("options"); return _17.filter.call(_16,e); },blur:function(e){ $(e.data.target).numberbox("fix"); },keydown:function(e){ if(e.keyCode==13){ $(e.data.target).numberbox("fix"); } }},min:null,max:null,precision:0,decimalSeparator:".",groupSeparator:"",prefix:"",suffix:"",filter:function(e){ var _18=$(this).numberbox("options"); var s=$(this).numberbox("getText"); if(e.metaKey||e.ctrlKey){ return true; } if($.inArray(String(e.which),["46","8","13","0"])>=0){ return true; } var tmp=$(""); tmp.html(String.fromCharCode(e.which)); var c=tmp.text(); tmp.remove(); if(!c){ return true; } if(c=="-"||c==_18.decimalSeparator){ return (s.indexOf(c)==-1)?true:false; }else{ if(c==_18.groupSeparator){ return true; }else{ if("0123456789".indexOf(c)>=0){ return true; }else{ return false; } } } },formatter:function(_19){ if(!_19){ return _19; } _19=_19+""; var _1a=$(this).numberbox("options"); var s1=_19,s2=""; var _1b=_19.indexOf("."); if(_1b>=0){ s1=_19.substring(0,_1b); s2=_19.substring(_1b+1,_19.length); } if(_1a.groupSeparator){ var p=/(\d+)(\d{3})/; while(p.test(s1)){ s1=s1.replace(p,"$1"+_1a.groupSeparator+"$2"); } } if(s2){ return _1a.prefix+s1+_1a.decimalSeparator+s2+_1a.suffix; }else{ return _1a.prefix+s1+_1a.suffix; } },parser:function(s){ s=s+""; var _1c=$(this).numberbox("options"); if(_1c.prefix){ s=$.trim(s.replace(new RegExp("\\"+$.trim(_1c.prefix),"g"),"")); } if(_1c.suffix){ s=$.trim(s.replace(new RegExp("\\"+$.trim(_1c.suffix),"g"),"")); } if(parseFloat(s)!=_1c.value){ if(_1c.groupSeparator){ s=$.trim(s.replace(new RegExp("\\"+_1c.groupSeparator,"g"),"")); } if(_1c.decimalSeparator){ s=$.trim(s.replace(new RegExp("\\"+_1c.decimalSeparator,"g"),".")); } s=s.replace(/\s/g,""); } var val=parseFloat(s).toFixed(_1c.precision); if(isNaN(val)){ val=""; }else{ if(typeof (_1c.min)=="number"&&val<_1c.min){ val=_1c.min.toFixed(_1c.precision); }else{ if(typeof (_1c.max)=="number"&&val>_1c.max){ val=_1c.max.toFixed(_1c.precision); } } } return val; }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.numberspinner.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ $(_2).addClass("numberspinner-f"); var _3=$.data(_2,"numberspinner").options; $(_2).numberbox($.extend({},_3,{doSize:false})).spinner(_3); $(_2).numberbox("setValue",_3.value); }; function _4(_5,_6){ var _7=$.data(_5,"numberspinner").options; var v=parseFloat($(_5).numberbox("getValue")||_7.value)||0; if(_6){ v-=_7.increment; }else{ v+=_7.increment; } $(_5).numberbox("setValue",v); }; $.fn.numberspinner=function(_8,_9){ if(typeof _8=="string"){ var _a=$.fn.numberspinner.methods[_8]; if(_a){ return _a(this,_9); }else{ return this.numberbox(_8,_9); } } _8=_8||{}; return this.each(function(){ var _b=$.data(this,"numberspinner"); if(_b){ $.extend(_b.options,_8); }else{ $.data(this,"numberspinner",{options:$.extend({},$.fn.numberspinner.defaults,$.fn.numberspinner.parseOptions(this),_8)}); } _1(this); }); }; $.fn.numberspinner.methods={options:function(jq){ var _c=jq.numberbox("options"); return $.extend($.data(jq[0],"numberspinner").options,{width:_c.width,value:_c.value,originalValue:_c.originalValue,disabled:_c.disabled,readonly:_c.readonly}); }}; $.fn.numberspinner.parseOptions=function(_d){ return $.extend({},$.fn.spinner.parseOptions(_d),$.fn.numberbox.parseOptions(_d),{}); }; $.fn.numberspinner.defaults=$.extend({},$.fn.spinner.defaults,$.fn.numberbox.defaults,{spin:function(_e){ _4(this,_e); }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.pagination.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"pagination"); var _4=_3.options; var bb=_3.bb={}; var _5=$(_2).addClass("pagination").html("
    "); var tr=_5.find("tr"); var aa=$.extend([],_4.layout); if(!_4.showPageList){ _6(aa,"list"); } if(!_4.showRefresh){ _6(aa,"refresh"); } if(aa[0]=="sep"){ aa.shift(); } if(aa[aa.length-1]=="sep"){ aa.pop(); } for(var _7=0;_7"); ps.bind("change",function(){ _4.pageSize=parseInt($(this).val()); _4.onChangePageSize.call(_2,_4.pageSize); _10(_2,_4.pageNumber); }); for(var i=0;i<_4.pageList.length;i++){ $("").text(_4.pageList[i]).appendTo(ps); } $("").append(ps).appendTo(tr); }else{ if(_8=="sep"){ $("
    ").appendTo(tr); }else{ if(_8=="first"){ bb.first=_9("first"); }else{ if(_8=="prev"){ bb.prev=_9("prev"); }else{ if(_8=="next"){ bb.next=_9("next"); }else{ if(_8=="last"){ bb.last=_9("last"); }else{ if(_8=="manual"){ $("").html(_4.beforePageText).appendTo(tr).wrap(""); bb.num=$("").appendTo(tr).wrap(""); bb.num.unbind(".pagination").bind("keydown.pagination",function(e){ if(e.keyCode==13){ var _a=parseInt($(this).val())||1; _10(_2,_a); return false; } }); bb.after=$("").appendTo(tr).wrap(""); }else{ if(_8=="refresh"){ bb.refresh=_9("refresh"); }else{ if(_8=="links"){ $("").appendTo(tr); } } } } } } } } } } if(_4.buttons){ $("
    ").appendTo(tr); if($.isArray(_4.buttons)){ for(var i=0;i<_4.buttons.length;i++){ var _b=_4.buttons[i]; if(_b=="-"){ $("
    ").appendTo(tr); }else{ var td=$("").appendTo(tr); var a=$("").appendTo(td); a[0].onclick=eval(_b.handler||function(){ }); a.linkbutton($.extend({},_b,{plain:true})); } } }else{ var td=$("").appendTo(tr); $(_4.buttons).appendTo(td).show(); } } $("
    ").appendTo(_5); $("
    ").appendTo(_5); function _9(_c){ var _d=_4.nav[_c]; var a=$("").appendTo(tr); a.wrap(""); a.linkbutton({iconCls:_d.iconCls,plain:true}).unbind(".pagination").bind("click.pagination",function(){ _d.handler.call(_2); }); return a; }; function _6(aa,_e){ var _f=$.inArray(_e,aa); if(_f>=0){ aa.splice(_f,1); } return aa; }; }; function _10(_11,_12){ var _13=$.data(_11,"pagination").options; _14(_11,{pageNumber:_12}); _13.onSelectPage.call(_11,_13.pageNumber,_13.pageSize); }; function _14(_15,_16){ var _17=$.data(_15,"pagination"); var _18=_17.options; var bb=_17.bb; $.extend(_18,_16||{}); var ps=$(_15).find("select.pagination-page-list"); if(ps.length){ ps.val(_18.pageSize+""); _18.pageSize=parseInt(ps.val()); } var _19=Math.ceil(_18.total/_18.pageSize)||1; if(_18.pageNumber<1){ _18.pageNumber=1; } if(_18.pageNumber>_19){ _18.pageNumber=_19; } if(_18.total==0){ _18.pageNumber=0; _19=0; } if(bb.num){ bb.num.val(_18.pageNumber); } if(bb.after){ bb.after.html(_18.afterPageText.replace(/{pages}/,_19)); } var td=$(_15).find("td.pagination-links"); if(td.length){ td.empty(); var _1a=_18.pageNumber-Math.floor(_18.links/2); if(_1a<1){ _1a=1; } var _1b=_1a+_18.links-1; if(_1b>_19){ _1b=_19; } _1a=_1b-_18.links+1; if(_1a<1){ _1a=1; } for(var i=_1a;i<=_1b;i++){ var a=$("").appendTo(td); a.linkbutton({plain:true,text:i}); if(i==_18.pageNumber){ a.linkbutton("select"); }else{ a.unbind(".pagination").bind("click.pagination",{pageNumber:i},function(e){ _10(_15,e.data.pageNumber); }); } } } var _1c=_18.displayMsg; _1c=_1c.replace(/{from}/,_18.total==0?0:_18.pageSize*(_18.pageNumber-1)+1); _1c=_1c.replace(/{to}/,Math.min(_18.pageSize*(_18.pageNumber),_18.total)); _1c=_1c.replace(/{total}/,_18.total); $(_15).find("div.pagination-info").html(_1c); if(bb.first){ bb.first.linkbutton({disabled:((!_18.total)||_18.pageNumber==1)}); } if(bb.prev){ bb.prev.linkbutton({disabled:((!_18.total)||_18.pageNumber==1)}); } if(bb.next){ bb.next.linkbutton({disabled:(_18.pageNumber==_19)}); } if(bb.last){ bb.last.linkbutton({disabled:(_18.pageNumber==_19)}); } _1d(_15,_18.loading); }; function _1d(_1e,_1f){ var _20=$.data(_1e,"pagination"); var _21=_20.options; _21.loading=_1f; if(_21.showRefresh&&_20.bb.refresh){ _20.bb.refresh.linkbutton({iconCls:(_21.loading?"pagination-loading":"pagination-load")}); } }; $.fn.pagination=function(_22,_23){ if(typeof _22=="string"){ return $.fn.pagination.methods[_22](this,_23); } _22=_22||{}; return this.each(function(){ var _24; var _25=$.data(this,"pagination"); if(_25){ _24=$.extend(_25.options,_22); }else{ _24=$.extend({},$.fn.pagination.defaults,$.fn.pagination.parseOptions(this),_22); $.data(this,"pagination",{options:_24}); } _1(this); _14(this); }); }; $.fn.pagination.methods={options:function(jq){ return $.data(jq[0],"pagination").options; },loading:function(jq){ return jq.each(function(){ _1d(this,true); }); },loaded:function(jq){ return jq.each(function(){ _1d(this,false); }); },refresh:function(jq,_26){ return jq.each(function(){ _14(this,_26); }); },select:function(jq,_27){ return jq.each(function(){ _10(this,_27); }); }}; $.fn.pagination.parseOptions=function(_28){ var t=$(_28); return $.extend({},$.parser.parseOptions(_28,[{total:"number",pageSize:"number",pageNumber:"number",links:"number"},{loading:"boolean",showPageList:"boolean",showRefresh:"boolean"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined)}); }; $.fn.pagination.defaults={total:1,pageSize:10,pageNumber:1,pageList:[10,20,30,50],loading:false,buttons:null,showPageList:true,showRefresh:true,links:10,layout:["list","sep","first","prev","sep","manual","sep","next","last","sep","refresh"],onSelectPage:function(_29,_2a){ },onBeforeRefresh:function(_2b,_2c){ },onRefresh:function(_2d,_2e){ },onChangePageSize:function(_2f){ },beforePageText:"Page",afterPageText:"of {pages}",displayMsg:"Displaying {from} to {to} of {total} items",nav:{first:{iconCls:"pagination-first",handler:function(){ var _30=$(this).pagination("options"); if(_30.pageNumber>1){ $(this).pagination("select",1); } }},prev:{iconCls:"pagination-prev",handler:function(){ var _31=$(this).pagination("options"); if(_31.pageNumber>1){ $(this).pagination("select",_31.pageNumber-1); } }},next:{iconCls:"pagination-next",handler:function(){ var _32=$(this).pagination("options"); var _33=Math.ceil(_32.total/_32.pageSize); if(_32.pageNumber<_33){ $(this).pagination("select",_32.pageNumber+1); } }},last:{iconCls:"pagination-last",handler:function(){ var _34=$(this).pagination("options"); var _35=Math.ceil(_34.total/_34.pageSize); if(_34.pageNumber<_35){ $(this).pagination("select",_35); } }},refresh:{iconCls:"pagination-refresh",handler:function(){ var _36=$(this).pagination("options"); if(_36.onBeforeRefresh.call(this,_36.pageNumber,_36.pageSize)!=false){ $(this).pagination("select",_36.pageNumber); _36.onRefresh.call(this,_36.pageNumber,_36.pageSize); } }}}}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.panel.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ $.fn._remove=function(){ return this.each(function(){ $(this).remove(); try{ this.outerHTML=""; } catch(err){ } }); }; function _1(_2){ _2._remove(); }; function _3(_4,_5){ var _6=$.data(_4,"panel"); var _7=_6.options; var _8=_6.panel; var _9=_8.children(".panel-header"); var _a=_8.children(".panel-body"); var _b=_8.children(".panel-footer"); if(_5){ $.extend(_7,{width:_5.width,height:_5.height,minWidth:_5.minWidth,maxWidth:_5.maxWidth,minHeight:_5.minHeight,maxHeight:_5.maxHeight,left:_5.left,top:_5.top}); } _8._size(_7); _9.add(_a)._outerWidth(_8.width()); if(!isNaN(parseInt(_7.height))){ _a._outerHeight(_8.height()-_9._outerHeight()-_b._outerHeight()); }else{ _a.css("height",""); var _c=$.parser.parseValue("minHeight",_7.minHeight,_8.parent()); var _d=$.parser.parseValue("maxHeight",_7.maxHeight,_8.parent()); var _e=_9._outerHeight()+_b._outerHeight()+_8._outerHeight()-_8.height(); _a._size("minHeight",_c?(_c-_e):""); _a._size("maxHeight",_d?(_d-_e):""); } _8.css({height:"",minHeight:"",maxHeight:"",left:_7.left,top:_7.top}); _7.onResize.apply(_4,[_7.width,_7.height]); $(_4).panel("doLayout"); }; function _f(_10,_11){ var _12=$.data(_10,"panel"); var _13=_12.options; var _14=_12.panel; if(_11){ if(_11.left!=null){ _13.left=_11.left; } if(_11.top!=null){ _13.top=_11.top; } } _14.css({left:_13.left,top:_13.top}); _14.find(".tooltip-f").each(function(){ $(this).tooltip("reposition"); }); _13.onMove.apply(_10,[_13.left,_13.top]); }; function _15(_16){ $(_16).addClass("panel-body")._size("clear"); var _17=$("
    ").insertBefore(_16); _17[0].appendChild(_16); _17.bind("_resize",function(e,_18){ if($(this).hasClass("easyui-fluid")||_18){ _3(_16); } return false; }); return _17; }; function _19(_1a){ var _1b=$.data(_1a,"panel"); var _1c=_1b.options; var _1d=_1b.panel; _1d.css(_1c.style); _1d.addClass(_1c.cls); _1e(); _1f(); var _20=$(_1a).panel("header"); var _21=$(_1a).panel("body"); var _22=$(_1a).siblings(".panel-footer"); if(_1c.border){ _20.removeClass("panel-header-noborder"); _21.removeClass("panel-body-noborder"); _22.removeClass("panel-footer-noborder"); }else{ _20.addClass("panel-header-noborder"); _21.addClass("panel-body-noborder"); _22.addClass("panel-footer-noborder"); } _20.addClass(_1c.headerCls); _21.addClass(_1c.bodyCls); $(_1a).attr("id",_1c.id||""); if(_1c.content){ $(_1a).panel("clear"); $(_1a).html(_1c.content); $.parser.parse($(_1a)); } function _1e(){ if(_1c.noheader||(!_1c.title&&!_1c.header)){ _1(_1d.children(".panel-header")); _1d.children(".panel-body").addClass("panel-body-noheader"); }else{ if(_1c.header){ $(_1c.header).addClass("panel-header").prependTo(_1d); }else{ var _23=_1d.children(".panel-header"); if(!_23.length){ _23=$("
    ").prependTo(_1d); } if(!$.isArray(_1c.tools)){ _23.find("div.panel-tool .panel-tool-a").appendTo(_1c.tools); } _23.empty(); var _24=$("
    ").html(_1c.title).appendTo(_23); if(_1c.iconCls){ _24.addClass("panel-with-icon"); $("
    ").addClass(_1c.iconCls).appendTo(_23); } var _25=$("
    ").appendTo(_23); _25.bind("click",function(e){ e.stopPropagation(); }); if(_1c.tools){ if($.isArray(_1c.tools)){ $.map(_1c.tools,function(t){ _26(_25,t.iconCls,eval(t.handler)); }); }else{ $(_1c.tools).children().each(function(){ $(this).addClass($(this).attr("iconCls")).addClass("panel-tool-a").appendTo(_25); }); } } if(_1c.collapsible){ _26(_25,"panel-tool-collapse",function(){ if(_1c.collapsed==true){ _4f(_1a,true); }else{ _3c(_1a,true); } }); } if(_1c.minimizable){ _26(_25,"panel-tool-min",function(){ _5a(_1a); }); } if(_1c.maximizable){ _26(_25,"panel-tool-max",function(){ if(_1c.maximized==true){ _5e(_1a); }else{ _3b(_1a); } }); } if(_1c.closable){ _26(_25,"panel-tool-close",function(){ _3d(_1a); }); } } _1d.children("div.panel-body").removeClass("panel-body-noheader"); } }; function _26(c,_27,_28){ var a=$("").addClass(_27).appendTo(c); a.bind("click",_28); }; function _1f(){ if(_1c.footer){ $(_1c.footer).addClass("panel-footer").appendTo(_1d); $(_1a).addClass("panel-body-nobottom"); }else{ _1d.children(".panel-footer").remove(); $(_1a).removeClass("panel-body-nobottom"); } }; }; function _29(_2a,_2b){ var _2c=$.data(_2a,"panel"); var _2d=_2c.options; if(_2e){ _2d.queryParams=_2b; } if(!_2d.href){ return; } if(!_2c.isLoaded||!_2d.cache){ var _2e=$.extend({},_2d.queryParams); if(_2d.onBeforeLoad.call(_2a,_2e)==false){ return; } _2c.isLoaded=false; if(_2d.loadingMessage){ $(_2a).panel("clear"); $(_2a).html($("
    ").html(_2d.loadingMessage)); } _2d.loader.call(_2a,_2e,function(_2f){ var _30=_2d.extractor.call(_2a,_2f); $(_2a).panel("clear"); $(_2a).html(_30); $.parser.parse($(_2a)); _2d.onLoad.apply(_2a,arguments); _2c.isLoaded=true; },function(){ _2d.onLoadError.apply(_2a,arguments); }); } }; function _31(_32){ var t=$(_32); t.find(".combo-f").each(function(){ $(this).combo("destroy"); }); t.find(".m-btn").each(function(){ $(this).menubutton("destroy"); }); t.find(".s-btn").each(function(){ $(this).splitbutton("destroy"); }); t.find(".tooltip-f").each(function(){ $(this).tooltip("destroy"); }); t.children("div").each(function(){ $(this)._size("unfit"); }); t.empty(); }; function _33(_34){ $(_34).panel("doLayout",true); }; function _35(_36,_37){ var _38=$.data(_36,"panel").options; var _39=$.data(_36,"panel").panel; if(_37!=true){ if(_38.onBeforeOpen.call(_36)==false){ return; } } _39.stop(true,true); if($.isFunction(_38.openAnimation)){ _38.openAnimation.call(_36,cb); }else{ switch(_38.openAnimation){ case "slide": _39.slideDown(_38.openDuration,cb); break; case "fade": _39.fadeIn(_38.openDuration,cb); break; case "show": _39.show(_38.openDuration,cb); break; default: _39.show(); cb(); } } function cb(){ _38.closed=false; _38.minimized=false; var _3a=_39.children(".panel-header").find("a.panel-tool-restore"); if(_3a.length){ _38.maximized=true; } _38.onOpen.call(_36); if(_38.maximized==true){ _38.maximized=false; _3b(_36); } if(_38.collapsed==true){ _38.collapsed=false; _3c(_36); } if(!_38.collapsed){ _29(_36); _33(_36); } }; }; function _3d(_3e,_3f){ var _40=$.data(_3e,"panel"); var _41=_40.options; var _42=_40.panel; if(_3f!=true){ if(_41.onBeforeClose.call(_3e)==false){ return; } } _42.find(".tooltip-f").each(function(){ $(this).tooltip("hide"); }); _42.stop(true,true); _42._size("unfit"); if($.isFunction(_41.closeAnimation)){ _41.closeAnimation.call(_3e,cb); }else{ switch(_41.closeAnimation){ case "slide": _42.slideUp(_41.closeDuration,cb); break; case "fade": _42.fadeOut(_41.closeDuration,cb); break; case "hide": _42.hide(_41.closeDuration,cb); break; default: _42.hide(); cb(); } } function cb(){ _41.closed=true; _41.onClose.call(_3e); }; }; function _43(_44,_45){ var _46=$.data(_44,"panel"); var _47=_46.options; var _48=_46.panel; if(_45!=true){ if(_47.onBeforeDestroy.call(_44)==false){ return; } } $(_44).panel("clear").panel("clear","footer"); _1(_48); _47.onDestroy.call(_44); }; function _3c(_49,_4a){ var _4b=$.data(_49,"panel").options; var _4c=$.data(_49,"panel").panel; var _4d=_4c.children(".panel-body"); var _4e=_4c.children(".panel-header").find("a.panel-tool-collapse"); if(_4b.collapsed==true){ return; } _4d.stop(true,true); if(_4b.onBeforeCollapse.call(_49)==false){ return; } _4e.addClass("panel-tool-expand"); if(_4a==true){ _4d.slideUp("normal",function(){ _4b.collapsed=true; _4b.onCollapse.call(_49); }); }else{ _4d.hide(); _4b.collapsed=true; _4b.onCollapse.call(_49); } }; function _4f(_50,_51){ var _52=$.data(_50,"panel").options; var _53=$.data(_50,"panel").panel; var _54=_53.children(".panel-body"); var _55=_53.children(".panel-header").find("a.panel-tool-collapse"); if(_52.collapsed==false){ return; } _54.stop(true,true); if(_52.onBeforeExpand.call(_50)==false){ return; } _55.removeClass("panel-tool-expand"); if(_51==true){ _54.slideDown("normal",function(){ _52.collapsed=false; _52.onExpand.call(_50); _29(_50); _33(_50); }); }else{ _54.show(); _52.collapsed=false; _52.onExpand.call(_50); _29(_50); _33(_50); } }; function _3b(_56){ var _57=$.data(_56,"panel").options; var _58=$.data(_56,"panel").panel; var _59=_58.children(".panel-header").find("a.panel-tool-max"); if(_57.maximized==true){ return; } _59.addClass("panel-tool-restore"); if(!$.data(_56,"panel").original){ $.data(_56,"panel").original={width:_57.width,height:_57.height,left:_57.left,top:_57.top,fit:_57.fit}; } _57.left=0; _57.top=0; _57.fit=true; _3(_56); _57.minimized=false; _57.maximized=true; _57.onMaximize.call(_56); }; function _5a(_5b){ var _5c=$.data(_5b,"panel").options; var _5d=$.data(_5b,"panel").panel; _5d._size("unfit"); _5d.hide(); _5c.minimized=true; _5c.maximized=false; _5c.onMinimize.call(_5b); }; function _5e(_5f){ var _60=$.data(_5f,"panel").options; var _61=$.data(_5f,"panel").panel; var _62=_61.children(".panel-header").find("a.panel-tool-max"); if(_60.maximized==false){ return; } _61.show(); _62.removeClass("panel-tool-restore"); $.extend(_60,$.data(_5f,"panel").original); _3(_5f); _60.minimized=false; _60.maximized=false; $.data(_5f,"panel").original=null; _60.onRestore.call(_5f); }; function _63(_64,_65){ $.data(_64,"panel").options.title=_65; $(_64).panel("header").find("div.panel-title").html(_65); }; var _66=null; $(window).unbind(".panel").bind("resize.panel",function(){ if(_66){ clearTimeout(_66); } _66=setTimeout(function(){ var _67=$("body.layout"); if(_67.length){ _67.layout("resize"); $("body").children(".easyui-fluid:visible").each(function(){ $(this).triggerHandler("_resize"); }); }else{ $("body").panel("doLayout"); } _66=null; },100); }); $.fn.panel=function(_68,_69){ if(typeof _68=="string"){ return $.fn.panel.methods[_68](this,_69); } _68=_68||{}; return this.each(function(){ var _6a=$.data(this,"panel"); var _6b; if(_6a){ _6b=$.extend(_6a.options,_68); _6a.isLoaded=false; }else{ _6b=$.extend({},$.fn.panel.defaults,$.fn.panel.parseOptions(this),_68); $(this).attr("title",""); _6a=$.data(this,"panel",{options:_6b,panel:_15(this),isLoaded:false}); } _19(this); $(this).show(); if(_6b.doSize==true){ _6a.panel.css("display","block"); _3(this); } if(_6b.closed==true||_6b.minimized==true){ _6a.panel.hide(); }else{ _35(this); } }); }; $.fn.panel.methods={options:function(jq){ return $.data(jq[0],"panel").options; },panel:function(jq){ return $.data(jq[0],"panel").panel; },header:function(jq){ return $.data(jq[0],"panel").panel.children(".panel-header"); },footer:function(jq){ return jq.panel("panel").children(".panel-footer"); },body:function(jq){ return $.data(jq[0],"panel").panel.children(".panel-body"); },setTitle:function(jq,_6c){ return jq.each(function(){ _63(this,_6c); }); },open:function(jq,_6d){ return jq.each(function(){ _35(this,_6d); }); },close:function(jq,_6e){ return jq.each(function(){ _3d(this,_6e); }); },destroy:function(jq,_6f){ return jq.each(function(){ _43(this,_6f); }); },clear:function(jq,_70){ return jq.each(function(){ _31(_70=="footer"?$(this).panel("footer"):this); }); },refresh:function(jq,_71){ return jq.each(function(){ var _72=$.data(this,"panel"); _72.isLoaded=false; if(_71){ if(typeof _71=="string"){ _72.options.href=_71; }else{ _72.options.queryParams=_71; } } _29(this); }); },resize:function(jq,_73){ return jq.each(function(){ _3(this,_73); }); },doLayout:function(jq,all){ return jq.each(function(){ _74(this,"body"); _74($(this).siblings(".panel-footer")[0],"footer"); function _74(_75,_76){ if(!_75){ return; } var _77=_75==$("body")[0]; var s=$(_75).find("div.panel:visible,div.accordion:visible,div.tabs-container:visible,div.layout:visible,.easyui-fluid:visible").filter(function(_78,el){ var p=$(el).parents(".panel-"+_76+":first"); return _77?p.length==0:p[0]==_75; }); s.each(function(){ $(this).triggerHandler("_resize",[all||false]); }); }; }); },move:function(jq,_79){ return jq.each(function(){ _f(this,_79); }); },maximize:function(jq){ return jq.each(function(){ _3b(this); }); },minimize:function(jq){ return jq.each(function(){ _5a(this); }); },restore:function(jq){ return jq.each(function(){ _5e(this); }); },collapse:function(jq,_7a){ return jq.each(function(){ _3c(this,_7a); }); },expand:function(jq,_7b){ return jq.each(function(){ _4f(this,_7b); }); }}; $.fn.panel.parseOptions=function(_7c){ var t=$(_7c); var hh=t.children(".panel-header,header"); var ff=t.children(".panel-footer,footer"); return $.extend({},$.parser.parseOptions(_7c,["id","width","height","left","top","title","iconCls","cls","headerCls","bodyCls","tools","href","method","header","footer",{cache:"boolean",fit:"boolean",border:"boolean",noheader:"boolean"},{collapsible:"boolean",minimizable:"boolean",maximizable:"boolean"},{closable:"boolean",collapsed:"boolean",minimized:"boolean",maximized:"boolean",closed:"boolean"},"openAnimation","closeAnimation",{openDuration:"number",closeDuration:"number"},]),{loadingMessage:(t.attr("loadingMessage")!=undefined?t.attr("loadingMessage"):undefined),header:(hh.length?hh.removeClass("panel-header"):undefined),footer:(ff.length?ff.removeClass("panel-footer"):undefined)}); }; $.fn.panel.defaults={id:null,title:null,iconCls:null,width:"auto",height:"auto",left:null,top:null,cls:null,headerCls:null,bodyCls:null,style:{},href:null,cache:true,fit:false,border:true,doSize:true,noheader:false,content:null,collapsible:false,minimizable:false,maximizable:false,closable:false,collapsed:false,minimized:false,maximized:false,closed:false,openAnimation:false,openDuration:400,closeAnimation:false,closeDuration:400,tools:null,footer:null,header:null,queryParams:{},method:"get",href:null,loadingMessage:"Loading...",loader:function(_7d,_7e,_7f){ var _80=$(this).panel("options"); if(!_80.href){ return false; } $.ajax({type:_80.method,url:_80.href,cache:false,data:_7d,dataType:"html",success:function(_81){ _7e(_81); },error:function(){ _7f.apply(this,arguments); }}); },extractor:function(_82){ var _83=/]*>((.|[\n\r])*)<\/body>/im; var _84=_83.exec(_82); if(_84){ return _84[1]; }else{ return _82; } },onBeforeLoad:function(_85){ },onLoad:function(){ },onLoadError:function(){ },onBeforeOpen:function(){ },onOpen:function(){ },onBeforeClose:function(){ },onClose:function(){ },onBeforeDestroy:function(){ },onDestroy:function(){ },onResize:function(_86,_87){ },onMove:function(_88,top){ },onMaximize:function(){ },onRestore:function(){ },onMinimize:function(){ },onBeforeCollapse:function(){ },onBeforeExpand:function(){ },onCollapse:function(){ },onExpand:function(){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.parser.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ $.easyui={indexOfArray:function(a,o,id){ for(var i=0,_1=a.length;i<_1;i++){ if(id==undefined){ if(a[i]==o){ return i; } }else{ if(a[i][o]==id){ return i; } } } return -1; },removeArrayItem:function(a,o,id){ if(typeof o=="string"){ for(var i=0,_2=a.length;i<_2;i++){ if(a[i][o]==id){ a.splice(i,1); return; } } }else{ var _3=this.indexOfArray(a,o); if(_3!=-1){ a.splice(_3,1); } } },addArrayItem:function(a,o,r){ var _4=this.indexOfArray(a,o,r?r[o]:undefined); if(_4==-1){ a.push(r?r:o); }else{ a[_4]=r?r:o; } },getArrayItem:function(a,o,id){ var _5=this.indexOfArray(a,o,id); return _5==-1?null:a[_5]; },forEach:function(_6,_7,_8){ var _9=[]; for(var i=0;i<_6.length;i++){ _9.push(_6[i]); } while(_9.length){ var _a=_9.shift(); if(_8(_a)==false){ return; } if(_7&&_a.children){ for(var i=_a.children.length-1;i>=0;i--){ _9.unshift(_a.children[i]); } } } }}; $.parser={auto:true,onComplete:function(_b){ },plugins:["draggable","droppable","resizable","pagination","tooltip","linkbutton","menu","menubutton","splitbutton","switchbutton","progressbar","tree","textbox","passwordbox","filebox","combo","combobox","combotree","combogrid","combotreegrid","tagbox","numberbox","validatebox","searchbox","spinner","numberspinner","timespinner","datetimespinner","calendar","datebox","datetimebox","slider","layout","panel","datagrid","propertygrid","treegrid","datalist","tabs","accordion","window","dialog","form"],parse:function(_c){ var aa=[]; for(var i=0;i<$.parser.plugins.length;i++){ var _d=$.parser.plugins[i]; var r=$(".easyui-"+_d,_c); if(r.length){ if(r[_d]){ r.each(function(){ $(this)[_d]($.data(this,"options")||{}); }); }else{ aa.push({name:_d,jq:r}); } } } if(aa.length&&window.easyloader){ var _e=[]; for(var i=0;i=0){ v=Math.floor((_12.width()-_13)*v/100); }else{ v=Math.floor((_12.height()-_13)*v/100); } }else{ v=parseInt(v)||undefined; } return v; },parseOptions:function(_15,_16){ var t=$(_15); var _17={}; var s=$.trim(t.attr("data-options")); if(s){ if(s.substring(0,1)!="{"){ s="{"+s+"}"; } _17=(new Function("return "+s))(); } $.map(["width","height","left","top","minWidth","maxWidth","minHeight","maxHeight"],function(p){ var pv=$.trim(_15.style[p]||""); if(pv){ if(pv.indexOf("%")==-1){ pv=parseInt(pv); if(isNaN(pv)){ pv=undefined; } } _17[p]=pv; } }); if(_16){ var _18={}; for(var i=0;i<_16.length;i++){ var pp=_16[i]; if(typeof pp=="string"){ _18[pp]=t.attr(pp); }else{ for(var _19 in pp){ var _1a=pp[_19]; if(_1a=="boolean"){ _18[_19]=t.attr(_19)?(t.attr(_19)=="true"):undefined; }else{ if(_1a=="number"){ _18[_19]=t.attr(_19)=="0"?0:parseFloat(t.attr(_19))||undefined; } } } } } $.extend(_17,_18); } return _17; }}; $(function(){ var d=$("
    ").appendTo("body"); $._boxModel=d.outerWidth()!=100; d.remove(); d=$("
    ").appendTo("body"); $._positionFixed=(d.css("position")=="fixed"); d.remove(); if(!window.easyloader&&$.parser.auto){ $.parser.parse(); } }); $.fn._outerWidth=function(_1b){ if(_1b==undefined){ if(this[0]==window){ return this.width()||document.body.clientWidth; } return this.outerWidth()||0; } return this._size("width",_1b); }; $.fn._outerHeight=function(_1c){ if(_1c==undefined){ if(this[0]==window){ return this.height()||document.body.clientHeight; } return this.outerHeight()||0; } return this._size("height",_1c); }; $.fn._scrollLeft=function(_1d){ if(_1d==undefined){ return this.scrollLeft(); }else{ return this.each(function(){ $(this).scrollLeft(_1d); }); } }; $.fn._propAttr=$.fn.prop||$.fn.attr; $.fn._size=function(_1e,_1f){ if(typeof _1e=="string"){ if(_1e=="clear"){ return this.each(function(){ $(this).css({width:"",minWidth:"",maxWidth:"",height:"",minHeight:"",maxHeight:""}); }); }else{ if(_1e=="fit"){ return this.each(function(){ _20(this,this.tagName=="BODY"?$("body"):$(this).parent(),true); }); }else{ if(_1e=="unfit"){ return this.each(function(){ _20(this,$(this).parent(),false); }); }else{ if(_1f==undefined){ return _21(this[0],_1e); }else{ return this.each(function(){ _21(this,_1e,_1f); }); } } } } }else{ return this.each(function(){ _1f=_1f||$(this).parent(); $.extend(_1e,_20(this,_1f,_1e.fit)||{}); var r1=_22(this,"width",_1f,_1e); var r2=_22(this,"height",_1f,_1e); if(r1||r2){ $(this).addClass("easyui-fluid"); }else{ $(this).removeClass("easyui-fluid"); } }); } function _20(_23,_24,fit){ if(!_24.length){ return false; } var t=$(_23)[0]; var p=_24[0]; var _25=p.fcount||0; if(fit){ if(!t.fitted){ t.fitted=true; p.fcount=_25+1; $(p).addClass("panel-noscroll"); if(p.tagName=="BODY"){ $("html").addClass("panel-fit"); } } return {width:($(p).width()||1),height:($(p).height()||1)}; }else{ if(t.fitted){ t.fitted=false; p.fcount=_25-1; if(p.fcount==0){ $(p).removeClass("panel-noscroll"); if(p.tagName=="BODY"){ $("html").removeClass("panel-fit"); } } } return false; } }; function _22(_26,_27,_28,_29){ var t=$(_26); var p=_27; var p1=p.substr(0,1).toUpperCase()+p.substr(1); var min=$.parser.parseValue("min"+p1,_29["min"+p1],_28); var max=$.parser.parseValue("max"+p1,_29["max"+p1],_28); var val=$.parser.parseValue(p,_29[p],_28); var _2a=(String(_29[p]||"").indexOf("%")>=0?true:false); if(!isNaN(val)){ var v=Math.min(Math.max(val,min||0),max||99999); if(!_2a){ _29[p]=v; } t._size("min"+p1,""); t._size("max"+p1,""); t._size(p,v); }else{ t._size(p,""); t._size("min"+p1,min); t._size("max"+p1,max); } return _2a||_29.fit; }; function _21(_2b,_2c,_2d){ var t=$(_2b); if(_2d==undefined){ _2d=parseInt(_2b.style[_2c]); if(isNaN(_2d)){ return undefined; } if($._boxModel){ _2d+=_2e(); } return _2d; }else{ if(_2d===""){ t.css(_2c,""); }else{ if($._boxModel){ _2d-=_2e(); if(_2d<0){ _2d=0; } } t.css(_2c,_2d+"px"); } } function _2e(){ if(_2c.toLowerCase().indexOf("width")>=0){ return t.outerWidth()-t.width(); }else{ return t.outerHeight()-t.height(); } }; }; }; })(jQuery); (function($){ var _2f=null; var _30=null; var _31=false; function _32(e){ if(e.touches.length!=1){ return; } if(!_31){ _31=true; dblClickTimer=setTimeout(function(){ _31=false; },500); }else{ clearTimeout(dblClickTimer); _31=false; _33(e,"dblclick"); } _2f=setTimeout(function(){ _33(e,"contextmenu",3); },1000); _33(e,"mousedown"); if($.fn.draggable.isDragging||$.fn.resizable.isResizing){ e.preventDefault(); } }; function _34(e){ if(e.touches.length!=1){ return; } if(_2f){ clearTimeout(_2f); } _33(e,"mousemove"); if($.fn.draggable.isDragging||$.fn.resizable.isResizing){ e.preventDefault(); } }; function _35(e){ if(_2f){ clearTimeout(_2f); } _33(e,"mouseup"); if($.fn.draggable.isDragging||$.fn.resizable.isResizing){ e.preventDefault(); } }; function _33(e,_36,_37){ var _38=new $.Event(_36); _38.pageX=e.changedTouches[0].pageX; _38.pageY=e.changedTouches[0].pageY; _38.which=_37||1; $(e.target).trigger(_38); }; if(document.addEventListener){ document.addEventListener("touchstart",_32,true); document.addEventListener("touchmove",_34,true); document.addEventListener("touchend",_35,true); } })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.passwordbox.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"passwordbox"); var _4=_3.options; var _5=$.extend(true,[],_4.icons); if(_4.showEye){ _5.push({iconCls:"passwordbox-open",handler:function(e){ _4.revealed=!_4.revealed; _6(_2); }}); } $(_2).addClass("passwordbox-f").textbox($.extend({},_4,{icons:_5})); _6(_2); }; function _7(_8,_9,_a){ var t=$(_8); var _b=t.passwordbox("options"); if(_b.revealed){ t.textbox("setValue",_9); return; } var _c=unescape(_b.passwordChar); var cc=_9.split(""); var vv=t.passwordbox("getValue").split(""); for(var i=0;i
    "); $(_2).bind("_resize",function(e,_3){ if($(this).hasClass("easyui-fluid")||_3){ _4(_2); } return false; }); return $(_2); }; function _4(_5,_6){ var _7=$.data(_5,"progressbar").options; var _8=$.data(_5,"progressbar").bar; if(_6){ _7.width=_6; } _8._size(_7); _8.find("div.progressbar-text").css("width",_8.width()); _8.find("div.progressbar-text,div.progressbar-value").css({height:_8.height()+"px",lineHeight:_8.height()+"px"}); }; $.fn.progressbar=function(_9,_a){ if(typeof _9=="string"){ var _b=$.fn.progressbar.methods[_9]; if(_b){ return _b(this,_a); } } _9=_9||{}; return this.each(function(){ var _c=$.data(this,"progressbar"); if(_c){ $.extend(_c.options,_9); }else{ _c=$.data(this,"progressbar",{options:$.extend({},$.fn.progressbar.defaults,$.fn.progressbar.parseOptions(this),_9),bar:_1(this)}); } $(this).progressbar("setValue",_c.options.value); _4(this); }); }; $.fn.progressbar.methods={options:function(jq){ return $.data(jq[0],"progressbar").options; },resize:function(jq,_d){ return jq.each(function(){ _4(this,_d); }); },getValue:function(jq){ return $.data(jq[0],"progressbar").options.value; },setValue:function(jq,_e){ if(_e<0){ _e=0; } if(_e>100){ _e=100; } return jq.each(function(){ var _f=$.data(this,"progressbar").options; var _10=_f.text.replace(/{value}/,_e); var _11=_f.value; _f.value=_e; $(this).find("div.progressbar-value").width(_e+"%"); $(this).find("div.progressbar-text").html(_10); if(_11!=_e){ _f.onChange.call(this,_e,_11); } }); }}; $.fn.progressbar.parseOptions=function(_12){ return $.extend({},$.parser.parseOptions(_12,["width","height","text",{value:"number"}])); }; $.fn.progressbar.defaults={width:"auto",height:22,value:0,text:"{value}%",onChange:function(_13,_14){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.propertygrid.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ var _1; $(document).unbind(".propertygrid").bind("mousedown.propertygrid",function(e){ var p=$(e.target).closest("div.datagrid-view,div.combo-panel"); if(p.length){ return; } _2(_1); _1=undefined; }); function _3(_4){ var _5=$.data(_4,"propertygrid"); var _6=$.data(_4,"propertygrid").options; $(_4).datagrid($.extend({},_6,{cls:"propertygrid",view:(_6.showGroup?_6.groupView:_6.view),onBeforeEdit:function(_7,_8){ if(_6.onBeforeEdit.call(_4,_7,_8)==false){ return false; } var dg=$(this); var _8=dg.datagrid("getRows")[_7]; var _9=dg.datagrid("getColumnOption","value"); _9.editor=_8.editor; },onClickCell:function(_a,_b,_c){ if(_1!=this){ _2(_1); _1=this; } if(_6.editIndex!=_a){ _2(_1); $(this).datagrid("beginEdit",_a); var ed=$(this).datagrid("getEditor",{index:_a,field:_b}); if(!ed){ ed=$(this).datagrid("getEditor",{index:_a,field:"value"}); } if(ed){ var t=$(ed.target); var _d=t.data("textbox")?t.textbox("textbox"):t; _d.focus(); _6.editIndex=_a; } } _6.onClickCell.call(_4,_a,_b,_c); },loadFilter:function(_e){ _2(this); return _6.loadFilter.call(this,_e); }})); }; function _2(_f){ var t=$(_f); if(!t.length){ return; } var _10=$.data(_f,"propertygrid").options; _10.finder.getTr(_f,null,"editing").each(function(){ var _11=parseInt($(this).attr("datagrid-row-index")); if(t.datagrid("validateRow",_11)){ t.datagrid("endEdit",_11); }else{ t.datagrid("cancelEdit",_11); } }); _10.editIndex=undefined; }; $.fn.propertygrid=function(_12,_13){ if(typeof _12=="string"){ var _14=$.fn.propertygrid.methods[_12]; if(_14){ return _14(this,_13); }else{ return this.datagrid(_12,_13); } } _12=_12||{}; return this.each(function(){ var _15=$.data(this,"propertygrid"); if(_15){ $.extend(_15.options,_12); }else{ var _16=$.extend({},$.fn.propertygrid.defaults,$.fn.propertygrid.parseOptions(this),_12); _16.frozenColumns=$.extend(true,[],_16.frozenColumns); _16.columns=$.extend(true,[],_16.columns); $.data(this,"propertygrid",{options:_16}); } _3(this); }); }; $.fn.propertygrid.methods={options:function(jq){ return $.data(jq[0],"propertygrid").options; }}; $.fn.propertygrid.parseOptions=function(_17){ return $.extend({},$.fn.datagrid.parseOptions(_17),$.parser.parseOptions(_17,[{showGroup:"boolean"}])); }; var _18=$.extend({},$.fn.datagrid.defaults.view,{render:function(_19,_1a,_1b){ var _1c=[]; var _1d=this.groups; for(var i=0;i<_1d.length;i++){ _1c.push(this.renderGroup.call(this,_19,i,_1d[i],_1b)); } $(_1a).html(_1c.join("")); },renderGroup:function(_1e,_1f,_20,_21){ var _22=$.data(_1e,"datagrid"); var _23=_22.options; var _24=$(_1e).datagrid("getColumnFields",_21); var _25=[]; _25.push("
    "); if((_21&&(_23.rownumbers||_23.frozenColumns.length))||(!_21&&!(_23.rownumbers||_23.frozenColumns.length))){ _25.push(""); _25.push(" "); _25.push(""); } if(!_21){ _25.push(""); _25.push(_23.groupFormatter.call(_1e,_20.value,_20.rows)); _25.push(""); } _25.push("
    "); _25.push(""); var _26=_20.startIndex; for(var j=0;j<_20.rows.length;j++){ var css=_23.rowStyler?_23.rowStyler.call(_1e,_26,_20.rows[j]):""; var _27=""; var _28=""; if(typeof css=="string"){ _28=css; }else{ if(css){ _27=css["class"]||""; _28=css["style"]||""; } } var cls="class=\"datagrid-row "+(_26%2&&_23.striped?"datagrid-row-alt ":" ")+_27+"\""; var _29=_28?"style=\""+_28+"\"":""; var _2a=_22.rowIdPrefix+"-"+(_21?1:2)+"-"+_26; _25.push(""); _25.push(this.renderRow.call(this,_1e,_24,_21,_26,_20.rows[j])); _25.push(""); _26++; } _25.push("
    "); return _25.join(""); },bindEvents:function(_2b){ var _2c=$.data(_2b,"datagrid"); var dc=_2c.dc; var _2d=dc.body1.add(dc.body2); var _2e=($.data(_2d[0],"events")||$._data(_2d[0],"events")).click[0].handler; _2d.unbind("click").bind("click",function(e){ var tt=$(e.target); var _2f=tt.closest("span.datagrid-row-expander"); if(_2f.length){ var _30=_2f.closest("div.datagrid-group").attr("group-index"); if(_2f.hasClass("datagrid-row-collapse")){ $(_2b).datagrid("collapseGroup",_30); }else{ $(_2b).datagrid("expandGroup",_30); } }else{ _2e(e); } e.stopPropagation(); }); },onBeforeRender:function(_31,_32){ var _33=$.data(_31,"datagrid"); var _34=_33.options; _35(); var _36=[]; for(var i=0;i<_32.length;i++){ var row=_32[i]; var _37=_38(row[_34.groupField]); if(!_37){ _37={value:row[_34.groupField],rows:[row]}; _36.push(_37); }else{ _37.rows.push(row); } } var _39=0; var _3a=[]; for(var i=0;i<_36.length;i++){ var _37=_36[i]; _37.startIndex=_39; _39+=_37.rows.length; _3a=_3a.concat(_37.rows); } _33.data.rows=_3a; this.groups=_36; var _3b=this; setTimeout(function(){ _3b.bindEvents(_31); },0); function _38(_3c){ for(var i=0;i<_36.length;i++){ var _3d=_36[i]; if(_3d.value==_3c){ return _3d; } } return null; }; function _35(){ if(!$("#datagrid-group-style").length){ $("head").append(""); } }; }}); $.extend($.fn.datagrid.methods,{groups:function(jq){ return jq.datagrid("options").view.groups; },expandGroup:function(jq,_3e){ return jq.each(function(){ var _3f=$.data(this,"datagrid").dc.view; var _40=_3f.find(_3e!=undefined?"div.datagrid-group[group-index=\""+_3e+"\"]":"div.datagrid-group"); var _41=_40.find("span.datagrid-row-expander"); if(_41.hasClass("datagrid-row-expand")){ _41.removeClass("datagrid-row-expand").addClass("datagrid-row-collapse"); _40.next("table").show(); } $(this).datagrid("fixRowHeight"); }); },collapseGroup:function(jq,_42){ return jq.each(function(){ var _43=$.data(this,"datagrid").dc.view; var _44=_43.find(_42!=undefined?"div.datagrid-group[group-index=\""+_42+"\"]":"div.datagrid-group"); var _45=_44.find("span.datagrid-row-expander"); if(_45.hasClass("datagrid-row-collapse")){ _45.removeClass("datagrid-row-collapse").addClass("datagrid-row-expand"); _44.next("table").hide(); } $(this).datagrid("fixRowHeight"); }); }}); $.extend(_18,{refreshGroupTitle:function(_46,_47){ var _48=$.data(_46,"datagrid"); var _49=_48.options; var dc=_48.dc; var _4a=this.groups[_47]; var _4b=dc.body2.children("div.datagrid-group[group-index="+_47+"]").find("span.datagrid-group-title"); _4b.html(_49.groupFormatter.call(_46,_4a.value,_4a.rows)); },insertRow:function(_4c,_4d,row){ var _4e=$.data(_4c,"datagrid"); var _4f=_4e.options; var dc=_4e.dc; var _50=null; var _51; if(!_4e.data.rows.length){ $(_4c).datagrid("loadData",[row]); return; } for(var i=0;i_50.startIndex+_50.rows.length){ _4d=_50.startIndex+_50.rows.length; } } $.fn.datagrid.defaults.view.insertRow.call(this,_4c,_4d,row); if(_4d>=_50.startIndex+_50.rows.length){ _52(_4d,true); _52(_4d,false); } _50.rows.splice(_4d-_50.startIndex,0,row); }else{ _50={value:row[_4f.groupField],rows:[row],startIndex:_4e.data.rows.length}; _51=this.groups.length; dc.body1.append(this.renderGroup.call(this,_4c,_51,_50,true)); dc.body2.append(this.renderGroup.call(this,_4c,_51,_50,false)); this.groups.push(_50); _4e.data.rows.push(row); } this.refreshGroupTitle(_4c,_51); function _52(_53,_54){ var _55=_54?1:2; var _56=_4f.finder.getTr(_4c,_53-1,"body",_55); var tr=_4f.finder.getTr(_4c,_53,"body",_55); tr.insertAfter(_56); }; },updateRow:function(_57,_58,row){ var _59=$.data(_57,"datagrid").options; $.fn.datagrid.defaults.view.updateRow.call(this,_57,_58,row); var tb=_59.finder.getTr(_57,_58,"body",2).closest("table.datagrid-btable"); var _5a=parseInt(tb.prev().attr("group-index")); this.refreshGroupTitle(_57,_5a); },deleteRow:function(_5b,_5c){ var _5d=$.data(_5b,"datagrid"); var _5e=_5d.options; var dc=_5d.dc; var _5f=dc.body1.add(dc.body2); var tb=_5e.finder.getTr(_5b,_5c,"body",2).closest("table.datagrid-btable"); var _60=parseInt(tb.prev().attr("group-index")); $.fn.datagrid.defaults.view.deleteRow.call(this,_5b,_5c); var _61=this.groups[_60]; if(_61.rows.length>1){ _61.rows.splice(_5c-_61.startIndex,1); this.refreshGroupTitle(_5b,_60); }else{ _5f.children("div.datagrid-group[group-index="+_60+"]").remove(); for(var i=_60+1;i_13.top&&e.pageY<_13.top+_16){ dir+="n"; }else{ if(e.pageY<_13.top+_15&&e.pageY>_13.top+_15-_16){ dir+="s"; } } if(e.pageX>_13.left&&e.pageX<_13.left+_16){ dir+="w"; }else{ if(e.pageX<_13.left+_14&&e.pageX>_13.left+_14-_16){ dir+="e"; } } var _17=_d.handles.split(","); for(var i=0;i<_17.length;i++){ var _18=_17[i].replace(/(^\s*)|(\s*$)/g,""); if(_18=="all"||_18==dir){ return dir; } } return ""; }; }); }; $.fn.resizable.methods={options:function(jq){ return $.data(jq[0],"resizable").options; },enable:function(jq){ return jq.each(function(){ $(this).resizable({disabled:false}); }); },disable:function(jq){ return jq.each(function(){ $(this).resizable({disabled:true}); }); }}; $.fn.resizable.parseOptions=function(_19){ var t=$(_19); return $.extend({},$.parser.parseOptions(_19,["handles",{minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number",edge:"number"}]),{disabled:(t.attr("disabled")?true:undefined)}); }; $.fn.resizable.defaults={disabled:false,handles:"n, e, s, w, ne, se, sw, nw, all",minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000,edge:5,onStartResize:function(e){ },onResize:function(e){ },onStopResize:function(e){ }}; $.fn.resizable.isResizing=false; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.searchbox.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"searchbox"); var _4=_3.options; var _5=$.extend(true,[],_4.icons); _5.push({iconCls:"searchbox-button",handler:function(e){ var t=$(e.data.target); var _6=t.searchbox("options"); _6.searcher.call(e.data.target,t.searchbox("getValue"),t.searchbox("getName")); }}); _7(); var _8=_9(); $(_2).addClass("searchbox-f").textbox($.extend({},_4,{icons:_5,buttonText:(_8?_8.text:"")})); $(_2).attr("searchboxName",$(_2).attr("textboxName")); _3.searchbox=$(_2).next(); _3.searchbox.addClass("searchbox"); _a(_8); function _7(){ if(_4.menu){ _3.menu=$(_4.menu).menu(); var _b=_3.menu.menu("options"); var _c=_b.onClick; _b.onClick=function(_d){ _a(_d); _c.call(this,_d); }; }else{ if(_3.menu){ _3.menu.menu("destroy"); } _3.menu=null; } }; function _9(){ if(_3.menu){ var _e=_3.menu.children("div.menu-item:first"); _3.menu.children("div.menu-item").each(function(){ var _f=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)}); if(_f.selected){ _e=$(this); return false; } }); return _3.menu.menu("getItem",_e[0]); }else{ return null; } }; function _a(_10){ if(!_10){ return; } $(_2).textbox("button").menubutton({text:_10.text,iconCls:(_10.iconCls||null),menu:_3.menu,menuAlign:_4.buttonAlign,plain:false}); _3.searchbox.find("input.textbox-value").attr("name",_10.name||_10.text); $(_2).searchbox("resize"); }; }; $.fn.searchbox=function(_11,_12){ if(typeof _11=="string"){ var _13=$.fn.searchbox.methods[_11]; if(_13){ return _13(this,_12); }else{ return this.textbox(_11,_12); } } _11=_11||{}; return this.each(function(){ var _14=$.data(this,"searchbox"); if(_14){ $.extend(_14.options,_11); }else{ $.data(this,"searchbox",{options:$.extend({},$.fn.searchbox.defaults,$.fn.searchbox.parseOptions(this),_11)}); } _1(this); }); }; $.fn.searchbox.methods={options:function(jq){ var _15=jq.textbox("options"); return $.extend($.data(jq[0],"searchbox").options,{width:_15.width,value:_15.value,originalValue:_15.originalValue,disabled:_15.disabled,readonly:_15.readonly}); },menu:function(jq){ return $.data(jq[0],"searchbox").menu; },getName:function(jq){ return $.data(jq[0],"searchbox").searchbox.find("input.textbox-value").attr("name"); },selectName:function(jq,_16){ return jq.each(function(){ var _17=$.data(this,"searchbox").menu; if(_17){ _17.children("div.menu-item").each(function(){ var _18=_17.menu("getItem",this); if(_18.name==_16){ $(this).triggerHandler("click"); return false; } }); } }); },destroy:function(jq){ return jq.each(function(){ var _19=$(this).searchbox("menu"); if(_19){ _19.menu("destroy"); } $(this).textbox("destroy"); }); }}; $.fn.searchbox.parseOptions=function(_1a){ var t=$(_1a); return $.extend({},$.fn.textbox.parseOptions(_1a),$.parser.parseOptions(_1a,["menu"]),{searcher:(t.attr("searcher")?eval(t.attr("searcher")):undefined)}); }; $.fn.searchbox.defaults=$.extend({},$.fn.textbox.defaults,{inputEvents:$.extend({},$.fn.textbox.defaults.inputEvents,{keydown:function(e){ if(e.keyCode==13){ e.preventDefault(); var t=$(e.data.target); var _1b=t.searchbox("options"); t.searchbox("setValue",$(this).val()); _1b.searcher.call(e.data.target,t.searchbox("getValue"),t.searchbox("getName")); return false; } }}),buttonAlign:"left",menu:null,searcher:function(_1c,_1d){ }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.slider.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$("
    "+"
    "+""+""+"
    "+"
    "+"
    "+"
    "+""+"
    ").insertAfter(_2); var t=$(_2); t.addClass("slider-f").hide(); var _4=t.attr("name"); if(_4){ _3.find("input.slider-value").attr("name",_4); t.removeAttr("name").attr("sliderName",_4); } _3.bind("_resize",function(e,_5){ if($(this).hasClass("easyui-fluid")||_5){ _6(_2); } return false; }); return _3; }; function _6(_7,_8){ var _9=$.data(_7,"slider"); var _a=_9.options; var _b=_9.slider; if(_8){ if(_8.width){ _a.width=_8.width; } if(_8.height){ _a.height=_8.height; } } _b._size(_a); if(_a.mode=="h"){ _b.css("height",""); _b.children("div").css("height",""); }else{ _b.css("width",""); _b.children("div").css("width",""); _b.children("div.slider-rule,div.slider-rulelabel,div.slider-inner")._outerHeight(_b._outerHeight()); } _c(_7); }; function _d(_e){ var _f=$.data(_e,"slider"); var _10=_f.options; var _11=_f.slider; var aa=_10.mode=="h"?_10.rule:_10.rule.slice(0).reverse(); if(_10.reversed){ aa=aa.slice(0).reverse(); } _12(aa); function _12(aa){ var _13=_11.find("div.slider-rule"); var _14=_11.find("div.slider-rulelabel"); _13.empty(); _14.empty(); for(var i=0;i").appendTo(_13); _16.css((_10.mode=="h"?"left":"top"),_15); if(aa[i]!="|"){ _16=$("").appendTo(_14); _16.html(aa[i]); if(_10.mode=="h"){ _16.css({left:_15,marginLeft:-Math.round(_16.outerWidth()/2)}); }else{ _16.css({top:_15,marginTop:-Math.round(_16.outerHeight()/2)}); } } } }; }; function _17(_18){ var _19=$.data(_18,"slider"); var _1a=_19.options; var _1b=_19.slider; _1b.removeClass("slider-h slider-v slider-disabled"); _1b.addClass(_1a.mode=="h"?"slider-h":"slider-v"); _1b.addClass(_1a.disabled?"slider-disabled":""); var _1c=_1b.find(".slider-inner"); _1c.html(""+""); if(_1a.range){ _1c.append(""+""); } _1b.find("a.slider-handle").draggable({axis:_1a.mode,cursor:"pointer",disabled:_1a.disabled,onDrag:function(e){ var _1d=e.data.left; var _1e=_1b.width(); if(_1a.mode!="h"){ _1d=e.data.top; _1e=_1b.height(); } if(_1d<0||_1d>_1e){ return false; }else{ _1f(_1d,this); return false; } },onStartDrag:function(){ _19.isDragging=true; _1a.onSlideStart.call(_18,_1a.value); },onStopDrag:function(e){ _1f(_1a.mode=="h"?e.data.left:e.data.top,this); _1a.onSlideEnd.call(_18,_1a.value); _1a.onComplete.call(_18,_1a.value); _19.isDragging=false; }}); _1b.find("div.slider-inner").unbind(".slider").bind("mousedown.slider",function(e){ if(_19.isDragging||_1a.disabled){ return; } var pos=$(this).offset(); _1f(_1a.mode=="h"?(e.pageX-pos.left):(e.pageY-pos.top)); _1a.onComplete.call(_18,_1a.value); }); function _1f(pos,_20){ var _21=_22(_18,pos); var s=Math.abs(_21%_1a.step); if(s<_1a.step/2){ _21-=s; }else{ _21=_21-s+_1a.step; } if(_1a.range){ var v1=_1a.value[0]; var v2=_1a.value[1]; var m=parseFloat((v1+v2)/2); if(_20){ var _23=$(_20).nextAll(".slider-handle").length>0; if(_21<=v2&&_23){ v1=_21; }else{ if(_21>=v1&&(!_23)){ v2=_21; } } }else{ if(_21v2){ v2=_21; }else{ _21_28.max){ _2d=_28.max; } var _2e=$("").appendTo(_29); _2e.attr("name",_2c); _2e.val(_2d); _2b.push(_2d); var _2f=_29.find(".slider-handle:eq("+i+")"); var tip=_2f.next(); var pos=_30(_25,_2d); if(_28.showTip){ tip.show(); tip.html(_28.tipFormatter.call(_25,_2d)); }else{ tip.hide(); } if(_28.mode=="h"){ var _31="left:"+pos+"px;"; _2f.attr("style",_31); tip.attr("style",_31+"margin-left:"+(-Math.round(tip.outerWidth()/2))+"px"); }else{ var _31="top:"+pos+"px;"; _2f.attr("style",_31); tip.attr("style",_31+"margin-left:"+(-Math.round(tip.outerWidth()))+"px"); } } _28.value=_28.range?_2b:_2b[0]; $(_25).val(_28.range?_2b.join(_28.separator):_2b[0]); if(_2a.join(",")!=_2b.join(",")){ _28.onChange.call(_25,_28.value,(_28.range?_2a:_2a[0])); } }; function _c(_32){ var _33=$.data(_32,"slider").options; var fn=_33.onChange; _33.onChange=function(){ }; _24(_32,_33.value); _33.onChange=fn; }; function _30(_34,_35){ var _36=$.data(_34,"slider"); var _37=_36.options; var _38=_36.slider; var _39=_37.mode=="h"?_38.width():_38.height(); var pos=_37.converter.toPosition.call(_34,_35,_39); if(_37.mode=="v"){ pos=_38.height()-pos; } if(_37.reversed){ pos=_39-pos; } return pos.toFixed(0); }; function _22(_3a,pos){ var _3b=$.data(_3a,"slider"); var _3c=_3b.options; var _3d=_3b.slider; var _3e=_3c.mode=="h"?_3d.width():_3d.height(); var pos=_3c.mode=="h"?(_3c.reversed?(_3e-pos):pos):(_3c.reversed?pos:(_3e-pos)); var _3f=_3c.converter.toValue.call(_3a,pos,_3e); return _3f.toFixed(0); }; $.fn.slider=function(_40,_41){ if(typeof _40=="string"){ return $.fn.slider.methods[_40](this,_41); } _40=_40||{}; return this.each(function(){ var _42=$.data(this,"slider"); if(_42){ $.extend(_42.options,_40); }else{ _42=$.data(this,"slider",{options:$.extend({},$.fn.slider.defaults,$.fn.slider.parseOptions(this),_40),slider:_1(this)}); $(this).removeAttr("disabled"); } var _43=_42.options; _43.min=parseFloat(_43.min); _43.max=parseFloat(_43.max); if(_43.range){ if(!$.isArray(_43.value)){ _43.value=$.map(String(_43.value).split(_43.separator),function(v){ return parseFloat(v); }); } if(_43.value.length<2){ _43.value.push(_43.max); } }else{ _43.value=parseFloat(_43.value); } _43.step=parseFloat(_43.step); _43.originalValue=_43.value; _17(this); _d(this); _6(this); }); }; $.fn.slider.methods={options:function(jq){ return $.data(jq[0],"slider").options; },destroy:function(jq){ return jq.each(function(){ $.data(this,"slider").slider.remove(); $(this).remove(); }); },resize:function(jq,_44){ return jq.each(function(){ _6(this,_44); }); },getValue:function(jq){ return jq.slider("options").value; },getValues:function(jq){ return jq.slider("options").value; },setValue:function(jq,_45){ return jq.each(function(){ _24(this,[_45]); }); },setValues:function(jq,_46){ return jq.each(function(){ _24(this,_46); }); },clear:function(jq){ return jq.each(function(){ var _47=$(this).slider("options"); _24(this,_47.range?[_47.min,_47.max]:[_47.min]); }); },reset:function(jq){ return jq.each(function(){ var _48=$(this).slider("options"); $(this).slider(_48.range?"setValues":"setValue",_48.originalValue); }); },enable:function(jq){ return jq.each(function(){ $.data(this,"slider").options.disabled=false; _17(this); }); },disable:function(jq){ return jq.each(function(){ $.data(this,"slider").options.disabled=true; _17(this); }); }}; $.fn.slider.parseOptions=function(_49){ var t=$(_49); return $.extend({},$.parser.parseOptions(_49,["width","height","mode",{reversed:"boolean",showTip:"boolean",range:"boolean",min:"number",max:"number",step:"number"}]),{value:(t.val()||undefined),disabled:(t.attr("disabled")?true:undefined),rule:(t.attr("rule")?eval(t.attr("rule")):undefined)}); }; $.fn.slider.defaults={width:"auto",height:"auto",mode:"h",reversed:false,showTip:false,disabled:false,range:false,value:0,separator:",",min:0,max:100,step:1,rule:[],tipFormatter:function(_4a){ return _4a; },converter:{toPosition:function(_4b,_4c){ var _4d=$(this).slider("options"); return (_4b-_4d.min)/(_4d.max-_4d.min)*_4c; },toValue:function(pos,_4e){ var _4f=$(this).slider("options"); return _4f.min+(_4f.max-_4f.min)*(pos/_4e); }},onChange:function(_50,_51){ },onSlideStart:function(_52){ },onSlideEnd:function(_53){ },onComplete:function(_54){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.spinner.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"spinner"); var _4=_3.options; var _5=$.extend(true,[],_4.icons); if(_4.spinAlign=="left"||_4.spinAlign=="right"){ _4.spinArrow=true; _4.iconAlign=_4.spinAlign; var _6={iconCls:"spinner-arrow",handler:function(e){ var _7=$(e.target).closest(".spinner-arrow-up,.spinner-arrow-down"); _13(e.data.target,_7.hasClass("spinner-arrow-down")); }}; if(_4.spinAlign=="left"){ _5.unshift(_6); }else{ _5.push(_6); } }else{ _4.spinArrow=false; if(_4.spinAlign=="vertical"){ if(_4.buttonAlign!="top"){ _4.buttonAlign="bottom"; } _4.clsLeft="textbox-button-bottom"; _4.clsRight="textbox-button-top"; }else{ _4.clsLeft="textbox-button-left"; _4.clsRight="textbox-button-right"; } } $(_2).addClass("spinner-f").textbox($.extend({},_4,{icons:_5,doSize:false,onResize:function(_8,_9){ if(!_4.spinArrow){ var _a=$(this).next(); var _b=_a.find(".textbox-button:not(.spinner-button)"); if(_b.length){ var _c=_b.outerWidth(); var _d=_b.outerHeight(); var _e=_a.find(".spinner-button."+_4.clsLeft); var _f=_a.find(".spinner-button."+_4.clsRight); if(_4.buttonAlign=="right"){ _f.css("marginRight",_c+"px"); }else{ if(_4.buttonAlign=="left"){ _e.css("marginLeft",_c+"px"); }else{ if(_4.buttonAlign=="top"){ _f.css("marginTop",_d+"px"); }else{ _e.css("marginBottom",_d+"px"); } } } } } _4.onResize.call(this,_8,_9); }})); $(_2).attr("spinnerName",$(_2).attr("textboxName")); _3.spinner=$(_2).next(); _3.spinner.addClass("spinner"); if(_4.spinArrow){ var _10=_3.spinner.find(".spinner-arrow"); _10.append(""); _10.append(""); }else{ var _11=$("").addClass(_4.clsLeft).appendTo(_3.spinner); var _12=$("").addClass(_4.clsRight).appendTo(_3.spinner); _11.linkbutton({iconCls:_4.reversed?"spinner-button-up":"spinner-button-down",onClick:function(){ _13(_2,!_4.reversed); }}); _12.linkbutton({iconCls:_4.reversed?"spinner-button-down":"spinner-button-up",onClick:function(){ _13(_2,_4.reversed); }}); if(_4.disabled){ $(_2).spinner("disable"); } if(_4.readonly){ $(_2).spinner("readonly"); } } $(_2).spinner("resize"); }; function _13(_14,_15){ var _16=$(_14).spinner("options"); _16.spin.call(_14,_15); _16[_15?"onSpinDown":"onSpinUp"].call(_14); $(_14).spinner("validate"); }; $.fn.spinner=function(_17,_18){ if(typeof _17=="string"){ var _19=$.fn.spinner.methods[_17]; if(_19){ return _19(this,_18); }else{ return this.textbox(_17,_18); } } _17=_17||{}; return this.each(function(){ var _1a=$.data(this,"spinner"); if(_1a){ $.extend(_1a.options,_17); }else{ _1a=$.data(this,"spinner",{options:$.extend({},$.fn.spinner.defaults,$.fn.spinner.parseOptions(this),_17)}); } _1(this); }); }; $.fn.spinner.methods={options:function(jq){ var _1b=jq.textbox("options"); return $.extend($.data(jq[0],"spinner").options,{width:_1b.width,value:_1b.value,originalValue:_1b.originalValue,disabled:_1b.disabled,readonly:_1b.readonly}); }}; $.fn.spinner.parseOptions=function(_1c){ return $.extend({},$.fn.textbox.parseOptions(_1c),$.parser.parseOptions(_1c,["min","max","spinAlign",{increment:"number",reversed:"boolean"}])); }; $.fn.spinner.defaults=$.extend({},$.fn.textbox.defaults,{min:null,max:null,increment:1,spinAlign:"right",reversed:false,spin:function(_1d){ },onSpinUp:function(){ },onSpinDown:function(){ }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.splitbutton.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"splitbutton").options; $(_2).menubutton(_3); $(_2).addClass("s-btn"); }; $.fn.splitbutton=function(_4,_5){ if(typeof _4=="string"){ var _6=$.fn.splitbutton.methods[_4]; if(_6){ return _6(this,_5); }else{ return this.menubutton(_4,_5); } } _4=_4||{}; return this.each(function(){ var _7=$.data(this,"splitbutton"); if(_7){ $.extend(_7.options,_4); }else{ $.data(this,"splitbutton",{options:$.extend({},$.fn.splitbutton.defaults,$.fn.splitbutton.parseOptions(this),_4)}); $(this).removeAttr("disabled"); } _1(this); }); }; $.fn.splitbutton.methods={options:function(jq){ var _8=jq.menubutton("options"); var _9=$.data(jq[0],"splitbutton").options; $.extend(_9,{disabled:_8.disabled,toggle:_8.toggle,selected:_8.selected}); return _9; }}; $.fn.splitbutton.parseOptions=function(_a){ var t=$(_a); return $.extend({},$.fn.linkbutton.parseOptions(_a),$.parser.parseOptions(_a,["menu",{plain:"boolean",duration:"number"}])); }; $.fn.splitbutton.defaults=$.extend({},$.fn.linkbutton.defaults,{plain:true,menu:null,duration:100,cls:{btn1:"m-btn-active s-btn-active",btn2:"m-btn-plain-active s-btn-plain-active",arrow:"m-btn-downarrow",trigger:"m-btn-line"}}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.switchbutton.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$(""+""+""+""+""+""+""+"").insertAfter(_2); var t=$(_2); t.addClass("switchbutton-f").hide(); var _4=t.attr("name"); if(_4){ t.removeAttr("name").attr("switchbuttonName",_4); _3.find(".switchbutton-value").attr("name",_4); } _3.bind("_resize",function(e,_5){ if($(this).hasClass("easyui-fluid")||_5){ _6(_2); } return false; }); return _3; }; function _6(_7,_8){ var _9=$.data(_7,"switchbutton"); var _a=_9.options; var _b=_9.switchbutton; if(_8){ $.extend(_a,_8); } var _c=_b.is(":visible"); if(!_c){ _b.appendTo("body"); } _b._size(_a); var w=_b.width(); var h=_b.height(); var w=_b.outerWidth(); var h=_b.outerHeight(); var _d=parseInt(_a.handleWidth)||_b.height(); var _e=w*2-_d; _b.find(".switchbutton-inner").css({width:_e+"px",height:h+"px",lineHeight:h+"px"}); _b.find(".switchbutton-handle")._outerWidth(_d)._outerHeight(h).css({marginLeft:-_d/2+"px"}); _b.find(".switchbutton-on").css({width:(w-_d/2)+"px",textIndent:(_a.reversed?"":"-")+_d/2+"px"}); _b.find(".switchbutton-off").css({width:(w-_d/2)+"px",textIndent:(_a.reversed?"-":"")+_d/2+"px"}); _a.marginWidth=w-_d; _f(_7,_a.checked,false); if(!_c){ _b.insertAfter(_7); } }; function _10(_11){ var _12=$.data(_11,"switchbutton"); var _13=_12.options; var _14=_12.switchbutton; var _15=_14.find(".switchbutton-inner"); var on=_15.find(".switchbutton-on").html(_13.onText); var off=_15.find(".switchbutton-off").html(_13.offText); var _16=_15.find(".switchbutton-handle").html(_13.handleText); if(_13.reversed){ off.prependTo(_15); on.insertAfter(_16); }else{ on.prependTo(_15); off.insertAfter(_16); } _14.find(".switchbutton-value")._propAttr("checked",_13.checked); _14.removeClass("switchbutton-disabled").addClass(_13.disabled?"switchbutton-disabled":""); _14.removeClass("switchbutton-reversed").addClass(_13.reversed?"switchbutton-reversed":""); _f(_11,_13.checked); _17(_11,_13.readonly); $(_11).switchbutton("setValue",_13.value); }; function _f(_18,_19,_1a){ var _1b=$.data(_18,"switchbutton"); var _1c=_1b.options; _1c.checked=_19; var _1d=_1b.switchbutton.find(".switchbutton-inner"); var _1e=_1d.find(".switchbutton-on"); var _1f=_1c.reversed?(_1c.checked?_1c.marginWidth:0):(_1c.checked?0:_1c.marginWidth); var dir=_1e.css("float").toLowerCase(); var css={}; css["margin-"+dir]=-_1f+"px"; _1a?_1d.animate(css,200):_1d.css(css); var _20=_1d.find(".switchbutton-value"); var ck=_20.is(":checked"); $(_18).add(_20)._propAttr("checked",_1c.checked); if(ck!=_1c.checked){ _1c.onChange.call(_18,_1c.checked); } }; function _21(_22,_23){ var _24=$.data(_22,"switchbutton"); var _25=_24.options; var _26=_24.switchbutton; var _27=_26.find(".switchbutton-value"); if(_23){ _25.disabled=true; $(_22).add(_27).attr("disabled","disabled"); _26.addClass("switchbutton-disabled"); }else{ _25.disabled=false; $(_22).add(_27).removeAttr("disabled"); _26.removeClass("switchbutton-disabled"); } }; function _17(_28,_29){ var _2a=$.data(_28,"switchbutton"); var _2b=_2a.options; _2b.readonly=_29==undefined?true:_29; _2a.switchbutton.removeClass("switchbutton-readonly").addClass(_2b.readonly?"switchbutton-readonly":""); }; function _2c(_2d){ var _2e=$.data(_2d,"switchbutton"); var _2f=_2e.options; _2e.switchbutton.unbind(".switchbutton").bind("click.switchbutton",function(){ if(!_2f.disabled&&!_2f.readonly){ _f(_2d,_2f.checked?false:true,true); } }); }; $.fn.switchbutton=function(_30,_31){ if(typeof _30=="string"){ return $.fn.switchbutton.methods[_30](this,_31); } _30=_30||{}; return this.each(function(){ var _32=$.data(this,"switchbutton"); if(_32){ $.extend(_32.options,_30); }else{ _32=$.data(this,"switchbutton",{options:$.extend({},$.fn.switchbutton.defaults,$.fn.switchbutton.parseOptions(this),_30),switchbutton:_1(this)}); } _32.options.originalChecked=_32.options.checked; _10(this); _6(this); _2c(this); }); }; $.fn.switchbutton.methods={options:function(jq){ var _33=jq.data("switchbutton"); return $.extend(_33.options,{value:_33.switchbutton.find(".switchbutton-value").val()}); },resize:function(jq,_34){ return jq.each(function(){ _6(this,_34); }); },enable:function(jq){ return jq.each(function(){ _21(this,false); }); },disable:function(jq){ return jq.each(function(){ _21(this,true); }); },readonly:function(jq,_35){ return jq.each(function(){ _17(this,_35); }); },check:function(jq){ return jq.each(function(){ _f(this,true); }); },uncheck:function(jq){ return jq.each(function(){ _f(this,false); }); },clear:function(jq){ return jq.each(function(){ _f(this,false); }); },reset:function(jq){ return jq.each(function(){ var _36=$(this).switchbutton("options"); _f(this,_36.originalChecked); }); },setValue:function(jq,_37){ return jq.each(function(){ $(this).val(_37); $.data(this,"switchbutton").switchbutton.find(".switchbutton-value").val(_37); }); }}; $.fn.switchbutton.parseOptions=function(_38){ var t=$(_38); return $.extend({},$.parser.parseOptions(_38,["onText","offText","handleText",{handleWidth:"number",reversed:"boolean"}]),{value:(t.val()||undefined),checked:(t.attr("checked")?true:undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)}); }; $.fn.switchbutton.defaults={handleWidth:"auto",width:60,height:26,checked:false,disabled:false,readonly:false,reversed:false,onText:"ON",offText:"OFF",handleText:"",value:"on",onChange:function(_39){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.tabs.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(c){ var w=0; $(c).children().each(function(){ w+=$(this).outerWidth(true); }); return w; }; function _2(_3){ var _4=$.data(_3,"tabs").options; if(_4.tabPosition=="left"||_4.tabPosition=="right"||!_4.showHeader){ return; } var _5=$(_3).children("div.tabs-header"); var _6=_5.children("div.tabs-tool:not(.tabs-tool-hidden)"); var _7=_5.children("div.tabs-scroller-left"); var _8=_5.children("div.tabs-scroller-right"); var _9=_5.children("div.tabs-wrap"); var _a=_5.outerHeight(); if(_4.plain){ _a-=_a-_5.height(); } _6._outerHeight(_a); var _b=_1(_5.find("ul.tabs")); var _c=_5.width()-_6._outerWidth(); if(_b>_c){ _7.add(_8).show()._outerHeight(_a); if(_4.toolPosition=="left"){ _6.css({left:_7.outerWidth(),right:""}); _9.css({marginLeft:_7.outerWidth()+_6._outerWidth(),marginRight:_8._outerWidth(),width:_c-_7.outerWidth()-_8.outerWidth()}); }else{ _6.css({left:"",right:_8.outerWidth()}); _9.css({marginLeft:_7.outerWidth(),marginRight:_8.outerWidth()+_6._outerWidth(),width:_c-_7.outerWidth()-_8.outerWidth()}); } }else{ _7.add(_8).hide(); if(_4.toolPosition=="left"){ _6.css({left:0,right:""}); _9.css({marginLeft:_6._outerWidth(),marginRight:0,width:_c}); }else{ _6.css({left:"",right:0}); _9.css({marginLeft:0,marginRight:_6._outerWidth(),width:_c}); } } }; function _d(_e){ var _f=$.data(_e,"tabs").options; var _10=$(_e).children("div.tabs-header"); if(_f.tools){ if(typeof _f.tools=="string"){ $(_f.tools).addClass("tabs-tool").appendTo(_10); $(_f.tools).show(); }else{ _10.children("div.tabs-tool").remove(); var _11=$("
    ").appendTo(_10); var tr=_11.find("tr"); for(var i=0;i<_f.tools.length;i++){ var td=$("").appendTo(tr); var _12=$("").appendTo(td); _12[0].onclick=eval(_f.tools[i].handler||function(){ }); _12.linkbutton($.extend({},_f.tools[i],{plain:true})); } } }else{ _10.children("div.tabs-tool").remove(); } }; function _13(_14,_15){ var _16=$.data(_14,"tabs"); var _17=_16.options; var cc=$(_14); if(!_17.doSize){ return; } if(_15){ $.extend(_17,{width:_15.width,height:_15.height}); } cc._size(_17); var _18=cc.children("div.tabs-header"); var _19=cc.children("div.tabs-panels"); var _1a=_18.find("div.tabs-wrap"); var ul=_1a.find(".tabs"); ul.children("li").removeClass("tabs-first tabs-last"); ul.children("li:first").addClass("tabs-first"); ul.children("li:last").addClass("tabs-last"); if(_17.tabPosition=="left"||_17.tabPosition=="right"){ _18._outerWidth(_17.showHeader?_17.headerWidth:0); _19._outerWidth(cc.width()-_18.outerWidth()); _18.add(_19)._size("height",isNaN(parseInt(_17.height))?"":cc.height()); _1a._outerWidth(_18.width()); ul._outerWidth(_1a.width()).css("height",""); }else{ _18.children("div.tabs-scroller-left,div.tabs-scroller-right,div.tabs-tool:not(.tabs-tool-hidden)").css("display",_17.showHeader?"block":"none"); _18._outerWidth(cc.width()).css("height",""); if(_17.showHeader){ _18.css("background-color",""); _1a.css("height",""); }else{ _18.css("background-color","transparent"); _18._outerHeight(0); _1a._outerHeight(0); } ul._outerHeight(_17.tabHeight).css("width",""); ul._outerHeight(ul.outerHeight()-ul.height()-1+_17.tabHeight).css("width",""); _19._size("height",isNaN(parseInt(_17.height))?"":(cc.height()-_18.outerHeight())); _19._size("width",cc.width()); } if(_16.tabs.length){ var d1=ul.outerWidth(true)-ul.width(); var li=ul.children("li:first"); var d2=li.outerWidth(true)-li.width(); var _1b=_18.width()-_18.children(".tabs-tool:not(.tabs-tool-hidden)")._outerWidth(); var _1c=Math.floor((_1b-d1-d2*_16.tabs.length)/_16.tabs.length); $.map(_16.tabs,function(p){ _1d(p,(_17.justified&&$.inArray(_17.tabPosition,["top","bottom"])>=0)?_1c:undefined); }); if(_17.justified&&$.inArray(_17.tabPosition,["top","bottom"])>=0){ var _1e=_1b-d1-_1(ul); _1d(_16.tabs[_16.tabs.length-1],_1c+_1e); } } _2(_14); function _1d(p,_1f){ var _20=p.panel("options"); var p_t=_20.tab.find("a.tabs-inner"); var _1f=_1f?_1f:(parseInt(_20.tabWidth||_17.tabWidth||undefined)); if(_1f){ p_t._outerWidth(_1f); }else{ p_t.css("width",""); } p_t._outerHeight(_17.tabHeight); p_t.css("lineHeight",p_t.height()+"px"); p_t.find(".easyui-fluid:visible").triggerHandler("_resize"); }; }; function _21(_22){ var _23=$.data(_22,"tabs").options; var tab=_24(_22); if(tab){ var _25=$(_22).children("div.tabs-panels"); var _26=_23.width=="auto"?"auto":_25.width(); var _27=_23.height=="auto"?"auto":_25.height(); tab.panel("resize",{width:_26,height:_27}); } }; function _28(_29){ var _2a=$.data(_29,"tabs").tabs; var cc=$(_29).addClass("tabs-container"); var _2b=$("
    ").insertBefore(cc); cc.children("div").each(function(){ _2b[0].appendChild(this); }); cc[0].appendChild(_2b[0]); $("
    "+"
    "+"
    "+"
    "+"
      "+"
      "+"
      ").prependTo(_29); cc.children("div.tabs-panels").children("div").each(function(i){ var _2c=$.extend({},$.parser.parseOptions(this),{disabled:($(this).attr("disabled")?true:undefined),selected:($(this).attr("selected")?true:undefined)}); _3c(_29,_2c,$(this)); }); cc.children("div.tabs-header").find(".tabs-scroller-left, .tabs-scroller-right").hover(function(){ $(this).addClass("tabs-scroller-over"); },function(){ $(this).removeClass("tabs-scroller-over"); }); cc.bind("_resize",function(e,_2d){ if($(this).hasClass("easyui-fluid")||_2d){ _13(_29); _21(_29); } return false; }); }; function _2e(_2f){ var _30=$.data(_2f,"tabs"); var _31=_30.options; $(_2f).children("div.tabs-header").unbind().bind("click",function(e){ if($(e.target).hasClass("tabs-scroller-left")){ $(_2f).tabs("scrollBy",-_31.scrollIncrement); }else{ if($(e.target).hasClass("tabs-scroller-right")){ $(_2f).tabs("scrollBy",_31.scrollIncrement); }else{ var li=$(e.target).closest("li"); if(li.hasClass("tabs-disabled")){ return false; } var a=$(e.target).closest("a.tabs-close"); if(a.length){ _5a(_2f,_32(li)); }else{ if(li.length){ var _33=_32(li); var _34=_30.tabs[_33].panel("options"); if(_34.collapsible){ _34.closed?_50(_2f,_33):_75(_2f,_33); }else{ _50(_2f,_33); } } } return false; } } }).bind("contextmenu",function(e){ var li=$(e.target).closest("li"); if(li.hasClass("tabs-disabled")){ return; } if(li.length){ _31.onContextMenu.call(_2f,e,li.find("span.tabs-title").html(),_32(li)); } }); function _32(li){ var _35=0; li.parent().children("li").each(function(i){ if(li[0]==this){ _35=i; return false; } }); return _35; }; }; function _36(_37){ var _38=$.data(_37,"tabs").options; var _39=$(_37).children("div.tabs-header"); var _3a=$(_37).children("div.tabs-panels"); _39.removeClass("tabs-header-top tabs-header-bottom tabs-header-left tabs-header-right"); _3a.removeClass("tabs-panels-top tabs-panels-bottom tabs-panels-left tabs-panels-right"); if(_38.tabPosition=="top"){ _39.insertBefore(_3a); }else{ if(_38.tabPosition=="bottom"){ _39.insertAfter(_3a); _39.addClass("tabs-header-bottom"); _3a.addClass("tabs-panels-top"); }else{ if(_38.tabPosition=="left"){ _39.addClass("tabs-header-left"); _3a.addClass("tabs-panels-right"); }else{ if(_38.tabPosition=="right"){ _39.addClass("tabs-header-right"); _3a.addClass("tabs-panels-left"); } } } } if(_38.plain==true){ _39.addClass("tabs-header-plain"); }else{ _39.removeClass("tabs-header-plain"); } _39.removeClass("tabs-header-narrow").addClass(_38.narrow?"tabs-header-narrow":""); var _3b=_39.find(".tabs"); _3b.removeClass("tabs-pill").addClass(_38.pill?"tabs-pill":""); _3b.removeClass("tabs-narrow").addClass(_38.narrow?"tabs-narrow":""); _3b.removeClass("tabs-justified").addClass(_38.justified?"tabs-justified":""); if(_38.border==true){ _39.removeClass("tabs-header-noborder"); _3a.removeClass("tabs-panels-noborder"); }else{ _39.addClass("tabs-header-noborder"); _3a.addClass("tabs-panels-noborder"); } _38.doSize=true; }; function _3c(_3d,_3e,pp){ _3e=_3e||{}; var _3f=$.data(_3d,"tabs"); var _40=_3f.tabs; if(_3e.index==undefined||_3e.index>_40.length){ _3e.index=_40.length; } if(_3e.index<0){ _3e.index=0; } var ul=$(_3d).children("div.tabs-header").find("ul.tabs"); var _41=$(_3d).children("div.tabs-panels"); var tab=$("
    • "+""+""+""+""+"
    • "); if(!pp){ pp=$("
      "); } if(_3e.index>=_40.length){ tab.appendTo(ul); pp.appendTo(_41); _40.push(pp); }else{ tab.insertBefore(ul.children("li:eq("+_3e.index+")")); pp.insertBefore(_41.children("div.panel:eq("+_3e.index+")")); _40.splice(_3e.index,0,pp); } pp.panel($.extend({},_3e,{tab:tab,border:false,noheader:true,closed:true,doSize:false,iconCls:(_3e.icon?_3e.icon:undefined),onLoad:function(){ if(_3e.onLoad){ _3e.onLoad.call(this,arguments); } _3f.options.onLoad.call(_3d,$(this)); },onBeforeOpen:function(){ if(_3e.onBeforeOpen){ if(_3e.onBeforeOpen.call(this)==false){ return false; } } var p=$(_3d).tabs("getSelected"); if(p){ if(p[0]!=this){ $(_3d).tabs("unselect",_4a(_3d,p)); p=$(_3d).tabs("getSelected"); if(p){ return false; } }else{ _21(_3d); return false; } } var _42=$(this).panel("options"); _42.tab.addClass("tabs-selected"); var _43=$(_3d).find(">div.tabs-header>div.tabs-wrap"); var _44=_42.tab.position().left; var _45=_44+_42.tab.outerWidth(); if(_44<0||_45>_43.width()){ var _46=_44-(_43.width()-_42.tab.width())/2; $(_3d).tabs("scrollBy",_46); }else{ $(_3d).tabs("scrollBy",0); } var _47=$(this).panel("panel"); _47.css("display","block"); _21(_3d); _47.css("display","none"); },onOpen:function(){ if(_3e.onOpen){ _3e.onOpen.call(this); } var _48=$(this).panel("options"); _3f.selectHis.push(_48.title); _3f.options.onSelect.call(_3d,_48.title,_4a(_3d,this)); },onBeforeClose:function(){ if(_3e.onBeforeClose){ if(_3e.onBeforeClose.call(this)==false){ return false; } } $(this).panel("options").tab.removeClass("tabs-selected"); },onClose:function(){ if(_3e.onClose){ _3e.onClose.call(this); } var _49=$(this).panel("options"); _3f.options.onUnselect.call(_3d,_49.title,_4a(_3d,this)); }})); $(_3d).tabs("update",{tab:pp,options:pp.panel("options"),type:"header"}); }; function _4b(_4c,_4d){ var _4e=$.data(_4c,"tabs"); var _4f=_4e.options; if(_4d.selected==undefined){ _4d.selected=true; } _3c(_4c,_4d); _4f.onAdd.call(_4c,_4d.title,_4d.index); if(_4d.selected){ _50(_4c,_4d.index); } }; function _51(_52,_53){ _53.type=_53.type||"all"; var _54=$.data(_52,"tabs").selectHis; var pp=_53.tab; var _55=pp.panel("options"); var _56=_55.title; $.extend(_55,_53.options,{iconCls:(_53.options.icon?_53.options.icon:undefined)}); if(_53.type=="all"||_53.type=="body"){ pp.panel(); } if(_53.type=="all"||_53.type=="header"){ var tab=_55.tab; if(_55.header){ tab.find(".tabs-inner").html($(_55.header)); }else{ var _57=tab.find("span.tabs-title"); var _58=tab.find("span.tabs-icon"); _57.html(_55.title); _58.attr("class","tabs-icon"); tab.find("a.tabs-close").remove(); if(_55.closable){ _57.addClass("tabs-closable"); $("").appendTo(tab); }else{ _57.removeClass("tabs-closable"); } if(_55.iconCls){ _57.addClass("tabs-with-icon"); _58.addClass(_55.iconCls); }else{ _57.removeClass("tabs-with-icon"); } if(_55.tools){ var _59=tab.find("span.tabs-p-tool"); if(!_59.length){ var _59=$("").insertAfter(tab.find("a.tabs-inner")); } if($.isArray(_55.tools)){ _59.empty(); for(var i=0;i<_55.tools.length;i++){ var t=$("").appendTo(_59); t.addClass(_55.tools[i].iconCls); if(_55.tools[i].handler){ t.bind("click",{handler:_55.tools[i].handler},function(e){ if($(this).parents("li").hasClass("tabs-disabled")){ return; } e.data.handler.call(this); }); } } }else{ $(_55.tools).children().appendTo(_59); } var pr=_59.children().length*12; if(_55.closable){ pr+=8; _59.css("right",""); }else{ pr-=3; _59.css("right","5px"); } _57.css("padding-right",pr+"px"); }else{ tab.find("span.tabs-p-tool").remove(); _57.css("padding-right",""); } } if(_56!=_55.title){ for(var i=0;i<_54.length;i++){ if(_54[i]==_56){ _54[i]=_55.title; } } } } if(_55.disabled){ _55.tab.addClass("tabs-disabled"); }else{ _55.tab.removeClass("tabs-disabled"); } _13(_52); $.data(_52,"tabs").options.onUpdate.call(_52,_55.title,_4a(_52,pp)); }; function _5a(_5b,_5c){ var _5d=$.data(_5b,"tabs").options; var _5e=$.data(_5b,"tabs").tabs; var _5f=$.data(_5b,"tabs").selectHis; if(!_60(_5b,_5c)){ return; } var tab=_61(_5b,_5c); var _62=tab.panel("options").title; var _63=_4a(_5b,tab); if(_5d.onBeforeClose.call(_5b,_62,_63)==false){ return; } var tab=_61(_5b,_5c,true); tab.panel("options").tab.remove(); tab.panel("destroy"); _5d.onClose.call(_5b,_62,_63); _13(_5b); for(var i=0;i<_5f.length;i++){ if(_5f[i]==_62){ _5f.splice(i,1); i--; } } var _64=_5f.pop(); if(_64){ _50(_5b,_64); }else{ if(_5e.length){ _50(_5b,0); } } }; function _61(_65,_66,_67){ var _68=$.data(_65,"tabs").tabs; var tab=null; if(typeof _66=="number"){ if(_66>=0&&_66<_68.length){ tab=_68[_66]; if(_67){ _68.splice(_66,1); } } }else{ var tmp=$(""); for(var i=0;i<_68.length;i++){ var p=_68[i]; tmp.html(p.panel("options").title); if(tmp.text()==_66){ tab=p; if(_67){ _68.splice(i,1); } break; } } tmp.remove(); } return tab; }; function _4a(_69,tab){ var _6a=$.data(_69,"tabs").tabs; for(var i=0;i<_6a.length;i++){ if(_6a[i][0]==$(tab)[0]){ return i; } } return -1; }; function _24(_6b){ var _6c=$.data(_6b,"tabs").tabs; for(var i=0;i<_6c.length;i++){ var tab=_6c[i]; if(tab.panel("options").tab.hasClass("tabs-selected")){ return tab; } } return null; }; function _6d(_6e){ var _6f=$.data(_6e,"tabs"); var _70=_6f.tabs; for(var i=0;i<_70.length;i++){ var _71=_70[i].panel("options"); if(_71.selected&&!_71.disabled){ _50(_6e,i); return; } } _50(_6e,_6f.options.selected); }; function _50(_72,_73){ var p=_61(_72,_73); if(p&&!p.is(":visible")){ _74(_72); if(!p.panel("options").disabled){ p.panel("open"); } } }; function _75(_76,_77){ var p=_61(_76,_77); if(p&&p.is(":visible")){ _74(_76); p.panel("close"); } }; function _74(_78){ $(_78).children("div.tabs-panels").each(function(){ $(this).stop(true,true); }); }; function _60(_79,_7a){ return _61(_79,_7a)!=null; }; function _7b(_7c,_7d){ var _7e=$.data(_7c,"tabs").options; _7e.showHeader=_7d; $(_7c).tabs("resize"); }; function _7f(_80,_81){ var _82=$(_80).find(">.tabs-header>.tabs-tool"); if(_81){ _82.removeClass("tabs-tool-hidden").show(); }else{ _82.addClass("tabs-tool-hidden").hide(); } $(_80).tabs("resize").tabs("scrollBy",0); }; $.fn.tabs=function(_83,_84){ if(typeof _83=="string"){ return $.fn.tabs.methods[_83](this,_84); } _83=_83||{}; return this.each(function(){ var _85=$.data(this,"tabs"); if(_85){ $.extend(_85.options,_83); }else{ $.data(this,"tabs",{options:$.extend({},$.fn.tabs.defaults,$.fn.tabs.parseOptions(this),_83),tabs:[],selectHis:[]}); _28(this); } _d(this); _36(this); _13(this); _2e(this); _6d(this); }); }; $.fn.tabs.methods={options:function(jq){ var cc=jq[0]; var _86=$.data(cc,"tabs").options; var s=_24(cc); _86.selected=s?_4a(cc,s):-1; return _86; },tabs:function(jq){ return $.data(jq[0],"tabs").tabs; },resize:function(jq,_87){ return jq.each(function(){ _13(this,_87); _21(this); }); },add:function(jq,_88){ return jq.each(function(){ _4b(this,_88); }); },close:function(jq,_89){ return jq.each(function(){ _5a(this,_89); }); },getTab:function(jq,_8a){ return _61(jq[0],_8a); },getTabIndex:function(jq,tab){ return _4a(jq[0],tab); },getSelected:function(jq){ return _24(jq[0]); },select:function(jq,_8b){ return jq.each(function(){ _50(this,_8b); }); },unselect:function(jq,_8c){ return jq.each(function(){ _75(this,_8c); }); },exists:function(jq,_8d){ return _60(jq[0],_8d); },update:function(jq,_8e){ return jq.each(function(){ _51(this,_8e); }); },enableTab:function(jq,_8f){ return jq.each(function(){ var _90=$(this).tabs("getTab",_8f).panel("options"); _90.tab.removeClass("tabs-disabled"); _90.disabled=false; }); },disableTab:function(jq,_91){ return jq.each(function(){ var _92=$(this).tabs("getTab",_91).panel("options"); _92.tab.addClass("tabs-disabled"); _92.disabled=true; }); },showHeader:function(jq){ return jq.each(function(){ _7b(this,true); }); },hideHeader:function(jq){ return jq.each(function(){ _7b(this,false); }); },showTool:function(jq){ return jq.each(function(){ _7f(this,true); }); },hideTool:function(jq){ return jq.each(function(){ _7f(this,false); }); },scrollBy:function(jq,_93){ return jq.each(function(){ var _94=$(this).tabs("options"); var _95=$(this).find(">div.tabs-header>div.tabs-wrap"); var pos=Math.min(_95._scrollLeft()+_93,_96()); _95.animate({scrollLeft:pos},_94.scrollDuration); function _96(){ var w=0; var ul=_95.children("ul"); ul.children("li").each(function(){ w+=$(this).outerWidth(true); }); return w-_95.width()+(ul.outerWidth()-ul.width()); }; }); }}; $.fn.tabs.parseOptions=function(_97){ return $.extend({},$.parser.parseOptions(_97,["tools","toolPosition","tabPosition",{fit:"boolean",border:"boolean",plain:"boolean"},{headerWidth:"number",tabWidth:"number",tabHeight:"number",selected:"number"},{showHeader:"boolean",justified:"boolean",narrow:"boolean",pill:"boolean"}])); }; $.fn.tabs.defaults={width:"auto",height:"auto",headerWidth:150,tabWidth:"auto",tabHeight:27,selected:0,showHeader:true,plain:false,fit:false,border:true,justified:false,narrow:false,pill:false,tools:null,toolPosition:"right",tabPosition:"top",scrollIncrement:100,scrollDuration:400,onLoad:function(_98){ },onSelect:function(_99,_9a){ },onUnselect:function(_9b,_9c){ },onBeforeClose:function(_9d,_9e){ },onClose:function(_9f,_a0){ },onAdd:function(_a1,_a2){ },onUpdate:function(_a3,_a4){ },onContextMenu:function(e,_a5,_a6){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.tagbox.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"tagbox"); var _4=_3.options; $(_2).addClass("tagbox-f").combobox($.extend({},_4,{cls:"tagbox",reversed:true,onChange:function(_5,_6){ _7(); $(this).combobox("hidePanel"); _4.onChange.call(_2,_5,_6); },onResizing:function(_8,_9){ var _a=$(this).combobox("textbox"); var tb=$(this).data("textbox").textbox; tb.css({height:"",paddingLeft:_a.css("marginLeft"),paddingRight:_a.css("marginRight")}); _a.css("margin",0); tb._size({width:_4.width},$(this).parent()); _23(_2); _12(this); _4.onResizing.call(_2,_8,_9); },onLoadSuccess:function(_b){ _7(); _4.onLoadSuccess.call(_2,_b); }})); _7(); _23(_2); function _7(){ $(_2).next().find(".tagbox-label").remove(); var _c=$(_2).tagbox("textbox"); var ss=[]; $.map($(_2).tagbox("getValues"),function(_d,_e){ var _f=_4.finder.getRow(_2,_d); var _10=_4.tagFormatter.call(_2,_d,_f); var cs={}; var css=_4.tagStyler.call(_2,_d,_f)||""; if(typeof css=="string"){ cs={s:css}; }else{ cs={c:css["class"]||"",s:css["style"]||""}; } var _11=$("").insertBefore(_c).html(_10); _11.attr("tagbox-index",_e); _11.attr("style",cs.s).addClass(cs.c); $("").appendTo(_11); }); _12(_2); $(_2).combobox("setText",""); }; }; function _12(_13,_14){ var _15=$(_13).next(); var _16=_14?$(_14):_15.find(".tagbox-label"); if(_16.length){ var _17=$(_13).tagbox("textbox"); var _18=$(_16[0]); var _19=_18.outerHeight(true)-_18.outerHeight(); var _1a=_17.outerHeight()-_19*2; _16.css({height:_1a+"px",lineHeight:_1a+"px"}); var _1b=_15.find(".textbox-addon").css("height","100%"); _1b.find(".textbox-icon").css("height","100%"); _15.find(".textbox-button").linkbutton("resize",{height:"100%"}); } }; function _1c(_1d){ var _1e=$(_1d).next(); _1e.unbind(".tagbox").bind("click.tagbox",function(e){ var _1f=$(_1d).tagbox("options"); if(_1f.disabled||_1f.readonly){ return; } if($(e.target).hasClass("tagbox-remove")){ var _20=parseInt($(e.target).parent().attr("tagbox-index")); var _21=$(_1d).tagbox("getValues"); if(_1f.onBeforeRemoveTag.call(_1d,_21[_20])==false){ return; } _1f.onRemoveTag.call(_1d,_21[_20]); _21.splice(_20,1); $(_1d).tagbox("setValues",_21); }else{ var _22=$(e.target).closest(".tagbox-label"); if(_22.length){ var _20=parseInt(_22.attr("tagbox-index")); var _21=$(_1d).tagbox("getValues"); _1f.onClickTag.call(_1d,_21[_20]); } } $(this).find(".textbox-text").focus(); }).bind("keyup.tagbox",function(e){ _23(_1d); }).bind("mouseover.tagbox",function(e){ if($(e.target).closest(".textbox-button,.textbox-addon,.tagbox-label").length){ $(this).triggerHandler("mouseleave"); }else{ $(this).find(".textbox-text").triggerHandler("mouseenter"); } }).bind("mouseleave.tagbox",function(e){ $(this).find(".textbox-text").triggerHandler("mouseleave"); }); }; function _23(_24){ var _25=$(_24).tagbox("options"); var _26=$(_24).tagbox("textbox"); var _27=$(_24).next(); var tmp=$("").appendTo("body"); tmp.attr("style",_26.attr("style")); tmp.css({position:"absolute",top:-9999,left:-9999,width:"auto",fontFamily:_26.css("fontFamily"),fontSize:_26.css("fontSize"),fontWeight:_26.css("fontWeight"),whiteSpace:"nowrap"}); var _28=_29(_26.val()); var _2a=_29(_25.prompt||""); tmp.remove(); var _2b=Math.min(Math.max(_28,_2a)+20,_27.width()); _26._outerWidth(_2b); _27.find(".textbox-button").linkbutton("resize",{height:"100%"}); function _29(val){ var s=val.replace(/&/g,"&").replace(/\s/g," ").replace(//g,">"); tmp.html(s); return tmp.outerWidth(); }; }; function _2c(_2d){ var t=$(_2d); var _2e=t.tagbox("options"); if(!$(_2d).tagbox("isValid")){ return; } if(_2e.limitToList){ var _2f=t.tagbox("panel"); var _30=_2f.children("div.combobox-item-hover"); if(_30.length){ _30.removeClass("combobox-item-hover"); var row=_2e.finder.getRow(_2d,_30); var _31=row[_2e.valueField]; $(_2d).tagbox(_30.hasClass("combobox-item-selected")?"unselect":"select",_31); } $(_2d).tagbox("hidePanel"); }else{ var v=$.trim($(_2d).tagbox("getText")); if(v!==""){ var _32=$(_2d).tagbox("getValues"); _32.push(v); $(_2d).tagbox("setValues",_32); } } }; function _33(_34,_35){ $(_34).combobox("setText",""); _23(_34); $(_34).combobox("setValues",_35); $(_34).combobox("setText",""); }; $.fn.tagbox=function(_36,_37){ if(typeof _36=="string"){ var _38=$.fn.tagbox.methods[_36]; if(_38){ return _38(this,_37); }else{ return this.combobox(_36,_37); } } _36=_36||{}; return this.each(function(){ var _39=$.data(this,"tagbox"); if(_39){ $.extend(_39.options,_36); }else{ $.data(this,"tagbox",{options:$.extend({},$.fn.tagbox.defaults,$.fn.tagbox.parseOptions(this),_36)}); } _1(this); _1c(this); }); }; $.fn.tagbox.methods={options:function(jq){ var _3a=jq.combobox("options"); return $.extend($.data(jq[0],"tagbox").options,{width:_3a.width,height:_3a.height,originalValue:_3a.originalValue,disabled:_3a.disabled,readonly:_3a.readonly}); },setValues:function(jq,_3b){ return jq.each(function(){ _33(this,_3b); }); }}; $.fn.tagbox.parseOptions=function(_3c){ return $.extend({},$.fn.combobox.parseOptions(_3c),$.parser.parseOptions(_3c,[])); }; $.fn.tagbox.defaults=$.extend({},$.fn.combobox.defaults,{hasDownArrow:false,multiple:true,reversed:true,selectOnNavigation:false,tipOptions:$.extend({},$.fn.textbox.defaults.tipOptions,{showDelay:200}),inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){ var _3d=e.data.target; var _3e=$(_3d).tagbox("options"); if(_3e.limitToList){ _2c(_3d); } }}),keyHandler:$.extend({},$.fn.combobox.defaults.keyHandler,{enter:function(e){ _2c(this); },query:function(q,e){ var _3f=$(this).tagbox("options"); if(_3f.limitToList){ $.fn.combobox.defaults.keyHandler.query.call(this,q,e); }else{ $(this).combobox("hidePanel"); } }}),tagFormatter:function(_40,row){ var _41=$(this).tagbox("options"); return row?row[_41.textField]:_40; },tagStyler:function(_42,row){ return ""; },onClickTag:function(_43){ },onBeforeRemoveTag:function(_44){ },onRemoveTag:function(_45){ }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.textbox.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ var _1=0; function _2(_3){ $(_3).addClass("textbox-f").hide(); var _4=$(""+""+""+"").insertAfter(_3); var _5=$(_3).attr("name"); if(_5){ _4.find("input.textbox-value").attr("name",_5); $(_3).removeAttr("name").attr("textboxName",_5); } return _4; }; function _6(_7){ var _8=$.data(_7,"textbox"); var _9=_8.options; var tb=_8.textbox; var _a="_easyui_textbox_input"+(++_1); tb.addClass(_9.cls); tb.find(".textbox-text").remove(); if(_9.multiline){ $("").prependTo(tb); }else{ $("").prependTo(tb); } $("#"+_a).attr("tabindex",$(_7).attr("tabindex")||"").css("text-align",_7.style.textAlign||""); tb.find(".textbox-addon").remove(); var bb=_9.icons?$.extend(true,[],_9.icons):[]; if(_9.iconCls){ bb.push({iconCls:_9.iconCls,disabled:true}); } if(bb.length){ var bc=$("").prependTo(tb); bc.addClass("textbox-addon-"+_9.iconAlign); for(var i=0;i"); } } tb.find(".textbox-button").remove(); if(_9.buttonText||_9.buttonIcon){ var _b=$("").prependTo(tb); _b.addClass("textbox-button-"+_9.buttonAlign).linkbutton({text:_9.buttonText,iconCls:_9.buttonIcon,onClick:function(){ var t=$(this).parent().prev(); t.textbox("options").onClickButton.call(t[0]); }}); } if(_9.label){ if(typeof _9.label=="object"){ _8.label=$(_9.label); _8.label.attr("for",_a); }else{ $(_8.label).remove(); _8.label=$("").html(_9.label); _8.label.css("textAlign",_9.labelAlign).attr("for",_a); if(_9.labelPosition=="after"){ _8.label.insertAfter(tb); }else{ _8.label.insertBefore(_7); } _8.label.removeClass("textbox-label-left textbox-label-right textbox-label-top"); _8.label.addClass("textbox-label-"+_9.labelPosition); } }else{ $(_8.label).remove(); } _c(_7); _d(_7,_9.disabled); _e(_7,_9.readonly); }; function _f(_10){ var tb=$.data(_10,"textbox").textbox; tb.find(".textbox-text").validatebox("destroy"); tb.remove(); $(_10).remove(); }; function _11(_12,_13){ var _14=$.data(_12,"textbox"); var _15=_14.options; var tb=_14.textbox; var _16=tb.parent(); if(_13){ if(typeof _13=="object"){ $.extend(_15,_13); }else{ _15.width=_13; } } if(isNaN(parseInt(_15.width))){ var c=$(_12).clone(); c.css("visibility","hidden"); c.insertAfter(_12); _15.width=c.outerWidth(); c.remove(); } var _17=tb.is(":visible"); if(!_17){ tb.appendTo("body"); } var _18=tb.find(".textbox-text"); var btn=tb.find(".textbox-button"); var _19=tb.find(".textbox-addon"); var _1a=_19.find(".textbox-icon"); if(_15.height=="auto"){ _18.css({margin:"",paddingTop:"",paddingBottom:"",height:"",lineHeight:""}); } tb._size(_15,_16); if(_15.label&&_15.labelPosition){ if(_15.labelPosition=="top"){ _14.label._size({width:_15.labelWidth=="auto"?tb.outerWidth():_15.labelWidth},tb); if(_15.height!="auto"){ tb._size("height",tb.outerHeight()-_14.label.outerHeight()); } }else{ _14.label._size({width:_15.labelWidth,height:tb.outerHeight()},tb); if(!_15.multiline){ _14.label.css("lineHeight",_14.label.height()+"px"); } tb._size("width",tb.outerWidth()-_14.label.outerWidth()); } } if(_15.buttonAlign=="left"||_15.buttonAlign=="right"){ btn.linkbutton("resize",{height:tb.height()}); }else{ btn.linkbutton("resize",{width:"100%"}); } var _1b=tb.width()-_1a.length*_15.iconWidth-_1c("left")-_1c("right"); var _1d=_15.height=="auto"?_18.outerHeight():(tb.height()-_1c("top")-_1c("bottom")); _19.css(_15.iconAlign,_1c(_15.iconAlign)+"px"); _19.css("top",_1c("top")+"px"); _1a.css({width:_15.iconWidth+"px",height:_1d+"px"}); _18.css({paddingLeft:(_12.style.paddingLeft||""),paddingRight:(_12.style.paddingRight||""),marginLeft:_1e("left"),marginRight:_1e("right"),marginTop:_1c("top"),marginBottom:_1c("bottom")}); if(_15.multiline){ _18.css({paddingTop:(_12.style.paddingTop||""),paddingBottom:(_12.style.paddingBottom||"")}); _18._outerHeight(_1d); }else{ _18.css({paddingTop:0,paddingBottom:0,height:_1d+"px",lineHeight:_1d+"px"}); } _18._outerWidth(_1b); _15.onResizing.call(_12,_15.width,_15.height); if(!_17){ tb.insertAfter(_12); } _15.onResize.call(_12,_15.width,_15.height); function _1e(_1f){ return (_15.iconAlign==_1f?_19._outerWidth():0)+_1c(_1f); }; function _1c(_20){ var w=0; btn.filter(".textbox-button-"+_20).each(function(){ if(_20=="left"||_20=="right"){ w+=$(this).outerWidth(); }else{ w+=$(this).outerHeight(); } }); return w; }; }; function _c(_21){ var _22=$(_21).textbox("options"); var _23=$(_21).textbox("textbox"); _23.validatebox($.extend({},_22,{deltaX:function(_24){ return $(_21).textbox("getTipX",_24); },deltaY:function(_25){ return $(_21).textbox("getTipY",_25); },onBeforeValidate:function(){ _22.onBeforeValidate.call(_21); var box=$(this); if(!box.is(":focus")){ if(box.val()!==_22.value){ _22.oldInputValue=box.val(); box.val(_22.value); } } },onValidate:function(_26){ var box=$(this); if(_22.oldInputValue!=undefined){ box.val(_22.oldInputValue); _22.oldInputValue=undefined; } var tb=box.parent(); if(_26){ tb.removeClass("textbox-invalid"); }else{ tb.addClass("textbox-invalid"); } _22.onValidate.call(_21,_26); }})); }; function _27(_28){ var _29=$.data(_28,"textbox"); var _2a=_29.options; var tb=_29.textbox; var _2b=tb.find(".textbox-text"); _2b.attr("placeholder",_2a.prompt); _2b.unbind(".textbox"); $(_29.label).unbind(".textbox"); if(!_2a.disabled&&!_2a.readonly){ if(_29.label){ $(_29.label).bind("click.textbox",function(e){ if(!_2a.hasFocusMe){ _2b.focus(); $(_28).textbox("setSelectionRange",{start:0,end:_2b.val().length}); } }); } _2b.bind("blur.textbox",function(e){ if(!tb.hasClass("textbox-focused")){ return; } _2a.value=$(this).val(); if(_2a.value==""){ $(this).val(_2a.prompt).addClass("textbox-prompt"); }else{ $(this).removeClass("textbox-prompt"); } tb.removeClass("textbox-focused"); }).bind("focus.textbox",function(e){ _2a.hasFocusMe=true; if(tb.hasClass("textbox-focused")){ return; } if($(this).val()!=_2a.value){ $(this).val(_2a.value); } $(this).removeClass("textbox-prompt"); tb.addClass("textbox-focused"); }); for(var _2c in _2a.inputEvents){ _2b.bind(_2c+".textbox",{target:_28},_2a.inputEvents[_2c]); } } var _2d=tb.find(".textbox-addon"); _2d.unbind().bind("click",{target:_28},function(e){ var _2e=$(e.target).closest("a.textbox-icon:not(.textbox-icon-disabled)"); if(_2e.length){ var _2f=parseInt(_2e.attr("icon-index")); var _30=_2a.icons[_2f]; if(_30&&_30.handler){ _30.handler.call(_2e[0],e); } _2a.onClickIcon.call(_28,_2f); } }); _2d.find(".textbox-icon").each(function(_31){ var _32=_2a.icons[_31]; var _33=$(this); if(!_32||_32.disabled||_2a.disabled||_2a.readonly){ _33.addClass("textbox-icon-disabled"); }else{ _33.removeClass("textbox-icon-disabled"); } }); var btn=tb.find(".textbox-button"); btn.linkbutton((_2a.disabled||_2a.readonly)?"disable":"enable"); tb.unbind(".textbox").bind("_resize.textbox",function(e,_34){ if($(this).hasClass("easyui-fluid")||_34){ _11(_28); } return false; }); }; function _d(_35,_36){ var _37=$.data(_35,"textbox"); var _38=_37.options; var tb=_37.textbox; var _39=tb.find(".textbox-text"); var ss=$(_35).add(tb.find(".textbox-value")); _38.disabled=_36; if(_38.disabled){ _39.blur(); _39.validatebox("disable"); tb.addClass("textbox-disabled"); ss.attr("disabled","disabled"); $(_37.label).addClass("textbox-label-disabled"); }else{ _39.validatebox("enable"); tb.removeClass("textbox-disabled"); ss.removeAttr("disabled"); $(_37.label).removeClass("textbox-label-disabled"); } }; function _e(_3a,_3b){ var _3c=$.data(_3a,"textbox"); var _3d=_3c.options; var tb=_3c.textbox; var _3e=tb.find(".textbox-text"); _3d.readonly=_3b==undefined?true:_3b; if(_3d.readonly){ _3e.triggerHandler("blur.textbox"); } _3e.validatebox("readonly",_3d.readonly); tb.removeClass("textbox-readonly").addClass(_3d.readonly?"textbox-readonly":""); }; $.fn.textbox=function(_3f,_40){ if(typeof _3f=="string"){ var _41=$.fn.textbox.methods[_3f]; if(_41){ return _41(this,_40); }else{ return this.each(function(){ var _42=$(this).textbox("textbox"); _42.validatebox(_3f,_40); }); } } _3f=_3f||{}; return this.each(function(){ var _43=$.data(this,"textbox"); if(_43){ $.extend(_43.options,_3f); if(_3f.value!=undefined){ _43.options.originalValue=_3f.value; } }else{ _43=$.data(this,"textbox",{options:$.extend({},$.fn.textbox.defaults,$.fn.textbox.parseOptions(this),_3f),textbox:_2(this)}); _43.options.originalValue=_43.options.value; } _6(this); _27(this); if(_43.options.doSize){ _11(this); } var _44=_43.options.value; _43.options.value=""; $(this).textbox("initValue",_44); }); }; $.fn.textbox.methods={options:function(jq){ return $.data(jq[0],"textbox").options; },cloneFrom:function(jq,_45){ return jq.each(function(){ var t=$(this); if(t.data("textbox")){ return; } if(!$(_45).data("textbox")){ $(_45).textbox(); } var _46=$.extend(true,{},$(_45).textbox("options")); var _47=t.attr("name")||""; t.addClass("textbox-f").hide(); t.removeAttr("name").attr("textboxName",_47); var _48=$(_45).next().clone().insertAfter(t); var _49="_easyui_textbox_input"+(++_1); _48.find(".textbox-value").attr("name",_47); _48.find(".textbox-text").attr("id",_49); var _4a=$($(_45).textbox("label")).clone(); if(_4a.length){ _4a.attr("for",_49); if(_46.labelPosition=="after"){ _4a.insertAfter(t.next()); }else{ _4a.insertBefore(t); } } $.data(this,"textbox",{options:_46,textbox:_48,label:(_4a.length?_4a:undefined)}); var _4b=$(_45).textbox("button"); if(_4b.length){ t.textbox("button").linkbutton($.extend(true,{},_4b.linkbutton("options"))); } _27(this); _c(this); }); },textbox:function(jq){ return $.data(jq[0],"textbox").textbox.find(".textbox-text"); },button:function(jq){ return $.data(jq[0],"textbox").textbox.find(".textbox-button"); },label:function(jq){ return $.data(jq[0],"textbox").label; },destroy:function(jq){ return jq.each(function(){ _f(this); }); },resize:function(jq,_4c){ return jq.each(function(){ _11(this,_4c); }); },disable:function(jq){ return jq.each(function(){ _d(this,true); _27(this); }); },enable:function(jq){ return jq.each(function(){ _d(this,false); _27(this); }); },readonly:function(jq,_4d){ return jq.each(function(){ _e(this,_4d); _27(this); }); },isValid:function(jq){ return jq.textbox("textbox").validatebox("isValid"); },clear:function(jq){ return jq.each(function(){ $(this).textbox("setValue",""); }); },setText:function(jq,_4e){ return jq.each(function(){ var _4f=$(this).textbox("options"); var _50=$(this).textbox("textbox"); _4e=_4e==undefined?"":String(_4e); if($(this).textbox("getText")!=_4e){ _50.val(_4e); } _4f.value=_4e; if(!_50.is(":focus")){ if(_4e){ _50.removeClass("textbox-prompt"); }else{ _50.val(_4f.prompt).addClass("textbox-prompt"); } } $(this).textbox("validate"); }); },initValue:function(jq,_51){ return jq.each(function(){ var _52=$.data(this,"textbox"); $(this).textbox("setText",_51); _52.textbox.find(".textbox-value").val(_51); $(this).val(_51); }); },setValue:function(jq,_53){ return jq.each(function(){ var _54=$.data(this,"textbox").options; var _55=$(this).textbox("getValue"); $(this).textbox("initValue",_53); if(_55!=_53){ _54.onChange.call(this,_53,_55); $(this).closest("form").trigger("_change",[this]); } }); },getText:function(jq){ var _56=jq.textbox("textbox"); if(_56.is(":focus")){ return _56.val(); }else{ return jq.textbox("options").value; } },getValue:function(jq){ return jq.data("textbox").textbox.find(".textbox-value").val(); },reset:function(jq){ return jq.each(function(){ var _57=$(this).textbox("options"); $(this).textbox("setValue",_57.originalValue); }); },getIcon:function(jq,_58){ return jq.data("textbox").textbox.find(".textbox-icon:eq("+_58+")"); },getTipX:function(jq,_59){ var _5a=jq.data("textbox"); var _5b=_5a.options; var tb=_5a.textbox; var _5c=tb.find(".textbox-text"); var _59=_59||_5b.tipPosition; var p1=tb.offset(); var p2=_5c.offset(); var w1=tb.outerWidth(); var w2=_5c.outerWidth(); if(_59=="right"){ return w1-w2-p2.left+p1.left; }else{ if(_59=="left"){ return p1.left-p2.left; }else{ return (w1-w2-p2.left+p1.left)/2-(p2.left-p1.left)/2; } } },getTipY:function(jq,_5d){ var _5e=jq.data("textbox"); var _5f=_5e.options; var tb=_5e.textbox; var _60=tb.find(".textbox-text"); var _5d=_5d||_5f.tipPosition; var p1=tb.offset(); var p2=_60.offset(); var h1=tb.outerHeight(); var h2=_60.outerHeight(); if(_5d=="left"||_5d=="right"){ return (h1-h2-p2.top+p1.top)/2-(p2.top-p1.top)/2; }else{ if(_5d=="bottom"){ return (h1-h2-p2.top+p1.top); }else{ return (p1.top-p2.top); } } },getSelectionStart:function(jq){ return jq.textbox("getSelectionRange").start; },getSelectionRange:function(jq){ var _61=jq.textbox("textbox")[0]; var _62=0; var end=0; if(typeof _61.selectionStart=="number"){ _62=_61.selectionStart; end=_61.selectionEnd; }else{ if(_61.createTextRange){ var s=document.selection.createRange(); var _63=_61.createTextRange(); _63.setEndPoint("EndToStart",s); _62=_63.text.length; end=_62+s.text.length; } } return {start:_62,end:end}; },setSelectionRange:function(jq,_64){ return jq.each(function(){ var _65=$(this).textbox("textbox")[0]; var _66=_64.start; var end=_64.end; if(_65.setSelectionRange){ _65.setSelectionRange(_66,end); }else{ if(_65.createTextRange){ var _67=_65.createTextRange(); _67.collapse(); _67.moveEnd("character",end); _67.moveStart("character",_66); _67.select(); } } }); }}; $.fn.textbox.parseOptions=function(_68){ var t=$(_68); return $.extend({},$.fn.validatebox.parseOptions(_68),$.parser.parseOptions(_68,["prompt","iconCls","iconAlign","buttonText","buttonIcon","buttonAlign","label","labelPosition","labelAlign",{multiline:"boolean",iconWidth:"number",labelWidth:"number"}]),{value:(t.val()||undefined),type:(t.attr("type")?t.attr("type"):undefined)}); }; $.fn.textbox.defaults=$.extend({},$.fn.validatebox.defaults,{doSize:true,width:"auto",height:"auto",cls:null,prompt:"",value:"",type:"text",multiline:false,icons:[],iconCls:null,iconAlign:"right",iconWidth:18,buttonText:"",buttonIcon:null,buttonAlign:"right",label:null,labelWidth:"auto",labelPosition:"before",labelAlign:"left",inputEvents:{blur:function(e){ var t=$(e.data.target); var _69=t.textbox("options"); if(t.textbox("getValue")!=_69.value){ t.textbox("setValue",_69.value); } },keydown:function(e){ if(e.keyCode==13){ var t=$(e.data.target); t.textbox("setValue",t.textbox("getText")); } }},onChange:function(_6a,_6b){ },onResizing:function(_6c,_6d){ },onResize:function(_6e,_6f){ },onClickButton:function(){ },onClickIcon:function(_70){ }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.timespinner.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"timespinner").options; $(_2).addClass("timespinner-f").spinner(_3); var _4=_3.formatter.call(_2,_3.parser.call(_2,_3.value)); $(_2).timespinner("initValue",_4); }; function _5(e){ var _6=e.data.target; var _7=$.data(_6,"timespinner").options; var _8=$(_6).timespinner("getSelectionStart"); for(var i=0;i<_7.selections.length;i++){ var _9=_7.selections[i]; if(_8>=_9[0]&&_8<=_9[1]){ _a(_6,i); return; } } }; function _a(_b,_c){ var _d=$.data(_b,"timespinner").options; if(_c!=undefined){ _d.highlight=_c; } var _e=_d.selections[_d.highlight]; if(_e){ var tb=$(_b).timespinner("textbox"); $(_b).timespinner("setSelectionRange",{start:_e[0],end:_e[1]}); tb.focus(); } }; function _f(_10,_11){ var _12=$.data(_10,"timespinner").options; var _11=_12.parser.call(_10,_11); var _13=_12.formatter.call(_10,_11); $(_10).spinner("setValue",_13); }; function _14(_15,_16){ var _17=$.data(_15,"timespinner").options; var s=$(_15).timespinner("getValue"); var _18=_17.selections[_17.highlight]; var s1=s.substring(0,_18[0]); var s2=s.substring(_18[0],_18[1]); var s3=s.substring(_18[1]); var v=s1+((parseInt(s2,10)||0)+_17.increment*(_16?-1:1))+s3; $(_15).timespinner("setValue",v); _a(_15); }; $.fn.timespinner=function(_19,_1a){ if(typeof _19=="string"){ var _1b=$.fn.timespinner.methods[_19]; if(_1b){ return _1b(this,_1a); }else{ return this.spinner(_19,_1a); } } _19=_19||{}; return this.each(function(){ var _1c=$.data(this,"timespinner"); if(_1c){ $.extend(_1c.options,_19); }else{ $.data(this,"timespinner",{options:$.extend({},$.fn.timespinner.defaults,$.fn.timespinner.parseOptions(this),_19)}); } _1(this); }); }; $.fn.timespinner.methods={options:function(jq){ var _1d=jq.data("spinner")?jq.spinner("options"):{}; return $.extend($.data(jq[0],"timespinner").options,{width:_1d.width,value:_1d.value,originalValue:_1d.originalValue,disabled:_1d.disabled,readonly:_1d.readonly}); },setValue:function(jq,_1e){ return jq.each(function(){ _f(this,_1e); }); },getHours:function(jq){ var _1f=$.data(jq[0],"timespinner").options; var vv=jq.timespinner("getValue").split(_1f.separator); return parseInt(vv[0],10); },getMinutes:function(jq){ var _20=$.data(jq[0],"timespinner").options; var vv=jq.timespinner("getValue").split(_20.separator); return parseInt(vv[1],10); },getSeconds:function(jq){ var _21=$.data(jq[0],"timespinner").options; var vv=jq.timespinner("getValue").split(_21.separator); return parseInt(vv[2],10)||0; }}; $.fn.timespinner.parseOptions=function(_22){ return $.extend({},$.fn.spinner.parseOptions(_22),$.parser.parseOptions(_22,["separator",{showSeconds:"boolean",highlight:"number"}])); }; $.fn.timespinner.defaults=$.extend({},$.fn.spinner.defaults,{inputEvents:$.extend({},$.fn.spinner.defaults.inputEvents,{click:function(e){ _5.call(this,e); },blur:function(e){ var t=$(e.data.target); t.timespinner("setValue",t.timespinner("getText")); },keydown:function(e){ if(e.keyCode==13){ var t=$(e.data.target); t.timespinner("setValue",t.timespinner("getText")); } }}),formatter:function(_23){ if(!_23){ return ""; } var _24=$(this).timespinner("options"); var tt=[_25(_23.getHours()),_25(_23.getMinutes())]; if(_24.showSeconds){ tt.push(_25(_23.getSeconds())); } return tt.join(_24.separator); function _25(_26){ return (_26<10?"0":"")+_26; }; },parser:function(s){ var _27=$(this).timespinner("options"); var _28=_29(s); if(_28){ var min=_29(_27.min); var max=_29(_27.max); if(min&&min>_28){ _28=min; } if(max&&max<_28){ _28=max; } } return _28; function _29(s){ if(!s){ return null; } var tt=s.split(_27.separator); return new Date(1900,0,0,parseInt(tt[0],10)||0,parseInt(tt[1],10)||0,parseInt(tt[2],10)||0); }; },selections:[[0,2],[3,5],[6,8]],separator:":",showSeconds:false,highlight:0,spin:function(_2a){ _14(this,_2a); }}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.tooltip.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ $(_2).addClass("tooltip-f"); }; function _3(_4){ var _5=$.data(_4,"tooltip").options; $(_4).unbind(".tooltip").bind(_5.showEvent+".tooltip",function(e){ $(_4).tooltip("show",e); }).bind(_5.hideEvent+".tooltip",function(e){ $(_4).tooltip("hide",e); }).bind("mousemove.tooltip",function(e){ if(_5.trackMouse){ _5.trackMouseX=e.pageX; _5.trackMouseY=e.pageY; $(_4).tooltip("reposition"); } }); }; function _6(_7){ var _8=$.data(_7,"tooltip"); if(_8.showTimer){ clearTimeout(_8.showTimer); _8.showTimer=null; } if(_8.hideTimer){ clearTimeout(_8.hideTimer); _8.hideTimer=null; } }; function _9(_a){ var _b=$.data(_a,"tooltip"); if(!_b||!_b.tip){ return; } var _c=_b.options; var _d=_b.tip; var _e={left:-100000,top:-100000}; if($(_a).is(":visible")){ _e=_f(_c.position); if(_c.position=="top"&&_e.top<0){ _e=_f("bottom"); }else{ if((_c.position=="bottom")&&(_e.top+_d._outerHeight()>$(window)._outerHeight()+$(document).scrollTop())){ _e=_f("top"); } } if(_e.left<0){ if(_c.position=="left"){ _e=_f("right"); }else{ $(_a).tooltip("arrow").css("left",_d._outerWidth()/2+_e.left); _e.left=0; } }else{ if(_e.left+_d._outerWidth()>$(window)._outerWidth()+$(document)._scrollLeft()){ if(_c.position=="right"){ _e=_f("left"); }else{ var _10=_e.left; _e.left=$(window)._outerWidth()+$(document)._scrollLeft()-_d._outerWidth(); $(_a).tooltip("arrow").css("left",_d._outerWidth()/2-(_e.left-_10)); } } } } _d.css({left:_e.left,top:_e.top,zIndex:(_c.zIndex!=undefined?_c.zIndex:($.fn.window?$.fn.window.defaults.zIndex++:""))}); _c.onPosition.call(_a,_e.left,_e.top); function _f(_11){ _c.position=_11||"bottom"; _d.removeClass("tooltip-top tooltip-bottom tooltip-left tooltip-right").addClass("tooltip-"+_c.position); var _12,top; var _13=$.isFunction(_c.deltaX)?_c.deltaX.call(_a,_c.position):_c.deltaX; var _14=$.isFunction(_c.deltaY)?_c.deltaY.call(_a,_c.position):_c.deltaY; if(_c.trackMouse){ t=$(); _12=_c.trackMouseX+_13; top=_c.trackMouseY+_14; }else{ var t=$(_a); _12=t.offset().left+_13; top=t.offset().top+_14; } switch(_c.position){ case "right": _12+=t._outerWidth()+12+(_c.trackMouse?12:0); top-=(_d._outerHeight()-t._outerHeight())/2; break; case "left": _12-=_d._outerWidth()+12+(_c.trackMouse?12:0); top-=(_d._outerHeight()-t._outerHeight())/2; break; case "top": _12-=(_d._outerWidth()-t._outerWidth())/2; top-=_d._outerHeight()+12+(_c.trackMouse?12:0); break; case "bottom": _12-=(_d._outerWidth()-t._outerWidth())/2; top+=t._outerHeight()+12+(_c.trackMouse?12:0); break; } return {left:_12,top:top}; }; }; function _15(_16,e){ var _17=$.data(_16,"tooltip"); var _18=_17.options; var tip=_17.tip; if(!tip){ tip=$("
      "+"
      "+"
      "+"
      "+"
      ").appendTo("body"); _17.tip=tip; _19(_16); } _6(_16); _17.showTimer=setTimeout(function(){ $(_16).tooltip("reposition"); tip.show(); _18.onShow.call(_16,e); var _1a=tip.children(".tooltip-arrow-outer"); var _1b=tip.children(".tooltip-arrow"); var bc="border-"+_18.position+"-color"; _1a.add(_1b).css({borderTopColor:"",borderBottomColor:"",borderLeftColor:"",borderRightColor:""}); _1a.css(bc,tip.css(bc)); _1b.css(bc,tip.css("backgroundColor")); },_18.showDelay); }; function _1c(_1d,e){ var _1e=$.data(_1d,"tooltip"); if(_1e&&_1e.tip){ _6(_1d); _1e.hideTimer=setTimeout(function(){ _1e.tip.hide(); _1e.options.onHide.call(_1d,e); },_1e.options.hideDelay); } }; function _19(_1f,_20){ var _21=$.data(_1f,"tooltip"); var _22=_21.options; if(_20){ _22.content=_20; } if(!_21.tip){ return; } var cc=typeof _22.content=="function"?_22.content.call(_1f):_22.content; _21.tip.children(".tooltip-content").html(cc); _22.onUpdate.call(_1f,cc); }; function _23(_24){ var _25=$.data(_24,"tooltip"); if(_25){ _6(_24); var _26=_25.options; if(_25.tip){ _25.tip.remove(); } if(_26._title){ $(_24).attr("title",_26._title); } $.removeData(_24,"tooltip"); $(_24).unbind(".tooltip").removeClass("tooltip-f"); _26.onDestroy.call(_24); } }; $.fn.tooltip=function(_27,_28){ if(typeof _27=="string"){ return $.fn.tooltip.methods[_27](this,_28); } _27=_27||{}; return this.each(function(){ var _29=$.data(this,"tooltip"); if(_29){ $.extend(_29.options,_27); }else{ $.data(this,"tooltip",{options:$.extend({},$.fn.tooltip.defaults,$.fn.tooltip.parseOptions(this),_27)}); _1(this); } _3(this); _19(this); }); }; $.fn.tooltip.methods={options:function(jq){ return $.data(jq[0],"tooltip").options; },tip:function(jq){ return $.data(jq[0],"tooltip").tip; },arrow:function(jq){ return jq.tooltip("tip").children(".tooltip-arrow-outer,.tooltip-arrow"); },show:function(jq,e){ return jq.each(function(){ _15(this,e); }); },hide:function(jq,e){ return jq.each(function(){ _1c(this,e); }); },update:function(jq,_2a){ return jq.each(function(){ _19(this,_2a); }); },reposition:function(jq){ return jq.each(function(){ _9(this); }); },destroy:function(jq){ return jq.each(function(){ _23(this); }); }}; $.fn.tooltip.parseOptions=function(_2b){ var t=$(_2b); var _2c=$.extend({},$.parser.parseOptions(_2b,["position","showEvent","hideEvent","content",{trackMouse:"boolean",deltaX:"number",deltaY:"number",showDelay:"number",hideDelay:"number"}]),{_title:t.attr("title")}); t.attr("title",""); if(!_2c.content){ _2c.content=_2c._title; } return _2c; }; $.fn.tooltip.defaults={position:"bottom",content:null,trackMouse:false,deltaX:0,deltaY:0,showEvent:"mouseenter",hideEvent:"mouseleave",showDelay:200,hideDelay:100,onShow:function(e){ },onHide:function(e){ },onUpdate:function(_2d){ },onPosition:function(_2e,top){ },onDestroy:function(){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.tree.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$(_2); _3.addClass("tree"); return _3; }; function _4(_5){ var _6=$.data(_5,"tree").options; $(_5).unbind().bind("mouseover",function(e){ var tt=$(e.target); var _7=tt.closest("div.tree-node"); if(!_7.length){ return; } _7.addClass("tree-node-hover"); if(tt.hasClass("tree-hit")){ if(tt.hasClass("tree-expanded")){ tt.addClass("tree-expanded-hover"); }else{ tt.addClass("tree-collapsed-hover"); } } e.stopPropagation(); }).bind("mouseout",function(e){ var tt=$(e.target); var _8=tt.closest("div.tree-node"); if(!_8.length){ return; } _8.removeClass("tree-node-hover"); if(tt.hasClass("tree-hit")){ if(tt.hasClass("tree-expanded")){ tt.removeClass("tree-expanded-hover"); }else{ tt.removeClass("tree-collapsed-hover"); } } e.stopPropagation(); }).bind("click",function(e){ var tt=$(e.target); var _9=tt.closest("div.tree-node"); if(!_9.length){ return; } if(tt.hasClass("tree-hit")){ _85(_5,_9[0]); return false; }else{ if(tt.hasClass("tree-checkbox")){ _34(_5,_9[0]); return false; }else{ _d9(_5,_9[0]); _6.onClick.call(_5,_c(_5,_9[0])); } } e.stopPropagation(); }).bind("dblclick",function(e){ var _a=$(e.target).closest("div.tree-node"); if(!_a.length){ return; } _d9(_5,_a[0]); _6.onDblClick.call(_5,_c(_5,_a[0])); e.stopPropagation(); }).bind("contextmenu",function(e){ var _b=$(e.target).closest("div.tree-node"); if(!_b.length){ return; } _6.onContextMenu.call(_5,e,_c(_5,_b[0])); e.stopPropagation(); }); }; function _d(_e){ var _f=$.data(_e,"tree").options; _f.dnd=false; var _10=$(_e).find("div.tree-node"); _10.draggable("disable"); _10.css("cursor","pointer"); }; function _11(_12){ var _13=$.data(_12,"tree"); var _14=_13.options; var _15=_13.tree; _13.disabledNodes=[]; _14.dnd=true; _15.find("div.tree-node").draggable({disabled:false,revert:true,cursor:"pointer",proxy:function(_16){ var p=$("
      ").appendTo("body"); p.html(" "+$(_16).find(".tree-title").html()); p.hide(); return p; },deltaX:15,deltaY:15,onBeforeDrag:function(e){ if(_14.onBeforeDrag.call(_12,_c(_12,this))==false){ return false; } if($(e.target).hasClass("tree-hit")||$(e.target).hasClass("tree-checkbox")){ return false; } if(e.which!=1){ return false; } var _17=$(this).find("span.tree-indent"); if(_17.length){ e.data.offsetWidth-=_17.length*_17.width(); } },onStartDrag:function(e){ $(this).next("ul").find("div.tree-node").each(function(){ $(this).droppable("disable"); _13.disabledNodes.push(this); }); $(this).draggable("proxy").css({left:-10000,top:-10000}); _14.onStartDrag.call(_12,_c(_12,this)); var _18=_c(_12,this); if(_18.id==undefined){ _18.id="easyui_tree_node_id_temp"; _60(_12,_18); } _13.draggingNodeId=_18.id; },onDrag:function(e){ var x1=e.pageX,y1=e.pageY,x2=e.data.startX,y2=e.data.startY; var d=Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); if(d>3){ $(this).draggable("proxy").show(); } this.pageY=e.pageY; },onStopDrag:function(){ for(var i=0;i<_13.disabledNodes.length;i++){ $(_13.disabledNodes[i]).droppable("enable"); } _13.disabledNodes=[]; var _19=_d0(_12,_13.draggingNodeId); if(_19&&_19.id=="easyui_tree_node_id_temp"){ _19.id=""; _60(_12,_19); } _14.onStopDrag.call(_12,_19); }}).droppable({accept:"div.tree-node",onDragEnter:function(e,_1a){ if(_14.onDragEnter.call(_12,this,_1b(_1a))==false){ _1c(_1a,false); $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); $(this).droppable("disable"); _13.disabledNodes.push(this); } },onDragOver:function(e,_1d){ if($(this).droppable("options").disabled){ return; } var _1e=_1d.pageY; var top=$(this).offset().top; var _1f=top+$(this).outerHeight(); _1c(_1d,true); $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); if(_1e>top+(_1f-top)/2){ if(_1f-_1e<5){ $(this).addClass("tree-node-bottom"); }else{ $(this).addClass("tree-node-append"); } }else{ if(_1e-top<5){ $(this).addClass("tree-node-top"); }else{ $(this).addClass("tree-node-append"); } } if(_14.onDragOver.call(_12,this,_1b(_1d))==false){ _1c(_1d,false); $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); $(this).droppable("disable"); _13.disabledNodes.push(this); } },onDragLeave:function(e,_20){ _1c(_20,false); $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); _14.onDragLeave.call(_12,this,_1b(_20)); },onDrop:function(e,_21){ var _22=this; var _23,_24; if($(this).hasClass("tree-node-append")){ _23=_25; _24="append"; }else{ _23=_26; _24=$(this).hasClass("tree-node-top")?"top":"bottom"; } if(_14.onBeforeDrop.call(_12,_22,_1b(_21),_24)==false){ $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); return; } _23(_21,_22,_24); $(this).removeClass("tree-node-append tree-node-top tree-node-bottom"); }}); function _1b(_27,pop){ return $(_27).closest("ul.tree").tree(pop?"pop":"getData",_27); }; function _1c(_28,_29){ var _2a=$(_28).draggable("proxy").find("span.tree-dnd-icon"); _2a.removeClass("tree-dnd-yes tree-dnd-no").addClass(_29?"tree-dnd-yes":"tree-dnd-no"); }; function _25(_2b,_2c){ if(_c(_12,_2c).state=="closed"){ _79(_12,_2c,function(){ _2d(); }); }else{ _2d(); } function _2d(){ var _2e=_1b(_2b,true); $(_12).tree("append",{parent:_2c,data:[_2e]}); _14.onDrop.call(_12,_2c,_2e,"append"); }; }; function _26(_2f,_30,_31){ var _32={}; if(_31=="top"){ _32.before=_30; }else{ _32.after=_30; } var _33=_1b(_2f,true); _32.data=_33; $(_12).tree("insert",_32); _14.onDrop.call(_12,_30,_33,_31); }; }; function _34(_35,_36,_37,_38){ var _39=$.data(_35,"tree"); var _3a=_39.options; if(!_3a.checkbox){ return; } var _3b=_c(_35,_36); if(!_3b.checkState){ return; } var ck=$(_36).find(".tree-checkbox"); if(_37==undefined){ if(ck.hasClass("tree-checkbox1")){ _37=false; }else{ if(ck.hasClass("tree-checkbox0")){ _37=true; }else{ if(_3b._checked==undefined){ _3b._checked=$(_36).find(".tree-checkbox").hasClass("tree-checkbox1"); } _37=!_3b._checked; } } } _3b._checked=_37; if(_37){ if(ck.hasClass("tree-checkbox1")){ return; } }else{ if(ck.hasClass("tree-checkbox0")){ return; } } if(!_38){ if(_3a.onBeforeCheck.call(_35,_3b,_37)==false){ return; } } if(_3a.cascadeCheck){ _3c(_35,_3b,_37); _3d(_35,_3b); }else{ _3e(_35,_3b,_37?"1":"0"); } if(!_38){ _3a.onCheck.call(_35,_3b,_37); } }; function _3c(_3f,_40,_41){ var _42=$.data(_3f,"tree").options; var _43=_41?1:0; _3e(_3f,_40,_43); if(_42.deepCheck){ $.easyui.forEach(_40.children||[],true,function(n){ _3e(_3f,n,_43); }); }else{ var _44=[]; if(_40.children&&_40.children.length){ _44.push(_40); } $.easyui.forEach(_40.children||[],true,function(n){ if(!n.hidden){ _3e(_3f,n,_43); if(n.children&&n.children.length){ _44.push(n); } } }); for(var i=_44.length-1;i>=0;i--){ var _45=_44[i]; _3e(_3f,_45,_46(_45)); } } }; function _3e(_47,_48,_49){ var _4a=$.data(_47,"tree").options; if(!_48.checkState||_49==undefined){ return; } if(_48.hidden&&!_4a.deepCheck){ return; } var ck=$("#"+_48.domId).find(".tree-checkbox"); _48.checkState=["unchecked","checked","indeterminate"][_49]; _48.checked=(_48.checkState=="checked"); ck.removeClass("tree-checkbox0 tree-checkbox1 tree-checkbox2"); ck.addClass("tree-checkbox"+_49); }; function _3d(_4b,_4c){ var pd=_4d(_4b,$("#"+_4c.domId)[0]); if(pd){ _3e(_4b,pd,_46(pd)); _3d(_4b,pd); } }; function _46(row){ var c0=0; var c1=0; var len=0; $.easyui.forEach(row.children||[],false,function(r){ if(r.checkState){ len++; if(r.checkState=="checked"){ c1++; }else{ if(r.checkState=="unchecked"){ c0++; } } } }); if(len==0){ return undefined; } var _4e=0; if(c0==len){ _4e=0; }else{ if(c1==len){ _4e=1; }else{ _4e=2; } } return _4e; }; function _4f(_50,_51){ var _52=$.data(_50,"tree").options; if(!_52.checkbox){ return; } var _53=$(_51); var ck=_53.find(".tree-checkbox"); var _54=_c(_50,_51); if(_52.view.hasCheckbox(_50,_54)){ if(!ck.length){ _54.checkState=_54.checkState||"unchecked"; $("").insertBefore(_53.find(".tree-title")); } if(_54.checkState=="checked"){ _34(_50,_51,true,true); }else{ if(_54.checkState=="unchecked"){ _34(_50,_51,false,true); }else{ var _55=_46(_54); if(_55===0){ _34(_50,_51,false,true); }else{ if(_55===1){ _34(_50,_51,true,true); } } } } }else{ ck.remove(); _54.checkState=undefined; _54.checked=undefined; _3d(_50,_54); } }; function _56(_57,ul,_58,_59,_5a){ var _5b=$.data(_57,"tree"); var _5c=_5b.options; var _5d=$(ul).prevAll("div.tree-node:first"); _58=_5c.loadFilter.call(_57,_58,_5d[0]); var _5e=_5f(_57,"domId",_5d.attr("id")); if(!_59){ _5e?_5e.children=_58:_5b.data=_58; $(ul).empty(); }else{ if(_5e){ _5e.children?_5e.children=_5e.children.concat(_58):_5e.children=_58; }else{ _5b.data=_5b.data.concat(_58); } } _5c.view.render.call(_5c.view,_57,ul,_58); if(_5c.dnd){ _11(_57); } if(_5e){ _60(_57,_5e); } for(var i=0;i<_5b.tmpIds.length;i++){ _34(_57,$("#"+_5b.tmpIds[i])[0],true,true); } _5b.tmpIds=[]; setTimeout(function(){ _61(_57,_57); },0); if(!_5a){ _5c.onLoadSuccess.call(_57,_5e,_58); } }; function _61(_62,ul,_63){ var _64=$.data(_62,"tree").options; if(_64.lines){ $(_62).addClass("tree-lines"); }else{ $(_62).removeClass("tree-lines"); return; } if(!_63){ _63=true; $(_62).find("span.tree-indent").removeClass("tree-line tree-join tree-joinbottom"); $(_62).find("div.tree-node").removeClass("tree-node-last tree-root-first tree-root-one"); var _65=$(_62).tree("getRoots"); if(_65.length>1){ $(_65[0].target).addClass("tree-root-first"); }else{ if(_65.length==1){ $(_65[0].target).addClass("tree-root-one"); } } } $(ul).children("li").each(function(){ var _66=$(this).children("div.tree-node"); var ul=_66.next("ul"); if(ul.length){ if($(this).next().length){ _67(_66); } _61(_62,ul,_63); }else{ _68(_66); } }); var _69=$(ul).children("li:last").children("div.tree-node").addClass("tree-node-last"); _69.children("span.tree-join").removeClass("tree-join").addClass("tree-joinbottom"); function _68(_6a,_6b){ var _6c=_6a.find("span.tree-icon"); _6c.prev("span.tree-indent").addClass("tree-join"); }; function _67(_6d){ var _6e=_6d.find("span.tree-indent, span.tree-hit").length; _6d.next().find("div.tree-node").each(function(){ $(this).children("span:eq("+(_6e-1)+")").addClass("tree-line"); }); }; }; function _6f(_70,ul,_71,_72){ var _73=$.data(_70,"tree").options; _71=$.extend({},_73.queryParams,_71||{}); var _74=null; if(_70!=ul){ var _75=$(ul).prev(); _74=_c(_70,_75[0]); } if(_73.onBeforeLoad.call(_70,_74,_71)==false){ return; } var _76=$(ul).prev().children("span.tree-folder"); _76.addClass("tree-loading"); var _77=_73.loader.call(_70,_71,function(_78){ _76.removeClass("tree-loading"); _56(_70,ul,_78); if(_72){ _72(); } },function(){ _76.removeClass("tree-loading"); _73.onLoadError.apply(_70,arguments); if(_72){ _72(); } }); if(_77==false){ _76.removeClass("tree-loading"); } }; function _79(_7a,_7b,_7c){ var _7d=$.data(_7a,"tree").options; var hit=$(_7b).children("span.tree-hit"); if(hit.length==0){ return; } if(hit.hasClass("tree-expanded")){ return; } var _7e=_c(_7a,_7b); if(_7d.onBeforeExpand.call(_7a,_7e)==false){ return; } hit.removeClass("tree-collapsed tree-collapsed-hover").addClass("tree-expanded"); hit.next().addClass("tree-folder-open"); var ul=$(_7b).next(); if(ul.length){ if(_7d.animate){ ul.slideDown("normal",function(){ _7e.state="open"; _7d.onExpand.call(_7a,_7e); if(_7c){ _7c(); } }); }else{ ul.css("display","block"); _7e.state="open"; _7d.onExpand.call(_7a,_7e); if(_7c){ _7c(); } } }else{ var _7f=$("
        ").insertAfter(_7b); _6f(_7a,_7f[0],{id:_7e.id},function(){ if(_7f.is(":empty")){ _7f.remove(); } if(_7d.animate){ _7f.slideDown("normal",function(){ _7e.state="open"; _7d.onExpand.call(_7a,_7e); if(_7c){ _7c(); } }); }else{ _7f.css("display","block"); _7e.state="open"; _7d.onExpand.call(_7a,_7e); if(_7c){ _7c(); } } }); } }; function _80(_81,_82){ var _83=$.data(_81,"tree").options; var hit=$(_82).children("span.tree-hit"); if(hit.length==0){ return; } if(hit.hasClass("tree-collapsed")){ return; } var _84=_c(_81,_82); if(_83.onBeforeCollapse.call(_81,_84)==false){ return; } hit.removeClass("tree-expanded tree-expanded-hover").addClass("tree-collapsed"); hit.next().removeClass("tree-folder-open"); var ul=$(_82).next(); if(_83.animate){ ul.slideUp("normal",function(){ _84.state="closed"; _83.onCollapse.call(_81,_84); }); }else{ ul.css("display","none"); _84.state="closed"; _83.onCollapse.call(_81,_84); } }; function _85(_86,_87){ var hit=$(_87).children("span.tree-hit"); if(hit.length==0){ return; } if(hit.hasClass("tree-expanded")){ _80(_86,_87); }else{ _79(_86,_87); } }; function _88(_89,_8a){ var _8b=_8c(_89,_8a); if(_8a){ _8b.unshift(_c(_89,_8a)); } for(var i=0;i<_8b.length;i++){ _79(_89,_8b[i].target); } }; function _8d(_8e,_8f){ var _90=[]; var p=_4d(_8e,_8f); while(p){ _90.unshift(p); p=_4d(_8e,p.target); } for(var i=0;i<_90.length;i++){ _79(_8e,_90[i].target); } }; function _91(_92,_93){ var c=$(_92).parent(); while(c[0].tagName!="BODY"&&c.css("overflow-y")!="auto"){ c=c.parent(); } var n=$(_93); var _94=n.offset().top; if(c[0].tagName!="BODY"){ var _95=c.offset().top; if(_94<_95){ c.scrollTop(c.scrollTop()+_94-_95); }else{ if(_94+n.outerHeight()>_95+c.outerHeight()-18){ c.scrollTop(c.scrollTop()+_94+n.outerHeight()-_95-c.outerHeight()+18); } } }else{ c.scrollTop(_94); } }; function _96(_97,_98){ var _99=_8c(_97,_98); if(_98){ _99.unshift(_c(_97,_98)); } for(var i=0;i<_99.length;i++){ _80(_97,_99[i].target); } }; function _9a(_9b,_9c){ var _9d=$(_9c.parent); var _9e=_9c.data; if(!_9e){ return; } _9e=$.isArray(_9e)?_9e:[_9e]; if(!_9e.length){ return; } var ul; if(_9d.length==0){ ul=$(_9b); }else{ if(_9f(_9b,_9d[0])){ var _a0=_9d.find("span.tree-icon"); _a0.removeClass("tree-file").addClass("tree-folder tree-folder-open"); var hit=$("").insertBefore(_a0); if(hit.prev().length){ hit.prev().remove(); } } ul=_9d.next(); if(!ul.length){ ul=$("
          ").insertAfter(_9d); } } _56(_9b,ul[0],_9e,true,true); }; function _a1(_a2,_a3){ var ref=_a3.before||_a3.after; var _a4=_4d(_a2,ref); var _a5=_a3.data; if(!_a5){ return; } _a5=$.isArray(_a5)?_a5:[_a5]; if(!_a5.length){ return; } _9a(_a2,{parent:(_a4?_a4.target:null),data:_a5}); var _a6=_a4?_a4.children:$(_a2).tree("getRoots"); for(var i=0;i<_a6.length;i++){ if(_a6[i].domId==$(ref).attr("id")){ for(var j=_a5.length-1;j>=0;j--){ _a6.splice((_a3.before?i:(i+1)),0,_a5[j]); } _a6.splice(_a6.length-_a5.length,_a5.length); break; } } var li=$(); for(var i=0;i<_a5.length;i++){ li=li.add($("#"+_a5[i].domId).parent()); } if(_a3.before){ li.insertBefore($(ref).parent()); }else{ li.insertAfter($(ref).parent()); } }; function _a7(_a8,_a9){ var _aa=del(_a9); $(_a9).parent().remove(); if(_aa){ if(!_aa.children||!_aa.children.length){ var _ab=$(_aa.target); _ab.find(".tree-icon").removeClass("tree-folder").addClass("tree-file"); _ab.find(".tree-hit").remove(); $("").prependTo(_ab); _ab.next().remove(); } _60(_a8,_aa); } _61(_a8,_a8); function del(_ac){ var id=$(_ac).attr("id"); var _ad=_4d(_a8,_ac); var cc=_ad?_ad.children:$.data(_a8,"tree").data; for(var i=0;i").appendTo(nt); _e6.val(_e4.text).focus(); _e6.width(_e5+20); _e6._outerHeight(18); _e6.bind("click",function(e){ return false; }).bind("mousedown",function(e){ e.stopPropagation(); }).bind("mousemove",function(e){ e.stopPropagation(); }).bind("keydown",function(e){ if(e.keyCode==13){ _e7(_e1,_e2); return false; }else{ if(e.keyCode==27){ _ed(_e1,_e2); return false; } } }).bind("blur",function(e){ e.stopPropagation(); _e7(_e1,_e2); }); }; function _e7(_e8,_e9){ var _ea=$.data(_e8,"tree").options; $(_e9).css("position",""); var _eb=$(_e9).find("input.tree-editor"); var val=_eb.val(); _eb.remove(); var _ec=_c(_e8,_e9); _ec.text=val; _60(_e8,_ec); _ea.onAfterEdit.call(_e8,_ec); }; function _ed(_ee,_ef){ var _f0=$.data(_ee,"tree").options; $(_ef).css("position",""); $(_ef).find("input.tree-editor").remove(); var _f1=_c(_ee,_ef); _60(_ee,_f1); _f0.onCancelEdit.call(_ee,_f1); }; function _f2(_f3,q){ var _f4=$.data(_f3,"tree"); var _f5=_f4.options; var ids={}; $.easyui.forEach(_f4.data,true,function(_f6){ if(_f5.filter.call(_f3,q,_f6)){ $("#"+_f6.domId).removeClass("tree-node-hidden"); ids[_f6.domId]=1; _f6.hidden=false; }else{ $("#"+_f6.domId).addClass("tree-node-hidden"); _f6.hidden=true; } }); for(var id in ids){ _f7(id); } function _f7(_f8){ var p=$(_f3).tree("getParent",$("#"+_f8)[0]); while(p){ $(p.target).removeClass("tree-node-hidden"); p.hidden=false; p=$(_f3).tree("getParent",p.target); } }; }; $.fn.tree=function(_f9,_fa){ if(typeof _f9=="string"){ return $.fn.tree.methods[_f9](this,_fa); } var _f9=_f9||{}; return this.each(function(){ var _fb=$.data(this,"tree"); var _fc; if(_fb){ _fc=$.extend(_fb.options,_f9); _fb.options=_fc; }else{ _fc=$.extend({},$.fn.tree.defaults,$.fn.tree.parseOptions(this),_f9); $.data(this,"tree",{options:_fc,tree:_1(this),data:[],tmpIds:[]}); var _fd=$.fn.tree.parseData(this); if(_fd.length){ _56(this,this,_fd); } } _4(this); if(_fc.data){ _56(this,this,$.extend(true,[],_fc.data)); } _6f(this,this); }); }; $.fn.tree.methods={options:function(jq){ return $.data(jq[0],"tree").options; },loadData:function(jq,_fe){ return jq.each(function(){ _56(this,this,_fe); }); },getNode:function(jq,_ff){ return _c(jq[0],_ff); },getData:function(jq,_100){ return _c9(jq[0],_100); },reload:function(jq,_101){ return jq.each(function(){ if(_101){ var node=$(_101); var hit=node.children("span.tree-hit"); hit.removeClass("tree-expanded tree-expanded-hover").addClass("tree-collapsed"); node.next().remove(); _79(this,_101); }else{ $(this).empty(); _6f(this,this); } }); },getRoot:function(jq,_102){ return _b3(jq[0],_102); },getRoots:function(jq){ return _b7(jq[0]); },getParent:function(jq,_103){ return _4d(jq[0],_103); },getChildren:function(jq,_104){ return _8c(jq[0],_104); },getChecked:function(jq,_105){ return _c2(jq[0],_105); },getSelected:function(jq){ return _c6(jq[0]); },isLeaf:function(jq,_106){ return _9f(jq[0],_106); },find:function(jq,id){ return _d0(jq[0],id); },select:function(jq,_107){ return jq.each(function(){ _d9(this,_107); }); },check:function(jq,_108){ return jq.each(function(){ _34(this,_108,true); }); },uncheck:function(jq,_109){ return jq.each(function(){ _34(this,_109,false); }); },collapse:function(jq,_10a){ return jq.each(function(){ _80(this,_10a); }); },expand:function(jq,_10b){ return jq.each(function(){ _79(this,_10b); }); },collapseAll:function(jq,_10c){ return jq.each(function(){ _96(this,_10c); }); },expandAll:function(jq,_10d){ return jq.each(function(){ _88(this,_10d); }); },expandTo:function(jq,_10e){ return jq.each(function(){ _8d(this,_10e); }); },scrollTo:function(jq,_10f){ return jq.each(function(){ _91(this,_10f); }); },toggle:function(jq,_110){ return jq.each(function(){ _85(this,_110); }); },append:function(jq,_111){ return jq.each(function(){ _9a(this,_111); }); },insert:function(jq,_112){ return jq.each(function(){ _a1(this,_112); }); },remove:function(jq,_113){ return jq.each(function(){ _a7(this,_113); }); },pop:function(jq,_114){ var node=jq.tree("getData",_114); jq.tree("remove",_114); return node; },update:function(jq,_115){ return jq.each(function(){ _60(this,$.extend({},_115,{checkState:_115.checked?"checked":(_115.checked===false?"unchecked":undefined)})); }); },enableDnd:function(jq){ return jq.each(function(){ _11(this); }); },disableDnd:function(jq){ return jq.each(function(){ _d(this); }); },beginEdit:function(jq,_116){ return jq.each(function(){ _e0(this,_116); }); },endEdit:function(jq,_117){ return jq.each(function(){ _e7(this,_117); }); },cancelEdit:function(jq,_118){ return jq.each(function(){ _ed(this,_118); }); },doFilter:function(jq,q){ return jq.each(function(){ _f2(this,q); }); }}; $.fn.tree.parseOptions=function(_119){ var t=$(_119); return $.extend({},$.parser.parseOptions(_119,["url","method",{checkbox:"boolean",cascadeCheck:"boolean",onlyLeafCheck:"boolean"},{animate:"boolean",lines:"boolean",dnd:"boolean"}])); }; $.fn.tree.parseData=function(_11a){ var data=[]; _11b(data,$(_11a)); return data; function _11b(aa,tree){ tree.children("li").each(function(){ var node=$(this); var item=$.extend({},$.parser.parseOptions(this,["id","iconCls","state"]),{checked:(node.attr("checked")?true:undefined)}); item.text=node.children("span").html(); if(!item.text){ item.text=node.html(); } var _11c=node.children("ul"); if(_11c.length){ item.children=[]; _11b(item.children,_11c); } aa.push(item); }); }; }; var _11d=1; var _11e={render:function(_11f,ul,data){ var _120=$.data(_11f,"tree"); var opts=_120.options; var _121=$(ul).prev(".tree-node"); var _122=_121.length?$(_11f).tree("getNode",_121[0]):null; var _123=_121.find("span.tree-indent, span.tree-hit").length; var cc=_124.call(this,_123,data); $(ul).append(cc.join("")); function _124(_125,_126){ var cc=[]; for(var i=0;i<_126.length;i++){ var item=_126[i]; if(item.state!="open"&&item.state!="closed"){ item.state="open"; } item.domId="_easyui_tree_"+_11d++; cc.push("
        • "); cc.push("
          "); for(var j=0;j<_125;j++){ cc.push(""); } if(item.state=="closed"){ cc.push(""); cc.push(""); }else{ if(item.children&&item.children.length){ cc.push(""); cc.push(""); }else{ cc.push(""); cc.push(""); } } if(this.hasCheckbox(_11f,item)){ var flag=0; if(_122&&_122.checkState=="checked"&&opts.cascadeCheck){ flag=1; item.checked=true; }else{ if(item.checked){ $.easyui.addArrayItem(_120.tmpIds,item.domId); } } item.checkState=flag?"checked":"unchecked"; cc.push(""); }else{ item.checkState=undefined; item.checked=undefined; } cc.push(""+opts.formatter.call(_11f,item)+""); cc.push("
          "); if(item.children&&item.children.length){ var tmp=_124.call(this,_125+1,item.children); cc.push("
            "); cc=cc.concat(tmp); cc.push("
          "); } cc.push("
        • "); } return cc; }; },hasCheckbox:function(_127,item){ var _128=$.data(_127,"tree"); var opts=_128.options; if(opts.checkbox){ if($.isFunction(opts.checkbox)){ if(opts.checkbox.call(_127,item)){ return true; }else{ return false; } }else{ if(opts.onlyLeafCheck){ if(item.state=="open"&&!(item.children&&item.children.length)){ return true; } }else{ return true; } } } return false; }}; $.fn.tree.defaults={url:null,method:"post",animate:false,checkbox:false,cascadeCheck:true,onlyLeafCheck:false,lines:false,dnd:false,data:null,queryParams:{},formatter:function(node){ return node.text; },filter:function(q,node){ var qq=[]; $.map($.isArray(q)?q:[q],function(q){ q=$.trim(q); if(q){ qq.push(q); } }); for(var i=0;i=0){ return true; } } return !qq.length; },loader:function(_12a,_12b,_12c){ var opts=$(this).tree("options"); if(!opts.url){ return false; } $.ajax({type:opts.method,url:opts.url,data:_12a,dataType:"json",success:function(data){ _12b(data); },error:function(){ _12c.apply(this,arguments); }}); },loadFilter:function(data,_12d){ return data; },view:_11e,onBeforeLoad:function(node,_12e){ },onLoadSuccess:function(node,data){ },onLoadError:function(){ },onClick:function(node){ },onDblClick:function(node){ },onBeforeExpand:function(node){ },onExpand:function(node){ },onBeforeCollapse:function(node){ },onCollapse:function(node){ },onBeforeCheck:function(node,_12f){ },onCheck:function(node,_130){ },onBeforeSelect:function(node){ },onSelect:function(node){ },onContextMenu:function(e,node){ },onBeforeDrag:function(node){ },onStartDrag:function(node){ },onStopDrag:function(node){ },onDragEnter:function(_131,_132){ },onDragOver:function(_133,_134){ },onDragLeave:function(_135,_136){ },onBeforeDrop:function(_137,_138,_139){ },onDrop:function(_13a,_13b,_13c){ },onBeforeEdit:function(node){ },onAfterEdit:function(node){ },onCancelEdit:function(node){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.treegrid.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2){ var _3=$.data(_2,"treegrid"); var _4=_3.options; $(_2).datagrid($.extend({},_4,{url:null,data:null,loader:function(){ return false; },onBeforeLoad:function(){ return false; },onLoadSuccess:function(){ },onResizeColumn:function(_5,_6){ _16(_2); _4.onResizeColumn.call(_2,_5,_6); },onBeforeSortColumn:function(_7,_8){ if(_4.onBeforeSortColumn.call(_2,_7,_8)==false){ return false; } },onSortColumn:function(_9,_a){ _4.sortName=_9; _4.sortOrder=_a; if(_4.remoteSort){ _15(_2); }else{ var _b=$(_2).treegrid("getData"); _56(_2,null,_b); } _4.onSortColumn.call(_2,_9,_a); },onClickCell:function(_c,_d){ _4.onClickCell.call(_2,_d,_37(_2,_c)); },onDblClickCell:function(_e,_f){ _4.onDblClickCell.call(_2,_f,_37(_2,_e)); },onRowContextMenu:function(e,_10){ _4.onContextMenu.call(_2,e,_37(_2,_10)); }})); var _11=$.data(_2,"datagrid").options; _4.columns=_11.columns; _4.frozenColumns=_11.frozenColumns; _3.dc=$.data(_2,"datagrid").dc; if(_4.pagination){ var _12=$(_2).datagrid("getPager"); _12.pagination({pageNumber:_4.pageNumber,pageSize:_4.pageSize,pageList:_4.pageList,onSelectPage:function(_13,_14){ _4.pageNumber=_13; _4.pageSize=_14; _15(_2); }}); _4.pageSize=_12.pagination("options").pageSize; } }; function _16(_17,_18){ var _19=$.data(_17,"datagrid").options; var dc=$.data(_17,"datagrid").dc; if(!dc.body1.is(":empty")&&(!_19.nowrap||_19.autoRowHeight)){ if(_18!=undefined){ var _1a=_1b(_17,_18); for(var i=0;i<_1a.length;i++){ _1c(_1a[i][_19.idField]); } } } $(_17).datagrid("fixRowHeight",_18); function _1c(_1d){ var tr1=_19.finder.getTr(_17,_1d,"body",1); var tr2=_19.finder.getTr(_17,_1d,"body",2); tr1.css("height",""); tr2.css("height",""); var _1e=Math.max(tr1.height(),tr2.height()); tr1.css("height",_1e); tr2.css("height",_1e); }; }; function _1f(_20){ var dc=$.data(_20,"datagrid").dc; var _21=$.data(_20,"treegrid").options; if(!_21.rownumbers){ return; } dc.body1.find("div.datagrid-cell-rownumber").each(function(i){ $(this).html(i+1); }); }; function _22(_23){ return function(e){ $.fn.datagrid.defaults.rowEvents[_23?"mouseover":"mouseout"](e); var tt=$(e.target); var fn=_23?"addClass":"removeClass"; if(tt.hasClass("tree-hit")){ tt.hasClass("tree-expanded")?tt[fn]("tree-expanded-hover"):tt[fn]("tree-collapsed-hover"); } }; }; function _24(e){ var tt=$(e.target); var tr=tt.closest("tr.datagrid-row"); if(!tr.length||!tr.parent().length){ return; } var _25=tr.attr("node-id"); var _26=_27(tr); if(tt.hasClass("tree-hit")){ _28(_26,_25); }else{ if(tt.hasClass("tree-checkbox")){ _29(_26,_25); }else{ var _2a=$(_26).datagrid("options"); if(!tt.parent().hasClass("datagrid-cell-check")&&!_2a.singleSelect&&e.shiftKey){ var _2b=$(_26).treegrid("getChildren"); var _2c=$.easyui.indexOfArray(_2b,_2a.idField,_2a.lastSelectedIndex); var _2d=$.easyui.indexOfArray(_2b,_2a.idField,_25); var _2e=Math.min(Math.max(_2c,0),_2d); var to=Math.max(_2c,_2d); var row=_2b[_2d]; var td=tt.closest("td[field]",tr); if(td.length){ var _2f=td.attr("field"); _2a.onClickCell.call(_26,_25,_2f,row[_2f]); } $(_26).treegrid("clearSelections"); for(var i=_2e;i<=to;i++){ $(_26).treegrid("selectRow",_2b[i][_2a.idField]); } _2a.onClickRow.call(_26,row); }else{ $.fn.datagrid.defaults.rowEvents.click(e); } } } }; function _27(t){ return $(t).closest("div.datagrid-view").children(".datagrid-f")[0]; }; function _29(_30,_31,_32,_33){ var _34=$.data(_30,"treegrid"); var _35=_34.checkedRows; var _36=_34.options; if(!_36.checkbox){ return; } var row=_37(_30,_31); if(!row.checkState){ return; } var tr=_36.finder.getTr(_30,_31); var ck=tr.find(".tree-checkbox"); if(_32==undefined){ if(ck.hasClass("tree-checkbox1")){ _32=false; }else{ if(ck.hasClass("tree-checkbox0")){ _32=true; }else{ if(row._checked==undefined){ row._checked=ck.hasClass("tree-checkbox1"); } _32=!row._checked; } } } row._checked=_32; if(_32){ if(ck.hasClass("tree-checkbox1")){ return; } }else{ if(ck.hasClass("tree-checkbox0")){ return; } } if(!_33){ if(_36.onBeforeCheckNode.call(_30,row,_32)==false){ return; } } if(_36.cascadeCheck){ _38(_30,row,_32); _39(_30,row); }else{ _3a(_30,row,_32?"1":"0"); } if(!_33){ _36.onCheckNode.call(_30,row,_32); } }; function _3a(_3b,row,_3c){ var _3d=$.data(_3b,"treegrid"); var _3e=_3d.checkedRows; var _3f=_3d.options; if(!row.checkState||_3c==undefined){ return; } var tr=_3f.finder.getTr(_3b,row[_3f.idField]); var ck=tr.find(".tree-checkbox"); if(!ck.length){ return; } row.checkState=["unchecked","checked","indeterminate"][_3c]; row.checked=(row.checkState=="checked"); ck.removeClass("tree-checkbox0 tree-checkbox1 tree-checkbox2"); ck.addClass("tree-checkbox"+_3c); if(_3c==0){ $.easyui.removeArrayItem(_3e,_3f.idField,row[_3f.idField]); }else{ $.easyui.addArrayItem(_3e,_3f.idField,row); } }; function _38(_40,row,_41){ var _42=_41?1:0; _3a(_40,row,_42); $.easyui.forEach(row.children||[],true,function(r){ _3a(_40,r,_42); }); }; function _39(_43,row){ var _44=$.data(_43,"treegrid").options; var _45=_46(_43,row[_44.idField]); if(_45){ _3a(_43,_45,_47(_45)); _39(_43,_45); } }; function _47(row){ var len=0; var c0=0; var c1=0; $.easyui.forEach(row.children||[],false,function(r){ if(r.checkState){ len++; if(r.checkState=="checked"){ c1++; }else{ if(r.checkState=="unchecked"){ c0++; } } } }); if(len==0){ return undefined; } var _48=0; if(c0==len){ _48=0; }else{ if(c1==len){ _48=1; }else{ _48=2; } } return _48; }; function _49(_4a,_4b){ var _4c=$.data(_4a,"treegrid").options; if(!_4c.checkbox){ return; } var row=_37(_4a,_4b); var tr=_4c.finder.getTr(_4a,_4b); var ck=tr.find(".tree-checkbox"); if(_4c.view.hasCheckbox(_4a,row)){ if(!ck.length){ row.checkState=row.checkState||"unchecked"; $("").insertBefore(tr.find(".tree-title")); } if(row.checkState=="checked"){ _29(_4a,_4b,true,true); }else{ if(row.checkState=="unchecked"){ _29(_4a,_4b,false,true); }else{ var _4d=_47(row); if(_4d===0){ _29(_4a,_4b,false,true); }else{ if(_4d===1){ _29(_4a,_4b,true,true); } } } } }else{ ck.remove(); row.checkState=undefined; row.checked=undefined; _39(_4a,row); } }; function _4e(_4f,_50){ var _51=$.data(_4f,"treegrid").options; var tr1=_51.finder.getTr(_4f,_50,"body",1); var tr2=_51.finder.getTr(_4f,_50,"body",2); var _52=$(_4f).datagrid("getColumnFields",true).length+(_51.rownumbers?1:0); var _53=$(_4f).datagrid("getColumnFields",false).length; _54(tr1,_52); _54(tr2,_53); function _54(tr,_55){ $(""+""+"
          "+""+"").insertAfter(tr); }; }; function _56(_57,_58,_59,_5a,_5b){ var _5c=$.data(_57,"treegrid"); var _5d=_5c.options; var dc=_5c.dc; _59=_5d.loadFilter.call(_57,_59,_58); var _5e=_37(_57,_58); if(_5e){ var _5f=_5d.finder.getTr(_57,_58,"body",1); var _60=_5d.finder.getTr(_57,_58,"body",2); var cc1=_5f.next("tr.treegrid-tr-tree").children("td").children("div"); var cc2=_60.next("tr.treegrid-tr-tree").children("td").children("div"); if(!_5a){ _5e.children=[]; } }else{ var cc1=dc.body1; var cc2=dc.body2; if(!_5a){ _5c.data=[]; } } if(!_5a){ cc1.empty(); cc2.empty(); } if(_5d.view.onBeforeRender){ _5d.view.onBeforeRender.call(_5d.view,_57,_58,_59); } _5d.view.render.call(_5d.view,_57,cc1,true); _5d.view.render.call(_5d.view,_57,cc2,false); if(_5d.showFooter){ _5d.view.renderFooter.call(_5d.view,_57,dc.footer1,true); _5d.view.renderFooter.call(_5d.view,_57,dc.footer2,false); } if(_5d.view.onAfterRender){ _5d.view.onAfterRender.call(_5d.view,_57); } if(!_58&&_5d.pagination){ var _61=$.data(_57,"treegrid").total; var _62=$(_57).datagrid("getPager"); if(_62.pagination("options").total!=_61){ _62.pagination({total:_61}); } } _16(_57); _1f(_57); $(_57).treegrid("showLines"); $(_57).treegrid("setSelectionState"); $(_57).treegrid("autoSizeColumn"); if(!_5b){ _5d.onLoadSuccess.call(_57,_5e,_59); } }; function _15(_63,_64,_65,_66,_67){ var _68=$.data(_63,"treegrid").options; var _69=$(_63).datagrid("getPanel").find("div.datagrid-body"); if(_64==undefined&&_68.queryParams){ _68.queryParams.id=undefined; } if(_65){ _68.queryParams=_65; } var _6a=$.extend({},_68.queryParams); if(_68.pagination){ $.extend(_6a,{page:_68.pageNumber,rows:_68.pageSize}); } if(_68.sortName){ $.extend(_6a,{sort:_68.sortName,order:_68.sortOrder}); } var row=_37(_63,_64); if(_68.onBeforeLoad.call(_63,row,_6a)==false){ return; } var _6b=_69.find("tr[node-id=\""+_64+"\"] span.tree-folder"); _6b.addClass("tree-loading"); $(_63).treegrid("loading"); var _6c=_68.loader.call(_63,_6a,function(_6d){ _6b.removeClass("tree-loading"); $(_63).treegrid("loaded"); _56(_63,_64,_6d,_66); if(_67){ _67(); } },function(){ _6b.removeClass("tree-loading"); $(_63).treegrid("loaded"); _68.onLoadError.apply(_63,arguments); if(_67){ _67(); } }); if(_6c==false){ _6b.removeClass("tree-loading"); $(_63).treegrid("loaded"); } }; function _6e(_6f){ var _70=_71(_6f); return _70.length?_70[0]:null; }; function _71(_72){ return $.data(_72,"treegrid").data; }; function _46(_73,_74){ var row=_37(_73,_74); if(row._parentId){ return _37(_73,row._parentId); }else{ return null; } }; function _1b(_75,_76){ var _77=$.data(_75,"treegrid").data; if(_76){ var _78=_37(_75,_76); _77=_78?(_78.children||[]):[]; } var _79=[]; $.easyui.forEach(_77,true,function(_7a){ _79.push(_7a); }); return _79; }; function _7b(_7c,_7d){ var _7e=$.data(_7c,"treegrid").options; var tr=_7e.finder.getTr(_7c,_7d); var _7f=tr.children("td[field=\""+_7e.treeField+"\"]"); return _7f.find("span.tree-indent,span.tree-hit").length; }; function _37(_80,_81){ var _82=$.data(_80,"treegrid"); var _83=_82.options; var _84=null; $.easyui.forEach(_82.data,true,function(_85){ if(_85[_83.idField]==_81){ _84=_85; return false; } }); return _84; }; function _86(_87,_88){ var _89=$.data(_87,"treegrid").options; var row=_37(_87,_88); var tr=_89.finder.getTr(_87,_88); var hit=tr.find("span.tree-hit"); if(hit.length==0){ return; } if(hit.hasClass("tree-collapsed")){ return; } if(_89.onBeforeCollapse.call(_87,row)==false){ return; } hit.removeClass("tree-expanded tree-expanded-hover").addClass("tree-collapsed"); hit.next().removeClass("tree-folder-open"); row.state="closed"; tr=tr.next("tr.treegrid-tr-tree"); var cc=tr.children("td").children("div"); if(_89.animate){ cc.slideUp("normal",function(){ $(_87).treegrid("autoSizeColumn"); _16(_87,_88); _89.onCollapse.call(_87,row); }); }else{ cc.hide(); $(_87).treegrid("autoSizeColumn"); _16(_87,_88); _89.onCollapse.call(_87,row); } }; function _8a(_8b,_8c){ var _8d=$.data(_8b,"treegrid").options; var tr=_8d.finder.getTr(_8b,_8c); var hit=tr.find("span.tree-hit"); var row=_37(_8b,_8c); if(hit.length==0){ return; } if(hit.hasClass("tree-expanded")){ return; } if(_8d.onBeforeExpand.call(_8b,row)==false){ return; } hit.removeClass("tree-collapsed tree-collapsed-hover").addClass("tree-expanded"); hit.next().addClass("tree-folder-open"); var _8e=tr.next("tr.treegrid-tr-tree"); if(_8e.length){ var cc=_8e.children("td").children("div"); _8f(cc); }else{ _4e(_8b,row[_8d.idField]); var _8e=tr.next("tr.treegrid-tr-tree"); var cc=_8e.children("td").children("div"); cc.hide(); var _90=$.extend({},_8d.queryParams||{}); _90.id=row[_8d.idField]; _15(_8b,row[_8d.idField],_90,true,function(){ if(cc.is(":empty")){ _8e.remove(); }else{ _8f(cc); } }); } function _8f(cc){ row.state="open"; if(_8d.animate){ cc.slideDown("normal",function(){ $(_8b).treegrid("autoSizeColumn"); _16(_8b,_8c); _8d.onExpand.call(_8b,row); }); }else{ cc.show(); $(_8b).treegrid("autoSizeColumn"); _16(_8b,_8c); _8d.onExpand.call(_8b,row); } }; }; function _28(_91,_92){ var _93=$.data(_91,"treegrid").options; var tr=_93.finder.getTr(_91,_92); var hit=tr.find("span.tree-hit"); if(hit.hasClass("tree-expanded")){ _86(_91,_92); }else{ _8a(_91,_92); } }; function _94(_95,_96){ var _97=$.data(_95,"treegrid").options; var _98=_1b(_95,_96); if(_96){ _98.unshift(_37(_95,_96)); } for(var i=0;i<_98.length;i++){ _86(_95,_98[i][_97.idField]); } }; function _99(_9a,_9b){ var _9c=$.data(_9a,"treegrid").options; var _9d=_1b(_9a,_9b); if(_9b){ _9d.unshift(_37(_9a,_9b)); } for(var i=0;i<_9d.length;i++){ _8a(_9a,_9d[i][_9c.idField]); } }; function _9e(_9f,_a0){ var _a1=$.data(_9f,"treegrid").options; var ids=[]; var p=_46(_9f,_a0); while(p){ var id=p[_a1.idField]; ids.unshift(id); p=_46(_9f,id); } for(var i=0;i").insertBefore(_a8); if(hit.prev().length){ hit.prev().remove(); } } } _56(_a3,_a4.parent,_a4.data,_a5.data.length>0,true); }; function _a9(_aa,_ab){ var ref=_ab.before||_ab.after; var _ac=$.data(_aa,"treegrid").options; var _ad=_46(_aa,ref); _a2(_aa,{parent:(_ad?_ad[_ac.idField]:null),data:[_ab.data]}); var _ae=_ad?_ad.children:$(_aa).treegrid("getRoots"); for(var i=0;i<_ae.length;i++){ if(_ae[i][_ac.idField]==ref){ var _af=_ae[_ae.length-1]; _ae.splice(_ab.before?i:(i+1),0,_af); _ae.splice(_ae.length-1,1); break; } } _b0(true); _b0(false); _1f(_aa); $(_aa).treegrid("showLines"); function _b0(_b1){ var _b2=_b1?1:2; var tr=_ac.finder.getTr(_aa,_ab.data[_ac.idField],"body",_b2); var _b3=tr.closest("table.datagrid-btable"); tr=tr.parent().children(); var _b4=_ac.finder.getTr(_aa,ref,"body",_b2); if(_ab.before){ tr.insertBefore(_b4); }else{ var sub=_b4.next("tr.treegrid-tr-tree"); tr.insertAfter(sub.length?sub:_b4); } _b3.remove(); }; }; function _b5(_b6,_b7){ var _b8=$.data(_b6,"treegrid"); var _b9=_b8.options; var _ba=_46(_b6,_b7); $(_b6).datagrid("deleteRow",_b7); $.easyui.removeArrayItem(_b8.checkedRows,_b9.idField,_b7); _1f(_b6); if(_ba){ _49(_b6,_ba[_b9.idField]); } _b8.total-=1; $(_b6).datagrid("getPager").pagination("refresh",{total:_b8.total}); $(_b6).treegrid("showLines"); }; function _bb(_bc){ var t=$(_bc); var _bd=t.treegrid("options"); if(_bd.lines){ t.treegrid("getPanel").addClass("tree-lines"); }else{ t.treegrid("getPanel").removeClass("tree-lines"); return; } t.treegrid("getPanel").find("span.tree-indent").removeClass("tree-line tree-join tree-joinbottom"); t.treegrid("getPanel").find("div.datagrid-cell").removeClass("tree-node-last tree-root-first tree-root-one"); var _be=t.treegrid("getRoots"); if(_be.length>1){ _bf(_be[0]).addClass("tree-root-first"); }else{ if(_be.length==1){ _bf(_be[0]).addClass("tree-root-one"); } } _c0(_be); _c1(_be); function _c0(_c2){ $.map(_c2,function(_c3){ if(_c3.children&&_c3.children.length){ _c0(_c3.children); }else{ var _c4=_bf(_c3); _c4.find(".tree-icon").prev().addClass("tree-join"); } }); if(_c2.length){ var _c5=_bf(_c2[_c2.length-1]); _c5.addClass("tree-node-last"); _c5.find(".tree-join").removeClass("tree-join").addClass("tree-joinbottom"); } }; function _c1(_c6){ $.map(_c6,function(_c7){ if(_c7.children&&_c7.children.length){ _c1(_c7.children); } }); for(var i=0;i<_c6.length-1;i++){ var _c8=_c6[i]; var _c9=t.treegrid("getLevel",_c8[_bd.idField]); var tr=_bd.finder.getTr(_bc,_c8[_bd.idField]); var cc=tr.next().find("tr.datagrid-row td[field=\""+_bd.treeField+"\"] div.datagrid-cell"); cc.find("span:eq("+(_c9-1)+")").addClass("tree-line"); } }; function _bf(_ca){ var tr=_bd.finder.getTr(_bc,_ca[_bd.idField]); var _cb=tr.find("td[field=\""+_bd.treeField+"\"] div.datagrid-cell"); return _cb; }; }; $.fn.treegrid=function(_cc,_cd){ if(typeof _cc=="string"){ var _ce=$.fn.treegrid.methods[_cc]; if(_ce){ return _ce(this,_cd); }else{ return this.datagrid(_cc,_cd); } } _cc=_cc||{}; return this.each(function(){ var _cf=$.data(this,"treegrid"); if(_cf){ $.extend(_cf.options,_cc); }else{ _cf=$.data(this,"treegrid",{options:$.extend({},$.fn.treegrid.defaults,$.fn.treegrid.parseOptions(this),_cc),data:[],checkedRows:[],tmpIds:[]}); } _1(this); if(_cf.options.data){ $(this).treegrid("loadData",_cf.options.data); } _15(this); }); }; $.fn.treegrid.methods={options:function(jq){ return $.data(jq[0],"treegrid").options; },resize:function(jq,_d0){ return jq.each(function(){ $(this).datagrid("resize",_d0); }); },fixRowHeight:function(jq,_d1){ return jq.each(function(){ _16(this,_d1); }); },loadData:function(jq,_d2){ return jq.each(function(){ _56(this,_d2.parent,_d2); }); },load:function(jq,_d3){ return jq.each(function(){ $(this).treegrid("options").pageNumber=1; $(this).treegrid("getPager").pagination({pageNumber:1}); $(this).treegrid("reload",_d3); }); },reload:function(jq,id){ return jq.each(function(){ var _d4=$(this).treegrid("options"); var _d5={}; if(typeof id=="object"){ _d5=id; }else{ _d5=$.extend({},_d4.queryParams); _d5.id=id; } if(_d5.id){ var _d6=$(this).treegrid("find",_d5.id); if(_d6.children){ _d6.children.splice(0,_d6.children.length); } _d4.queryParams=_d5; var tr=_d4.finder.getTr(this,_d5.id); tr.next("tr.treegrid-tr-tree").remove(); tr.find("span.tree-hit").removeClass("tree-expanded tree-expanded-hover").addClass("tree-collapsed"); _8a(this,_d5.id); }else{ _15(this,null,_d5); } }); },reloadFooter:function(jq,_d7){ return jq.each(function(){ var _d8=$.data(this,"treegrid").options; var dc=$.data(this,"datagrid").dc; if(_d7){ $.data(this,"treegrid").footer=_d7; } if(_d8.showFooter){ _d8.view.renderFooter.call(_d8.view,this,dc.footer1,true); _d8.view.renderFooter.call(_d8.view,this,dc.footer2,false); if(_d8.view.onAfterRender){ _d8.view.onAfterRender.call(_d8.view,this); } $(this).treegrid("fixRowHeight"); } }); },getData:function(jq){ return $.data(jq[0],"treegrid").data; },getFooterRows:function(jq){ return $.data(jq[0],"treegrid").footer; },getRoot:function(jq){ return _6e(jq[0]); },getRoots:function(jq){ return _71(jq[0]); },getParent:function(jq,id){ return _46(jq[0],id); },getChildren:function(jq,id){ return _1b(jq[0],id); },getLevel:function(jq,id){ return _7b(jq[0],id); },find:function(jq,id){ return _37(jq[0],id); },isLeaf:function(jq,id){ var _d9=$.data(jq[0],"treegrid").options; var tr=_d9.finder.getTr(jq[0],id); var hit=tr.find("span.tree-hit"); return hit.length==0; },select:function(jq,id){ return jq.each(function(){ $(this).datagrid("selectRow",id); }); },unselect:function(jq,id){ return jq.each(function(){ $(this).datagrid("unselectRow",id); }); },collapse:function(jq,id){ return jq.each(function(){ _86(this,id); }); },expand:function(jq,id){ return jq.each(function(){ _8a(this,id); }); },toggle:function(jq,id){ return jq.each(function(){ _28(this,id); }); },collapseAll:function(jq,id){ return jq.each(function(){ _94(this,id); }); },expandAll:function(jq,id){ return jq.each(function(){ _99(this,id); }); },expandTo:function(jq,id){ return jq.each(function(){ _9e(this,id); }); },append:function(jq,_da){ return jq.each(function(){ _a2(this,_da); }); },insert:function(jq,_db){ return jq.each(function(){ _a9(this,_db); }); },remove:function(jq,id){ return jq.each(function(){ _b5(this,id); }); },pop:function(jq,id){ var row=jq.treegrid("find",id); jq.treegrid("remove",id); return row; },refresh:function(jq,id){ return jq.each(function(){ var _dc=$.data(this,"treegrid").options; _dc.view.refreshRow.call(_dc.view,this,id); }); },update:function(jq,_dd){ return jq.each(function(){ var _de=$.data(this,"treegrid").options; var row=_dd.row; _de.view.updateRow.call(_de.view,this,_dd.id,row); if(row.checked!=undefined){ row=_37(this,_dd.id); $.extend(row,{checkState:row.checked?"checked":(row.checked===false?"unchecked":undefined)}); _49(this,_dd.id); } }); },beginEdit:function(jq,id){ return jq.each(function(){ $(this).datagrid("beginEdit",id); $(this).treegrid("fixRowHeight",id); }); },endEdit:function(jq,id){ return jq.each(function(){ $(this).datagrid("endEdit",id); }); },cancelEdit:function(jq,id){ return jq.each(function(){ $(this).datagrid("cancelEdit",id); }); },showLines:function(jq){ return jq.each(function(){ _bb(this); }); },setSelectionState:function(jq){ return jq.each(function(){ $(this).datagrid("setSelectionState"); var _df=$(this).data("treegrid"); for(var i=0;i<_df.tmpIds.length;i++){ _29(this,_df.tmpIds[i],true,true); } _df.tmpIds=[]; }); },getCheckedNodes:function(jq,_e0){ _e0=_e0||"checked"; var _e1=[]; $.easyui.forEach(jq.data("treegrid").checkedRows,false,function(row){ if(row.checkState==_e0){ _e1.push(row); } }); return _e1; },checkNode:function(jq,id){ return jq.each(function(){ _29(this,id,true); }); },uncheckNode:function(jq,id){ return jq.each(function(){ _29(this,id,false); }); },clearChecked:function(jq){ return jq.each(function(){ var _e2=this; var _e3=$(_e2).treegrid("options"); $(_e2).datagrid("clearChecked"); $.map($(_e2).treegrid("getCheckedNodes"),function(row){ _29(_e2,row[_e3.idField],false,true); }); }); }}; $.fn.treegrid.parseOptions=function(_e4){ return $.extend({},$.fn.datagrid.parseOptions(_e4),$.parser.parseOptions(_e4,["treeField",{checkbox:"boolean",cascadeCheck:"boolean",onlyLeafCheck:"boolean"},{animate:"boolean"}])); }; var _e5=$.extend({},$.fn.datagrid.defaults.view,{render:function(_e6,_e7,_e8){ var _e9=$.data(_e6,"treegrid").options; var _ea=$(_e6).datagrid("getColumnFields",_e8); var _eb=$.data(_e6,"datagrid").rowIdPrefix; if(_e8){ if(!(_e9.rownumbers||(_e9.frozenColumns&&_e9.frozenColumns.length))){ return; } } var _ec=this; if(this.treeNodes&&this.treeNodes.length){ var _ed=_ee.call(this,_e8,this.treeLevel,this.treeNodes); $(_e7).append(_ed.join("")); } function _ee(_ef,_f0,_f1){ var _f2=$(_e6).treegrid("getParent",_f1[0][_e9.idField]); var _f3=(_f2?_f2.children.length:$(_e6).treegrid("getRoots").length)-_f1.length; var _f4=[""]; for(var i=0;i<_f1.length;i++){ var row=_f1[i]; if(row.state!="open"&&row.state!="closed"){ row.state="open"; } var css=_e9.rowStyler?_e9.rowStyler.call(_e6,row):""; var cs=this.getStyleValue(css); var cls="class=\"datagrid-row "+(_f3++%2&&_e9.striped?"datagrid-row-alt ":" ")+cs.c+"\""; var _f5=cs.s?"style=\""+cs.s+"\"":""; var _f6=_eb+"-"+(_ef?1:2)+"-"+row[_e9.idField]; _f4.push(""); _f4=_f4.concat(_ec.renderRow.call(_ec,_e6,_ea,_ef,_f0,row)); _f4.push(""); if(row.children&&row.children.length){ var tt=_ee.call(this,_ef,_f0+1,row.children); var v=row.state=="closed"?"none":"block"; _f4.push(""); } } _f4.push("
          "); _f4=_f4.concat(tt); _f4.push("
          "); return _f4; }; },renderFooter:function(_f7,_f8,_f9){ var _fa=$.data(_f7,"treegrid").options; var _fb=$.data(_f7,"treegrid").footer||[]; var _fc=$(_f7).datagrid("getColumnFields",_f9); var _fd=[""]; for(var i=0;i<_fb.length;i++){ var row=_fb[i]; row[_fa.idField]=row[_fa.idField]||("foot-row-id"+i); _fd.push(""); _fd.push(this.renderRow.call(this,_f7,_fc,_f9,0,row)); _fd.push(""); } _fd.push("
          "); $(_f8).html(_fd.join("")); },renderRow:function(_fe,_ff,_100,_101,row){ var _102=$.data(_fe,"treegrid"); var opts=_102.options; var cc=[]; if(_100&&opts.rownumbers){ cc.push("
          0
          "); } for(var i=0;i<_ff.length;i++){ var _103=_ff[i]; var col=$(_fe).datagrid("getColumnOption",_103); if(col){ var css=col.styler?(col.styler(row[_103],row)||""):""; var cs=this.getStyleValue(css); var cls=cs.c?"class=\""+cs.c+"\"":""; var _104=col.hidden?"style=\"display:none;"+cs.s+"\"":(cs.s?"style=\""+cs.s+"\"":""); cc.push(""); var _104=""; if(!col.checkbox){ if(col.align){ _104+="text-align:"+col.align+";"; } if(!opts.nowrap){ _104+="white-space:normal;height:auto;"; }else{ if(opts.autoRowHeight){ _104+="height:auto;"; } } } cc.push("
          "); if(col.checkbox){ if(row.checked){ cc.push(""); }else{ var val=null; if(col.formatter){ val=col.formatter(row[_103],row); }else{ val=row[_103]; } if(_103==opts.treeField){ for(var j=0;j<_101;j++){ cc.push(""); } if(row.state=="closed"){ cc.push(""); cc.push(""); }else{ if(row.children&&row.children.length){ cc.push(""); cc.push(""); }else{ cc.push(""); cc.push(""); } } if(this.hasCheckbox(_fe,row)){ var flag=0; var crow=$.easyui.getArrayItem(_102.checkedRows,opts.idField,row[opts.idField]); if(crow){ flag=crow.checkState=="checked"?1:2; row.checkState=crow.checkState; row.checked=crow.checked; $.easyui.addArrayItem(_102.checkedRows,opts.idField,row); }else{ var prow=$.easyui.getArrayItem(_102.checkedRows,opts.idField,row._parentId); if(prow&&prow.checkState=="checked"&&opts.cascadeCheck){ flag=1; row.checked=true; $.easyui.addArrayItem(_102.checkedRows,opts.idField,row); }else{ if(row.checked){ $.easyui.addArrayItem(_102.tmpIds,row[opts.idField]); } } row.checkState=flag?"checked":"unchecked"; } cc.push(""); }else{ row.checkState=undefined; row.checked=undefined; } cc.push(""+val+""); }else{ cc.push(val); } } cc.push("
          "); cc.push(""); } } return cc.join(""); },hasCheckbox:function(_105,row){ var opts=$.data(_105,"treegrid").options; if(opts.checkbox){ if($.isFunction(opts.checkbox)){ if(opts.checkbox.call(_105,row)){ return true; }else{ return false; } }else{ if(opts.onlyLeafCheck){ if(row.state=="open"&&!(row.children&&row.children.length)){ return true; } }else{ return true; } } } return false; },refreshRow:function(_106,id){ this.updateRow.call(this,_106,id,{}); },updateRow:function(_107,id,row){ var opts=$.data(_107,"treegrid").options; var _108=$(_107).treegrid("find",id); $.extend(_108,row); var _109=$(_107).treegrid("getLevel",id)-1; var _10a=opts.rowStyler?opts.rowStyler.call(_107,_108):""; var _10b=$.data(_107,"datagrid").rowIdPrefix; var _10c=_108[opts.idField]; function _10d(_10e){ var _10f=$(_107).treegrid("getColumnFields",_10e); var tr=opts.finder.getTr(_107,id,"body",(_10e?1:2)); var _110=tr.find("div.datagrid-cell-rownumber").html(); var _111=tr.find("div.datagrid-cell-check input[type=checkbox]").is(":checked"); tr.html(this.renderRow(_107,_10f,_10e,_109,_108)); tr.attr("style",_10a||""); tr.find("div.datagrid-cell-rownumber").html(_110); if(_111){ tr.find("div.datagrid-cell-check input[type=checkbox]")._propAttr("checked",true); } if(_10c!=id){ tr.attr("id",_10b+"-"+(_10e?1:2)+"-"+_10c); tr.attr("node-id",_10c); } }; _10d.call(this,true); _10d.call(this,false); $(_107).treegrid("fixRowHeight",id); },deleteRow:function(_112,id){ var opts=$.data(_112,"treegrid").options; var tr=opts.finder.getTr(_112,id); tr.next("tr.treegrid-tr-tree").remove(); tr.remove(); var _113=del(id); if(_113){ if(_113.children.length==0){ tr=opts.finder.getTr(_112,_113[opts.idField]); tr.next("tr.treegrid-tr-tree").remove(); var cell=tr.children("td[field=\""+opts.treeField+"\"]").children("div.datagrid-cell"); cell.find(".tree-icon").removeClass("tree-folder").addClass("tree-file"); cell.find(".tree-hit").remove(); $("").prependTo(cell); } } this.setEmptyMsg(_112); function del(id){ var cc; var _114=$(_112).treegrid("getParent",id); if(_114){ cc=_114.children; }else{ cc=$(_112).treegrid("getData"); } for(var i=0;ib?1:-1); }; r=_11f(r1[sn],r2[sn])*(so=="asc"?1:-1); if(r!=0){ return r; } } return r; }); for(var i=0;i=_45[0]&&len<=_45[1]; },message:"Please enter a value between {0} and {1}."},remote:{validator:function(_46,_47){ var _48={}; _48[_47[1]]=_46; var _49=$.ajax({url:_47[0],dataType:"json",data:_48,async:false,cache:false,type:"post"}).responseText; return _49=="true"; },message:"Please fix this field."}},onBeforeValidate:function(){ },onValidate:function(_4a){ }}; })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/plugins/jquery.window.js ================================================ /** * jQuery EasyUI 1.5.1 * * Copyright (c) 2009-2016 www.jeasyui.com. All rights reserved. * * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php * To use it on other terms please contact us: info@jeasyui.com * */ (function($){ function _1(_2,_3){ var _4=$.data(_2,"window"); if(_3){ if(_3.left!=null){ _4.options.left=_3.left; } if(_3.top!=null){ _4.options.top=_3.top; } } $(_2).panel("move",_4.options); if(_4.shadow){ _4.shadow.css({left:_4.options.left,top:_4.options.top}); } }; function _5(_6,_7){ var _8=$.data(_6,"window").options; var pp=$(_6).window("panel"); var _9=pp._outerWidth(); if(_8.inline){ var _a=pp.parent(); _8.left=Math.ceil((_a.width()-_9)/2+_a.scrollLeft()); }else{ _8.left=Math.ceil(($(window)._outerWidth()-_9)/2+$(document).scrollLeft()); } if(_7){ _1(_6); } }; function _b(_c,_d){ var _e=$.data(_c,"window").options; var pp=$(_c).window("panel"); var _f=pp._outerHeight(); if(_e.inline){ var _10=pp.parent(); _e.top=Math.ceil((_10.height()-_f)/2+_10.scrollTop()); }else{ _e.top=Math.ceil(($(window)._outerHeight()-_f)/2+$(document).scrollTop()); } if(_d){ _1(_c); } }; function _11(_12){ var _13=$.data(_12,"window"); var _14=_13.options; var win=$(_12).panel($.extend({},_13.options,{border:false,doSize:true,closed:true,cls:"window "+(!_14.border?"window-thinborder window-noborder ":(_14.border=="thin"?"window-thinborder ":""))+(_14.cls||""),headerCls:"window-header "+(_14.headerCls||""),bodyCls:"window-body "+(_14.noheader?"window-body-noheader ":" ")+(_14.bodyCls||""),onBeforeDestroy:function(){ if(_14.onBeforeDestroy.call(_12)==false){ return false; } if(_13.shadow){ _13.shadow.remove(); } if(_13.mask){ _13.mask.remove(); } },onClose:function(){ if(_13.shadow){ _13.shadow.hide(); } if(_13.mask){ _13.mask.hide(); } _14.onClose.call(_12); },onOpen:function(){ if(_13.mask){ _13.mask.css($.extend({display:"block",zIndex:$.fn.window.defaults.zIndex++},$.fn.window.getMaskSize(_12))); } if(_13.shadow){ _13.shadow.css({display:"block",zIndex:$.fn.window.defaults.zIndex++,left:_14.left,top:_14.top,width:_13.window._outerWidth(),height:_13.window._outerHeight()}); } _13.window.css("z-index",$.fn.window.defaults.zIndex++); _14.onOpen.call(_12); },onResize:function(_15,_16){ var _17=$(this).panel("options"); $.extend(_14,{width:_17.width,height:_17.height,left:_17.left,top:_17.top}); if(_13.shadow){ _13.shadow.css({left:_14.left,top:_14.top,width:_13.window._outerWidth(),height:_13.window._outerHeight()}); } _14.onResize.call(_12,_15,_16); },onMinimize:function(){ if(_13.shadow){ _13.shadow.hide(); } if(_13.mask){ _13.mask.hide(); } _13.options.onMinimize.call(_12); },onBeforeCollapse:function(){ if(_14.onBeforeCollapse.call(_12)==false){ return false; } if(_13.shadow){ _13.shadow.hide(); } },onExpand:function(){ if(_13.shadow){ _13.shadow.show(); } _14.onExpand.call(_12); }})); _13.window=win.panel("panel"); if(_13.mask){ _13.mask.remove(); } if(_14.modal){ _13.mask=$("
          ").insertAfter(_13.window); } if(_13.shadow){ _13.shadow.remove(); } if(_14.shadow){ _13.shadow=$("
          ").insertAfter(_13.window); } var _18=_14.closed; if(_14.left==null){ _5(_12); } if(_14.top==null){ _b(_12); } _1(_12); if(!_18){ win.window("open"); } }; function _19(_1a,top,_1b,_1c){ var _1d=this; var _1e=$.data(_1d,"window"); var _1f=_1e.options; if(!_1f.constrain){ return {}; } if($.isFunction(_1f.constrain)){ return _1f.constrain.call(_1d,_1a,top,_1b,_1c); } var win=$(_1d).window("window"); var _20=_1f.inline?win.parent():$(window); if(_1a<0){ _1a=0; } if(top<_20.scrollTop()){ top=_20.scrollTop(); } if(_1a+_1b>_20.width()){ if(_1b==win.outerWidth()){ _1a=_20.width()-_1b; }else{ _1b=_20.width()-_1a; } } if(top-_20.scrollTop()+_1c>_20.height()){ if(_1c==win.outerHeight()){ top=_20.height()-_1c+_20.scrollTop(); }else{ _1c=_20.height()-top+_20.scrollTop(); } } return {left:_1a,top:top,width:_1b,height:_1c}; }; function _21(_22){ var _23=$.data(_22,"window"); _23.window.draggable({handle:">div.panel-header>div.panel-title",disabled:_23.options.draggable==false,onBeforeDrag:function(e){ if(_23.mask){ _23.mask.css("z-index",$.fn.window.defaults.zIndex++); } if(_23.shadow){ _23.shadow.css("z-index",$.fn.window.defaults.zIndex++); } _23.window.css("z-index",$.fn.window.defaults.zIndex++); },onStartDrag:function(e){ _24(e); },onDrag:function(e){ _25(e); return false; },onStopDrag:function(e){ _26(e,"move"); }}); _23.window.resizable({disabled:_23.options.resizable==false,onStartResize:function(e){ _24(e); },onResize:function(e){ _25(e); return false; },onStopResize:function(e){ _26(e,"resize"); }}); function _24(e){ if(_23.pmask){ _23.pmask.remove(); } _23.pmask=$("
          ").insertAfter(_23.window); _23.pmask.css({display:"none",zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top,width:_23.window._outerWidth(),height:_23.window._outerHeight()}); if(_23.proxy){ _23.proxy.remove(); } _23.proxy=$("
          ").insertAfter(_23.window); _23.proxy.css({display:"none",zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top}); _23.proxy._outerWidth(e.data.width)._outerHeight(e.data.height); _23.proxy.hide(); setTimeout(function(){ if(_23.pmask){ _23.pmask.show(); } if(_23.proxy){ _23.proxy.show(); } },500); }; function _25(e){ $.extend(e.data,_19.call(_22,e.data.left,e.data.top,e.data.width,e.data.height)); _23.pmask.show(); _23.proxy.css({display:"block",left:e.data.left,top:e.data.top}); _23.proxy._outerWidth(e.data.width); _23.proxy._outerHeight(e.data.height); }; function _26(e,_27){ $.extend(e.data,_19.call(_22,e.data.left,e.data.top,e.data.width+0.1,e.data.height+0.1)); $(_22).window(_27,e.data); _23.pmask.remove(); _23.pmask=null; _23.proxy.remove(); _23.proxy=null; }; }; $(function(){ if(!$._positionFixed){ $(window).resize(function(){ $("body>div.window-mask:visible").css({width:"",height:""}); setTimeout(function(){ $("body>div.window-mask:visible").css($.fn.window.getMaskSize()); },50); }); } }); $.fn.window=function(_28,_29){ if(typeof _28=="string"){ var _2a=$.fn.window.methods[_28]; if(_2a){ return _2a(this,_29); }else{ return this.panel(_28,_29); } } _28=_28||{}; return this.each(function(){ var _2b=$.data(this,"window"); if(_2b){ $.extend(_2b.options,_28); }else{ _2b=$.data(this,"window",{options:$.extend({},$.fn.window.defaults,$.fn.window.parseOptions(this),_28)}); if(!_2b.options.inline){ document.body.appendChild(this); } } _11(this); _21(this); }); }; $.fn.window.methods={options:function(jq){ var _2c=jq.panel("options"); var _2d=$.data(jq[0],"window").options; return $.extend(_2d,{closed:_2c.closed,collapsed:_2c.collapsed,minimized:_2c.minimized,maximized:_2c.maximized}); },window:function(jq){ return $.data(jq[0],"window").window; },move:function(jq,_2e){ return jq.each(function(){ _1(this,_2e); }); },hcenter:function(jq){ return jq.each(function(){ _5(this,true); }); },vcenter:function(jq){ return jq.each(function(){ _b(this,true); }); },center:function(jq){ return jq.each(function(){ _5(this); _b(this); _1(this); }); }}; $.fn.window.getMaskSize=function(_2f){ var _30=$(_2f).data("window"); if(_30&&_30.options.inline){ return {}; }else{ if($._positionFixed){ return {position:"fixed"}; }else{ return {width:$(document).width(),height:$(document).height()}; } } }; $.fn.window.parseOptions=function(_31){ return $.extend({},$.fn.panel.parseOptions(_31),$.parser.parseOptions(_31,[{draggable:"boolean",resizable:"boolean",shadow:"boolean",modal:"boolean",inline:"boolean"}])); }; $.fn.window.defaults=$.extend({},$.fn.panel.defaults,{zIndex:9000,draggable:true,resizable:true,shadow:true,modal:false,border:true,inline:false,title:"New Window",collapsible:true,minimizable:true,maximizable:true,closable:true,closed:false,constrain:false}); })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/accordion.css ================================================ .accordion { overflow: hidden; border-width: 1px; border-style: solid; } .accordion .accordion-header { border-width: 0 0 1px; cursor: pointer; } .accordion .accordion-body { border-width: 0 0 1px; } .accordion-noborder { border-width: 0; } .accordion-noborder .accordion-header { border-width: 0 0 1px; } .accordion-noborder .accordion-body { border-width: 0 0 1px; } .accordion-collapse { background: url('images/accordion_arrows.png') no-repeat 0 0; } .accordion-expand { background: url('images/accordion_arrows.png') no-repeat -16px 0; } .accordion { background: #ffffff; border-color: #D4D4D4; } .accordion .accordion-header { background: #F2F2F2; filter: none; } .accordion .accordion-header-selected { background: #0081c2; } .accordion .accordion-header-selected .panel-title { color: #fff; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/calendar.css ================================================ .calendar { border-width: 1px; border-style: solid; padding: 1px; overflow: hidden; } .calendar table { table-layout: fixed; border-collapse: separate; font-size: 12px; width: 100%; height: 100%; } .calendar table td, .calendar table th { font-size: 12px; } .calendar-noborder { border: 0; } .calendar-header { position: relative; height: 22px; } .calendar-title { text-align: center; height: 22px; } .calendar-title span { position: relative; display: inline-block; top: 2px; padding: 0 3px; height: 18px; line-height: 18px; font-size: 12px; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-prevmonth, .calendar-nextmonth, .calendar-prevyear, .calendar-nextyear { position: absolute; top: 50%; margin-top: -7px; width: 14px; height: 14px; cursor: pointer; font-size: 1px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-prevmonth { left: 20px; background: url('images/calendar_arrows.png') no-repeat -18px -2px; } .calendar-nextmonth { right: 20px; background: url('images/calendar_arrows.png') no-repeat -34px -2px; } .calendar-prevyear { left: 3px; background: url('images/calendar_arrows.png') no-repeat -1px -2px; } .calendar-nextyear { right: 3px; background: url('images/calendar_arrows.png') no-repeat -49px -2px; } .calendar-body { position: relative; } .calendar-body th, .calendar-body td { text-align: center; } .calendar-day { border: 0; padding: 1px; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-other-month { opacity: 0.3; filter: alpha(opacity=30); } .calendar-disabled { opacity: 0.6; filter: alpha(opacity=60); cursor: default; } .calendar-menu { position: absolute; top: 0; left: 0; width: 180px; height: 150px; padding: 5px; font-size: 12px; display: none; overflow: hidden; } .calendar-menu-year-inner { text-align: center; padding-bottom: 5px; } .calendar-menu-year { width: 50px; text-align: center; border-width: 1px; border-style: solid; outline-style: none; resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { display: inline-block; width: 21px; height: 21px; vertical-align: top; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-menu-prev { margin-right: 10px; background: url('images/calendar_arrows.png') no-repeat 2px 2px; } .calendar-menu-next { margin-left: 10px; background: url('images/calendar_arrows.png') no-repeat -45px 2px; } .calendar-menu-month { text-align: center; cursor: pointer; font-weight: bold; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-body th, .calendar-menu-month { color: #808080; } .calendar-day { color: #333; } .calendar-sunday { color: #CC2222; } .calendar-saturday { color: #00ee00; } .calendar-today { color: #0000ff; } .calendar-menu-year { border-color: #D4D4D4; } .calendar { border-color: #D4D4D4; } .calendar-header { background: #F2F2F2; } .calendar-body, .calendar-menu { background: #ffffff; } .calendar-body th { background: #F5F5F5; padding: 2px 0; } .calendar-hover, .calendar-nav-hover, .calendar-menu-hover { background-color: #e6e6e6; color: #00438a; } .calendar-hover { border: 1px solid #ddd; padding: 0; } .calendar-selected { background-color: #0081c2; color: #fff; border: 1px solid #0070a9; padding: 0; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/combo.css ================================================ .combo-arrow { width: 18px; height: 20px; overflow: hidden; display: inline-block; vertical-align: top; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); } .combo-arrow-hover { opacity: 1.0; filter: alpha(opacity=100); } .combo-panel { overflow: auto; } .combo-arrow { background: url('images/combo_arrow.png') no-repeat center center; } .combo-panel { background-color: #ffffff; } .combo-arrow { background-color: #F2F2F2; } .combo-arrow-hover { background-color: #e6e6e6; } .combo-arrow:hover { background-color: #e6e6e6; } .combo .textbox-icon-disabled:hover { cursor: default; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/combobox.css ================================================ .combobox-item, .combobox-group, .combobox-stick { font-size: 12px; padding: 3px; } .combobox-item-disabled { opacity: 0.5; filter: alpha(opacity=50); } .combobox-gitem { padding-left: 10px; } .combobox-group, .combobox-stick { font-weight: bold; } .combobox-stick { position: absolute; top: 1px; left: 1px; right: 1px; background: inherit; } .combobox-item-hover { background-color: #e6e6e6; color: #00438a; } .combobox-item-selected { background-color: #0081c2; color: #fff; } .combobox-icon { display: inline-block; width: 16px; height: 16px; vertical-align: middle; margin-right: 2px; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/datagrid.css ================================================ .datagrid .panel-body { overflow: hidden; position: relative; } .datagrid-view { position: relative; overflow: hidden; } .datagrid-view1, .datagrid-view2 { position: absolute; overflow: hidden; top: 0; } .datagrid-view1 { left: 0; } .datagrid-view2 { right: 0; } .datagrid-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0.3; filter: alpha(opacity=30); display: none; } .datagrid-mask-msg { position: absolute; top: 50%; margin-top: -20px; padding: 10px 5px 10px 30px; width: auto; height: 16px; border-width: 2px; border-style: solid; display: none; } .datagrid-empty { position: absolute; left: 0; top: 0; width: 100%; height: 25px; line-height: 25px; text-align: center; } .datagrid-sort-icon { padding: 0; display: none; } .datagrid-toolbar { height: auto; padding: 1px 2px; border-width: 0 0 1px 0; border-style: solid; } .datagrid-btn-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 2px 1px; } .datagrid .datagrid-pager { display: block; margin: 0; border-width: 1px 0 0 0; border-style: solid; } .datagrid .datagrid-pager-top { border-width: 0 0 1px 0; } .datagrid-header { overflow: hidden; cursor: default; border-width: 0 0 1px 0; border-style: solid; } .datagrid-header-inner { float: left; width: 10000px; } .datagrid-header-row, .datagrid-row { height: 25px; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-width: 0 1px 1px 0; border-style: dotted; margin: 0; padding: 0; } .datagrid-cell, .datagrid-cell-group, .datagrid-header-rownumber, .datagrid-cell-rownumber { margin: 0; padding: 0 4px; white-space: nowrap; word-wrap: normal; overflow: hidden; height: 18px; line-height: 18px; font-size: 12px; } .datagrid-header .datagrid-cell { height: auto; } .datagrid-header .datagrid-cell span { font-size: 12px; } .datagrid-cell-group { text-align: center; text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { width: 30px; text-align: center; margin: 0; padding: 0; } .datagrid-body { margin: 0; padding: 0; overflow: auto; zoom: 1; } .datagrid-view1 .datagrid-body-inner { padding-bottom: 20px; } .datagrid-view1 .datagrid-body { overflow: hidden; } .datagrid-footer { overflow: hidden; } .datagrid-footer-inner { border-width: 1px 0 0 0; border-style: solid; width: 10000px; float: left; } .datagrid-row-editing .datagrid-cell { height: auto; } .datagrid-header-check, .datagrid-cell-check { padding: 0; width: 27px; height: 18px; font-size: 1px; text-align: center; overflow: hidden; } .datagrid-header-check input, .datagrid-cell-check input { margin: 0; padding: 0; width: 15px; height: 18px; } .datagrid-resize-proxy { position: absolute; width: 1px; height: 10000px; top: 0; cursor: e-resize; display: none; } .datagrid-body .datagrid-editable { margin: 0; padding: 0; } .datagrid-body .datagrid-editable table { width: 100%; height: 100%; } .datagrid-body .datagrid-editable td { border: 0; margin: 0; padding: 0; } .datagrid-view .datagrid-editable-input { margin: 0; padding: 2px 4px; border: 1px solid #D4D4D4; font-size: 12px; outline-style: none; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .datagrid-view .validatebox-invalid { border-color: #ffa8a8; } .datagrid-sort .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -64px center; } .datagrid-sort-desc .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } .datagrid-row-collapse { background: url('images/datagrid_icons.png') no-repeat -48px center; } .datagrid-row-expand { background: url('images/datagrid_icons.png') no-repeat -32px center; } .datagrid-mask-msg { background: #ffffff url('images/loading.gif') no-repeat scroll 5px center; } .datagrid-header, .datagrid-td-rownumber { background-color: #F2F2F2; background: -webkit-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -moz-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -o-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); } .datagrid-cell-rownumber { color: #333; } .datagrid-resize-proxy { background: #bbb; } .datagrid-mask { background: #ccc; } .datagrid-mask-msg { border-color: #D4D4D4; } .datagrid-toolbar, .datagrid-pager { background: #F5F5F5; } .datagrid-header, .datagrid-toolbar, .datagrid-pager, .datagrid-footer-inner { border-color: #e6e6e6; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-color: #ccc; } .datagrid-htable, .datagrid-btable, .datagrid-ftable { color: #333; border-collapse: separate; } .datagrid-row-alt { background: #F5F5F5; } .datagrid-row-over, .datagrid-header td.datagrid-header-over { background: #e6e6e6; color: #00438a; cursor: default; } .datagrid-row-selected { background: #0081c2; color: #fff; } .datagrid-row-editing .textbox, .datagrid-row-editing .textbox-text { -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/datalist.css ================================================ .datalist .datagrid-header { border-width: 0; } .datalist .datagrid-group, .m-list .m-list-group { height: 25px; line-height: 25px; font-weight: bold; overflow: hidden; background-color: #F2F2F2; border-style: solid; border-width: 0 0 1px 0; border-color: #ccc; } .datalist .datagrid-group-expander { display: none; } .datalist .datagrid-group-title { padding: 0 4px; } .datalist .datagrid-btable { width: 100%; table-layout: fixed; } .datalist .datagrid-row td { border-style: solid; border-left-color: transparent; border-right-color: transparent; border-bottom-width: 0; } .datalist-lines .datagrid-row td { border-bottom-width: 1px; } .datalist .datagrid-cell, .m-list li { width: auto; height: auto; padding: 2px 4px; line-height: 18px; position: relative; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .datalist-link, .m-list li>a { display: block; position: relative; cursor: pointer; color: #333; text-decoration: none; overflow: hidden; margin: -2px -4px; padding: 2px 4px; padding-right: 16px; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .datalist-link::after, .m-list li>a::after { position: absolute; display: block; width: 8px; height: 8px; content: ''; right: 6px; top: 50%; margin-top: -4px; border-style: solid; border-width: 1px 1px 0 0; -ms-transform: rotate(45deg); -moz-transform: rotate(45deg); -webkit-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); } .m-list { margin: 0; padding: 0; list-style: none; } .m-list li { border-style: solid; border-width: 0 0 1px 0; border-color: #ccc; } .m-list li>a:hover { background: #e6e6e6; color: #00438a; } .m-list .m-list-group { padding: 0 4px; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/datebox.css ================================================ .datebox-calendar-inner { height: 180px; } .datebox-button { padding: 0 5px; text-align: center; } .datebox-button a { line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; opacity: 0.6; filter: alpha(opacity=60); } .datebox-button a:hover { opacity: 1.0; filter: alpha(opacity=100); } .datebox-current, .datebox-close { float: left; } .datebox-close { float: right; } .datebox .combo-arrow { background-image: url('images/datebox_arrow.png'); background-position: center center; } .datebox-button { background-color: #F5F5F5; } .datebox-button a { color: #444; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/dialog.css ================================================ .dialog-content { overflow: auto; } .dialog-toolbar { position: relative; padding: 2px 5px; } .dialog-tool-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 2px 1px; } .dialog-button { position: relative; top: -1px; padding: 5px; text-align: right; } .dialog-button .l-btn { margin-left: 5px; } .dialog-toolbar, .dialog-button { background: #F5F5F5; border-width: 1px; border-style: solid; } .dialog-toolbar { border-color: #D4D4D4 #D4D4D4 #e6e6e6 #D4D4D4; } .dialog-button { border-color: #e6e6e6 #D4D4D4 #D4D4D4 #D4D4D4; } .window-thinborder .dialog-toolbar { border-left: transparent; border-right: transparent; border-top-color: #F5F5F5; } .window-thinborder .dialog-button { top: 0px; padding: 5px 8px 8px 8px; border-left: transparent; border-right: transparent; border-bottom: transparent; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/easyui.css ================================================ .panel { overflow: hidden; text-align: left; margin: 0; border: 0; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .panel-header, .panel-body { border-width: 1px; border-style: solid; } .panel-header { padding: 5px; position: relative; } .panel-title { background: url('images/blank.gif') no-repeat; } .panel-header-noborder { border-width: 0 0 1px 0; } .panel-body { overflow: auto; border-top-width: 0; padding: 0; } .panel-body-noheader { border-top-width: 1px; } .panel-body-noborder { border-width: 0px; } .panel-body-nobottom { border-bottom-width: 0; } .panel-with-icon { padding-left: 18px; } .panel-icon, .panel-tool { position: absolute; top: 50%; margin-top: -8px; height: 16px; overflow: hidden; } .panel-icon { left: 5px; width: 16px; } .panel-tool { right: 5px; width: auto; } .panel-tool a { display: inline-block; width: 16px; height: 16px; opacity: 0.6; filter: alpha(opacity=60); margin: 0 0 0 2px; vertical-align: top; } .panel-tool a:hover { opacity: 1; filter: alpha(opacity=100); background-color: #e6e6e6; -moz-border-radius: 3px 3px 3px 3px; -webkit-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; } .panel-loading { padding: 11px 0px 10px 30px; } .panel-noscroll { overflow: hidden; } .panel-fit, .panel-fit body { height: 100%; margin: 0; padding: 0; border: 0; overflow: hidden; } .panel-loading { background: url('images/loading.gif') no-repeat 10px 10px; } .panel-tool-close { background: url('images/panel_tools.png') no-repeat -16px 0px; } .panel-tool-min { background: url('images/panel_tools.png') no-repeat 0px 0px; } .panel-tool-max { background: url('images/panel_tools.png') no-repeat 0px -16px; } .panel-tool-restore { background: url('images/panel_tools.png') no-repeat -16px -16px; } .panel-tool-collapse { background: url('images/panel_tools.png') no-repeat -32px 0; } .panel-tool-expand { background: url('images/panel_tools.png') no-repeat -32px -16px; } .panel-header, .panel-body { border-color: #D4D4D4; } .panel-header { background-color: #F2F2F2; background: -webkit-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -moz-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -o-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); } .panel-body { background-color: #ffffff; color: #333; font-size: 12px; } .panel-title { font-size: 12px; font-weight: bold; color: #777; height: 16px; line-height: 16px; } .panel-footer { border: 1px solid #D4D4D4; overflow: hidden; background: #F5F5F5; } .panel-footer-noborder { border-width: 1px 0 0 0; } .accordion { overflow: hidden; border-width: 1px; border-style: solid; } .accordion .accordion-header { border-width: 0 0 1px; cursor: pointer; } .accordion .accordion-body { border-width: 0 0 1px; } .accordion-noborder { border-width: 0; } .accordion-noborder .accordion-header { border-width: 0 0 1px; } .accordion-noborder .accordion-body { border-width: 0 0 1px; } .accordion-collapse { background: url('images/accordion_arrows.png') no-repeat 0 0; } .accordion-expand { background: url('images/accordion_arrows.png') no-repeat -16px 0; } .accordion { background: #ffffff; border-color: #D4D4D4; } .accordion .accordion-header { background: #F2F2F2; filter: none; } .accordion .accordion-header-selected { background: #0081c2; } .accordion .accordion-header-selected .panel-title { color: #fff; } .window { overflow: hidden; padding: 5px; border-width: 1px; border-style: solid; } .window .window-header { background: transparent; padding: 0px 0px 6px 0px; } .window .window-body { border-width: 1px; border-style: solid; border-top-width: 0px; } .window .window-body-noheader { border-top-width: 1px; } .window .panel-body-nobottom { border-bottom-width: 0; } .window .window-header .panel-icon, .window .window-header .panel-tool { top: 50%; margin-top: -11px; } .window .window-header .panel-icon { left: 1px; } .window .window-header .panel-tool { right: 1px; } .window .window-header .panel-with-icon { padding-left: 18px; } .window-proxy { position: absolute; overflow: hidden; } .window-proxy-mask { position: absolute; filter: alpha(opacity=5); opacity: 0.05; } .window-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; filter: alpha(opacity=40); opacity: 0.40; font-size: 1px; overflow: hidden; } .window, .window-shadow { position: absolute; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .window-shadow { background: #ccc; -moz-box-shadow: 2px 2px 3px #cccccc; -webkit-box-shadow: 2px 2px 3px #cccccc; box-shadow: 2px 2px 3px #cccccc; filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); } .window, .window .window-body { border-color: #D4D4D4; } .window { background-color: #F2F2F2; background: -webkit-linear-gradient(top,#ffffff 0,#F2F2F2 20%); background: -moz-linear-gradient(top,#ffffff 0,#F2F2F2 20%); background: -o-linear-gradient(top,#ffffff 0,#F2F2F2 20%); background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 20%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); } .window-proxy { border: 1px dashed #D4D4D4; } .window-proxy-mask, .window-mask { background: #ccc; } .window .panel-footer { border: 1px solid #D4D4D4; position: relative; top: -1px; } .window-thinborder { padding: 0; } .window-thinborder .window-header { padding: 5px 5px 6px 5px; } .window-thinborder .window-body { border-width: 0px; } .window-thinborder .window-header .panel-icon, .window-thinborder .window-header .panel-tool { margin-top: -9px; margin-left: 5px; margin-right: 5px; } .window-noborder { border: 0; } .dialog-content { overflow: auto; } .dialog-toolbar { position: relative; padding: 2px 5px; } .dialog-tool-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 2px 1px; } .dialog-button { position: relative; top: -1px; padding: 5px; text-align: right; } .dialog-button .l-btn { margin-left: 5px; } .dialog-toolbar, .dialog-button { background: #F5F5F5; border-width: 1px; border-style: solid; } .dialog-toolbar { border-color: #D4D4D4 #D4D4D4 #e6e6e6 #D4D4D4; } .dialog-button { border-color: #e6e6e6 #D4D4D4 #D4D4D4 #D4D4D4; } .window-thinborder .dialog-toolbar { border-left: transparent; border-right: transparent; border-top-color: #F5F5F5; } .window-thinborder .dialog-button { top: 0px; padding: 5px 8px 8px 8px; border-left: transparent; border-right: transparent; border-bottom: transparent; } .l-btn { text-decoration: none; display: inline-block; overflow: hidden; margin: 0; padding: 0; cursor: pointer; outline: none; text-align: center; vertical-align: middle; line-height: normal; } .l-btn-plain { border-width: 0; padding: 1px; } .l-btn-left { display: inline-block; position: relative; overflow: hidden; margin: 0; padding: 0; vertical-align: top; } .l-btn-text { display: inline-block; vertical-align: top; width: auto; line-height: 24px; font-size: 12px; padding: 0; margin: 0 4px; } .l-btn-icon { display: inline-block; width: 16px; height: 16px; line-height: 16px; position: absolute; top: 50%; margin-top: -8px; font-size: 1px; } .l-btn span span .l-btn-empty { display: inline-block; margin: 0; width: 16px; height: 24px; font-size: 1px; vertical-align: top; } .l-btn span .l-btn-icon-left { padding: 0 0 0 20px; background-position: left center; } .l-btn span .l-btn-icon-right { padding: 0 20px 0 0; background-position: right center; } .l-btn-icon-left .l-btn-text { margin: 0 4px 0 24px; } .l-btn-icon-left .l-btn-icon { left: 4px; } .l-btn-icon-right .l-btn-text { margin: 0 24px 0 4px; } .l-btn-icon-right .l-btn-icon { right: 4px; } .l-btn-icon-top .l-btn-text { margin: 20px 4px 0 4px; } .l-btn-icon-top .l-btn-icon { top: 4px; left: 50%; margin: 0 0 0 -8px; } .l-btn-icon-bottom .l-btn-text { margin: 0 4px 20px 4px; } .l-btn-icon-bottom .l-btn-icon { top: auto; bottom: 4px; left: 50%; margin: 0 0 0 -8px; } .l-btn-left .l-btn-empty { margin: 0 4px; width: 16px; } .l-btn-plain:hover { padding: 0; } .l-btn-focus { outline: #0000FF dotted thin; } .l-btn-large .l-btn-text { line-height: 40px; } .l-btn-large .l-btn-icon { width: 32px; height: 32px; line-height: 32px; margin-top: -16px; } .l-btn-large .l-btn-icon-left .l-btn-text { margin-left: 40px; } .l-btn-large .l-btn-icon-right .l-btn-text { margin-right: 40px; } .l-btn-large .l-btn-icon-top .l-btn-text { margin-top: 36px; line-height: 24px; min-width: 32px; } .l-btn-large .l-btn-icon-top .l-btn-icon { margin: 0 0 0 -16px; } .l-btn-large .l-btn-icon-bottom .l-btn-text { margin-bottom: 36px; line-height: 24px; min-width: 32px; } .l-btn-large .l-btn-icon-bottom .l-btn-icon { margin: 0 0 0 -16px; } .l-btn-large .l-btn-left .l-btn-empty { margin: 0 4px; width: 32px; } .l-btn { color: #444; background: #f5f5f5; background-repeat: repeat-x; border: 1px solid #bbb; background: -webkit-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: -moz-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: -o-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: linear-gradient(to bottom,#ffffff 0,#e6e6e6 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#e6e6e6,GradientType=0); -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .l-btn:hover { background: #e6e6e6; color: #00438a; border: 1px solid #ddd; filter: none; } .l-btn-plain { background: transparent; border-width: 0; filter: none; } .l-btn-outline { border-width: 1px; border-color: #ddd; padding: 0; } .l-btn-plain:hover { background: #e6e6e6; color: #00438a; border: 1px solid #ddd; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .l-btn-disabled, .l-btn-disabled:hover { opacity: 0.5; cursor: default; background: #f5f5f5; color: #444; background: -webkit-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: -moz-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: -o-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: linear-gradient(to bottom,#ffffff 0,#e6e6e6 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#e6e6e6,GradientType=0); } .l-btn-disabled .l-btn-text, .l-btn-disabled .l-btn-icon { filter: alpha(opacity=50); } .l-btn-plain-disabled, .l-btn-plain-disabled:hover { background: transparent; filter: alpha(opacity=50); } .l-btn-selected, .l-btn-selected:hover { background: #ddd; filter: none; } .l-btn-plain-selected, .l-btn-plain-selected:hover { background: #ddd; } .textbox { position: relative; border: 1px solid #D4D4D4; background-color: #fff; vertical-align: middle; display: inline-block; overflow: hidden; white-space: nowrap; margin: 0; padding: 0; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .textbox .textbox-text { font-size: 12px; border: 0; margin: 0; padding: 4px; white-space: normal; vertical-align: top; outline-style: none; resize: none; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .textbox .textbox-text::-ms-clear, .textbox .textbox-text::-ms-reveal { display: none; } .textbox textarea.textbox-text { white-space: pre-wrap; } .textbox .textbox-prompt { font-size: 12px; color: #aaa; } .textbox .textbox-bgicon { background-position: 3px center; padding-left: 21px; } .textbox .textbox-button, .textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; vertical-align: top; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .textbox .textbox-button-right, .textbox .textbox-button-right:hover { right: 0; border-width: 0 0 0 1px; } .textbox .textbox-button-left, .textbox .textbox-button-left:hover { left: 0; border-width: 0 1px 0 0; } .textbox .textbox-button-top, .textbox .textbox-button-top:hover { left: 0; border-width: 0 0 1px 0; } .textbox .textbox-button-bottom, .textbox .textbox-button-bottom:hover { top: auto; bottom: 0; left: 0; border-width: 1px 0 0 0; } .textbox-addon { position: absolute; top: 0; } .textbox-label { display: inline-block; width: 80px; height: 22px; line-height: 22px; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; padding-right: 5px; } .textbox-label-after { padding-left: 5px; padding-right: 0; } .textbox-label-top { display: block; width: auto; padding: 0; } .textbox-disabled, .textbox-label-disabled { opacity: 0.6; filter: alpha(opacity=60); } .textbox-icon { display: inline-block; width: 18px; height: 20px; overflow: hidden; vertical-align: top; background-position: center center; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); text-decoration: none; outline-style: none; } .textbox-icon-disabled, .textbox-icon-readonly { cursor: default; } .textbox-icon:hover { opacity: 1.0; filter: alpha(opacity=100); } .textbox-icon-disabled:hover { opacity: 0.6; filter: alpha(opacity=60); } .textbox-focused { border-color: #bbbbbb; -moz-box-shadow: 0 0 3px 0 #D4D4D4; -webkit-box-shadow: 0 0 3px 0 #D4D4D4; box-shadow: 0 0 3px 0 #D4D4D4; } .textbox-invalid { border-color: #ffa8a8; background-color: #fff3f3; } .passwordbox-open { background: url('images/passwordbox_open.png') no-repeat center center; } .passwordbox-close { background: url('images/passwordbox_close.png') no-repeat center center; } .filebox .textbox-value { vertical-align: top; position: absolute; top: 0; left: -5000px; } .filebox-label { display: inline-block; position: absolute; width: 100%; height: 100%; cursor: pointer; left: 0; top: 0; z-index: 10; background: url('images/blank.gif') no-repeat; } .l-btn-disabled .filebox-label { cursor: default; } .combo-arrow { width: 18px; height: 20px; overflow: hidden; display: inline-block; vertical-align: top; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); } .combo-arrow-hover { opacity: 1.0; filter: alpha(opacity=100); } .combo-panel { overflow: auto; } .combo-arrow { background: url('images/combo_arrow.png') no-repeat center center; } .combo-panel { background-color: #ffffff; } .combo-arrow { background-color: #F2F2F2; } .combo-arrow-hover { background-color: #e6e6e6; } .combo-arrow:hover { background-color: #e6e6e6; } .combo .textbox-icon-disabled:hover { cursor: default; } .combobox-item, .combobox-group, .combobox-stick { font-size: 12px; padding: 3px; } .combobox-item-disabled { opacity: 0.5; filter: alpha(opacity=50); } .combobox-gitem { padding-left: 10px; } .combobox-group, .combobox-stick { font-weight: bold; } .combobox-stick { position: absolute; top: 1px; left: 1px; right: 1px; background: inherit; } .combobox-item-hover { background-color: #e6e6e6; color: #00438a; } .combobox-item-selected { background-color: #0081c2; color: #fff; } .combobox-icon { display: inline-block; width: 16px; height: 16px; vertical-align: middle; margin-right: 2px; } .tagbox { cursor: text; } .tagbox .textbox-text { float: left; } .tagbox-label { position: relative; display: block; margin: 4px 0 0 4px; padding: 0 20px 0 4px; float: left; vertical-align: top; text-decoration: none; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; background: #e6e6e6; color: #00438a; } .tagbox-remove { background: url('images/tagbox_icons.png') no-repeat -16px center; position: absolute; display: block; width: 16px; height: 16px; right: 2px; top: 50%; margin-top: -8px; opacity: 0.6; filter: alpha(opacity=60); } .tagbox-remove:hover { opacity: 1; filter: alpha(opacity=100); } .textbox-disabled .tagbox-label { cursor: default; } .textbox-disabled .tagbox-remove:hover { cursor: default; opacity: 0.6; filter: alpha(opacity=60); } .layout { position: relative; overflow: hidden; margin: 0; padding: 0; z-index: 0; } .layout-panel { position: absolute; overflow: hidden; } .layout-body { min-width: 1px; min-height: 1px; } .layout-panel-east, .layout-panel-west { z-index: 2; } .layout-panel-north, .layout-panel-south { z-index: 3; } .layout-expand { position: absolute; padding: 0px; font-size: 1px; cursor: pointer; z-index: 1; } .layout-expand .panel-header, .layout-expand .panel-body { background: transparent; filter: none; overflow: hidden; } .layout-expand .panel-header { border-bottom-width: 0px; } .layout-expand .panel-body { position: relative; } .layout-expand .panel-body .panel-icon { margin-top: 0; top: 0; left: 50%; margin-left: -8px; } .layout-expand-west .panel-header .panel-icon, .layout-expand-east .panel-header .panel-icon { display: none; } .layout-expand-title { position: absolute; top: 0; left: 21px; white-space: nowrap; word-wrap: normal; -webkit-transform: rotate(90deg); -webkit-transform-origin: 0 0; -moz-transform: rotate(90deg); -moz-transform-origin: 0 0; -o-transform: rotate(90deg); -o-transform-origin: 0 0; transform: rotate(90deg); transform-origin: 0 0; } .layout-expand-with-icon { top: 18px; } .layout-expand .panel-body-noheader .layout-expand-title, .layout-expand .panel-body-noheader .panel-icon { top: 5px; } .layout-expand .panel-body-noheader .layout-expand-with-icon { top: 23px; } .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; font-size: 1px; display: none; z-index: 5; } .layout-split-proxy-h { width: 5px; cursor: e-resize; } .layout-split-proxy-v { height: 5px; cursor: n-resize; } .layout-mask { position: absolute; background: #fafafa; filter: alpha(opacity=10); opacity: 0.10; z-index: 4; } .layout-button-up { background: url('images/layout_arrows.png') no-repeat -16px -16px; } .layout-button-down { background: url('images/layout_arrows.png') no-repeat -16px 0; } .layout-button-left { background: url('images/layout_arrows.png') no-repeat 0 0; } .layout-button-right { background: url('images/layout_arrows.png') no-repeat 0 -16px; } .layout-split-proxy-h, .layout-split-proxy-v { background-color: #bbb; } .layout-split-north { border-bottom: 5px solid #eee; } .layout-split-south { border-top: 5px solid #eee; } .layout-split-east { border-left: 5px solid #eee; } .layout-split-west { border-right: 5px solid #eee; } .layout-expand { background-color: #F2F2F2; } .layout-expand-over { background-color: #F2F2F2; } .tabs-container { overflow: hidden; } .tabs-header { border-width: 1px; border-style: solid; border-bottom-width: 0; position: relative; padding: 0; padding-top: 2px; overflow: hidden; } .tabs-scroller-left, .tabs-scroller-right { position: absolute; top: auto; bottom: 0; width: 18px; font-size: 1px; display: none; cursor: pointer; border-width: 1px; border-style: solid; } .tabs-scroller-left { left: 0; } .tabs-scroller-right { right: 0; } .tabs-tool { position: absolute; bottom: 0; padding: 1px; overflow: hidden; border-width: 1px; border-style: solid; } .tabs-header-plain .tabs-tool { padding: 0 1px; } .tabs-wrap { position: relative; left: 0; overflow: hidden; width: 100%; margin: 0; padding: 0; } .tabs-scrolling { margin-left: 18px; margin-right: 18px; } .tabs-disabled { opacity: 0.3; filter: alpha(opacity=30); } .tabs { list-style-type: none; height: 26px; margin: 0px; padding: 0px; padding-left: 4px; width: 50000px; border-style: solid; border-width: 0 0 1px 0; } .tabs li { float: left; display: inline-block; margin: 0 4px -1px 0; padding: 0; position: relative; border: 0; } .tabs li a.tabs-inner { display: inline-block; text-decoration: none; margin: 0; padding: 0 10px; height: 25px; line-height: 25px; text-align: center; white-space: nowrap; border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 0 0; -webkit-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; } .tabs li.tabs-selected a.tabs-inner { font-weight: bold; outline: none; } .tabs li.tabs-selected a:hover.tabs-inner { cursor: default; pointer: default; } .tabs li a.tabs-close, .tabs-p-tool { position: absolute; font-size: 1px; display: block; height: 12px; padding: 0; top: 50%; margin-top: -6px; overflow: hidden; } .tabs li a.tabs-close { width: 12px; right: 5px; opacity: 0.6; filter: alpha(opacity=60); } .tabs-p-tool { right: 16px; } .tabs-p-tool a { display: inline-block; font-size: 1px; width: 12px; height: 12px; margin: 0; opacity: 0.6; filter: alpha(opacity=60); } .tabs li a:hover.tabs-close, .tabs-p-tool a:hover { opacity: 1; filter: alpha(opacity=100); cursor: hand; cursor: pointer; } .tabs-with-icon { padding-left: 18px; } .tabs-icon { position: absolute; width: 16px; height: 16px; left: 10px; top: 50%; margin-top: -8px; } .tabs-title { font-size: 12px; } .tabs-closable { padding-right: 8px; } .tabs-panels { margin: 0px; padding: 0px; border-width: 1px; border-style: solid; border-top-width: 0; overflow: hidden; } .tabs-header-bottom { border-width: 0 1px 1px 1px; padding: 0 0 2px 0; } .tabs-header-bottom .tabs { border-width: 1px 0 0 0; } .tabs-header-bottom .tabs li { margin: -1px 4px 0 0; } .tabs-header-bottom .tabs li a.tabs-inner { -moz-border-radius: 0 0 5px 5px; -webkit-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; } .tabs-header-bottom .tabs-tool { top: 0; } .tabs-header-bottom .tabs-scroller-left, .tabs-header-bottom .tabs-scroller-right { top: 0; bottom: auto; } .tabs-panels-top { border-width: 1px 1px 0 1px; } .tabs-header-left { float: left; border-width: 1px 0 1px 1px; padding: 0; } .tabs-header-right { float: right; border-width: 1px 1px 1px 0; padding: 0; } .tabs-header-left .tabs-wrap, .tabs-header-right .tabs-wrap { height: 100%; } .tabs-header-left .tabs { height: 100%; padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, .tabs-header-right .tabs li { display: block; width: 100%; position: relative; } .tabs-header-left .tabs li { left: auto; right: 0; margin: 0 -1px 4px 0; float: right; } .tabs-header-right .tabs li { left: 0; right: auto; margin: 0 0 4px -1px; float: left; } .tabs-justified li a.tabs-inner { padding-left: 0; padding-right: 0; } .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; padding-left: 10px; padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; padding-left: 10px; padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; } .tabs-panels-right { float: right; border-width: 1px 1px 1px 0; } .tabs-panels-left { float: left; border-width: 1px 0 1px 1px; } .tabs-header-noborder, .tabs-panels-noborder { border: 0px; } .tabs-header-plain { border: 0px; background: transparent; } .tabs-pill { padding-bottom: 3px; } .tabs-header-bottom .tabs-pill { padding-top: 3px; padding-bottom: 0; } .tabs-header-left .tabs-pill { padding-right: 3px; } .tabs-header-right .tabs-pill { padding-left: 3px; } .tabs-header .tabs-pill li a.tabs-inner { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .tabs-header-narrow, .tabs-header-narrow .tabs-narrow { padding: 0; } .tabs-narrow li, .tabs-header-bottom .tabs-narrow li { margin-left: 0; margin-right: -1px; } .tabs-narrow li.tabs-last, .tabs-header-bottom .tabs-narrow li.tabs-last { margin-right: 0; } .tabs-header-left .tabs-narrow, .tabs-header-right .tabs-narrow { padding-top: 0; } .tabs-header-left .tabs-narrow li { margin-bottom: -1px; margin-right: -1px; } .tabs-header-left .tabs-narrow li.tabs-last, .tabs-header-right .tabs-narrow li.tabs-last { margin-bottom: 0; } .tabs-header-right .tabs-narrow li { margin-bottom: -1px; margin-left: -1px; } .tabs-scroller-left { background: #F2F2F2 url('images/tabs_icons.png') no-repeat 1px center; } .tabs-scroller-right { background: #F2F2F2 url('images/tabs_icons.png') no-repeat -15px center; } .tabs li a.tabs-close { background: url('images/tabs_icons.png') no-repeat -34px center; } .tabs li a.tabs-inner:hover { background: #e6e6e6; color: #00438a; filter: none; } .tabs li.tabs-selected a.tabs-inner { background-color: #ffffff; color: #777; background: -webkit-linear-gradient(top,#ffffff 0,#ffffff 100%); background: -moz-linear-gradient(top,#ffffff 0,#ffffff 100%); background: -o-linear-gradient(top,#ffffff 0,#ffffff 100%); background: linear-gradient(to bottom,#ffffff 0,#ffffff 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=0); } .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(top,#ffffff 0,#ffffff 100%); background: -moz-linear-gradient(top,#ffffff 0,#ffffff 100%); background: -o-linear-gradient(top,#ffffff 0,#ffffff 100%); background: linear-gradient(to bottom,#ffffff 0,#ffffff 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=0); } .tabs-header-left .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(left,#ffffff 0,#ffffff 100%); background: -moz-linear-gradient(left,#ffffff 0,#ffffff 100%); background: -o-linear-gradient(left,#ffffff 0,#ffffff 100%); background: linear-gradient(to right,#ffffff 0,#ffffff 100%); background-repeat: repeat-y; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=1); } .tabs-header-right .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(left,#ffffff 0,#ffffff 100%); background: -moz-linear-gradient(left,#ffffff 0,#ffffff 100%); background: -o-linear-gradient(left,#ffffff 0,#ffffff 100%); background: linear-gradient(to right,#ffffff 0,#ffffff 100%); background-repeat: repeat-y; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=1); } .tabs li a.tabs-inner { color: #777; background-color: #F2F2F2; background: -webkit-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -moz-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -o-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); } .tabs-header, .tabs-tool { background-color: #F2F2F2; } .tabs-header-plain { background: transparent; } .tabs-header, .tabs-scroller-left, .tabs-scroller-right, .tabs-tool, .tabs, .tabs-panels, .tabs li a.tabs-inner, .tabs li.tabs-selected a.tabs-inner, .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner, .tabs-header-left .tabs li.tabs-selected a.tabs-inner, .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-color: #D4D4D4; } .tabs-p-tool a:hover, .tabs li a:hover.tabs-close, .tabs-scroller-over { background-color: #e6e6e6; } .tabs li.tabs-selected a.tabs-inner { border-bottom: 1px solid #ffffff; } .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { border-top: 1px solid #ffffff; } .tabs-header-left .tabs li.tabs-selected a.tabs-inner { border-right: 1px solid #ffffff; } .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #ffffff; } .tabs-header .tabs-pill li.tabs-selected a.tabs-inner { background: #0081c2; color: #fff; filter: none; border-color: #D4D4D4; } .datagrid .panel-body { overflow: hidden; position: relative; } .datagrid-view { position: relative; overflow: hidden; } .datagrid-view1, .datagrid-view2 { position: absolute; overflow: hidden; top: 0; } .datagrid-view1 { left: 0; } .datagrid-view2 { right: 0; } .datagrid-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0.3; filter: alpha(opacity=30); display: none; } .datagrid-mask-msg { position: absolute; top: 50%; margin-top: -20px; padding: 10px 5px 10px 30px; width: auto; height: 16px; border-width: 2px; border-style: solid; display: none; } .datagrid-empty { position: absolute; left: 0; top: 0; width: 100%; height: 25px; line-height: 25px; text-align: center; } .datagrid-sort-icon { padding: 0; display: none; } .datagrid-toolbar { height: auto; padding: 1px 2px; border-width: 0 0 1px 0; border-style: solid; } .datagrid-btn-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 2px 1px; } .datagrid .datagrid-pager { display: block; margin: 0; border-width: 1px 0 0 0; border-style: solid; } .datagrid .datagrid-pager-top { border-width: 0 0 1px 0; } .datagrid-header { overflow: hidden; cursor: default; border-width: 0 0 1px 0; border-style: solid; } .datagrid-header-inner { float: left; width: 10000px; } .datagrid-header-row, .datagrid-row { height: 25px; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-width: 0 1px 1px 0; border-style: dotted; margin: 0; padding: 0; } .datagrid-cell, .datagrid-cell-group, .datagrid-header-rownumber, .datagrid-cell-rownumber { margin: 0; padding: 0 4px; white-space: nowrap; word-wrap: normal; overflow: hidden; height: 18px; line-height: 18px; font-size: 12px; } .datagrid-header .datagrid-cell { height: auto; } .datagrid-header .datagrid-cell span { font-size: 12px; } .datagrid-cell-group { text-align: center; text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { width: 30px; text-align: center; margin: 0; padding: 0; } .datagrid-body { margin: 0; padding: 0; overflow: auto; zoom: 1; } .datagrid-view1 .datagrid-body-inner { padding-bottom: 20px; } .datagrid-view1 .datagrid-body { overflow: hidden; } .datagrid-footer { overflow: hidden; } .datagrid-footer-inner { border-width: 1px 0 0 0; border-style: solid; width: 10000px; float: left; } .datagrid-row-editing .datagrid-cell { height: auto; } .datagrid-header-check, .datagrid-cell-check { padding: 0; width: 27px; height: 18px; font-size: 1px; text-align: center; overflow: hidden; } .datagrid-header-check input, .datagrid-cell-check input { margin: 0; padding: 0; width: 15px; height: 18px; } .datagrid-resize-proxy { position: absolute; width: 1px; height: 10000px; top: 0; cursor: e-resize; display: none; } .datagrid-body .datagrid-editable { margin: 0; padding: 0; } .datagrid-body .datagrid-editable table { width: 100%; height: 100%; } .datagrid-body .datagrid-editable td { border: 0; margin: 0; padding: 0; } .datagrid-view .datagrid-editable-input { margin: 0; padding: 2px 4px; border: 1px solid #D4D4D4; font-size: 12px; outline-style: none; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .datagrid-view .validatebox-invalid { border-color: #ffa8a8; } .datagrid-sort .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -64px center; } .datagrid-sort-desc .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } .datagrid-row-collapse { background: url('images/datagrid_icons.png') no-repeat -48px center; } .datagrid-row-expand { background: url('images/datagrid_icons.png') no-repeat -32px center; } .datagrid-mask-msg { background: #ffffff url('images/loading.gif') no-repeat scroll 5px center; } .datagrid-header, .datagrid-td-rownumber { background-color: #F2F2F2; background: -webkit-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -moz-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -o-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); } .datagrid-cell-rownumber { color: #333; } .datagrid-resize-proxy { background: #bbb; } .datagrid-mask { background: #ccc; } .datagrid-mask-msg { border-color: #D4D4D4; } .datagrid-toolbar, .datagrid-pager { background: #F5F5F5; } .datagrid-header, .datagrid-toolbar, .datagrid-pager, .datagrid-footer-inner { border-color: #e6e6e6; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-color: #ccc; } .datagrid-htable, .datagrid-btable, .datagrid-ftable { color: #333; border-collapse: separate; } .datagrid-row-alt { background: #F5F5F5; } .datagrid-row-over, .datagrid-header td.datagrid-header-over { background: #e6e6e6; color: #00438a; cursor: default; } .datagrid-row-selected { background: #0081c2; color: #fff; } .datagrid-row-editing .textbox, .datagrid-row-editing .textbox-text { -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .propertygrid .datagrid-view1 .datagrid-body td { padding-bottom: 1px; border-width: 0 1px 0 0; } .propertygrid .datagrid-group { height: 21px; overflow: hidden; border-width: 0 0 1px 0; border-style: solid; } .propertygrid .datagrid-group span { font-weight: bold; } .propertygrid .datagrid-view1 .datagrid-body td { border-color: #e6e6e6; } .propertygrid .datagrid-view1 .datagrid-group { border-color: #F2F2F2; } .propertygrid .datagrid-view2 .datagrid-group { border-color: #e6e6e6; } .propertygrid .datagrid-group, .propertygrid .datagrid-view1 .datagrid-body, .propertygrid .datagrid-view1 .datagrid-row-over, .propertygrid .datagrid-view1 .datagrid-row-selected { background: #F2F2F2; } .datalist .datagrid-header { border-width: 0; } .datalist .datagrid-group, .m-list .m-list-group { height: 25px; line-height: 25px; font-weight: bold; overflow: hidden; background-color: #F2F2F2; border-style: solid; border-width: 0 0 1px 0; border-color: #ccc; } .datalist .datagrid-group-expander { display: none; } .datalist .datagrid-group-title { padding: 0 4px; } .datalist .datagrid-btable { width: 100%; table-layout: fixed; } .datalist .datagrid-row td { border-style: solid; border-left-color: transparent; border-right-color: transparent; border-bottom-width: 0; } .datalist-lines .datagrid-row td { border-bottom-width: 1px; } .datalist .datagrid-cell, .m-list li { width: auto; height: auto; padding: 2px 4px; line-height: 18px; position: relative; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .datalist-link, .m-list li>a { display: block; position: relative; cursor: pointer; color: #333; text-decoration: none; overflow: hidden; margin: -2px -4px; padding: 2px 4px; padding-right: 16px; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .datalist-link::after, .m-list li>a::after { position: absolute; display: block; width: 8px; height: 8px; content: ''; right: 6px; top: 50%; margin-top: -4px; border-style: solid; border-width: 1px 1px 0 0; -ms-transform: rotate(45deg); -moz-transform: rotate(45deg); -webkit-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); } .m-list { margin: 0; padding: 0; list-style: none; } .m-list li { border-style: solid; border-width: 0 0 1px 0; border-color: #ccc; } .m-list li>a:hover { background: #e6e6e6; color: #00438a; } .m-list .m-list-group { padding: 0 4px; } .pagination { zoom: 1; } .pagination table { float: left; height: 30px; } .pagination td { border: 0; } .pagination-btn-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 3px 1px; } .pagination .pagination-num { border-width: 1px; border-style: solid; margin: 0 2px; padding: 2px; width: 2em; height: auto; } .pagination-page-list { margin: 0px 6px; padding: 1px 2px; width: auto; height: auto; border-width: 1px; border-style: solid; } .pagination-info { float: right; margin: 0 6px 0 0; padding: 0; height: 30px; line-height: 30px; font-size: 12px; } .pagination span { font-size: 12px; } .pagination-link .l-btn-text { width: 24px; text-align: center; margin: 0; } .pagination-first { background: url('images/pagination_icons.png') no-repeat 0 center; } .pagination-prev { background: url('images/pagination_icons.png') no-repeat -16px center; } .pagination-next { background: url('images/pagination_icons.png') no-repeat -32px center; } .pagination-last { background: url('images/pagination_icons.png') no-repeat -48px center; } .pagination-load { background: url('images/pagination_icons.png') no-repeat -64px center; } .pagination-loading { background: url('images/loading.gif') no-repeat center center; } .pagination-page-list, .pagination .pagination-num { border-color: #D4D4D4; } .calendar { border-width: 1px; border-style: solid; padding: 1px; overflow: hidden; } .calendar table { table-layout: fixed; border-collapse: separate; font-size: 12px; width: 100%; height: 100%; } .calendar table td, .calendar table th { font-size: 12px; } .calendar-noborder { border: 0; } .calendar-header { position: relative; height: 22px; } .calendar-title { text-align: center; height: 22px; } .calendar-title span { position: relative; display: inline-block; top: 2px; padding: 0 3px; height: 18px; line-height: 18px; font-size: 12px; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-prevmonth, .calendar-nextmonth, .calendar-prevyear, .calendar-nextyear { position: absolute; top: 50%; margin-top: -7px; width: 14px; height: 14px; cursor: pointer; font-size: 1px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-prevmonth { left: 20px; background: url('images/calendar_arrows.png') no-repeat -18px -2px; } .calendar-nextmonth { right: 20px; background: url('images/calendar_arrows.png') no-repeat -34px -2px; } .calendar-prevyear { left: 3px; background: url('images/calendar_arrows.png') no-repeat -1px -2px; } .calendar-nextyear { right: 3px; background: url('images/calendar_arrows.png') no-repeat -49px -2px; } .calendar-body { position: relative; } .calendar-body th, .calendar-body td { text-align: center; } .calendar-day { border: 0; padding: 1px; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-other-month { opacity: 0.3; filter: alpha(opacity=30); } .calendar-disabled { opacity: 0.6; filter: alpha(opacity=60); cursor: default; } .calendar-menu { position: absolute; top: 0; left: 0; width: 180px; height: 150px; padding: 5px; font-size: 12px; display: none; overflow: hidden; } .calendar-menu-year-inner { text-align: center; padding-bottom: 5px; } .calendar-menu-year { width: 50px; text-align: center; border-width: 1px; border-style: solid; outline-style: none; resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { display: inline-block; width: 21px; height: 21px; vertical-align: top; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-menu-prev { margin-right: 10px; background: url('images/calendar_arrows.png') no-repeat 2px 2px; } .calendar-menu-next { margin-left: 10px; background: url('images/calendar_arrows.png') no-repeat -45px 2px; } .calendar-menu-month { text-align: center; cursor: pointer; font-weight: bold; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-body th, .calendar-menu-month { color: #808080; } .calendar-day { color: #333; } .calendar-sunday { color: #CC2222; } .calendar-saturday { color: #00ee00; } .calendar-today { color: #0000ff; } .calendar-menu-year { border-color: #D4D4D4; } .calendar { border-color: #D4D4D4; } .calendar-header { background: #F2F2F2; } .calendar-body, .calendar-menu { background: #ffffff; } .calendar-body th { background: #F5F5F5; padding: 2px 0; } .calendar-hover, .calendar-nav-hover, .calendar-menu-hover { background-color: #e6e6e6; color: #00438a; } .calendar-hover { border: 1px solid #ddd; padding: 0; } .calendar-selected { background-color: #0081c2; color: #fff; border: 1px solid #0070a9; padding: 0; } .datebox-calendar-inner { height: 180px; } .datebox-button { padding: 0 5px; text-align: center; } .datebox-button a { line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; opacity: 0.6; filter: alpha(opacity=60); } .datebox-button a:hover { opacity: 1.0; filter: alpha(opacity=100); } .datebox-current, .datebox-close { float: left; } .datebox-close { float: right; } .datebox .combo-arrow { background-image: url('images/datebox_arrow.png'); background-position: center center; } .datebox-button { background-color: #F5F5F5; } .datebox-button a { color: #444; } .spinner-arrow { background-color: #F2F2F2; display: inline-block; overflow: hidden; vertical-align: top; margin: 0; padding: 0; opacity: 1.0; filter: alpha(opacity=100); width: 18px; } .spinner-arrow-up, .spinner-arrow-down { opacity: 0.6; filter: alpha(opacity=60); display: block; font-size: 1px; width: 18px; height: 10px; width: 100%; height: 50%; color: #444; outline-style: none; } .spinner-arrow-hover { background-color: #e6e6e6; opacity: 1.0; filter: alpha(opacity=100); } .spinner-arrow-up:hover, .spinner-arrow-down:hover { opacity: 1.0; filter: alpha(opacity=100); background-color: #e6e6e6; } .textbox-icon-disabled .spinner-arrow-up:hover, .textbox-icon-disabled .spinner-arrow-down:hover { opacity: 0.6; filter: alpha(opacity=60); background-color: #F2F2F2; cursor: default; } .spinner .textbox-icon-disabled { opacity: 0.6; filter: alpha(opacity=60); } .spinner-arrow-up { background: url('images/spinner_arrows.png') no-repeat 1px center; } .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } .spinner-button-up { background: url('images/spinner_arrows.png') no-repeat -32px center; } .spinner-button-down { background: url('images/spinner_arrows.png') no-repeat -48px center; } .progressbar { border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; overflow: hidden; position: relative; } .progressbar-text { text-align: center; position: absolute; } .progressbar-value { position: relative; overflow: hidden; width: 0; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .progressbar { border-color: #D4D4D4; } .progressbar-text { color: #333; font-size: 12px; } .progressbar-value .progressbar-text { background-color: #0081c2; color: #fff; } .searchbox-button { width: 18px; height: 20px; overflow: hidden; display: inline-block; vertical-align: top; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); } .searchbox-button-hover { opacity: 1.0; filter: alpha(opacity=100); } .searchbox .l-btn-plain { border: 0; padding: 0; vertical-align: top; opacity: 0.6; filter: alpha(opacity=60); -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .l-btn-plain:hover { border: 0; padding: 0; opacity: 1.0; filter: alpha(opacity=100); -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox a.m-btn-plain-active { -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .m-btn-active { border-width: 0 1px 0 0; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .textbox-button-right { border-width: 0 0 0 1px; } .searchbox .textbox-button-left { border-width: 0 1px 0 0; } .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } .searchbox .l-btn-plain { background: #F2F2F2; } .searchbox .l-btn-plain-disabled, .searchbox .l-btn-plain-disabled:hover { opacity: 0.5; filter: alpha(opacity=50); } .slider-disabled { opacity: 0.5; filter: alpha(opacity=50); } .slider-h { height: 22px; } .slider-v { width: 22px; } .slider-inner { position: relative; height: 6px; top: 7px; border-width: 1px; border-style: solid; border-radius: 5px; } .slider-handle { position: absolute; display: block; outline: none; width: 20px; height: 20px; top: 50%; margin-top: -10px; margin-left: -10px; } .slider-tip { position: absolute; display: inline-block; line-height: 12px; font-size: 12px; white-space: nowrap; top: -22px; } .slider-rule { position: relative; top: 15px; } .slider-rule span { position: absolute; display: inline-block; font-size: 0; height: 5px; border-width: 0 0 0 1px; border-style: solid; } .slider-rulelabel { position: relative; top: 20px; } .slider-rulelabel span { position: absolute; display: inline-block; font-size: 12px; } .slider-v .slider-inner { width: 6px; left: 7px; top: 0; float: left; } .slider-v .slider-handle { left: 50%; margin-top: -10px; } .slider-v .slider-tip { left: -10px; margin-top: -6px; } .slider-v .slider-rule { float: left; top: 0; left: 16px; } .slider-v .slider-rule span { width: 5px; height: 'auto'; border-left: 0; border-width: 1px 0 0 0; border-style: solid; } .slider-v .slider-rulelabel { float: left; top: 0; left: 23px; } .slider-handle { background: url('images/slider_handle.png') no-repeat; } .slider-inner { border-color: #D4D4D4; background: #F2F2F2; } .slider-rule span { border-color: #D4D4D4; } .slider-rulelabel span { color: #333; } .menu { position: absolute; margin: 0; padding: 2px; border-width: 1px; border-style: solid; overflow: hidden; } .menu-inline { position: relative; } .menu-item { position: relative; margin: 0; padding: 0; overflow: hidden; white-space: nowrap; cursor: pointer; border-width: 1px; border-style: solid; } .menu-text { height: 20px; line-height: 20px; float: left; padding-left: 28px; } .menu-icon { position: absolute; width: 16px; height: 16px; left: 2px; top: 50%; margin-top: -8px; } .menu-rightarrow { position: absolute; width: 16px; height: 16px; right: 0; top: 50%; margin-top: -8px; } .menu-line { position: absolute; left: 26px; top: 0; height: 2000px; font-size: 1px; } .menu-sep { margin: 3px 0px 3px 25px; font-size: 1px; } .menu-noline .menu-line { display: none; } .menu-noline .menu-sep { margin-left: 0; margin-right: 0; } .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .menu-item-disabled { opacity: 0.5; filter: alpha(opacity=50); cursor: default; } .menu-text, .menu-text span { font-size: 12px; } .menu-shadow { position: absolute; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; background: #ccc; -moz-box-shadow: 2px 2px 3px #cccccc; -webkit-box-shadow: 2px 2px 3px #cccccc; box-shadow: 2px 2px 3px #cccccc; filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); } .menu-rightarrow { background: url('images/menu_arrows.png') no-repeat -32px center; } .menu-line { border-left: 1px solid #ccc; border-right: 1px solid #fff; } .menu-sep { border-top: 1px solid #ccc; border-bottom: 1px solid #fff; } .menu { background-color: #fff; border-color: #e6e6e6; color: #333; } .menu-content { background: #ffffff; } .menu-item { border-color: transparent; _border-color: #fff; } .menu-active { border-color: #ddd; color: #00438a; background: #e6e6e6; } .menu-active-disabled { border-color: transparent; background: transparent; color: #333; } .m-btn-downarrow, .s-btn-downarrow { display: inline-block; position: absolute; width: 16px; height: 16px; font-size: 1px; right: 0; top: 50%; margin-top: -8px; } .m-btn-active, .s-btn-active { background: #e6e6e6; color: #00438a; border: 1px solid #ddd; filter: none; } .m-btn-plain-active, .s-btn-plain-active { background: transparent; padding: 0; border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .m-btn .l-btn-left .l-btn-text { margin-right: 20px; } .m-btn .l-btn-icon-right .l-btn-text { margin-right: 40px; } .m-btn .l-btn-icon-right .l-btn-icon { right: 20px; } .m-btn .l-btn-icon-top .l-btn-text { margin-right: 4px; margin-bottom: 14px; } .m-btn .l-btn-icon-bottom .l-btn-text { margin-right: 4px; margin-bottom: 34px; } .m-btn .l-btn-icon-bottom .l-btn-icon { top: auto; bottom: 20px; } .m-btn .l-btn-icon-top .m-btn-downarrow, .m-btn .l-btn-icon-bottom .m-btn-downarrow { top: auto; bottom: 0px; left: 50%; margin-left: -8px; } .m-btn-line { display: inline-block; position: absolute; font-size: 1px; display: none; } .m-btn .l-btn-left .m-btn-line { right: 0; width: 16px; height: 500px; border-style: solid; border-color: #bbb; border-width: 0 0 0 1px; } .m-btn .l-btn-icon-top .m-btn-line, .m-btn .l-btn-icon-bottom .m-btn-line { left: 0; bottom: 0; width: 500px; height: 16px; border-width: 1px 0 0 0; } .m-btn-large .l-btn-icon-right .l-btn-text { margin-right: 56px; } .m-btn-large .l-btn-icon-bottom .l-btn-text { margin-bottom: 50px; } .m-btn-downarrow, .s-btn-downarrow { background: url('images/menu_arrows.png') no-repeat 0 center; } .m-btn-plain-active, .s-btn-plain-active { border-color: #ddd; background-color: #e6e6e6; color: #00438a; } .s-btn:hover .m-btn-line, .s-btn-active .m-btn-line, .s-btn-plain-active .m-btn-line { display: inline-block; } .l-btn:hover .s-btn-downarrow, .s-btn-active .s-btn-downarrow, .s-btn-plain-active .s-btn-downarrow { border-style: solid; border-color: #bbb; border-width: 0 0 0 1px; } .messager-body { padding: 10px 10px 30px 10px; overflow: auto; } .messager-button { text-align: center; padding: 5px; } .messager-button .l-btn { width: 70px; } .messager-icon { float: left; width: 32px; height: 32px; margin: 0 10px 10px 0; } .messager-error { background: url('images/messager_icons.png') no-repeat scroll -64px 0; } .messager-info { background: url('images/messager_icons.png') no-repeat scroll 0 0; } .messager-question { background: url('images/messager_icons.png') no-repeat scroll -32px 0; } .messager-warning { background: url('images/messager_icons.png') no-repeat scroll -96px 0; } .messager-progress { padding: 10px; } .messager-p-msg { margin-bottom: 5px; } .messager-body .messager-input { width: 100%; padding: 4px 0; outline-style: none; border: 1px solid #D4D4D4; } .window-thinborder .messager-button { padding-bottom: 8px; } .tree { margin: 0; padding: 0; list-style-type: none; } .tree li { white-space: nowrap; } .tree li ul { list-style-type: none; margin: 0; padding: 0; } .tree-node { height: 18px; white-space: nowrap; cursor: pointer; } .tree-hit { cursor: pointer; } .tree-expanded, .tree-collapsed, .tree-folder, .tree-file, .tree-checkbox, .tree-indent { display: inline-block; width: 16px; height: 18px; vertical-align: top; overflow: hidden; } .tree-expanded { background: url('images/tree_icons.png') no-repeat -18px 0px; } .tree-expanded-hover { background: url('images/tree_icons.png') no-repeat -50px 0px; } .tree-collapsed { background: url('images/tree_icons.png') no-repeat 0px 0px; } .tree-collapsed-hover { background: url('images/tree_icons.png') no-repeat -32px 0px; } .tree-lines .tree-expanded, .tree-lines .tree-root-first .tree-expanded { background: url('images/tree_icons.png') no-repeat -144px 0; } .tree-lines .tree-collapsed, .tree-lines .tree-root-first .tree-collapsed { background: url('images/tree_icons.png') no-repeat -128px 0; } .tree-lines .tree-node-last .tree-expanded, .tree-lines .tree-root-one .tree-expanded { background: url('images/tree_icons.png') no-repeat -80px 0; } .tree-lines .tree-node-last .tree-collapsed, .tree-lines .tree-root-one .tree-collapsed { background: url('images/tree_icons.png') no-repeat -64px 0; } .tree-line { background: url('images/tree_icons.png') no-repeat -176px 0; } .tree-join { background: url('images/tree_icons.png') no-repeat -192px 0; } .tree-joinbottom { background: url('images/tree_icons.png') no-repeat -160px 0; } .tree-folder { background: url('images/tree_icons.png') no-repeat -208px 0; } .tree-folder-open { background: url('images/tree_icons.png') no-repeat -224px 0; } .tree-file { background: url('images/tree_icons.png') no-repeat -240px 0; } .tree-loading { background: url('images/loading.gif') no-repeat center center; } .tree-checkbox0 { background: url('images/tree_icons.png') no-repeat -208px -18px; } .tree-checkbox1 { background: url('images/tree_icons.png') no-repeat -224px -18px; } .tree-checkbox2 { background: url('images/tree_icons.png') no-repeat -240px -18px; } .tree-title { font-size: 12px; display: inline-block; text-decoration: none; vertical-align: top; white-space: nowrap; padding: 0 2px; height: 18px; line-height: 18px; } .tree-node-proxy { font-size: 12px; line-height: 20px; padding: 0 2px 0 20px; border-width: 1px; border-style: solid; z-index: 9900000; } .tree-dnd-icon { display: inline-block; position: absolute; width: 16px; height: 18px; left: 2px; top: 50%; margin-top: -9px; } .tree-dnd-yes { background: url('images/tree_icons.png') no-repeat -256px 0; } .tree-dnd-no { background: url('images/tree_icons.png') no-repeat -256px -18px; } .tree-node-top { border-top: 1px dotted red; } .tree-node-bottom { border-bottom: 1px dotted red; } .tree-node-append .tree-title { border: 1px dotted red; } .tree-editor { border: 1px solid #D4D4D4; font-size: 12px; line-height: 16px; padding: 0 4px; margin: 0; width: 80px; outline-style: none; vertical-align: top; position: absolute; top: 0; } .tree-node-proxy { background-color: #ffffff; color: #333; border-color: #D4D4D4; } .tree-node-hover { background: #e6e6e6; color: #00438a; } .tree-node-selected { background: #0081c2; color: #fff; } .tree-node-hidden { display: none; } .validatebox-invalid { border-color: #ffa8a8; background-color: #fff3f3; color: #000; } .tooltip { position: absolute; display: none; z-index: 9900000; outline: none; opacity: 1; filter: alpha(opacity=100); padding: 5px; border-width: 1px; border-style: solid; border-radius: 5px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .tooltip-content { font-size: 12px; } .tooltip-arrow-outer, .tooltip-arrow { position: absolute; width: 0; height: 0; line-height: 0; font-size: 0; border-style: solid; border-width: 6px; border-color: transparent; _border-color: tomato; _filter: chroma(color=tomato); } .tooltip-arrow { display: none \9; } .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; margin: -6px 0 0 -13px; } .tooltip-right .tooltip-arrow { left: 0; top: 50%; margin: -6px 0 0 -12px; } .tooltip-left .tooltip-arrow-outer { right: 0; top: 50%; margin: -6px -13px 0 0; } .tooltip-left .tooltip-arrow { right: 0; top: 50%; margin: -6px -12px 0 0; } .tooltip-top .tooltip-arrow-outer { bottom: 0; left: 50%; margin: 0 0 -13px -6px; } .tooltip-top .tooltip-arrow { bottom: 0; left: 50%; margin: 0 0 -12px -6px; } .tooltip-bottom .tooltip-arrow-outer { top: 0; left: 50%; margin: -13px 0 0 -6px; } .tooltip-bottom .tooltip-arrow { top: 0; left: 50%; margin: -12px 0 0 -6px; } .tooltip { background-color: #ffffff; border-color: #D4D4D4; color: #333; } .tooltip-right .tooltip-arrow-outer { border-right-color: #D4D4D4; } .tooltip-right .tooltip-arrow { border-right-color: #ffffff; } .tooltip-left .tooltip-arrow-outer { border-left-color: #D4D4D4; } .tooltip-left .tooltip-arrow { border-left-color: #ffffff; } .tooltip-top .tooltip-arrow-outer { border-top-color: #D4D4D4; } .tooltip-top .tooltip-arrow { border-top-color: #ffffff; } .tooltip-bottom .tooltip-arrow-outer { border-bottom-color: #D4D4D4; } .tooltip-bottom .tooltip-arrow { border-bottom-color: #ffffff; } .switchbutton { text-decoration: none; display: inline-block; overflow: hidden; vertical-align: middle; margin: 0; padding: 0; cursor: pointer; background: #bbb; border: 1px solid #bbb; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .switchbutton-inner { display: inline-block; overflow: hidden; position: relative; top: -1px; left: -1px; } .switchbutton-on, .switchbutton-off, .switchbutton-handle { display: inline-block; text-align: center; height: 100%; float: left; font-size: 12px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .switchbutton-on { background: #0081c2; color: #fff; } .switchbutton-off { background-color: #ffffff; color: #333; } .switchbutton-on, .switchbutton-reversed .switchbutton-off { -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .switchbutton-off, .switchbutton-reversed .switchbutton-on { -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; } .switchbutton-handle { position: absolute; top: 0; left: 50%; background-color: #ffffff; color: #333; border: 1px solid #bbb; -moz-box-shadow: 0 0 3px 0 #bbb; -webkit-box-shadow: 0 0 3px 0 #bbb; box-shadow: 0 0 3px 0 #bbb; } .switchbutton-value { position: absolute; top: 0; left: -5000px; } .switchbutton-disabled { opacity: 0.5; filter: alpha(opacity=50); } .switchbutton-disabled, .switchbutton-readonly { cursor: default; } .tabs-panels { border-color: transparent; } .tabs li a.tabs-inner { border-color: transparent; background: transparent; filter: none; color: #0088CC; } .menu-active { background-color: #0081C2; border-color: #0081C2; color: #fff; } .menu-active-disabled { border-color: transparent; background: transparent; color: #333; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/filebox.css ================================================ .filebox .textbox-value { vertical-align: top; position: absolute; top: 0; left: -5000px; } .filebox-label { display: inline-block; position: absolute; width: 100%; height: 100%; cursor: pointer; left: 0; top: 0; z-index: 10; background: url('images/blank.gif') no-repeat; } .l-btn-disabled .filebox-label { cursor: default; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/layout.css ================================================ .layout { position: relative; overflow: hidden; margin: 0; padding: 0; z-index: 0; } .layout-panel { position: absolute; overflow: hidden; } .layout-body { min-width: 1px; min-height: 1px; } .layout-panel-east, .layout-panel-west { z-index: 2; } .layout-panel-north, .layout-panel-south { z-index: 3; } .layout-expand { position: absolute; padding: 0px; font-size: 1px; cursor: pointer; z-index: 1; } .layout-expand .panel-header, .layout-expand .panel-body { background: transparent; filter: none; overflow: hidden; } .layout-expand .panel-header { border-bottom-width: 0px; } .layout-expand .panel-body { position: relative; } .layout-expand .panel-body .panel-icon { margin-top: 0; top: 0; left: 50%; margin-left: -8px; } .layout-expand-west .panel-header .panel-icon, .layout-expand-east .panel-header .panel-icon { display: none; } .layout-expand-title { position: absolute; top: 0; left: 21px; white-space: nowrap; word-wrap: normal; -webkit-transform: rotate(90deg); -webkit-transform-origin: 0 0; -moz-transform: rotate(90deg); -moz-transform-origin: 0 0; -o-transform: rotate(90deg); -o-transform-origin: 0 0; transform: rotate(90deg); transform-origin: 0 0; } .layout-expand-with-icon { top: 18px; } .layout-expand .panel-body-noheader .layout-expand-title, .layout-expand .panel-body-noheader .panel-icon { top: 5px; } .layout-expand .panel-body-noheader .layout-expand-with-icon { top: 23px; } .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; font-size: 1px; display: none; z-index: 5; } .layout-split-proxy-h { width: 5px; cursor: e-resize; } .layout-split-proxy-v { height: 5px; cursor: n-resize; } .layout-mask { position: absolute; background: #fafafa; filter: alpha(opacity=10); opacity: 0.10; z-index: 4; } .layout-button-up { background: url('images/layout_arrows.png') no-repeat -16px -16px; } .layout-button-down { background: url('images/layout_arrows.png') no-repeat -16px 0; } .layout-button-left { background: url('images/layout_arrows.png') no-repeat 0 0; } .layout-button-right { background: url('images/layout_arrows.png') no-repeat 0 -16px; } .layout-split-proxy-h, .layout-split-proxy-v { background-color: #bbb; } .layout-split-north { border-bottom: 5px solid #eee; } .layout-split-south { border-top: 5px solid #eee; } .layout-split-east { border-left: 5px solid #eee; } .layout-split-west { border-right: 5px solid #eee; } .layout-expand { background-color: #F2F2F2; } .layout-expand-over { background-color: #F2F2F2; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/linkbutton.css ================================================ .l-btn { text-decoration: none; display: inline-block; overflow: hidden; margin: 0; padding: 0; cursor: pointer; outline: none; text-align: center; vertical-align: middle; line-height: normal; } .l-btn-plain { border-width: 0; padding: 1px; } .l-btn-left { display: inline-block; position: relative; overflow: hidden; margin: 0; padding: 0; vertical-align: top; } .l-btn-text { display: inline-block; vertical-align: top; width: auto; line-height: 24px; font-size: 12px; padding: 0; margin: 0 4px; } .l-btn-icon { display: inline-block; width: 16px; height: 16px; line-height: 16px; position: absolute; top: 50%; margin-top: -8px; font-size: 1px; } .l-btn span span .l-btn-empty { display: inline-block; margin: 0; width: 16px; height: 24px; font-size: 1px; vertical-align: top; } .l-btn span .l-btn-icon-left { padding: 0 0 0 20px; background-position: left center; } .l-btn span .l-btn-icon-right { padding: 0 20px 0 0; background-position: right center; } .l-btn-icon-left .l-btn-text { margin: 0 4px 0 24px; } .l-btn-icon-left .l-btn-icon { left: 4px; } .l-btn-icon-right .l-btn-text { margin: 0 24px 0 4px; } .l-btn-icon-right .l-btn-icon { right: 4px; } .l-btn-icon-top .l-btn-text { margin: 20px 4px 0 4px; } .l-btn-icon-top .l-btn-icon { top: 4px; left: 50%; margin: 0 0 0 -8px; } .l-btn-icon-bottom .l-btn-text { margin: 0 4px 20px 4px; } .l-btn-icon-bottom .l-btn-icon { top: auto; bottom: 4px; left: 50%; margin: 0 0 0 -8px; } .l-btn-left .l-btn-empty { margin: 0 4px; width: 16px; } .l-btn-plain:hover { padding: 0; } .l-btn-focus { outline: #0000FF dotted thin; } .l-btn-large .l-btn-text { line-height: 40px; } .l-btn-large .l-btn-icon { width: 32px; height: 32px; line-height: 32px; margin-top: -16px; } .l-btn-large .l-btn-icon-left .l-btn-text { margin-left: 40px; } .l-btn-large .l-btn-icon-right .l-btn-text { margin-right: 40px; } .l-btn-large .l-btn-icon-top .l-btn-text { margin-top: 36px; line-height: 24px; min-width: 32px; } .l-btn-large .l-btn-icon-top .l-btn-icon { margin: 0 0 0 -16px; } .l-btn-large .l-btn-icon-bottom .l-btn-text { margin-bottom: 36px; line-height: 24px; min-width: 32px; } .l-btn-large .l-btn-icon-bottom .l-btn-icon { margin: 0 0 0 -16px; } .l-btn-large .l-btn-left .l-btn-empty { margin: 0 4px; width: 32px; } .l-btn { color: #444; background: #f5f5f5; background-repeat: repeat-x; border: 1px solid #bbb; background: -webkit-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: -moz-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: -o-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: linear-gradient(to bottom,#ffffff 0,#e6e6e6 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#e6e6e6,GradientType=0); -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .l-btn:hover { background: #e6e6e6; color: #00438a; border: 1px solid #ddd; filter: none; } .l-btn-plain { background: transparent; border-width: 0; filter: none; } .l-btn-outline { border-width: 1px; border-color: #ddd; padding: 0; } .l-btn-plain:hover { background: #e6e6e6; color: #00438a; border: 1px solid #ddd; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .l-btn-disabled, .l-btn-disabled:hover { opacity: 0.5; cursor: default; background: #f5f5f5; color: #444; background: -webkit-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: -moz-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: -o-linear-gradient(top,#ffffff 0,#e6e6e6 100%); background: linear-gradient(to bottom,#ffffff 0,#e6e6e6 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#e6e6e6,GradientType=0); } .l-btn-disabled .l-btn-text, .l-btn-disabled .l-btn-icon { filter: alpha(opacity=50); } .l-btn-plain-disabled, .l-btn-plain-disabled:hover { background: transparent; filter: alpha(opacity=50); } .l-btn-selected, .l-btn-selected:hover { background: #ddd; filter: none; } .l-btn-plain-selected, .l-btn-plain-selected:hover { background: #ddd; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/menu.css ================================================ .menu { position: absolute; margin: 0; padding: 2px; border-width: 1px; border-style: solid; overflow: hidden; } .menu-inline { position: relative; } .menu-item { position: relative; margin: 0; padding: 0; overflow: hidden; white-space: nowrap; cursor: pointer; border-width: 1px; border-style: solid; } .menu-text { height: 20px; line-height: 20px; float: left; padding-left: 28px; } .menu-icon { position: absolute; width: 16px; height: 16px; left: 2px; top: 50%; margin-top: -8px; } .menu-rightarrow { position: absolute; width: 16px; height: 16px; right: 0; top: 50%; margin-top: -8px; } .menu-line { position: absolute; left: 26px; top: 0; height: 2000px; font-size: 1px; } .menu-sep { margin: 3px 0px 3px 25px; font-size: 1px; } .menu-noline .menu-line { display: none; } .menu-noline .menu-sep { margin-left: 0; margin-right: 0; } .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .menu-item-disabled { opacity: 0.5; filter: alpha(opacity=50); cursor: default; } .menu-text, .menu-text span { font-size: 12px; } .menu-shadow { position: absolute; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; background: #ccc; -moz-box-shadow: 2px 2px 3px #cccccc; -webkit-box-shadow: 2px 2px 3px #cccccc; box-shadow: 2px 2px 3px #cccccc; filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); } .menu-rightarrow { background: url('images/menu_arrows.png') no-repeat -32px center; } .menu-line { border-left: 1px solid #ccc; border-right: 1px solid #fff; } .menu-sep { border-top: 1px solid #ccc; border-bottom: 1px solid #fff; } .menu { background-color: #fff; border-color: #e6e6e6; color: #333; } .menu-content { background: #ffffff; } .menu-item { border-color: transparent; _border-color: #fff; } .menu-active { border-color: #ddd; color: #00438a; background: #e6e6e6; } .menu-active-disabled { border-color: transparent; background: transparent; color: #333; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/menubutton.css ================================================ .m-btn-downarrow, .s-btn-downarrow { display: inline-block; position: absolute; width: 16px; height: 16px; font-size: 1px; right: 0; top: 50%; margin-top: -8px; } .m-btn-active, .s-btn-active { background: #e6e6e6; color: #00438a; border: 1px solid #ddd; filter: none; } .m-btn-plain-active, .s-btn-plain-active { background: transparent; padding: 0; border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .m-btn .l-btn-left .l-btn-text { margin-right: 20px; } .m-btn .l-btn-icon-right .l-btn-text { margin-right: 40px; } .m-btn .l-btn-icon-right .l-btn-icon { right: 20px; } .m-btn .l-btn-icon-top .l-btn-text { margin-right: 4px; margin-bottom: 14px; } .m-btn .l-btn-icon-bottom .l-btn-text { margin-right: 4px; margin-bottom: 34px; } .m-btn .l-btn-icon-bottom .l-btn-icon { top: auto; bottom: 20px; } .m-btn .l-btn-icon-top .m-btn-downarrow, .m-btn .l-btn-icon-bottom .m-btn-downarrow { top: auto; bottom: 0px; left: 50%; margin-left: -8px; } .m-btn-line { display: inline-block; position: absolute; font-size: 1px; display: none; } .m-btn .l-btn-left .m-btn-line { right: 0; width: 16px; height: 500px; border-style: solid; border-color: #bbb; border-width: 0 0 0 1px; } .m-btn .l-btn-icon-top .m-btn-line, .m-btn .l-btn-icon-bottom .m-btn-line { left: 0; bottom: 0; width: 500px; height: 16px; border-width: 1px 0 0 0; } .m-btn-large .l-btn-icon-right .l-btn-text { margin-right: 56px; } .m-btn-large .l-btn-icon-bottom .l-btn-text { margin-bottom: 50px; } .m-btn-downarrow, .s-btn-downarrow { background: url('images/menu_arrows.png') no-repeat 0 center; } .m-btn-plain-active, .s-btn-plain-active { border-color: #ddd; background-color: #e6e6e6; color: #00438a; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/messager.css ================================================ .messager-body { padding: 10px 10px 30px 10px; overflow: auto; } .messager-button { text-align: center; padding: 5px; } .messager-button .l-btn { width: 70px; } .messager-icon { float: left; width: 32px; height: 32px; margin: 0 10px 10px 0; } .messager-error { background: url('images/messager_icons.png') no-repeat scroll -64px 0; } .messager-info { background: url('images/messager_icons.png') no-repeat scroll 0 0; } .messager-question { background: url('images/messager_icons.png') no-repeat scroll -32px 0; } .messager-warning { background: url('images/messager_icons.png') no-repeat scroll -96px 0; } .messager-progress { padding: 10px; } .messager-p-msg { margin-bottom: 5px; } .messager-body .messager-input { width: 100%; padding: 4px 0; outline-style: none; border: 1px solid #D4D4D4; } .window-thinborder .messager-button { padding-bottom: 8px; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/numberbox.css ================================================ ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/pagination.css ================================================ .pagination { zoom: 1; } .pagination table { float: left; height: 30px; } .pagination td { border: 0; } .pagination-btn-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 3px 1px; } .pagination .pagination-num { border-width: 1px; border-style: solid; margin: 0 2px; padding: 2px; width: 2em; height: auto; } .pagination-page-list { margin: 0px 6px; padding: 1px 2px; width: auto; height: auto; border-width: 1px; border-style: solid; } .pagination-info { float: right; margin: 0 6px 0 0; padding: 0; height: 30px; line-height: 30px; font-size: 12px; } .pagination span { font-size: 12px; } .pagination-link .l-btn-text { width: 24px; text-align: center; margin: 0; } .pagination-first { background: url('images/pagination_icons.png') no-repeat 0 center; } .pagination-prev { background: url('images/pagination_icons.png') no-repeat -16px center; } .pagination-next { background: url('images/pagination_icons.png') no-repeat -32px center; } .pagination-last { background: url('images/pagination_icons.png') no-repeat -48px center; } .pagination-load { background: url('images/pagination_icons.png') no-repeat -64px center; } .pagination-loading { background: url('images/loading.gif') no-repeat center center; } .pagination-page-list, .pagination .pagination-num { border-color: #D4D4D4; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/panel.css ================================================ .panel { overflow: hidden; text-align: left; margin: 0; border: 0; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .panel-header, .panel-body { border-width: 1px; border-style: solid; } .panel-header { padding: 5px; position: relative; } .panel-title { background: url('images/blank.gif') no-repeat; } .panel-header-noborder { border-width: 0 0 1px 0; } .panel-body { overflow: auto; border-top-width: 0; padding: 0; } .panel-body-noheader { border-top-width: 1px; } .panel-body-noborder { border-width: 0px; } .panel-body-nobottom { border-bottom-width: 0; } .panel-with-icon { padding-left: 18px; } .panel-icon, .panel-tool { position: absolute; top: 50%; margin-top: -8px; height: 16px; overflow: hidden; } .panel-icon { left: 5px; width: 16px; } .panel-tool { right: 5px; width: auto; } .panel-tool a { display: inline-block; width: 16px; height: 16px; opacity: 0.6; filter: alpha(opacity=60); margin: 0 0 0 2px; vertical-align: top; } .panel-tool a:hover { opacity: 1; filter: alpha(opacity=100); background-color: #e6e6e6; -moz-border-radius: 3px 3px 3px 3px; -webkit-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; } .panel-loading { padding: 11px 0px 10px 30px; } .panel-noscroll { overflow: hidden; } .panel-fit, .panel-fit body { height: 100%; margin: 0; padding: 0; border: 0; overflow: hidden; } .panel-loading { background: url('images/loading.gif') no-repeat 10px 10px; } .panel-tool-close { background: url('images/panel_tools.png') no-repeat -16px 0px; } .panel-tool-min { background: url('images/panel_tools.png') no-repeat 0px 0px; } .panel-tool-max { background: url('images/panel_tools.png') no-repeat 0px -16px; } .panel-tool-restore { background: url('images/panel_tools.png') no-repeat -16px -16px; } .panel-tool-collapse { background: url('images/panel_tools.png') no-repeat -32px 0; } .panel-tool-expand { background: url('images/panel_tools.png') no-repeat -32px -16px; } .panel-header, .panel-body { border-color: #D4D4D4; } .panel-header { background-color: #F2F2F2; background: -webkit-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -moz-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -o-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); } .panel-body { background-color: #ffffff; color: #333; font-size: 12px; } .panel-title { font-size: 12px; font-weight: bold; color: #777; height: 16px; line-height: 16px; } .panel-footer { border: 1px solid #D4D4D4; overflow: hidden; background: #F5F5F5; } .panel-footer-noborder { border-width: 1px 0 0 0; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/passwordbox.css ================================================ .passwordbox-open { background: url('images/passwordbox_open.png') no-repeat center center; } .passwordbox-close { background: url('images/passwordbox_close.png') no-repeat center center; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/progressbar.css ================================================ .progressbar { border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; overflow: hidden; position: relative; } .progressbar-text { text-align: center; position: absolute; } .progressbar-value { position: relative; overflow: hidden; width: 0; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .progressbar { border-color: #D4D4D4; } .progressbar-text { color: #333; font-size: 12px; } .progressbar-value .progressbar-text { background-color: #0081c2; color: #fff; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/propertygrid.css ================================================ .propertygrid .datagrid-view1 .datagrid-body td { padding-bottom: 1px; border-width: 0 1px 0 0; } .propertygrid .datagrid-group { height: 21px; overflow: hidden; border-width: 0 0 1px 0; border-style: solid; } .propertygrid .datagrid-group span { font-weight: bold; } .propertygrid .datagrid-view1 .datagrid-body td { border-color: #e6e6e6; } .propertygrid .datagrid-view1 .datagrid-group { border-color: #F2F2F2; } .propertygrid .datagrid-view2 .datagrid-group { border-color: #e6e6e6; } .propertygrid .datagrid-group, .propertygrid .datagrid-view1 .datagrid-body, .propertygrid .datagrid-view1 .datagrid-row-over, .propertygrid .datagrid-view1 .datagrid-row-selected { background: #F2F2F2; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/searchbox.css ================================================ .searchbox-button { width: 18px; height: 20px; overflow: hidden; display: inline-block; vertical-align: top; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); } .searchbox-button-hover { opacity: 1.0; filter: alpha(opacity=100); } .searchbox .l-btn-plain { border: 0; padding: 0; vertical-align: top; opacity: 0.6; filter: alpha(opacity=60); -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .l-btn-plain:hover { border: 0; padding: 0; opacity: 1.0; filter: alpha(opacity=100); -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox a.m-btn-plain-active { -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .m-btn-active { border-width: 0 1px 0 0; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .textbox-button-right { border-width: 0 0 0 1px; } .searchbox .textbox-button-left { border-width: 0 1px 0 0; } .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } .searchbox .l-btn-plain { background: #F2F2F2; } .searchbox .l-btn-plain-disabled, .searchbox .l-btn-plain-disabled:hover { opacity: 0.5; filter: alpha(opacity=50); } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/slider.css ================================================ .slider-disabled { opacity: 0.5; filter: alpha(opacity=50); } .slider-h { height: 22px; } .slider-v { width: 22px; } .slider-inner { position: relative; height: 6px; top: 7px; border-width: 1px; border-style: solid; border-radius: 5px; } .slider-handle { position: absolute; display: block; outline: none; width: 20px; height: 20px; top: 50%; margin-top: -10px; margin-left: -10px; } .slider-tip { position: absolute; display: inline-block; line-height: 12px; font-size: 12px; white-space: nowrap; top: -22px; } .slider-rule { position: relative; top: 15px; } .slider-rule span { position: absolute; display: inline-block; font-size: 0; height: 5px; border-width: 0 0 0 1px; border-style: solid; } .slider-rulelabel { position: relative; top: 20px; } .slider-rulelabel span { position: absolute; display: inline-block; font-size: 12px; } .slider-v .slider-inner { width: 6px; left: 7px; top: 0; float: left; } .slider-v .slider-handle { left: 50%; margin-top: -10px; } .slider-v .slider-tip { left: -10px; margin-top: -6px; } .slider-v .slider-rule { float: left; top: 0; left: 16px; } .slider-v .slider-rule span { width: 5px; height: 'auto'; border-left: 0; border-width: 1px 0 0 0; border-style: solid; } .slider-v .slider-rulelabel { float: left; top: 0; left: 23px; } .slider-handle { background: url('images/slider_handle.png') no-repeat; } .slider-inner { border-color: #D4D4D4; background: #F2F2F2; } .slider-rule span { border-color: #D4D4D4; } .slider-rulelabel span { color: #333; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/spinner.css ================================================ .spinner-arrow { background-color: #F2F2F2; display: inline-block; overflow: hidden; vertical-align: top; margin: 0; padding: 0; opacity: 1.0; filter: alpha(opacity=100); width: 18px; } .spinner-arrow-up, .spinner-arrow-down { opacity: 0.6; filter: alpha(opacity=60); display: block; font-size: 1px; width: 18px; height: 10px; width: 100%; height: 50%; color: #444; outline-style: none; } .spinner-arrow-hover { background-color: #e6e6e6; opacity: 1.0; filter: alpha(opacity=100); } .spinner-arrow-up:hover, .spinner-arrow-down:hover { opacity: 1.0; filter: alpha(opacity=100); background-color: #e6e6e6; } .textbox-icon-disabled .spinner-arrow-up:hover, .textbox-icon-disabled .spinner-arrow-down:hover { opacity: 0.6; filter: alpha(opacity=60); background-color: #F2F2F2; cursor: default; } .spinner .textbox-icon-disabled { opacity: 0.6; filter: alpha(opacity=60); } .spinner-arrow-up { background: url('images/spinner_arrows.png') no-repeat 1px center; } .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } .spinner-button-up { background: url('images/spinner_arrows.png') no-repeat -32px center; } .spinner-button-down { background: url('images/spinner_arrows.png') no-repeat -48px center; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/splitbutton.css ================================================ .s-btn:hover .m-btn-line, .s-btn-active .m-btn-line, .s-btn-plain-active .m-btn-line { display: inline-block; } .l-btn:hover .s-btn-downarrow, .s-btn-active .s-btn-downarrow, .s-btn-plain-active .s-btn-downarrow { border-style: solid; border-color: #bbb; border-width: 0 0 0 1px; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/switchbutton.css ================================================ .switchbutton { text-decoration: none; display: inline-block; overflow: hidden; vertical-align: middle; margin: 0; padding: 0; cursor: pointer; background: #bbb; border: 1px solid #bbb; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .switchbutton-inner { display: inline-block; overflow: hidden; position: relative; top: -1px; left: -1px; } .switchbutton-on, .switchbutton-off, .switchbutton-handle { display: inline-block; text-align: center; height: 100%; float: left; font-size: 12px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .switchbutton-on { background: #0081c2; color: #fff; } .switchbutton-off { background-color: #ffffff; color: #333; } .switchbutton-on, .switchbutton-reversed .switchbutton-off { -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .switchbutton-off, .switchbutton-reversed .switchbutton-on { -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; } .switchbutton-handle { position: absolute; top: 0; left: 50%; background-color: #ffffff; color: #333; border: 1px solid #bbb; -moz-box-shadow: 0 0 3px 0 #bbb; -webkit-box-shadow: 0 0 3px 0 #bbb; box-shadow: 0 0 3px 0 #bbb; } .switchbutton-value { position: absolute; top: 0; left: -5000px; } .switchbutton-disabled { opacity: 0.5; filter: alpha(opacity=50); } .switchbutton-disabled, .switchbutton-readonly { cursor: default; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/tabs.css ================================================ .tabs-container { overflow: hidden; } .tabs-header { border-width: 1px; border-style: solid; border-bottom-width: 0; position: relative; padding: 0; padding-top: 2px; overflow: hidden; } .tabs-scroller-left, .tabs-scroller-right { position: absolute; top: auto; bottom: 0; width: 18px; font-size: 1px; display: none; cursor: pointer; border-width: 1px; border-style: solid; } .tabs-scroller-left { left: 0; } .tabs-scroller-right { right: 0; } .tabs-tool { position: absolute; bottom: 0; padding: 1px; overflow: hidden; border-width: 1px; border-style: solid; } .tabs-header-plain .tabs-tool { padding: 0 1px; } .tabs-wrap { position: relative; left: 0; overflow: hidden; width: 100%; margin: 0; padding: 0; } .tabs-scrolling { margin-left: 18px; margin-right: 18px; } .tabs-disabled { opacity: 0.3; filter: alpha(opacity=30); } .tabs { list-style-type: none; height: 26px; margin: 0px; padding: 0px; padding-left: 4px; width: 50000px; border-style: solid; border-width: 0 0 1px 0; } .tabs li { float: left; display: inline-block; margin: 0 4px -1px 0; padding: 0; position: relative; border: 0; } .tabs li a.tabs-inner { display: inline-block; text-decoration: none; margin: 0; padding: 0 10px; height: 25px; line-height: 25px; text-align: center; white-space: nowrap; border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 0 0; -webkit-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; } .tabs li.tabs-selected a.tabs-inner { font-weight: bold; outline: none; } .tabs li.tabs-selected a:hover.tabs-inner { cursor: default; pointer: default; } .tabs li a.tabs-close, .tabs-p-tool { position: absolute; font-size: 1px; display: block; height: 12px; padding: 0; top: 50%; margin-top: -6px; overflow: hidden; } .tabs li a.tabs-close { width: 12px; right: 5px; opacity: 0.6; filter: alpha(opacity=60); } .tabs-p-tool { right: 16px; } .tabs-p-tool a { display: inline-block; font-size: 1px; width: 12px; height: 12px; margin: 0; opacity: 0.6; filter: alpha(opacity=60); } .tabs li a:hover.tabs-close, .tabs-p-tool a:hover { opacity: 1; filter: alpha(opacity=100); cursor: hand; cursor: pointer; } .tabs-with-icon { padding-left: 18px; } .tabs-icon { position: absolute; width: 16px; height: 16px; left: 10px; top: 50%; margin-top: -8px; } .tabs-title { font-size: 12px; } .tabs-closable { padding-right: 8px; } .tabs-panels { margin: 0px; padding: 0px; border-width: 1px; border-style: solid; border-top-width: 0; overflow: hidden; } .tabs-header-bottom { border-width: 0 1px 1px 1px; padding: 0 0 2px 0; } .tabs-header-bottom .tabs { border-width: 1px 0 0 0; } .tabs-header-bottom .tabs li { margin: -1px 4px 0 0; } .tabs-header-bottom .tabs li a.tabs-inner { -moz-border-radius: 0 0 5px 5px; -webkit-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; } .tabs-header-bottom .tabs-tool { top: 0; } .tabs-header-bottom .tabs-scroller-left, .tabs-header-bottom .tabs-scroller-right { top: 0; bottom: auto; } .tabs-panels-top { border-width: 1px 1px 0 1px; } .tabs-header-left { float: left; border-width: 1px 0 1px 1px; padding: 0; } .tabs-header-right { float: right; border-width: 1px 1px 1px 0; padding: 0; } .tabs-header-left .tabs-wrap, .tabs-header-right .tabs-wrap { height: 100%; } .tabs-header-left .tabs { height: 100%; padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, .tabs-header-right .tabs li { display: block; width: 100%; position: relative; } .tabs-header-left .tabs li { left: auto; right: 0; margin: 0 -1px 4px 0; float: right; } .tabs-header-right .tabs li { left: 0; right: auto; margin: 0 0 4px -1px; float: left; } .tabs-justified li a.tabs-inner { padding-left: 0; padding-right: 0; } .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; padding-left: 10px; padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; padding-left: 10px; padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; } .tabs-panels-right { float: right; border-width: 1px 1px 1px 0; } .tabs-panels-left { float: left; border-width: 1px 0 1px 1px; } .tabs-header-noborder, .tabs-panels-noborder { border: 0px; } .tabs-header-plain { border: 0px; background: transparent; } .tabs-pill { padding-bottom: 3px; } .tabs-header-bottom .tabs-pill { padding-top: 3px; padding-bottom: 0; } .tabs-header-left .tabs-pill { padding-right: 3px; } .tabs-header-right .tabs-pill { padding-left: 3px; } .tabs-header .tabs-pill li a.tabs-inner { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .tabs-header-narrow, .tabs-header-narrow .tabs-narrow { padding: 0; } .tabs-narrow li, .tabs-header-bottom .tabs-narrow li { margin-left: 0; margin-right: -1px; } .tabs-narrow li.tabs-last, .tabs-header-bottom .tabs-narrow li.tabs-last { margin-right: 0; } .tabs-header-left .tabs-narrow, .tabs-header-right .tabs-narrow { padding-top: 0; } .tabs-header-left .tabs-narrow li { margin-bottom: -1px; margin-right: -1px; } .tabs-header-left .tabs-narrow li.tabs-last, .tabs-header-right .tabs-narrow li.tabs-last { margin-bottom: 0; } .tabs-header-right .tabs-narrow li { margin-bottom: -1px; margin-left: -1px; } .tabs-scroller-left { background: #F2F2F2 url('images/tabs_icons.png') no-repeat 1px center; } .tabs-scroller-right { background: #F2F2F2 url('images/tabs_icons.png') no-repeat -15px center; } .tabs li a.tabs-close { background: url('images/tabs_icons.png') no-repeat -34px center; } .tabs li a.tabs-inner:hover { background: #e6e6e6; color: #00438a; filter: none; } .tabs li.tabs-selected a.tabs-inner { background-color: #ffffff; color: #777; background: -webkit-linear-gradient(top,#ffffff 0,#ffffff 100%); background: -moz-linear-gradient(top,#ffffff 0,#ffffff 100%); background: -o-linear-gradient(top,#ffffff 0,#ffffff 100%); background: linear-gradient(to bottom,#ffffff 0,#ffffff 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=0); } .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(top,#ffffff 0,#ffffff 100%); background: -moz-linear-gradient(top,#ffffff 0,#ffffff 100%); background: -o-linear-gradient(top,#ffffff 0,#ffffff 100%); background: linear-gradient(to bottom,#ffffff 0,#ffffff 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=0); } .tabs-header-left .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(left,#ffffff 0,#ffffff 100%); background: -moz-linear-gradient(left,#ffffff 0,#ffffff 100%); background: -o-linear-gradient(left,#ffffff 0,#ffffff 100%); background: linear-gradient(to right,#ffffff 0,#ffffff 100%); background-repeat: repeat-y; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=1); } .tabs-header-right .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(left,#ffffff 0,#ffffff 100%); background: -moz-linear-gradient(left,#ffffff 0,#ffffff 100%); background: -o-linear-gradient(left,#ffffff 0,#ffffff 100%); background: linear-gradient(to right,#ffffff 0,#ffffff 100%); background-repeat: repeat-y; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff,GradientType=1); } .tabs li a.tabs-inner { color: #777; background-color: #F2F2F2; background: -webkit-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -moz-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -o-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); } .tabs-header, .tabs-tool { background-color: #F2F2F2; } .tabs-header-plain { background: transparent; } .tabs-header, .tabs-scroller-left, .tabs-scroller-right, .tabs-tool, .tabs, .tabs-panels, .tabs li a.tabs-inner, .tabs li.tabs-selected a.tabs-inner, .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner, .tabs-header-left .tabs li.tabs-selected a.tabs-inner, .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-color: #D4D4D4; } .tabs-p-tool a:hover, .tabs li a:hover.tabs-close, .tabs-scroller-over { background-color: #e6e6e6; } .tabs li.tabs-selected a.tabs-inner { border-bottom: 1px solid #ffffff; } .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { border-top: 1px solid #ffffff; } .tabs-header-left .tabs li.tabs-selected a.tabs-inner { border-right: 1px solid #ffffff; } .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #ffffff; } .tabs-header .tabs-pill li.tabs-selected a.tabs-inner { background: #0081c2; color: #fff; filter: none; border-color: #D4D4D4; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/tagbox.css ================================================ .tagbox { cursor: text; } .tagbox .textbox-text { float: left; } .tagbox-label { position: relative; display: block; margin: 4px 0 0 4px; padding: 0 20px 0 4px; float: left; vertical-align: top; text-decoration: none; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; background: #e6e6e6; color: #00438a; } .tagbox-remove { background: url('images/tagbox_icons.png') no-repeat -16px center; position: absolute; display: block; width: 16px; height: 16px; right: 2px; top: 50%; margin-top: -8px; opacity: 0.6; filter: alpha(opacity=60); } .tagbox-remove:hover { opacity: 1; filter: alpha(opacity=100); } .textbox-disabled .tagbox-label { cursor: default; } .textbox-disabled .tagbox-remove:hover { cursor: default; opacity: 0.6; filter: alpha(opacity=60); } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/textbox.css ================================================ .textbox { position: relative; border: 1px solid #D4D4D4; background-color: #fff; vertical-align: middle; display: inline-block; overflow: hidden; white-space: nowrap; margin: 0; padding: 0; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .textbox .textbox-text { font-size: 12px; border: 0; margin: 0; padding: 4px; white-space: normal; vertical-align: top; outline-style: none; resize: none; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .textbox .textbox-text::-ms-clear, .textbox .textbox-text::-ms-reveal { display: none; } .textbox textarea.textbox-text { white-space: pre-wrap; } .textbox .textbox-prompt { font-size: 12px; color: #aaa; } .textbox .textbox-bgicon { background-position: 3px center; padding-left: 21px; } .textbox .textbox-button, .textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; vertical-align: top; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .textbox .textbox-button-right, .textbox .textbox-button-right:hover { right: 0; border-width: 0 0 0 1px; } .textbox .textbox-button-left, .textbox .textbox-button-left:hover { left: 0; border-width: 0 1px 0 0; } .textbox .textbox-button-top, .textbox .textbox-button-top:hover { left: 0; border-width: 0 0 1px 0; } .textbox .textbox-button-bottom, .textbox .textbox-button-bottom:hover { top: auto; bottom: 0; left: 0; border-width: 1px 0 0 0; } .textbox-addon { position: absolute; top: 0; } .textbox-label { display: inline-block; width: 80px; height: 22px; line-height: 22px; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; padding-right: 5px; } .textbox-label-after { padding-left: 5px; padding-right: 0; } .textbox-label-top { display: block; width: auto; padding: 0; } .textbox-disabled, .textbox-label-disabled { opacity: 0.6; filter: alpha(opacity=60); } .textbox-icon { display: inline-block; width: 18px; height: 20px; overflow: hidden; vertical-align: top; background-position: center center; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); text-decoration: none; outline-style: none; } .textbox-icon-disabled, .textbox-icon-readonly { cursor: default; } .textbox-icon:hover { opacity: 1.0; filter: alpha(opacity=100); } .textbox-icon-disabled:hover { opacity: 0.6; filter: alpha(opacity=60); } .textbox-focused { border-color: #bbbbbb; -moz-box-shadow: 0 0 3px 0 #D4D4D4; -webkit-box-shadow: 0 0 3px 0 #D4D4D4; box-shadow: 0 0 3px 0 #D4D4D4; } .textbox-invalid { border-color: #ffa8a8; background-color: #fff3f3; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/tooltip.css ================================================ .tooltip { position: absolute; display: none; z-index: 9900000; outline: none; opacity: 1; filter: alpha(opacity=100); padding: 5px; border-width: 1px; border-style: solid; border-radius: 5px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .tooltip-content { font-size: 12px; } .tooltip-arrow-outer, .tooltip-arrow { position: absolute; width: 0; height: 0; line-height: 0; font-size: 0; border-style: solid; border-width: 6px; border-color: transparent; _border-color: tomato; _filter: chroma(color=tomato); } .tooltip-arrow { display: none \9; } .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; margin: -6px 0 0 -13px; } .tooltip-right .tooltip-arrow { left: 0; top: 50%; margin: -6px 0 0 -12px; } .tooltip-left .tooltip-arrow-outer { right: 0; top: 50%; margin: -6px -13px 0 0; } .tooltip-left .tooltip-arrow { right: 0; top: 50%; margin: -6px -12px 0 0; } .tooltip-top .tooltip-arrow-outer { bottom: 0; left: 50%; margin: 0 0 -13px -6px; } .tooltip-top .tooltip-arrow { bottom: 0; left: 50%; margin: 0 0 -12px -6px; } .tooltip-bottom .tooltip-arrow-outer { top: 0; left: 50%; margin: -13px 0 0 -6px; } .tooltip-bottom .tooltip-arrow { top: 0; left: 50%; margin: -12px 0 0 -6px; } .tooltip { background-color: #ffffff; border-color: #D4D4D4; color: #333; } .tooltip-right .tooltip-arrow-outer { border-right-color: #D4D4D4; } .tooltip-right .tooltip-arrow { border-right-color: #ffffff; } .tooltip-left .tooltip-arrow-outer { border-left-color: #D4D4D4; } .tooltip-left .tooltip-arrow { border-left-color: #ffffff; } .tooltip-top .tooltip-arrow-outer { border-top-color: #D4D4D4; } .tooltip-top .tooltip-arrow { border-top-color: #ffffff; } .tooltip-bottom .tooltip-arrow-outer { border-bottom-color: #D4D4D4; } .tooltip-bottom .tooltip-arrow { border-bottom-color: #ffffff; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/tree.css ================================================ .tree { margin: 0; padding: 0; list-style-type: none; } .tree li { white-space: nowrap; } .tree li ul { list-style-type: none; margin: 0; padding: 0; } .tree-node { height: 18px; white-space: nowrap; cursor: pointer; } .tree-hit { cursor: pointer; } .tree-expanded, .tree-collapsed, .tree-folder, .tree-file, .tree-checkbox, .tree-indent { display: inline-block; width: 16px; height: 18px; vertical-align: top; overflow: hidden; } .tree-expanded { background: url('images/tree_icons.png') no-repeat -18px 0px; } .tree-expanded-hover { background: url('images/tree_icons.png') no-repeat -50px 0px; } .tree-collapsed { background: url('images/tree_icons.png') no-repeat 0px 0px; } .tree-collapsed-hover { background: url('images/tree_icons.png') no-repeat -32px 0px; } .tree-lines .tree-expanded, .tree-lines .tree-root-first .tree-expanded { background: url('images/tree_icons.png') no-repeat -144px 0; } .tree-lines .tree-collapsed, .tree-lines .tree-root-first .tree-collapsed { background: url('images/tree_icons.png') no-repeat -128px 0; } .tree-lines .tree-node-last .tree-expanded, .tree-lines .tree-root-one .tree-expanded { background: url('images/tree_icons.png') no-repeat -80px 0; } .tree-lines .tree-node-last .tree-collapsed, .tree-lines .tree-root-one .tree-collapsed { background: url('images/tree_icons.png') no-repeat -64px 0; } .tree-line { background: url('images/tree_icons.png') no-repeat -176px 0; } .tree-join { background: url('images/tree_icons.png') no-repeat -192px 0; } .tree-joinbottom { background: url('images/tree_icons.png') no-repeat -160px 0; } .tree-folder { background: url('images/tree_icons.png') no-repeat -208px 0; } .tree-folder-open { background: url('images/tree_icons.png') no-repeat -224px 0; } .tree-file { background: url('images/tree_icons.png') no-repeat -240px 0; } .tree-loading { background: url('images/loading.gif') no-repeat center center; } .tree-checkbox0 { background: url('images/tree_icons.png') no-repeat -208px -18px; } .tree-checkbox1 { background: url('images/tree_icons.png') no-repeat -224px -18px; } .tree-checkbox2 { background: url('images/tree_icons.png') no-repeat -240px -18px; } .tree-title { font-size: 12px; display: inline-block; text-decoration: none; vertical-align: top; white-space: nowrap; padding: 0 2px; height: 18px; line-height: 18px; } .tree-node-proxy { font-size: 12px; line-height: 20px; padding: 0 2px 0 20px; border-width: 1px; border-style: solid; z-index: 9900000; } .tree-dnd-icon { display: inline-block; position: absolute; width: 16px; height: 18px; left: 2px; top: 50%; margin-top: -9px; } .tree-dnd-yes { background: url('images/tree_icons.png') no-repeat -256px 0; } .tree-dnd-no { background: url('images/tree_icons.png') no-repeat -256px -18px; } .tree-node-top { border-top: 1px dotted red; } .tree-node-bottom { border-bottom: 1px dotted red; } .tree-node-append .tree-title { border: 1px dotted red; } .tree-editor { border: 1px solid #D4D4D4; font-size: 12px; line-height: 16px; padding: 0 4px; margin: 0; width: 80px; outline-style: none; vertical-align: top; position: absolute; top: 0; } .tree-node-proxy { background-color: #ffffff; color: #333; border-color: #D4D4D4; } .tree-node-hover { background: #e6e6e6; color: #00438a; } .tree-node-selected { background: #0081c2; color: #fff; } .tree-node-hidden { display: none; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/validatebox.css ================================================ .validatebox-invalid { border-color: #ffa8a8; background-color: #fff3f3; color: #000; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/bootstrap/window.css ================================================ .window { overflow: hidden; padding: 5px; border-width: 1px; border-style: solid; } .window .window-header { background: transparent; padding: 0px 0px 6px 0px; } .window .window-body { border-width: 1px; border-style: solid; border-top-width: 0px; } .window .window-body-noheader { border-top-width: 1px; } .window .panel-body-nobottom { border-bottom-width: 0; } .window .window-header .panel-icon, .window .window-header .panel-tool { top: 50%; margin-top: -11px; } .window .window-header .panel-icon { left: 1px; } .window .window-header .panel-tool { right: 1px; } .window .window-header .panel-with-icon { padding-left: 18px; } .window-proxy { position: absolute; overflow: hidden; } .window-proxy-mask { position: absolute; filter: alpha(opacity=5); opacity: 0.05; } .window-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; filter: alpha(opacity=40); opacity: 0.40; font-size: 1px; overflow: hidden; } .window, .window-shadow { position: absolute; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .window-shadow { background: #ccc; -moz-box-shadow: 2px 2px 3px #cccccc; -webkit-box-shadow: 2px 2px 3px #cccccc; box-shadow: 2px 2px 3px #cccccc; filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); } .window, .window .window-body { border-color: #D4D4D4; } .window { background-color: #F2F2F2; background: -webkit-linear-gradient(top,#ffffff 0,#F2F2F2 20%); background: -moz-linear-gradient(top,#ffffff 0,#F2F2F2 20%); background: -o-linear-gradient(top,#ffffff 0,#F2F2F2 20%); background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 20%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); } .window-proxy { border: 1px dashed #D4D4D4; } .window-proxy-mask, .window-mask { background: #ccc; } .window .panel-footer { border: 1px solid #D4D4D4; position: relative; top: -1px; } .window-thinborder { padding: 0; } .window-thinborder .window-header { padding: 5px 5px 6px 5px; } .window-thinborder .window-body { border-width: 0px; } .window-thinborder .window-header .panel-icon, .window-thinborder .window-header .panel-tool { margin-top: -9px; margin-left: 5px; margin-right: 5px; } .window-noborder { border: 0; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/color.css ================================================ .c1,.c1:hover,.c1>.panel-header{ color: #fff; border-color: #3c8b3c; background: #4cae4c; background: -webkit-linear-gradient(top,#4cae4c 0,#449d44 100%); background: -moz-linear-gradient(top,#4cae4c 0,#449d44 100%); background: -o-linear-gradient(top,#4cae4c 0,#449d44 100%); background: linear-gradient(to bottom,#4cae4c 0,#449d44 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4cae4c,endColorstr=#449d44,GradientType=0); } a.c1:hover{ background: #449d44; filter: none; } .c1>.panel-body{ border-color: #3c8b3c; } .c1>.dialog-toolbar,.c1>.dialog-button{ border-left-color: #3c8b3c; border-right-color: #3c8b3c; } .c1>.dialog-button{ border-bottom-color: #3c8b3c; } .c2,.c2:hover,.c2>.panel-header{ color: #fff; border-color: #5f5f5f; background: #747474; background: -webkit-linear-gradient(top,#747474 0,#676767 100%); background: -moz-linear-gradient(top,#747474 0,#676767 100%); background: -o-linear-gradient(top,#747474 0,#676767 100%); background: linear-gradient(to bottom,#747474 0,#676767 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#747474,endColorstr=#676767,GradientType=0); } a.c2:hover{ background: #676767; filter: none; } .c2>.panel-body{ border-color: #5f5f5f; } .c2>.dialog-toolbar,.c2>.dialog-button{ border-left-color: #5f5f5f; border-right-color: #5f5f5f; } .c2>.dialog-button{ border-bottom-color: #5f5f5f; } .c3,.c3:hover,.c3>.panel-header{ color: #333; border-color: #ff8080; background: #ffb3b3; background: -webkit-linear-gradient(top,#ffb3b3 0,#ff9999 100%); background: -moz-linear-gradient(top,#ffb3b3 0,#ff9999 100%); background: -o-linear-gradient(top,#ffb3b3 0,#ff9999 100%); background: linear-gradient(to bottom,#ffb3b3 0,#ff9999 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffb3b3,endColorstr=#ff9999,GradientType=0); } a.c3:hover{ background: #ff9999; filter: none; } .c3>.panel-body{ border-color: #ff8080; } .c3>.dialog-toolbar,.c3>.dialog-button{ border-left-color: #ff8080; border-right-color: #ff8080; } .c3>.dialog-button{ border-bottom-color: #ff8080; } .c4,.c4:hover,.c4>.panel-header{ color: #333; border-color: #52d689; background: #b8eecf; background: -webkit-linear-gradient(top,#b8eecf 0,#a4e9c1 100%); background: -moz-linear-gradient(top,#b8eecf 0,#a4e9c1 100%); background: -o-linear-gradient(top,#b8eecf 0,#a4e9c1 100%); background: linear-gradient(to bottom,#b8eecf 0,#a4e9c1 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b8eecf,endColorstr=#a4e9c1,GradientType=0); } a.c4:hover{ background: #a4e9c1; filter: none; } .c4>.panel-body{ border-color: #52d689; } .c4>.dialog-toolbar,.c4>.dialog-button{ border-left-color: #52d689; border-right-color: #52d689; } .c4>.dialog-button{ border-bottom-color: #52d689; } .c5,.c5:hover,.c5>.panel-header{ color: #fff; border-color: #b52b27; background: #d84f4b; background: -webkit-linear-gradient(top,#d84f4b 0,#c9302c 100%); background: -moz-linear-gradient(top,#d84f4b 0,#c9302c 100%); background: -o-linear-gradient(top,#d84f4b 0,#c9302c 100%); background: linear-gradient(to bottom,#d84f4b 0,#c9302c 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#d84f4b,endColorstr=#c9302c,GradientType=0); } a.c5:hover{ background: #c9302c; filter: none; } .c5>.panel-body{ border-color: #b52b27; } .c5>.dialog-toolbar,.c5>.dialog-button{ border-left-color: #b52b27; border-right-color: #b52b27; } .c5>.dialog-button{ border-bottom-color: #b52b27; } .c6,.c6:hover,.c6>.panel-header{ color: #fff; border-color: #1f637b; background: #2984a4; background: -webkit-linear-gradient(top,#2984a4 0,#24748f 100%); background: -moz-linear-gradient(top,#2984a4 0,#24748f 100%); background: -o-linear-gradient(top,#2984a4 0,#24748f 100%); background: linear-gradient(to bottom,#2984a4 0,#24748f 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#2984a4,endColorstr=#24748f,GradientType=0); } a.c6:hover{ background: #24748f; filter: none; } .c6>.panel-body{ border-color: #1f637b; } .c6>.dialog-toolbar,.c6>.dialog-button{ border-left-color: #1f637b; border-right-color: #1f637b; } .c6>.dialog-button{ border-bottom-color: #1f637b; } .c7,.c7:hover,.c7>.panel-header{ color: #333; border-color: #e68900; background: #ffab2e; background: -webkit-linear-gradient(top,#ffab2e 0,#ff9900 100%); background: -moz-linear-gradient(top,#ffab2e 0,#ff9900 100%); background: -o-linear-gradient(top,#ffab2e 0,#ff9900 100%); background: linear-gradient(to bottom,#ffab2e 0,#ff9900 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffab2e,endColorstr=#ff9900,GradientType=0); } a.c7:hover{ background: #ff9900; filter: none; } .c7>.panel-body{ border-color: #e68900; } .c7>.dialog-toolbar,.c7>.dialog-button{ border-left-color: #e68900; border-right-color: #e68900; } .c7>.dialog-button{ border-bottom-color: #e68900; } .c8,.c8:hover,.c8>.panel-header{ color: #fff; border-color: #4b72a4; background: #698cba; background: -webkit-linear-gradient(top,#698cba 0,#577eb2 100%); background: -moz-linear-gradient(top,#698cba 0,#577eb2 100%); background: -o-linear-gradient(top,#698cba 0,#577eb2 100%); background: linear-gradient(to bottom,#698cba 0,#577eb2 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#698cba,endColorstr=#577eb2,GradientType=0); } a.c8:hover{ background: #577eb2; filter: none; } .c8>.panel-body{ border-color: #4b72a4; } .c8>.dialog-toolbar,.c8>.dialog-button{ border-left-color: #4b72a4; border-right-color: #4b72a4; } .c8>.dialog-button{ border-bottom-color: #4b72a4; } .c1>.panel-header>.panel-title,.c2>.panel-header>.panel-title, .c5>.panel-header>.panel-title,.c6>.panel-header>.panel-title,.c8>.panel-header>.panel-title{ color: #fff; } .c-plain{ border-color: #fff; background: #fff; } .c-plain>.panel-header, .c-plain>.panel-body, .c-plain>.dialog-button, .c-plain>.dialog-toolbar{ border-color: transparent; background: transparent; } .c-raised{ box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/accordion.css ================================================ .accordion { overflow: hidden; border-width: 1px; border-style: solid; } .accordion .accordion-header { border-width: 0 0 1px; cursor: pointer; } .accordion .accordion-body { border-width: 0 0 1px; } .accordion-noborder { border-width: 0; } .accordion-noborder .accordion-header { border-width: 0 0 1px; } .accordion-noborder .accordion-body { border-width: 0 0 1px; } .accordion-collapse { background: url('images/accordion_arrows.png') no-repeat 0 0; } .accordion-expand { background: url('images/accordion_arrows.png') no-repeat -16px 0; } .accordion { background: #ffffff; border-color: #95B8E7; } .accordion .accordion-header { background: #E0ECFF; filter: none; } .accordion .accordion-header-selected { background: #ffe48d; } .accordion .accordion-header-selected .panel-title { color: #000000; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/calendar.css ================================================ .calendar { border-width: 1px; border-style: solid; padding: 1px; overflow: hidden; } .calendar table { table-layout: fixed; border-collapse: separate; font-size: 12px; width: 100%; height: 100%; } .calendar table td, .calendar table th { font-size: 12px; } .calendar-noborder { border: 0; } .calendar-header { position: relative; height: 22px; } .calendar-title { text-align: center; height: 22px; } .calendar-title span { position: relative; display: inline-block; top: 2px; padding: 0 3px; height: 18px; line-height: 18px; font-size: 12px; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-prevmonth, .calendar-nextmonth, .calendar-prevyear, .calendar-nextyear { position: absolute; top: 50%; margin-top: -7px; width: 14px; height: 14px; cursor: pointer; font-size: 1px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-prevmonth { left: 20px; background: url('images/calendar_arrows.png') no-repeat -18px -2px; } .calendar-nextmonth { right: 20px; background: url('images/calendar_arrows.png') no-repeat -34px -2px; } .calendar-prevyear { left: 3px; background: url('images/calendar_arrows.png') no-repeat -1px -2px; } .calendar-nextyear { right: 3px; background: url('images/calendar_arrows.png') no-repeat -49px -2px; } .calendar-body { position: relative; } .calendar-body th, .calendar-body td { text-align: center; } .calendar-day { border: 0; padding: 1px; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-other-month { opacity: 0.3; filter: alpha(opacity=30); } .calendar-disabled { opacity: 0.6; filter: alpha(opacity=60); cursor: default; } .calendar-menu { position: absolute; top: 0; left: 0; width: 180px; height: 150px; padding: 5px; font-size: 12px; display: none; overflow: hidden; } .calendar-menu-year-inner { text-align: center; padding-bottom: 5px; } .calendar-menu-year { width: 50px; text-align: center; border-width: 1px; border-style: solid; outline-style: none; resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { display: inline-block; width: 21px; height: 21px; vertical-align: top; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-menu-prev { margin-right: 10px; background: url('images/calendar_arrows.png') no-repeat 2px 2px; } .calendar-menu-next { margin-left: 10px; background: url('images/calendar_arrows.png') no-repeat -45px 2px; } .calendar-menu-month { text-align: center; cursor: pointer; font-weight: bold; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-body th, .calendar-menu-month { color: #4d4d4d; } .calendar-day { color: #000000; } .calendar-sunday { color: #CC2222; } .calendar-saturday { color: #00ee00; } .calendar-today { color: #0000ff; } .calendar-menu-year { border-color: #95B8E7; } .calendar { border-color: #95B8E7; } .calendar-header { background: #E0ECFF; } .calendar-body, .calendar-menu { background: #ffffff; } .calendar-body th { background: #F4F4F4; padding: 2px 0; } .calendar-hover, .calendar-nav-hover, .calendar-menu-hover { background-color: #eaf2ff; color: #000000; } .calendar-hover { border: 1px solid #b7d2ff; padding: 0; } .calendar-selected { background-color: #ffe48d; color: #000000; border: 1px solid #ffab3f; padding: 0; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/combo.css ================================================ .combo-arrow { width: 18px; height: 20px; overflow: hidden; display: inline-block; vertical-align: top; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); } .combo-arrow-hover { opacity: 1.0; filter: alpha(opacity=100); } .combo-panel { overflow: auto; } .combo-arrow { background: url('images/combo_arrow.png') no-repeat center center; } .combo-panel { background-color: #ffffff; } .combo-arrow { background-color: #E0ECFF; } .combo-arrow-hover { background-color: #eaf2ff; } .combo-arrow:hover { background-color: #eaf2ff; } .combo .textbox-icon-disabled:hover { cursor: default; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/combobox.css ================================================ .combobox-item, .combobox-group, .combobox-stick { font-size: 12px; padding: 3px; } .combobox-item-disabled { opacity: 0.5; filter: alpha(opacity=50); } .combobox-gitem { padding-left: 10px; } .combobox-group, .combobox-stick { font-weight: bold; } .combobox-stick { position: absolute; top: 1px; left: 1px; right: 1px; background: inherit; } .combobox-item-hover { background-color: #eaf2ff; color: #000000; } .combobox-item-selected { background-color: #ffe48d; color: #000000; } .combobox-icon { display: inline-block; width: 16px; height: 16px; vertical-align: middle; margin-right: 2px; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/datagrid.css ================================================ .datagrid .panel-body { overflow: hidden; position: relative; } .datagrid-view { position: relative; overflow: hidden; } .datagrid-view1, .datagrid-view2 { position: absolute; overflow: hidden; top: 0; } .datagrid-view1 { left: 0; } .datagrid-view2 { right: 0; } .datagrid-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0.3; filter: alpha(opacity=30); display: none; } .datagrid-mask-msg { position: absolute; top: 50%; margin-top: -20px; padding: 10px 5px 10px 30px; width: auto; height: 16px; border-width: 2px; border-style: solid; display: none; } .datagrid-empty { position: absolute; left: 0; top: 0; width: 100%; height: 25px; line-height: 25px; text-align: center; } .datagrid-sort-icon { padding: 0; display: none; } .datagrid-toolbar { height: auto; padding: 1px 2px; border-width: 0 0 1px 0; border-style: solid; } .datagrid-btn-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 2px 1px; } .datagrid .datagrid-pager { display: block; margin: 0; border-width: 1px 0 0 0; border-style: solid; } .datagrid .datagrid-pager-top { border-width: 0 0 1px 0; } .datagrid-header { overflow: hidden; cursor: default; border-width: 0 0 1px 0; border-style: solid; } .datagrid-header-inner { float: left; width: 10000px; } .datagrid-header-row, .datagrid-row { height: 25px; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-width: 0 1px 1px 0; border-style: dotted; margin: 0; padding: 0; } .datagrid-cell, .datagrid-cell-group, .datagrid-header-rownumber, .datagrid-cell-rownumber { margin: 0; padding: 0 4px; white-space: nowrap; word-wrap: normal; overflow: hidden; height: 18px; line-height: 18px; font-size: 12px; } .datagrid-header .datagrid-cell { height: auto; } .datagrid-header .datagrid-cell span { font-size: 12px; } .datagrid-cell-group { text-align: center; text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { width: 30px; text-align: center; margin: 0; padding: 0; } .datagrid-body { margin: 0; padding: 0; overflow: auto; zoom: 1; } .datagrid-view1 .datagrid-body-inner { padding-bottom: 20px; } .datagrid-view1 .datagrid-body { overflow: hidden; } .datagrid-footer { overflow: hidden; } .datagrid-footer-inner { border-width: 1px 0 0 0; border-style: solid; width: 10000px; float: left; } .datagrid-row-editing .datagrid-cell { height: auto; } .datagrid-header-check, .datagrid-cell-check { padding: 0; width: 27px; height: 18px; font-size: 1px; text-align: center; overflow: hidden; } .datagrid-header-check input, .datagrid-cell-check input { margin: 0; padding: 0; width: 15px; height: 18px; } .datagrid-resize-proxy { position: absolute; width: 1px; height: 10000px; top: 0; cursor: e-resize; display: none; } .datagrid-body .datagrid-editable { margin: 0; padding: 0; } .datagrid-body .datagrid-editable table { width: 100%; height: 100%; } .datagrid-body .datagrid-editable td { border: 0; margin: 0; padding: 0; } .datagrid-view .datagrid-editable-input { margin: 0; padding: 2px 4px; border: 1px solid #95B8E7; font-size: 12px; outline-style: none; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .datagrid-view .validatebox-invalid { border-color: #ffa8a8; } .datagrid-sort .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -64px center; } .datagrid-sort-desc .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } .datagrid-row-collapse { background: url('images/datagrid_icons.png') no-repeat -48px center; } .datagrid-row-expand { background: url('images/datagrid_icons.png') no-repeat -32px center; } .datagrid-mask-msg { background: #ffffff url('images/loading.gif') no-repeat scroll 5px center; } .datagrid-header, .datagrid-td-rownumber { background-color: #efefef; background: -webkit-linear-gradient(top,#F9F9F9 0,#efefef 100%); background: -moz-linear-gradient(top,#F9F9F9 0,#efefef 100%); background: -o-linear-gradient(top,#F9F9F9 0,#efefef 100%); background: linear-gradient(to bottom,#F9F9F9 0,#efefef 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#F9F9F9,endColorstr=#efefef,GradientType=0); } .datagrid-cell-rownumber { color: #000000; } .datagrid-resize-proxy { background: #aac5e7; } .datagrid-mask { background: #ccc; } .datagrid-mask-msg { border-color: #95B8E7; } .datagrid-toolbar, .datagrid-pager { background: #F4F4F4; } .datagrid-header, .datagrid-toolbar, .datagrid-pager, .datagrid-footer-inner { border-color: #dddddd; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-color: #ccc; } .datagrid-htable, .datagrid-btable, .datagrid-ftable { color: #000000; border-collapse: separate; } .datagrid-row-alt { background: #fafafa; } .datagrid-row-over, .datagrid-header td.datagrid-header-over { background: #eaf2ff; color: #000000; cursor: default; } .datagrid-row-selected { background: #ffe48d; color: #000000; } .datagrid-row-editing .textbox, .datagrid-row-editing .textbox-text { -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/datalist.css ================================================ .datalist .datagrid-header { border-width: 0; } .datalist .datagrid-group, .m-list .m-list-group { height: 25px; line-height: 25px; font-weight: bold; overflow: hidden; background-color: #efefef; border-style: solid; border-width: 0 0 1px 0; border-color: #ccc; } .datalist .datagrid-group-expander { display: none; } .datalist .datagrid-group-title { padding: 0 4px; } .datalist .datagrid-btable { width: 100%; table-layout: fixed; } .datalist .datagrid-row td { border-style: solid; border-left-color: transparent; border-right-color: transparent; border-bottom-width: 0; } .datalist-lines .datagrid-row td { border-bottom-width: 1px; } .datalist .datagrid-cell, .m-list li { width: auto; height: auto; padding: 2px 4px; line-height: 18px; position: relative; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .datalist-link, .m-list li>a { display: block; position: relative; cursor: pointer; color: #000000; text-decoration: none; overflow: hidden; margin: -2px -4px; padding: 2px 4px; padding-right: 16px; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .datalist-link::after, .m-list li>a::after { position: absolute; display: block; width: 8px; height: 8px; content: ''; right: 6px; top: 50%; margin-top: -4px; border-style: solid; border-width: 1px 1px 0 0; -ms-transform: rotate(45deg); -moz-transform: rotate(45deg); -webkit-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); } .m-list { margin: 0; padding: 0; list-style: none; } .m-list li { border-style: solid; border-width: 0 0 1px 0; border-color: #ccc; } .m-list li>a:hover { background: #eaf2ff; color: #000000; } .m-list .m-list-group { padding: 0 4px; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/datebox.css ================================================ .datebox-calendar-inner { height: 180px; } .datebox-button { padding: 0 5px; text-align: center; } .datebox-button a { line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; opacity: 0.6; filter: alpha(opacity=60); } .datebox-button a:hover { opacity: 1.0; filter: alpha(opacity=100); } .datebox-current, .datebox-close { float: left; } .datebox-close { float: right; } .datebox .combo-arrow { background-image: url('images/datebox_arrow.png'); background-position: center center; } .datebox-button { background-color: #F4F4F4; } .datebox-button a { color: #444; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/dialog.css ================================================ .dialog-content { overflow: auto; } .dialog-toolbar { position: relative; padding: 2px 5px; } .dialog-tool-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 2px 1px; } .dialog-button { position: relative; top: -1px; padding: 5px; text-align: right; } .dialog-button .l-btn { margin-left: 5px; } .dialog-toolbar, .dialog-button { background: #F4F4F4; border-width: 1px; border-style: solid; } .dialog-toolbar { border-color: #95B8E7 #95B8E7 #dddddd #95B8E7; } .dialog-button { border-color: #dddddd #95B8E7 #95B8E7 #95B8E7; } .window-thinborder .dialog-toolbar { border-left: transparent; border-right: transparent; border-top-color: #F4F4F4; } .window-thinborder .dialog-button { top: 0px; padding: 5px 8px 8px 8px; border-left: transparent; border-right: transparent; border-bottom: transparent; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/easyui.css ================================================ .panel { overflow: hidden; text-align: left; margin: 0; border: 0; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .panel-header, .panel-body { border-width: 1px; border-style: solid; } .panel-header { padding: 5px; position: relative; } .panel-title { background: url('images/blank.gif') no-repeat; } .panel-header-noborder { border-width: 0 0 1px 0; } .panel-body { overflow: auto; border-top-width: 0; padding: 0; } .panel-body-noheader { border-top-width: 1px; } .panel-body-noborder { border-width: 0px; } .panel-body-nobottom { border-bottom-width: 0; } .panel-with-icon { padding-left: 18px; } .panel-icon, .panel-tool { position: absolute; top: 50%; margin-top: -8px; height: 16px; overflow: hidden; } .panel-icon { left: 5px; width: 16px; } .panel-tool { right: 5px; width: auto; } .panel-tool a { display: inline-block; width: 16px; height: 16px; opacity: 0.6; filter: alpha(opacity=60); margin: 0 0 0 2px; vertical-align: top; } .panel-tool a:hover { opacity: 1; filter: alpha(opacity=100); background-color: #eaf2ff; -moz-border-radius: 3px 3px 3px 3px; -webkit-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; } .panel-loading { padding: 11px 0px 10px 30px; } .panel-noscroll { overflow: hidden; } .panel-fit, .panel-fit body { height: 100%; margin: 0; padding: 0; border: 0; overflow: hidden; } .panel-loading { background: url('images/loading.gif') no-repeat 10px 10px; } .panel-tool-close { background: url('images/panel_tools.png') no-repeat -16px 0px; } .panel-tool-min { background: url('images/panel_tools.png') no-repeat 0px 0px; } .panel-tool-max { background: url('images/panel_tools.png') no-repeat 0px -16px; } .panel-tool-restore { background: url('images/panel_tools.png') no-repeat -16px -16px; } .panel-tool-collapse { background: url('images/panel_tools.png') no-repeat -32px 0; } .panel-tool-expand { background: url('images/panel_tools.png') no-repeat -32px -16px; } .panel-header, .panel-body { border-color: #95B8E7; } .panel-header { background-color: #E0ECFF; background: -webkit-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: -moz-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: -o-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: linear-gradient(to bottom,#EFF5FF 0,#E0ECFF 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#E0ECFF,GradientType=0); } .panel-body { background-color: #ffffff; color: #000000; font-size: 12px; } .panel-title { font-size: 12px; font-weight: bold; color: #0E2D5F; height: 16px; line-height: 16px; } .panel-footer { border: 1px solid #95B8E7; overflow: hidden; background: #F4F4F4; } .panel-footer-noborder { border-width: 1px 0 0 0; } .accordion { overflow: hidden; border-width: 1px; border-style: solid; } .accordion .accordion-header { border-width: 0 0 1px; cursor: pointer; } .accordion .accordion-body { border-width: 0 0 1px; } .accordion-noborder { border-width: 0; } .accordion-noborder .accordion-header { border-width: 0 0 1px; } .accordion-noborder .accordion-body { border-width: 0 0 1px; } .accordion-collapse { background: url('images/accordion_arrows.png') no-repeat 0 0; } .accordion-expand { background: url('images/accordion_arrows.png') no-repeat -16px 0; } .accordion { background: #ffffff; border-color: #95B8E7; } .accordion .accordion-header { background: #E0ECFF; filter: none; } .accordion .accordion-header-selected { background: #ffe48d; } .accordion .accordion-header-selected .panel-title { color: #000000; } .window { overflow: hidden; padding: 5px; border-width: 1px; border-style: solid; } .window .window-header { background: transparent; padding: 0px 0px 6px 0px; } .window .window-body { border-width: 1px; border-style: solid; border-top-width: 0px; } .window .window-body-noheader { border-top-width: 1px; } .window .panel-body-nobottom { border-bottom-width: 0; } .window .window-header .panel-icon, .window .window-header .panel-tool { top: 50%; margin-top: -11px; } .window .window-header .panel-icon { left: 1px; } .window .window-header .panel-tool { right: 1px; } .window .window-header .panel-with-icon { padding-left: 18px; } .window-proxy { position: absolute; overflow: hidden; } .window-proxy-mask { position: absolute; filter: alpha(opacity=5); opacity: 0.05; } .window-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; filter: alpha(opacity=40); opacity: 0.40; font-size: 1px; overflow: hidden; } .window, .window-shadow { position: absolute; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .window-shadow { background: #ccc; -moz-box-shadow: 2px 2px 3px #cccccc; -webkit-box-shadow: 2px 2px 3px #cccccc; box-shadow: 2px 2px 3px #cccccc; filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); } .window, .window .window-body { border-color: #95B8E7; } .window { background-color: #E0ECFF; background: -webkit-linear-gradient(top,#EFF5FF 0,#E0ECFF 20%); background: -moz-linear-gradient(top,#EFF5FF 0,#E0ECFF 20%); background: -o-linear-gradient(top,#EFF5FF 0,#E0ECFF 20%); background: linear-gradient(to bottom,#EFF5FF 0,#E0ECFF 20%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#E0ECFF,GradientType=0); } .window-proxy { border: 1px dashed #95B8E7; } .window-proxy-mask, .window-mask { background: #ccc; } .window .panel-footer { border: 1px solid #95B8E7; position: relative; top: -1px; } .window-thinborder { padding: 0; } .window-thinborder .window-header { padding: 5px 5px 6px 5px; } .window-thinborder .window-body { border-width: 0px; } .window-thinborder .window-header .panel-icon, .window-thinborder .window-header .panel-tool { margin-top: -9px; margin-left: 5px; margin-right: 5px; } .window-noborder { border: 0; } .dialog-content { overflow: auto; } .dialog-toolbar { position: relative; padding: 2px 5px; } .dialog-tool-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 2px 1px; } .dialog-button { position: relative; top: -1px; padding: 5px; text-align: right; } .dialog-button .l-btn { margin-left: 5px; } .dialog-toolbar, .dialog-button { background: #F4F4F4; border-width: 1px; border-style: solid; } .dialog-toolbar { border-color: #95B8E7 #95B8E7 #dddddd #95B8E7; } .dialog-button { border-color: #dddddd #95B8E7 #95B8E7 #95B8E7; } .window-thinborder .dialog-toolbar { border-left: transparent; border-right: transparent; border-top-color: #F4F4F4; } .window-thinborder .dialog-button { top: 0px; padding: 5px 8px 8px 8px; border-left: transparent; border-right: transparent; border-bottom: transparent; } .l-btn { text-decoration: none; display: inline-block; overflow: hidden; margin: 0; padding: 0; cursor: pointer; outline: none; text-align: center; vertical-align: middle; line-height: normal; } .l-btn-plain { border-width: 0; padding: 1px; } .l-btn-left { display: inline-block; position: relative; overflow: hidden; margin: 0; padding: 0; vertical-align: top; } .l-btn-text { display: inline-block; vertical-align: top; width: auto; line-height: 24px; font-size: 12px; padding: 0; margin: 0 4px; } .l-btn-icon { display: inline-block; width: 16px; height: 16px; line-height: 16px; position: absolute; top: 50%; margin-top: -8px; font-size: 1px; } .l-btn span span .l-btn-empty { display: inline-block; margin: 0; width: 16px; height: 24px; font-size: 1px; vertical-align: top; } .l-btn span .l-btn-icon-left { padding: 0 0 0 20px; background-position: left center; } .l-btn span .l-btn-icon-right { padding: 0 20px 0 0; background-position: right center; } .l-btn-icon-left .l-btn-text { margin: 0 4px 0 24px; } .l-btn-icon-left .l-btn-icon { left: 4px; } .l-btn-icon-right .l-btn-text { margin: 0 24px 0 4px; } .l-btn-icon-right .l-btn-icon { right: 4px; } .l-btn-icon-top .l-btn-text { margin: 20px 4px 0 4px; } .l-btn-icon-top .l-btn-icon { top: 4px; left: 50%; margin: 0 0 0 -8px; } .l-btn-icon-bottom .l-btn-text { margin: 0 4px 20px 4px; } .l-btn-icon-bottom .l-btn-icon { top: auto; bottom: 4px; left: 50%; margin: 0 0 0 -8px; } .l-btn-left .l-btn-empty { margin: 0 4px; width: 16px; } .l-btn-plain:hover { padding: 0; } .l-btn-focus { outline: #0000FF dotted thin; } .l-btn-large .l-btn-text { line-height: 40px; } .l-btn-large .l-btn-icon { width: 32px; height: 32px; line-height: 32px; margin-top: -16px; } .l-btn-large .l-btn-icon-left .l-btn-text { margin-left: 40px; } .l-btn-large .l-btn-icon-right .l-btn-text { margin-right: 40px; } .l-btn-large .l-btn-icon-top .l-btn-text { margin-top: 36px; line-height: 24px; min-width: 32px; } .l-btn-large .l-btn-icon-top .l-btn-icon { margin: 0 0 0 -16px; } .l-btn-large .l-btn-icon-bottom .l-btn-text { margin-bottom: 36px; line-height: 24px; min-width: 32px; } .l-btn-large .l-btn-icon-bottom .l-btn-icon { margin: 0 0 0 -16px; } .l-btn-large .l-btn-left .l-btn-empty { margin: 0 4px; width: 32px; } .l-btn { color: #444; background: #fafafa; background-repeat: repeat-x; border: 1px solid #bbb; background: -webkit-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: -moz-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: -o-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: linear-gradient(to bottom,#ffffff 0,#eeeeee 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#eeeeee,GradientType=0); -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .l-btn:hover { background: #eaf2ff; color: #000000; border: 1px solid #b7d2ff; filter: none; } .l-btn-plain { background: transparent; border-width: 0; filter: none; } .l-btn-outline { border-width: 1px; border-color: #b7d2ff; padding: 0; } .l-btn-plain:hover { background: #eaf2ff; color: #000000; border: 1px solid #b7d2ff; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .l-btn-disabled, .l-btn-disabled:hover { opacity: 0.5; cursor: default; background: #fafafa; color: #444; background: -webkit-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: -moz-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: -o-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: linear-gradient(to bottom,#ffffff 0,#eeeeee 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#eeeeee,GradientType=0); } .l-btn-disabled .l-btn-text, .l-btn-disabled .l-btn-icon { filter: alpha(opacity=50); } .l-btn-plain-disabled, .l-btn-plain-disabled:hover { background: transparent; filter: alpha(opacity=50); } .l-btn-selected, .l-btn-selected:hover { background: #ddd; filter: none; } .l-btn-plain-selected, .l-btn-plain-selected:hover { background: #ddd; } .textbox { position: relative; border: 1px solid #95B8E7; background-color: #fff; vertical-align: middle; display: inline-block; overflow: hidden; white-space: nowrap; margin: 0; padding: 0; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .textbox .textbox-text { font-size: 12px; border: 0; margin: 0; padding: 4px; white-space: normal; vertical-align: top; outline-style: none; resize: none; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .textbox .textbox-text::-ms-clear, .textbox .textbox-text::-ms-reveal { display: none; } .textbox textarea.textbox-text { white-space: pre-wrap; } .textbox .textbox-prompt { font-size: 12px; color: #aaa; } .textbox .textbox-bgicon { background-position: 3px center; padding-left: 21px; } .textbox .textbox-button, .textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; vertical-align: top; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .textbox .textbox-button-right, .textbox .textbox-button-right:hover { right: 0; border-width: 0 0 0 1px; } .textbox .textbox-button-left, .textbox .textbox-button-left:hover { left: 0; border-width: 0 1px 0 0; } .textbox .textbox-button-top, .textbox .textbox-button-top:hover { left: 0; border-width: 0 0 1px 0; } .textbox .textbox-button-bottom, .textbox .textbox-button-bottom:hover { top: auto; bottom: 0; left: 0; border-width: 1px 0 0 0; } .textbox-addon { position: absolute; top: 0; } .textbox-label { display: inline-block; width: 80px; height: 22px; line-height: 22px; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; padding-right: 5px; } .textbox-label-after { padding-left: 5px; padding-right: 0; } .textbox-label-top { display: block; width: auto; padding: 0; } .textbox-disabled, .textbox-label-disabled { opacity: 0.6; filter: alpha(opacity=60); } .textbox-icon { display: inline-block; width: 18px; height: 20px; overflow: hidden; vertical-align: top; background-position: center center; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); text-decoration: none; outline-style: none; } .textbox-icon-disabled, .textbox-icon-readonly { cursor: default; } .textbox-icon:hover { opacity: 1.0; filter: alpha(opacity=100); } .textbox-icon-disabled:hover { opacity: 0.6; filter: alpha(opacity=60); } .textbox-focused { border-color: #6b9cde; -moz-box-shadow: 0 0 3px 0 #95B8E7; -webkit-box-shadow: 0 0 3px 0 #95B8E7; box-shadow: 0 0 3px 0 #95B8E7; } .textbox-invalid { border-color: #ffa8a8; background-color: #fff3f3; } .passwordbox-open { background: url('images/passwordbox_open.png') no-repeat center center; } .passwordbox-close { background: url('images/passwordbox_close.png') no-repeat center center; } .filebox .textbox-value { vertical-align: top; position: absolute; top: 0; left: -5000px; } .filebox-label { display: inline-block; position: absolute; width: 100%; height: 100%; cursor: pointer; left: 0; top: 0; z-index: 10; background: url('images/blank.gif') no-repeat; } .l-btn-disabled .filebox-label { cursor: default; } .combo-arrow { width: 18px; height: 20px; overflow: hidden; display: inline-block; vertical-align: top; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); } .combo-arrow-hover { opacity: 1.0; filter: alpha(opacity=100); } .combo-panel { overflow: auto; } .combo-arrow { background: url('images/combo_arrow.png') no-repeat center center; } .combo-panel { background-color: #ffffff; } .combo-arrow { background-color: #E0ECFF; } .combo-arrow-hover { background-color: #eaf2ff; } .combo-arrow:hover { background-color: #eaf2ff; } .combo .textbox-icon-disabled:hover { cursor: default; } .combobox-item, .combobox-group, .combobox-stick { font-size: 12px; padding: 3px; } .combobox-item-disabled { opacity: 0.5; filter: alpha(opacity=50); } .combobox-gitem { padding-left: 10px; } .combobox-group, .combobox-stick { font-weight: bold; } .combobox-stick { position: absolute; top: 1px; left: 1px; right: 1px; background: inherit; } .combobox-item-hover { background-color: #eaf2ff; color: #000000; } .combobox-item-selected { background-color: #ffe48d; color: #000000; } .combobox-icon { display: inline-block; width: 16px; height: 16px; vertical-align: middle; margin-right: 2px; } .layout { position: relative; overflow: hidden; margin: 0; padding: 0; z-index: 0; } .layout-panel { position: absolute; overflow: hidden; } .layout-body { min-width: 1px; min-height: 1px; } .layout-panel-east, .layout-panel-west { z-index: 2; } .layout-panel-north, .layout-panel-south { z-index: 3; } .layout-expand { position: absolute; padding: 0px; font-size: 1px; cursor: pointer; z-index: 1; } .layout-expand .panel-header, .layout-expand .panel-body { background: transparent; filter: none; overflow: hidden; } .layout-expand .panel-header { border-bottom-width: 0px; } .layout-expand .panel-body { position: relative; } .layout-expand .panel-body .panel-icon { margin-top: 0; top: 0; left: 50%; margin-left: -8px; } .layout-expand-west .panel-header .panel-icon, .layout-expand-east .panel-header .panel-icon { display: none; } .layout-expand-title { position: absolute; top: 0; left: 21px; white-space: nowrap; word-wrap: normal; -webkit-transform: rotate(90deg); -webkit-transform-origin: 0 0; -moz-transform: rotate(90deg); -moz-transform-origin: 0 0; -o-transform: rotate(90deg); -o-transform-origin: 0 0; transform: rotate(90deg); transform-origin: 0 0; } .layout-expand-with-icon { top: 18px; } .layout-expand .panel-body-noheader .layout-expand-title, .layout-expand .panel-body-noheader .panel-icon { top: 5px; } .layout-expand .panel-body-noheader .layout-expand-with-icon { top: 23px; } .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; font-size: 1px; display: none; z-index: 5; } .layout-split-proxy-h { width: 5px; cursor: e-resize; } .layout-split-proxy-v { height: 5px; cursor: n-resize; } .layout-mask { position: absolute; background: #fafafa; filter: alpha(opacity=10); opacity: 0.10; z-index: 4; } .layout-button-up { background: url('images/layout_arrows.png') no-repeat -16px -16px; } .layout-button-down { background: url('images/layout_arrows.png') no-repeat -16px 0; } .layout-button-left { background: url('images/layout_arrows.png') no-repeat 0 0; } .layout-button-right { background: url('images/layout_arrows.png') no-repeat 0 -16px; } .layout-split-proxy-h, .layout-split-proxy-v { background-color: #aac5e7; } .layout-split-north { border-bottom: 5px solid #E6EEF8; } .layout-split-south { border-top: 5px solid #E6EEF8; } .layout-split-east { border-left: 5px solid #E6EEF8; } .layout-split-west { border-right: 5px solid #E6EEF8; } .layout-expand { background-color: #E0ECFF; } .layout-expand-over { background-color: #E0ECFF; } .tabs-container { overflow: hidden; } .tabs-header { border-width: 1px; border-style: solid; border-bottom-width: 0; position: relative; padding: 0; padding-top: 2px; overflow: hidden; } .tabs-scroller-left, .tabs-scroller-right { position: absolute; top: auto; bottom: 0; width: 18px; font-size: 1px; display: none; cursor: pointer; border-width: 1px; border-style: solid; } .tabs-scroller-left { left: 0; } .tabs-scroller-right { right: 0; } .tabs-tool { position: absolute; bottom: 0; padding: 1px; overflow: hidden; border-width: 1px; border-style: solid; } .tabs-header-plain .tabs-tool { padding: 0 1px; } .tabs-wrap { position: relative; left: 0; overflow: hidden; width: 100%; margin: 0; padding: 0; } .tabs-scrolling { margin-left: 18px; margin-right: 18px; } .tabs-disabled { opacity: 0.3; filter: alpha(opacity=30); } .tabs { list-style-type: none; height: 26px; margin: 0px; padding: 0px; padding-left: 4px; width: 50000px; border-style: solid; border-width: 0 0 1px 0; } .tabs li { float: left; display: inline-block; margin: 0 4px -1px 0; padding: 0; position: relative; border: 0; } .tabs li a.tabs-inner { display: inline-block; text-decoration: none; margin: 0; padding: 0 10px; height: 25px; line-height: 25px; text-align: center; white-space: nowrap; border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 0 0; -webkit-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; } .tabs li.tabs-selected a.tabs-inner { font-weight: bold; outline: none; } .tabs li.tabs-selected a:hover.tabs-inner { cursor: default; pointer: default; } .tabs li a.tabs-close, .tabs-p-tool { position: absolute; font-size: 1px; display: block; height: 12px; padding: 0; top: 50%; margin-top: -6px; overflow: hidden; } .tabs li a.tabs-close { width: 12px; right: 5px; opacity: 0.6; filter: alpha(opacity=60); } .tabs-p-tool { right: 16px; } .tabs-p-tool a { display: inline-block; font-size: 1px; width: 12px; height: 12px; margin: 0; opacity: 0.6; filter: alpha(opacity=60); } .tabs li a:hover.tabs-close, .tabs-p-tool a:hover { opacity: 1; filter: alpha(opacity=100); cursor: hand; cursor: pointer; } .tabs-with-icon { padding-left: 18px; } .tabs-icon { position: absolute; width: 16px; height: 16px; left: 10px; top: 50%; margin-top: -8px; } .tabs-title { font-size: 12px; } .tabs-closable { padding-right: 8px; } .tabs-panels { margin: 0px; padding: 0px; border-width: 1px; border-style: solid; border-top-width: 0; overflow: hidden; } .tabs-header-bottom { border-width: 0 1px 1px 1px; padding: 0 0 2px 0; } .tabs-header-bottom .tabs { border-width: 1px 0 0 0; } .tabs-header-bottom .tabs li { margin: -1px 4px 0 0; } .tabs-header-bottom .tabs li a.tabs-inner { -moz-border-radius: 0 0 5px 5px; -webkit-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; } .tabs-header-bottom .tabs-tool { top: 0; } .tabs-header-bottom .tabs-scroller-left, .tabs-header-bottom .tabs-scroller-right { top: 0; bottom: auto; } .tabs-panels-top { border-width: 1px 1px 0 1px; } .tabs-header-left { float: left; border-width: 1px 0 1px 1px; padding: 0; } .tabs-header-right { float: right; border-width: 1px 1px 1px 0; padding: 0; } .tabs-header-left .tabs-wrap, .tabs-header-right .tabs-wrap { height: 100%; } .tabs-header-left .tabs { height: 100%; padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, .tabs-header-right .tabs li { display: block; width: 100%; position: relative; } .tabs-header-left .tabs li { left: auto; right: 0; margin: 0 -1px 4px 0; float: right; } .tabs-header-right .tabs li { left: 0; right: auto; margin: 0 0 4px -1px; float: left; } .tabs-justified li a.tabs-inner { padding-left: 0; padding-right: 0; } .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; padding-left: 10px; padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; padding-left: 10px; padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; } .tabs-panels-right { float: right; border-width: 1px 1px 1px 0; } .tabs-panels-left { float: left; border-width: 1px 0 1px 1px; } .tabs-header-noborder, .tabs-panels-noborder { border: 0px; } .tabs-header-plain { border: 0px; background: transparent; } .tabs-pill { padding-bottom: 3px; } .tabs-header-bottom .tabs-pill { padding-top: 3px; padding-bottom: 0; } .tabs-header-left .tabs-pill { padding-right: 3px; } .tabs-header-right .tabs-pill { padding-left: 3px; } .tabs-header .tabs-pill li a.tabs-inner { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .tabs-header-narrow, .tabs-header-narrow .tabs-narrow { padding: 0; } .tabs-narrow li, .tabs-header-bottom .tabs-narrow li { margin-left: 0; margin-right: -1px; } .tabs-narrow li.tabs-last, .tabs-header-bottom .tabs-narrow li.tabs-last { margin-right: 0; } .tabs-header-left .tabs-narrow, .tabs-header-right .tabs-narrow { padding-top: 0; } .tabs-header-left .tabs-narrow li { margin-bottom: -1px; margin-right: -1px; } .tabs-header-left .tabs-narrow li.tabs-last, .tabs-header-right .tabs-narrow li.tabs-last { margin-bottom: 0; } .tabs-header-right .tabs-narrow li { margin-bottom: -1px; margin-left: -1px; } .tabs-scroller-left { background: #E0ECFF url('images/tabs_icons.png') no-repeat 1px center; } .tabs-scroller-right { background: #E0ECFF url('images/tabs_icons.png') no-repeat -15px center; } .tabs li a.tabs-close { background: url('images/tabs_icons.png') no-repeat -34px center; } .tabs li a.tabs-inner:hover { background: #eaf2ff; color: #000000; filter: none; } .tabs li.tabs-selected a.tabs-inner { background-color: #ffffff; color: #0E2D5F; background: -webkit-linear-gradient(top,#EFF5FF 0,#ffffff 100%); background: -moz-linear-gradient(top,#EFF5FF 0,#ffffff 100%); background: -o-linear-gradient(top,#EFF5FF 0,#ffffff 100%); background: linear-gradient(to bottom,#EFF5FF 0,#ffffff 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#ffffff,GradientType=0); } .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(top,#ffffff 0,#EFF5FF 100%); background: -moz-linear-gradient(top,#ffffff 0,#EFF5FF 100%); background: -o-linear-gradient(top,#ffffff 0,#EFF5FF 100%); background: linear-gradient(to bottom,#ffffff 0,#EFF5FF 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#EFF5FF,GradientType=0); } .tabs-header-left .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(left,#EFF5FF 0,#ffffff 100%); background: -moz-linear-gradient(left,#EFF5FF 0,#ffffff 100%); background: -o-linear-gradient(left,#EFF5FF 0,#ffffff 100%); background: linear-gradient(to right,#EFF5FF 0,#ffffff 100%); background-repeat: repeat-y; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#ffffff,GradientType=1); } .tabs-header-right .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(left,#ffffff 0,#EFF5FF 100%); background: -moz-linear-gradient(left,#ffffff 0,#EFF5FF 100%); background: -o-linear-gradient(left,#ffffff 0,#EFF5FF 100%); background: linear-gradient(to right,#ffffff 0,#EFF5FF 100%); background-repeat: repeat-y; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#EFF5FF,GradientType=1); } .tabs li a.tabs-inner { color: #0E2D5F; background-color: #E0ECFF; background: -webkit-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: -moz-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: -o-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: linear-gradient(to bottom,#EFF5FF 0,#E0ECFF 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#E0ECFF,GradientType=0); } .tabs-header, .tabs-tool { background-color: #E0ECFF; } .tabs-header-plain { background: transparent; } .tabs-header, .tabs-scroller-left, .tabs-scroller-right, .tabs-tool, .tabs, .tabs-panels, .tabs li a.tabs-inner, .tabs li.tabs-selected a.tabs-inner, .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner, .tabs-header-left .tabs li.tabs-selected a.tabs-inner, .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-color: #95B8E7; } .tabs-p-tool a:hover, .tabs li a:hover.tabs-close, .tabs-scroller-over { background-color: #eaf2ff; } .tabs li.tabs-selected a.tabs-inner { border-bottom: 1px solid #ffffff; } .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { border-top: 1px solid #ffffff; } .tabs-header-left .tabs li.tabs-selected a.tabs-inner { border-right: 1px solid #ffffff; } .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #ffffff; } .tabs-header .tabs-pill li.tabs-selected a.tabs-inner { background: #ffe48d; color: #000000; filter: none; border-color: #95B8E7; } .datagrid .panel-body { overflow: hidden; position: relative; } .datagrid-view { position: relative; overflow: hidden; } .datagrid-view1, .datagrid-view2 { position: absolute; overflow: hidden; top: 0; } .datagrid-view1 { left: 0; } .datagrid-view2 { right: 0; } .datagrid-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0.3; filter: alpha(opacity=30); display: none; } .datagrid-mask-msg { position: absolute; top: 50%; margin-top: -20px; padding: 10px 5px 10px 30px; width: auto; height: 16px; border-width: 2px; border-style: solid; display: none; } .datagrid-empty { position: absolute; left: 0; top: 0; width: 100%; height: 25px; line-height: 25px; text-align: center; } .datagrid-sort-icon { padding: 0; display: none; } .datagrid-toolbar { height: auto; padding: 1px 2px; border-width: 0 0 1px 0; border-style: solid; } .datagrid-btn-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 2px 1px; } .datagrid .datagrid-pager { display: block; margin: 0; border-width: 1px 0 0 0; border-style: solid; } .datagrid .datagrid-pager-top { border-width: 0 0 1px 0; } .datagrid-header { overflow: hidden; cursor: default; border-width: 0 0 1px 0; border-style: solid; } .datagrid-header-inner { float: left; width: 10000px; } .datagrid-header-row, .datagrid-row { height: 25px; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-width: 0 1px 1px 0; border-style: dotted; margin: 0; padding: 0; } .datagrid-cell, .datagrid-cell-group, .datagrid-header-rownumber, .datagrid-cell-rownumber { margin: 0; padding: 0 4px; white-space: nowrap; word-wrap: normal; overflow: hidden; height: 18px; line-height: 18px; font-size: 12px; } .datagrid-header .datagrid-cell { height: auto; } .datagrid-header .datagrid-cell span { font-size: 12px; } .datagrid-cell-group { text-align: center; text-overflow: ellipsis; } .datagrid-header-rownumber, .datagrid-cell-rownumber { width: 30px; text-align: center; margin: 0; padding: 0; } .datagrid-body { margin: 0; padding: 0; overflow: auto; zoom: 1; } .datagrid-view1 .datagrid-body-inner { padding-bottom: 20px; } .datagrid-view1 .datagrid-body { overflow: hidden; } .datagrid-footer { overflow: hidden; } .datagrid-footer-inner { border-width: 1px 0 0 0; border-style: solid; width: 10000px; float: left; } .datagrid-row-editing .datagrid-cell { height: auto; } .datagrid-header-check, .datagrid-cell-check { padding: 0; width: 27px; height: 18px; font-size: 1px; text-align: center; overflow: hidden; } .datagrid-header-check input, .datagrid-cell-check input { margin: 0; padding: 0; width: 15px; height: 18px; } .datagrid-resize-proxy { position: absolute; width: 1px; height: 10000px; top: 0; cursor: e-resize; display: none; } .datagrid-body .datagrid-editable { margin: 0; padding: 0; } .datagrid-body .datagrid-editable table { width: 100%; height: 100%; } .datagrid-body .datagrid-editable td { border: 0; margin: 0; padding: 0; } .datagrid-view .datagrid-editable-input { margin: 0; padding: 2px 4px; border: 1px solid #95B8E7; font-size: 12px; outline-style: none; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .datagrid-view .validatebox-invalid { border-color: #ffa8a8; } .datagrid-sort .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -64px center; } .datagrid-sort-desc .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat -16px center; } .datagrid-sort-asc .datagrid-sort-icon { display: inline; padding: 0 13px 0 0; background: url('images/datagrid_icons.png') no-repeat 0px center; } .datagrid-row-collapse { background: url('images/datagrid_icons.png') no-repeat -48px center; } .datagrid-row-expand { background: url('images/datagrid_icons.png') no-repeat -32px center; } .datagrid-mask-msg { background: #ffffff url('images/loading.gif') no-repeat scroll 5px center; } .datagrid-header, .datagrid-td-rownumber { background-color: #efefef; background: -webkit-linear-gradient(top,#F9F9F9 0,#efefef 100%); background: -moz-linear-gradient(top,#F9F9F9 0,#efefef 100%); background: -o-linear-gradient(top,#F9F9F9 0,#efefef 100%); background: linear-gradient(to bottom,#F9F9F9 0,#efefef 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#F9F9F9,endColorstr=#efefef,GradientType=0); } .datagrid-cell-rownumber { color: #000000; } .datagrid-resize-proxy { background: #aac5e7; } .datagrid-mask { background: #ccc; } .datagrid-mask-msg { border-color: #95B8E7; } .datagrid-toolbar, .datagrid-pager { background: #F4F4F4; } .datagrid-header, .datagrid-toolbar, .datagrid-pager, .datagrid-footer-inner { border-color: #dddddd; } .datagrid-header td, .datagrid-body td, .datagrid-footer td { border-color: #ccc; } .datagrid-htable, .datagrid-btable, .datagrid-ftable { color: #000000; border-collapse: separate; } .datagrid-row-alt { background: #fafafa; } .datagrid-row-over, .datagrid-header td.datagrid-header-over { background: #eaf2ff; color: #000000; cursor: default; } .datagrid-row-selected { background: #ffe48d; color: #000000; } .datagrid-row-editing .textbox, .datagrid-row-editing .textbox-text { -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .propertygrid .datagrid-view1 .datagrid-body td { padding-bottom: 1px; border-width: 0 1px 0 0; } .propertygrid .datagrid-group { height: 21px; overflow: hidden; border-width: 0 0 1px 0; border-style: solid; } .propertygrid .datagrid-group span { font-weight: bold; } .propertygrid .datagrid-view1 .datagrid-body td { border-color: #dddddd; } .propertygrid .datagrid-view1 .datagrid-group { border-color: #E0ECFF; } .propertygrid .datagrid-view2 .datagrid-group { border-color: #dddddd; } .propertygrid .datagrid-group, .propertygrid .datagrid-view1 .datagrid-body, .propertygrid .datagrid-view1 .datagrid-row-over, .propertygrid .datagrid-view1 .datagrid-row-selected { background: #E0ECFF; } .datalist .datagrid-header { border-width: 0; } .datalist .datagrid-group, .m-list .m-list-group { height: 25px; line-height: 25px; font-weight: bold; overflow: hidden; background-color: #efefef; border-style: solid; border-width: 0 0 1px 0; border-color: #ccc; } .datalist .datagrid-group-expander { display: none; } .datalist .datagrid-group-title { padding: 0 4px; } .datalist .datagrid-btable { width: 100%; table-layout: fixed; } .datalist .datagrid-row td { border-style: solid; border-left-color: transparent; border-right-color: transparent; border-bottom-width: 0; } .datalist-lines .datagrid-row td { border-bottom-width: 1px; } .datalist .datagrid-cell, .m-list li { width: auto; height: auto; padding: 2px 4px; line-height: 18px; position: relative; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .datalist-link, .m-list li>a { display: block; position: relative; cursor: pointer; color: #000000; text-decoration: none; overflow: hidden; margin: -2px -4px; padding: 2px 4px; padding-right: 16px; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .datalist-link::after, .m-list li>a::after { position: absolute; display: block; width: 8px; height: 8px; content: ''; right: 6px; top: 50%; margin-top: -4px; border-style: solid; border-width: 1px 1px 0 0; -ms-transform: rotate(45deg); -moz-transform: rotate(45deg); -webkit-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); } .m-list { margin: 0; padding: 0; list-style: none; } .m-list li { border-style: solid; border-width: 0 0 1px 0; border-color: #ccc; } .m-list li>a:hover { background: #eaf2ff; color: #000000; } .m-list .m-list-group { padding: 0 4px; } .pagination { zoom: 1; } .pagination table { float: left; height: 30px; } .pagination td { border: 0; } .pagination-btn-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 3px 1px; } .pagination .pagination-num { border-width: 1px; border-style: solid; margin: 0 2px; padding: 2px; width: 2em; height: auto; } .pagination-page-list { margin: 0px 6px; padding: 1px 2px; width: auto; height: auto; border-width: 1px; border-style: solid; } .pagination-info { float: right; margin: 0 6px 0 0; padding: 0; height: 30px; line-height: 30px; font-size: 12px; } .pagination span { font-size: 12px; } .pagination-link .l-btn-text { width: 24px; text-align: center; margin: 0; } .pagination-first { background: url('images/pagination_icons.png') no-repeat 0 center; } .pagination-prev { background: url('images/pagination_icons.png') no-repeat -16px center; } .pagination-next { background: url('images/pagination_icons.png') no-repeat -32px center; } .pagination-last { background: url('images/pagination_icons.png') no-repeat -48px center; } .pagination-load { background: url('images/pagination_icons.png') no-repeat -64px center; } .pagination-loading { background: url('images/loading.gif') no-repeat center center; } .pagination-page-list, .pagination .pagination-num { border-color: #95B8E7; } .calendar { border-width: 1px; border-style: solid; padding: 1px; overflow: hidden; } .calendar table { table-layout: fixed; border-collapse: separate; font-size: 12px; width: 100%; height: 100%; } .calendar table td, .calendar table th { font-size: 12px; } .calendar-noborder { border: 0; } .calendar-header { position: relative; height: 22px; } .calendar-title { text-align: center; height: 22px; } .calendar-title span { position: relative; display: inline-block; top: 2px; padding: 0 3px; height: 18px; line-height: 18px; font-size: 12px; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-prevmonth, .calendar-nextmonth, .calendar-prevyear, .calendar-nextyear { position: absolute; top: 50%; margin-top: -7px; width: 14px; height: 14px; cursor: pointer; font-size: 1px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-prevmonth { left: 20px; background: url('images/calendar_arrows.png') no-repeat -18px -2px; } .calendar-nextmonth { right: 20px; background: url('images/calendar_arrows.png') no-repeat -34px -2px; } .calendar-prevyear { left: 3px; background: url('images/calendar_arrows.png') no-repeat -1px -2px; } .calendar-nextyear { right: 3px; background: url('images/calendar_arrows.png') no-repeat -49px -2px; } .calendar-body { position: relative; } .calendar-body th, .calendar-body td { text-align: center; } .calendar-day { border: 0; padding: 1px; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-other-month { opacity: 0.3; filter: alpha(opacity=30); } .calendar-disabled { opacity: 0.6; filter: alpha(opacity=60); cursor: default; } .calendar-menu { position: absolute; top: 0; left: 0; width: 180px; height: 150px; padding: 5px; font-size: 12px; display: none; overflow: hidden; } .calendar-menu-year-inner { text-align: center; padding-bottom: 5px; } .calendar-menu-year { width: 50px; text-align: center; border-width: 1px; border-style: solid; outline-style: none; resize: none; margin: 0; padding: 2px; font-weight: bold; font-size: 12px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-menu-prev, .calendar-menu-next { display: inline-block; width: 21px; height: 21px; vertical-align: top; cursor: pointer; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-menu-prev { margin-right: 10px; background: url('images/calendar_arrows.png') no-repeat 2px 2px; } .calendar-menu-next { margin-left: 10px; background: url('images/calendar_arrows.png') no-repeat -45px 2px; } .calendar-menu-month { text-align: center; cursor: pointer; font-weight: bold; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .calendar-body th, .calendar-menu-month { color: #4d4d4d; } .calendar-day { color: #000000; } .calendar-sunday { color: #CC2222; } .calendar-saturday { color: #00ee00; } .calendar-today { color: #0000ff; } .calendar-menu-year { border-color: #95B8E7; } .calendar { border-color: #95B8E7; } .calendar-header { background: #E0ECFF; } .calendar-body, .calendar-menu { background: #ffffff; } .calendar-body th { background: #F4F4F4; padding: 2px 0; } .calendar-hover, .calendar-nav-hover, .calendar-menu-hover { background-color: #eaf2ff; color: #000000; } .calendar-hover { border: 1px solid #b7d2ff; padding: 0; } .calendar-selected { background-color: #ffe48d; color: #000000; border: 1px solid #ffab3f; padding: 0; } .datebox-calendar-inner { height: 180px; } .datebox-button { padding: 0 5px; text-align: center; } .datebox-button a { line-height: 22px; font-size: 12px; font-weight: bold; text-decoration: none; opacity: 0.6; filter: alpha(opacity=60); } .datebox-button a:hover { opacity: 1.0; filter: alpha(opacity=100); } .datebox-current, .datebox-close { float: left; } .datebox-close { float: right; } .datebox .combo-arrow { background-image: url('images/datebox_arrow.png'); background-position: center center; } .datebox-button { background-color: #F4F4F4; } .datebox-button a { color: #444; } .spinner-arrow { background-color: #E0ECFF; display: inline-block; overflow: hidden; vertical-align: top; margin: 0; padding: 0; opacity: 1.0; filter: alpha(opacity=100); width: 18px; } .spinner-arrow-up, .spinner-arrow-down { opacity: 0.6; filter: alpha(opacity=60); display: block; font-size: 1px; width: 18px; height: 10px; width: 100%; height: 50%; color: #444; outline-style: none; } .spinner-arrow-hover { background-color: #eaf2ff; opacity: 1.0; filter: alpha(opacity=100); } .spinner-arrow-up:hover, .spinner-arrow-down:hover { opacity: 1.0; filter: alpha(opacity=100); background-color: #eaf2ff; } .textbox-icon-disabled .spinner-arrow-up:hover, .textbox-icon-disabled .spinner-arrow-down:hover { opacity: 0.6; filter: alpha(opacity=60); background-color: #E0ECFF; cursor: default; } .spinner .textbox-icon-disabled { opacity: 0.6; filter: alpha(opacity=60); } .spinner-arrow-up { background: url('images/spinner_arrows.png') no-repeat 1px center; } .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } .spinner-button-up { background: url('images/spinner_arrows.png') no-repeat -32px center; } .spinner-button-down { background: url('images/spinner_arrows.png') no-repeat -48px center; } .progressbar { border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; overflow: hidden; position: relative; } .progressbar-text { text-align: center; position: absolute; } .progressbar-value { position: relative; overflow: hidden; width: 0; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .progressbar { border-color: #95B8E7; } .progressbar-text { color: #000000; font-size: 12px; } .progressbar-value .progressbar-text { background-color: #ffe48d; color: #000000; } .searchbox-button { width: 18px; height: 20px; overflow: hidden; display: inline-block; vertical-align: top; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); } .searchbox-button-hover { opacity: 1.0; filter: alpha(opacity=100); } .searchbox .l-btn-plain { border: 0; padding: 0; vertical-align: top; opacity: 0.6; filter: alpha(opacity=60); -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .l-btn-plain:hover { border: 0; padding: 0; opacity: 1.0; filter: alpha(opacity=100); -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox a.m-btn-plain-active { -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .m-btn-active { border-width: 0 1px 0 0; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .textbox-button-right { border-width: 0 0 0 1px; } .searchbox .textbox-button-left { border-width: 0 1px 0 0; } .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } .searchbox .l-btn-plain { background: #E0ECFF; } .searchbox .l-btn-plain-disabled, .searchbox .l-btn-plain-disabled:hover { opacity: 0.5; filter: alpha(opacity=50); } .slider-disabled { opacity: 0.5; filter: alpha(opacity=50); } .slider-h { height: 22px; } .slider-v { width: 22px; } .slider-inner { position: relative; height: 6px; top: 7px; border-width: 1px; border-style: solid; border-radius: 5px; } .slider-handle { position: absolute; display: block; outline: none; width: 20px; height: 20px; top: 50%; margin-top: -10px; margin-left: -10px; } .slider-tip { position: absolute; display: inline-block; line-height: 12px; font-size: 12px; white-space: nowrap; top: -22px; } .slider-rule { position: relative; top: 15px; } .slider-rule span { position: absolute; display: inline-block; font-size: 0; height: 5px; border-width: 0 0 0 1px; border-style: solid; } .slider-rulelabel { position: relative; top: 20px; } .slider-rulelabel span { position: absolute; display: inline-block; font-size: 12px; } .slider-v .slider-inner { width: 6px; left: 7px; top: 0; float: left; } .slider-v .slider-handle { left: 50%; margin-top: -10px; } .slider-v .slider-tip { left: -10px; margin-top: -6px; } .slider-v .slider-rule { float: left; top: 0; left: 16px; } .slider-v .slider-rule span { width: 5px; height: 'auto'; border-left: 0; border-width: 1px 0 0 0; border-style: solid; } .slider-v .slider-rulelabel { float: left; top: 0; left: 23px; } .slider-handle { background: url('images/slider_handle.png') no-repeat; } .slider-inner { border-color: #95B8E7; background: #E0ECFF; } .slider-rule span { border-color: #95B8E7; } .slider-rulelabel span { color: #000000; } .menu { position: absolute; margin: 0; padding: 2px; border-width: 1px; border-style: solid; overflow: hidden; } .menu-inline { position: relative; } .menu-item { position: relative; margin: 0; padding: 0; overflow: hidden; white-space: nowrap; cursor: pointer; border-width: 1px; border-style: solid; } .menu-text { height: 20px; line-height: 20px; float: left; padding-left: 28px; } .menu-icon { position: absolute; width: 16px; height: 16px; left: 2px; top: 50%; margin-top: -8px; } .menu-rightarrow { position: absolute; width: 16px; height: 16px; right: 0; top: 50%; margin-top: -8px; } .menu-line { position: absolute; left: 26px; top: 0; height: 2000px; font-size: 1px; } .menu-sep { margin: 3px 0px 3px 25px; font-size: 1px; } .menu-noline .menu-line { display: none; } .menu-noline .menu-sep { margin-left: 0; margin-right: 0; } .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .menu-item-disabled { opacity: 0.5; filter: alpha(opacity=50); cursor: default; } .menu-text, .menu-text span { font-size: 12px; } .menu-shadow { position: absolute; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; background: #ccc; -moz-box-shadow: 2px 2px 3px #cccccc; -webkit-box-shadow: 2px 2px 3px #cccccc; box-shadow: 2px 2px 3px #cccccc; filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); } .menu-rightarrow { background: url('images/menu_arrows.png') no-repeat -32px center; } .menu-line { border-left: 1px solid #ccc; border-right: 1px solid #fff; } .menu-sep { border-top: 1px solid #ccc; border-bottom: 1px solid #fff; } .menu { background-color: #fafafa; border-color: #ddd; color: #444; } .menu-content { background: #ffffff; } .menu-item { border-color: transparent; _border-color: #fafafa; } .menu-active { border-color: #b7d2ff; color: #000000; background: #eaf2ff; } .menu-active-disabled { border-color: transparent; background: transparent; color: #444; } .m-btn-downarrow, .s-btn-downarrow { display: inline-block; position: absolute; width: 16px; height: 16px; font-size: 1px; right: 0; top: 50%; margin-top: -8px; } .m-btn-active, .s-btn-active { background: #eaf2ff; color: #000000; border: 1px solid #b7d2ff; filter: none; } .m-btn-plain-active, .s-btn-plain-active { background: transparent; padding: 0; border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .m-btn .l-btn-left .l-btn-text { margin-right: 20px; } .m-btn .l-btn-icon-right .l-btn-text { margin-right: 40px; } .m-btn .l-btn-icon-right .l-btn-icon { right: 20px; } .m-btn .l-btn-icon-top .l-btn-text { margin-right: 4px; margin-bottom: 14px; } .m-btn .l-btn-icon-bottom .l-btn-text { margin-right: 4px; margin-bottom: 34px; } .m-btn .l-btn-icon-bottom .l-btn-icon { top: auto; bottom: 20px; } .m-btn .l-btn-icon-top .m-btn-downarrow, .m-btn .l-btn-icon-bottom .m-btn-downarrow { top: auto; bottom: 0px; left: 50%; margin-left: -8px; } .m-btn-line { display: inline-block; position: absolute; font-size: 1px; display: none; } .m-btn .l-btn-left .m-btn-line { right: 0; width: 16px; height: 500px; border-style: solid; border-color: #aac5e7; border-width: 0 0 0 1px; } .m-btn .l-btn-icon-top .m-btn-line, .m-btn .l-btn-icon-bottom .m-btn-line { left: 0; bottom: 0; width: 500px; height: 16px; border-width: 1px 0 0 0; } .m-btn-large .l-btn-icon-right .l-btn-text { margin-right: 56px; } .m-btn-large .l-btn-icon-bottom .l-btn-text { margin-bottom: 50px; } .m-btn-downarrow, .s-btn-downarrow { background: url('images/menu_arrows.png') no-repeat 0 center; } .m-btn-plain-active, .s-btn-plain-active { border-color: #b7d2ff; background-color: #eaf2ff; color: #000000; } .s-btn:hover .m-btn-line, .s-btn-active .m-btn-line, .s-btn-plain-active .m-btn-line { display: inline-block; } .l-btn:hover .s-btn-downarrow, .s-btn-active .s-btn-downarrow, .s-btn-plain-active .s-btn-downarrow { border-style: solid; border-color: #aac5e7; border-width: 0 0 0 1px; } .messager-body { padding: 10px 10px 30px 10px; overflow: auto; } .messager-button { text-align: center; padding: 5px; } .messager-button .l-btn { width: 70px; } .messager-icon { float: left; width: 32px; height: 32px; margin: 0 10px 10px 0; } .messager-error { background: url('images/messager_icons.png') no-repeat scroll -64px 0; } .messager-info { background: url('images/messager_icons.png') no-repeat scroll 0 0; } .messager-question { background: url('images/messager_icons.png') no-repeat scroll -32px 0; } .messager-warning { background: url('images/messager_icons.png') no-repeat scroll -96px 0; } .messager-progress { padding: 10px; } .messager-p-msg { margin-bottom: 5px; } .messager-body .messager-input { width: 100%; padding: 4px 0; outline-style: none; border: 1px solid #95B8E7; } .window-thinborder .messager-button { padding-bottom: 8px; } .tree { margin: 0; padding: 0; list-style-type: none; } .tree li { white-space: nowrap; } .tree li ul { list-style-type: none; margin: 0; padding: 0; } .tree-node { height: 18px; white-space: nowrap; cursor: pointer; } .tree-hit { cursor: pointer; } .tree-expanded, .tree-collapsed, .tree-folder, .tree-file, .tree-checkbox, .tree-indent { display: inline-block; width: 16px; height: 18px; vertical-align: top; overflow: hidden; } .tree-expanded { background: url('images/tree_icons.png') no-repeat -18px 0px; } .tree-expanded-hover { background: url('images/tree_icons.png') no-repeat -50px 0px; } .tree-collapsed { background: url('images/tree_icons.png') no-repeat 0px 0px; } .tree-collapsed-hover { background: url('images/tree_icons.png') no-repeat -32px 0px; } .tree-lines .tree-expanded, .tree-lines .tree-root-first .tree-expanded { background: url('images/tree_icons.png') no-repeat -144px 0; } .tree-lines .tree-collapsed, .tree-lines .tree-root-first .tree-collapsed { background: url('images/tree_icons.png') no-repeat -128px 0; } .tree-lines .tree-node-last .tree-expanded, .tree-lines .tree-root-one .tree-expanded { background: url('images/tree_icons.png') no-repeat -80px 0; } .tree-lines .tree-node-last .tree-collapsed, .tree-lines .tree-root-one .tree-collapsed { background: url('images/tree_icons.png') no-repeat -64px 0; } .tree-line { background: url('images/tree_icons.png') no-repeat -176px 0; } .tree-join { background: url('images/tree_icons.png') no-repeat -192px 0; } .tree-joinbottom { background: url('images/tree_icons.png') no-repeat -160px 0; } .tree-folder { background: url('images/tree_icons.png') no-repeat -208px 0; } .tree-folder-open { background: url('images/tree_icons.png') no-repeat -224px 0; } .tree-file { background: url('images/tree_icons.png') no-repeat -240px 0; } .tree-loading { background: url('images/loading.gif') no-repeat center center; } .tree-checkbox0 { background: url('images/tree_icons.png') no-repeat -208px -18px; } .tree-checkbox1 { background: url('images/tree_icons.png') no-repeat -224px -18px; } .tree-checkbox2 { background: url('images/tree_icons.png') no-repeat -240px -18px; } .tree-title { font-size: 12px; display: inline-block; text-decoration: none; vertical-align: top; white-space: nowrap; padding: 0 2px; height: 18px; line-height: 18px; } .tree-node-proxy { font-size: 12px; line-height: 20px; padding: 0 2px 0 20px; border-width: 1px; border-style: solid; z-index: 9900000; } .tree-dnd-icon { display: inline-block; position: absolute; width: 16px; height: 18px; left: 2px; top: 50%; margin-top: -9px; } .tree-dnd-yes { background: url('images/tree_icons.png') no-repeat -256px 0; } .tree-dnd-no { background: url('images/tree_icons.png') no-repeat -256px -18px; } .tree-node-top { border-top: 1px dotted red; } .tree-node-bottom { border-bottom: 1px dotted red; } .tree-node-append .tree-title { border: 1px dotted red; } .tree-editor { border: 1px solid #95B8E7; font-size: 12px; line-height: 16px; padding: 0 4px; margin: 0; width: 80px; outline-style: none; vertical-align: top; position: absolute; top: 0; } .tree-node-proxy { background-color: #ffffff; color: #000000; border-color: #95B8E7; } .tree-node-hover { background: #eaf2ff; color: #000000; } .tree-node-selected { background: #ffe48d; color: #000000; } .tree-node-hidden { display: none; } .validatebox-invalid { border-color: #ffa8a8; background-color: #fff3f3; color: #000; } .tooltip { position: absolute; display: none; z-index: 9900000; outline: none; opacity: 1; filter: alpha(opacity=100); padding: 5px; border-width: 1px; border-style: solid; border-radius: 5px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .tooltip-content { font-size: 12px; } .tooltip-arrow-outer, .tooltip-arrow { position: absolute; width: 0; height: 0; line-height: 0; font-size: 0; border-style: solid; border-width: 6px; border-color: transparent; _border-color: tomato; _filter: chroma(color=tomato); } .tooltip-arrow { display: none \9; } .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; margin: -6px 0 0 -13px; } .tooltip-right .tooltip-arrow { left: 0; top: 50%; margin: -6px 0 0 -12px; } .tooltip-left .tooltip-arrow-outer { right: 0; top: 50%; margin: -6px -13px 0 0; } .tooltip-left .tooltip-arrow { right: 0; top: 50%; margin: -6px -12px 0 0; } .tooltip-top .tooltip-arrow-outer { bottom: 0; left: 50%; margin: 0 0 -13px -6px; } .tooltip-top .tooltip-arrow { bottom: 0; left: 50%; margin: 0 0 -12px -6px; } .tooltip-bottom .tooltip-arrow-outer { top: 0; left: 50%; margin: -13px 0 0 -6px; } .tooltip-bottom .tooltip-arrow { top: 0; left: 50%; margin: -12px 0 0 -6px; } .tooltip { background-color: #ffffff; border-color: #95B8E7; color: #000000; } .tooltip-right .tooltip-arrow-outer { border-right-color: #95B8E7; } .tooltip-right .tooltip-arrow { border-right-color: #ffffff; } .tooltip-left .tooltip-arrow-outer { border-left-color: #95B8E7; } .tooltip-left .tooltip-arrow { border-left-color: #ffffff; } .tooltip-top .tooltip-arrow-outer { border-top-color: #95B8E7; } .tooltip-top .tooltip-arrow { border-top-color: #ffffff; } .tooltip-bottom .tooltip-arrow-outer { border-bottom-color: #95B8E7; } .tooltip-bottom .tooltip-arrow { border-bottom-color: #ffffff; } .switchbutton { text-decoration: none; display: inline-block; overflow: hidden; vertical-align: middle; margin: 0; padding: 0; cursor: pointer; background: #bbb; border: 1px solid #bbb; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .switchbutton-inner { display: inline-block; overflow: hidden; position: relative; top: -1px; left: -1px; } .switchbutton-on, .switchbutton-off, .switchbutton-handle { display: inline-block; text-align: center; height: 100%; float: left; font-size: 12px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .switchbutton-on { background: #ffe48d; color: #000000; } .switchbutton-off { background-color: #ffffff; color: #000000; } .switchbutton-on, .switchbutton-reversed .switchbutton-off { -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .switchbutton-off, .switchbutton-reversed .switchbutton-on { -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; } .switchbutton-handle { position: absolute; top: 0; left: 50%; background-color: #ffffff; color: #000000; border: 1px solid #bbb; -moz-box-shadow: 0 0 3px 0 #bbb; -webkit-box-shadow: 0 0 3px 0 #bbb; box-shadow: 0 0 3px 0 #bbb; } .switchbutton-value { position: absolute; top: 0; left: -5000px; } .switchbutton-disabled { opacity: 0.5; filter: alpha(opacity=50); } .switchbutton-disabled, .switchbutton-readonly { cursor: default; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/filebox.css ================================================ .filebox .textbox-value { vertical-align: top; position: absolute; top: 0; left: -5000px; } .filebox-label { display: inline-block; position: absolute; width: 100%; height: 100%; cursor: pointer; left: 0; top: 0; z-index: 10; background: url('images/blank.gif') no-repeat; } .l-btn-disabled .filebox-label { cursor: default; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/layout.css ================================================ .layout { position: relative; overflow: hidden; margin: 0; padding: 0; z-index: 0; } .layout-panel { position: absolute; overflow: hidden; } .layout-body { min-width: 1px; min-height: 1px; } .layout-panel-east, .layout-panel-west { z-index: 2; } .layout-panel-north, .layout-panel-south { z-index: 3; } .layout-expand { position: absolute; padding: 0px; font-size: 1px; cursor: pointer; z-index: 1; } .layout-expand .panel-header, .layout-expand .panel-body { background: transparent; filter: none; overflow: hidden; } .layout-expand .panel-header { border-bottom-width: 0px; } .layout-expand .panel-body { position: relative; } .layout-expand .panel-body .panel-icon { margin-top: 0; top: 0; left: 50%; margin-left: -8px; } .layout-expand-west .panel-header .panel-icon, .layout-expand-east .panel-header .panel-icon { display: none; } .layout-expand-title { position: absolute; top: 0; left: 21px; white-space: nowrap; word-wrap: normal; -webkit-transform: rotate(90deg); -webkit-transform-origin: 0 0; -moz-transform: rotate(90deg); -moz-transform-origin: 0 0; -o-transform: rotate(90deg); -o-transform-origin: 0 0; transform: rotate(90deg); transform-origin: 0 0; } .layout-expand-with-icon { top: 18px; } .layout-expand .panel-body-noheader .layout-expand-title, .layout-expand .panel-body-noheader .panel-icon { top: 5px; } .layout-expand .panel-body-noheader .layout-expand-with-icon { top: 23px; } .layout-split-proxy-h, .layout-split-proxy-v { position: absolute; font-size: 1px; display: none; z-index: 5; } .layout-split-proxy-h { width: 5px; cursor: e-resize; } .layout-split-proxy-v { height: 5px; cursor: n-resize; } .layout-mask { position: absolute; background: #fafafa; filter: alpha(opacity=10); opacity: 0.10; z-index: 4; } .layout-button-up { background: url('images/layout_arrows.png') no-repeat -16px -16px; } .layout-button-down { background: url('images/layout_arrows.png') no-repeat -16px 0; } .layout-button-left { background: url('images/layout_arrows.png') no-repeat 0 0; } .layout-button-right { background: url('images/layout_arrows.png') no-repeat 0 -16px; } .layout-split-proxy-h, .layout-split-proxy-v { background-color: #aac5e7; } .layout-split-north { border-bottom: 5px solid #E6EEF8; } .layout-split-south { border-top: 5px solid #E6EEF8; } .layout-split-east { border-left: 5px solid #E6EEF8; } .layout-split-west { border-right: 5px solid #E6EEF8; } .layout-expand { background-color: #E0ECFF; } .layout-expand-over { background-color: #E0ECFF; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/linkbutton.css ================================================ .l-btn { text-decoration: none; display: inline-block; overflow: hidden; margin: 0; padding: 0; cursor: pointer; outline: none; text-align: center; vertical-align: middle; line-height: normal; } .l-btn-plain { border-width: 0; padding: 1px; } .l-btn-left { display: inline-block; position: relative; overflow: hidden; margin: 0; padding: 0; vertical-align: top; } .l-btn-text { display: inline-block; vertical-align: top; width: auto; line-height: 24px; font-size: 12px; padding: 0; margin: 0 4px; } .l-btn-icon { display: inline-block; width: 16px; height: 16px; line-height: 16px; position: absolute; top: 50%; margin-top: -8px; font-size: 1px; } .l-btn span span .l-btn-empty { display: inline-block; margin: 0; width: 16px; height: 24px; font-size: 1px; vertical-align: top; } .l-btn span .l-btn-icon-left { padding: 0 0 0 20px; background-position: left center; } .l-btn span .l-btn-icon-right { padding: 0 20px 0 0; background-position: right center; } .l-btn-icon-left .l-btn-text { margin: 0 4px 0 24px; } .l-btn-icon-left .l-btn-icon { left: 4px; } .l-btn-icon-right .l-btn-text { margin: 0 24px 0 4px; } .l-btn-icon-right .l-btn-icon { right: 4px; } .l-btn-icon-top .l-btn-text { margin: 20px 4px 0 4px; } .l-btn-icon-top .l-btn-icon { top: 4px; left: 50%; margin: 0 0 0 -8px; } .l-btn-icon-bottom .l-btn-text { margin: 0 4px 20px 4px; } .l-btn-icon-bottom .l-btn-icon { top: auto; bottom: 4px; left: 50%; margin: 0 0 0 -8px; } .l-btn-left .l-btn-empty { margin: 0 4px; width: 16px; } .l-btn-plain:hover { padding: 0; } .l-btn-focus { outline: #0000FF dotted thin; } .l-btn-large .l-btn-text { line-height: 40px; } .l-btn-large .l-btn-icon { width: 32px; height: 32px; line-height: 32px; margin-top: -16px; } .l-btn-large .l-btn-icon-left .l-btn-text { margin-left: 40px; } .l-btn-large .l-btn-icon-right .l-btn-text { margin-right: 40px; } .l-btn-large .l-btn-icon-top .l-btn-text { margin-top: 36px; line-height: 24px; min-width: 32px; } .l-btn-large .l-btn-icon-top .l-btn-icon { margin: 0 0 0 -16px; } .l-btn-large .l-btn-icon-bottom .l-btn-text { margin-bottom: 36px; line-height: 24px; min-width: 32px; } .l-btn-large .l-btn-icon-bottom .l-btn-icon { margin: 0 0 0 -16px; } .l-btn-large .l-btn-left .l-btn-empty { margin: 0 4px; width: 32px; } .l-btn { color: #444; background: #fafafa; background-repeat: repeat-x; border: 1px solid #bbb; background: -webkit-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: -moz-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: -o-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: linear-gradient(to bottom,#ffffff 0,#eeeeee 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#eeeeee,GradientType=0); -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .l-btn:hover { background: #eaf2ff; color: #000000; border: 1px solid #b7d2ff; filter: none; } .l-btn-plain { background: transparent; border-width: 0; filter: none; } .l-btn-outline { border-width: 1px; border-color: #b7d2ff; padding: 0; } .l-btn-plain:hover { background: #eaf2ff; color: #000000; border: 1px solid #b7d2ff; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .l-btn-disabled, .l-btn-disabled:hover { opacity: 0.5; cursor: default; background: #fafafa; color: #444; background: -webkit-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: -moz-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: -o-linear-gradient(top,#ffffff 0,#eeeeee 100%); background: linear-gradient(to bottom,#ffffff 0,#eeeeee 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#eeeeee,GradientType=0); } .l-btn-disabled .l-btn-text, .l-btn-disabled .l-btn-icon { filter: alpha(opacity=50); } .l-btn-plain-disabled, .l-btn-plain-disabled:hover { background: transparent; filter: alpha(opacity=50); } .l-btn-selected, .l-btn-selected:hover { background: #ddd; filter: none; } .l-btn-plain-selected, .l-btn-plain-selected:hover { background: #ddd; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/menu.css ================================================ .menu { position: absolute; margin: 0; padding: 2px; border-width: 1px; border-style: solid; overflow: hidden; } .menu-inline { position: relative; } .menu-item { position: relative; margin: 0; padding: 0; overflow: hidden; white-space: nowrap; cursor: pointer; border-width: 1px; border-style: solid; } .menu-text { height: 20px; line-height: 20px; float: left; padding-left: 28px; } .menu-icon { position: absolute; width: 16px; height: 16px; left: 2px; top: 50%; margin-top: -8px; } .menu-rightarrow { position: absolute; width: 16px; height: 16px; right: 0; top: 50%; margin-top: -8px; } .menu-line { position: absolute; left: 26px; top: 0; height: 2000px; font-size: 1px; } .menu-sep { margin: 3px 0px 3px 25px; font-size: 1px; } .menu-noline .menu-line { display: none; } .menu-noline .menu-sep { margin-left: 0; margin-right: 0; } .menu-active { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .menu-item-disabled { opacity: 0.5; filter: alpha(opacity=50); cursor: default; } .menu-text, .menu-text span { font-size: 12px; } .menu-shadow { position: absolute; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; background: #ccc; -moz-box-shadow: 2px 2px 3px #cccccc; -webkit-box-shadow: 2px 2px 3px #cccccc; box-shadow: 2px 2px 3px #cccccc; filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); } .menu-rightarrow { background: url('images/menu_arrows.png') no-repeat -32px center; } .menu-line { border-left: 1px solid #ccc; border-right: 1px solid #fff; } .menu-sep { border-top: 1px solid #ccc; border-bottom: 1px solid #fff; } .menu { background-color: #fafafa; border-color: #ddd; color: #444; } .menu-content { background: #ffffff; } .menu-item { border-color: transparent; _border-color: #fafafa; } .menu-active { border-color: #b7d2ff; color: #000000; background: #eaf2ff; } .menu-active-disabled { border-color: transparent; background: transparent; color: #444; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/menubutton.css ================================================ .m-btn-downarrow, .s-btn-downarrow { display: inline-block; position: absolute; width: 16px; height: 16px; font-size: 1px; right: 0; top: 50%; margin-top: -8px; } .m-btn-active, .s-btn-active { background: #eaf2ff; color: #000000; border: 1px solid #b7d2ff; filter: none; } .m-btn-plain-active, .s-btn-plain-active { background: transparent; padding: 0; border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .m-btn .l-btn-left .l-btn-text { margin-right: 20px; } .m-btn .l-btn-icon-right .l-btn-text { margin-right: 40px; } .m-btn .l-btn-icon-right .l-btn-icon { right: 20px; } .m-btn .l-btn-icon-top .l-btn-text { margin-right: 4px; margin-bottom: 14px; } .m-btn .l-btn-icon-bottom .l-btn-text { margin-right: 4px; margin-bottom: 34px; } .m-btn .l-btn-icon-bottom .l-btn-icon { top: auto; bottom: 20px; } .m-btn .l-btn-icon-top .m-btn-downarrow, .m-btn .l-btn-icon-bottom .m-btn-downarrow { top: auto; bottom: 0px; left: 50%; margin-left: -8px; } .m-btn-line { display: inline-block; position: absolute; font-size: 1px; display: none; } .m-btn .l-btn-left .m-btn-line { right: 0; width: 16px; height: 500px; border-style: solid; border-color: #aac5e7; border-width: 0 0 0 1px; } .m-btn .l-btn-icon-top .m-btn-line, .m-btn .l-btn-icon-bottom .m-btn-line { left: 0; bottom: 0; width: 500px; height: 16px; border-width: 1px 0 0 0; } .m-btn-large .l-btn-icon-right .l-btn-text { margin-right: 56px; } .m-btn-large .l-btn-icon-bottom .l-btn-text { margin-bottom: 50px; } .m-btn-downarrow, .s-btn-downarrow { background: url('images/menu_arrows.png') no-repeat 0 center; } .m-btn-plain-active, .s-btn-plain-active { border-color: #b7d2ff; background-color: #eaf2ff; color: #000000; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/messager.css ================================================ .messager-body { padding: 10px 10px 30px 10px; overflow: auto; } .messager-button { text-align: center; padding: 5px; } .messager-button .l-btn { width: 70px; } .messager-icon { float: left; width: 32px; height: 32px; margin: 0 10px 10px 0; } .messager-error { background: url('images/messager_icons.png') no-repeat scroll -64px 0; } .messager-info { background: url('images/messager_icons.png') no-repeat scroll 0 0; } .messager-question { background: url('images/messager_icons.png') no-repeat scroll -32px 0; } .messager-warning { background: url('images/messager_icons.png') no-repeat scroll -96px 0; } .messager-progress { padding: 10px; } .messager-p-msg { margin-bottom: 5px; } .messager-body .messager-input { width: 100%; padding: 4px 0; outline-style: none; border: 1px solid #95B8E7; } .window-thinborder .messager-button { padding-bottom: 8px; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/numberbox.css ================================================ ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/pagination.css ================================================ .pagination { zoom: 1; } .pagination table { float: left; height: 30px; } .pagination td { border: 0; } .pagination-btn-separator { float: left; height: 24px; border-left: 1px solid #ccc; border-right: 1px solid #fff; margin: 3px 1px; } .pagination .pagination-num { border-width: 1px; border-style: solid; margin: 0 2px; padding: 2px; width: 2em; height: auto; } .pagination-page-list { margin: 0px 6px; padding: 1px 2px; width: auto; height: auto; border-width: 1px; border-style: solid; } .pagination-info { float: right; margin: 0 6px 0 0; padding: 0; height: 30px; line-height: 30px; font-size: 12px; } .pagination span { font-size: 12px; } .pagination-link .l-btn-text { width: 24px; text-align: center; margin: 0; } .pagination-first { background: url('images/pagination_icons.png') no-repeat 0 center; } .pagination-prev { background: url('images/pagination_icons.png') no-repeat -16px center; } .pagination-next { background: url('images/pagination_icons.png') no-repeat -32px center; } .pagination-last { background: url('images/pagination_icons.png') no-repeat -48px center; } .pagination-load { background: url('images/pagination_icons.png') no-repeat -64px center; } .pagination-loading { background: url('images/loading.gif') no-repeat center center; } .pagination-page-list, .pagination .pagination-num { border-color: #95B8E7; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/panel.css ================================================ .panel { overflow: hidden; text-align: left; margin: 0; border: 0; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .panel-header, .panel-body { border-width: 1px; border-style: solid; } .panel-header { padding: 5px; position: relative; } .panel-title { background: url('images/blank.gif') no-repeat; } .panel-header-noborder { border-width: 0 0 1px 0; } .panel-body { overflow: auto; border-top-width: 0; padding: 0; } .panel-body-noheader { border-top-width: 1px; } .panel-body-noborder { border-width: 0px; } .panel-body-nobottom { border-bottom-width: 0; } .panel-with-icon { padding-left: 18px; } .panel-icon, .panel-tool { position: absolute; top: 50%; margin-top: -8px; height: 16px; overflow: hidden; } .panel-icon { left: 5px; width: 16px; } .panel-tool { right: 5px; width: auto; } .panel-tool a { display: inline-block; width: 16px; height: 16px; opacity: 0.6; filter: alpha(opacity=60); margin: 0 0 0 2px; vertical-align: top; } .panel-tool a:hover { opacity: 1; filter: alpha(opacity=100); background-color: #eaf2ff; -moz-border-radius: 3px 3px 3px 3px; -webkit-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; } .panel-loading { padding: 11px 0px 10px 30px; } .panel-noscroll { overflow: hidden; } .panel-fit, .panel-fit body { height: 100%; margin: 0; padding: 0; border: 0; overflow: hidden; } .panel-loading { background: url('images/loading.gif') no-repeat 10px 10px; } .panel-tool-close { background: url('images/panel_tools.png') no-repeat -16px 0px; } .panel-tool-min { background: url('images/panel_tools.png') no-repeat 0px 0px; } .panel-tool-max { background: url('images/panel_tools.png') no-repeat 0px -16px; } .panel-tool-restore { background: url('images/panel_tools.png') no-repeat -16px -16px; } .panel-tool-collapse { background: url('images/panel_tools.png') no-repeat -32px 0; } .panel-tool-expand { background: url('images/panel_tools.png') no-repeat -32px -16px; } .panel-header, .panel-body { border-color: #95B8E7; } .panel-header { background-color: #E0ECFF; background: -webkit-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: -moz-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: -o-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: linear-gradient(to bottom,#EFF5FF 0,#E0ECFF 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#E0ECFF,GradientType=0); } .panel-body { background-color: #ffffff; color: #000000; font-size: 12px; } .panel-title { font-size: 12px; font-weight: bold; color: #0E2D5F; height: 16px; line-height: 16px; } .panel-footer { border: 1px solid #95B8E7; overflow: hidden; background: #F4F4F4; } .panel-footer-noborder { border-width: 1px 0 0 0; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/passwordbox.css ================================================ .passwordbox-open { background: url('images/passwordbox_open.png') no-repeat center center; } .passwordbox-close { background: url('images/passwordbox_close.png') no-repeat center center; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/progressbar.css ================================================ .progressbar { border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; overflow: hidden; position: relative; } .progressbar-text { text-align: center; position: absolute; } .progressbar-value { position: relative; overflow: hidden; width: 0; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .progressbar { border-color: #95B8E7; } .progressbar-text { color: #000000; font-size: 12px; } .progressbar-value .progressbar-text { background-color: #ffe48d; color: #000000; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/propertygrid.css ================================================ .propertygrid .datagrid-view1 .datagrid-body td { padding-bottom: 1px; border-width: 0 1px 0 0; } .propertygrid .datagrid-group { height: 21px; overflow: hidden; border-width: 0 0 1px 0; border-style: solid; } .propertygrid .datagrid-group span { font-weight: bold; } .propertygrid .datagrid-view1 .datagrid-body td { border-color: #dddddd; } .propertygrid .datagrid-view1 .datagrid-group { border-color: #E0ECFF; } .propertygrid .datagrid-view2 .datagrid-group { border-color: #dddddd; } .propertygrid .datagrid-group, .propertygrid .datagrid-view1 .datagrid-body, .propertygrid .datagrid-view1 .datagrid-row-over, .propertygrid .datagrid-view1 .datagrid-row-selected { background: #E0ECFF; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/searchbox.css ================================================ .searchbox-button { width: 18px; height: 20px; overflow: hidden; display: inline-block; vertical-align: top; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); } .searchbox-button-hover { opacity: 1.0; filter: alpha(opacity=100); } .searchbox .l-btn-plain { border: 0; padding: 0; vertical-align: top; opacity: 0.6; filter: alpha(opacity=60); -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .l-btn-plain:hover { border: 0; padding: 0; opacity: 1.0; filter: alpha(opacity=100); -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox a.m-btn-plain-active { -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .m-btn-active { border-width: 0 1px 0 0; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .searchbox .textbox-button-right { border-width: 0 0 0 1px; } .searchbox .textbox-button-left { border-width: 0 1px 0 0; } .searchbox-button { background: url('images/searchbox_button.png') no-repeat center center; } .searchbox .l-btn-plain { background: #E0ECFF; } .searchbox .l-btn-plain-disabled, .searchbox .l-btn-plain-disabled:hover { opacity: 0.5; filter: alpha(opacity=50); } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/slider.css ================================================ .slider-disabled { opacity: 0.5; filter: alpha(opacity=50); } .slider-h { height: 22px; } .slider-v { width: 22px; } .slider-inner { position: relative; height: 6px; top: 7px; border-width: 1px; border-style: solid; border-radius: 5px; } .slider-handle { position: absolute; display: block; outline: none; width: 20px; height: 20px; top: 50%; margin-top: -10px; margin-left: -10px; } .slider-tip { position: absolute; display: inline-block; line-height: 12px; font-size: 12px; white-space: nowrap; top: -22px; } .slider-rule { position: relative; top: 15px; } .slider-rule span { position: absolute; display: inline-block; font-size: 0; height: 5px; border-width: 0 0 0 1px; border-style: solid; } .slider-rulelabel { position: relative; top: 20px; } .slider-rulelabel span { position: absolute; display: inline-block; font-size: 12px; } .slider-v .slider-inner { width: 6px; left: 7px; top: 0; float: left; } .slider-v .slider-handle { left: 50%; margin-top: -10px; } .slider-v .slider-tip { left: -10px; margin-top: -6px; } .slider-v .slider-rule { float: left; top: 0; left: 16px; } .slider-v .slider-rule span { width: 5px; height: 'auto'; border-left: 0; border-width: 1px 0 0 0; border-style: solid; } .slider-v .slider-rulelabel { float: left; top: 0; left: 23px; } .slider-handle { background: url('images/slider_handle.png') no-repeat; } .slider-inner { border-color: #95B8E7; background: #E0ECFF; } .slider-rule span { border-color: #95B8E7; } .slider-rulelabel span { color: #000000; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/spinner.css ================================================ .spinner-arrow { background-color: #E0ECFF; display: inline-block; overflow: hidden; vertical-align: top; margin: 0; padding: 0; opacity: 1.0; filter: alpha(opacity=100); width: 18px; } .spinner-arrow-up, .spinner-arrow-down { opacity: 0.6; filter: alpha(opacity=60); display: block; font-size: 1px; width: 18px; height: 10px; width: 100%; height: 50%; color: #444; outline-style: none; } .spinner-arrow-hover { background-color: #eaf2ff; opacity: 1.0; filter: alpha(opacity=100); } .spinner-arrow-up:hover, .spinner-arrow-down:hover { opacity: 1.0; filter: alpha(opacity=100); background-color: #eaf2ff; } .textbox-icon-disabled .spinner-arrow-up:hover, .textbox-icon-disabled .spinner-arrow-down:hover { opacity: 0.6; filter: alpha(opacity=60); background-color: #E0ECFF; cursor: default; } .spinner .textbox-icon-disabled { opacity: 0.6; filter: alpha(opacity=60); } .spinner-arrow-up { background: url('images/spinner_arrows.png') no-repeat 1px center; } .spinner-arrow-down { background: url('images/spinner_arrows.png') no-repeat -15px center; } .spinner-button-up { background: url('images/spinner_arrows.png') no-repeat -32px center; } .spinner-button-down { background: url('images/spinner_arrows.png') no-repeat -48px center; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/splitbutton.css ================================================ .s-btn:hover .m-btn-line, .s-btn-active .m-btn-line, .s-btn-plain-active .m-btn-line { display: inline-block; } .l-btn:hover .s-btn-downarrow, .s-btn-active .s-btn-downarrow, .s-btn-plain-active .s-btn-downarrow { border-style: solid; border-color: #aac5e7; border-width: 0 0 0 1px; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/switchbutton.css ================================================ .switchbutton { text-decoration: none; display: inline-block; overflow: hidden; vertical-align: middle; margin: 0; padding: 0; cursor: pointer; background: #bbb; border: 1px solid #bbb; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .switchbutton-inner { display: inline-block; overflow: hidden; position: relative; top: -1px; left: -1px; } .switchbutton-on, .switchbutton-off, .switchbutton-handle { display: inline-block; text-align: center; height: 100%; float: left; font-size: 12px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .switchbutton-on { background: #ffe48d; color: #000000; } .switchbutton-off { background-color: #ffffff; color: #000000; } .switchbutton-on, .switchbutton-reversed .switchbutton-off { -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .switchbutton-off, .switchbutton-reversed .switchbutton-on { -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; } .switchbutton-handle { position: absolute; top: 0; left: 50%; background-color: #ffffff; color: #000000; border: 1px solid #bbb; -moz-box-shadow: 0 0 3px 0 #bbb; -webkit-box-shadow: 0 0 3px 0 #bbb; box-shadow: 0 0 3px 0 #bbb; } .switchbutton-value { position: absolute; top: 0; left: -5000px; } .switchbutton-disabled { opacity: 0.5; filter: alpha(opacity=50); } .switchbutton-disabled, .switchbutton-readonly { cursor: default; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/tabs.css ================================================ .tabs-container { overflow: hidden; } .tabs-header { border-width: 1px; border-style: solid; border-bottom-width: 0; position: relative; padding: 0; padding-top: 2px; overflow: hidden; } .tabs-scroller-left, .tabs-scroller-right { position: absolute; top: auto; bottom: 0; width: 18px; font-size: 1px; display: none; cursor: pointer; border-width: 1px; border-style: solid; } .tabs-scroller-left { left: 0; } .tabs-scroller-right { right: 0; } .tabs-tool { position: absolute; bottom: 0; padding: 1px; overflow: hidden; border-width: 1px; border-style: solid; } .tabs-header-plain .tabs-tool { padding: 0 1px; } .tabs-wrap { position: relative; left: 0; overflow: hidden; width: 100%; margin: 0; padding: 0; } .tabs-scrolling { margin-left: 18px; margin-right: 18px; } .tabs-disabled { opacity: 0.3; filter: alpha(opacity=30); } .tabs { list-style-type: none; height: 26px; margin: 0px; padding: 0px; padding-left: 4px; width: 50000px; border-style: solid; border-width: 0 0 1px 0; } .tabs li { float: left; display: inline-block; margin: 0 4px -1px 0; padding: 0; position: relative; border: 0; } .tabs li a.tabs-inner { display: inline-block; text-decoration: none; margin: 0; padding: 0 10px; height: 25px; line-height: 25px; text-align: center; white-space: nowrap; border-width: 1px; border-style: solid; -moz-border-radius: 5px 5px 0 0; -webkit-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; } .tabs li.tabs-selected a.tabs-inner { font-weight: bold; outline: none; } .tabs li.tabs-selected a:hover.tabs-inner { cursor: default; pointer: default; } .tabs li a.tabs-close, .tabs-p-tool { position: absolute; font-size: 1px; display: block; height: 12px; padding: 0; top: 50%; margin-top: -6px; overflow: hidden; } .tabs li a.tabs-close { width: 12px; right: 5px; opacity: 0.6; filter: alpha(opacity=60); } .tabs-p-tool { right: 16px; } .tabs-p-tool a { display: inline-block; font-size: 1px; width: 12px; height: 12px; margin: 0; opacity: 0.6; filter: alpha(opacity=60); } .tabs li a:hover.tabs-close, .tabs-p-tool a:hover { opacity: 1; filter: alpha(opacity=100); cursor: hand; cursor: pointer; } .tabs-with-icon { padding-left: 18px; } .tabs-icon { position: absolute; width: 16px; height: 16px; left: 10px; top: 50%; margin-top: -8px; } .tabs-title { font-size: 12px; } .tabs-closable { padding-right: 8px; } .tabs-panels { margin: 0px; padding: 0px; border-width: 1px; border-style: solid; border-top-width: 0; overflow: hidden; } .tabs-header-bottom { border-width: 0 1px 1px 1px; padding: 0 0 2px 0; } .tabs-header-bottom .tabs { border-width: 1px 0 0 0; } .tabs-header-bottom .tabs li { margin: -1px 4px 0 0; } .tabs-header-bottom .tabs li a.tabs-inner { -moz-border-radius: 0 0 5px 5px; -webkit-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; } .tabs-header-bottom .tabs-tool { top: 0; } .tabs-header-bottom .tabs-scroller-left, .tabs-header-bottom .tabs-scroller-right { top: 0; bottom: auto; } .tabs-panels-top { border-width: 1px 1px 0 1px; } .tabs-header-left { float: left; border-width: 1px 0 1px 1px; padding: 0; } .tabs-header-right { float: right; border-width: 1px 1px 1px 0; padding: 0; } .tabs-header-left .tabs-wrap, .tabs-header-right .tabs-wrap { height: 100%; } .tabs-header-left .tabs { height: 100%; padding: 4px 0 0 2px; border-width: 0 1px 0 0; } .tabs-header-right .tabs { height: 100%; padding: 4px 2px 0 0; border-width: 0 0 0 1px; } .tabs-header-left .tabs li, .tabs-header-right .tabs li { display: block; width: 100%; position: relative; } .tabs-header-left .tabs li { left: auto; right: 0; margin: 0 -1px 4px 0; float: right; } .tabs-header-right .tabs li { left: 0; right: auto; margin: 0 0 4px -1px; float: left; } .tabs-justified li a.tabs-inner { padding-left: 0; padding-right: 0; } .tabs-header-left .tabs li a.tabs-inner { display: block; text-align: left; padding-left: 10px; padding-right: 10px; -moz-border-radius: 5px 0 0 5px; -webkit-border-radius: 5px 0 0 5px; border-radius: 5px 0 0 5px; } .tabs-header-right .tabs li a.tabs-inner { display: block; text-align: left; padding-left: 10px; padding-right: 10px; -moz-border-radius: 0 5px 5px 0; -webkit-border-radius: 0 5px 5px 0; border-radius: 0 5px 5px 0; } .tabs-panels-right { float: right; border-width: 1px 1px 1px 0; } .tabs-panels-left { float: left; border-width: 1px 0 1px 1px; } .tabs-header-noborder, .tabs-panels-noborder { border: 0px; } .tabs-header-plain { border: 0px; background: transparent; } .tabs-pill { padding-bottom: 3px; } .tabs-header-bottom .tabs-pill { padding-top: 3px; padding-bottom: 0; } .tabs-header-left .tabs-pill { padding-right: 3px; } .tabs-header-right .tabs-pill { padding-left: 3px; } .tabs-header .tabs-pill li a.tabs-inner { -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .tabs-header-narrow, .tabs-header-narrow .tabs-narrow { padding: 0; } .tabs-narrow li, .tabs-header-bottom .tabs-narrow li { margin-left: 0; margin-right: -1px; } .tabs-narrow li.tabs-last, .tabs-header-bottom .tabs-narrow li.tabs-last { margin-right: 0; } .tabs-header-left .tabs-narrow, .tabs-header-right .tabs-narrow { padding-top: 0; } .tabs-header-left .tabs-narrow li { margin-bottom: -1px; margin-right: -1px; } .tabs-header-left .tabs-narrow li.tabs-last, .tabs-header-right .tabs-narrow li.tabs-last { margin-bottom: 0; } .tabs-header-right .tabs-narrow li { margin-bottom: -1px; margin-left: -1px; } .tabs-scroller-left { background: #E0ECFF url('images/tabs_icons.png') no-repeat 1px center; } .tabs-scroller-right { background: #E0ECFF url('images/tabs_icons.png') no-repeat -15px center; } .tabs li a.tabs-close { background: url('images/tabs_icons.png') no-repeat -34px center; } .tabs li a.tabs-inner:hover { background: #eaf2ff; color: #000000; filter: none; } .tabs li.tabs-selected a.tabs-inner { background-color: #ffffff; color: #0E2D5F; background: -webkit-linear-gradient(top,#EFF5FF 0,#ffffff 100%); background: -moz-linear-gradient(top,#EFF5FF 0,#ffffff 100%); background: -o-linear-gradient(top,#EFF5FF 0,#ffffff 100%); background: linear-gradient(to bottom,#EFF5FF 0,#ffffff 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#ffffff,GradientType=0); } .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(top,#ffffff 0,#EFF5FF 100%); background: -moz-linear-gradient(top,#ffffff 0,#EFF5FF 100%); background: -o-linear-gradient(top,#ffffff 0,#EFF5FF 100%); background: linear-gradient(to bottom,#ffffff 0,#EFF5FF 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#EFF5FF,GradientType=0); } .tabs-header-left .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(left,#EFF5FF 0,#ffffff 100%); background: -moz-linear-gradient(left,#EFF5FF 0,#ffffff 100%); background: -o-linear-gradient(left,#EFF5FF 0,#ffffff 100%); background: linear-gradient(to right,#EFF5FF 0,#ffffff 100%); background-repeat: repeat-y; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#ffffff,GradientType=1); } .tabs-header-right .tabs li.tabs-selected a.tabs-inner { background: -webkit-linear-gradient(left,#ffffff 0,#EFF5FF 100%); background: -moz-linear-gradient(left,#ffffff 0,#EFF5FF 100%); background: -o-linear-gradient(left,#ffffff 0,#EFF5FF 100%); background: linear-gradient(to right,#ffffff 0,#EFF5FF 100%); background-repeat: repeat-y; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#EFF5FF,GradientType=1); } .tabs li a.tabs-inner { color: #0E2D5F; background-color: #E0ECFF; background: -webkit-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: -moz-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: -o-linear-gradient(top,#EFF5FF 0,#E0ECFF 100%); background: linear-gradient(to bottom,#EFF5FF 0,#E0ECFF 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#E0ECFF,GradientType=0); } .tabs-header, .tabs-tool { background-color: #E0ECFF; } .tabs-header-plain { background: transparent; } .tabs-header, .tabs-scroller-left, .tabs-scroller-right, .tabs-tool, .tabs, .tabs-panels, .tabs li a.tabs-inner, .tabs li.tabs-selected a.tabs-inner, .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner, .tabs-header-left .tabs li.tabs-selected a.tabs-inner, .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-color: #95B8E7; } .tabs-p-tool a:hover, .tabs li a:hover.tabs-close, .tabs-scroller-over { background-color: #eaf2ff; } .tabs li.tabs-selected a.tabs-inner { border-bottom: 1px solid #ffffff; } .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner { border-top: 1px solid #ffffff; } .tabs-header-left .tabs li.tabs-selected a.tabs-inner { border-right: 1px solid #ffffff; } .tabs-header-right .tabs li.tabs-selected a.tabs-inner { border-left: 1px solid #ffffff; } .tabs-header .tabs-pill li.tabs-selected a.tabs-inner { background: #ffe48d; color: #000000; filter: none; border-color: #95B8E7; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/textbox.css ================================================ .textbox { position: relative; border: 1px solid #95B8E7; background-color: #fff; vertical-align: middle; display: inline-block; overflow: hidden; white-space: nowrap; margin: 0; padding: 0; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .textbox .textbox-text { font-size: 12px; border: 0; margin: 0; padding: 4px; white-space: normal; vertical-align: top; outline-style: none; resize: none; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .textbox .textbox-text::-ms-clear, .textbox .textbox-text::-ms-reveal { display: none; } .textbox textarea.textbox-text { white-space: pre-wrap; } .textbox .textbox-prompt { font-size: 12px; color: #aaa; } .textbox .textbox-bgicon { background-position: 3px center; padding-left: 21px; } .textbox .textbox-button, .textbox .textbox-button:hover { position: absolute; top: 0; padding: 0; vertical-align: top; -moz-border-radius: 0 0 0 0; -webkit-border-radius: 0 0 0 0; border-radius: 0 0 0 0; } .textbox .textbox-button-right, .textbox .textbox-button-right:hover { right: 0; border-width: 0 0 0 1px; } .textbox .textbox-button-left, .textbox .textbox-button-left:hover { left: 0; border-width: 0 1px 0 0; } .textbox .textbox-button-top, .textbox .textbox-button-top:hover { left: 0; border-width: 0 0 1px 0; } .textbox .textbox-button-bottom, .textbox .textbox-button-bottom:hover { top: auto; bottom: 0; left: 0; border-width: 1px 0 0 0; } .textbox-addon { position: absolute; top: 0; } .textbox-label { display: inline-block; width: 80px; height: 22px; line-height: 22px; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; padding-right: 5px; } .textbox-label-after { padding-left: 5px; padding-right: 0; } .textbox-label-top { display: block; width: auto; padding: 0; } .textbox-disabled, .textbox-label-disabled { opacity: 0.6; filter: alpha(opacity=60); } .textbox-icon { display: inline-block; width: 18px; height: 20px; overflow: hidden; vertical-align: top; background-position: center center; cursor: pointer; opacity: 0.6; filter: alpha(opacity=60); text-decoration: none; outline-style: none; } .textbox-icon-disabled, .textbox-icon-readonly { cursor: default; } .textbox-icon:hover { opacity: 1.0; filter: alpha(opacity=100); } .textbox-icon-disabled:hover { opacity: 0.6; filter: alpha(opacity=60); } .textbox-focused { border-color: #6b9cde; -moz-box-shadow: 0 0 3px 0 #95B8E7; -webkit-box-shadow: 0 0 3px 0 #95B8E7; box-shadow: 0 0 3px 0 #95B8E7; } .textbox-invalid { border-color: #ffa8a8; background-color: #fff3f3; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/tooltip.css ================================================ .tooltip { position: absolute; display: none; z-index: 9900000; outline: none; opacity: 1; filter: alpha(opacity=100); padding: 5px; border-width: 1px; border-style: solid; border-radius: 5px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .tooltip-content { font-size: 12px; } .tooltip-arrow-outer, .tooltip-arrow { position: absolute; width: 0; height: 0; line-height: 0; font-size: 0; border-style: solid; border-width: 6px; border-color: transparent; _border-color: tomato; _filter: chroma(color=tomato); } .tooltip-arrow { display: none \9; } .tooltip-right .tooltip-arrow-outer { left: 0; top: 50%; margin: -6px 0 0 -13px; } .tooltip-right .tooltip-arrow { left: 0; top: 50%; margin: -6px 0 0 -12px; } .tooltip-left .tooltip-arrow-outer { right: 0; top: 50%; margin: -6px -13px 0 0; } .tooltip-left .tooltip-arrow { right: 0; top: 50%; margin: -6px -12px 0 0; } .tooltip-top .tooltip-arrow-outer { bottom: 0; left: 50%; margin: 0 0 -13px -6px; } .tooltip-top .tooltip-arrow { bottom: 0; left: 50%; margin: 0 0 -12px -6px; } .tooltip-bottom .tooltip-arrow-outer { top: 0; left: 50%; margin: -13px 0 0 -6px; } .tooltip-bottom .tooltip-arrow { top: 0; left: 50%; margin: -12px 0 0 -6px; } .tooltip { background-color: #ffffff; border-color: #95B8E7; color: #000000; } .tooltip-right .tooltip-arrow-outer { border-right-color: #95B8E7; } .tooltip-right .tooltip-arrow { border-right-color: #ffffff; } .tooltip-left .tooltip-arrow-outer { border-left-color: #95B8E7; } .tooltip-left .tooltip-arrow { border-left-color: #ffffff; } .tooltip-top .tooltip-arrow-outer { border-top-color: #95B8E7; } .tooltip-top .tooltip-arrow { border-top-color: #ffffff; } .tooltip-bottom .tooltip-arrow-outer { border-bottom-color: #95B8E7; } .tooltip-bottom .tooltip-arrow { border-bottom-color: #ffffff; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/tree.css ================================================ .tree { margin: 0; padding: 0; list-style-type: none; } .tree li { white-space: nowrap; } .tree li ul { list-style-type: none; margin: 0; padding: 0; } .tree-node { height: 18px; white-space: nowrap; cursor: pointer; } .tree-hit { cursor: pointer; } .tree-expanded, .tree-collapsed, .tree-folder, .tree-file, .tree-checkbox, .tree-indent { display: inline-block; width: 16px; height: 18px; vertical-align: top; overflow: hidden; } .tree-expanded { background: url('images/tree_icons.png') no-repeat -18px 0px; } .tree-expanded-hover { background: url('images/tree_icons.png') no-repeat -50px 0px; } .tree-collapsed { background: url('images/tree_icons.png') no-repeat 0px 0px; } .tree-collapsed-hover { background: url('images/tree_icons.png') no-repeat -32px 0px; } .tree-lines .tree-expanded, .tree-lines .tree-root-first .tree-expanded { background: url('images/tree_icons.png') no-repeat -144px 0; } .tree-lines .tree-collapsed, .tree-lines .tree-root-first .tree-collapsed { background: url('images/tree_icons.png') no-repeat -128px 0; } .tree-lines .tree-node-last .tree-expanded, .tree-lines .tree-root-one .tree-expanded { background: url('images/tree_icons.png') no-repeat -80px 0; } .tree-lines .tree-node-last .tree-collapsed, .tree-lines .tree-root-one .tree-collapsed { background: url('images/tree_icons.png') no-repeat -64px 0; } .tree-line { background: url('images/tree_icons.png') no-repeat -176px 0; } .tree-join { background: url('images/tree_icons.png') no-repeat -192px 0; } .tree-joinbottom { background: url('images/tree_icons.png') no-repeat -160px 0; } .tree-folder { background: url('images/tree_icons.png') no-repeat -208px 0; } .tree-folder-open { background: url('images/tree_icons.png') no-repeat -224px 0; } .tree-file { background: url('images/tree_icons.png') no-repeat -240px 0; } .tree-loading { background: url('images/loading.gif') no-repeat center center; } .tree-checkbox0 { background: url('images/tree_icons.png') no-repeat -208px -18px; } .tree-checkbox1 { background: url('images/tree_icons.png') no-repeat -224px -18px; } .tree-checkbox2 { background: url('images/tree_icons.png') no-repeat -240px -18px; } .tree-title { font-size: 12px; display: inline-block; text-decoration: none; vertical-align: top; white-space: nowrap; padding: 0 2px; height: 18px; line-height: 18px; } .tree-node-proxy { font-size: 12px; line-height: 20px; padding: 0 2px 0 20px; border-width: 1px; border-style: solid; z-index: 9900000; } .tree-dnd-icon { display: inline-block; position: absolute; width: 16px; height: 18px; left: 2px; top: 50%; margin-top: -9px; } .tree-dnd-yes { background: url('images/tree_icons.png') no-repeat -256px 0; } .tree-dnd-no { background: url('images/tree_icons.png') no-repeat -256px -18px; } .tree-node-top { border-top: 1px dotted red; } .tree-node-bottom { border-bottom: 1px dotted red; } .tree-node-append .tree-title { border: 1px dotted red; } .tree-editor { border: 1px solid #95B8E7; font-size: 12px; line-height: 16px; padding: 0 4px; margin: 0; width: 80px; outline-style: none; vertical-align: top; position: absolute; top: 0; } .tree-node-proxy { background-color: #ffffff; color: #000000; border-color: #95B8E7; } .tree-node-hover { background: #eaf2ff; color: #000000; } .tree-node-selected { background: #ffe48d; color: #000000; } .tree-node-hidden { display: none; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/validatebox.css ================================================ .validatebox-invalid { border-color: #ffa8a8; background-color: #fff3f3; color: #000; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/default/window.css ================================================ .window { overflow: hidden; padding: 5px; border-width: 1px; border-style: solid; } .window .window-header { background: transparent; padding: 0px 0px 6px 0px; } .window .window-body { border-width: 1px; border-style: solid; border-top-width: 0px; } .window .window-body-noheader { border-top-width: 1px; } .window .panel-body-nobottom { border-bottom-width: 0; } .window .window-header .panel-icon, .window .window-header .panel-tool { top: 50%; margin-top: -11px; } .window .window-header .panel-icon { left: 1px; } .window .window-header .panel-tool { right: 1px; } .window .window-header .panel-with-icon { padding-left: 18px; } .window-proxy { position: absolute; overflow: hidden; } .window-proxy-mask { position: absolute; filter: alpha(opacity=5); opacity: 0.05; } .window-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; filter: alpha(opacity=40); opacity: 0.40; font-size: 1px; overflow: hidden; } .window, .window-shadow { position: absolute; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px; } .window-shadow { background: #ccc; -moz-box-shadow: 2px 2px 3px #cccccc; -webkit-box-shadow: 2px 2px 3px #cccccc; box-shadow: 2px 2px 3px #cccccc; filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=2,MakeShadow=false,ShadowOpacity=0.2); } .window, .window .window-body { border-color: #95B8E7; } .window { background-color: #E0ECFF; background: -webkit-linear-gradient(top,#EFF5FF 0,#E0ECFF 20%); background: -moz-linear-gradient(top,#EFF5FF 0,#E0ECFF 20%); background: -o-linear-gradient(top,#EFF5FF 0,#E0ECFF 20%); background: linear-gradient(to bottom,#EFF5FF 0,#E0ECFF 20%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFF5FF,endColorstr=#E0ECFF,GradientType=0); } .window-proxy { border: 1px dashed #95B8E7; } .window-proxy-mask, .window-mask { background: #ccc; } .window .panel-footer { border: 1px solid #95B8E7; position: relative; top: -1px; } .window-thinborder { padding: 0; } .window-thinborder .window-header { padding: 5px 5px 6px 5px; } .window-thinborder .window-body { border-width: 0px; } .window-thinborder .window-header .panel-icon, .window-thinborder .window-header .panel-tool { margin-top: -9px; margin-left: 5px; margin-right: 5px; } .window-noborder { border: 0; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/themes/icon.css ================================================ .icon-blank{ background:url('icons/blank.gif') no-repeat center center; } .icon-add{ background:url('icons/edit_add.png') no-repeat center center; } .icon-edit{ background:url('icons/pencil.png') no-repeat center center; } .icon-clear{ background:url('icons/clear.png') no-repeat center center; } .icon-remove{ background:url('icons/edit_remove.png') no-repeat center center; } .icon-save{ background:url('icons/filesave.png') no-repeat center center; } .icon-cut{ background:url('icons/cut.png') no-repeat center center; } .icon-ok{ background:url('icons/ok.png') no-repeat center center; } .icon-no{ background:url('icons/no.png') no-repeat center center; } .icon-cancel{ background:url('icons/cancel.png') no-repeat center center; } .icon-reload{ background:url('icons/reload.png') no-repeat center center; } .icon-search{ background:url('icons/search.png') no-repeat center center; } .icon-print{ background:url('icons/print.png') no-repeat center center; } .icon-help{ background:url('icons/help.png') no-repeat center center; } .icon-undo{ background:url('icons/undo.png') no-repeat center center; } .icon-redo{ background:url('icons/redo.png') no-repeat center center; } .icon-back{ background:url('icons/back.png') no-repeat center center; } .icon-sum{ background:url('icons/sum.png') no-repeat center center; } .icon-tip{ background:url('icons/tip.png') no-repeat center center; } .icon-filter{ background:url('icons/filter.png') no-repeat center center; } .icon-man{ background:url('icons/man.png') no-repeat center center; } .icon-lock{ background:url('icons/lock.png') no-repeat center center; } .icon-more{ background:url('icons/more.png') no-repeat center center; } .icon-disable{ background:url('icons/disable.png') no-repeat center center; } .icon-excel{ background:url('icons/excel.png') no-repeat center center; } .icon-sync{ background:url('icons/sync.png') no-repeat center center; } .icon-mini-add{ background:url('icons/mini_add.png') no-repeat center center; } .icon-mini-edit{ background:url('icons/mini_edit.png') no-repeat center center; } .icon-mini-refresh{ background:url('icons/mini_refresh.png') no-repeat center center; } ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/views/datagrid-bufferview.js ================================================ $.extend($.fn.datagrid.defaults, { rowHeight: 25, onBeforeFetch: function(page){}, onFetch: function(page, rows){} }); var bufferview = $.extend({}, $.fn.datagrid.defaults.view, { render: function(target, container, frozen){ var state = $.data(target, 'datagrid'); var opts = state.options; var rows = this.rows || []; if (!rows.length) { return; } var fields = $(target).datagrid('getColumnFields', frozen); if (frozen){ if (!(opts.rownumbers || (opts.frozenColumns && opts.frozenColumns.length))){ return; } } var index = parseInt(opts.finder.getTr(target,'','last',(frozen?1:2)).attr('datagrid-row-index'))+1 || 0; var table = ['']; for(var i=0; i'); table.push(this.renderRow.call(this, target, fields, frozen, index, rows[i])); table.push(''); index++; } table.push('
          '); $(container).append(table.join('')); }, onBeforeRender: function(target){ var state = $.data(target, 'datagrid'); var opts = state.options; var dc = state.dc; var view = this; this.renderedCount = 0; this.rows = []; dc.body1.add(dc.body2).empty(); init(); function init(){ // erase the onLoadSuccess event, make sure it can't be triggered state.onLoadSuccess = opts.onLoadSuccess; opts.onLoadSuccess = function(){}; setTimeout(function(){ dc.body2.unbind('.datagrid').bind('scroll.datagrid', function(e){ if (state.onLoadSuccess){ opts.onLoadSuccess = state.onLoadSuccess; // restore the onLoadSuccess event state.onLoadSuccess = undefined; } if (view.scrollTimer){ clearTimeout(view.scrollTimer); } view.scrollTimer = setTimeout(function(){ scrolling.call(view); }, 50); }); dc.body2.triggerHandler('scroll.datagrid'); }, 0); } function scrolling(){ if (getDataHeight() < dc.body2.height() && view.renderedCount < state.data.total){ this.getRows.call(this, target, function(rows){ this.rows = rows; this.populate.call(this, target); dc.body2.triggerHandler('scroll.datagrid'); }); } else if (dc.body2.scrollTop() >= getDataHeight() - dc.body2.height()){ this.getRows.call(this, target, function(rows){ this.rows = rows; this.populate.call(this, target); }); } } function getDataHeight(){ // var h = 0; // dc.body2.children('table.datagrid-btable').each(function(){ // h += $(this).outerHeight(); // }); // if (!h){ // h = view.renderedCount * opts.rowHeight; // } // return h; return view.renderedCount * opts.rowHeight; } }, getRows: function(target, callback){ var state = $.data(target, 'datagrid'); var opts = state.options; var page = Math.floor(this.renderedCount/opts.pageSize) + 1; if (this.renderedCount >= state.data.total){return;} if (opts.onBeforeFetch.call(target, page) == false){return} // var rows = state.data.rows.slice(this.renderedCount, this.renderedCount+opts.pageSize); var index = (page-1)*opts.pageSize; var rows = state.data.rows.slice(index, index+opts.pageSize); if (rows.length){ opts.onFetch.call(target, page, rows); callback.call(this, rows); } else { var param = $.extend({}, opts.queryParams, { page: Math.floor(this.renderedCount/opts.pageSize)+1, rows: opts.pageSize }); if (opts.sortName){ $.extend(param, { sort: opts.sortName, order: opts.sortOrder }); } if (opts.onBeforeLoad.call(target, param) == false){return;} $(target).datagrid('loading'); var result = opts.loader.call(target, param, function(data){ $(target).datagrid('loaded'); var data = opts.loadFilter.call(target, data); opts.onFetch.call(target, page, data.rows); if (data.rows && data.rows.length){ state.data.rows = state.data.rows.concat(data.rows); callback.call(opts.view, data.rows); } else { opts.onLoadSuccess.call(target, data); } }, function(){ $(target).datagrid('loaded'); opts.onLoadError.apply(target, arguments); }); if (result == false){ $(target).datagrid('loaded'); if (!state.data.rows.length){ opts.onFetch.call(target, page, state.data.rows); opts.onLoadSuccess.call(target, state.data); } } } }, populate: function(target){ var state = $.data(target, 'datagrid'); var opts = state.options; var dc = state.dc; if (this.rows.length){ this.renderedCount += this.rows.length; this.render.call(this, target, dc.body2, false); this.render.call(this, target, dc.body1, true); opts.onLoadSuccess.call(target, { total: state.data.total, rows: this.rows }); // for(var i=this.renderedCount-this.rows.length; i']; for(var i=0; i'); table.push(this.renderRow.call(this, target, fields, frozen, i, rows[i])); table.push(''); } table.push(''); $(container).html(table.join('')); }, renderFooter: function(target, container, frozen){ var opts = $.data(target, 'datagrid').options; var rows = $.data(target, 'datagrid').footer || []; var fields = $(target).datagrid('getColumnFields', frozen); var table = ['']; for(var i=0; i'); table.push(this.renderRow.call(this, target, fields, frozen, i, rows[i])); table.push(''); } table.push('
          '); $(container).html(table.join('')); }, renderRow: function(target, fields, frozen, rowIndex, rowData){ var opts = $.data(target, 'datagrid').options; var cc = []; if (frozen && opts.rownumbers){ var rownumber = rowIndex + 1; if (opts.pagination){ rownumber += (opts.pageNumber-1)*opts.pageSize; } cc.push('
          '+rownumber+'
          '); } for(var i=0; i'); if (col.checkbox){ var style = ''; } else { var style = styleValue; if (col.align){style += ';text-align:' + col.align + ';'} if (!opts.nowrap){ style += ';white-space:normal;height:auto;'; } else if (opts.autoRowHeight){ style += ';height:auto;'; } } cc.push('
          '); if (col.checkbox){ cc.push(''); } else if (col.formatter){ cc.push(col.formatter(value, rowData, rowIndex)); } else { cc.push(value); } cc.push('
          '); cc.push(''); } } return cc.join(''); }, refreshRow: function(target, rowIndex){ this.updateRow.call(this, target, rowIndex, {}); }, updateRow: function(target, rowIndex, row){ var opts = $.data(target, 'datagrid').options; var rows = $(target).datagrid('getRows'); $.extend(rows[rowIndex], row); var css = opts.rowStyler ? opts.rowStyler.call(target, rowIndex, rows[rowIndex]) : ''; var classValue = ''; var styleValue = ''; if (typeof css == 'string'){ styleValue = css; } else if (css){ classValue = css['class'] || ''; styleValue = css['style'] || ''; } var classValue = 'datagrid-row ' + (rowIndex % 2 && opts.striped ? 'datagrid-row-alt ' : ' ') + classValue; function _update(frozen){ var fields = $(target).datagrid('getColumnFields', frozen); var tr = opts.finder.getTr(target, rowIndex, 'body', (frozen?1:2)); var checked = tr.find('div.datagrid-cell-check input[type=checkbox]').is(':checked'); tr.html(this.renderRow.call(this, target, fields, frozen, rowIndex, rows[rowIndex])); tr.attr('style', styleValue).attr('class', classValue); if (checked){ tr.find('div.datagrid-cell-check input[type=checkbox]')._propAttr('checked', true); } } _update.call(this, true); _update.call(this, false); $(target).datagrid('fixRowHeight', rowIndex); }, insertRow: function(target, index, row){ var state = $.data(target, 'datagrid'); var opts = state.options; var dc = state.dc; var data = state.data; if (index == undefined || index == null) index = data.rows.length; if (index > data.rows.length) index = data.rows.length; function _incIndex(frozen){ var serno = frozen?1:2; for(var i=data.rows.length-1; i>=index; i--){ var tr = opts.finder.getTr(target, i, 'body', serno); tr.attr('datagrid-row-index', i+1); tr.attr('id', state.rowIdPrefix + '-' + serno + '-' + (i+1)); if (frozen && opts.rownumbers){ var rownumber = i+2; if (opts.pagination){ rownumber += (opts.pageNumber-1)*opts.pageSize; } tr.find('div.datagrid-cell-rownumber').html(rownumber); } if (opts.striped){ tr.removeClass('datagrid-row-alt').addClass((i+1)%2 ? 'datagrid-row-alt' : ''); } } } function _insert(frozen){ var serno = frozen?1:2; var fields = $(target).datagrid('getColumnFields', frozen); var rowId = state.rowIdPrefix + '-' + serno + '-' + index; var tr = ''; // var tr = '' + this.renderRow.call(this, target, fields, frozen, index, row) + ''; if (index >= data.rows.length){ // append new row if (data.rows.length){ // not empty opts.finder.getTr(target, '', 'last', serno).after(tr); } else { var cc = frozen ? dc.body1 : dc.body2; cc.html('' + tr + '
          '); } } else { // insert new row opts.finder.getTr(target, index+1, 'body', serno).before(tr); } } _incIndex.call(this, true); _incIndex.call(this, false); _insert.call(this, true); _insert.call(this, false); data.total += 1; data.rows.splice(index, 0, row); this.refreshRow.call(this, target, index); }, deleteRow: function(target, index){ var state = $.data(target, 'datagrid'); var opts = state.options; var data = state.data; function _decIndex(frozen){ var serno = frozen?1:2; for(var i=index+1; i'); for(var i=0; i'); table.push(this.renderRow.call(this, target, fields, frozen, i, rows[i])); table.push(''); table.push(''); if (frozen){ table.push(''); } else { table.push(''); } table.push('
          '); if (frozen){ table.push(' '); } else { table.push(opts.detailFormatter.call(target, i, rows[i])); } table.push('
          '); table.push(''); table.push(''); } table.push(''); $(container).html(table.join('')); }, renderRow: function(target, fields, frozen, rowIndex, rowData){ var opts = $.data(target, 'datagrid').options; var cc = []; if (frozen && opts.rownumbers){ var rownumber = rowIndex + 1; if (opts.pagination){ rownumber += (opts.pageNumber-1)*opts.pageSize; } cc.push('
          '+rownumber+'
          '); } for(var i=0; i'); if (col.checkbox){ style = ''; } else if (col.expander){ style = "text-align:center;height:16px;"; } else { style = styleValue; if (col.align){style += ';text-align:' + col.align + ';'} if (!opts.nowrap){ style += ';white-space:normal;height:auto;'; } else if (opts.autoRowHeight){ style += ';height:auto;'; } } cc.push('
          '); if (col.checkbox){ cc.push(''); } else if (col.expander) { //cc.push('
          '); cc.push(''); //cc.push('
          '); } else if (col.formatter){ cc.push(col.formatter(value, rowData, rowIndex)); } else { cc.push(value); } cc.push('
          '); cc.push(''); } } return cc.join(''); }, insertRow: function(target, index, row){ var opts = $.data(target, 'datagrid').options; var dc = $.data(target, 'datagrid').dc; var panel = $(target).datagrid('getPanel'); var view1 = dc.view1; var view2 = dc.view2; var isAppend = false; var rowLength = $(target).datagrid('getRows').length; if (rowLength == 0){ $(target).datagrid('loadData',{total:1,rows:[row]}); return; } if (index == undefined || index == null || index >= rowLength) { index = rowLength; isAppend = true; this.canUpdateDetail = false; } $.fn.datagrid.defaults.view.insertRow.call(this, target, index, row); _insert(true); _insert(false); this.canUpdateDetail = true; function _insert(frozen){ var tr = opts.finder.getTr(target, index, 'body', frozen?1:2); if (isAppend){ var detail = tr.next(); var newDetail = tr.next().clone(); tr.insertAfter(detail); } else { var newDetail = tr.next().next().clone(); } newDetail.insertAfter(tr); newDetail.hide(); if (!frozen){ newDetail.find('div.datagrid-row-detail').html(opts.detailFormatter.call(target, index, row)); } } }, deleteRow: function(target, index){ var opts = $.data(target, 'datagrid').options; var dc = $.data(target, 'datagrid').dc; var tr = opts.finder.getTr(target, index); tr.next().remove(); $.fn.datagrid.defaults.view.deleteRow.call(this, target, index); dc.body2.triggerHandler('scroll'); }, updateRow: function(target, rowIndex, row){ var dc = $.data(target, 'datagrid').dc; var opts = $.data(target, 'datagrid').options; var cls = $(target).datagrid('getExpander', rowIndex).attr('class'); $.fn.datagrid.defaults.view.updateRow.call(this, target, rowIndex, row); $(target).datagrid('getExpander', rowIndex).attr('class',cls); // update the detail content if (opts.autoUpdateDetail && this.canUpdateDetail){ var row = $(target).datagrid('getRows')[rowIndex]; var detail = $(target).datagrid('getRowDetail', rowIndex); detail.html(opts.detailFormatter.call(target, rowIndex, row)); } }, bindEvents: function(target){ var state = $.data(target, 'datagrid'); if (state.ss.bindDetailEvents){return;} state.ss.bindDetailEvents = true; var dc = state.dc; var opts = state.options; var body = dc.body1.add(dc.body2); var clickHandler = ($.data(body[0],'events')||$._data(body[0],'events')).click[0].handler; body.unbind('click').bind('click', function(e){ var tt = $(e.target); var tr = tt.closest('tr.datagrid-row'); if (!tr.length){return} if (tt.hasClass('datagrid-row-expander')){ var rowIndex = parseInt(tr.attr('datagrid-row-index')); if (tt.hasClass('datagrid-row-expand')){ $(target).datagrid('expandRow', rowIndex); } else { $(target).datagrid('collapseRow', rowIndex); } $(target).datagrid('fixRowHeight'); } else { clickHandler(e); } e.stopPropagation(); }); }, onBeforeRender: function(target){ var state = $.data(target, 'datagrid'); var opts = state.options; var dc = state.dc; var t = $(target); var hasExpander = false; var fields = t.datagrid('getColumnFields',true).concat(t.datagrid('getColumnFields')); for(var i=0; i
          '); if ($('tr',t).length == 0){ td.wrap('').parent().appendTo($('tbody',t)); } else if (opts.rownumbers){ td.insertAfter(t.find('td:has(div.datagrid-header-rownumber)')); } else { td.prependTo(t.find('tr:first')); } } // if (!state.bindDetailEvents){ // state.bindDetailEvents = true; // var that = this; // setTimeout(function(){ // that.bindEvents(target); // },0); // } }, onAfterRender: function(target){ var that = this; var state = $.data(target, 'datagrid'); var dc = state.dc; var opts = state.options; var panel = $(target).datagrid('getPanel'); $.fn.datagrid.defaults.view.onAfterRender.call(this, target); if (!state.onResizeColumn){ state.onResizeColumn = opts.onResizeColumn; opts.onResizeColumn = function(field, width){ if (!opts.fitColumns){ resizeDetails(); } var rowCount = $(target).datagrid('getRows').length; for(var i=0; itable.datagrid-btable>tbody>tr>td>div.datagrid-row-detail:visible')._outerWidth(ww); // details.find('.easyui-fluid').trigger('_resize'); // fr.show(); // } function resizeDetails(){ var details = dc.body2.find('>table.datagrid-btable>tbody>tr>td>div.datagrid-row-detail:visible'); if (details.length){ var ww = 0; dc.header2.find('.datagrid-header-check:visible,.datagrid-cell:visible').each(function(){ ww += $(this).outerWidth(true) + 1; }); if (ww != details.outerWidth(true)){ details._outerWidth(ww); details.find('.easyui-fluid').trigger('_resize'); } } } this.canUpdateDetail = true; // define if to update the detail content when 'updateRow' method is called; var footer = dc.footer1.add(dc.footer2); footer.find('span.datagrid-row-expander').css('visibility', 'hidden'); $(target).datagrid('resize'); this.bindEvents(target); var detail = dc.body1.add(dc.body2).find('div.datagrid-row-detail'); detail.unbind().bind('mouseover mouseout click dblclick contextmenu scroll', function(e){ e.stopPropagation(); }); } }); $.extend($.fn.datagrid.methods, { fixDetailRowHeight: function(jq, index){ return jq.each(function(){ var opts = $.data(this, 'datagrid').options; if (!(opts.rownumbers || (opts.frozenColumns && opts.frozenColumns.length))){ return; } var dc = $.data(this, 'datagrid').dc; var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); // fix the detail row height if (tr2.is(':visible')){ tr1.css('height', ''); tr2.css('height', ''); var height = Math.max(tr1.height(), tr2.height()); tr1.css('height', height); tr2.css('height', height); } dc.body2.triggerHandler('scroll'); }); }, getExpander: function(jq, index){ // get row expander object var opts = $.data(jq[0], 'datagrid').options; return opts.finder.getTr(jq[0], index).find('span.datagrid-row-expander'); }, // get row detail container getRowDetail: function(jq, index){ var opts = $.data(jq[0], 'datagrid').options; var tr = opts.finder.getTr(jq[0], index, 'body', 2); // return tr.next().find('div.datagrid-row-detail'); return tr.next().find('>td>div.datagrid-row-detail'); }, expandRow: function(jq, index){ return jq.each(function(){ var opts = $(this).datagrid('options'); var dc = $.data(this, 'datagrid').dc; var expander = $(this).datagrid('getExpander', index); if (expander.hasClass('datagrid-row-expand')){ expander.removeClass('datagrid-row-expand').addClass('datagrid-row-collapse'); var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); tr1.show(); tr2.show(); $(this).datagrid('fixDetailRowHeight', index); if (opts.onExpandRow){ var row = $(this).datagrid('getRows')[index]; opts.onExpandRow.call(this, index, row); } } }); }, collapseRow: function(jq, index){ return jq.each(function(){ var opts = $(this).datagrid('options'); var dc = $.data(this, 'datagrid').dc; var expander = $(this).datagrid('getExpander', index); if (expander.hasClass('datagrid-row-collapse')){ expander.removeClass('datagrid-row-collapse').addClass('datagrid-row-expand'); var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); tr1.hide(); tr2.hide(); dc.body2.triggerHandler('scroll'); if (opts.onCollapseRow){ var row = $(this).datagrid('getRows')[index]; opts.onCollapseRow.call(this, index, row); } } }); } }); $.extend($.fn.datagrid.methods, { subgrid: function(jq, conf){ return jq.each(function(){ createGrid(this, conf); function createGrid(target, conf, prow){ var queryParams = $.extend({}, conf.options.queryParams||{}); // queryParams[conf.options.foreignField] = prow ? prow[conf.options.foreignField] : undefined; if (prow){ var fk = conf.options.foreignField; if ($.isFunction(fk)){ $.extend(queryParams, fk.call(conf, prow)); } else { queryParams[fk] = prow[fk]; } } var plugin = conf.options.edatagrid ? 'edatagrid' : 'datagrid'; $(target)[plugin]($.extend({}, conf.options, { subgrid: conf.subgrid, view: (conf.subgrid ? detailview : undefined), queryParams: queryParams, detailFormatter: function(index, row){ return '
          '; }, onExpandRow: function(index, row){ var opts = $(this).datagrid('options'); var rd = $(this).datagrid('getRowDetail', index); var dg = getSubGrid(rd); if (!dg.data('datagrid')){ createGrid(dg[0], opts.subgrid, row); } rd.find('.easyui-fluid').trigger('_resize'); setHeight(this, index); if (conf.options.onExpandRow){ conf.options.onExpandRow.call(this, index, row); } }, onCollapseRow: function(index, row){ setHeight(this, index); if (conf.options.onCollapseRow){ conf.options.onCollapseRow.call(this, index, row); } }, onResize: function(){ var dg = $(this).children('div.datagrid-view').children('table') setParentHeight(this); }, onResizeColumn: function(field, width){ setParentHeight(this); if (conf.options.onResizeColumn){ conf.options.onResizeColumn.call(this, field, width); } }, onLoadSuccess: function(data){ setParentHeight(this); if (conf.options.onLoadSuccess){ conf.options.onLoadSuccess.call(this, data); } } })); } function getSubGrid(rowDetail){ var div = $(rowDetail).children('div'); if (div.children('div.datagrid').length){ return div.find('>div.datagrid>div.panel-body>div.datagrid-view>table.datagrid-subgrid'); } else { return div.find('>table.datagrid-subgrid'); } } function setParentHeight(target){ var tr = $(target).closest('div.datagrid-row-detail').closest('tr').prev(); if (tr.length){ var index = parseInt(tr.attr('datagrid-row-index')); var dg = tr.closest('div.datagrid-view').children('table'); setHeight(dg[0], index); } } function setHeight(target, index){ $(target).datagrid('fixDetailRowHeight', index); $(target).datagrid('fixRowHeight', index); var tr = $(target).closest('div.datagrid-row-detail').closest('tr').prev(); if (tr.length){ var index = parseInt(tr.attr('datagrid-row-index')); var dg = tr.closest('div.datagrid-view').children('table'); setHeight(dg[0], index); } } }); }, getSelfGrid: function(jq){ var grid = jq.closest('.datagrid'); if (grid.length){ return grid.find('>.datagrid-wrap>.datagrid-view>.datagrid-f'); } else { return null; } }, getParentGrid: function(jq){ var detail = jq.closest('div.datagrid-row-detail'); if (detail.length){ return detail.closest('.datagrid-view').children('.datagrid-f'); } else { return null; } }, getParentRowIndex: function(jq){ var detail = jq.closest('div.datagrid-row-detail'); if (detail.length){ var tr = detail.closest('tr').prev(); return parseInt(tr.attr('datagrid-row-index')); } else { return -1; } } }); ================================================ FILE: src/Coldairarrow.Web/Scripts/easyui/views/datagrid-groupview.js ================================================ $.extend($.fn.datagrid.defaults, { groupHeight: 25, expanderWidth: 30, groupStyler: function(value,rows){return ''} }); var groupview = $.extend({}, $.fn.datagrid.defaults.view, { render: function(target, container, frozen){ var table = []; var groups = this.groups; for(var i=0; i'); if ((frozen && (opts.rownumbers || opts.frozenColumns.length)) || (!frozen && !(opts.rownumbers || opts.frozenColumns.length))){ table.push(''); table.push(' '); table.push(''); } if ((frozen && hasFrozen) || (!frozen)){ table.push(''); table.push(opts.groupFormatter.call(target, group.value, group.rows)); table.push(''); } table.push('
          '); table.push(''); var index = group.startIndex; for(var j=0; j'); table.push(this.renderRow.call(this, target, fields, frozen, index, group.rows[j])); table.push(''); index++; } table.push('
          '); return table.join(''); function parseCss(css, cls){ var classValue = ''; var styleValue = ''; if (typeof css == 'string'){ styleValue = css; } else if (css){ classValue = css['class'] || ''; styleValue = css['style'] || ''; } return 'class="' + cls + (classValue ? ' '+classValue : '') + '" ' + 'style="' + styleValue + '"'; } }, bindEvents: function(target){ var state = $.data(target, 'datagrid'); var dc = state.dc; var body = dc.body1.add(dc.body2); var clickHandler = ($.data(body[0],'events')||$._data(body[0],'events')).click[0].handler; body.unbind('click').bind('click', function(e){ var tt = $(e.target); var expander = tt.closest('span.datagrid-row-expander'); if (expander.length){ var gindex = expander.closest('div.datagrid-group').attr('group-index'); if (expander.hasClass('datagrid-row-collapse')){ $(target).datagrid('collapseGroup', gindex); } else { $(target).datagrid('expandGroup', gindex); } } else { clickHandler(e); } e.stopPropagation(); }); }, onBeforeRender: function(target, rows){ var state = $.data(target, 'datagrid'); var opts = state.options; initCss(); var groups = []; for(var i=0; i' + '.datagrid-group{height:'+opts.groupHeight+'px;overflow:hidden;font-weight:bold;border-bottom:1px solid #ccc;white-space:nowrap;word-break:normal;}' + '.datagrid-group-title,.datagrid-group-expander{display:inline-block;vertical-align:bottom;height:100%;line-height:'+opts.groupHeight+'px;padding:0 4px;}' + '.datagrid-group-title{position:relative;}' + '.datagrid-group-expander{width:'+opts.expanderWidth+'px;text-align:center;padding:0}' + '.datagrid-row-expander{margin:'+Math.floor((opts.groupHeight-16)/2)+'px 0;display:inline-block;width:16px;height:16px;cursor:pointer}' + '' ); } } }, onAfterRender: function(target){ $.fn.datagrid.defaults.view.onAfterRender.call(this, target); var view = this; var state = $.data(target, 'datagrid'); var opts = state.options; if (!state.onResizeColumn){ state.onResizeColumn = opts.onResizeColumn; } if (!state.onResize){ state.onResize = opts.onResize; } opts.onResizeColumn = function(field, width){ view.resizeGroup(target); state.onResizeColumn.call(target, field, width); } opts.onResize = function(width, height){ view.resizeGroup(target); state.onResize.call($(target).datagrid('getPanel')[0], width, height); } view.resizeGroup(target); } }); $.extend($.fn.datagrid.methods, { groups:function(jq){ return jq.datagrid('options').view.groups; }, expandGroup:function(jq, groupIndex){ return jq.each(function(){ var view = $.data(this, 'datagrid').dc.view; var group = view.find(groupIndex!=undefined ? 'div.datagrid-group[group-index="'+groupIndex+'"]' : 'div.datagrid-group'); var expander = group.find('span.datagrid-row-expander'); if (expander.hasClass('datagrid-row-expand')){ expander.removeClass('datagrid-row-expand').addClass('datagrid-row-collapse'); group.next('table').show(); } $(this).datagrid('fixRowHeight'); }); }, collapseGroup:function(jq, groupIndex){ return jq.each(function(){ var view = $.data(this, 'datagrid').dc.view; var group = view.find(groupIndex!=undefined ? 'div.datagrid-group[group-index="'+groupIndex+'"]' : 'div.datagrid-group'); var expander = group.find('span.datagrid-row-expander'); if (expander.hasClass('datagrid-row-collapse')){ expander.removeClass('datagrid-row-collapse').addClass('datagrid-row-expand'); group.next('table').hide(); } $(this).datagrid('fixRowHeight'); }); }, scrollToGroup: function(jq, groupIndex){ return jq.each(function(){ var state = $.data(this, 'datagrid'); var dc = state.dc; var grow = dc.body2.children('div.datagrid-group[group-index="'+groupIndex+'"]'); if (grow.length){ var groupHeight = grow.outerHeight(); var headerHeight = dc.view2.children('div.datagrid-header')._outerHeight(); var frozenHeight = dc.body2.outerHeight(true) - dc.body2.outerHeight(); var top = grow.position().top - headerHeight - frozenHeight; if (top < 0){ dc.body2.scrollTop(dc.body2.scrollTop() + top); } else if (top + groupHeight > dc.body2.height() - 18){ dc.body2.scrollTop(dc.body2.scrollTop() + top + groupHeight - dc.body2.height() + 18); } } }); } }); $.extend(groupview, { refreshGroupTitle: function(target, groupIndex){ var state = $.data(target, 'datagrid'); var opts = state.options; var dc = state.dc; var group = this.groups[groupIndex]; var span = dc.body1.add(dc.body2).children('div.datagrid-group[group-index=' + groupIndex + ']').find('span.datagrid-group-title'); span.html(opts.groupFormatter.call(target, group.value, group.rows)); }, resizeGroup: function(target, groupIndex){ var state = $.data(target, 'datagrid'); var dc = state.dc; var ht = dc.header2.find('table'); var fr = ht.find('tr.datagrid-filter-row').hide(); var ww = ht.width(); if (groupIndex == undefined){ var groupHeader = dc.body2.children('div.datagrid-group'); } else { var groupHeader = dc.body2.children('div.datagrid-group[group-index=' + groupIndex + ']'); } groupHeader._outerWidth(ww); var opts = state.options; if (opts.frozenColumns && opts.frozenColumns.length){ var width = dc.view1.width() - opts.expanderWidth; var isRtl = dc.view1.css('direction').toLowerCase()=='rtl'; groupHeader.find('.datagrid-group-title').css(isRtl?'right':'left', -width+'px'); } fr.show(); }, insertRow: function(target, index, row){ var state = $.data(target, 'datagrid'); var opts = state.options; var dc = state.dc; var group = null; var groupIndex; if (!state.data.rows.length){ $(target).datagrid('loadData', [row]); return; } for(var i=0; i group.startIndex + group.rows.length){ index = group.startIndex + group.rows.length; } $.fn.datagrid.defaults.view.insertRow.call(this, target, index, row); if (index >= group.startIndex + group.rows.length){ _moveTr(index, true); _moveTr(index, false); } group.rows.splice(index - group.startIndex, 0, row); } else { group = { value: row[opts.groupField], rows: [row], startIndex: state.data.rows.length } groupIndex = this.groups.length; dc.body1.append(this.renderGroup.call(this, target, groupIndex, group, true)); dc.body2.append(this.renderGroup.call(this, target, groupIndex, group, false)); this.groups.push(group); state.data.rows.push(row); } this.setGroupIndex(target); this.refreshGroupTitle(target, groupIndex); this.resizeGroup(target); function _moveTr(index,frozen){ var serno = frozen?1:2; var prevTr = opts.finder.getTr(target, index-1, 'body', serno); var tr = opts.finder.getTr(target, index, 'body', serno); tr.insertAfter(prevTr); } }, updateRow: function(target, index, row){ var opts = $.data(target, 'datagrid').options; $.fn.datagrid.defaults.view.updateRow.call(this, target, index, row); var tb = opts.finder.getTr(target, index, 'body', 2).closest('table.datagrid-btable'); var groupIndex = parseInt(tb.prev().attr('group-index')); this.refreshGroupTitle(target, groupIndex); }, deleteRow: function(target, index){ var state = $.data(target, 'datagrid'); var opts = state.options; var dc = state.dc; var body = dc.body1.add(dc.body2); var tb = opts.finder.getTr(target, index, 'body', 2).closest('table.datagrid-btable'); var groupIndex = parseInt(tb.prev().attr('group-index')); $.fn.datagrid.defaults.view.deleteRow.call(this, target, index); var group = this.groups[groupIndex]; if (group.rows.length > 1){ group.rows.splice(index-group.startIndex, 1); this.refreshGroupTitle(target, groupIndex); } else { body.children('div.datagrid-group[group-index='+groupIndex+']').remove(); for(var i=groupIndex+1; i
          ', '']; for(var i=0; i'); table.push(this.renderRow.call(this, target, fields, frozen, index, rows[i])); table.push(''); // render the detail row if (opts.detailFormatter){ table.push(''); if (frozen){ table.push(''); table.push(''); } index++; } table.push('
          '); } else { table.push(''); } table.push('
          '); if (frozen){ table.push(' '); } else { table.push(opts.detailFormatter.call(target, index, rows[i])); } table.push('
          '); table.push('
          '); table.push('
          '); $(container).html(table.join('')); }, renderRow: function(target, fields, frozen, rowIndex, rowData){ var opts = $.data(target, 'datagrid').options; var cc = []; if (frozen && opts.rownumbers){ var rownumber = rowIndex + 1; // if (opts.pagination){ // rownumber += (opts.pageNumber-1)*opts.pageSize; // } cc.push('
          '+rownumber+'
          '); } for(var i=0; i'); if (col.checkbox){ style = ''; } else if (col.expander){ style = "text-align:center;height:16px;"; } else { style = styleValue; if (col.align){style += ';text-align:' + col.align + ';'} if (!opts.nowrap){ style += ';white-space:normal;height:auto;'; } else if (opts.autoRowHeight){ style += ';height:auto;'; } } cc.push('
          '); if (col.checkbox){ cc.push(''); } else if (col.expander) { //cc.push('
          '); cc.push(''); //cc.push('
          '); } else if (col.formatter){ cc.push(col.formatter(value, rowData, rowIndex)); } else { cc.push(value); } cc.push('
          '); cc.push(''); } } return cc.join(''); }, bindEvents: function(target){ var state = $.data(target, 'datagrid'); var dc = state.dc; var opts = state.options; var body = dc.body1.add(dc.body2); var clickHandler = ($.data(body[0],'events')||$._data(body[0],'events')).click[0].handler; body.unbind('click').bind('click', function(e){ var tt = $(e.target); var tr = tt.closest('tr.datagrid-row'); if (!tr.length){return} if (tt.hasClass('datagrid-row-expander')){ var rowIndex = parseInt(tr.attr('datagrid-row-index')); if (tt.hasClass('datagrid-row-expand')){ $(target).datagrid('expandRow', rowIndex); } else { $(target).datagrid('collapseRow', rowIndex); } $(target).datagrid('fixRowHeight'); } else { clickHandler(e); } e.stopPropagation(); }); }, onBeforeRender: function(target){ var state = $.data(target, 'datagrid'); var opts = state.options; var dc = state.dc; var view = this; state.data.firstRows = state.data.rows; state.data.rows = []; dc.body1.add(dc.body2).empty(); this.rows = []; // the rows to be rendered this.r1 = this.r2 = []; // the first part and last part of rows init(); createHeaderExpander(); function init(){ var pager = $(target).datagrid('getPager'); pager.pagination({ onSelectPage: function(pageNum, pageSize){ opts.pageNumber = pageNum || 1; opts.pageSize = pageSize; pager.pagination('refresh',{ pageNumber:pageNum, pageSize:pageSize }); $(target).datagrid('gotoPage', opts.pageNumber); } }); // erase the onLoadSuccess event, make sure it can't be triggered state.onLoadSuccess = opts.onLoadSuccess; opts.onLoadSuccess = function(){}; if (!opts.remoteSort){ var onBeforeSortColumn = opts.onBeforeSortColumn; opts.onBeforeSortColumn = function(name, order){ var result = onBeforeSortColumn.call(this, name, order); if (result == false){ return false; } state.data.rows = state.data.firstRows; } } dc.body2.unbind('.datagrid'); setTimeout(function(){ dc.body2.unbind('.datagrid').bind('scroll.datagrid', function(e){ if (state.onLoadSuccess){ opts.onLoadSuccess = state.onLoadSuccess; // restore the onLoadSuccess event state.onLoadSuccess = undefined; } if (view.scrollTimer){ clearTimeout(view.scrollTimer); } view.scrollTimer = setTimeout(function(){ view.scrolling.call(view, target); }, 50); }); dc.body2.triggerHandler('scroll.datagrid'); }, 0); } function createHeaderExpander(){ if (!opts.detailFormatter){return} var t = $(target); var hasExpander = false; var fields = t.datagrid('getColumnFields',true).concat(t.datagrid('getColumnFields')); for(var i=0; i
          '); if ($('tr',t).length == 0){ td.wrap('').parent().appendTo($('tbody',t)); } else if (opts.rownumbers){ td.insertAfter(t.find('td:has(div.datagrid-header-rownumber)')); } else { td.prependTo(t.find('tr:first')); } } setTimeout(function(){ view.bindEvents(target); },0); } }, onAfterRender: function(target){ $.fn.datagrid.defaults.view.onAfterRender.call(this, target); var dc = $.data(target, 'datagrid').dc; var footer = dc.footer1.add(dc.footer2); footer.find('span.datagrid-row-expander').css('visibility', 'hidden'); }, scrolling: function(target){ var state = $.data(target, 'datagrid'); var opts = state.options; var dc = state.dc; if (!opts.finder.getRows(target).length){ this.reload.call(this, target); } else { if (!dc.body2.is(':visible')){return} var headerHeight = dc.view2.children('div.datagrid-header').outerHeight(); var topDiv = dc.body2.children('div.datagrid-btable-top'); var bottomDiv = dc.body2.children('div.datagrid-btable-bottom'); if (!topDiv.length || !bottomDiv.length){return;} var top = topDiv.position().top + topDiv._outerHeight() - headerHeight; var bottom = bottomDiv.position().top - headerHeight; top = Math.floor(top); bottom = Math.floor(bottom); if (top > dc.body2.height() || bottom < 0){ this.reload.call(this, target); } else if (top > 0){ var page = Math.floor(this.index/opts.pageSize); this.getRows.call(this, target, page, function(rows){ this.page = page; this.r2 = this.r1; this.r1 = rows; this.index = (page-1)*opts.pageSize; this.rows = this.r1.concat(this.r2); this.populate.call(this, target); }); } else if (bottom < dc.body2.height()){ if (state.data.rows.length+this.index >= state.data.total){ return; } var page = Math.floor(this.index/opts.pageSize)+2; if (this.r2.length){ page++; } this.getRows.call(this, target, page, function(rows){ this.page = page; if (!this.r2.length){ this.r2 = rows; } else { this.r1 = this.r2; this.r2 = rows; this.index += opts.pageSize; } this.rows = this.r1.concat(this.r2); this.populate.call(this, target); }); } } }, reload: function(target){ var state = $.data(target, 'datagrid'); var opts = state.options; var dc = state.dc; var top = $(dc.body2).scrollTop() + opts.deltaTopHeight; var index = Math.floor(top/opts.rowHeight); var page = Math.floor(index/opts.pageSize) + 1; this.getRows.call(this, target, page, function(rows){ this.page = page; this.index = (page-1)*opts.pageSize; this.rows = rows; this.r1 = rows; this.r2 = []; this.populate.call(this, target); dc.body2.triggerHandler('scroll.datagrid'); }); }, getRows: function(target, page, callback){ var state = $.data(target, 'datagrid'); var opts = state.options; var index = (page-1)*opts.pageSize; if (index < 0){return} if (opts.onBeforeFetch.call(target, page) == false){return;} var rows = state.data.firstRows.slice(index, index+opts.pageSize); if (rows.length && (rows.length==opts.pageSize || index+rows.length==state.data.total)){ opts.onFetch.call(target, page, rows); callback.call(this, rows); } else { var param = $.extend({}, opts.queryParams, { page: page, rows: opts.pageSize }); if (opts.sortName){ $.extend(param, { sort: opts.sortName, order: opts.sortOrder }); } if (opts.onBeforeLoad.call(target, param) == false) return; $(target).datagrid('loading'); var result = opts.loader.call(target, param, function(data){ $(target).datagrid('loaded'); var data = opts.loadFilter.call(target, data); opts.onFetch.call(target, page, data.rows); if (data.rows && data.rows.length){ callback.call(opts.view, data.rows); } else { opts.onLoadSuccess.call(target, data); } }, function(){ $(target).datagrid('loaded'); opts.onLoadError.apply(target, arguments); }); if (result == false){ $(target).datagrid('loaded'); if (!state.data.firstRows.length){ opts.onFetch.call(target, page, state.data.firstRows); opts.onLoadSuccess.call(target, state.data); } } } }, populate: function(target){ var state = $.data(target, 'datagrid'); var opts = state.options; var dc = state.dc; var rowHeight = opts.rowHeight; var maxHeight = opts.maxDivHeight; if (this.rows.length){ opts.view.render.call(opts.view, target, dc.body2, false); opts.view.render.call(opts.view, target, dc.body1, true); var body = dc.body1.add(dc.body2); var topDiv = body.children('div.datagrid-btable-top'); var bottomDiv = body.children('div.datagrid-btable-bottom'); var topHeight = this.index * rowHeight; var bottomHeight = state.data.total*rowHeight - this.rows.length*rowHeight - topHeight; fillHeight(topDiv, topHeight); fillHeight(bottomDiv, bottomHeight); state.data.rows = this.rows; var spos = dc.body2.scrollTop() + opts.deltaTopHeight; if (topHeight > opts.maxVisibleHeight){ opts.deltaTopHeight = topHeight - opts.maxVisibleHeight; fillHeight(topDiv, topHeight - opts.deltaTopHeight); } else { opts.deltaTopHeight = 0; } if (bottomHeight > opts.maxVisibleHeight){ fillHeight(bottomDiv, opts.maxVisibleHeight); } else if (bottomHeight == 0){ var lastCount = state.data.total % opts.pageSize; if (lastCount){ fillHeight(bottomDiv, dc.body2.height() - lastCount * rowHeight); } } $(target).datagrid('setSelectionState'); dc.body2.scrollTop(spos - opts.deltaTopHeight); var pager = $(target).datagrid('getPager'); if (pager.length){ var popts = pager.pagination('options'); var displayMsg = popts.displayMsg; var msg = displayMsg.replace(/{from}/, this.index+1); msg = msg.replace(/{to}/, this.index+this.rows.length); pager.pagination('refresh', { pageNumber: this.page, displayMsg: msg }); popts.displayMsg = displayMsg; } opts.onLoadSuccess.call(target, { total: state.data.total, rows: this.rows }); } function fillHeight(div, height){ var count = Math.floor(height/maxHeight); var leftHeight = height - maxHeight*count; if (height < 0){ leftHeight = 0; } var cc = []; for(var i=0; i'); } cc.push('
          '); $(div).html(cc.join('')); } }, updateRow: function(target, rowIndex, row){ var opts = $.data(target, 'datagrid').options; var rows = $(target).datagrid('getRows'); var rowData = opts.finder.getRow(target, rowIndex); var oldStyle = _getRowStyle(rowIndex); $.extend(rowData, row); var newStyle = _getRowStyle(rowIndex); var oldClassValue = oldStyle.c; var styleValue = newStyle.s; var classValue = 'datagrid-row ' + (rowIndex % 2 && opts.striped ? 'datagrid-row-alt ' : ' ') + newStyle.c; function _getRowStyle(rowIndex){ var css = opts.rowStyler ? opts.rowStyler.call(target, rowIndex, rowData) : ''; var classValue = ''; var styleValue = ''; if (typeof css == 'string'){ styleValue = css; } else if (css){ classValue = css['class'] || ''; styleValue = css['style'] || ''; } return {c:classValue, s:styleValue}; } function _update(frozen){ var fields = $(target).datagrid('getColumnFields', frozen); var tr = opts.finder.getTr(target, rowIndex, 'body', (frozen?1:2)); var checked = tr.find('div.datagrid-cell-check input[type=checkbox]').is(':checked'); tr.html(this.renderRow.call(this, target, fields, frozen, rowIndex, rowData)); tr.attr('style', styleValue).removeClass(oldClassValue).addClass(classValue); if (checked){ tr.find('div.datagrid-cell-check input[type=checkbox]')._propAttr('checked', true); } } _update.call(this, true); _update.call(this, false); $(target).datagrid('fixRowHeight', rowIndex); }, // insertRow: function(target, index, row){ // var state = $.data(target, 'datagrid'); // var data = state.data; // if (index == undefined || index == null) index = data.rows.length; // if (index > data.rows.length) index = data.rows.length; // $.fn.datagrid.defaults.view.insertRow.call(this, target, index, row); // if (data.firstRows && index <= data.firstRows.length){ // data.firstRows.splice(index, 0, row); // } // }, insertRow: function(target, index, row){ var state = $.data(target, 'datagrid'); var opts = state.options; var data = state.data; var total = $(target).datagrid('getData').total; if (index == null){index = total;} if (index > total){index = total;} if (data.firstRows && index <= data.firstRows.length){ data.firstRows.splice(index, 0, row); } data.total++; var rows = this.r1.concat(this.r2); if (index < this.index){ this.reload.call(this, target); } else if (index <= this.index+rows.length){ rows.splice(index - this.index, 0, row); this.r1 = rows.splice(0, opts.pageSize); if (this.r2.length){ this.r2 = rows.splice(0, opts.pageSize); } this.rows = this.r1.concat(this.r2); this.populate.call(this, target); state.dc.body2.triggerHandler('scroll.datagrid'); } }, // deleteRow: function(target, index){ // var data = $(target).datagrid('getData'); // $.fn.datagrid.defaults.view.deleteRow.call(this, target, index); // if (data.firstRows){ // data.firstRows.splice(index, 1); // } // }, deleteRow: function(target, index){ var state = $.data(target, 'datagrid'); var data = state.data; var opts = state.options; if (data.firstRows){ data.firstRows.splice(index, 1); } data.total--; var rows = this.r1.concat(this.r2); if (index < this.index){ this.reload.call(this, target); } else if (index < this.index+rows.length){ rows.splice(index - this.index, 1); this.r1 = rows.splice(0, opts.pageSize); if (this.r1.length < opts.pageSize){ this.reload.call(this, target); } else { this.r2 = []; this.rows = this.r1.concat(this.r2); this.populate.call(this, target); state.dc.body2.triggerHandler('scroll.datagrid'); } } } }); $.fn.datagrid.methods.baseGetRowIndex = $.fn.datagrid.methods.getRowIndex; $.fn.datagrid.methods.baseScrollTo = $.fn.datagrid.methods.scrollTo; $.fn.datagrid.methods.baseGotoPage = $.fn.datagrid.methods.gotoPage; $.extend($.fn.datagrid.methods, { getRowIndex: function(jq, id){ var opts = jq.datagrid('options'); if (opts.view.type == 'scrollview'){ // return jq.datagrid('baseGetRowIndex', id) + opts.view.index; var index = jq.datagrid('baseGetRowIndex', id); if (index == -1){ return -1; } else { return index + opts.view.index; } } else { return jq.datagrid('baseGetRowIndex', id); } }, getRow: function(jq, index){ return jq.datagrid('options').finder.getRow(jq[0], index); }, gotoPage: function(jq, param){ return jq.each(function(){ var target = this; var opts = $(target).datagrid('options'); if (opts.view.type == 'scrollview'){ var page, callback; if (typeof param == 'object'){ page = param.page; callback = param.callback; } else { page = param; } opts.view.getRows.call(opts.view, target, page, function(rows){ this.page = page; this.index = (page-1)*opts.pageSize; this.rows = rows; this.r1 = rows; this.r2 = []; this.populate.call(this, target); $(target).data('datagrid').dc.body2.scrollTop(this.index * opts.rowHeight - opts.deltaTopHeight); if (callback){ callback.call(target, page); } }); } else { $(target).datagrid('baseGotoPage', param); } }); }, scrollTo: function(jq, param){ return jq.each(function(){ var target = this; var opts = $(target).datagrid('options'); var index, callback; if (typeof param == 'object'){ index = param.index; callback = param.callback; } else { index = param; } var view = opts.view; if (view.type == 'scrollview'){ if (index >= view.index && index < view.index+view.rows.length){ $(target).datagrid('baseScrollTo', index); if (callback){ callback.call(target, index); } } else if (index >= 0){ var page = Math.floor(index/opts.pageSize) + 1; $(target).datagrid('gotoPage', { page: page, callback: function(){ setTimeout(function(){ $(target).datagrid('baseScrollTo', index); if (callback){ callback.call(target, index); } }, 0); } }); } } else { $(target).datagrid('baseScrollTo', index); if (callback){ callback.call(target, index); } } }); } }); $.extend($.fn.datagrid.methods, { fixDetailRowHeight: function(jq, index){ return jq.each(function(){ var opts = $.data(this, 'datagrid').options; var dc = $.data(this, 'datagrid').dc; var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); // fix the detail row height if (tr2.is(':visible')){ tr1.css('height', ''); tr2.css('height', ''); var height = Math.max(tr1.height(), tr2.height()); tr1.css('height', height); tr2.css('height', height); } dc.body2.triggerHandler('scroll'); }); }, getExpander: function(jq, index){ // get row expander object var opts = $.data(jq[0], 'datagrid').options; return opts.finder.getTr(jq[0], index).find('span.datagrid-row-expander'); }, // get row detail container getRowDetail: function(jq, index){ var opts = $.data(jq[0], 'datagrid').options; var tr = opts.finder.getTr(jq[0], index, 'body', 2); return tr.next().find('div.datagrid-row-detail'); }, expandRow: function(jq, index){ return jq.each(function(){ var opts = $(this).datagrid('options'); var dc = $.data(this, 'datagrid').dc; var expander = $(this).datagrid('getExpander', index); if (expander.hasClass('datagrid-row-expand')){ expander.removeClass('datagrid-row-expand').addClass('datagrid-row-collapse'); var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); tr1.show(); tr2.show(); $(this).datagrid('fixDetailRowHeight', index); if (opts.onExpandRow){ var row = $(this).datagrid('getRows')[index]; opts.onExpandRow.call(this, index, row); } } }); }, collapseRow: function(jq, index){ return jq.each(function(){ var opts = $(this).datagrid('options'); var dc = $.data(this, 'datagrid').dc; var expander = $(this).datagrid('getExpander', index); if (expander.hasClass('datagrid-row-collapse')){ expander.removeClass('datagrid-row-collapse').addClass('datagrid-row-expand'); var tr1 = opts.finder.getTr(this, index, 'body', 1).next(); var tr2 = opts.finder.getTr(this, index, 'body', 2).next(); tr1.hide(); tr2.hide(); dc.body2.triggerHandler('scroll'); if (opts.onCollapseRow){ var row = $(this).datagrid('getRows')[index]; opts.onCollapseRow.call(this, index, row); } } }); } }); ================================================ FILE: src/Coldairarrow.Web/Scripts/global.js ================================================ /** * 扩展String */ (function ($) { /** * 扩展String */ $.extend(String, { /** * 格式化含有{0|1...}格式标签的字符串,类似c#的format * 如:String.format('a{0}b',x) = axb * @param str * @return {*} */ format: function (str) { if (!str) return null; var args = Array.prototype.slice.call(arguments, 1); return str.replace(/\{(\d+)\}/g, function (m, i) { return args[i]; }); } }); /** * 扩展String.prototype */ $.extend(String.prototype, { /** * HTML转义 * @returns {string} */ encodeHtml: function () { var s = this; if (s.length == 0) return ""; s = s.replace(/&/g, ">"); s = s.replace(//g, ">"); s = s.replace(/ /g, " "); s = s.replace(/\'/g, "'"); s = s.replace(/\"/g, """); s = s.replace(/\r\n/g, "
          "); s = s.replace(/\n/g, "
          "); return s; }, /** * HTML反转义 * @returns {string} */ decodeHtml: function () { var s = this; if (s.length == 0) return ""; s = s.replace(/>/g, "&"); s = s.replace(/</g, "<"); s = s.replace(/>/g, ">"); s = s.replace(/ /g, " "); s = s.replace(/'/g, "\'"); s = s.replace(/"/g, "\""); s = s.replace(/
          /g, "\n"); s = s.replace(/
          /g, "\n"); return s; }, /** * 去除字符串两边的空格 * @return {String} */ trim: function () { return this.replace(/(^\s*)|(\s*$)/g, ""); }, /** * 格式化含有{0|1...}格式标签的字符串,类似c#的format * 如:'a{0}b' .format(x) = axb * @return {String} */ format: function () { var args = arguments; return this.replace(/\{(\d+)\}/g, function (m, i) { return args[i]; }); }, /** * 格式化浮点数数字,返回保留n个小数的数字结果 * @param n //小数点精度 * @return {String} */ toFixed: function (n) { return parseFloat(this).toFixed(n); }, /** * 以0做前缀转换成固定长度的字符串 * @param num * @return {String} */ padZero: function (num) { if (this.length < num) { var tmp = []; for (var i = 0; i < num - this.length; i++) { tmp.push(0); } return tmp.join('') + this; } else { return this; } }, /** * 检测字符串是否为日期格式 * 日期格式为yyyy-M-d或yyyy-MM-dd或yyyy/M/d或yyyy/MM/dd * @return {Boolean} */ isDate: function () { var r = this.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/); if (r == null) return false; var d = new Date(r[1], r[3] - 1, r[4]); return (d.getFullYear() == r[1] && (d.getMonth() + 1) == r[3] && d.getDate() == r[4]); }, toDate: function () { var temp = this.toString(); temp = temp.replace(/-/g, "/"); return new Date(Date.parse(temp)); }, /** * 检测字符串是否为长日期格式 * 日期部分格式为yyyy-M-d或yyyy-MM-dd或yyyy/M/d或yyyy/MM/dd * 时间部分格式为hh:mm:ss或h:m:s * @return {Boolean} */ isDateTime: function () { var r = this.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/); if (r == null) return false; var d = new Date(r[1], r[3] - 1, r[4], r[5], r[6], r[7]); return (d.getFullYear() == r[1] && (d.getMonth() + 1) == r[3] && d.getDate() == r[4] && d.getHours() == r[5] && d.getMinutes() == r[6] && d.getSeconds() == r[7]); }, /** * 检测字符串是否为邮件格式 * @return {Boolean} */ isMail: function () { var emailReg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; return emailReg.test(this); }, /** * 是否已制定字符开头 * @param prefix * @param offset * @return {Boolean} */ startsWith: function (prefix, offset) { offset = offset || 0; if (offset < 0 || offset > this.length) return false; return this.substring(offset, offset + prefix.length) == prefix; }, /** * 是否已制定字符结束 * @param suffix * @return {Boolean} */ endsWith: function (suffix) { return this.substring(this.length - suffix.length) == suffix; }, /** * 截取字符串 * @param length * @param suffix * @return {String} */ cut: function (length, suffix) { length = length || 30; suffix = suffix === undefined ? "..." : suffix; return this.length > length ? this.slice(0, length - suffix.length) + suffix : this; }, /** * 移除html标签 * @return {String} */ stripTags: function () { return this.replace(/<\/?[^>]+>/gi, ''); } }); })(jQuery); /** * extand Date object */ (function ($) { $.extend(Date, { /** * An Array of day names starting with Sunday. * * @example dayNames[0] * @result 'Sunday' * * @name dayNames * @type Array * @cat Plugins/Methods/Date */ dayNames: ['日', '一', '二', '三', '四', '五', '六'], /** * An Array of abbreviated day names starting with Sun. * * @example abbrDayNames[0] * @result 'Sun' * * @name abbrDayNames * @type Array * @cat Plugins/Methods/Date */ abbrDayNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], /** * An Array of month names starting with Janurary. * * @example monthNames[0] * @result 'January' * * @name monthNames * @type Array * @cat Plugins/Methods/Date */ monthNames: ['一月', '二月', '三月', '四月', '五月', '五月', '七月', '八月', '九月', '十月', '十一月', '十二月'], /** * An Array of abbreviated month names starting with Jan. * * @example abbrMonthNames[0] * @result 'Jan' * * @name monthNames * @type Array * @cat Plugins/Methods/Date */ abbrMonthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], /** * The first day of the week for this locale. * * @name firstDayOfWeek * @type Number * @cat Plugins/Methods/Date * @author Kelvin Luck */ firstDayOfWeek: 1, /** * The format that string dates should be represented as (e.g. 'dd/mm/yyyy' for UK, 'mm/dd/yyyy' for US, 'yyyy-mm-dd' for Unicode etc). * * @name format * @type String * @cat Plugins/Methods/Date * @author Kelvin Luck */ //format: 'dd/mm/yyyy'; //format: 'mm/dd/yyyy'; format: 'yyyy-mm-dd', //format: 'dd mmm yy'; /** * Returns a new date object created from the passed String according to Date.format or false if the attempt to do this results in an invalid date object * (We can't simple use Date.parse as it's not aware of locale and I chose not to overwrite it incase it's functionality is being relied on elsewhere) * * @example var dtm = Date.fromString("12/01/2008"); * dtm.toString(); * @result 'Sat Jan 12 2008 00:00:00' // (where Date.format == 'dd/mm/yyyy' * * @name fromString * @type Date * @cat Plugins/Methods/Date * @author Kelvin Luck */ fromString: function (str) { var f = Date.format; var d = new Date('01/01/1970'); if (str == "") return d; str = str.toLowerCase(); var matcher = ''; var order = []; var r = /(dd?d?|mm?m?|yy?yy?)+([^(m|d|y)])?/g; var results; while ((results = r.exec(f)) != null) { switch (results[1]) { case 'd': case 'dd': case 'm': case 'mm': case 'yy': case 'yyyy': matcher += '(\\d+\\d?\\d?\\d?)+'; order.push(results[1].substr(0, 1)); break; case 'mmm': matcher += '([a-z]{3})'; order.push('M'); break; } if (results[2]) { matcher += results[2]; } } var dm = new RegExp(matcher); var result = str.match(dm); for (var i = 0; i < order.length; i++) { var res = result[i + 1]; switch (order[i]) { case 'd': d.setDate(res); break; case 'm': d.setMonth(Number(res) - 1); break; case 'M': for (var j = 0; j < Date.abbrMonthNames.length; j++) { if (Date.abbrMonthNames[j].toLowerCase() == res) break; } d.setMonth(j); break; case 'y': d.setYear(res); break; } } return d; } }); })(jQuery); /** * extand Date prototype */ (function ($) { $.extend(Date.prototype, { /** * Checks if the year is a leap year. * * @example var dtm = new Date("01/12/2008"); * dtm.isLeapYear(); * @result true * * @name isLeapYear * @type Boolean * @cat Plugins/Methods/Date */ isLeapYear: function () { var y = this.getFullYear(); return (y % 4 == 0 && y % 100 != 0) || y % 400 == 0; }, /** * Checks if the day is a weekend day (Sat or Sun). * * @example var dtm = new Date("01/12/2008"); * dtm.isWeekend(); * @result false * * @name isWeekend * @type Boolean * @cat Plugins/Methods/Date */ isWeekend: function () { return this.getDay() == 0 || this.getDay() == 6; }, /** * Check if the day is a day of the week (Mon-Fri) * * @example var dtm = new Date("01/12/2008"); * dtm.isWeekDay(); * @result false * * @name isWeekDay * @type Boolean * @cat Plugins/Methods/Date */ isWeekDay: function () { return !this.isWeekend(); }, /** * Gets the number of days in the month. * * @example var dtm = new Date("01/12/2008"); * dtm.getDaysInMonth(); * @result 31 * * @name getDaysInMonth * @type Number * @cat Plugins/Methods/Date */ getDaysInMonth: function () { return [31, (this.isLeapYear() ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][this.getMonth()]; }, /** * Gets the name of the day. * * @example var dtm = new Date("01/12/2008"); * dtm.getDayName(); * @result 'Saturday' * * @example var dtm = new Date("01/12/2008"); * dtm.getDayName(true); * @result 'Sat' * * @param abbreviated Boolean When set to true the name will be abbreviated. * @name getDayName * @type String * @cat Plugins/Methods/Date */ getDayName: function (abbreviated) { return abbreviated ? Date.abbrDayNames[this.getDay()] : Date.dayNames[this.getDay()]; }, /** * Gets the name of the month. * * @example var dtm = new Date("01/12/2008"); * dtm.getMonthName(); * @result 'Janurary' * * @example var dtm = new Date("01/12/2008"); * dtm.getMonthName(true); * @result 'Jan' * * @param abbreviated Boolean When set to true the name will be abbreviated. * @name getDayName * @type String * @cat Plugins/Methods/Date */ getMonthName: function (abbreviated) { return abbreviated ? Date.abbrMonthNames[this.getMonth()] : Date.monthNames[this.getMonth()]; }, /** * Get the number of the day of the year. * * @example var dtm = new Date("01/12/2008"); * dtm.getDayOfYear(); * @result 11 * * @name getDayOfYear * @type Number * @cat Plugins/Methods/Date */ getDayOfYear: function () { var tempDate = new Date("1/1/" + this.getFullYear()); return Math.floor((this.getTime() - tempDate.getTime()) / 86400000); }, /** * Get the number of the week of the year. * * @example var dtm = new Date("01/12/2008"); * dtm.getWeekOfYear(); * @result 2 * * @name getWeekOfYear * @type Number * @cat Plugins/Methods/Date */ getWeekOfYear: function () { return Math.ceil(this.getDayOfYear() / 7); }, /** * Set the day of the year. * * @example var dtm = new Date("01/12/2008"); * dtm.setDayOfYear(1); * dtm.toString(); * @result 'Tue Jan 01 2008 00:00:00' * * @name setDayOfYear * @type Date * @cat Plugins/Methods/Date */ setDayOfYear: function (day) { this.setMonth(0); this.setDate(day); return this; }, /** * Add a number of years to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addYears(1); * dtm.toString(); * @result 'Mon Jan 12 2009 00:00:00' * * @name addYears * @type Date * @cat Plugins/Methods/Date */ addYears: function (num) { this.setFullYear(this.getFullYear() + num); return this; }, /** * Add a number of months to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addMonths(1); * dtm.toString(); * @result 'Tue Feb 12 2008 00:00:00' * * @name addMonths * @type Date * @cat Plugins/Methods/Date */ addMonths: function (num) { var tempDate = this.getDate(); this.setMonth(this.getMonth() + num); if (tempDate > this.getDate()) this.addDays(-this.getDate()); return this; }, /** * Add a number of days to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addDays(1); * dtm.toString(); * @result 'Sun Jan 13 2008 00:00:00' * * @name addDays * @type Date * @cat Plugins/Methods/Date */ addDays: function (num) { //this.setDate(this.getDate() + num); this.setTime(this.getTime() + (num * 86400000)); return this; }, /** * Add a number of hours to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addHours(24); * dtm.toString(); * @result 'Sun Jan 13 2008 00:00:00' * * @name addHours * @type Date * @cat Plugins/Methods/Date */ addHours: function (num) { this.setHours(this.getHours() + num); return this; }, /** * Add a number of minutes to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addMinutes(60); * dtm.toString(); * @result 'Sat Jan 12 2008 01:00:00' * * @name addMinutes * @type Date * @cat Plugins/Methods/Date */ addMinutes: function (num) { this.setMinutes(this.getMinutes() + num); return this; }, /** * Add a number of seconds to the date object. * * @example var dtm = new Date("01/12/2008"); * dtm.addSeconds(60); * dtm.toString(); * @result 'Sat Jan 12 2008 00:01:00' * * @name addSeconds * @type Date * @cat Plugins/Methods/Date */ addSeconds: function (num) { this.setSeconds(this.getSeconds() + num); return this; }, /** * Sets the time component of this Date to zero for cleaner, easier comparison of dates where time is not relevant. * * @example var dtm = new Date(); * dtm.zeroTime(); * dtm.toString(); * @result 'Sat Jan 12 2008 00:01:00' * * @name zeroTime * @type Date * @cat Plugins/Methods/Date * @author Kelvin Luck */ zeroTime: function () { this.setMilliseconds(0); this.setSeconds(0); this.setMinutes(0); this.setHours(0); return this; }, /** * Returns a string representation of the date object according to Date.format. * (Date.toString may be used in other places so I purposefully didn't overwrite it) * * @example var dtm = new Date("01/12/2008"); * dtm.asString(); * @result '12/01/2008' // (where Date.format == 'dd/mm/yyyy' * * @name asString * @type Date * @cat Plugins/Methods/Date * @author Kelvin Luck */ asString: function (format) { var r = format || Date.format; if (r.split('mm').length > 1) { // ugly workaround to make sure we don't replace the m's in e.g. noveMber r = r.split('mmmm').join(this.getMonthName(false)) .split('mmm').join(this.getMonthName(true)) .split('mm').join(fx.zeroPad(this.getMonth() + 1)) } else { r = r.split('m').join(this.getMonth() + 1); } r = r.split('yyyy').join(this.getFullYear()) .split('yy').join((this.getFullYear() + '').substring(2)) .split('dd').join(fx.zeroPad(this.getDate())) .split('d').join(this.getDate()); return r; }, /** * 对Date的扩展,将 Date 转化为指定格式的String * 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, * 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) * 例子: * (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 * (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 */ format: function (fmt) { var o = { "M+": this.getMonth() + 1, //月份 "d+": this.getDate(), //日 "h+": this.getHours(), //小时 "m+": this.getMinutes(), //分 "s+": this.getSeconds(), //秒 "q+": Math.floor((this.getMonth() + 3) / 3), //季度 "S": this.getMilliseconds() //毫秒 }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) { if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : (("00" + o[k]).substr(("" + o[k]).length))); } return fmt; } }); })(jQuery); /** * json parser */ (function ($) { /* * 取表单域的所有值 */ $.fn.getValues = function (options) { var defaults = { checkbox: 'array', not: [] }; var $container = $(this); options = $.extend({}, defaults, options); function getValues() { var values = {}, ckbFields = []; $container.find(":input[name]").each(function () { var that = $(this), type = that.attr("type").toLowerCase(), name = that.attr("name"); if (type == 'button' || type == 'submit') return true; if (!name.length) return true; if ($.inArray(name, options.not) >= 0) return true; if (type == "checkbox") { if (values[name] != undefined) { return true; } ckbFields.push(name); values[name] = getCheckboxValues(name); } else if (type == "radio") { if (values[name] != undefined) { return true; } values[name] = getRadioValue(name); } else { var value = that.val(); if (!value.length) return true; if (values[name] == undefined) { values[name] = value; } else { var arr = []; arr.push(values[name]); arr.push(value); values[name] = arr.join(','); } } }); if (options.checkbox == 'string') { $.each(ckbFields, function (i, v) { if ($.isArray(values[v])) values[v] = values[v].join(','); }); } return values; } function getRadioValue(name) { return $container.find("input:radio[name='" + name + "']").val(); } function getCheckboxValues(name) { return $.map($container.find("input:checkbox[name='" + name + "']:checked"), function (n) { return n.value; }); } return getValues(); }; })(jQuery); /* * Desktop */ var Desktop = function () { var currentSystemMenu, innerMsgContainer, innerMsgPanel, innerMsgNum; var innerMsgTemplate = [ '
        • ', '', '
          {{:MsgTitle}}
          ', '
          {{:MsgTime}}
          ', '
          ', '
        • ' ].join(''); function init() { $(window).on('load hashchange', function () { var hash = location.hash.indexOf('#') === 0 ? location.hash.substring(1) : ''; if (!hash || !hash.length) { return; } var arr = hash.split('|'); var panelId = parseInt(Math.random() * 10000, 10) + 1; Desktop.tabs.add('_panel_r' + panelId, arr.length > 1 ? arr[1] : '', arr[0]); }); initMenu(); initInnerMsg(); } function initMenu() { $("#menu").on("click", "a.menu_item", function () { if (currentSystemMenu) { currentSystemMenu.removeClass("menu_item_active"); } currentSystemMenu = $(this); currentSystemMenu.addClass("menu_item_active"); }); } function initInnerMsg() { var wrapper = $('#topbar_innermsg'); innerMsgPanel = wrapper.find('div.topbar-msg-panel'); innerMsgContainer = wrapper.find('ul.topbar-msg'); innerMsgNum = wrapper.find('span.topbar-btn-msg-num'); btn = wrapper.find('a.topbar-btn'); btn.on('mouseover', function () { btn.addClass('topbar-btn-active'); }).on('mouseleave', function () { btn.removeClass('topbar-btn-active'); }); innerMsgPanel.on('mouseover', function () { btn.addClass('topbar-btn-active'); }).on('mouseleave', function () { btn.removeClass('topbar-btn-active'); }); innerMsgContainer.on('click', 'a.topbar-msg-item', function () { var self = $(this), id = self.data('id'); Desktop.tabs.add('_panel_innermsg_' + id, self.data('title'), '/innermsg/details/' + id); }); //loadInnerMsg(); } function loadInnerMsg() { $.ajax({ url: '/innermsg/getlist', cache: false, data: { isread: false, pageindex: 1, pagesize: 5 }, dataType: 'json', success: function (res) { if (res.total > 0) { innerMsgNum.text(res.total).css('display', 'inline-block'); var tmpl = $.templates(innerMsgTemplate); var html = tmpl.render(res.rows); innerMsgContainer.html(html); } else { innerMsgNum.text('0').css('display', 'none'); innerMsgContainer.html('
        • 暂无未读消息
        • '); } setTimeout(loadInnerMsg, 30 * 1000); } }); } return init(), {}; }(); /* * extend Desktop */ $.extend(Desktop, { tabs: function () { var $tabs; function init() { $tabs = $("#global_tabs").tabs({ fit: true, border: false, tools: [{ iconCls: 'icon-reload', handler: function () { var tab = $tabs.tabs("getSelected"); //if (tab) { // tab.panel('refresh'); //} tab.find('iframe')[0].contentWindow.location.reload(true); } }] }); } function add(id, title, href, options) { var $tab = $tabs.tabs("getTab", id); if ($tab) { var tabOpt = $tab.panel("options"); var index = $tabs.tabs("getTabIndex", $tab); $tabs.tabs("select", index); //if (href != tabOpt.href) { // $tab.panel('refresh', href); //} } else { var newTab = ''.format(href); options = $.extend({ id: id, title: title, //href: href, content: newTab, closable: true }, options); $tabs.tabs("add", options); } } return init(), { "add": add }; }(), dialog: function () { var defaults = { modal: true, cache: false, closed: true }; var $dialog; function init() { $dialog = $('').appendTo("body"); } function open(options, id) { options = $.extend({}, defaults, { closed: false, content: null, openerGrid: null }, options); if (!id || !id.length) { $dialog.dialog(options).dialog("center"); } else { var dialogId = id; if (!dialogId.startsWith("#")) { dialogId = "#" + id; } var $dlg = $(dialogId); if (!$dlg.length) { $dlg = $('
          ').attr("id", id).appendTo("body"); } $dlg.dialog(options).dialog("center"); } } function close(id) { if (!id) { $dialog.dialog("close"); } else { if (!id.startsWith("#")) { id = "#" + id; } $(id).dialog("close"); } } function refresh(url) { $dialog.dialog('refresh', url); } function options() { return $dialog.dialog("options"); } function reloadOpenerGrid() { var options = $dialog.dialog("options"); if (options.openerGrid) { if (!options.openerGrid.startsWith("#")) { options.openerGrid = "#" + options.openerGrid; } $(options.openerGrid).datagrid("reload"); } } return init(), { "open": open, "close": close, "refresh": refresh, "options": options, "reloadOpenerGrid": reloadOpenerGrid }; }(), searchGrid: function (gridId) { var $wrapper = $(this).closest("div.search_wrapper"); if (!$wrapper || !$wrapper.length) { return; } var params = $wrapper.getValues(); $(gridId).datagrid("load", params); }, export: function (searchContainer, formId, url) { var params = $(searchContainer).getValues(); for (key in params) { if ($.isArray(params[key])) { params[key] = params[key].join(','); } } var $form = $('#' + formId); if (!$form.length) { $form = $('
          ').appendTo('body'); } $form.form('submit', { iframe: true, url: url, queryParams: params }); } }); ================================================ FILE: src/Coldairarrow.Web/Scripts/typings/jquery/jquery.d.ts ================================================ // Type definitions for jQuery 1.10.x / 2.0.x // Project: http://jquery.com/ // Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly , Dick van den Brink // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /** * Interface for the AJAX setting that will configure the AJAX request */ interface JQueryAjaxSettings { /** * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. */ accepts?: any; /** * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). */ async?: boolean; /** * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. */ beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; /** * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. */ cache?: boolean; /** * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. */ complete? (jqXHR: JQueryXHR, textStatus: string): any; /** * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) */ contents?: { [key: string]: any; }; //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/742 /** * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. */ contentType?: any; /** * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). */ context?: any; /** * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5) */ converters?: { [key: string]: any; }; /** * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5) */ crossDomain?: boolean; /** * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). */ data?: any; /** * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. */ dataFilter? (data: any, ty: any): any; /** * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). */ dataType?: string; /** * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. */ error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; /** * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. */ global?: boolean; /** * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) */ headers?: { [key: string]: any; }; /** * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. */ ifModified?: boolean; /** * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1) */ isLocal?: boolean; /** * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } */ jsonp?: any; /** * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. */ jsonpCallback?: any; /** * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0) */ method?: string; /** * A mime type to override the XHR mime type. (version added: 1.5.1) */ mimeType?: string; /** * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. */ password?: string; /** * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. */ processData?: boolean; /** * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. */ scriptCharset?: string; /** * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5) */ statusCode?: { [key: string]: any; }; /** * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. */ success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; /** * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. */ timeout?: number; /** * Set this to true if you wish to use the traditional style of param serialization. */ traditional?: boolean; /** * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. */ type?: string; /** * A string containing the URL to which the request is sent. */ url?: string; /** * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. */ username?: string; /** * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. */ xhr?: any; /** * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1) */ xhrFields?: { [key: string]: any; }; } /** * Interface for the jqXHR object */ interface JQueryXHR extends XMLHttpRequest, JQueryPromise { /** * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). */ overrideMimeType(mimeType: string): any; /** * Cancel the request. * * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" */ abort(statusText?: string): void; /** * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. */ then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => R, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; /** * Property containing the parsed response if the response Content-Type is json */ responseJSON?: any; /** * A function to be called if the request fails. */ error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void; } /** * Interface for the JQuery callback */ interface JQueryCallback { /** * Add a callback or a collection of callbacks to a callback list. * * @param callbacks A function, or array of functions, that are to be added to the callback list. */ add(callbacks: Function): JQueryCallback; /** * Add a callback or a collection of callbacks to a callback list. * * @param callbacks A function, or array of functions, that are to be added to the callback list. */ add(callbacks: Function[]): JQueryCallback; /** * Disable a callback list from doing anything more. */ disable(): JQueryCallback; /** * Determine if the callbacks list has been disabled. */ disabled(): boolean; /** * Remove all of the callbacks from a list. */ empty(): JQueryCallback; /** * Call all of the callbacks with the given arguments * * @param arguments The argument or list of arguments to pass back to the callback list. */ fire(...arguments: any[]): JQueryCallback; /** * Determine if the callbacks have already been called at least once. */ fired(): boolean; /** * Call all callbacks in a list with the given context and arguments. * * @param context A reference to the context in which the callbacks in the list should be fired. * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. */ fireWith(context?: any, args?: any[]): JQueryCallback; /** * Determine whether a supplied callback is in a list * * @param callback The callback to search for. */ has(callback: Function): boolean; /** * Lock a callback list in its current state. */ lock(): JQueryCallback; /** * Determine if the callbacks list has been locked. */ locked(): boolean; /** * Remove a callback or a collection of callbacks from a callback list. * * @param callbacks A function, or array of functions, that are to be removed from the callback list. */ remove(callbacks: Function): JQueryCallback; /** * Remove a callback or a collection of callbacks from a callback list. * * @param callbacks A function, or array of functions, that are to be removed from the callback list. */ remove(callbacks: Function[]): JQueryCallback; } /** * Allows jQuery Promises to interop with non-jQuery promises */ interface JQueryGenericPromise { /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter A function that is called when the Deferred is resolved. * @param failFilter An optional function that is called when the Deferred is rejected. */ then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. * * @param doneFilter A function that is called when the Deferred is resolved. * @param failFilter An optional function that is called when the Deferred is rejected. */ then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; } /** * Interface for the JQuery promise/deferred callbacks */ interface JQueryPromiseCallback { (value?: T, ...args: any[]): void; } interface JQueryPromiseOperator { (callback1: JQueryPromiseCallback|JQueryPromiseCallback[], ...callbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; } /** * Interface for the JQuery promise, part of callbacks */ interface JQueryPromise extends JQueryGenericPromise { /** * Determine the current state of a Deferred object. */ state(): string; /** * Add handlers to be called when the Deferred object is either resolved or rejected. * * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. */ always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; /** * Add handlers to be called when the Deferred object is resolved. * * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; /** * Add handlers to be called when the Deferred object is rejected. * * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. */ fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; /** * Add handlers to be called when the Deferred object generates progress notifications. * * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. */ progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; // Deprecated - given no typings pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; /** * Return a Deferred's Promise object. * * @param target Object onto which the promise methods have to be attached */ promise(target?: any): JQueryPromise; } /** * Interface for the JQuery deferred, part of callbacks */ interface JQueryDeferred extends JQueryGenericPromise { /** * Determine the current state of a Deferred object. */ state(): string; /** * Add handlers to be called when the Deferred object is either resolved or rejected. * * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. */ always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; /** * Add handlers to be called when the Deferred object is resolved. * * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; /** * Add handlers to be called when the Deferred object is rejected. * * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. */ fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; /** * Add handlers to be called when the Deferred object generates progress notifications. * * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. */ progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; /** * Call the progressCallbacks on a Deferred object with the given args. * * @param args Optional arguments that are passed to the progressCallbacks. */ notify(value?: any, ...args: any[]): JQueryDeferred; /** * Call the progressCallbacks on a Deferred object with the given context and args. * * @param context Context passed to the progressCallbacks as the this object. * @param args Optional arguments that are passed to the progressCallbacks. */ notifyWith(context: any, value?: any[]): JQueryDeferred; /** * Reject a Deferred object and call any failCallbacks with the given args. * * @param args Optional arguments that are passed to the failCallbacks. */ reject(value?: any, ...args: any[]): JQueryDeferred; /** * Reject a Deferred object and call any failCallbacks with the given context and args. * * @param context Context passed to the failCallbacks as the this object. * @param args An optional array of arguments that are passed to the failCallbacks. */ rejectWith(context: any, value?: any[]): JQueryDeferred; /** * Resolve a Deferred object and call any doneCallbacks with the given args. * * @param value First argument passed to doneCallbacks. * @param args Optional subsequent arguments that are passed to the doneCallbacks. */ resolve(value?: T, ...args: any[]): JQueryDeferred; /** * Resolve a Deferred object and call any doneCallbacks with the given context and args. * * @param context Context passed to the doneCallbacks as the this object. * @param args An optional array of arguments that are passed to the doneCallbacks. */ resolveWith(context: any, value?: T[]): JQueryDeferred; /** * Return a Deferred's Promise object. * * @param target Object onto which the promise methods have to be attached */ promise(target?: any): JQueryPromise; // Deprecated - given no typings pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; } /** * Interface of the JQuery extension of the W3C event object */ interface BaseJQueryEventObject extends Event { currentTarget: Element; data: any; delegateTarget: Element; isDefaultPrevented(): boolean; isImmediatePropagationStopped(): boolean; isPropagationStopped(): boolean; namespace: string; originalEvent: Event; preventDefault(): any; relatedTarget: Element; result: any; stopImmediatePropagation(): void; stopPropagation(): void; target: Element; pageX: number; pageY: number; which: number; metaKey: boolean; } interface JQueryInputEventObject extends BaseJQueryEventObject { altKey: boolean; ctrlKey: boolean; metaKey: boolean; shiftKey: boolean; } interface JQueryMouseEventObject extends JQueryInputEventObject { button: number; clientX: number; clientY: number; offsetX: number; offsetY: number; pageX: number; pageY: number; screenX: number; screenY: number; } interface JQueryKeyEventObject extends JQueryInputEventObject { char: any; charCode: number; key: any; keyCode: number; } interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ } /* Collection of properties of the current browser */ interface JQuerySupport { ajax?: boolean; boxModel?: boolean; changeBubbles?: boolean; checkClone?: boolean; checkOn?: boolean; cors?: boolean; cssFloat?: boolean; hrefNormalized?: boolean; htmlSerialize?: boolean; leadingWhitespace?: boolean; noCloneChecked?: boolean; noCloneEvent?: boolean; opacity?: boolean; optDisabled?: boolean; optSelected?: boolean; scriptEval? (): boolean; style?: boolean; submitBubbles?: boolean; tbody?: boolean; } interface JQueryParam { /** * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. * * @param obj An array or object to serialize. */ (obj: any): string; /** * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. * * @param obj An array or object to serialize. * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. */ (obj: any, traditional: boolean): string; } /** * The interface used to construct jQuery events (with $.Event). It is * defined separately instead of inline in JQueryStatic to allow * overriding the construction function with specific strings * returning specific event objects. */ interface JQueryEventConstructor { (name: string, eventProperties?: any): JQueryEventObject; new (name: string, eventProperties?: any): JQueryEventObject; } /** * The interface used to specify coordinates. */ interface JQueryCoordinates { left: number; top: number; } /** * Elements in the array returned by serializeArray() */ interface JQuerySerializeArrayElement { name: string; value: string; } interface JQueryAnimationOptions { /** * A string or number determining how long the animation will run. */ duration?: any; /** * A string indicating which easing function to use for the transition. */ easing?: string; /** * A function to call once the animation is complete. */ complete?: Function; /** * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. */ step?: (now: number, tween: any) => any; /** * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) */ progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; /** * A function to call when the animation begins. (version added: 1.8) */ start?: (animation: JQueryPromise) => any; /** * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) */ done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; /** * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) */ fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; /** * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) */ always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; /** * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. */ queue?: any; /** * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) */ specialEasing?: Object; } interface JQueryEasingFunction { ( percent: number ): number; } interface JQueryEasingFunctions { [ name: string ]: JQueryEasingFunction; linear: JQueryEasingFunction; swing: JQueryEasingFunction; } /** * Static members of jQuery (those on $ and jQuery themselves) */ interface JQueryStatic { /** * Perform an asynchronous HTTP (Ajax) request. * * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). */ ajax(settings: JQueryAjaxSettings): JQueryXHR; /** * Perform an asynchronous HTTP (Ajax) request. * * @param url A string containing the URL to which the request is sent. * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). */ ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; /** * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). * * @param dataTypes An optional string containing one or more space-separated dataTypes * @param handler A handler to set default values for future Ajax requests. */ ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; /** * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). * * @param handler A handler to set default values for future Ajax requests. */ ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; ajaxSettings: JQueryAjaxSettings; /** * Set default values for future Ajax requests. Its use is not recommended. * * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. */ ajaxSetup(options: JQueryAjaxSettings): void; /** * Load data from the server using a HTTP GET request. * * @param url A string containing the URL to which the request is sent. * @param success A callback function that is executed if the request succeeds. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). */ get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load data from the server using a HTTP GET request. * * @param url A string containing the URL to which the request is sent. * @param data A plain object or string that is sent to the server with the request. * @param success A callback function that is executed if the request succeeds. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). */ get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load data from the server using a HTTP GET request. * * @param settings The JQueryAjaxSettings to be used for the request */ get(settings : JQueryAjaxSettings): JQueryXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * * @param url A string containing the URL to which the request is sent. * @param success A callback function that is executed if the request succeeds. */ getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * * @param url A string containing the URL to which the request is sent. * @param data A plain object or string that is sent to the server with the request. * @param success A callback function that is executed if the request succeeds. */ getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; /** * Load a JavaScript file from the server using a GET HTTP request, then execute it. * * @param url A string containing the URL to which the request is sent. * @param success A callback function that is executed if the request succeeds. */ getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; /** * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. */ param: JQueryParam; /** * Load data from the server using a HTTP POST request. * * @param url A string containing the URL to which the request is sent. * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). */ post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load data from the server using a HTTP POST request. * * @param url A string containing the URL to which the request is sent. * @param data A plain object or string that is sent to the server with the request. * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). */ post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load data from the server using a HTTP POST request. * * @param settings The JQueryAjaxSettings to be used for the request */ post(settings : JQueryAjaxSettings): JQueryXHR; /** * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. * * @param flags An optional list of space-separated flags that change how the callback list behaves. */ Callbacks(flags?: string): JQueryCallback; /** * Holds or releases the execution of jQuery's ready event. * * @param hold Indicates whether the ready hold is being requested or released */ holdReady(hold: boolean): void; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param selector A string containing a selector expression * @param context A DOM Element, Document, or jQuery to use as context */ (selector: string, context?: Element|JQuery): JQuery; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param element A DOM element to wrap in a jQuery object. */ (element: Element): JQuery; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. */ (elementArray: Element[]): JQuery; /** * Binds a function to be executed when the DOM has finished loading. * * @param callback A function to execute after the DOM is ready. */ (callback: (jQueryAlias?: JQueryStatic) => any): JQuery; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param object A plain object to wrap in a jQuery object. */ (object: {}): JQuery; /** * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param object An existing jQuery object to clone. */ (object: JQuery): JQuery; /** * Specify a function to execute when the DOM is fully loaded. */ (): JQuery; /** * Creates DOM elements on the fly from the provided string of raw HTML. * * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. * @param ownerDocument A document in which the new elements will be created. */ (html: string, ownerDocument?: Document): JQuery; /** * Creates DOM elements on the fly from the provided string of raw HTML. * * @param html A string defining a single, standalone, HTML element (e.g.
          or
          ). * @param attributes An object of attributes, events, and methods to call on the newly-created element. */ (html: string, attributes: Object): JQuery; /** * Relinquish jQuery's control of the $ variable. * * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). */ noConflict(removeAll?: boolean): JQueryStatic; /** * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. * * @param deferreds One or more Deferred objects, or plain JavaScript objects. */ when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; /** * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. */ cssHooks: { [key: string]: any; }; cssNumber: any; /** * Store arbitrary data associated with the specified element. Returns the value that was set. * * @param element The DOM element to associate with the data. * @param key A string naming the piece of data to set. * @param value The new data value. */ data(element: Element, key: string, value: T): T; /** * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. * * @param element The DOM element to associate with the data. * @param key A string naming the piece of data to set. */ data(element: Element, key: string): any; /** * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. * * @param element The DOM element to associate with the data. */ data(element: Element): any; /** * Execute the next function on the queue for the matched element. * * @param element A DOM element from which to remove and execute a queued function. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. */ dequeue(element: Element, queueName?: string): void; /** * Determine whether an element has any jQuery data associated with it. * * @param element A DOM element to be checked for data. */ hasData(element: Element): boolean; /** * Show the queue of functions to be executed on the matched element. * * @param element A DOM element to inspect for an attached queue. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. */ queue(element: Element, queueName?: string): any[]; /** * Manipulate the queue of functions to be executed on the matched element. * * @param element A DOM element where the array of queued functions is attached. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param newQueue An array of functions to replace the current queue contents. */ queue(element: Element, queueName: string, newQueue: Function[]): JQuery; /** * Manipulate the queue of functions to be executed on the matched element. * * @param element A DOM element on which to add a queued function. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param callback The new function to add to the queue. */ queue(element: Element, queueName: string, callback: Function): JQuery; /** * Remove a previously-stored piece of data. * * @param element A DOM element from which to remove data. * @param name A string naming the piece of data to remove. */ removeData(element: Element, name?: string): JQuery; /** * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. * * @param beforeStart A function that is called just before the constructor returns. */ Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred; /** * Effects */ easing: JQueryEasingFunctions; fx: { tick: () => void; /** * The rate (in milliseconds) at which animations fire. */ interval: number; stop: () => void; speeds: { slow: number; fast: number; }; /** * Globally disable all animations. */ off: boolean; step: any; }; /** * Takes a function and returns a new one that will always have a particular context. * * @param fnction The function whose context will be changed. * @param context The object to which the context (this) of the function should be set. * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. */ proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; /** * Takes a function and returns a new one that will always have a particular context. * * @param context The object to which the context (this) of the function should be set. * @param name The name of the function whose context will be changed (should be a property of the context object). * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. */ proxy(context: Object, name: string, ...additionalArguments: any[]): any; Event: JQueryEventConstructor; /** * Takes a string and throws an exception containing it. * * @param message The message to send out. */ error(message: any): JQuery; expr: any; fn: any; //TODO: Decide how we want to type this isReady: boolean; // Properties support: JQuerySupport; /** * Check to see if a DOM element is a descendant of another DOM element. * * @param container The DOM element that may contain the other element. * @param contained The DOM element that may be contained by (a descendant of) the other element. */ contains(container: Element, contained: Element): boolean; /** * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. * * @param collection The object or array to iterate over. * @param callback The function that will be executed on every object. */ each( collection: T[], callback: (indexInArray: number, valueOfElement: T) => any ): any; /** * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. * * @param collection The object or array to iterate over. * @param callback The function that will be executed on every object. */ each( collection: any, callback: (indexInArray: any, valueOfElement: any) => any ): any; /** * Merge the contents of two or more objects together into the first object. * * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. * @param object1 An object containing additional properties to merge in. * @param objectN Additional objects containing properties to merge in. */ extend(target: any, object1?: any, ...objectN: any[]): any; /** * Merge the contents of two or more objects together into the first object. * * @param deep If true, the merge becomes recursive (aka. deep copy). * @param target The object to extend. It will receive the new properties. * @param object1 An object containing additional properties to merge in. * @param objectN Additional objects containing properties to merge in. */ extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; /** * Execute some JavaScript code globally. * * @param code The JavaScript code to execute. */ globalEval(code: string): any; /** * Finds the elements of an array which satisfy a filter function. The original array is not affected. * * @param array The array to search through. * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. */ grep(array: T[], func: (elementOfArray?: T, indexInArray?: number) => boolean, invert?: boolean): T[]; /** * Search for a specified value within an array and return its index (or -1 if not found). * * @param value The value to search for. * @param array An array through which to search. * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array. */ inArray(value: T, array: T[], fromIndex?: number): number; /** * Determine whether the argument is an array. * * @param obj Object to test whether or not it is an array. */ isArray(obj: any): boolean; /** * Check to see if an object is empty (contains no enumerable properties). * * @param obj The object that will be checked to see if it's empty. */ isEmptyObject(obj: any): boolean; /** * Determine if the argument passed is a Javascript function object. * * @param obj Object to test whether or not it is a function. */ isFunction(obj: any): boolean; /** * Determines whether its argument is a number. * * @param obj The value to be tested. */ isNumeric(value: any): boolean; /** * Check to see if an object is a plain object (created using "{}" or "new Object"). * * @param obj The object that will be checked to see if it's a plain object. */ isPlainObject(obj: any): boolean; /** * Determine whether the argument is a window. * * @param obj Object to test whether or not it is a window. */ isWindow(obj: any): boolean; /** * Check to see if a DOM node is within an XML document (or is an XML document). * * @param node he DOM node that will be checked to see if it's in an XML document. */ isXMLDoc(node: Node): boolean; /** * Convert an array-like object into a true JavaScript array. * * @param obj Any object to turn into a native Array. */ makeArray(obj: any): any[]; /** * Translate all items in an array or object to new array of items. * * @param array The Array to translate. * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. */ map(array: T[], callback: (elementOfArray?: T, indexInArray?: number) => U): U[]; /** * Translate all items in an array or object to new array of items. * * @param arrayOrObject The Array or Object to translate. * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. */ map(arrayOrObject: any, callback: (value?: any, indexOrKey?: any) => any): any; /** * Merge the contents of two arrays together into the first array. * * @param first The first array to merge, the elements of second added. * @param second The second array to merge into the first, unaltered. */ merge(first: T[], second: T[]): T[]; /** * An empty function. */ noop(): any; /** * Return a number representing the current time. */ now(): number; /** * Takes a well-formed JSON string and returns the resulting JavaScript object. * * @param json The JSON string to parse. */ parseJSON(json: string): any; /** * Parses a string into an XML document. * * @param data a well-formed XML string to be parsed */ parseXML(data: string): XMLDocument; /** * Remove the whitespace from the beginning and end of a string. * * @param str Remove the whitespace from the beginning and end of a string. */ trim(str: string): string; /** * Determine the internal JavaScript [[Class]] of an object. * * @param obj Object to get the internal JavaScript [[Class]] of. */ type(obj: any): string; /** * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. * * @param array The Array of DOM elements. */ unique(array: Element[]): Element[]; /** * Parses a string into an array of DOM nodes. * * @param data HTML string to be parsed * @param context DOM element to serve as the context in which the HTML fragment will be created * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string */ parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; /** * Parses a string into an array of DOM nodes. * * @param data HTML string to be parsed * @param context DOM element to serve as the context in which the HTML fragment will be created * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string */ parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; } /** * The jQuery instance members */ interface JQuery { /** * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. * * @param handler The function to be invoked. */ ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; /** * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. * * @param handler The function to be invoked. */ ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; /** * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. * * @param handler The function to be invoked. */ ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; /** * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. * * @param handler The function to be invoked. */ ajaxStart(handler: () => any): JQuery; /** * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. * * @param handler The function to be invoked. */ ajaxStop(handler: () => any): JQuery; /** * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. * * @param handler The function to be invoked. */ ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; /** * Load data from the server and place the returned HTML into the matched element. * * @param url A string containing the URL to which the request is sent. * @param data A plain object or string that is sent to the server with the request. * @param complete A callback function that is executed when the request completes. */ load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; /** * Encode a set of form elements as a string for submission. */ serialize(): string; /** * Encode a set of form elements as an array of names and values. */ serializeArray(): JQuerySerializeArrayElement[]; /** * Adds the specified class(es) to each of the set of matched elements. * * @param className One or more space-separated classes to be added to the class attribute of each matched element. */ addClass(className: string): JQuery; /** * Adds the specified class(es) to each of the set of matched elements. * * @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. */ addClass(func: (index: number, className: string) => string): JQuery; /** * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. */ addBack(selector?: string): JQuery; /** * Get the value of an attribute for the first element in the set of matched elements. * * @param attributeName The name of the attribute to get. */ attr(attributeName: string): string; /** * Set one or more attributes for the set of matched elements. * * @param attributeName The name of the attribute to set. * @param value A value to set for the attribute. */ attr(attributeName: string, value: string|number): JQuery; /** * Set one or more attributes for the set of matched elements. * * @param attributeName The name of the attribute to set. * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. */ attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; /** * Set one or more attributes for the set of matched elements. * * @param attributes An object of attribute-value pairs to set. */ attr(attributes: Object): JQuery; /** * Determine whether any of the matched elements are assigned the given class. * * @param className The class name to search for. */ hasClass(className: string): boolean; /** * Get the HTML contents of the first element in the set of matched elements. */ html(): string; /** * Set the HTML contents of each element in the set of matched elements. * * @param htmlString A string of HTML to set as the content of each matched element. */ html(htmlString: string): JQuery; /** * Set the HTML contents of each element in the set of matched elements. * * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. */ html(func: (index: number, oldhtml: string) => string): JQuery; /** * Set the HTML contents of each element in the set of matched elements. * * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. */ /** * Get the value of a property for the first element in the set of matched elements. * * @param propertyName The name of the property to get. */ prop(propertyName: string): any; /** * Set one or more properties for the set of matched elements. * * @param propertyName The name of the property to set. * @param value A value to set for the property. */ prop(propertyName: string, value: string|number|boolean): JQuery; /** * Set one or more properties for the set of matched elements. * * @param properties An object of property-value pairs to set. */ prop(properties: Object): JQuery; /** * Set one or more properties for the set of matched elements. * * @param propertyName The name of the property to set. * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. */ prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; /** * Remove an attribute from each element in the set of matched elements. * * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. */ removeAttr(attributeName: string): JQuery; /** * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. * * @param className One or more space-separated classes to be removed from the class attribute of each matched element. */ removeClass(className?: string): JQuery; /** * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. * * @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. */ removeClass(func: (index: number, className: string) => string): JQuery; /** * Remove a property for the set of matched elements. * * @param propertyName The name of the property to remove. */ removeProp(propertyName: string): JQuery; /** * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. * * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. */ toggleClass(className: string, swtch?: boolean): JQuery; /** * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. * * @param swtch A boolean value to determine whether the class should be added or removed. */ toggleClass(swtch?: boolean): JQuery; /** * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. * * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. * @param swtch A boolean value to determine whether the class should be added or removed. */ toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; /** * Get the current value of the first element in the set of matched elements. */ val(): any; /** * Set the value of each element in the set of matched elements. * * @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked. */ val(value: string|string[]|number): JQuery; /** * Set the value of each element in the set of matched elements. * * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ val(func: (index: number, value: string) => string): JQuery; /** * Get the value of style properties for the first element in the set of matched elements. * * @param propertyName A CSS property. */ css(propertyName: string): string; /** * Set one or more CSS properties for the set of matched elements. * * @param propertyName A CSS property name. * @param value A value to set for the property. */ css(propertyName: string, value: string|number): JQuery; /** * Set one or more CSS properties for the set of matched elements. * * @param propertyName A CSS property name. * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ css(propertyName: string, value: (index: number, value: string) => string|number): JQuery; /** * Set one or more CSS properties for the set of matched elements. * * @param properties An object of property-value pairs to set. */ css(properties: Object): JQuery; /** * Get the current computed height for the first element in the set of matched elements. */ height(): number; /** * Set the CSS height of every matched element. * * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). */ height(value: number|string): JQuery; /** * Set the CSS height of every matched element. * * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. */ height(func: (index: number, height: number) => number|string): JQuery; /** * Get the current computed height for the first element in the set of matched elements, including padding but not border. */ innerHeight(): number; /** * Sets the inner height on elements in the set of matched elements, including padding but not border. * * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ innerHeight(height: number|string): JQuery; /** * Get the current computed width for the first element in the set of matched elements, including padding but not border. */ innerWidth(): number; /** * Sets the inner width on elements in the set of matched elements, including padding but not border. * * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ innerWidth(width: number|string): JQuery; /** * Get the current coordinates of the first element in the set of matched elements, relative to the document. */ offset(): JQueryCoordinates; /** * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. * * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. */ offset(coordinates: JQueryCoordinates): JQuery; /** * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. * * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. */ offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; /** * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. * * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. */ outerHeight(includeMargin?: boolean): number; /** * Sets the outer height on elements in the set of matched elements, including padding and border. * * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ outerHeight(height: number|string): JQuery; /** * Get the current computed width for the first element in the set of matched elements, including padding and border. * * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. */ outerWidth(includeMargin?: boolean): number; /** * Sets the outer width on elements in the set of matched elements, including padding and border. * * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ outerWidth(width: number|string): JQuery; /** * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. */ position(): JQueryCoordinates; /** * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. */ scrollLeft(): number; /** * Set the current horizontal position of the scroll bar for each of the set of matched elements. * * @param value An integer indicating the new position to set the scroll bar to. */ scrollLeft(value: number): JQuery; /** * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. */ scrollTop(): number; /** * Set the current vertical position of the scroll bar for each of the set of matched elements. * * @param value An integer indicating the new position to set the scroll bar to. */ scrollTop(value: number): JQuery; /** * Get the current computed width for the first element in the set of matched elements. */ width(): number; /** * Set the CSS width of each element in the set of matched elements. * * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). */ width(value: number|string): JQuery; /** * Set the CSS width of each element in the set of matched elements. * * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. */ width(func: (index: number, width: number) => number|string): JQuery; /** * Remove from the queue all items that have not yet been run. * * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. */ clearQueue(queueName?: string): JQuery; /** * Store arbitrary data associated with the matched elements. * * @param key A string naming the piece of data to set. * @param value The new data value; it can be any Javascript type including Array or Object. */ data(key: string, value: any): JQuery; /** * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. * * @param key Name of the data stored. */ data(key: string): any; /** * Store arbitrary data associated with the matched elements. * * @param obj An object of key-value pairs of data to update. */ data(obj: { [key: string]: any; }): JQuery; /** * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. */ data(): any; /** * Execute the next function on the queue for the matched elements. * * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. */ dequeue(queueName?: string): JQuery; /** * Remove a previously-stored piece of data. * * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. */ removeData(name: string): JQuery; /** * Remove a previously-stored piece of data. * * @param list An array of strings naming the pieces of data to delete. */ removeData(list: string[]): JQuery; /** * Remove all previously-stored piece of data. */ removeData(): JQuery; /** * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. * * @param type The type of queue that needs to be observed. (default: fx) * @param target Object onto which the promise methods have to be attached */ promise(type?: string, target?: Object): JQueryPromise; /** * Perform a custom animation of a set of CSS properties. * * @param properties An object of CSS properties and values that the animation will move toward. * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ animate(properties: Object, duration?: string|number, complete?: Function): JQuery; /** * Perform a custom animation of a set of CSS properties. * * @param properties An object of CSS properties and values that the animation will move toward. * @param duration A string or number determining how long the animation will run. * @param easing A string indicating which easing function to use for the transition. (default: swing) * @param complete A function to call once the animation is complete. */ animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery; /** * Perform a custom animation of a set of CSS properties. * * @param properties An object of CSS properties and values that the animation will move toward. * @param options A map of additional options to pass to the method. */ animate(properties: Object, options: JQueryAnimationOptions): JQuery; /** * Set a timer to delay execution of subsequent items in the queue. * * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. */ delay(duration: number, queueName?: string): JQuery; /** * Display the matched elements by fading them to opaque. * * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ fadeIn(duration?: number|string, complete?: Function): JQuery; /** * Display the matched elements by fading them to opaque. * * @param duration A string or number determining how long the animation will run. * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery; /** * Display the matched elements by fading them to opaque. * * @param options A map of additional options to pass to the method. */ fadeIn(options: JQueryAnimationOptions): JQuery; /** * Hide the matched elements by fading them to transparent. * * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ fadeOut(duration?: number|string, complete?: Function): JQuery; /** * Hide the matched elements by fading them to transparent. * * @param duration A string or number determining how long the animation will run. * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements by fading them to transparent. * * @param options A map of additional options to pass to the method. */ fadeOut(options: JQueryAnimationOptions): JQuery; /** * Adjust the opacity of the matched elements. * * @param duration A string or number determining how long the animation will run. * @param opacity A number between 0 and 1 denoting the target opacity. * @param complete A function to call once the animation is complete. */ fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery; /** * Adjust the opacity of the matched elements. * * @param duration A string or number determining how long the animation will run. * @param opacity A number between 0 and 1 denoting the target opacity. * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements by animating their opacity. * * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ fadeToggle(duration?: number|string, complete?: Function): JQuery; /** * Display or hide the matched elements by animating their opacity. * * @param duration A string or number determining how long the animation will run. * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements by animating their opacity. * * @param options A map of additional options to pass to the method. */ fadeToggle(options: JQueryAnimationOptions): JQuery; /** * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. * * @param queue The name of the queue in which to stop animations. */ finish(queue?: string): JQuery; /** * Hide the matched elements. * * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ hide(duration?: number|string, complete?: Function): JQuery; /** * Hide the matched elements. * * @param duration A string or number determining how long the animation will run. * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ hide(duration?: number|string, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements. * * @param options A map of additional options to pass to the method. */ hide(options: JQueryAnimationOptions): JQuery; /** * Display the matched elements. * * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ show(duration?: number|string, complete?: Function): JQuery; /** * Display the matched elements. * * @param duration A string or number determining how long the animation will run. * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ show(duration?: number|string, easing?: string, complete?: Function): JQuery; /** * Display the matched elements. * * @param options A map of additional options to pass to the method. */ show(options: JQueryAnimationOptions): JQuery; /** * Display the matched elements with a sliding motion. * * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ slideDown(duration?: number|string, complete?: Function): JQuery; /** * Display the matched elements with a sliding motion. * * @param duration A string or number determining how long the animation will run. * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery; /** * Display the matched elements with a sliding motion. * * @param options A map of additional options to pass to the method. */ slideDown(options: JQueryAnimationOptions): JQuery; /** * Display or hide the matched elements with a sliding motion. * * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ slideToggle(duration?: number|string, complete?: Function): JQuery; /** * Display or hide the matched elements with a sliding motion. * * @param duration A string or number determining how long the animation will run. * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements with a sliding motion. * * @param options A map of additional options to pass to the method. */ slideToggle(options: JQueryAnimationOptions): JQuery; /** * Hide the matched elements with a sliding motion. * * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ slideUp(duration?: number|string, complete?: Function): JQuery; /** * Hide the matched elements with a sliding motion. * * @param duration A string or number determining how long the animation will run. * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery; /** * Hide the matched elements with a sliding motion. * * @param options A map of additional options to pass to the method. */ slideUp(options: JQueryAnimationOptions): JQuery; /** * Stop the currently-running animation on the matched elements. * * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. */ stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; /** * Stop the currently-running animation on the matched elements. * * @param queue The name of the queue in which to stop animations. * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. */ stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; /** * Display or hide the matched elements. * * @param duration A string or number determining how long the animation will run. * @param complete A function to call once the animation is complete. */ toggle(duration?: number|string, complete?: Function): JQuery; /** * Display or hide the matched elements. * * @param duration A string or number determining how long the animation will run. * @param easing A string indicating which easing function to use for the transition. * @param complete A function to call once the animation is complete. */ toggle(duration?: number|string, easing?: string, complete?: Function): JQuery; /** * Display or hide the matched elements. * * @param options A map of additional options to pass to the method. */ toggle(options: JQueryAnimationOptions): JQuery; /** * Display or hide the matched elements. * * @param showOrHide A Boolean indicating whether to show or hide the elements. */ toggle(showOrHide: boolean): JQuery; /** * Attach a handler to an event for the elements. * * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. * * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param handler A function to execute each time the event is triggered. */ bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. * * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param eventData An object containing data that will be passed to the event handler. * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. */ bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; /** * Attach a handler to an event for the elements. * * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. */ bind(eventType: string, preventBubble: boolean): JQuery; /** * Attach a handler to an event for the elements. * * @param events An object containing one or more DOM event types and functions to execute for them. */ bind(events: any): JQuery; /** * Trigger the "blur" event on an element */ blur(): JQuery; /** * Bind an event handler to the "blur" JavaScript event * * @param handler A function to execute each time the event is triggered. */ blur(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "blur" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "change" event on an element. */ change(): JQuery; /** * Bind an event handler to the "change" JavaScript event * * @param handler A function to execute each time the event is triggered. */ change(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "change" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "click" event on an element. */ click(): JQuery; /** * Bind an event handler to the "click" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. */ click(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "click" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "contextmenu" event on an element. */ contextmenu(): JQuery; /** * Bind an event handler to the "contextmenu" JavaScript event. * * @param handler A function to execute when the event is triggered. */ contextmenu(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to the "contextmenu" JavaScript event. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ contextmenu(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "dblclick" event on an element. */ dblclick(): JQuery; /** * Bind an event handler to the "dblclick" JavaScript event * * @param handler A function to execute each time the event is triggered. */ dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "dblclick" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "focus" event on an element. */ focus(): JQuery; /** * Bind an event handler to the "focus" JavaScript event * * @param handler A function to execute each time the event is triggered. */ focus(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "focus" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "focusin" event on an element. */ focusin(): JQuery; /** * Bind an event handler to the "focusin" JavaScript event * * @param handler A function to execute each time the event is triggered. */ focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "focusin" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "focusout" event on an element. */ focusout(): JQuery; /** * Bind an event handler to the "focusout" JavaScript event * * @param handler A function to execute each time the event is triggered. */ focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "focusout" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. * * @param handlerIn A function to execute when the mouse pointer enters the element. * @param handlerOut A function to execute when the mouse pointer leaves the element. */ hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. * * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. */ hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "keydown" event on an element. */ keydown(): JQuery; /** * Bind an event handler to the "keydown" JavaScript event * * @param handler A function to execute each time the event is triggered. */ keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Bind an event handler to the "keydown" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Trigger the "keypress" event on an element. */ keypress(): JQuery; /** * Bind an event handler to the "keypress" JavaScript event * * @param handler A function to execute each time the event is triggered. */ keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Bind an event handler to the "keypress" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Trigger the "keyup" event on an element. */ keyup(): JQuery; /** * Bind an event handler to the "keyup" JavaScript event * * @param handler A function to execute each time the event is triggered. */ keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Bind an event handler to the "keyup" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; /** * Bind an event handler to the "load" JavaScript event. * * @param handler A function to execute when the event is triggered. */ load(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "load" JavaScript event. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "mousedown" event on an element. */ mousedown(): JQuery; /** * Bind an event handler to the "mousedown" JavaScript event. * * @param handler A function to execute when the event is triggered. */ mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to the "mousedown" JavaScript event. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mouseenter" event on an element. */ mouseenter(): JQuery; /** * Bind an event handler to be fired when the mouse enters an element. * * @param handler A function to execute when the event is triggered. */ mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to be fired when the mouse enters an element. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mouseleave" event on an element. */ mouseleave(): JQuery; /** * Bind an event handler to be fired when the mouse leaves an element. * * @param handler A function to execute when the event is triggered. */ mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to be fired when the mouse leaves an element. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mousemove" event on an element. */ mousemove(): JQuery; /** * Bind an event handler to the "mousemove" JavaScript event. * * @param handler A function to execute when the event is triggered. */ mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to the "mousemove" JavaScript event. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mouseout" event on an element. */ mouseout(): JQuery; /** * Bind an event handler to the "mouseout" JavaScript event. * * @param handler A function to execute when the event is triggered. */ mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to the "mouseout" JavaScript event. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mouseover" event on an element. */ mouseover(): JQuery; /** * Bind an event handler to the "mouseover" JavaScript event. * * @param handler A function to execute when the event is triggered. */ mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to the "mouseover" JavaScript event. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Trigger the "mouseup" event on an element. */ mouseup(): JQuery; /** * Bind an event handler to the "mouseup" JavaScript event. * * @param handler A function to execute when the event is triggered. */ mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Bind an event handler to the "mouseup" JavaScript event. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; /** * Remove an event handler. */ off(): JQuery; /** * Remove an event handler. * * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. * @param handler A handler function previously attached for the event(s), or the special value false. */ off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Remove an event handler. * * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". * @param handler A handler function previously attached for the event(s), or the special value false. Takes handler with extra args that can be attached with on(). */ off(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; /** * Remove an event handler. * * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". * @param handler A handler function previously attached for the event(s), or the special value false. */ off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Remove an event handler. * * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. */ off(events: { [key: string]: any; }, selector?: string): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). */ on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param data Data to be passed to the handler in event.data when an event is triggered. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. * @param data Data to be passed to the handler in event.data when an event is triggered. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. * @param data Data to be passed to the handler in event.data when an event occurs. */ on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). * @param data Data to be passed to the handler in event.data when an event occurs. */ on(events: { [key: string]: any; }, data?: any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. * @param handler A function to execute at the time the event is triggered. */ one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. * @param data An object containing data that will be passed to the event handler. * @param handler A function to execute at the time the event is triggered. */ one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. * @param data Data to be passed to the handler in event.data when an event is triggered. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. * @param data Data to be passed to the handler in event.data when an event occurs. */ one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. * * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). * @param data Data to be passed to the handler in event.data when an event occurs. */ one(events: { [key: string]: any; }, data?: any): JQuery; /** * Specify a function to execute when the DOM is fully loaded. * * @param handler A function to execute after the DOM is ready. */ ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery; /** * Trigger the "resize" event on an element. */ resize(): JQuery; /** * Bind an event handler to the "resize" JavaScript event. * * @param handler A function to execute each time the event is triggered. */ resize(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "resize" JavaScript event. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "scroll" event on an element. */ scroll(): JQuery; /** * Bind an event handler to the "scroll" JavaScript event. * * @param handler A function to execute each time the event is triggered. */ scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "scroll" JavaScript event. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "select" event on an element. */ select(): JQuery; /** * Bind an event handler to the "select" JavaScript event. * * @param handler A function to execute each time the event is triggered. */ select(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "select" JavaScript event. * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "submit" event on an element. */ submit(): JQuery; /** * Bind an event handler to the "submit" JavaScript event * * @param handler A function to execute each time the event is triggered. */ submit(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "submit" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. */ submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Execute all handlers and behaviors attached to the matched elements for the given event type. * * @param eventType A string containing a JavaScript event type, such as click or submit. * @param extraParameters Additional parameters to pass along to the event handler. */ trigger(eventType: string, extraParameters?: any[]|Object): JQuery; /** * Execute all handlers and behaviors attached to the matched elements for the given event type. * * @param event A jQuery.Event object. * @param extraParameters Additional parameters to pass along to the event handler. */ trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery; /** * Execute all handlers attached to an element for an event. * * @param eventType A string containing a JavaScript event type, such as click or submit. * @param extraParameters An array of additional parameters to pass along to the event handler. */ triggerHandler(eventType: string, ...extraParameters: any[]): Object; /** * Execute all handlers attached to an element for an event. * * @param event A jQuery.Event object. * @param extraParameters An array of additional parameters to pass along to the event handler. */ triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object; /** * Remove a previously-attached event handler from the elements. * * @param eventType A string containing a JavaScript event type, such as click or submit. * @param handler The function that is to be no longer executed. */ unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Remove a previously-attached event handler from the elements. * * @param eventType A string containing a JavaScript event type, such as click or submit. * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). */ unbind(eventType: string, fls: boolean): JQuery; /** * Remove a previously-attached event handler from the elements. * * @param evt A JavaScript event object as passed to an event handler. */ unbind(evt: any): JQuery; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. */ undelegate(): JQuery; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. * * @param selector A selector which will be used to filter the event results. * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" * @param handler A function to execute at the time the event is triggered. */ undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. * * @param selector A selector which will be used to filter the event results. * @param events An object of one or more event types and previously bound functions to unbind from them. */ undelegate(selector: string, events: Object): JQuery; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. * * @param namespace A string containing a namespace to unbind all events from. */ undelegate(namespace: string): JQuery; /** * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) * * @param handler A function to execute when the event is triggered. */ unload(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) * * @param eventData A plain object of data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10) */ context: Element; jquery: string; /** * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) * * @param handler A function to execute when the event is triggered. */ error(handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) * * @param eventData A plain object of data that will be passed to the event handler. * @param handler A function to execute when the event is triggered. */ error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Add a collection of DOM elements onto the jQuery stack. * * @param elements An array of elements to push onto the stack and make into a new jQuery object. */ pushStack(elements: any[]): JQuery; /** * Add a collection of DOM elements onto the jQuery stack. * * @param elements An array of elements to push onto the stack and make into a new jQuery object. * @param name The name of a jQuery method that generated the array of elements. * @param arguments The arguments that were passed in to the jQuery method (for serialization). */ pushStack(elements: any[], name: string, arguments: any[]): JQuery; /** * Insert content, specified by the parameter, after each element in the set of matched elements. * * param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert after each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. */ after(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, after each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ after(func: (index: number, html: string) => string|Element|JQuery): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. * * param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. */ append(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. */ append(func: (index: number, html: string) => string|Element|JQuery): JQuery; /** * Insert every element in the set of matched elements to the end of the target. * * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. */ appendTo(target: JQuery|any[]|Element|string): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. * * param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert before each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. */ before(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, before each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ before(func: (index: number, html: string) => string|Element|JQuery): JQuery; /** * Create a deep copy of the set of matched elements. * * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). */ clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; /** * Remove the set of matched elements from the DOM. * * param selector A selector expression that filters the set of matched elements to be removed. */ detach(selector?: string): JQuery; /** * Remove all child nodes of the set of matched elements from the DOM. */ empty(): JQuery; /** * Insert every element in the set of matched elements after the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. */ insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; /** * Insert every element in the set of matched elements before the target. * * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. */ insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. * * param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. */ prepend(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery; /** * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. */ prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; /** * Insert every element in the set of matched elements to the beginning of the target. * * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. */ prependTo(target: JQuery|any[]|Element|string): JQuery; /** * Remove the set of matched elements from the DOM. * * @param selector A selector expression that filters the set of matched elements to be removed. */ remove(selector?: string): JQuery; /** * Replace each target element with the set of matched elements. * * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. */ replaceAll(target: JQuery|any[]|Element|string): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. * * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. */ replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; /** * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. * * param func A function that returns content with which to replace the set of matched elements. */ replaceWith(func: () => Element|JQuery): JQuery; /** * Get the combined text contents of each element in the set of matched elements, including their descendants. */ text(): string; /** * Set the content of each element in the set of matched elements to the specified text. * * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. */ text(text: string|number|boolean): JQuery; /** * Set the content of each element in the set of matched elements to the specified text. * * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. */ text(func: (index: number, text: string) => string): JQuery; /** * Retrieve all the elements contained in the jQuery set, as an array. * @name toArray */ toArray(): HTMLElement[]; /** * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. */ unwrap(): JQuery; /** * Wrap an HTML structure around each element in the set of matched elements. * * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ wrap(wrappingElement: JQuery|Element|string): JQuery; /** * Wrap an HTML structure around each element in the set of matched elements. * * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ wrap(func: (index: number) => string|JQuery): JQuery; /** * Wrap an HTML structure around all elements in the set of matched elements. * * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ wrapAll(wrappingElement: JQuery|Element|string): JQuery; wrapAll(func: (index: number) => string): JQuery; /** * Wrap an HTML structure around the content of each element in the set of matched elements. * * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. */ wrapInner(wrappingElement: JQuery|Element|string): JQuery; /** * Wrap an HTML structure around the content of each element in the set of matched elements. * * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ wrapInner(func: (index: number) => string): JQuery; /** * Iterate over a jQuery object, executing a function for each matched element. * * @param func A function to execute for each matched element. */ each(func: (index: number, elem: Element) => any): JQuery; /** * Retrieve one of the elements matched by the jQuery object. * * @param index A zero-based integer indicating which element to retrieve. */ get(index: number): HTMLElement; /** * Retrieve the elements matched by the jQuery object. * @alias toArray */ get(): HTMLElement[]; /** * Search for a given element from among the matched elements. */ index(): number; /** * Search for a given element from among the matched elements. * * @param selector A selector representing a jQuery collection in which to look for an element. */ index(selector: string|JQuery|Element): number; /** * The number of elements in the jQuery object. */ length: number; /** * A selector representing selector passed to jQuery(), if any, when creating the original set. * version deprecated: 1.7, removed: 1.9 */ selector: string; [index: string]: any; [index: number]: HTMLElement; /** * Add elements to the set of matched elements. * * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. */ add(selector: string, context?: Element): JQuery; /** * Add elements to the set of matched elements. * * @param elements One or more elements to add to the set of matched elements. */ add(...elements: Element[]): JQuery; /** * Add elements to the set of matched elements. * * @param html An HTML fragment to add to the set of matched elements. */ add(html: string): JQuery; /** * Add elements to the set of matched elements. * * @param obj An existing jQuery object to add to the set of matched elements. */ add(obj: JQuery): JQuery; /** * Get the children of each element in the set of matched elements, optionally filtered by a selector. * * @param selector A string containing a selector expression to match elements against. */ children(selector?: string): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. * * @param selector A string containing a selector expression to match elements against. */ closest(selector: string): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. * * @param selector A string containing a selector expression to match elements against. * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. */ closest(selector: string, context?: Element): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. * * @param obj A jQuery object to match elements against. */ closest(obj: JQuery): JQuery; /** * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. * * @param element An element to match elements against. */ closest(element: Element): JQuery; /** * Get an array of all the elements and selectors matched against the current element up through the DOM tree. * * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object). * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. */ closest(selectors: any, context?: Element): any[]; /** * Get the children of each element in the set of matched elements, including text and comment nodes. */ contents(): JQuery; /** * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. */ end(): JQuery; /** * Reduce the set of matched elements to the one at the specified index. * * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. * */ eq(index: number): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. * * @param selector A string containing a selector expression to match the current set of elements against. */ filter(selector: string): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. * * @param func A function used as a test for each element in the set. this is the current DOM element. */ filter(func: (index: number, element: Element) => any): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. * * @param element An element to match the current set of elements against. */ filter(element: Element): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. * * @param obj An existing jQuery object to match the current set of elements against. */ filter(obj: JQuery): JQuery; /** * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. * * @param selector A string containing a selector expression to match elements against. */ find(selector: string): JQuery; /** * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. * * @param element An element to match elements against. */ find(element: Element): JQuery; /** * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. * * @param obj A jQuery object to match elements against. */ find(obj: JQuery): JQuery; /** * Reduce the set of matched elements to the first in the set. */ first(): JQuery; /** * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. * * @param selector A string containing a selector expression to match elements against. */ has(selector: string): JQuery; /** * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. * * @param contained A DOM element to match elements against. */ has(contained: Element): JQuery; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. * * @param selector A string containing a selector expression to match elements against. */ is(selector: string): boolean; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. * * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. */ is(func: (index: number, element: Element) => boolean): boolean; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. * * @param obj An existing jQuery object to match the current set of elements against. */ is(obj: JQuery): boolean; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. * * @param elements One or more elements to match the current set of elements against. */ is(elements: any): boolean; /** * Reduce the set of matched elements to the final one in the set. */ last(): JQuery; /** * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. * * @param callback A function object that will be invoked for each element in the current set. */ map(callback: (index: number, domElement: Element) => any): JQuery; /** * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. * * @param selector A string containing a selector expression to match elements against. */ next(selector?: string): JQuery; /** * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. * * @param selector A string containing a selector expression to match elements against. */ nextAll(selector?: string): JQuery; /** * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. * * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. * @param filter A string containing a selector expression to match elements against. */ nextUntil(selector?: string, filter?: string): JQuery; /** * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. * * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements. * @param filter A string containing a selector expression to match elements against. */ nextUntil(element?: Element, filter?: string): JQuery; /** * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. * * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements. * @param filter A string containing a selector expression to match elements against. */ nextUntil(obj?: JQuery, filter?: string): JQuery; /** * Remove elements from the set of matched elements. * * @param selector A string containing a selector expression to match elements against. */ not(selector: string): JQuery; /** * Remove elements from the set of matched elements. * * @param func A function used as a test for each element in the set. this is the current DOM element. */ not(func: (index: number, element: Element) => boolean): JQuery; /** * Remove elements from the set of matched elements. * * @param elements One or more DOM elements to remove from the matched set. */ not(elements: Element|Element[]): JQuery; /** * Remove elements from the set of matched elements. * * @param obj An existing jQuery object to match the current set of elements against. */ not(obj: JQuery): JQuery; /** * Get the closest ancestor element that is positioned. */ offsetParent(): JQuery; /** * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. * * @param selector A string containing a selector expression to match elements against. */ parent(selector?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. * * @param selector A string containing a selector expression to match elements against. */ parents(selector?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. * @param filter A string containing a selector expression to match elements against. */ parentsUntil(selector?: string, filter?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements. * @param filter A string containing a selector expression to match elements against. */ parentsUntil(element?: Element, filter?: string): JQuery; /** * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements. * @param filter A string containing a selector expression to match elements against. */ parentsUntil(obj?: JQuery, filter?: string): JQuery; /** * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. * * @param selector A string containing a selector expression to match elements against. */ prev(selector?: string): JQuery; /** * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. * * @param selector A string containing a selector expression to match elements against. */ prevAll(selector?: string): JQuery; /** * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. * @param filter A string containing a selector expression to match elements against. */ prevUntil(selector?: string, filter?: string): JQuery; /** * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements. * @param filter A string containing a selector expression to match elements against. */ prevUntil(element?: Element, filter?: string): JQuery; /** * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. * * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements. * @param filter A string containing a selector expression to match elements against. */ prevUntil(obj?: JQuery, filter?: string): JQuery; /** * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. * * @param selector A string containing a selector expression to match elements against. */ siblings(selector?: string): JQuery; /** * Reduce the set of matched elements to a subset specified by a range of indices. * * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. */ slice(start: number, end?: number): JQuery; /** * Show the queue of functions to be executed on the matched elements. * * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. */ queue(queueName?: string): any[]; /** * Manipulate the queue of functions to be executed, once for each matched element. * * @param newQueue An array of functions to replace the current queue contents. */ queue(newQueue: Function[]): JQuery; /** * Manipulate the queue of functions to be executed, once for each matched element. * * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. */ queue(callback: Function): JQuery; /** * Manipulate the queue of functions to be executed, once for each matched element. * * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param newQueue An array of functions to replace the current queue contents. */ queue(queueName: string, newQueue: Function[]): JQuery; /** * Manipulate the queue of functions to be executed, once for each matched element. * * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. */ queue(queueName: string, callback: Function): JQuery; } declare module "jquery" { export = $; } declare var jQuery: JQueryStatic; declare var $: JQueryStatic; ================================================ FILE: src/Coldairarrow.Web/Scripts/util/easyui-extend.js ================================================ //打开弹框,传入参数对象 function dialogOpen(options) { var _options = { id: 'dialogDefault', title: '弹框', width: 400, height: 200, content: null, url:'', closed: false, cache: false, modal: true, }; $.extend(_options, options); var height = _options.height.toString(); var width = _options.width.toString(); if (!height.contains('%')) { if (height > $(window).height()) { _options.height = '90%'; } } if (!width.contains('%')) { if (width > $(window).width()) { _options.width = '90%'; } } var id = _options.id; var src = _options.url; var $html = $('#{0}'.format(id)); if ($html.length == 0) $html = $(''.format(id, src)).appendTo("body"); var content = ''.format(src); $html.dialog({ title: _options.title, width: _options.width, height: _options.height, content: content, closed: false, cache: false, modal: true }); } //关闭弹框,dialogId为弹框参数id function dialogClose(dialogId) { $('#' + dialogId).dialog('close'); } //右下角显示消息 function dialogMsg(msg) { $.messager.show({ title: "操作提示", msg: msg, showType: 'slide', timeout: 3000 }); } //弹出警告消息框 function dialogError(msg) { $.messager.alert("操作提示", msg, "error"); } //弹出确认框 function dialogComfirm(msg, succcess, cancel) { var _succcess = succcess || function () { }; var _cancel = cancel || function () { }; $.messager.confirm("操作提示", msg, function (data) { if (data) { _succcess(); } else { _cancel(); } }); } //初始化日期控件为年月 function init_yearMonth(id, value) { var db = $('#' + id); db.datebox({ value: value, width: 100, editable: true, prompt: '选择年月', validType: [], //readonly: false, onShowPanel: function () {//显示日趋选择对象后再触发弹出月份层的事件,初始化时没有生成月份层 span.trigger('click'); //触发click事件弹出月份层 if (!tds) setTimeout(function () {//延时触发获取月份对象,因为上面的事件触发和对象生成有时间间隔 tds = p.find('div.calendar-menu-month-inner td'); tds.click(function (e) { e.stopPropagation(); //禁止冒泡执行easyui给月份绑定的事件 var year = /\d{4}/.exec(span.html())[0]//得到年份 , month = parseInt($(this).attr('abbr'), 10); //月份,这里不需要+1 db.datebox('hidePanel')//隐藏日期对象 .datebox('setValue', year + '-' + month); //设置日期的值 }); }, 0); yearIpt.unbind();//解绑年份输入框中任何事件 $(yearIpt).attr('readonly', true);//年份只读 $(yearIpt).css('border-color', 'white');//边框去掉 }, parser: function (s) { if (!s) return new Date(); var arr = s.split('-'); return new Date(parseInt(arr[0], 10), parseInt(arr[1], 10) - 1, 1); }, formatter: function (d) { return d.getFullYear() + '-' + (d.getMonth() + 1);/*getMonth返回的是0开始的,忘记了。。已修正*/ } }); var p = db.datebox('panel'), //日期选择对象 tds = false, //日期选择对象中月份 aToday = p.find('a.datebox-current'), yearIpt = p.find('input.calendar-menu-year'),//年份输入框 //显示月份层的触发控件 span = aToday.length ? p.find('div.calendar-title span') ://1.3.x版本 p.find('span.calendar-text'); //1.4.x版本 if (aToday.length) {//1.3.x版本,取消Today按钮的click事件,重新绑定新事件设置日期框为今天,防止弹出日期选择面板 aToday.unbind('click').click(function () { var now = new Date(); db.datebox('hidePanel').datebox('setValue', now.getFullYear() + '-' + (now.getMonth() + 1)); }); } } ================================================ FILE: src/Coldairarrow.Web/Scripts/util/framework-util.js ================================================ //搜索表格 function searchGrid(searchBtnObj, gridSelector) { var $wrapper = $(searchBtnObj).closest("div.search_wrapper"); if (!$wrapper || !$wrapper.length) { return; } var params = $wrapper.getValues(); $(gridSelector).datagrid("load", params); } //搜索树表格 function searchTreeGrid(searchBtnObj, gridSelector) { var $wrapper = $(searchBtnObj).closest("div.search_wrapper"); if (!$wrapper || !$wrapper.length) { return; } var params = $wrapper.getValues(); $(gridSelector).treegrid("load", params); } //加载动画 function loading(isLoading) { var loading = true; if (typeof (isLoading) != 'undefined') loading = isLoading; if (loading) { $('
          ') .css({ display: "block", 'z-index': 998, width: "100%", height: '100%' }) .appendTo("body"); $("
          ") .html("加载中,请稍候。。。") .css({ display: "block", 'z-index': 999, left: ($(document.body).outerWidth(true) - 190) / 2, top: ($(window).height() - 45) / 2 }) .appendTo("body"); } else { $("#loadingMask").remove(); $("#loadingMaskMsg").remove(); } } //处理请求返回数据 function accessResJson(resJson) { if (resJson.Success) { dialogMsg('操作成功!'); } else { dialogError('操作失败!详情:{0}'.format(resJson.Msg)); } } //重定向 function redirect(url, param) { if (!url) return; var _param = param || {}; var formId = 'redirectForm' + new Date().getTime(); var formHtml = "
          ".format(formId, url); Object.keys(_param).forEach(function (aProperty) { if (_param[aProperty]) { formHtml += "".format(aProperty, _param[aProperty].toString()); } }); formHtml += '
          '; $(formHtml).appendTo('body'); $('#' + formId).submit(); } //初始化日期控件为年月 function init_yearMonth(id, value) { var db = $('#' + id); db.datebox({ value: value, width: 100, editable: true, prompt: '选择年月', validType: [], //readonly: false, onShowPanel: function () {//显示日趋选择对象后再触发弹出月份层的事件,初始化时没有生成月份层 span.trigger('click'); //触发click事件弹出月份层 if (!tds) setTimeout(function () {//延时触发获取月份对象,因为上面的事件触发和对象生成有时间间隔 tds = p.find('div.calendar-menu-month-inner td'); tds.click(function (e) { e.stopPropagation(); //禁止冒泡执行easyui给月份绑定的事件 var year = /\d{4}/.exec(span.html())[0]//得到年份 , month = parseInt($(this).attr('abbr'), 10); //月份,这里不需要+1 db.datebox('hidePanel')//隐藏日期对象 .datebox('setValue', year + '-' + month); //设置日期的值 }); }, 0); yearIpt.unbind();//解绑年份输入框中任何事件 $(yearIpt).attr('readonly', true);//年份只读 $(yearIpt).css('border-color', 'white');//边框去掉 }, parser: function (s) { if (!s) return new Date(); var arr = s.split('-'); return new Date(parseInt(arr[0], 10), parseInt(arr[1], 10) - 1, 1); }, formatter: function (d) { return d.getFullYear() + '-' + (d.getMonth() + 1);/*getMonth返回的是0开始的,忘记了。。已修正*/ } }); var p = db.datebox('panel'), //日期选择对象 tds = false, //日期选择对象中月份 aToday = p.find('a.datebox-current'), yearIpt = p.find('input.calendar-menu-year'),//年份输入框 //显示月份层的触发控件 span = aToday.length ? p.find('div.calendar-title span') ://1.3.x版本 p.find('span.calendar-text'); //1.4.x版本 if (aToday.length) {//1.3.x版本,取消Today按钮的click事件,重新绑定新事件设置日期框为今天,防止弹出日期选择面板 aToday.unbind('click').click(function () { var now = new Date(); db.datebox('hidePanel').datebox('setValue', now.getFullYear() + '-' + (now.getMonth() + 1)); }); } } //显示大图 function showBigImg(url) { top.dialogOpen({ id: 'ShowBigImg', title: '添加数据', width: 600, height: 600, url: rootUrl + 'Base_SysManage/Common/ShowBigImg?url={0}'.format(url), }); } //获取图片构造的Html function getImgHtml(imgs) { var html = ''; (imgs || '').split(',').forEach(function (item, index) { if (item == '') return; var br = ''; if (index != 0) br = '
          '; html += '{0}'.format(br, item); }); return html; } ================================================ FILE: src/Coldairarrow.Web/Scripts/util/upload-time.js ================================================ /** *上传页面停留时间 *callBack为回调函数,返回参数为停留的毫秒数 * @param {function(number)} callBack */ function uploadTime(callBack) { if (typeof (jQuery) == 'undefined') throw '缺少jQuery引入'; var _startTime = new Date().getTime(); var _callBack = callBack || function () { }; function initObj() { $(function () { document.addEventListener('visibilitychange', function () { var visibilityState = document.visibilityState; if (visibilityState == 'hidden' || visibilityState == 'unloaded') { callBackTime(); } else if (visibilityState == 'visible') { _startTime = new Date().getTime(); } }); //在关闭页面时弹出确认提示窗口 $(window).bind('beforeunload', function () { callBackTime(); }); }); } function callBackTime() { var time = new Date().getTime() - _startTime; _callBack(time); } initObj(); } ================================================ FILE: src/Coldairarrow.Web/Scripts/util/util.js ================================================ //关闭所有jquery AJAX缓存 (function ($) { $.ajaxSetup({ cache: false, //关闭AJAX缓存 dataFilter: function (res, dataType) {//登录失败过滤 try { var resJson = JSON.parse(res); if (resJson.ErrorCode == 1) top.document.location.href = '/Home/Login'; } catch(ex) { } return res; } }); })(jQuery); //获取请求的参数 (function (window) { if (window.request) return; window.request = function (key) { var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)"); var result = window.location.search.substr(1).match(reg); return result ? decodeURIComponent(result[2]) : null; }; })(window); //获取根目录 (function (window) { if (window.getRootPath) return; window.getRootPath = function () { var strFullPath = window.document.location.href; var strPath = window.document.location.pathname; var pos = strFullPath.indexOf(strPath); var prePath = strFullPath.substring(0, pos); return prePath; } })(window); //拓展$.postJSON方法,使用方式和$.getJSON类似,只不过方法改为POST (function ($) { if ($.postJSON) return; $.extend({ postJSON: function (url, param, callBack) { $.ajax({ type: "POST", url: url || "", data: param || {}, dataType: "json", success: callBack || function () { } }); } }); })(jQuery); //拓展String的contains方法 (function () { if (String.prototype.contains) return; String.prototype.contains = function (subStr) { return this.indexOf(subStr) > -1; }; })(); //拓展String的toBlob方法,将base64字符串转为blob对象 (function () { if (String.prototype.toBlob) return; String.prototype.toBlob = function (contentType, sliceSize) { var b64Data = this; contentType = contentType || ''; sliceSize = sliceSize || 512; var byteCharacters = atob(b64Data); var byteArrays = []; for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) { var slice = byteCharacters.slice(offset, offset + sliceSize); var byteNumbers = new Array(slice.length); for (var i = 0; i < slice.length; i++) { byteNumbers[i] = slice.charCodeAt(i); } var byteArray = new Uint8Array(byteNumbers); byteArrays.push(byteArray); } var blob = new Blob(byteArrays, { type: contentType }); return blob; }; })(); //拓展String的toDate方法,将日期字符串转为日期 (function () { if (String.prototype.toDate) return; String.prototype.toDate = function () { var str = this; str = str.replace(/-/g, "/"); return new Date(str); }; })(); //拓展Array的forEach方法,用在某些浏览器没有forEach方法 (function (Array) { if (Array.prototype.forEach) return; Object.defineProperty(Array.prototype, "forEach", { value: function (callback) { var d = this || []; if (!callback) return; for (var i = 0; i < d.length; i++) { var elem = d[i]; callback(elem, i); } }, enumerable: false }); })(Array); //拓展Array的indexOf方法 (function (Array) { if (Array.prototype.indexOf) return; Object.defineProperty(Array.prototype, "indexOf", { value: function (val) { for (var i = 0; i < this.length; i++) { if (this[i] == val) return i; } return -1; }, enumerable: false }); })(Array); //拓展Array的exists方法 (function (Array) { if (Array.prototype.exists) return; Object.defineProperty(Array.prototype, "exists", { value: function (val) { return this.indexOf(val) > -1; }, enumerable: false }); })(Array); //拓展Array的removeItem方法 (function (Array) { if (Array.prototype.removeItem) return; Object.defineProperty(Array.prototype, "removeItem", { value: function (val) { var index = this.indexOf(val); if (index > -1) { this.splice(index, 1); } }, enumerable: false }); })(Array); //日期格式化 (function () { if (Date.prototype.format) return; Date.prototype.format = function (fmt) { //author: meizz var o = { "M+": this.getMonth() + 1, //月份 "d+": this.getDate(), //日 "h+": this.getHours(), //小时 "m+": this.getMinutes(), //分 "s+": this.getSeconds(), //秒 "q+": Math.floor((this.getMonth() + 3) / 3), //季度 "S": this.getMilliseconds() //毫秒 }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); return fmt; }; Date.prototype.addDays = function (d) { this.setDate(this.getDate() + d); }; Date.prototype.addWeeks = function (w) { this.addDays(w * 7); }; Date.prototype.addMonths = function (m) { var d = this.getDate(); this.setMonth(this.getMonth() + m); if (this.getDate() < d) this.setDate(0); }; Date.prototype.addYears = function (y) { var m = this.getMonth(); this.setFullYear(this.getFullYear() + y); if (m < this.getMonth()) { this.setDate(0); } }; })(); //字符串格式化输入 (function () { if (String.prototype.format) return; String.prototype.format = function () { if (arguments.length == 0) return this; for (var s = this, i = 0; i < arguments.length; i++) s = s.replace(new RegExp("\\{" + i + "\\}", "g"), arguments[i]); return s; }; })(); //确保开始时间小于结束时间 (function ($, window) { if (window.checkStartEndDate) return; window.checkStartEndDate = function (startDateId, endDateId) { var startDate = $("#" + startDateId).val(); var endDate = $("#" + endDateId).val(); var _startDate = new Date(startDate); var _endDate = new Date(endDate); if (_startDate > _endDate) { dialogMsg("请输入选择有效的时间(结束时间必须大于或者等于开始时间!)"); return false; } else { return true; } } })(jQuery, window); /*jQuery拓展,绑定input file并转为base64字符串 *使用示例: $('#img').bindImgBase64(function (base64) { $('#img-display').attr('src', base64); }); */ (function ($) { try { if (typeof ($) == "undefined") throw '缺少jQuery'; if ($.prototype.bindImgBase64) return; $.prototype.bindImgBase64 = function (callback) { var _callback = callback || function () { }; var thisElement = this[0]; thisElement.onchange = function () { var img = event.target.files[0]; // 判断是否图片 if (!img) { return; } // 判断图片格式 if (!(img.type.indexOf('image') == 0 && img.type && /\.(?:jpg|jpeg|png|gif|bmp)$/i.test(img.name))) { throw '图片只能是jpg,jpeg,gif,png,bmp'; } var reader = new FileReader(); reader.readAsDataURL(img); reader.onload = function (e) { var imgBase64 = e.target.result; $(thisElement).attr('base64', imgBase64); _callback(imgBase64); } }; }; $.prototype.getImgBase64 = function () { return this.attr('base64'); }; } catch (e) { console.log(e); } })($); //拓展FileReader的readAsBinaryString方法 (function () { try { if (FileReader.prototype.readAsBinaryString) return; FileReader.prototype.readAsBinaryString = function (fileData) { var binary = ""; var pt = this; var reader = new FileReader(); reader.onload = function (e) { var bytes = new Uint8Array(reader.result); var length = bytes.byteLength; for (var i = 0; i < length; i++) binary += String.fromCharCode(bytes[i]); } pt.content = binary; $(pt).trigger('onload'); reader.readAsArrayBuffer(fileData); } } catch (e) { console.log(e); } })(); //拓展文件操作,将文件转为base64 //回调参数为文件base64内容和文件名 (function () { try { if (typeof (jQuery) == 'undefined') throw '缺少jQuery插件'; $.prototype.getFileBase64 = function (callBack) { var _callBack = callBack || function () { }; var file = $(this)[0].files[0]; var reader = new FileReader(); reader.readAsBinaryString(file); reader.onload = function (e) { var bytes = e.target.result; var base64 = btoa(bytes); var fileName = file.name; callBack(base64, fileName); } }; } catch (e) { console.log(e); } })(); //获取元素中所有没有被disabled的name集合 (function () { if (typeof ($) == "undefined") throw '缺少jQuery'; $.prototype.getNames = function () { var nameList = []; $(this).find('[name]').not('[disabled]').each(function (index, element) { var name = $(element).attr('name'); nameList.push(name); }); return nameList; }; })(); //取表单域的所有值 (function ($) { if ($.fn.getValues) return; $.fn.getValues = function (options) { var defaults = { checkbox: 'array', not: [] }; var $container = $(this); options = $.extend({}, defaults, options); function getValues() { var values = {}, ckbFields = []; $container.find(":input[name]").each(function () { var that = $(this), type = (that.attr("type") || '').toLowerCase(), name = that.attr("name"); if (type == 'button' || type == 'submit') return true; if (!name.length) return true; if ($.inArray(name, options.not) >= 0) return true; if (type == "checkbox") { if (values[name] != undefined) { return true; } ckbFields.push(name); values[name] = getCheckboxValues(name); } else if (type == "radio") { if (values[name] != undefined) { return true; } values[name] = getRadioValue(name); } else { var value = that.val(); //if (!value.length) return true; if (values[name] == undefined) { values[name] = value; } else { var arr = []; arr.push(values[name]); arr.push(value); values[name] = arr.join(','); } } }); if (options.checkbox == 'string') { $.each(ckbFields, function (i, v) { if ($.isArray(values[v])) values[v] = values[v].join(','); }); } return values; } function getRadioValue(name) { return $container.find("input:radio[name='" + name + "']").val(); } function getCheckboxValues(name) { return $.map($container.find("input:checkbox[name='" + name + "']:checked"), function (n) { return n.value; }); } return getValues(); }; })(jQuery); //使用文件base64下载文件 (function () { if (window.downloadFileBase64) return; window.downloadFileBase64 = function (base64, fileName) { var blob = base64.toBlob(); var reader = new FileReader(); reader.readAsDataURL(blob); reader.onload = function (e) { // 转换完成,创建一个a标签用于下载 var a = document.createElement('a'); a.hidden = true; a.download = fileName; a.href = e.target.result; $("body").append(a); // 修复firefox中无法触发click a.click(); $(a).remove(); } }; })(); //使用文件Url下载文件 (function () { if (window.downloadFile) return; window.downloadFile = function (url) { var a = document.createElement('a'); a.hidden = true; a.download = ''; a.href = url $("body").append(a); // 修复firefox中无法触发click a.click(); $(a).remove(); }; })(); //拓展window的toDateString方法 (function () { if (window.toDateString) return; window.toDateString = function (date, fmt) { if (date) { return date.toDate().format(fmt); } else { return ''; } }; })(); //拓展window的getType方法 (function () { if (window.getType) return; window.getType = function (obj) { var type = typeof (obj); if (type == 'object') { type = Object.prototype.toString.call(obj); if (type == '[object Array]') { return 'array'; } else if (type == '[object Object]') { return "object"; } else { return 'param is no object type'; } } else { return type; } } })(); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/easy-validate/easy-validate.js ================================================ /** * 简单表单验证插件 * 作者:Coldairarrow * @param {any} selecter */ function easyValidate(selecter) { if (typeof ($) == 'undefined') throw '缺少jQuery插件'; if (typeof (layer) == 'undefined') throw '缺少layer插件'; var _selecter = selecter || document; var _rule = { //不为空 requred: "^.+$", //邮箱 email: "^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$" }; var elementList = $(_selecter).find('[easy-validate]'); var msg = ''; var isValidate = true; elementList.each(function (index, element) { var config = JSON.parse($(element).attr('easy-validate')); var value = $(element).val(); var rule = getRule(config.rule); var regex = new RegExp(rule); if (!regex.test(value)) { msg += config.errormsg + '
          '; isValidate = false; } }); if (!isValidate) top.layer.msg(msg, { icon: 2 }); return isValidate; function getRule(ruleName) { return _rule[ruleName] || ruleName; } } ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/echarts/echarts.js ================================================ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (factory((global.echarts = {}))); }(this, (function (exports) { 'use strict'; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // (1) The code `if (__DEV__) ...` can be removed by build tool. // (2) If intend to use `__DEV__`, this module should be imported. Use a global // variable `__DEV__` may cause that miss the declaration (see #6535), or the // declaration is behind of the using position (for example in `Model.extent`, // And tools like rollup can not analysis the dependency if not import). var dev; // In browser if (typeof window !== 'undefined') { dev = window.__DEV__; } // In node else if (typeof global !== 'undefined') { dev = global.__DEV__; } if (typeof dev === 'undefined') { dev = true; } var __DEV__ = dev; /** * zrender: 生成唯一id * * @author errorrik (errorrik@gmail.com) */ var idStart = 0x0907; var guid = function () { return idStart++; }; /** * echarts设备环境识别 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 * @author firede[firede@firede.us] * @desc thanks zepto. */ var env = {}; if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') { // In Weixin Application env = { browser: {}, os: {}, node: false, wxa: true, // Weixin Application canvasSupported: true, svgSupported: false, touchEventsSupported: true }; } else if (typeof document === 'undefined' && typeof self !== 'undefined') { // In worker env = { browser: {}, os: {}, node: false, worker: true, canvasSupported: true }; } else if (typeof navigator === 'undefined') { // In node env = { browser: {}, os: {}, node: true, worker: false, // Assume canvas is supported canvasSupported: true, svgSupported: true }; } else { env = detect(navigator.userAgent); } var env$1 = env; // Zepto.js // (c) 2010-2013 Thomas Fuchs // Zepto.js may be freely distributed under the MIT license. function detect(ua) { var os = {}; var browser = {}; // var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); // var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); // var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); // var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); // var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/); // var touchpad = webos && ua.match(/TouchPad/); // var kindle = ua.match(/Kindle\/([\d.]+)/); // var silk = ua.match(/Silk\/([\d._]+)/); // var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/); // var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/); // var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/); // var playbook = ua.match(/PlayBook/); // var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/); var firefox = ua.match(/Firefox\/([\d.]+)/); // var safari = webkit && ua.match(/Mobile\//) && !chrome; // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; var ie = ua.match(/MSIE\s([\d.]+)/) // IE 11 Trident/7.0; rv:11.0 || ua.match(/Trident\/.+?rv:(([\d.]+))/); var edge = ua.match(/Edge\/([\d.]+)/); // IE 12 and 12+ var weChat = (/micromessenger/i).test(ua); // Todo: clean this up with a better OS/browser seperation: // - discern (more) between multiple browsers on android // - decide if kindle fire in silk mode is android or not // - Firefox on Android doesn't specify the Android version // - possibly devide in os, device and browser hashes // if (browser.webkit = !!webkit) browser.version = webkit[1]; // if (android) os.android = true, os.version = android[2]; // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.'); // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.'); // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null; // if (webos) os.webos = true, os.version = webos[2]; // if (touchpad) os.touchpad = true; // if (blackberry) os.blackberry = true, os.version = blackberry[2]; // if (bb10) os.bb10 = true, os.version = bb10[2]; // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2]; // if (playbook) browser.playbook = true; // if (kindle) os.kindle = true, os.version = kindle[1]; // if (silk) browser.silk = true, browser.version = silk[1]; // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true; // if (chrome) browser.chrome = true, browser.version = chrome[1]; if (firefox) { browser.firefox = true; browser.version = firefox[1]; } // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true; // if (webview) browser.webview = true; if (ie) { browser.ie = true; browser.version = ie[1]; } if (edge) { browser.edge = true; browser.version = edge[1]; } // It is difficult to detect WeChat in Win Phone precisely, because ua can // not be set on win phone. So we do not consider Win Phone. if (weChat) { browser.weChat = true; } // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) || // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/))); // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\/([\d.]+)/)) || // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/)))); return { browser: browser, os: os, node: false, // 原生canvas支持,改极端点了 // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9) canvasSupported: !!document.createElement('canvas').getContext, svgSupported: typeof SVGRect !== 'undefined', // works on most browsers // IE10/11 does not support touch event, and MS Edge supports them but not by // default, so we dont check navigator.maxTouchPoints for them here. touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge, // . pointerEventsSupported: 'onpointerdown' in window // Firefox supports pointer but not by default, only MS browsers are reliable on pointer // events currently. So we dont use that on other browsers unless tested sufficiently. // Although IE 10 supports pointer event, it use old style and is different from the // standard. So we exclude that. (IE 10 is hardly used on touch device) && (browser.edge || (browser.ie && browser.version >= 11)) // passiveSupported: detectPassiveSupport() }; } // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection // function detectPassiveSupport() { // // Test via a getter in the options object to see if the passive property is accessed // var supportsPassive = false; // try { // var opts = Object.defineProperty({}, 'passive', { // get: function() { // supportsPassive = true; // } // }); // window.addEventListener('testPassive', function() {}, opts); // } catch (e) { // } // return supportsPassive; // } /** * @module zrender/core/util */ // 用于处理merge时无法遍历Date等对象的问题 var BUILTIN_OBJECT = { '[object Function]': 1, '[object RegExp]': 1, '[object Date]': 1, '[object Error]': 1, '[object CanvasGradient]': 1, '[object CanvasPattern]': 1, // For node-canvas '[object Image]': 1, '[object Canvas]': 1 }; var TYPED_ARRAY = { '[object Int8Array]': 1, '[object Uint8Array]': 1, '[object Uint8ClampedArray]': 1, '[object Int16Array]': 1, '[object Uint16Array]': 1, '[object Int32Array]': 1, '[object Uint32Array]': 1, '[object Float32Array]': 1, '[object Float64Array]': 1 }; var objToString = Object.prototype.toString; var arrayProto = Array.prototype; var nativeForEach = arrayProto.forEach; var nativeFilter = arrayProto.filter; var nativeSlice = arrayProto.slice; var nativeMap = arrayProto.map; var nativeReduce = arrayProto.reduce; // Avoid assign to an exported variable, for transforming to cjs. var methods = {}; function $override(name, fn) { // Clear ctx instance for different environment if (name === 'createCanvas') { _ctx = null; } methods[name] = fn; } /** * Those data types can be cloned: * Plain object, Array, TypedArray, number, string, null, undefined. * Those data types will be assgined using the orginal data: * BUILTIN_OBJECT * Instance of user defined class will be cloned to a plain object, without * properties in prototype. * Other data types is not supported (not sure what will happen). * * Caution: do not support clone Date, for performance consideration. * (There might be a large number of date in `series.data`). * So date should not be modified in and out of echarts. * * @param {*} source * @return {*} new */ function clone(source) { if (source == null || typeof source != 'object') { return source; } var result = source; var typeStr = objToString.call(source); if (typeStr === '[object Array]') { if (!isPrimitive(source)) { result = []; for (var i = 0, len = source.length; i < len; i++) { result[i] = clone(source[i]); } } } else if (TYPED_ARRAY[typeStr]) { if (!isPrimitive(source)) { var Ctor = source.constructor; if (source.constructor.from) { result = Ctor.from(source); } else { result = new Ctor(source.length); for (var i = 0, len = source.length; i < len; i++) { result[i] = clone(source[i]); } } } } else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) { result = {}; for (var key in source) { if (source.hasOwnProperty(key)) { result[key] = clone(source[key]); } } } return result; } /** * @memberOf module:zrender/core/util * @param {*} target * @param {*} source * @param {boolean} [overwrite=false] */ function merge(target, source, overwrite) { // We should escapse that source is string // and enter for ... in ... if (!isObject$1(source) || !isObject$1(target)) { return overwrite ? clone(source) : target; } for (var key in source) { if (source.hasOwnProperty(key)) { var targetProp = target[key]; var sourceProp = source[key]; if (isObject$1(sourceProp) && isObject$1(targetProp) && !isArray(sourceProp) && !isArray(targetProp) && !isDom(sourceProp) && !isDom(targetProp) && !isBuiltInObject(sourceProp) && !isBuiltInObject(targetProp) && !isPrimitive(sourceProp) && !isPrimitive(targetProp) ) { // 如果需要递归覆盖,就递归调用merge merge(targetProp, sourceProp, overwrite); } else if (overwrite || !(key in target)) { // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况 // NOTE,在 target[key] 不存在的时候也是直接覆盖 target[key] = clone(source[key], true); } } } return target; } /** * @param {Array} targetAndSources The first item is target, and the rests are source. * @param {boolean} [overwrite=false] * @return {*} target */ function mergeAll(targetAndSources, overwrite) { var result = targetAndSources[0]; for (var i = 1, len = targetAndSources.length; i < len; i++) { result = merge(result, targetAndSources[i], overwrite); } return result; } /** * @param {*} target * @param {*} source * @memberOf module:zrender/core/util */ function extend(target, source) { for (var key in source) { if (source.hasOwnProperty(key)) { target[key] = source[key]; } } return target; } /** * @param {*} target * @param {*} source * @param {boolean} [overlay=false] * @memberOf module:zrender/core/util */ function defaults(target, source, overlay) { for (var key in source) { if (source.hasOwnProperty(key) && (overlay ? source[key] != null : target[key] == null) ) { target[key] = source[key]; } } return target; } var createCanvas = function () { return methods.createCanvas(); }; methods.createCanvas = function () { return document.createElement('canvas'); }; // FIXME var _ctx; function getContext() { if (!_ctx) { // Use util.createCanvas instead of createCanvas // because createCanvas may be overwritten in different environment _ctx = createCanvas().getContext('2d'); } return _ctx; } /** * 查询数组中元素的index * @memberOf module:zrender/core/util */ function indexOf(array, value) { if (array) { if (array.indexOf) { return array.indexOf(value); } for (var i = 0, len = array.length; i < len; i++) { if (array[i] === value) { return i; } } } return -1; } /** * 构造类继承关系 * * @memberOf module:zrender/core/util * @param {Function} clazz 源类 * @param {Function} baseClazz 基类 */ function inherits(clazz, baseClazz) { var clazzPrototype = clazz.prototype; function F() {} F.prototype = baseClazz.prototype; clazz.prototype = new F(); for (var prop in clazzPrototype) { clazz.prototype[prop] = clazzPrototype[prop]; } clazz.prototype.constructor = clazz; clazz.superClass = baseClazz; } /** * @memberOf module:zrender/core/util * @param {Object|Function} target * @param {Object|Function} sorce * @param {boolean} overlay */ function mixin(target, source, overlay) { target = 'prototype' in target ? target.prototype : target; source = 'prototype' in source ? source.prototype : source; defaults(target, source, overlay); } /** * Consider typed array. * @param {Array|TypedArray} data */ function isArrayLike(data) { if (! data) { return; } if (typeof data == 'string') { return false; } return typeof data.length == 'number'; } /** * 数组或对象遍历 * @memberOf module:zrender/core/util * @param {Object|Array} obj * @param {Function} cb * @param {*} [context] */ function each$1(obj, cb, context) { if (!(obj && cb)) { return; } if (obj.forEach && obj.forEach === nativeForEach) { obj.forEach(cb, context); } else if (obj.length === +obj.length) { for (var i = 0, len = obj.length; i < len; i++) { cb.call(context, obj[i], i, obj); } } else { for (var key in obj) { if (obj.hasOwnProperty(key)) { cb.call(context, obj[key], key, obj); } } } } /** * 数组映射 * @memberOf module:zrender/core/util * @param {Array} obj * @param {Function} cb * @param {*} [context] * @return {Array} */ function map(obj, cb, context) { if (!(obj && cb)) { return; } if (obj.map && obj.map === nativeMap) { return obj.map(cb, context); } else { var result = []; for (var i = 0, len = obj.length; i < len; i++) { result.push(cb.call(context, obj[i], i, obj)); } return result; } } /** * @memberOf module:zrender/core/util * @param {Array} obj * @param {Function} cb * @param {Object} [memo] * @param {*} [context] * @return {Array} */ function reduce(obj, cb, memo, context) { if (!(obj && cb)) { return; } if (obj.reduce && obj.reduce === nativeReduce) { return obj.reduce(cb, memo, context); } else { for (var i = 0, len = obj.length; i < len; i++) { memo = cb.call(context, memo, obj[i], i, obj); } return memo; } } /** * 数组过滤 * @memberOf module:zrender/core/util * @param {Array} obj * @param {Function} cb * @param {*} [context] * @return {Array} */ function filter(obj, cb, context) { if (!(obj && cb)) { return; } if (obj.filter && obj.filter === nativeFilter) { return obj.filter(cb, context); } else { var result = []; for (var i = 0, len = obj.length; i < len; i++) { if (cb.call(context, obj[i], i, obj)) { result.push(obj[i]); } } return result; } } /** * 数组项查找 * @memberOf module:zrender/core/util * @param {Array} obj * @param {Function} cb * @param {*} [context] * @return {*} */ function find(obj, cb, context) { if (!(obj && cb)) { return; } for (var i = 0, len = obj.length; i < len; i++) { if (cb.call(context, obj[i], i, obj)) { return obj[i]; } } } /** * @memberOf module:zrender/core/util * @param {Function} func * @param {*} context * @return {Function} */ function bind(func, context) { var args = nativeSlice.call(arguments, 2); return function () { return func.apply(context, args.concat(nativeSlice.call(arguments))); }; } /** * @memberOf module:zrender/core/util * @param {Function} func * @return {Function} */ function curry(func) { var args = nativeSlice.call(arguments, 1); return function () { return func.apply(this, args.concat(nativeSlice.call(arguments))); }; } /** * @memberOf module:zrender/core/util * @param {*} value * @return {boolean} */ function isArray(value) { return objToString.call(value) === '[object Array]'; } /** * @memberOf module:zrender/core/util * @param {*} value * @return {boolean} */ function isFunction$1(value) { return typeof value === 'function'; } /** * @memberOf module:zrender/core/util * @param {*} value * @return {boolean} */ function isString(value) { return objToString.call(value) === '[object String]'; } /** * @memberOf module:zrender/core/util * @param {*} value * @return {boolean} */ function isObject$1(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return type === 'function' || (!!value && type == 'object'); } /** * @memberOf module:zrender/core/util * @param {*} value * @return {boolean} */ function isBuiltInObject(value) { return !!BUILTIN_OBJECT[objToString.call(value)]; } /** * @memberOf module:zrender/core/util * @param {*} value * @return {boolean} */ function isTypedArray(value) { return !!TYPED_ARRAY[objToString.call(value)]; } /** * @memberOf module:zrender/core/util * @param {*} value * @return {boolean} */ function isDom(value) { return typeof value === 'object' && typeof value.nodeType === 'number' && typeof value.ownerDocument === 'object'; } /** * Whether is exactly NaN. Notice isNaN('a') returns true. * @param {*} value * @return {boolean} */ function eqNaN(value) { return value !== value; } /** * If value1 is not null, then return value1, otherwise judget rest of values. * Low performance. * @memberOf module:zrender/core/util * @return {*} Final value */ function retrieve(values) { for (var i = 0, len = arguments.length; i < len; i++) { if (arguments[i] != null) { return arguments[i]; } } } function retrieve2(value0, value1) { return value0 != null ? value0 : value1; } function retrieve3(value0, value1, value2) { return value0 != null ? value0 : value1 != null ? value1 : value2; } /** * @memberOf module:zrender/core/util * @param {Array} arr * @param {number} startIndex * @param {number} endIndex * @return {Array} */ function slice() { return Function.call.apply(nativeSlice, arguments); } /** * Normalize css liked array configuration * e.g. * 3 => [3, 3, 3, 3] * [4, 2] => [4, 2, 4, 2] * [4, 3, 2] => [4, 3, 2, 3] * @param {number|Array.} val * @return {Array.} */ function normalizeCssArray(val) { if (typeof (val) === 'number') { return [val, val, val, val]; } var len = val.length; if (len === 2) { // vertical | horizontal return [val[0], val[1], val[0], val[1]]; } else if (len === 3) { // top | horizontal | bottom return [val[0], val[1], val[2], val[1]]; } return val; } /** * @memberOf module:zrender/core/util * @param {boolean} condition * @param {string} message */ function assert$1(condition, message) { if (!condition) { throw new Error(message); } } /** * @memberOf module:zrender/core/util * @param {string} str string to be trimed * @return {string} trimed string */ function trim(str) { if (str == null) { return null; } else if (typeof str.trim === 'function') { return str.trim(); } else { return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); } } var primitiveKey = '__ec_primitive__'; /** * Set an object as primitive to be ignored traversing children in clone or merge */ function setAsPrimitive(obj) { obj[primitiveKey] = true; } function isPrimitive(obj) { return obj[primitiveKey]; } /** * @constructor * @param {Object} obj Only apply `ownProperty`. */ function HashMap(obj) { var isArr = isArray(obj); var thisMap = this; (obj instanceof HashMap) ? obj.each(visit) : (obj && each$1(obj, visit)); function visit(value, key) { isArr ? thisMap.set(value, key) : thisMap.set(key, value); } } // Add prefix to avoid conflict with Object.prototype. HashMap.prototype = { constructor: HashMap, // Do not provide `has` method to avoid defining what is `has`. // (We usually treat `null` and `undefined` as the same, different // from ES6 Map). get: function (key) { return this.hasOwnProperty(key) ? this[key] : null; }, set: function (key, value) { // Comparing with invocation chaining, `return value` is more commonly // used in this case: `var someVal = map.set('a', genVal());` return (this[key] = value); }, // Although util.each can be performed on this hashMap directly, user // should not use the exposed keys, who are prefixed. each: function (cb, context) { context !== void 0 && (cb = bind(cb, context)); for (var key in this) { this.hasOwnProperty(key) && cb(this[key], key); } }, // Do not use this method if performance sensitive. removeKey: function (key) { delete this[key]; } }; function createHashMap(obj) { return new HashMap(obj); } function concatArray(a, b) { var newArray = new a.constructor(a.length + b.length); for (var i = 0; i < a.length; i++) { newArray[i] = a[i]; } var offset = a.length; for (i = 0; i < b.length; i++) { newArray[i + offset] = b[i]; } return newArray; } function noop() {} var zrUtil = (Object.freeze || Object)({ $override: $override, clone: clone, merge: merge, mergeAll: mergeAll, extend: extend, defaults: defaults, createCanvas: createCanvas, getContext: getContext, indexOf: indexOf, inherits: inherits, mixin: mixin, isArrayLike: isArrayLike, each: each$1, map: map, reduce: reduce, filter: filter, find: find, bind: bind, curry: curry, isArray: isArray, isFunction: isFunction$1, isString: isString, isObject: isObject$1, isBuiltInObject: isBuiltInObject, isTypedArray: isTypedArray, isDom: isDom, eqNaN: eqNaN, retrieve: retrieve, retrieve2: retrieve2, retrieve3: retrieve3, slice: slice, normalizeCssArray: normalizeCssArray, assert: assert$1, trim: trim, setAsPrimitive: setAsPrimitive, isPrimitive: isPrimitive, createHashMap: createHashMap, concatArray: concatArray, noop: noop }); var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; /** * 创建一个向量 * @param {number} [x=0] * @param {number} [y=0] * @return {Vector2} */ function create(x, y) { var out = new ArrayCtor(2); if (x == null) { x = 0; } if (y == null) { y = 0; } out[0] = x; out[1] = y; return out; } /** * 复制向量数据 * @param {Vector2} out * @param {Vector2} v * @return {Vector2} */ function copy(out, v) { out[0] = v[0]; out[1] = v[1]; return out; } /** * 克隆一个向量 * @param {Vector2} v * @return {Vector2} */ function clone$1(v) { var out = new ArrayCtor(2); out[0] = v[0]; out[1] = v[1]; return out; } /** * 设置向量的两个项 * @param {Vector2} out * @param {number} a * @param {number} b * @return {Vector2} 结果 */ function set(out, a, b) { out[0] = a; out[1] = b; return out; } /** * 向量相加 * @param {Vector2} out * @param {Vector2} v1 * @param {Vector2} v2 */ function add(out, v1, v2) { out[0] = v1[0] + v2[0]; out[1] = v1[1] + v2[1]; return out; } /** * 向量缩放后相加 * @param {Vector2} out * @param {Vector2} v1 * @param {Vector2} v2 * @param {number} a */ function scaleAndAdd(out, v1, v2, a) { out[0] = v1[0] + v2[0] * a; out[1] = v1[1] + v2[1] * a; return out; } /** * 向量相减 * @param {Vector2} out * @param {Vector2} v1 * @param {Vector2} v2 */ function sub(out, v1, v2) { out[0] = v1[0] - v2[0]; out[1] = v1[1] - v2[1]; return out; } /** * 向量长度 * @param {Vector2} v * @return {number} */ function len(v) { return Math.sqrt(lenSquare(v)); } var length = len; // jshint ignore:line /** * 向量长度平方 * @param {Vector2} v * @return {number} */ function lenSquare(v) { return v[0] * v[0] + v[1] * v[1]; } var lengthSquare = lenSquare; /** * 向量乘法 * @param {Vector2} out * @param {Vector2} v1 * @param {Vector2} v2 */ function mul(out, v1, v2) { out[0] = v1[0] * v2[0]; out[1] = v1[1] * v2[1]; return out; } /** * 向量除法 * @param {Vector2} out * @param {Vector2} v1 * @param {Vector2} v2 */ function div(out, v1, v2) { out[0] = v1[0] / v2[0]; out[1] = v1[1] / v2[1]; return out; } /** * 向量点乘 * @param {Vector2} v1 * @param {Vector2} v2 * @return {number} */ function dot(v1, v2) { return v1[0] * v2[0] + v1[1] * v2[1]; } /** * 向量缩放 * @param {Vector2} out * @param {Vector2} v * @param {number} s */ function scale(out, v, s) { out[0] = v[0] * s; out[1] = v[1] * s; return out; } /** * 向量归一化 * @param {Vector2} out * @param {Vector2} v */ function normalize(out, v) { var d = len(v); if (d === 0) { out[0] = 0; out[1] = 0; } else { out[0] = v[0] / d; out[1] = v[1] / d; } return out; } /** * 计算向量间距离 * @param {Vector2} v1 * @param {Vector2} v2 * @return {number} */ function distance(v1, v2) { return Math.sqrt( (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]) ); } var dist = distance; /** * 向量距离平方 * @param {Vector2} v1 * @param {Vector2} v2 * @return {number} */ function distanceSquare(v1, v2) { return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]); } var distSquare = distanceSquare; /** * 求负向量 * @param {Vector2} out * @param {Vector2} v */ function negate(out, v) { out[0] = -v[0]; out[1] = -v[1]; return out; } /** * 插值两个点 * @param {Vector2} out * @param {Vector2} v1 * @param {Vector2} v2 * @param {number} t */ function lerp(out, v1, v2, t) { out[0] = v1[0] + t * (v2[0] - v1[0]); out[1] = v1[1] + t * (v2[1] - v1[1]); return out; } /** * 矩阵左乘向量 * @param {Vector2} out * @param {Vector2} v * @param {Vector2} m */ function applyTransform(out, v, m) { var x = v[0]; var y = v[1]; out[0] = m[0] * x + m[2] * y + m[4]; out[1] = m[1] * x + m[3] * y + m[5]; return out; } /** * 求两个向量最小值 * @param {Vector2} out * @param {Vector2} v1 * @param {Vector2} v2 */ function min(out, v1, v2) { out[0] = Math.min(v1[0], v2[0]); out[1] = Math.min(v1[1], v2[1]); return out; } /** * 求两个向量最大值 * @param {Vector2} out * @param {Vector2} v1 * @param {Vector2} v2 */ function max(out, v1, v2) { out[0] = Math.max(v1[0], v2[0]); out[1] = Math.max(v1[1], v2[1]); return out; } var vector = (Object.freeze || Object)({ create: create, copy: copy, clone: clone$1, set: set, add: add, scaleAndAdd: scaleAndAdd, sub: sub, len: len, length: length, lenSquare: lenSquare, lengthSquare: lengthSquare, mul: mul, div: div, dot: dot, scale: scale, normalize: normalize, distance: distance, dist: dist, distanceSquare: distanceSquare, distSquare: distSquare, negate: negate, lerp: lerp, applyTransform: applyTransform, min: min, max: max }); // TODO Draggable for group // FIXME Draggable on element which has parent rotation or scale function Draggable() { this.on('mousedown', this._dragStart, this); this.on('mousemove', this._drag, this); this.on('mouseup', this._dragEnd, this); this.on('globalout', this._dragEnd, this); // this._dropTarget = null; // this._draggingTarget = null; // this._x = 0; // this._y = 0; } Draggable.prototype = { constructor: Draggable, _dragStart: function (e) { var draggingTarget = e.target; if (draggingTarget && draggingTarget.draggable) { this._draggingTarget = draggingTarget; draggingTarget.dragging = true; this._x = e.offsetX; this._y = e.offsetY; this.dispatchToElement(param(draggingTarget, e), 'dragstart', e.event); } }, _drag: function (e) { var draggingTarget = this._draggingTarget; if (draggingTarget) { var x = e.offsetX; var y = e.offsetY; var dx = x - this._x; var dy = y - this._y; this._x = x; this._y = y; draggingTarget.drift(dx, dy, e); this.dispatchToElement(param(draggingTarget, e), 'drag', e.event); var dropTarget = this.findHover(x, y, draggingTarget).target; var lastDropTarget = this._dropTarget; this._dropTarget = dropTarget; if (draggingTarget !== dropTarget) { if (lastDropTarget && dropTarget !== lastDropTarget) { this.dispatchToElement(param(lastDropTarget, e), 'dragleave', e.event); } if (dropTarget && dropTarget !== lastDropTarget) { this.dispatchToElement(param(dropTarget, e), 'dragenter', e.event); } } } }, _dragEnd: function (e) { var draggingTarget = this._draggingTarget; if (draggingTarget) { draggingTarget.dragging = false; } this.dispatchToElement(param(draggingTarget, e), 'dragend', e.event); if (this._dropTarget) { this.dispatchToElement(param(this._dropTarget, e), 'drop', e.event); } this._draggingTarget = null; this._dropTarget = null; } }; function param(target, e) { return {target: target, topTarget: e && e.topTarget}; } /** * 事件扩展 * @module zrender/mixin/Eventful * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * pissang (https://www.github.com/pissang) */ var arrySlice = Array.prototype.slice; /** * 事件分发器 * @alias module:zrender/mixin/Eventful * @constructor */ var Eventful = function () { this._$handlers = {}; }; Eventful.prototype = { constructor: Eventful, /** * 单次触发绑定,trigger后销毁 * * @param {string} event 事件名 * @param {Function} handler 响应函数 * @param {Object} context */ one: function (event, handler, context) { var _h = this._$handlers; if (!handler || !event) { return this; } if (!_h[event]) { _h[event] = []; } for (var i = 0; i < _h[event].length; i++) { if (_h[event][i].h === handler) { return this; } } _h[event].push({ h: handler, one: true, ctx: context || this }); return this; }, /** * 绑定事件 * @param {string} event 事件名 * @param {Function} handler 事件处理函数 * @param {Object} [context] */ on: function (event, handler, context) { var _h = this._$handlers; if (!handler || !event) { return this; } if (!_h[event]) { _h[event] = []; } for (var i = 0; i < _h[event].length; i++) { if (_h[event][i].h === handler) { return this; } } _h[event].push({ h: handler, one: false, ctx: context || this }); return this; }, /** * 是否绑定了事件 * @param {string} event * @return {boolean} */ isSilent: function (event) { var _h = this._$handlers; return _h[event] && _h[event].length; }, /** * 解绑事件 * @param {string} event 事件名 * @param {Function} [handler] 事件处理函数 */ off: function (event, handler) { var _h = this._$handlers; if (!event) { this._$handlers = {}; return this; } if (handler) { if (_h[event]) { var newList = []; for (var i = 0, l = _h[event].length; i < l; i++) { if (_h[event][i]['h'] != handler) { newList.push(_h[event][i]); } } _h[event] = newList; } if (_h[event] && _h[event].length === 0) { delete _h[event]; } } else { delete _h[event]; } return this; }, /** * 事件分发 * * @param {string} type 事件类型 */ trigger: function (type) { if (this._$handlers[type]) { var args = arguments; var argLen = args.length; if (argLen > 3) { args = arrySlice.call(args, 1); } var _h = this._$handlers[type]; var len = _h.length; for (var i = 0; i < len;) { // Optimize advise from backbone switch (argLen) { case 1: _h[i]['h'].call(_h[i]['ctx']); break; case 2: _h[i]['h'].call(_h[i]['ctx'], args[1]); break; case 3: _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); break; default: // have more than 2 given arguments _h[i]['h'].apply(_h[i]['ctx'], args); break; } if (_h[i]['one']) { _h.splice(i, 1); len--; } else { i++; } } } return this; }, /** * 带有context的事件分发, 最后一个参数是事件回调的context * @param {string} type 事件类型 */ triggerWithContext: function (type) { if (this._$handlers[type]) { var args = arguments; var argLen = args.length; if (argLen > 4) { args = arrySlice.call(args, 1, args.length - 1); } var ctx = args[args.length - 1]; var _h = this._$handlers[type]; var len = _h.length; for (var i = 0; i < len;) { // Optimize advise from backbone switch (argLen) { case 1: _h[i]['h'].call(ctx); break; case 2: _h[i]['h'].call(ctx, args[1]); break; case 3: _h[i]['h'].call(ctx, args[1], args[2]); break; default: // have more than 2 given arguments _h[i]['h'].apply(ctx, args); break; } if (_h[i]['one']) { _h.splice(i, 1); len--; } else { i++; } } } return this; } }; var SILENT = 'silent'; function makeEventPacket(eveType, targetInfo, event) { return { type: eveType, event: event, // target can only be an element that is not silent. target: targetInfo.target, // topTarget can be a silent element. topTarget: targetInfo.topTarget, cancelBubble: false, offsetX: event.zrX, offsetY: event.zrY, gestureEvent: event.gestureEvent, pinchX: event.pinchX, pinchY: event.pinchY, pinchScale: event.pinchScale, wheelDelta: event.zrDelta, zrByTouch: event.zrByTouch, which: event.which }; } function EmptyProxy () {} EmptyProxy.prototype.dispose = function () {}; var handlerNames = [ 'click', 'dblclick', 'mousewheel', 'mouseout', 'mouseup', 'mousedown', 'mousemove', 'contextmenu' ]; /** * @alias module:zrender/Handler * @constructor * @extends module:zrender/mixin/Eventful * @param {module:zrender/Storage} storage Storage instance. * @param {module:zrender/Painter} painter Painter instance. * @param {module:zrender/dom/HandlerProxy} proxy HandlerProxy instance. * @param {HTMLElement} painterRoot painter.root (not painter.getViewportRoot()). */ var Handler = function(storage, painter, proxy, painterRoot) { Eventful.call(this); this.storage = storage; this.painter = painter; this.painterRoot = painterRoot; proxy = proxy || new EmptyProxy(); /** * Proxy of event. can be Dom, WebGLSurface, etc. */ this.proxy = null; /** * {target, topTarget, x, y} * @private * @type {Object} */ this._hovered = {}; /** * @private * @type {Date} */ this._lastTouchMoment; /** * @private * @type {number} */ this._lastX; /** * @private * @type {number} */ this._lastY; Draggable.call(this); this.setHandlerProxy(proxy); }; Handler.prototype = { constructor: Handler, setHandlerProxy: function (proxy) { if (this.proxy) { this.proxy.dispose(); } if (proxy) { each$1(handlerNames, function (name) { proxy.on && proxy.on(name, this[name], this); }, this); // Attach handler proxy.handler = this; } this.proxy = proxy; }, mousemove: function (event) { var x = event.zrX; var y = event.zrY; var lastHovered = this._hovered; var lastHoveredTarget = lastHovered.target; // If lastHoveredTarget is removed from zr (detected by '__zr') by some API call // (like 'setOption' or 'dispatchAction') in event handlers, we should find // lastHovered again here. Otherwise 'mouseout' can not be triggered normally. // See #6198. if (lastHoveredTarget && !lastHoveredTarget.__zr) { lastHovered = this.findHover(lastHovered.x, lastHovered.y); lastHoveredTarget = lastHovered.target; } var hovered = this._hovered = this.findHover(x, y); var hoveredTarget = hovered.target; var proxy = this.proxy; proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default'); // Mouse out on previous hovered element if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) { this.dispatchToElement(lastHovered, 'mouseout', event); } // Mouse moving on one element this.dispatchToElement(hovered, 'mousemove', event); // Mouse over on a new element if (hoveredTarget && hoveredTarget !== lastHoveredTarget) { this.dispatchToElement(hovered, 'mouseover', event); } }, mouseout: function (event) { this.dispatchToElement(this._hovered, 'mouseout', event); // There might be some doms created by upper layer application // at the same level of painter.getViewportRoot() (e.g., tooltip // dom created by echarts), where 'globalout' event should not // be triggered when mouse enters these doms. (But 'mouseout' // should be triggered at the original hovered element as usual). var element = event.toElement || event.relatedTarget; var innerDom; do { element = element && element.parentNode; } while (element && element.nodeType != 9 && !( innerDom = element === this.painterRoot )); !innerDom && this.trigger('globalout', {event: event}); }, /** * Resize */ resize: function (event) { this._hovered = {}; }, /** * Dispatch event * @param {string} eventName * @param {event=} eventArgs */ dispatch: function (eventName, eventArgs) { var handler = this[eventName]; handler && handler.call(this, eventArgs); }, /** * Dispose */ dispose: function () { this.proxy.dispose(); this.storage = this.proxy = this.painter = null; }, /** * 设置默认的cursor style * @param {string} [cursorStyle='default'] 例如 crosshair */ setCursorStyle: function (cursorStyle) { var proxy = this.proxy; proxy.setCursor && proxy.setCursor(cursorStyle); }, /** * 事件分发代理 * * @private * @param {Object} targetInfo {target, topTarget} 目标图形元素 * @param {string} eventName 事件名称 * @param {Object} event 事件对象 */ dispatchToElement: function (targetInfo, eventName, event) { targetInfo = targetInfo || {}; var el = targetInfo.target; if (el && el.silent) { return; } var eventHandler = 'on' + eventName; var eventPacket = makeEventPacket(eventName, targetInfo, event); while (el) { el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler].call(el, eventPacket)); el.trigger(eventName, eventPacket); el = el.parent; if (eventPacket.cancelBubble) { break; } } if (!eventPacket.cancelBubble) { // 冒泡到顶级 zrender 对象 this.trigger(eventName, eventPacket); // 分发事件到用户自定义层 // 用户有可能在全局 click 事件中 dispose,所以需要判断下 painter 是否存在 this.painter && this.painter.eachOtherLayer(function (layer) { if (typeof(layer[eventHandler]) == 'function') { layer[eventHandler].call(layer, eventPacket); } if (layer.trigger) { layer.trigger(eventName, eventPacket); } }); } }, /** * @private * @param {number} x * @param {number} y * @param {module:zrender/graphic/Displayable} exclude * @return {model:zrender/Element} * @method */ findHover: function(x, y, exclude) { var list = this.storage.getDisplayList(); var out = {x: x, y: y}; for (var i = list.length - 1; i >= 0 ; i--) { var hoverCheckResult; if (list[i] !== exclude // getDisplayList may include ignored item in VML mode && !list[i].ignore && (hoverCheckResult = isHover(list[i], x, y)) ) { !out.topTarget && (out.topTarget = list[i]); if (hoverCheckResult !== SILENT) { out.target = list[i]; break; } } } return out; } }; // Common handlers each$1(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) { Handler.prototype[name] = function (event) { // Find hover again to avoid click event is dispatched manually. Or click is triggered without mouseover var hovered = this.findHover(event.zrX, event.zrY); var hoveredTarget = hovered.target; if (name === 'mousedown') { this._downEl = hoveredTarget; this._downPoint = [event.zrX, event.zrY]; // In case click triggered before mouseup this._upEl = hoveredTarget; } else if (name === 'mouseup') { this._upEl = hoveredTarget; } else if (name === 'click') { if (this._downEl !== this._upEl // Original click event is triggered on the whole canvas element, // including the case that `mousedown` - `mousemove` - `mouseup`, // which should be filtered, otherwise it will bring trouble to // pan and zoom. || !this._downPoint // Arbitrary value || dist(this._downPoint, [event.zrX, event.zrY]) > 4 ) { return; } this._downPoint = null; } this.dispatchToElement(hovered, name, event); }; }); function isHover(displayable, x, y) { if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) { var el = displayable; var isSilent; while (el) { // If clipped by ancestor. // FIXME: If clipPath has neither stroke nor fill, // el.clipPath.contain(x, y) will always return false. if (el.clipPath && !el.clipPath.contain(x, y)) { return false; } if (el.silent) { isSilent = true; } el = el.parent; } return isSilent ? SILENT : true; } return false; } mixin(Handler, Eventful); mixin(Handler, Draggable); /** * 3x2矩阵操作类 * @exports zrender/tool/matrix */ var ArrayCtor$1 = typeof Float32Array === 'undefined' ? Array : Float32Array; /** * Create a identity matrix. * @return {Float32Array|Array.} */ function create$1() { var out = new ArrayCtor$1(6); identity(out); return out; } /** * 设置矩阵为单位矩阵 * @param {Float32Array|Array.} out */ function identity(out) { out[0] = 1; out[1] = 0; out[2] = 0; out[3] = 1; out[4] = 0; out[5] = 0; return out; } /** * 复制矩阵 * @param {Float32Array|Array.} out * @param {Float32Array|Array.} m */ function copy$1(out, m) { out[0] = m[0]; out[1] = m[1]; out[2] = m[2]; out[3] = m[3]; out[4] = m[4]; out[5] = m[5]; return out; } /** * 矩阵相乘 * @param {Float32Array|Array.} out * @param {Float32Array|Array.} m1 * @param {Float32Array|Array.} m2 */ function mul$1(out, m1, m2) { // Consider matrix.mul(m, m2, m); // where out is the same as m2. // So use temp variable to escape error. var out0 = m1[0] * m2[0] + m1[2] * m2[1]; var out1 = m1[1] * m2[0] + m1[3] * m2[1]; var out2 = m1[0] * m2[2] + m1[2] * m2[3]; var out3 = m1[1] * m2[2] + m1[3] * m2[3]; var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; out[0] = out0; out[1] = out1; out[2] = out2; out[3] = out3; out[4] = out4; out[5] = out5; return out; } /** * 平移变换 * @param {Float32Array|Array.} out * @param {Float32Array|Array.} a * @param {Float32Array|Array.} v */ function translate(out, a, v) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; out[4] = a[4] + v[0]; out[5] = a[5] + v[1]; return out; } /** * 旋转变换 * @param {Float32Array|Array.} out * @param {Float32Array|Array.} a * @param {number} rad */ function rotate(out, a, rad) { var aa = a[0]; var ac = a[2]; var atx = a[4]; var ab = a[1]; var ad = a[3]; var aty = a[5]; var st = Math.sin(rad); var ct = Math.cos(rad); out[0] = aa * ct + ab * st; out[1] = -aa * st + ab * ct; out[2] = ac * ct + ad * st; out[3] = -ac * st + ct * ad; out[4] = ct * atx + st * aty; out[5] = ct * aty - st * atx; return out; } /** * 缩放变换 * @param {Float32Array|Array.} out * @param {Float32Array|Array.} a * @param {Float32Array|Array.} v */ function scale$1(out, a, v) { var vx = v[0]; var vy = v[1]; out[0] = a[0] * vx; out[1] = a[1] * vy; out[2] = a[2] * vx; out[3] = a[3] * vy; out[4] = a[4] * vx; out[5] = a[5] * vy; return out; } /** * 求逆矩阵 * @param {Float32Array|Array.} out * @param {Float32Array|Array.} a */ function invert(out, a) { var aa = a[0]; var ac = a[2]; var atx = a[4]; var ab = a[1]; var ad = a[3]; var aty = a[5]; var det = aa * ad - ab * ac; if (!det) { return null; } det = 1.0 / det; out[0] = ad * det; out[1] = -ab * det; out[2] = -ac * det; out[3] = aa * det; out[4] = (ac * aty - ad * atx) * det; out[5] = (ab * atx - aa * aty) * det; return out; } /** * Clone a new matrix. * @param {Float32Array|Array.} a */ function clone$2(a) { var b = create$1(); copy$1(b, a); return b; } var matrix = (Object.freeze || Object)({ create: create$1, identity: identity, copy: copy$1, mul: mul$1, translate: translate, rotate: rotate, scale: scale$1, invert: invert, clone: clone$2 }); /** * 提供变换扩展 * @module zrender/mixin/Transformable * @author pissang (https://www.github.com/pissang) */ var mIdentity = identity; var EPSILON = 5e-5; function isNotAroundZero(val) { return val > EPSILON || val < -EPSILON; } /** * @alias module:zrender/mixin/Transformable * @constructor */ var Transformable = function (opts) { opts = opts || {}; // If there are no given position, rotation, scale if (!opts.position) { /** * 平移 * @type {Array.} * @default [0, 0] */ this.position = [0, 0]; } if (opts.rotation == null) { /** * 旋转 * @type {Array.} * @default 0 */ this.rotation = 0; } if (!opts.scale) { /** * 缩放 * @type {Array.} * @default [1, 1] */ this.scale = [1, 1]; } /** * 旋转和缩放的原点 * @type {Array.} * @default null */ this.origin = this.origin || null; }; var transformableProto = Transformable.prototype; transformableProto.transform = null; /** * 判断是否需要有坐标变换 * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵 */ transformableProto.needLocalTransform = function () { return isNotAroundZero(this.rotation) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1); }; transformableProto.updateTransform = function () { var parent = this.parent; var parentHasTransform = parent && parent.transform; var needLocalTransform = this.needLocalTransform(); var m = this.transform; if (!(needLocalTransform || parentHasTransform)) { m && mIdentity(m); return; } m = m || create$1(); if (needLocalTransform) { this.getLocalTransform(m); } else { mIdentity(m); } // 应用父节点变换 if (parentHasTransform) { if (needLocalTransform) { mul$1(m, parent.transform, m); } else { copy$1(m, parent.transform); } } // 保存这个变换矩阵 this.transform = m; this.invTransform = this.invTransform || create$1(); invert(this.invTransform, m); }; transformableProto.getLocalTransform = function (m) { return Transformable.getLocalTransform(this, m); }; /** * 将自己的transform应用到context上 * @param {CanvasRenderingContext2D} ctx */ transformableProto.setTransform = function (ctx) { var m = this.transform; var dpr = ctx.dpr || 1; if (m) { ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]); } else { ctx.setTransform(dpr, 0, 0, dpr, 0, 0); } }; transformableProto.restoreTransform = function (ctx) { var dpr = ctx.dpr || 1; ctx.setTransform(dpr, 0, 0, dpr, 0, 0); }; var tmpTransform = []; /** * 分解`transform`矩阵到`position`, `rotation`, `scale` */ transformableProto.decomposeTransform = function () { if (!this.transform) { return; } var parent = this.parent; var m = this.transform; if (parent && parent.transform) { // Get local transform and decompose them to position, scale, rotation mul$1(tmpTransform, parent.invTransform, m); m = tmpTransform; } var sx = m[0] * m[0] + m[1] * m[1]; var sy = m[2] * m[2] + m[3] * m[3]; var position = this.position; var scale$$1 = this.scale; if (isNotAroundZero(sx - 1)) { sx = Math.sqrt(sx); } if (isNotAroundZero(sy - 1)) { sy = Math.sqrt(sy); } if (m[0] < 0) { sx = -sx; } if (m[3] < 0) { sy = -sy; } position[0] = m[4]; position[1] = m[5]; scale$$1[0] = sx; scale$$1[1] = sy; this.rotation = Math.atan2(-m[1] / sy, m[0] / sx); }; /** * Get global scale * @return {Array.} */ transformableProto.getGlobalScale = function () { var m = this.transform; if (!m) { return [1, 1]; } var sx = Math.sqrt(m[0] * m[0] + m[1] * m[1]); var sy = Math.sqrt(m[2] * m[2] + m[3] * m[3]); if (m[0] < 0) { sx = -sx; } if (m[3] < 0) { sy = -sy; } return [sx, sy]; }; /** * 变换坐标位置到 shape 的局部坐标空间 * @method * @param {number} x * @param {number} y * @return {Array.} */ transformableProto.transformCoordToLocal = function (x, y) { var v2 = [x, y]; var invTransform = this.invTransform; if (invTransform) { applyTransform(v2, v2, invTransform); } return v2; }; /** * 变换局部坐标位置到全局坐标空间 * @method * @param {number} x * @param {number} y * @return {Array.} */ transformableProto.transformCoordToGlobal = function (x, y) { var v2 = [x, y]; var transform = this.transform; if (transform) { applyTransform(v2, v2, transform); } return v2; }; /** * @static * @param {Object} target * @param {Array.} target.origin * @param {number} target.rotation * @param {Array.} target.position * @param {Array.} [m] */ Transformable.getLocalTransform = function (target, m) { m = m || []; mIdentity(m); var origin = target.origin; var scale$$1 = target.scale || [1, 1]; var rotation = target.rotation || 0; var position = target.position || [0, 0]; if (origin) { // Translate to origin m[4] -= origin[0]; m[5] -= origin[1]; } scale$1(m, m, scale$$1); if (rotation) { rotate(m, m, rotation); } if (origin) { // Translate back from origin m[4] += origin[0]; m[5] += origin[1]; } m[4] += position[0]; m[5] += position[1]; return m; }; /** * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js * @see http://sole.github.io/tween.js/examples/03_graphs.html * @exports zrender/animation/easing */ var easing = { /** * @param {number} k * @return {number} */ linear: function (k) { return k; }, /** * @param {number} k * @return {number} */ quadraticIn: function (k) { return k * k; }, /** * @param {number} k * @return {number} */ quadraticOut: function (k) { return k * (2 - k); }, /** * @param {number} k * @return {number} */ quadraticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k; } return -0.5 * (--k * (k - 2) - 1); }, // 三次方的缓动(t^3) /** * @param {number} k * @return {number} */ cubicIn: function (k) { return k * k * k; }, /** * @param {number} k * @return {number} */ cubicOut: function (k) { return --k * k * k + 1; }, /** * @param {number} k * @return {number} */ cubicInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k; } return 0.5 * ((k -= 2) * k * k + 2); }, // 四次方的缓动(t^4) /** * @param {number} k * @return {number} */ quarticIn: function (k) { return k * k * k * k; }, /** * @param {number} k * @return {number} */ quarticOut: function (k) { return 1 - (--k * k * k * k); }, /** * @param {number} k * @return {number} */ quarticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k * k; } return -0.5 * ((k -= 2) * k * k * k - 2); }, // 五次方的缓动(t^5) /** * @param {number} k * @return {number} */ quinticIn: function (k) { return k * k * k * k * k; }, /** * @param {number} k * @return {number} */ quinticOut: function (k) { return --k * k * k * k * k + 1; }, /** * @param {number} k * @return {number} */ quinticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k * k * k; } return 0.5 * ((k -= 2) * k * k * k * k + 2); }, // 正弦曲线的缓动(sin(t)) /** * @param {number} k * @return {number} */ sinusoidalIn: function (k) { return 1 - Math.cos(k * Math.PI / 2); }, /** * @param {number} k * @return {number} */ sinusoidalOut: function (k) { return Math.sin(k * Math.PI / 2); }, /** * @param {number} k * @return {number} */ sinusoidalInOut: function (k) { return 0.5 * (1 - Math.cos(Math.PI * k)); }, // 指数曲线的缓动(2^t) /** * @param {number} k * @return {number} */ exponentialIn: function (k) { return k === 0 ? 0 : Math.pow(1024, k - 1); }, /** * @param {number} k * @return {number} */ exponentialOut: function (k) { return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); }, /** * @param {number} k * @return {number} */ exponentialInOut: function (k) { if (k === 0) { return 0; } if (k === 1) { return 1; } if ((k *= 2) < 1) { return 0.5 * Math.pow(1024, k - 1); } return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2); }, // 圆形曲线的缓动(sqrt(1-t^2)) /** * @param {number} k * @return {number} */ circularIn: function (k) { return 1 - Math.sqrt(1 - k * k); }, /** * @param {number} k * @return {number} */ circularOut: function (k) { return Math.sqrt(1 - (--k * k)); }, /** * @param {number} k * @return {number} */ circularInOut: function (k) { if ((k *= 2) < 1) { return -0.5 * (Math.sqrt(1 - k * k) - 1); } return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); }, // 创建类似于弹簧在停止前来回振荡的动画 /** * @param {number} k * @return {number} */ elasticIn: function (k) { var s; var a = 0.1; var p = 0.4; if (k === 0) { return 0; } if (k === 1) { return 1; } if (!a || a < 1) { a = 1; s = p / 4; } else { s = p * Math.asin(1 / a) / (2 * Math.PI); } return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); }, /** * @param {number} k * @return {number} */ elasticOut: function (k) { var s; var a = 0.1; var p = 0.4; if (k === 0) { return 0; } if (k === 1) { return 1; } if (!a || a < 1) { a = 1; s = p / 4; } else { s = p * Math.asin(1 / a) / (2 * Math.PI); } return (a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1); }, /** * @param {number} k * @return {number} */ elasticInOut: function (k) { var s; var a = 0.1; var p = 0.4; if (k === 0) { return 0; } if (k === 1) { return 1; } if (!a || a < 1) { a = 1; s = p / 4; } else { s = p * Math.asin(1 / a) / (2 * Math.PI); } if ((k *= 2) < 1) { return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); } return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; }, // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动 /** * @param {number} k * @return {number} */ backIn: function (k) { var s = 1.70158; return k * k * ((s + 1) * k - s); }, /** * @param {number} k * @return {number} */ backOut: function (k) { var s = 1.70158; return --k * k * ((s + 1) * k + s) + 1; }, /** * @param {number} k * @return {number} */ backInOut: function (k) { var s = 1.70158 * 1.525; if ((k *= 2) < 1) { return 0.5 * (k * k * ((s + 1) * k - s)); } return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); }, // 创建弹跳效果 /** * @param {number} k * @return {number} */ bounceIn: function (k) { return 1 - easing.bounceOut(1 - k); }, /** * @param {number} k * @return {number} */ bounceOut: function (k) { if (k < (1 / 2.75)) { return 7.5625 * k * k; } else if (k < (2 / 2.75)) { return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; } else if (k < (2.5 / 2.75)) { return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; } else { return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; } }, /** * @param {number} k * @return {number} */ bounceInOut: function (k) { if (k < 0.5) { return easing.bounceIn(k * 2) * 0.5; } return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5; } }; /** * 动画主控制器 * @config target 动画对象,可以是数组,如果是数组的话会批量分发onframe等事件 * @config life(1000) 动画时长 * @config delay(0) 动画延迟时间 * @config loop(true) * @config gap(0) 循环的间隔时间 * @config onframe * @config easing(optional) * @config ondestroy(optional) * @config onrestart(optional) * * TODO pause */ function Clip(options) { this._target = options.target; // 生命周期 this._life = options.life || 1000; // 延时 this._delay = options.delay || 0; // 开始时间 // this._startTime = new Date().getTime() + this._delay;// 单位毫秒 this._initialized = false; // 是否循环 this.loop = options.loop == null ? false : options.loop; this.gap = options.gap || 0; this.easing = options.easing || 'Linear'; this.onframe = options.onframe; this.ondestroy = options.ondestroy; this.onrestart = options.onrestart; this._pausedTime = 0; this._paused = false; } Clip.prototype = { constructor: Clip, step: function (globalTime, deltaTime) { // Set startTime on first step, or _startTime may has milleseconds different between clips // PENDING if (!this._initialized) { this._startTime = globalTime + this._delay; this._initialized = true; } if (this._paused) { this._pausedTime += deltaTime; return; } var percent = (globalTime - this._startTime - this._pausedTime) / this._life; // 还没开始 if (percent < 0) { return; } percent = Math.min(percent, 1); var easing$$1 = this.easing; var easingFunc = typeof easing$$1 == 'string' ? easing[easing$$1] : easing$$1; var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent; this.fire('frame', schedule); // 结束 if (percent == 1) { if (this.loop) { this.restart (globalTime); // 重新开始周期 // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件 return 'restart'; } // 动画完成将这个控制器标识为待删除 // 在Animation.update中进行批量删除 this._needsRemove = true; return 'destroy'; } return null; }, restart: function (globalTime) { var remainder = (globalTime - this._startTime - this._pausedTime) % this._life; this._startTime = globalTime - remainder + this.gap; this._pausedTime = 0; this._needsRemove = false; }, fire: function (eventType, arg) { eventType = 'on' + eventType; if (this[eventType]) { this[eventType](this._target, arg); } }, pause: function () { this._paused = true; }, resume: function () { this._paused = false; } }; // Simple LRU cache use doubly linked list // @module zrender/core/LRU /** * Simple double linked list. Compared with array, it has O(1) remove operation. * @constructor */ var LinkedList = function () { /** * @type {module:zrender/core/LRU~Entry} */ this.head = null; /** * @type {module:zrender/core/LRU~Entry} */ this.tail = null; this._len = 0; }; var linkedListProto = LinkedList.prototype; /** * Insert a new value at the tail * @param {} val * @return {module:zrender/core/LRU~Entry} */ linkedListProto.insert = function (val) { var entry = new Entry(val); this.insertEntry(entry); return entry; }; /** * Insert an entry at the tail * @param {module:zrender/core/LRU~Entry} entry */ linkedListProto.insertEntry = function (entry) { if (!this.head) { this.head = this.tail = entry; } else { this.tail.next = entry; entry.prev = this.tail; entry.next = null; this.tail = entry; } this._len++; }; /** * Remove entry. * @param {module:zrender/core/LRU~Entry} entry */ linkedListProto.remove = function (entry) { var prev = entry.prev; var next = entry.next; if (prev) { prev.next = next; } else { // Is head this.head = next; } if (next) { next.prev = prev; } else { // Is tail this.tail = prev; } entry.next = entry.prev = null; this._len--; }; /** * @return {number} */ linkedListProto.len = function () { return this._len; }; /** * Clear list */ linkedListProto.clear = function () { this.head = this.tail = null; this._len = 0; }; /** * @constructor * @param {} val */ var Entry = function (val) { /** * @type {} */ this.value = val; /** * @type {module:zrender/core/LRU~Entry} */ this.next; /** * @type {module:zrender/core/LRU~Entry} */ this.prev; }; /** * LRU Cache * @constructor * @alias module:zrender/core/LRU */ var LRU = function (maxSize) { this._list = new LinkedList(); this._map = {}; this._maxSize = maxSize || 10; this._lastRemovedEntry = null; }; var LRUProto = LRU.prototype; /** * @param {string} key * @param {} value * @return {} Removed value */ LRUProto.put = function (key, value) { var list = this._list; var map = this._map; var removed = null; if (map[key] == null) { var len = list.len(); // Reuse last removed entry var entry = this._lastRemovedEntry; if (len >= this._maxSize && len > 0) { // Remove the least recently used var leastUsedEntry = list.head; list.remove(leastUsedEntry); delete map[leastUsedEntry.key]; removed = leastUsedEntry.value; this._lastRemovedEntry = leastUsedEntry; } if (entry) { entry.value = value; } else { entry = new Entry(value); } entry.key = key; list.insertEntry(entry); map[key] = entry; } return removed; }; /** * @param {string} key * @return {} */ LRUProto.get = function (key) { var entry = this._map[key]; var list = this._list; if (entry != null) { // Put the latest used entry in the tail if (entry !== list.tail) { list.remove(entry); list.insertEntry(entry); } return entry.value; } }; /** * Clear the cache */ LRUProto.clear = function () { this._list.clear(); this._map = {}; }; var kCSSColorTable = { 'transparent': [0,0,0,0], 'aliceblue': [240,248,255,1], 'antiquewhite': [250,235,215,1], 'aqua': [0,255,255,1], 'aquamarine': [127,255,212,1], 'azure': [240,255,255,1], 'beige': [245,245,220,1], 'bisque': [255,228,196,1], 'black': [0,0,0,1], 'blanchedalmond': [255,235,205,1], 'blue': [0,0,255,1], 'blueviolet': [138,43,226,1], 'brown': [165,42,42,1], 'burlywood': [222,184,135,1], 'cadetblue': [95,158,160,1], 'chartreuse': [127,255,0,1], 'chocolate': [210,105,30,1], 'coral': [255,127,80,1], 'cornflowerblue': [100,149,237,1], 'cornsilk': [255,248,220,1], 'crimson': [220,20,60,1], 'cyan': [0,255,255,1], 'darkblue': [0,0,139,1], 'darkcyan': [0,139,139,1], 'darkgoldenrod': [184,134,11,1], 'darkgray': [169,169,169,1], 'darkgreen': [0,100,0,1], 'darkgrey': [169,169,169,1], 'darkkhaki': [189,183,107,1], 'darkmagenta': [139,0,139,1], 'darkolivegreen': [85,107,47,1], 'darkorange': [255,140,0,1], 'darkorchid': [153,50,204,1], 'darkred': [139,0,0,1], 'darksalmon': [233,150,122,1], 'darkseagreen': [143,188,143,1], 'darkslateblue': [72,61,139,1], 'darkslategray': [47,79,79,1], 'darkslategrey': [47,79,79,1], 'darkturquoise': [0,206,209,1], 'darkviolet': [148,0,211,1], 'deeppink': [255,20,147,1], 'deepskyblue': [0,191,255,1], 'dimgray': [105,105,105,1], 'dimgrey': [105,105,105,1], 'dodgerblue': [30,144,255,1], 'firebrick': [178,34,34,1], 'floralwhite': [255,250,240,1], 'forestgreen': [34,139,34,1], 'fuchsia': [255,0,255,1], 'gainsboro': [220,220,220,1], 'ghostwhite': [248,248,255,1], 'gold': [255,215,0,1], 'goldenrod': [218,165,32,1], 'gray': [128,128,128,1], 'green': [0,128,0,1], 'greenyellow': [173,255,47,1], 'grey': [128,128,128,1], 'honeydew': [240,255,240,1], 'hotpink': [255,105,180,1], 'indianred': [205,92,92,1], 'indigo': [75,0,130,1], 'ivory': [255,255,240,1], 'khaki': [240,230,140,1], 'lavender': [230,230,250,1], 'lavenderblush': [255,240,245,1], 'lawngreen': [124,252,0,1], 'lemonchiffon': [255,250,205,1], 'lightblue': [173,216,230,1], 'lightcoral': [240,128,128,1], 'lightcyan': [224,255,255,1], 'lightgoldenrodyellow': [250,250,210,1], 'lightgray': [211,211,211,1], 'lightgreen': [144,238,144,1], 'lightgrey': [211,211,211,1], 'lightpink': [255,182,193,1], 'lightsalmon': [255,160,122,1], 'lightseagreen': [32,178,170,1], 'lightskyblue': [135,206,250,1], 'lightslategray': [119,136,153,1], 'lightslategrey': [119,136,153,1], 'lightsteelblue': [176,196,222,1], 'lightyellow': [255,255,224,1], 'lime': [0,255,0,1], 'limegreen': [50,205,50,1], 'linen': [250,240,230,1], 'magenta': [255,0,255,1], 'maroon': [128,0,0,1], 'mediumaquamarine': [102,205,170,1], 'mediumblue': [0,0,205,1], 'mediumorchid': [186,85,211,1], 'mediumpurple': [147,112,219,1], 'mediumseagreen': [60,179,113,1], 'mediumslateblue': [123,104,238,1], 'mediumspringgreen': [0,250,154,1], 'mediumturquoise': [72,209,204,1], 'mediumvioletred': [199,21,133,1], 'midnightblue': [25,25,112,1], 'mintcream': [245,255,250,1], 'mistyrose': [255,228,225,1], 'moccasin': [255,228,181,1], 'navajowhite': [255,222,173,1], 'navy': [0,0,128,1], 'oldlace': [253,245,230,1], 'olive': [128,128,0,1], 'olivedrab': [107,142,35,1], 'orange': [255,165,0,1], 'orangered': [255,69,0,1], 'orchid': [218,112,214,1], 'palegoldenrod': [238,232,170,1], 'palegreen': [152,251,152,1], 'paleturquoise': [175,238,238,1], 'palevioletred': [219,112,147,1], 'papayawhip': [255,239,213,1], 'peachpuff': [255,218,185,1], 'peru': [205,133,63,1], 'pink': [255,192,203,1], 'plum': [221,160,221,1], 'powderblue': [176,224,230,1], 'purple': [128,0,128,1], 'red': [255,0,0,1], 'rosybrown': [188,143,143,1], 'royalblue': [65,105,225,1], 'saddlebrown': [139,69,19,1], 'salmon': [250,128,114,1], 'sandybrown': [244,164,96,1], 'seagreen': [46,139,87,1], 'seashell': [255,245,238,1], 'sienna': [160,82,45,1], 'silver': [192,192,192,1], 'skyblue': [135,206,235,1], 'slateblue': [106,90,205,1], 'slategray': [112,128,144,1], 'slategrey': [112,128,144,1], 'snow': [255,250,250,1], 'springgreen': [0,255,127,1], 'steelblue': [70,130,180,1], 'tan': [210,180,140,1], 'teal': [0,128,128,1], 'thistle': [216,191,216,1], 'tomato': [255,99,71,1], 'turquoise': [64,224,208,1], 'violet': [238,130,238,1], 'wheat': [245,222,179,1], 'white': [255,255,255,1], 'whitesmoke': [245,245,245,1], 'yellow': [255,255,0,1], 'yellowgreen': [154,205,50,1] }; function clampCssByte(i) { // Clamp to integer 0 .. 255. i = Math.round(i); // Seems to be what Chrome does (vs truncation). return i < 0 ? 0 : i > 255 ? 255 : i; } function clampCssAngle(i) { // Clamp to integer 0 .. 360. i = Math.round(i); // Seems to be what Chrome does (vs truncation). return i < 0 ? 0 : i > 360 ? 360 : i; } function clampCssFloat(f) { // Clamp to float 0.0 .. 1.0. return f < 0 ? 0 : f > 1 ? 1 : f; } function parseCssInt(str) { // int or percentage. if (str.length && str.charAt(str.length - 1) === '%') { return clampCssByte(parseFloat(str) / 100 * 255); } return clampCssByte(parseInt(str, 10)); } function parseCssFloat(str) { // float or percentage. if (str.length && str.charAt(str.length - 1) === '%') { return clampCssFloat(parseFloat(str) / 100); } return clampCssFloat(parseFloat(str)); } function cssHueToRgb(m1, m2, h) { if (h < 0) { h += 1; } else if (h > 1) { h -= 1; } if (h * 6 < 1) { return m1 + (m2 - m1) * h * 6; } if (h * 2 < 1) { return m2; } if (h * 3 < 2) { return m1 + (m2 - m1) * (2/3 - h) * 6; } return m1; } function lerpNumber(a, b, p) { return a + (b - a) * p; } function setRgba(out, r, g, b, a) { out[0] = r; out[1] = g; out[2] = b; out[3] = a; return out; } function copyRgba(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; return out; } var colorCache = new LRU(20); var lastRemovedArr = null; function putToCache(colorStr, rgbaArr) { // Reuse removed array if (lastRemovedArr) { copyRgba(lastRemovedArr, rgbaArr); } lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice())); } /** * @param {string} colorStr * @param {Array.} out * @return {Array.} * @memberOf module:zrender/util/color */ function parse(colorStr, rgbaArr) { if (!colorStr) { return; } rgbaArr = rgbaArr || []; var cached = colorCache.get(colorStr); if (cached) { return copyRgba(rgbaArr, cached); } // colorStr may be not string colorStr = colorStr + ''; // Remove all whitespace, not compliant, but should just be more accepting. var str = colorStr.replace(/ /g, '').toLowerCase(); // Color keywords (and transparent) lookup. if (str in kCSSColorTable) { copyRgba(rgbaArr, kCSSColorTable[str]); putToCache(colorStr, rgbaArr); return rgbaArr; } // #abc and #abc123 syntax. if (str.charAt(0) === '#') { if (str.length === 4) { var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing. if (!(iv >= 0 && iv <= 0xfff)) { setRgba(rgbaArr, 0, 0, 0, 1); return; // Covers NaN. } setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), 1 ); putToCache(colorStr, rgbaArr); return rgbaArr; } else if (str.length === 7) { var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing. if (!(iv >= 0 && iv <= 0xffffff)) { setRgba(rgbaArr, 0, 0, 0, 1); return; // Covers NaN. } setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, 1 ); putToCache(colorStr, rgbaArr); return rgbaArr; } return; } var op = str.indexOf('('), ep = str.indexOf(')'); if (op !== -1 && ep + 1 === str.length) { var fname = str.substr(0, op); var params = str.substr(op + 1, ep - (op + 1)).split(','); var alpha = 1; // To allow case fallthrough. switch (fname) { case 'rgba': if (params.length !== 4) { setRgba(rgbaArr, 0, 0, 0, 1); return; } alpha = parseCssFloat(params.pop()); // jshint ignore:line // Fall through. case 'rgb': if (params.length !== 3) { setRgba(rgbaArr, 0, 0, 0, 1); return; } setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha ); putToCache(colorStr, rgbaArr); return rgbaArr; case 'hsla': if (params.length !== 4) { setRgba(rgbaArr, 0, 0, 0, 1); return; } params[3] = parseCssFloat(params[3]); hsla2rgba(params, rgbaArr); putToCache(colorStr, rgbaArr); return rgbaArr; case 'hsl': if (params.length !== 3) { setRgba(rgbaArr, 0, 0, 0, 1); return; } hsla2rgba(params, rgbaArr); putToCache(colorStr, rgbaArr); return rgbaArr; default: return; } } setRgba(rgbaArr, 0, 0, 0, 1); return; } /** * @param {Array.} hsla * @param {Array.} rgba * @return {Array.} rgba */ function hsla2rgba(hsla, rgba) { var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360; // 0 .. 1 // NOTE(deanm): According to the CSS spec s/l should only be // percentages, but we don't bother and let float or percentage. var s = parseCssFloat(hsla[1]); var l = parseCssFloat(hsla[2]); var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; var m1 = l * 2 - m2; rgba = rgba || []; setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1 ); if (hsla.length === 4) { rgba[3] = hsla[3]; } return rgba; } /** * @param {Array.} rgba * @return {Array.} hsla */ function rgba2hsla(rgba) { if (!rgba) { return; } // RGB from 0 to 255 var R = rgba[0] / 255; var G = rgba[1] / 255; var B = rgba[2] / 255; var vMin = Math.min(R, G, B); // Min. value of RGB var vMax = Math.max(R, G, B); // Max. value of RGB var delta = vMax - vMin; // Delta RGB value var L = (vMax + vMin) / 2; var H; var S; // HSL results from 0 to 1 if (delta === 0) { H = 0; S = 0; } else { if (L < 0.5) { S = delta / (vMax + vMin); } else { S = delta / (2 - vMax - vMin); } var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; if (R === vMax) { H = deltaB - deltaG; } else if (G === vMax) { H = (1 / 3) + deltaR - deltaB; } else if (B === vMax) { H = (2 / 3) + deltaG - deltaR; } if (H < 0) { H += 1; } if (H > 1) { H -= 1; } } var hsla = [H * 360, S, L]; if (rgba[3] != null) { hsla.push(rgba[3]); } return hsla; } /** * @param {string} color * @param {number} level * @return {string} * @memberOf module:zrender/util/color */ function lift(color, level) { var colorArr = parse(color); if (colorArr) { for (var i = 0; i < 3; i++) { if (level < 0) { colorArr[i] = colorArr[i] * (1 - level) | 0; } else { colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0; } if (colorArr[i] > 255) { colorArr[i] = 255; } else if (color[i] < 0) { colorArr[i] = 0; } } return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb'); } } /** * @param {string} color * @return {string} * @memberOf module:zrender/util/color */ function toHex(color) { var colorArr = parse(color); if (colorArr) { return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1); } } /** * Map value to color. Faster than lerp methods because color is represented by rgba array. * @param {number} normalizedValue A float between 0 and 1. * @param {Array.>} colors List of rgba color array * @param {Array.} [out] Mapped gba color array * @return {Array.} will be null/undefined if input illegal. */ function fastLerp(normalizedValue, colors, out) { if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1) ) { return; } out = out || []; var value = normalizedValue * (colors.length - 1); var leftIndex = Math.floor(value); var rightIndex = Math.ceil(value); var leftColor = colors[leftIndex]; var rightColor = colors[rightIndex]; var dv = value - leftIndex; out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)); out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)); out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)); out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv)); return out; } /** * @deprecated */ var fastMapToColor = fastLerp; /** * @param {number} normalizedValue A float between 0 and 1. * @param {Array.} colors Color list. * @param {boolean=} fullOutput Default false. * @return {(string|Object)} Result color. If fullOutput, * return {color: ..., leftIndex: ..., rightIndex: ..., value: ...}, * @memberOf module:zrender/util/color */ function lerp$1(normalizedValue, colors, fullOutput) { if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1) ) { return; } var value = normalizedValue * (colors.length - 1); var leftIndex = Math.floor(value); var rightIndex = Math.ceil(value); var leftColor = parse(colors[leftIndex]); var rightColor = parse(colors[rightIndex]); var dv = value - leftIndex; var color = stringify( [ clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)), clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)), clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)), clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv)) ], 'rgba' ); return fullOutput ? { color: color, leftIndex: leftIndex, rightIndex: rightIndex, value: value } : color; } /** * @deprecated */ var mapToColor = lerp$1; /** * @param {string} color * @param {number=} h 0 ~ 360, ignore when null. * @param {number=} s 0 ~ 1, ignore when null. * @param {number=} l 0 ~ 1, ignore when null. * @return {string} Color string in rgba format. * @memberOf module:zrender/util/color */ function modifyHSL(color, h, s, l) { color = parse(color); if (color) { color = rgba2hsla(color); h != null && (color[0] = clampCssAngle(h)); s != null && (color[1] = parseCssFloat(s)); l != null && (color[2] = parseCssFloat(l)); return stringify(hsla2rgba(color), 'rgba'); } } /** * @param {string} color * @param {number=} alpha 0 ~ 1 * @return {string} Color string in rgba format. * @memberOf module:zrender/util/color */ function modifyAlpha(color, alpha) { color = parse(color); if (color && alpha != null) { color[3] = clampCssFloat(alpha); return stringify(color, 'rgba'); } } /** * @param {Array.} arrColor like [12,33,44,0.4] * @param {string} type 'rgba', 'hsva', ... * @return {string} Result color. (If input illegal, return undefined). */ function stringify(arrColor, type) { if (!arrColor || !arrColor.length) { return; } var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2]; if (type === 'rgba' || type === 'hsva' || type === 'hsla') { colorStr += ',' + arrColor[3]; } return type + '(' + colorStr + ')'; } var color = (Object.freeze || Object)({ parse: parse, lift: lift, toHex: toHex, fastLerp: fastLerp, fastMapToColor: fastMapToColor, lerp: lerp$1, mapToColor: mapToColor, modifyHSL: modifyHSL, modifyAlpha: modifyAlpha, stringify: stringify }); /** * @module echarts/animation/Animator */ var arraySlice = Array.prototype.slice; function defaultGetter(target, key) { return target[key]; } function defaultSetter(target, key, value) { target[key] = value; } /** * @param {number} p0 * @param {number} p1 * @param {number} percent * @return {number} */ function interpolateNumber(p0, p1, percent) { return (p1 - p0) * percent + p0; } /** * @param {string} p0 * @param {string} p1 * @param {number} percent * @return {string} */ function interpolateString(p0, p1, percent) { return percent > 0.5 ? p1 : p0; } /** * @param {Array} p0 * @param {Array} p1 * @param {number} percent * @param {Array} out * @param {number} arrDim */ function interpolateArray(p0, p1, percent, out, arrDim) { var len = p0.length; if (arrDim == 1) { for (var i = 0; i < len; i++) { out[i] = interpolateNumber(p0[i], p1[i], percent); } } else { var len2 = len && p0[0].length; for (var i = 0; i < len; i++) { for (var j = 0; j < len2; j++) { out[i][j] = interpolateNumber( p0[i][j], p1[i][j], percent ); } } } } // arr0 is source array, arr1 is target array. // Do some preprocess to avoid error happened when interpolating from arr0 to arr1 function fillArr(arr0, arr1, arrDim) { var arr0Len = arr0.length; var arr1Len = arr1.length; if (arr0Len !== arr1Len) { // FIXME Not work for TypedArray var isPreviousLarger = arr0Len > arr1Len; if (isPreviousLarger) { // Cut the previous arr0.length = arr1Len; } else { // Fill the previous for (var i = arr0Len; i < arr1Len; i++) { arr0.push( arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]) ); } } } // Handling NaN value var len2 = arr0[0] && arr0[0].length; for (var i = 0; i < arr0.length; i++) { if (arrDim === 1) { if (isNaN(arr0[i])) { arr0[i] = arr1[i]; } } else { for (var j = 0; j < len2; j++) { if (isNaN(arr0[i][j])) { arr0[i][j] = arr1[i][j]; } } } } } /** * @param {Array} arr0 * @param {Array} arr1 * @param {number} arrDim * @return {boolean} */ function isArraySame(arr0, arr1, arrDim) { if (arr0 === arr1) { return true; } var len = arr0.length; if (len !== arr1.length) { return false; } if (arrDim === 1) { for (var i = 0; i < len; i++) { if (arr0[i] !== arr1[i]) { return false; } } } else { var len2 = arr0[0].length; for (var i = 0; i < len; i++) { for (var j = 0; j < len2; j++) { if (arr0[i][j] !== arr1[i][j]) { return false; } } } } return true; } /** * Catmull Rom interpolate array * @param {Array} p0 * @param {Array} p1 * @param {Array} p2 * @param {Array} p3 * @param {number} t * @param {number} t2 * @param {number} t3 * @param {Array} out * @param {number} arrDim */ function catmullRomInterpolateArray( p0, p1, p2, p3, t, t2, t3, out, arrDim ) { var len = p0.length; if (arrDim == 1) { for (var i = 0; i < len; i++) { out[i] = catmullRomInterpolate( p0[i], p1[i], p2[i], p3[i], t, t2, t3 ); } } else { var len2 = p0[0].length; for (var i = 0; i < len; i++) { for (var j = 0; j < len2; j++) { out[i][j] = catmullRomInterpolate( p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3 ); } } } } /** * Catmull Rom interpolate number * @param {number} p0 * @param {number} p1 * @param {number} p2 * @param {number} p3 * @param {number} t * @param {number} t2 * @param {number} t3 * @return {number} */ function catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) { var v0 = (p2 - p0) * 0.5; var v1 = (p3 - p1) * 0.5; return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; } function cloneValue(value) { if (isArrayLike(value)) { var len = value.length; if (isArrayLike(value[0])) { var ret = []; for (var i = 0; i < len; i++) { ret.push(arraySlice.call(value[i])); } return ret; } return arraySlice.call(value); } return value; } function rgba2String(rgba) { rgba[0] = Math.floor(rgba[0]); rgba[1] = Math.floor(rgba[1]); rgba[2] = Math.floor(rgba[2]); return 'rgba(' + rgba.join(',') + ')'; } function getArrayDim(keyframes) { var lastValue = keyframes[keyframes.length - 1].value; return isArrayLike(lastValue && lastValue[0]) ? 2 : 1; } function createTrackClip(animator, easing, oneTrackDone, keyframes, propName, forceAnimate) { var getter = animator._getter; var setter = animator._setter; var useSpline = easing === 'spline'; var trackLen = keyframes.length; if (!trackLen) { return; } // Guess data type var firstVal = keyframes[0].value; var isValueArray = isArrayLike(firstVal); var isValueColor = false; var isValueString = false; // For vertices morphing var arrDim = isValueArray ? getArrayDim(keyframes) : 0; var trackMaxTime; // Sort keyframe as ascending keyframes.sort(function(a, b) { return a.time - b.time; }); trackMaxTime = keyframes[trackLen - 1].time; // Percents of each keyframe var kfPercents = []; // Value of each keyframe var kfValues = []; var prevValue = keyframes[0].value; var isAllValueEqual = true; for (var i = 0; i < trackLen; i++) { kfPercents.push(keyframes[i].time / trackMaxTime); // Assume value is a color when it is a string var value = keyframes[i].value; // Check if value is equal, deep check if value is array if (!((isValueArray && isArraySame(value, prevValue, arrDim)) || (!isValueArray && value === prevValue))) { isAllValueEqual = false; } prevValue = value; // Try converting a string to a color array if (typeof value == 'string') { var colorArray = parse(value); if (colorArray) { value = colorArray; isValueColor = true; } else { isValueString = true; } } kfValues.push(value); } if (!forceAnimate && isAllValueEqual) { return; } var lastValue = kfValues[trackLen - 1]; // Polyfill array and NaN value for (var i = 0; i < trackLen - 1; i++) { if (isValueArray) { fillArr(kfValues[i], lastValue, arrDim); } else { if (isNaN(kfValues[i]) && !isNaN(lastValue) && !isValueString && !isValueColor) { kfValues[i] = lastValue; } } } isValueArray && fillArr(getter(animator._target, propName), lastValue, arrDim); // Cache the key of last frame to speed up when // animation playback is sequency var lastFrame = 0; var lastFramePercent = 0; var start; var w; var p0; var p1; var p2; var p3; if (isValueColor) { var rgba = [0, 0, 0, 0]; } var onframe = function (target, percent) { // Find the range keyframes // kf1-----kf2---------current--------kf3 // find kf2 and kf3 and do interpolation var frame; // In the easing function like elasticOut, percent may less than 0 if (percent < 0) { frame = 0; } else if (percent < lastFramePercent) { // Start from next key // PENDING start from lastFrame ? start = Math.min(lastFrame + 1, trackLen - 1); for (frame = start; frame >= 0; frame--) { if (kfPercents[frame] <= percent) { break; } } // PENDING really need to do this ? frame = Math.min(frame, trackLen - 2); } else { for (frame = lastFrame; frame < trackLen; frame++) { if (kfPercents[frame] > percent) { break; } } frame = Math.min(frame - 1, trackLen - 2); } lastFrame = frame; lastFramePercent = percent; var range = (kfPercents[frame + 1] - kfPercents[frame]); if (range === 0) { return; } else { w = (percent - kfPercents[frame]) / range; } if (useSpline) { p1 = kfValues[frame]; p0 = kfValues[frame === 0 ? frame : frame - 1]; p2 = kfValues[frame > trackLen - 2 ? trackLen - 1 : frame + 1]; p3 = kfValues[frame > trackLen - 3 ? trackLen - 1 : frame + 2]; if (isValueArray) { catmullRomInterpolateArray( p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim ); } else { var value; if (isValueColor) { value = catmullRomInterpolateArray( p0, p1, p2, p3, w, w * w, w * w * w, rgba, 1 ); value = rgba2String(rgba); } else if (isValueString) { // String is step(0.5) return interpolateString(p1, p2, w); } else { value = catmullRomInterpolate( p0, p1, p2, p3, w, w * w, w * w * w ); } setter( target, propName, value ); } } else { if (isValueArray) { interpolateArray( kfValues[frame], kfValues[frame + 1], w, getter(target, propName), arrDim ); } else { var value; if (isValueColor) { interpolateArray( kfValues[frame], kfValues[frame + 1], w, rgba, 1 ); value = rgba2String(rgba); } else if (isValueString) { // String is step(0.5) return interpolateString(kfValues[frame], kfValues[frame + 1], w); } else { value = interpolateNumber(kfValues[frame], kfValues[frame + 1], w); } setter( target, propName, value ); } } }; var clip = new Clip({ target: animator._target, life: trackMaxTime, loop: animator._loop, delay: animator._delay, onframe: onframe, ondestroy: oneTrackDone }); if (easing && easing !== 'spline') { clip.easing = easing; } return clip; } /** * @alias module:zrender/animation/Animator * @constructor * @param {Object} target * @param {boolean} loop * @param {Function} getter * @param {Function} setter */ var Animator = function(target, loop, getter, setter) { this._tracks = {}; this._target = target; this._loop = loop || false; this._getter = getter || defaultGetter; this._setter = setter || defaultSetter; this._clipCount = 0; this._delay = 0; this._doneList = []; this._onframeList = []; this._clipList = []; }; Animator.prototype = { /** * 设置动画关键帧 * @param {number} time 关键帧时间,单位是ms * @param {Object} props 关键帧的属性值,key-value表示 * @return {module:zrender/animation/Animator} */ when: function(time /* ms */, props) { var tracks = this._tracks; for (var propName in props) { if (!props.hasOwnProperty(propName)) { continue; } if (!tracks[propName]) { tracks[propName] = []; // Invalid value var value = this._getter(this._target, propName); if (value == null) { // zrLog('Invalid property ' + propName); continue; } // If time is 0 // Then props is given initialize value // Else // Initialize value from current prop value if (time !== 0) { tracks[propName].push({ time: 0, value: cloneValue(value) }); } } tracks[propName].push({ time: time, value: props[propName] }); } return this; }, /** * 添加动画每一帧的回调函数 * @param {Function} callback * @return {module:zrender/animation/Animator} */ during: function (callback) { this._onframeList.push(callback); return this; }, pause: function () { for (var i = 0; i < this._clipList.length; i++) { this._clipList[i].pause(); } this._paused = true; }, resume: function () { for (var i = 0; i < this._clipList.length; i++) { this._clipList[i].resume(); } this._paused = false; }, isPaused: function () { return !!this._paused; }, _doneCallback: function () { // Clear all tracks this._tracks = {}; // Clear all clips this._clipList.length = 0; var doneList = this._doneList; var len = doneList.length; for (var i = 0; i < len; i++) { doneList[i].call(this); } }, /** * 开始执行动画 * @param {string|Function} [easing] * 动画缓动函数,详见{@link module:zrender/animation/easing} * @param {boolean} forceAnimate * @return {module:zrender/animation/Animator} */ start: function (easing, forceAnimate) { var self = this; var clipCount = 0; var oneTrackDone = function() { clipCount--; if (!clipCount) { self._doneCallback(); } }; var lastClip; for (var propName in this._tracks) { if (!this._tracks.hasOwnProperty(propName)) { continue; } var clip = createTrackClip( this, easing, oneTrackDone, this._tracks[propName], propName, forceAnimate ); if (clip) { this._clipList.push(clip); clipCount++; // If start after added to animation if (this.animation) { this.animation.addClip(clip); } lastClip = clip; } } // Add during callback on the last clip if (lastClip) { var oldOnFrame = lastClip.onframe; lastClip.onframe = function (target, percent) { oldOnFrame(target, percent); for (var i = 0; i < self._onframeList.length; i++) { self._onframeList[i](target, percent); } }; } // This optimization will help the case that in the upper application // the view may be refreshed frequently, where animation will be // called repeatly but nothing changed. if (!clipCount) { this._doneCallback(); } return this; }, /** * 停止动画 * @param {boolean} forwardToLast If move to last frame before stop */ stop: function (forwardToLast) { var clipList = this._clipList; var animation = this.animation; for (var i = 0; i < clipList.length; i++) { var clip = clipList[i]; if (forwardToLast) { // Move to last frame before stop clip.onframe(this._target, 1); } animation && animation.removeClip(clip); } clipList.length = 0; }, /** * 设置动画延迟开始的时间 * @param {number} time 单位ms * @return {module:zrender/animation/Animator} */ delay: function (time) { this._delay = time; return this; }, /** * 添加动画结束的回调 * @param {Function} cb * @return {module:zrender/animation/Animator} */ done: function(cb) { if (cb) { this._doneList.push(cb); } return this; }, /** * @return {Array.} */ getClips: function () { return this._clipList; } }; var dpr = 1; // If in browser environment if (typeof window !== 'undefined') { dpr = Math.max(window.devicePixelRatio || 1, 1); } /** * config默认配置项 * @exports zrender/config * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) */ /** * debug日志选项:catchBrushException为true下有效 * 0 : 不生成debug数据,发布用 * 1 : 异常抛出,调试用 * 2 : 控制台输出,调试用 */ var debugMode = 0; // retina 屏幕优化 var devicePixelRatio = dpr; var log = function () { }; if (debugMode === 1) { log = function () { for (var k in arguments) { throw new Error(arguments[k]); } }; } else if (debugMode > 1) { log = function () { for (var k in arguments) { console.log(arguments[k]); } }; } var zrLog = log; /** * @alias modue:zrender/mixin/Animatable * @constructor */ var Animatable = function () { /** * @type {Array.} * @readOnly */ this.animators = []; }; Animatable.prototype = { constructor: Animatable, /** * 动画 * * @param {string} path The path to fetch value from object, like 'a.b.c'. * @param {boolean} [loop] Whether to loop animation. * @return {module:zrender/animation/Animator} * @example: * el.animate('style', false) * .when(1000, {x: 10} ) * .done(function(){ // Animation done }) * .start() */ animate: function (path, loop) { var target; var animatingShape = false; var el = this; var zr = this.__zr; if (path) { var pathSplitted = path.split('.'); var prop = el; // If animating shape animatingShape = pathSplitted[0] === 'shape'; for (var i = 0, l = pathSplitted.length; i < l; i++) { if (!prop) { continue; } prop = prop[pathSplitted[i]]; } if (prop) { target = prop; } } else { target = el; } if (!target) { zrLog( 'Property "' + path + '" is not existed in element ' + el.id ); return; } var animators = el.animators; var animator = new Animator(target, loop); animator.during(function (target) { el.dirty(animatingShape); }) .done(function () { // FIXME Animator will not be removed if use `Animator#stop` to stop animation animators.splice(indexOf(animators, animator), 1); }); animators.push(animator); // If animate after added to the zrender if (zr) { zr.animation.addAnimator(animator); } return animator; }, /** * 停止动画 * @param {boolean} forwardToLast If move to last frame before stop */ stopAnimation: function (forwardToLast) { var animators = this.animators; var len = animators.length; for (var i = 0; i < len; i++) { animators[i].stop(forwardToLast); } animators.length = 0; return this; }, /** * Caution: this method will stop previous animation. * So do not use this method to one element twice before * animation starts, unless you know what you are doing. * @param {Object} target * @param {number} [time=500] Time in ms * @param {string} [easing='linear'] * @param {number} [delay=0] * @param {Function} [callback] * @param {Function} [forceAnimate] Prevent stop animation and callback * immediently when target values are the same as current values. * * @example * // Animate position * el.animateTo({ * position: [10, 10] * }, function () { // done }) * * // Animate shape, style and position in 100ms, delayed 100ms, with cubicOut easing * el.animateTo({ * shape: { * width: 500 * }, * style: { * fill: 'red' * } * position: [10, 10] * }, 100, 100, 'cubicOut', function () { // done }) */ // TODO Return animation key animateTo: function (target, time, delay, easing, callback, forceAnimate) { // animateTo(target, time, easing, callback); if (isString(delay)) { callback = easing; easing = delay; delay = 0; } // animateTo(target, time, delay, callback); else if (isFunction$1(easing)) { callback = easing; easing = 'linear'; delay = 0; } // animateTo(target, time, callback); else if (isFunction$1(delay)) { callback = delay; delay = 0; } // animateTo(target, callback) else if (isFunction$1(time)) { callback = time; time = 500; } // animateTo(target) else if (!time) { time = 500; } // Stop all previous animations this.stopAnimation(); this._animateToShallow('', this, target, time, delay); // Animators may be removed immediately after start // if there is nothing to animate var animators = this.animators.slice(); var count = animators.length; function done() { count--; if (!count) { callback && callback(); } } // No animators. This should be checked before animators[i].start(), // because 'done' may be executed immediately if no need to animate. if (!count) { callback && callback(); } // Start after all animators created // Incase any animator is done immediately when all animation properties are not changed for (var i = 0; i < animators.length; i++) { animators[i] .done(done) .start(easing, forceAnimate); } }, /** * @private * @param {string} path='' * @param {Object} source=this * @param {Object} target * @param {number} [time=500] * @param {number} [delay=0] * * @example * // Animate position * el._animateToShallow({ * position: [10, 10] * }) * * // Animate shape, style and position in 100ms, delayed 100ms * el._animateToShallow({ * shape: { * width: 500 * }, * style: { * fill: 'red' * } * position: [10, 10] * }, 100, 100) */ _animateToShallow: function (path, source, target, time, delay) { var objShallow = {}; var propertyCount = 0; for (var name in target) { if (!target.hasOwnProperty(name)) { continue; } if (source[name] != null) { if (isObject$1(target[name]) && !isArrayLike(target[name])) { this._animateToShallow( path ? path + '.' + name : name, source[name], target[name], time, delay ); } else { objShallow[name] = target[name]; propertyCount++; } } else if (target[name] != null) { // Attr directly if not has property // FIXME, if some property not needed for element ? if (!path) { this.attr(name, target[name]); } else { // Shape or style var props = {}; props[path] = {}; props[path][name] = target[name]; this.attr(props); } } } if (propertyCount > 0) { this.animate(path, false) .when(time == null ? 500 : time, objShallow) .delay(delay || 0); } return this; } }; /** * @alias module:zrender/Element * @constructor * @extends {module:zrender/mixin/Animatable} * @extends {module:zrender/mixin/Transformable} * @extends {module:zrender/mixin/Eventful} */ var Element = function (opts) { // jshint ignore:line Transformable.call(this, opts); Eventful.call(this, opts); Animatable.call(this, opts); /** * 画布元素ID * @type {string} */ this.id = opts.id || guid(); }; Element.prototype = { /** * 元素类型 * Element type * @type {string} */ type: 'element', /** * 元素名字 * Element name * @type {string} */ name: '', /** * ZRender 实例对象,会在 element 添加到 zrender 实例中后自动赋值 * ZRender instance will be assigned when element is associated with zrender * @name module:/zrender/Element#__zr * @type {module:zrender/ZRender} */ __zr: null, /** * 图形是否忽略,为true时忽略图形的绘制以及事件触发 * If ignore drawing and events of the element object * @name module:/zrender/Element#ignore * @type {boolean} * @default false */ ignore: false, /** * 用于裁剪的路径(shape),所有 Group 内的路径在绘制时都会被这个路径裁剪 * 该路径会继承被裁减对象的变换 * @type {module:zrender/graphic/Path} * @see http://www.w3.org/TR/2dcontext/#clipping-region * @readOnly */ clipPath: null, /** * 是否是 Group * @type {boolean} */ isGroup: false, /** * Drift element * @param {number} dx dx on the global space * @param {number} dy dy on the global space */ drift: function (dx, dy) { switch (this.draggable) { case 'horizontal': dy = 0; break; case 'vertical': dx = 0; break; } var m = this.transform; if (!m) { m = this.transform = [1, 0, 0, 1, 0, 0]; } m[4] += dx; m[5] += dy; this.decomposeTransform(); this.dirty(false); }, /** * Hook before update */ beforeUpdate: function () {}, /** * Hook after update */ afterUpdate: function () {}, /** * Update each frame */ update: function () { this.updateTransform(); }, /** * @param {Function} cb * @param {} context */ traverse: function (cb, context) {}, /** * @protected */ attrKV: function (key, value) { if (key === 'position' || key === 'scale' || key === 'origin') { // Copy the array if (value) { var target = this[key]; if (!target) { target = this[key] = []; } target[0] = value[0]; target[1] = value[1]; } } else { this[key] = value; } }, /** * Hide the element */ hide: function () { this.ignore = true; this.__zr && this.__zr.refresh(); }, /** * Show the element */ show: function () { this.ignore = false; this.__zr && this.__zr.refresh(); }, /** * @param {string|Object} key * @param {*} value */ attr: function (key, value) { if (typeof key === 'string') { this.attrKV(key, value); } else if (isObject$1(key)) { for (var name in key) { if (key.hasOwnProperty(name)) { this.attrKV(name, key[name]); } } } this.dirty(false); return this; }, /** * @param {module:zrender/graphic/Path} clipPath */ setClipPath: function (clipPath) { var zr = this.__zr; if (zr) { clipPath.addSelfToZr(zr); } // Remove previous clip path if (this.clipPath && this.clipPath !== clipPath) { this.removeClipPath(); } this.clipPath = clipPath; clipPath.__zr = zr; clipPath.__clipTarget = this; this.dirty(false); }, /** */ removeClipPath: function () { var clipPath = this.clipPath; if (clipPath) { if (clipPath.__zr) { clipPath.removeSelfFromZr(clipPath.__zr); } clipPath.__zr = null; clipPath.__clipTarget = null; this.clipPath = null; this.dirty(false); } }, /** * Add self from zrender instance. * Not recursively because it will be invoked when element added to storage. * @param {module:zrender/ZRender} zr */ addSelfToZr: function (zr) { this.__zr = zr; // 添加动画 var animators = this.animators; if (animators) { for (var i = 0; i < animators.length; i++) { zr.animation.addAnimator(animators[i]); } } if (this.clipPath) { this.clipPath.addSelfToZr(zr); } }, /** * Remove self from zrender instance. * Not recursively because it will be invoked when element added to storage. * @param {module:zrender/ZRender} zr */ removeSelfFromZr: function (zr) { this.__zr = null; // 移除动画 var animators = this.animators; if (animators) { for (var i = 0; i < animators.length; i++) { zr.animation.removeAnimator(animators[i]); } } if (this.clipPath) { this.clipPath.removeSelfFromZr(zr); } } }; mixin(Element, Animatable); mixin(Element, Transformable); mixin(Element, Eventful); /** * @module echarts/core/BoundingRect */ var v2ApplyTransform = applyTransform; var mathMin = Math.min; var mathMax = Math.max; /** * @alias module:echarts/core/BoundingRect */ function BoundingRect(x, y, width, height) { if (width < 0) { x = x + width; width = -width; } if (height < 0) { y = y + height; height = -height; } /** * @type {number} */ this.x = x; /** * @type {number} */ this.y = y; /** * @type {number} */ this.width = width; /** * @type {number} */ this.height = height; } BoundingRect.prototype = { constructor: BoundingRect, /** * @param {module:echarts/core/BoundingRect} other */ union: function (other) { var x = mathMin(other.x, this.x); var y = mathMin(other.y, this.y); this.width = mathMax( other.x + other.width, this.x + this.width ) - x; this.height = mathMax( other.y + other.height, this.y + this.height ) - y; this.x = x; this.y = y; }, /** * @param {Array.} m * @methods */ applyTransform: (function () { var lt = []; var rb = []; var lb = []; var rt = []; return function (m) { // In case usage like this // el.getBoundingRect().applyTransform(el.transform) // And element has no transform if (!m) { return; } lt[0] = lb[0] = this.x; lt[1] = rt[1] = this.y; rb[0] = rt[0] = this.x + this.width; rb[1] = lb[1] = this.y + this.height; v2ApplyTransform(lt, lt, m); v2ApplyTransform(rb, rb, m); v2ApplyTransform(lb, lb, m); v2ApplyTransform(rt, rt, m); this.x = mathMin(lt[0], rb[0], lb[0], rt[0]); this.y = mathMin(lt[1], rb[1], lb[1], rt[1]); var maxX = mathMax(lt[0], rb[0], lb[0], rt[0]); var maxY = mathMax(lt[1], rb[1], lb[1], rt[1]); this.width = maxX - this.x; this.height = maxY - this.y; }; })(), /** * Calculate matrix of transforming from self to target rect * @param {module:zrender/core/BoundingRect} b * @return {Array.} */ calculateTransform: function (b) { var a = this; var sx = b.width / a.width; var sy = b.height / a.height; var m = create$1(); // 矩阵右乘 translate(m, m, [-a.x, -a.y]); scale$1(m, m, [sx, sy]); translate(m, m, [b.x, b.y]); return m; }, /** * @param {(module:echarts/core/BoundingRect|Object)} b * @return {boolean} */ intersect: function (b) { if (!b) { return false; } if (!(b instanceof BoundingRect)) { // Normalize negative width/height. b = BoundingRect.create(b); } var a = this; var ax0 = a.x; var ax1 = a.x + a.width; var ay0 = a.y; var ay1 = a.y + a.height; var bx0 = b.x; var bx1 = b.x + b.width; var by0 = b.y; var by1 = b.y + b.height; return ! (ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0); }, contain: function (x, y) { var rect = this; return x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height); }, /** * @return {module:echarts/core/BoundingRect} */ clone: function () { return new BoundingRect(this.x, this.y, this.width, this.height); }, /** * Copy from another rect */ copy: function (other) { this.x = other.x; this.y = other.y; this.width = other.width; this.height = other.height; }, plain: function () { return { x: this.x, y: this.y, width: this.width, height: this.height }; } }; /** * @param {Object|module:zrender/core/BoundingRect} rect * @param {number} rect.x * @param {number} rect.y * @param {number} rect.width * @param {number} rect.height * @return {module:zrender/core/BoundingRect} */ BoundingRect.create = function (rect) { return new BoundingRect(rect.x, rect.y, rect.width, rect.height); }; /** * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上 * @module zrender/graphic/Group * @example * var Group = require('zrender/container/Group'); * var Circle = require('zrender/graphic/shape/Circle'); * var g = new Group(); * g.position[0] = 100; * g.position[1] = 100; * g.add(new Circle({ * style: { * x: 100, * y: 100, * r: 20, * } * })); * zr.add(g); */ /** * @alias module:zrender/graphic/Group * @constructor * @extends module:zrender/mixin/Transformable * @extends module:zrender/mixin/Eventful */ var Group = function (opts) { opts = opts || {}; Element.call(this, opts); for (var key in opts) { if (opts.hasOwnProperty(key)) { this[key] = opts[key]; } } this._children = []; this.__storage = null; this.__dirty = true; }; Group.prototype = { constructor: Group, isGroup: true, /** * @type {string} */ type: 'group', /** * 所有子孙元素是否响应鼠标事件 * @name module:/zrender/container/Group#silent * @type {boolean} * @default false */ silent: false, /** * @return {Array.} */ children: function () { return this._children.slice(); }, /** * 获取指定 index 的儿子节点 * @param {number} idx * @return {module:zrender/Element} */ childAt: function (idx) { return this._children[idx]; }, /** * 获取指定名字的儿子节点 * @param {string} name * @return {module:zrender/Element} */ childOfName: function (name) { var children = this._children; for (var i = 0; i < children.length; i++) { if (children[i].name === name) { return children[i]; } } }, /** * @return {number} */ childCount: function () { return this._children.length; }, /** * 添加子节点到最后 * @param {module:zrender/Element} child */ add: function (child) { if (child && child !== this && child.parent !== this) { this._children.push(child); this._doAdd(child); } return this; }, /** * 添加子节点在 nextSibling 之前 * @param {module:zrender/Element} child * @param {module:zrender/Element} nextSibling */ addBefore: function (child, nextSibling) { if (child && child !== this && child.parent !== this && nextSibling && nextSibling.parent === this) { var children = this._children; var idx = children.indexOf(nextSibling); if (idx >= 0) { children.splice(idx, 0, child); this._doAdd(child); } } return this; }, _doAdd: function (child) { if (child.parent) { child.parent.remove(child); } child.parent = this; var storage = this.__storage; var zr = this.__zr; if (storage && storage !== child.__storage) { storage.addToStorage(child); if (child instanceof Group) { child.addChildrenToStorage(storage); } } zr && zr.refresh(); }, /** * 移除子节点 * @param {module:zrender/Element} child */ remove: function (child) { var zr = this.__zr; var storage = this.__storage; var children = this._children; var idx = indexOf(children, child); if (idx < 0) { return this; } children.splice(idx, 1); child.parent = null; if (storage) { storage.delFromStorage(child); if (child instanceof Group) { child.delChildrenFromStorage(storage); } } zr && zr.refresh(); return this; }, /** * 移除所有子节点 */ removeAll: function () { var children = this._children; var storage = this.__storage; var child; var i; for (i = 0; i < children.length; i++) { child = children[i]; if (storage) { storage.delFromStorage(child); if (child instanceof Group) { child.delChildrenFromStorage(storage); } } child.parent = null; } children.length = 0; return this; }, /** * 遍历所有子节点 * @param {Function} cb * @param {} context */ eachChild: function (cb, context) { var children = this._children; for (var i = 0; i < children.length; i++) { var child = children[i]; cb.call(context, child, i); } return this; }, /** * 深度优先遍历所有子孙节点 * @param {Function} cb * @param {} context */ traverse: function (cb, context) { for (var i = 0; i < this._children.length; i++) { var child = this._children[i]; cb.call(context, child); if (child.type === 'group') { child.traverse(cb, context); } } return this; }, addChildrenToStorage: function (storage) { for (var i = 0; i < this._children.length; i++) { var child = this._children[i]; storage.addToStorage(child); if (child instanceof Group) { child.addChildrenToStorage(storage); } } }, delChildrenFromStorage: function (storage) { for (var i = 0; i < this._children.length; i++) { var child = this._children[i]; storage.delFromStorage(child); if (child instanceof Group) { child.delChildrenFromStorage(storage); } } }, dirty: function () { this.__dirty = true; this.__zr && this.__zr.refresh(); return this; }, /** * @return {module:zrender/core/BoundingRect} */ getBoundingRect: function (includeChildren) { // TODO Caching var rect = null; var tmpRect = new BoundingRect(0, 0, 0, 0); var children = includeChildren || this._children; var tmpMat = []; for (var i = 0; i < children.length; i++) { var child = children[i]; if (child.ignore || child.invisible) { continue; } var childRect = child.getBoundingRect(); var transform = child.getLocalTransform(tmpMat); // TODO // The boundingRect cacluated by transforming original // rect may be bigger than the actual bundingRect when rotation // is used. (Consider a circle rotated aginst its center, where // the actual boundingRect should be the same as that not be // rotated.) But we can not find better approach to calculate // actual boundingRect yet, considering performance. if (transform) { tmpRect.copy(childRect); tmpRect.applyTransform(transform); rect = rect || tmpRect.clone(); rect.union(tmpRect); } else { rect = rect || childRect.clone(); rect.union(childRect); } } return rect || tmpRect; } }; inherits(Group, Element); // https://github.com/mziccard/node-timsort var DEFAULT_MIN_MERGE = 32; var DEFAULT_MIN_GALLOPING = 7; function minRunLength(n) { var r = 0; while (n >= DEFAULT_MIN_MERGE) { r |= n & 1; n >>= 1; } return n + r; } function makeAscendingRun(array, lo, hi, compare) { var runHi = lo + 1; if (runHi === hi) { return 1; } if (compare(array[runHi++], array[lo]) < 0) { while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) { runHi++; } reverseRun(array, lo, runHi); } else { while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) { runHi++; } } return runHi - lo; } function reverseRun(array, lo, hi) { hi--; while (lo < hi) { var t = array[lo]; array[lo++] = array[hi]; array[hi--] = t; } } function binaryInsertionSort(array, lo, hi, start, compare) { if (start === lo) { start++; } for (; start < hi; start++) { var pivot = array[start]; var left = lo; var right = start; var mid; while (left < right) { mid = left + right >>> 1; if (compare(pivot, array[mid]) < 0) { right = mid; } else { left = mid + 1; } } var n = start - left; switch (n) { case 3: array[left + 3] = array[left + 2]; case 2: array[left + 2] = array[left + 1]; case 1: array[left + 1] = array[left]; break; default: while (n > 0) { array[left + n] = array[left + n - 1]; n--; } } array[left] = pivot; } } function gallopLeft(value, array, start, length, hint, compare) { var lastOffset = 0; var maxOffset = 0; var offset = 1; if (compare(value, array[start + hint]) > 0) { maxOffset = length - hint; while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { offset = maxOffset; } } if (offset > maxOffset) { offset = maxOffset; } lastOffset += hint; offset += hint; } else { maxOffset = hint + 1; while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { offset = maxOffset; } } if (offset > maxOffset) { offset = maxOffset; } var tmp = lastOffset; lastOffset = hint - offset; offset = hint - tmp; } lastOffset++; while (lastOffset < offset) { var m = lastOffset + (offset - lastOffset >>> 1); if (compare(value, array[start + m]) > 0) { lastOffset = m + 1; } else { offset = m; } } return offset; } function gallopRight(value, array, start, length, hint, compare) { var lastOffset = 0; var maxOffset = 0; var offset = 1; if (compare(value, array[start + hint]) < 0) { maxOffset = hint + 1; while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { offset = maxOffset; } } if (offset > maxOffset) { offset = maxOffset; } var tmp = lastOffset; lastOffset = hint - offset; offset = hint - tmp; } else { maxOffset = length - hint; while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) { lastOffset = offset; offset = (offset << 1) + 1; if (offset <= 0) { offset = maxOffset; } } if (offset > maxOffset) { offset = maxOffset; } lastOffset += hint; offset += hint; } lastOffset++; while (lastOffset < offset) { var m = lastOffset + (offset - lastOffset >>> 1); if (compare(value, array[start + m]) < 0) { offset = m; } else { lastOffset = m + 1; } } return offset; } function TimSort(array, compare) { var minGallop = DEFAULT_MIN_GALLOPING; var runStart; var runLength; var stackSize = 0; var tmp = []; runStart = []; runLength = []; function pushRun(_runStart, _runLength) { runStart[stackSize] = _runStart; runLength[stackSize] = _runLength; stackSize += 1; } function mergeRuns() { while (stackSize > 1) { var n = stackSize - 2; if (n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1] || n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1]) { if (runLength[n - 1] < runLength[n + 1]) { n--; } } else if (runLength[n] > runLength[n + 1]) { break; } mergeAt(n); } } function forceMergeRuns() { while (stackSize > 1) { var n = stackSize - 2; if (n > 0 && runLength[n - 1] < runLength[n + 1]) { n--; } mergeAt(n); } } function mergeAt(i) { var start1 = runStart[i]; var length1 = runLength[i]; var start2 = runStart[i + 1]; var length2 = runLength[i + 1]; runLength[i] = length1 + length2; if (i === stackSize - 3) { runStart[i + 1] = runStart[i + 2]; runLength[i + 1] = runLength[i + 2]; } stackSize--; var k = gallopRight(array[start2], array, start1, length1, 0, compare); start1 += k; length1 -= k; if (length1 === 0) { return; } length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare); if (length2 === 0) { return; } if (length1 <= length2) { mergeLow(start1, length1, start2, length2); } else { mergeHigh(start1, length1, start2, length2); } } function mergeLow(start1, length1, start2, length2) { var i = 0; for (i = 0; i < length1; i++) { tmp[i] = array[start1 + i]; } var cursor1 = 0; var cursor2 = start2; var dest = start1; array[dest++] = array[cursor2++]; if (--length2 === 0) { for (i = 0; i < length1; i++) { array[dest + i] = tmp[cursor1 + i]; } return; } if (length1 === 1) { for (i = 0; i < length2; i++) { array[dest + i] = array[cursor2 + i]; } array[dest + length2] = tmp[cursor1]; return; } var _minGallop = minGallop; var count1, count2, exit; while (1) { count1 = 0; count2 = 0; exit = false; do { if (compare(array[cursor2], tmp[cursor1]) < 0) { array[dest++] = array[cursor2++]; count2++; count1 = 0; if (--length2 === 0) { exit = true; break; } } else { array[dest++] = tmp[cursor1++]; count1++; count2 = 0; if (--length1 === 1) { exit = true; break; } } } while ((count1 | count2) < _minGallop); if (exit) { break; } do { count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare); if (count1 !== 0) { for (i = 0; i < count1; i++) { array[dest + i] = tmp[cursor1 + i]; } dest += count1; cursor1 += count1; length1 -= count1; if (length1 <= 1) { exit = true; break; } } array[dest++] = array[cursor2++]; if (--length2 === 0) { exit = true; break; } count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare); if (count2 !== 0) { for (i = 0; i < count2; i++) { array[dest + i] = array[cursor2 + i]; } dest += count2; cursor2 += count2; length2 -= count2; if (length2 === 0) { exit = true; break; } } array[dest++] = tmp[cursor1++]; if (--length1 === 1) { exit = true; break; } _minGallop--; } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); if (exit) { break; } if (_minGallop < 0) { _minGallop = 0; } _minGallop += 2; } minGallop = _minGallop; minGallop < 1 && (minGallop = 1); if (length1 === 1) { for (i = 0; i < length2; i++) { array[dest + i] = array[cursor2 + i]; } array[dest + length2] = tmp[cursor1]; } else if (length1 === 0) { throw new Error(); // throw new Error('mergeLow preconditions were not respected'); } else { for (i = 0; i < length1; i++) { array[dest + i] = tmp[cursor1 + i]; } } } function mergeHigh (start1, length1, start2, length2) { var i = 0; for (i = 0; i < length2; i++) { tmp[i] = array[start2 + i]; } var cursor1 = start1 + length1 - 1; var cursor2 = length2 - 1; var dest = start2 + length2 - 1; var customCursor = 0; var customDest = 0; array[dest--] = array[cursor1--]; if (--length1 === 0) { customCursor = dest - (length2 - 1); for (i = 0; i < length2; i++) { array[customCursor + i] = tmp[i]; } return; } if (length2 === 1) { dest -= length1; cursor1 -= length1; customDest = dest + 1; customCursor = cursor1 + 1; for (i = length1 - 1; i >= 0; i--) { array[customDest + i] = array[customCursor + i]; } array[dest] = tmp[cursor2]; return; } var _minGallop = minGallop; while (true) { var count1 = 0; var count2 = 0; var exit = false; do { if (compare(tmp[cursor2], array[cursor1]) < 0) { array[dest--] = array[cursor1--]; count1++; count2 = 0; if (--length1 === 0) { exit = true; break; } } else { array[dest--] = tmp[cursor2--]; count2++; count1 = 0; if (--length2 === 1) { exit = true; break; } } } while ((count1 | count2) < _minGallop); if (exit) { break; } do { count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare); if (count1 !== 0) { dest -= count1; cursor1 -= count1; length1 -= count1; customDest = dest + 1; customCursor = cursor1 + 1; for (i = count1 - 1; i >= 0; i--) { array[customDest + i] = array[customCursor + i]; } if (length1 === 0) { exit = true; break; } } array[dest--] = tmp[cursor2--]; if (--length2 === 1) { exit = true; break; } count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare); if (count2 !== 0) { dest -= count2; cursor2 -= count2; length2 -= count2; customDest = dest + 1; customCursor = cursor2 + 1; for (i = 0; i < count2; i++) { array[customDest + i] = tmp[customCursor + i]; } if (length2 <= 1) { exit = true; break; } } array[dest--] = array[cursor1--]; if (--length1 === 0) { exit = true; break; } _minGallop--; } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); if (exit) { break; } if (_minGallop < 0) { _minGallop = 0; } _minGallop += 2; } minGallop = _minGallop; if (minGallop < 1) { minGallop = 1; } if (length2 === 1) { dest -= length1; cursor1 -= length1; customDest = dest + 1; customCursor = cursor1 + 1; for (i = length1 - 1; i >= 0; i--) { array[customDest + i] = array[customCursor + i]; } array[dest] = tmp[cursor2]; } else if (length2 === 0) { throw new Error(); // throw new Error('mergeHigh preconditions were not respected'); } else { customCursor = dest - (length2 - 1); for (i = 0; i < length2; i++) { array[customCursor + i] = tmp[i]; } } } this.mergeRuns = mergeRuns; this.forceMergeRuns = forceMergeRuns; this.pushRun = pushRun; } function sort(array, compare, lo, hi) { if (!lo) { lo = 0; } if (!hi) { hi = array.length; } var remaining = hi - lo; if (remaining < 2) { return; } var runLength = 0; if (remaining < DEFAULT_MIN_MERGE) { runLength = makeAscendingRun(array, lo, hi, compare); binaryInsertionSort(array, lo, hi, lo + runLength, compare); return; } var ts = new TimSort(array, compare); var minRun = minRunLength(remaining); do { runLength = makeAscendingRun(array, lo, hi, compare); if (runLength < minRun) { var force = remaining; if (force > minRun) { force = minRun; } binaryInsertionSort(array, lo, lo + force, lo + runLength, compare); runLength = force; } ts.pushRun(lo, runLength); ts.mergeRuns(); remaining -= runLength; lo += runLength; } while (remaining !== 0); ts.forceMergeRuns(); } // Use timsort because in most case elements are partially sorted // https://jsfiddle.net/pissang/jr4x7mdm/8/ function shapeCompareFunc(a, b) { if (a.zlevel === b.zlevel) { if (a.z === b.z) { // if (a.z2 === b.z2) { // // FIXME Slow has renderidx compare // // http://stackoverflow.com/questions/20883421/sorting-in-javascript-should-every-compare-function-have-a-return-0-statement // // https://github.com/v8/v8/blob/47cce544a31ed5577ffe2963f67acb4144ee0232/src/js/array.js#L1012 // return a.__renderidx - b.__renderidx; // } return a.z2 - b.z2; } return a.z - b.z; } return a.zlevel - b.zlevel; } /** * 内容仓库 (M) * @alias module:zrender/Storage * @constructor */ var Storage = function () { // jshint ignore:line this._roots = []; this._displayList = []; this._displayListLen = 0; }; Storage.prototype = { constructor: Storage, /** * @param {Function} cb * */ traverse: function (cb, context) { for (var i = 0; i < this._roots.length; i++) { this._roots[i].traverse(cb, context); } }, /** * 返回所有图形的绘制队列 * @param {boolean} [update=false] 是否在返回前更新该数组 * @param {boolean} [includeIgnore=false] 是否包含 ignore 的数组, 在 update 为 true 的时候有效 * * 详见{@link module:zrender/graphic/Displayable.prototype.updateDisplayList} * @return {Array.} */ getDisplayList: function (update, includeIgnore) { includeIgnore = includeIgnore || false; if (update) { this.updateDisplayList(includeIgnore); } return this._displayList; }, /** * 更新图形的绘制队列。 * 每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中, * 最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列 * @param {boolean} [includeIgnore=false] 是否包含 ignore 的数组 */ updateDisplayList: function (includeIgnore) { this._displayListLen = 0; var roots = this._roots; var displayList = this._displayList; for (var i = 0, len = roots.length; i < len; i++) { this._updateAndAddDisplayable(roots[i], null, includeIgnore); } displayList.length = this._displayListLen; env$1.canvasSupported && sort(displayList, shapeCompareFunc); }, _updateAndAddDisplayable: function (el, clipPaths, includeIgnore) { if (el.ignore && !includeIgnore) { return; } el.beforeUpdate(); if (el.__dirty) { el.update(); } el.afterUpdate(); var userSetClipPath = el.clipPath; if (userSetClipPath) { // FIXME 效率影响 if (clipPaths) { clipPaths = clipPaths.slice(); } else { clipPaths = []; } var currentClipPath = userSetClipPath; var parentClipPath = el; // Recursively add clip path while (currentClipPath) { // clipPath 的变换是基于使用这个 clipPath 的元素 currentClipPath.parent = parentClipPath; currentClipPath.updateTransform(); clipPaths.push(currentClipPath); parentClipPath = currentClipPath; currentClipPath = currentClipPath.clipPath; } } if (el.isGroup) { var children = el._children; for (var i = 0; i < children.length; i++) { var child = children[i]; // Force to mark as dirty if group is dirty // FIXME __dirtyPath ? if (el.__dirty) { child.__dirty = true; } this._updateAndAddDisplayable(child, clipPaths, includeIgnore); } // Mark group clean here el.__dirty = false; } else { el.__clipPaths = clipPaths; this._displayList[this._displayListLen++] = el; } }, /** * 添加图形(Shape)或者组(Group)到根节点 * @param {module:zrender/Element} el */ addRoot: function (el) { if (el.__storage === this) { return; } if (el instanceof Group) { el.addChildrenToStorage(this); } this.addToStorage(el); this._roots.push(el); }, /** * 删除指定的图形(Shape)或者组(Group) * @param {string|Array.} [el] 如果为空清空整个Storage */ delRoot: function (el) { if (el == null) { // 不指定el清空 for (var i = 0; i < this._roots.length; i++) { var root = this._roots[i]; if (root instanceof Group) { root.delChildrenFromStorage(this); } } this._roots = []; this._displayList = []; this._displayListLen = 0; return; } if (el instanceof Array) { for (var i = 0, l = el.length; i < l; i++) { this.delRoot(el[i]); } return; } var idx = indexOf(this._roots, el); if (idx >= 0) { this.delFromStorage(el); this._roots.splice(idx, 1); if (el instanceof Group) { el.delChildrenFromStorage(this); } } }, addToStorage: function (el) { if (el) { el.__storage = this; el.dirty(false); } return this; }, delFromStorage: function (el) { if (el) { el.__storage = null; } return this; }, /** * 清空并且释放Storage */ dispose: function () { this._renderList = this._roots = null; }, displayableSortFunc: shapeCompareFunc }; var SHADOW_PROPS = { 'shadowBlur': 1, 'shadowOffsetX': 1, 'shadowOffsetY': 1, 'textShadowBlur': 1, 'textShadowOffsetX': 1, 'textShadowOffsetY': 1, 'textBoxShadowBlur': 1, 'textBoxShadowOffsetX': 1, 'textBoxShadowOffsetY': 1 }; var fixShadow = function (ctx, propName, value) { if (SHADOW_PROPS.hasOwnProperty(propName)) { return value *= ctx.dpr; } return value; }; var STYLE_COMMON_PROPS = [ ['shadowBlur', 0], ['shadowOffsetX', 0], ['shadowOffsetY', 0], ['shadowColor', '#000'], ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10] ]; // var SHADOW_PROPS = STYLE_COMMON_PROPS.slice(0, 4); // var LINE_PROPS = STYLE_COMMON_PROPS.slice(4); var Style = function (opts, host) { this.extendFrom(opts, false); this.host = host; }; function createLinearGradient(ctx, obj, rect) { var x = obj.x == null ? 0 : obj.x; var x2 = obj.x2 == null ? 1 : obj.x2; var y = obj.y == null ? 0 : obj.y; var y2 = obj.y2 == null ? 0 : obj.y2; if (!obj.global) { x = x * rect.width + rect.x; x2 = x2 * rect.width + rect.x; y = y * rect.height + rect.y; y2 = y2 * rect.height + rect.y; } // Fix NaN when rect is Infinity x = isNaN(x) ? 0 : x; x2 = isNaN(x2) ? 1 : x2; y = isNaN(y) ? 0 : y; y2 = isNaN(y2) ? 0 : y2; var canvasGradient = ctx.createLinearGradient(x, y, x2, y2); return canvasGradient; } function createRadialGradient(ctx, obj, rect) { var width = rect.width; var height = rect.height; var min = Math.min(width, height); var x = obj.x == null ? 0.5 : obj.x; var y = obj.y == null ? 0.5 : obj.y; var r = obj.r == null ? 0.5 : obj.r; if (!obj.global) { x = x * width + rect.x; y = y * height + rect.y; r = r * min; } var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r); return canvasGradient; } Style.prototype = { constructor: Style, /** * @type {module:zrender/graphic/Displayable} */ host: null, /** * @type {string} */ fill: '#000', /** * @type {string} */ stroke: null, /** * @type {number} */ opacity: 1, /** * @type {Array.} */ lineDash: null, /** * @type {number} */ lineDashOffset: 0, /** * @type {number} */ shadowBlur: 0, /** * @type {number} */ shadowOffsetX: 0, /** * @type {number} */ shadowOffsetY: 0, /** * @type {number} */ lineWidth: 1, /** * If stroke ignore scale * @type {Boolean} */ strokeNoScale: false, // Bounding rect text configuration // Not affected by element transform /** * @type {string} */ text: null, /** * If `fontSize` or `fontFamily` exists, `font` will be reset by * `fontSize`, `fontStyle`, `fontWeight`, `fontFamily`. * So do not visit it directly in upper application (like echarts), * but use `contain/text#makeFont` instead. * @type {string} */ font: null, /** * The same as font. Use font please. * @deprecated * @type {string} */ textFont: null, /** * It helps merging respectively, rather than parsing an entire font string. * @type {string} */ fontStyle: null, /** * It helps merging respectively, rather than parsing an entire font string. * @type {string} */ fontWeight: null, /** * It helps merging respectively, rather than parsing an entire font string. * Should be 12 but not '12px'. * @type {number} */ fontSize: null, /** * It helps merging respectively, rather than parsing an entire font string. * @type {string} */ fontFamily: null, /** * Reserved for special functinality, like 'hr'. * @type {string} */ textTag: null, /** * @type {string} */ textFill: '#000', /** * @type {string} */ textStroke: null, /** * @type {number} */ textWidth: null, /** * Only for textBackground. * @type {number} */ textHeight: null, /** * textStroke may be set as some color as a default * value in upper applicaion, where the default value * of textStrokeWidth should be 0 to make sure that * user can choose to do not use text stroke. * @type {number} */ textStrokeWidth: 0, /** * @type {number} */ textLineHeight: null, /** * 'inside', 'left', 'right', 'top', 'bottom' * [x, y] * Based on x, y of rect. * @type {string|Array.} * @default 'inside' */ textPosition: 'inside', /** * If not specified, use the boundingRect of a `displayable`. * @type {Object} */ textRect: null, /** * [x, y] * @type {Array.} */ textOffset: null, /** * @type {string} */ textAlign: null, /** * @type {string} */ textVerticalAlign: null, /** * @type {number} */ textDistance: 5, /** * @type {string} */ textShadowColor: 'transparent', /** * @type {number} */ textShadowBlur: 0, /** * @type {number} */ textShadowOffsetX: 0, /** * @type {number} */ textShadowOffsetY: 0, /** * @type {string} */ textBoxShadowColor: 'transparent', /** * @type {number} */ textBoxShadowBlur: 0, /** * @type {number} */ textBoxShadowOffsetX: 0, /** * @type {number} */ textBoxShadowOffsetY: 0, /** * Whether transform text. * Only useful in Path and Image element * @type {boolean} */ transformText: false, /** * Text rotate around position of Path or Image * Only useful in Path and Image element and transformText is false. */ textRotation: 0, /** * Text origin of text rotation, like [10, 40]. * Based on x, y of rect. * Useful in label rotation of circular symbol. * By default, this origin is textPosition. * Can be 'center'. * @type {string|Array.} */ textOrigin: null, /** * @type {string} */ textBackgroundColor: null, /** * @type {string} */ textBorderColor: null, /** * @type {number} */ textBorderWidth: 0, /** * @type {number} */ textBorderRadius: 0, /** * Can be `2` or `[2, 4]` or `[2, 3, 4, 5]` * @type {number|Array.} */ textPadding: null, /** * Text styles for rich text. * @type {Object} */ rich: null, /** * {outerWidth, outerHeight, ellipsis, placeholder} * @type {Object} */ truncate: null, /** * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation * @type {string} */ blend: null, /** * @param {CanvasRenderingContext2D} ctx */ bind: function (ctx, el, prevEl) { var style = this; var prevStyle = prevEl && prevEl.style; var firstDraw = !prevStyle; for (var i = 0; i < STYLE_COMMON_PROPS.length; i++) { var prop = STYLE_COMMON_PROPS[i]; var styleName = prop[0]; if (firstDraw || style[styleName] !== prevStyle[styleName]) { // FIXME Invalid property value will cause style leak from previous element. ctx[styleName] = fixShadow(ctx, styleName, style[styleName] || prop[1]); } } if ((firstDraw || style.fill !== prevStyle.fill)) { ctx.fillStyle = style.fill; } if ((firstDraw || style.stroke !== prevStyle.stroke)) { ctx.strokeStyle = style.stroke; } if ((firstDraw || style.opacity !== prevStyle.opacity)) { ctx.globalAlpha = style.opacity == null ? 1 : style.opacity; } if ((firstDraw || style.blend !== prevStyle.blend)) { ctx.globalCompositeOperation = style.blend || 'source-over'; } if (this.hasStroke()) { var lineWidth = style.lineWidth; ctx.lineWidth = lineWidth / ( (this.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1 ); } }, hasFill: function () { var fill = this.fill; return fill != null && fill !== 'none'; }, hasStroke: function () { var stroke = this.stroke; return stroke != null && stroke !== 'none' && this.lineWidth > 0; }, /** * Extend from other style * @param {zrender/graphic/Style} otherStyle * @param {boolean} overwrite true: overwrirte any way. * false: overwrite only when !target.hasOwnProperty * others: overwrite when property is not null/undefined. */ extendFrom: function (otherStyle, overwrite) { if (otherStyle) { for (var name in otherStyle) { if (otherStyle.hasOwnProperty(name) && (overwrite === true || ( overwrite === false ? !this.hasOwnProperty(name) : otherStyle[name] != null ) ) ) { this[name] = otherStyle[name]; } } } }, /** * Batch setting style with a given object * @param {Object|string} obj * @param {*} [obj] */ set: function (obj, value) { if (typeof obj === 'string') { this[obj] = value; } else { this.extendFrom(obj, true); } }, /** * Clone * @return {zrender/graphic/Style} [description] */ clone: function () { var newStyle = new this.constructor(); newStyle.extendFrom(this, true); return newStyle; }, getGradient: function (ctx, obj, rect) { var method = obj.type === 'radial' ? createRadialGradient : createLinearGradient; var canvasGradient = method(ctx, obj, rect); var colorStops = obj.colorStops; for (var i = 0; i < colorStops.length; i++) { canvasGradient.addColorStop( colorStops[i].offset, colorStops[i].color ); } return canvasGradient; } }; var styleProto = Style.prototype; for (var i = 0; i < STYLE_COMMON_PROPS.length; i++) { var prop = STYLE_COMMON_PROPS[i]; if (!(prop[0] in styleProto)) { styleProto[prop[0]] = prop[1]; } } // Provide for others Style.getGradient = styleProto.getGradient; var Pattern = function (image, repeat) { // Should do nothing more in this constructor. Because gradient can be // declard by `color: {image: ...}`, where this constructor will not be called. this.image = image; this.repeat = repeat; // Can be cloned this.type = 'pattern'; }; Pattern.prototype.getCanvasPattern = function (ctx) { return ctx.createPattern(this.image, this.repeat || 'repeat'); }; /** * @module zrender/Layer * @author pissang(https://www.github.com/pissang) */ function returnFalse() { return false; } /** * 创建dom * * @inner * @param {string} id dom id 待用 * @param {Painter} painter painter instance * @param {number} number */ function createDom(id, painter, dpr) { var newDom = createCanvas(); var width = painter.getWidth(); var height = painter.getHeight(); var newDomStyle = newDom.style; if (newDomStyle) { // In node or some other non-browser environment newDomStyle.position = 'absolute'; newDomStyle.left = 0; newDomStyle.top = 0; newDomStyle.width = width + 'px'; newDomStyle.height = height + 'px'; newDom.setAttribute('data-zr-dom-id', id); } newDom.width = width * dpr; newDom.height = height * dpr; return newDom; } /** * @alias module:zrender/Layer * @constructor * @extends module:zrender/mixin/Transformable * @param {string} id * @param {module:zrender/Painter} painter * @param {number} [dpr] */ var Layer = function(id, painter, dpr) { var dom; dpr = dpr || devicePixelRatio; if (typeof id === 'string') { dom = createDom(id, painter, dpr); } // Not using isDom because in node it will return false else if (isObject$1(id)) { dom = id; id = dom.id; } this.id = id; this.dom = dom; var domStyle = dom.style; if (domStyle) { // Not in node dom.onselectstart = returnFalse; // 避免页面选中的尴尬 domStyle['-webkit-user-select'] = 'none'; domStyle['user-select'] = 'none'; domStyle['-webkit-touch-callout'] = 'none'; domStyle['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)'; domStyle['padding'] = 0; domStyle['margin'] = 0; domStyle['border-width'] = 0; } this.domBack = null; this.ctxBack = null; this.painter = painter; this.config = null; // Configs /** * 每次清空画布的颜色 * @type {string} * @default 0 */ this.clearColor = 0; /** * 是否开启动态模糊 * @type {boolean} * @default false */ this.motionBlur = false; /** * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 * @type {number} * @default 0.7 */ this.lastFrameAlpha = 0.7; /** * Layer dpr * @type {number} */ this.dpr = dpr; }; Layer.prototype = { constructor: Layer, __dirty: true, __used: false, __drawIndex: 0, __startIndex: 0, __endIndex: 0, incremental: false, getElementCount: function () { return this.__endIndex - this.__startIndex; }, initContext: function () { this.ctx = this.dom.getContext('2d'); this.ctx.dpr = this.dpr; }, createBackBuffer: function () { var dpr = this.dpr; this.domBack = createDom('back-' + this.id, this.painter, dpr); this.ctxBack = this.domBack.getContext('2d'); if (dpr != 1) { this.ctxBack.scale(dpr, dpr); } }, /** * @param {number} width * @param {number} height */ resize: function (width, height) { var dpr = this.dpr; var dom = this.dom; var domStyle = dom.style; var domBack = this.domBack; if (domStyle) { domStyle.width = width + 'px'; domStyle.height = height + 'px'; } dom.width = width * dpr; dom.height = height * dpr; if (domBack) { domBack.width = width * dpr; domBack.height = height * dpr; if (dpr != 1) { this.ctxBack.scale(dpr, dpr); } } }, /** * 清空该层画布 * @param {boolean} [clearAll]=false Clear all with out motion blur * @param {Color} [clearColor] */ clear: function (clearAll, clearColor) { var dom = this.dom; var ctx = this.ctx; var width = dom.width; var height = dom.height; var clearColor = clearColor || this.clearColor; var haveMotionBLur = this.motionBlur && !clearAll; var lastFrameAlpha = this.lastFrameAlpha; var dpr = this.dpr; if (haveMotionBLur) { if (!this.domBack) { this.createBackBuffer(); } this.ctxBack.globalCompositeOperation = 'copy'; this.ctxBack.drawImage( dom, 0, 0, width / dpr, height / dpr ); } ctx.clearRect(0, 0, width, height); if (clearColor && clearColor !== 'transparent') { var clearColorGradientOrPattern; // Gradient if (clearColor.colorStops) { // Cache canvas gradient clearColorGradientOrPattern = clearColor.__canvasGradient || Style.getGradient(ctx, clearColor, { x: 0, y: 0, width: width, height: height }); clearColor.__canvasGradient = clearColorGradientOrPattern; } // Pattern else if (clearColor.image) { clearColorGradientOrPattern = Pattern.prototype.getCanvasPattern.call(clearColor, ctx); } ctx.save(); ctx.fillStyle = clearColorGradientOrPattern || clearColor; ctx.fillRect(0, 0, width, height); ctx.restore(); } if (haveMotionBLur) { var domBack = this.domBack; ctx.save(); ctx.globalAlpha = lastFrameAlpha; ctx.drawImage(domBack, 0, 0, width, height); ctx.restore(); } } }; var requestAnimationFrame = ( typeof window !== 'undefined' && ( (window.requestAnimationFrame && window.requestAnimationFrame.bind(window)) // https://github.com/ecomfe/zrender/issues/189#issuecomment-224919809 || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window)) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ) ) || function (func) { setTimeout(func, 16); }; var globalImageCache = new LRU(50); /** * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image */ function findExistImage(newImageOrSrc) { if (typeof newImageOrSrc === 'string') { var cachedImgObj = globalImageCache.get(newImageOrSrc); return cachedImgObj && cachedImgObj.image; } else { return newImageOrSrc; } } /** * Caution: User should cache loaded images, but not just count on LRU. * Consider if required images more than LRU size, will dead loop occur? * * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc * @param {HTMLImageElement|HTMLCanvasElement|Canvas} image Existent image. * @param {module:zrender/Element} [hostEl] For calling `dirty`. * @param {Function} [cb] params: (image, cbPayload) * @param {Object} [cbPayload] Payload on cb calling. * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image */ function createOrUpdateImage(newImageOrSrc, image, hostEl, cb, cbPayload) { if (!newImageOrSrc) { return image; } else if (typeof newImageOrSrc === 'string') { // Image should not be loaded repeatly. if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) { return image; } // Only when there is no existent image or existent image src // is different, this method is responsible for load. var cachedImgObj = globalImageCache.get(newImageOrSrc); var pendingWrap = {hostEl: hostEl, cb: cb, cbPayload: cbPayload}; if (cachedImgObj) { image = cachedImgObj.image; !isImageReady(image) && cachedImgObj.pending.push(pendingWrap); } else { !image && (image = new Image()); image.onload = imageOnLoad; globalImageCache.put( newImageOrSrc, image.__cachedImgObj = { image: image, pending: [pendingWrap] } ); image.src = image.__zrImageSrc = newImageOrSrc; } return image; } // newImageOrSrc is an HTMLImageElement or HTMLCanvasElement or Canvas else { return newImageOrSrc; } } function imageOnLoad() { var cachedImgObj = this.__cachedImgObj; this.onload = this.__cachedImgObj = null; for (var i = 0; i < cachedImgObj.pending.length; i++) { var pendingWrap = cachedImgObj.pending[i]; var cb = pendingWrap.cb; cb && cb(this, pendingWrap.cbPayload); pendingWrap.hostEl.dirty(); } cachedImgObj.pending.length = 0; } function isImageReady(image) { return image && image.width && image.height; } var textWidthCache = {}; var textWidthCacheCounter = 0; var TEXT_CACHE_MAX = 5000; var STYLE_REG = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g; var DEFAULT_FONT = '12px sans-serif'; // Avoid assign to an exported variable, for transforming to cjs. var methods$1 = {}; function $override$1(name, fn) { methods$1[name] = fn; } /** * @public * @param {string} text * @param {string} font * @return {number} width */ function getWidth(text, font) { font = font || DEFAULT_FONT; var key = text + ':' + font; if (textWidthCache[key]) { return textWidthCache[key]; } var textLines = (text + '').split('\n'); var width = 0; for (var i = 0, l = textLines.length; i < l; i++) { // textContain.measureText may be overrided in SVG or VML width = Math.max(measureText(textLines[i], font).width, width); } if (textWidthCacheCounter > TEXT_CACHE_MAX) { textWidthCacheCounter = 0; textWidthCache = {}; } textWidthCacheCounter++; textWidthCache[key] = width; return width; } /** * @public * @param {string} text * @param {string} font * @param {string} [textAlign='left'] * @param {string} [textVerticalAlign='top'] * @param {Array.} [textPadding] * @param {Object} [rich] * @param {Object} [truncate] * @return {Object} {x, y, width, height, lineHeight} */ function getBoundingRect(text, font, textAlign, textVerticalAlign, textPadding, rich, truncate) { return rich ? getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, rich, truncate) : getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, truncate); } function getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, truncate) { var contentBlock = parsePlainText(text, font, textPadding, truncate); var outerWidth = getWidth(text, font); if (textPadding) { outerWidth += textPadding[1] + textPadding[3]; } var outerHeight = contentBlock.outerHeight; var x = adjustTextX(0, outerWidth, textAlign); var y = adjustTextY(0, outerHeight, textVerticalAlign); var rect = new BoundingRect(x, y, outerWidth, outerHeight); rect.lineHeight = contentBlock.lineHeight; return rect; } function getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, rich, truncate) { var contentBlock = parseRichText(text, { rich: rich, truncate: truncate, font: font, textAlign: textAlign, textPadding: textPadding }); var outerWidth = contentBlock.outerWidth; var outerHeight = contentBlock.outerHeight; var x = adjustTextX(0, outerWidth, textAlign); var y = adjustTextY(0, outerHeight, textVerticalAlign); return new BoundingRect(x, y, outerWidth, outerHeight); } /** * @public * @param {number} x * @param {number} width * @param {string} [textAlign='left'] * @return {number} Adjusted x. */ function adjustTextX(x, width, textAlign) { // FIXME Right to left language if (textAlign === 'right') { x -= width; } else if (textAlign === 'center') { x -= width / 2; } return x; } /** * @public * @param {number} y * @param {number} height * @param {string} [textVerticalAlign='top'] * @return {number} Adjusted y. */ function adjustTextY(y, height, textVerticalAlign) { if (textVerticalAlign === 'middle') { y -= height / 2; } else if (textVerticalAlign === 'bottom') { y -= height; } return y; } /** * @public * @param {stirng} textPosition * @param {Object} rect {x, y, width, height} * @param {number} distance * @return {Object} {x, y, textAlign, textVerticalAlign} */ function adjustTextPositionOnRect(textPosition, rect, distance) { var x = rect.x; var y = rect.y; var height = rect.height; var width = rect.width; var halfHeight = height / 2; var textAlign = 'left'; var textVerticalAlign = 'top'; switch (textPosition) { case 'left': x -= distance; y += halfHeight; textAlign = 'right'; textVerticalAlign = 'middle'; break; case 'right': x += distance + width; y += halfHeight; textVerticalAlign = 'middle'; break; case 'top': x += width / 2; y -= distance; textAlign = 'center'; textVerticalAlign = 'bottom'; break; case 'bottom': x += width / 2; y += height + distance; textAlign = 'center'; break; case 'inside': x += width / 2; y += halfHeight; textAlign = 'center'; textVerticalAlign = 'middle'; break; case 'insideLeft': x += distance; y += halfHeight; textVerticalAlign = 'middle'; break; case 'insideRight': x += width - distance; y += halfHeight; textAlign = 'right'; textVerticalAlign = 'middle'; break; case 'insideTop': x += width / 2; y += distance; textAlign = 'center'; break; case 'insideBottom': x += width / 2; y += height - distance; textAlign = 'center'; textVerticalAlign = 'bottom'; break; case 'insideTopLeft': x += distance; y += distance; break; case 'insideTopRight': x += width - distance; y += distance; textAlign = 'right'; break; case 'insideBottomLeft': x += distance; y += height - distance; textVerticalAlign = 'bottom'; break; case 'insideBottomRight': x += width - distance; y += height - distance; textAlign = 'right'; textVerticalAlign = 'bottom'; break; } return { x: x, y: y, textAlign: textAlign, textVerticalAlign: textVerticalAlign }; } /** * Show ellipsis if overflow. * * @public * @param {string} text * @param {string} containerWidth * @param {string} font * @param {number} [ellipsis='...'] * @param {Object} [options] * @param {number} [options.maxIterations=3] * @param {number} [options.minChar=0] If truncate result are less * then minChar, ellipsis will not show, which is * better for user hint in some cases. * @param {number} [options.placeholder=''] When all truncated, use the placeholder. * @return {string} */ function truncateText(text, containerWidth, font, ellipsis, options) { if (!containerWidth) { return ''; } var textLines = (text + '').split('\n'); options = prepareTruncateOptions(containerWidth, font, ellipsis, options); // FIXME // It is not appropriate that every line has '...' when truncate multiple lines. for (var i = 0, len = textLines.length; i < len; i++) { textLines[i] = truncateSingleLine(textLines[i], options); } return textLines.join('\n'); } function prepareTruncateOptions(containerWidth, font, ellipsis, options) { options = extend({}, options); options.font = font; var ellipsis = retrieve2(ellipsis, '...'); options.maxIterations = retrieve2(options.maxIterations, 2); var minChar = options.minChar = retrieve2(options.minChar, 0); // FIXME // Other languages? options.cnCharWidth = getWidth('国', font); // FIXME // Consider proportional font? var ascCharWidth = options.ascCharWidth = getWidth('a', font); options.placeholder = retrieve2(options.placeholder, ''); // Example 1: minChar: 3, text: 'asdfzxcv', truncate result: 'asdf', but not: 'a...'. // Example 2: minChar: 3, text: '维度', truncate result: '维', but not: '...'. var contentWidth = containerWidth = Math.max(0, containerWidth - 1); // Reserve some gap. for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) { contentWidth -= ascCharWidth; } var ellipsisWidth = getWidth(ellipsis); if (ellipsisWidth > contentWidth) { ellipsis = ''; ellipsisWidth = 0; } contentWidth = containerWidth - ellipsisWidth; options.ellipsis = ellipsis; options.ellipsisWidth = ellipsisWidth; options.contentWidth = contentWidth; options.containerWidth = containerWidth; return options; } function truncateSingleLine(textLine, options) { var containerWidth = options.containerWidth; var font = options.font; var contentWidth = options.contentWidth; if (!containerWidth) { return ''; } var lineWidth = getWidth(textLine, font); if (lineWidth <= containerWidth) { return textLine; } for (var j = 0;; j++) { if (lineWidth <= contentWidth || j >= options.maxIterations) { textLine += options.ellipsis; break; } var subLength = j === 0 ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth) : lineWidth > 0 ? Math.floor(textLine.length * contentWidth / lineWidth) : 0; textLine = textLine.substr(0, subLength); lineWidth = getWidth(textLine, font); } if (textLine === '') { textLine = options.placeholder; } return textLine; } function estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) { var width = 0; var i = 0; for (var len = text.length; i < len && width < contentWidth; i++) { var charCode = text.charCodeAt(i); width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth; } return i; } /** * @public * @param {string} font * @return {number} line height */ function getLineHeight(font) { // FIXME A rough approach. return getWidth('国', font); } /** * @public * @param {string} text * @param {string} font * @return {Object} width */ function measureText(text, font) { return methods$1.measureText(text, font); } // Avoid assign to an exported variable, for transforming to cjs. methods$1.measureText = function (text, font) { var ctx = getContext(); ctx.font = font || DEFAULT_FONT; return ctx.measureText(text); }; /** * @public * @param {string} text * @param {string} font * @param {Object} [truncate] * @return {Object} block: {lineHeight, lines, height, outerHeight} * Notice: for performance, do not calculate outerWidth util needed. */ function parsePlainText(text, font, padding, truncate) { text != null && (text += ''); var lineHeight = getLineHeight(font); var lines = text ? text.split('\n') : []; var height = lines.length * lineHeight; var outerHeight = height; if (padding) { outerHeight += padding[0] + padding[2]; } if (text && truncate) { var truncOuterHeight = truncate.outerHeight; var truncOuterWidth = truncate.outerWidth; if (truncOuterHeight != null && outerHeight > truncOuterHeight) { text = ''; lines = []; } else if (truncOuterWidth != null) { var options = prepareTruncateOptions( truncOuterWidth - (padding ? padding[1] + padding[3] : 0), font, truncate.ellipsis, {minChar: truncate.minChar, placeholder: truncate.placeholder} ); // FIXME // It is not appropriate that every line has '...' when truncate multiple lines. for (var i = 0, len = lines.length; i < len; i++) { lines[i] = truncateSingleLine(lines[i], options); } } } return { lines: lines, height: height, outerHeight: outerHeight, lineHeight: lineHeight }; } /** * For example: 'some text {a|some text}other text{b|some text}xxx{c|}xxx' * Also consider 'bbbb{a|xxx\nzzz}xxxx\naaaa'. * * @public * @param {string} text * @param {Object} style * @return {Object} block * { * width, * height, * lines: [{ * lineHeight, * width, * tokens: [[{ * styleName, * text, * width, // include textPadding * height, // include textPadding * textWidth, // pure text width * textHeight, // pure text height * lineHeihgt, * font, * textAlign, * textVerticalAlign * }], [...], ...] * }, ...] * } * If styleName is undefined, it is plain text. */ function parseRichText(text, style) { var contentBlock = {lines: [], width: 0, height: 0}; text != null && (text += ''); if (!text) { return contentBlock; } var lastIndex = STYLE_REG.lastIndex = 0; var result; while ((result = STYLE_REG.exec(text)) != null) { var matchedIndex = result.index; if (matchedIndex > lastIndex) { pushTokens(contentBlock, text.substring(lastIndex, matchedIndex)); } pushTokens(contentBlock, result[2], result[1]); lastIndex = STYLE_REG.lastIndex; } if (lastIndex < text.length) { pushTokens(contentBlock, text.substring(lastIndex, text.length)); } var lines = contentBlock.lines; var contentHeight = 0; var contentWidth = 0; // For `textWidth: 100%` var pendingList = []; var stlPadding = style.textPadding; var truncate = style.truncate; var truncateWidth = truncate && truncate.outerWidth; var truncateHeight = truncate && truncate.outerHeight; if (stlPadding) { truncateWidth != null && (truncateWidth -= stlPadding[1] + stlPadding[3]); truncateHeight != null && (truncateHeight -= stlPadding[0] + stlPadding[2]); } // Calculate layout info of tokens. for (var i = 0; i < lines.length; i++) { var line = lines[i]; var lineHeight = 0; var lineWidth = 0; for (var j = 0; j < line.tokens.length; j++) { var token = line.tokens[j]; var tokenStyle = token.styleName && style.rich[token.styleName] || {}; // textPadding should not inherit from style. var textPadding = token.textPadding = tokenStyle.textPadding; // textFont has been asigned to font by `normalizeStyle`. var font = token.font = tokenStyle.font || style.font; // textHeight can be used when textVerticalAlign is specified in token. var tokenHeight = token.textHeight = retrieve2( // textHeight should not be inherited, consider it can be specified // as box height of the block. tokenStyle.textHeight, getLineHeight(font) ); textPadding && (tokenHeight += textPadding[0] + textPadding[2]); token.height = tokenHeight; token.lineHeight = retrieve3( tokenStyle.textLineHeight, style.textLineHeight, tokenHeight ); token.textAlign = tokenStyle && tokenStyle.textAlign || style.textAlign; token.textVerticalAlign = tokenStyle && tokenStyle.textVerticalAlign || 'middle'; if (truncateHeight != null && contentHeight + token.lineHeight > truncateHeight) { return {lines: [], width: 0, height: 0}; } token.textWidth = getWidth(token.text, font); var tokenWidth = tokenStyle.textWidth; var tokenWidthNotSpecified = tokenWidth == null || tokenWidth === 'auto'; // Percent width, can be `100%`, can be used in drawing separate // line when box width is needed to be auto. if (typeof tokenWidth === 'string' && tokenWidth.charAt(tokenWidth.length - 1) === '%') { token.percentWidth = tokenWidth; pendingList.push(token); tokenWidth = 0; // Do not truncate in this case, because there is no user case // and it is too complicated. } else { if (tokenWidthNotSpecified) { tokenWidth = token.textWidth; // FIXME: If image is not loaded and textWidth is not specified, calling // `getBoundingRect()` will not get correct result. var textBackgroundColor = tokenStyle.textBackgroundColor; var bgImg = textBackgroundColor && textBackgroundColor.image; // Use cases: // (1) If image is not loaded, it will be loaded at render phase and call // `dirty()` and `textBackgroundColor.image` will be replaced with the loaded // image, and then the right size will be calculated here at the next tick. // See `graphic/helper/text.js`. // (2) If image loaded, and `textBackgroundColor.image` is image src string, // use `imageHelper.findExistImage` to find cached image. // `imageHelper.findExistImage` will always be called here before // `imageHelper.createOrUpdateImage` in `graphic/helper/text.js#renderRichText` // which ensures that image will not be rendered before correct size calcualted. if (bgImg) { bgImg = findExistImage(bgImg); if (isImageReady(bgImg)) { tokenWidth = Math.max(tokenWidth, bgImg.width * tokenHeight / bgImg.height); } } } var paddingW = textPadding ? textPadding[1] + textPadding[3] : 0; tokenWidth += paddingW; var remianTruncWidth = truncateWidth != null ? truncateWidth - lineWidth : null; if (remianTruncWidth != null && remianTruncWidth < tokenWidth) { if (!tokenWidthNotSpecified || remianTruncWidth < paddingW) { token.text = ''; token.textWidth = tokenWidth = 0; } else { token.text = truncateText( token.text, remianTruncWidth - paddingW, font, truncate.ellipsis, {minChar: truncate.minChar} ); token.textWidth = getWidth(token.text, font); tokenWidth = token.textWidth + paddingW; } } } lineWidth += (token.width = tokenWidth); tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight)); } line.width = lineWidth; line.lineHeight = lineHeight; contentHeight += lineHeight; contentWidth = Math.max(contentWidth, lineWidth); } contentBlock.outerWidth = contentBlock.width = retrieve2(style.textWidth, contentWidth); contentBlock.outerHeight = contentBlock.height = retrieve2(style.textHeight, contentHeight); if (stlPadding) { contentBlock.outerWidth += stlPadding[1] + stlPadding[3]; contentBlock.outerHeight += stlPadding[0] + stlPadding[2]; } for (var i = 0; i < pendingList.length; i++) { var token = pendingList[i]; var percentWidth = token.percentWidth; // Should not base on outerWidth, because token can not be placed out of padding. token.width = parseInt(percentWidth, 10) / 100 * contentWidth; } return contentBlock; } function pushTokens(block, str, styleName) { var isEmptyStr = str === ''; var strs = str.split('\n'); var lines = block.lines; for (var i = 0; i < strs.length; i++) { var text = strs[i]; var token = { styleName: styleName, text: text, isLineHolder: !text && !isEmptyStr }; // The first token should be appended to the last line. if (!i) { var tokens = (lines[lines.length - 1] || (lines[0] = {tokens: []})).tokens; // Consider cases: // (1) ''.split('\n') => ['', '\n', ''], the '' at the first item // (which is a placeholder) should be replaced by new token. // (2) A image backage, where token likes {a|}. // (3) A redundant '' will affect textAlign in line. // (4) tokens with the same tplName should not be merged, because // they should be displayed in different box (with border and padding). var tokensLen = tokens.length; (tokensLen === 1 && tokens[0].isLineHolder) ? (tokens[0] = token) // Consider text is '', only insert when it is the "lineHolder" or // "emptyStr". Otherwise a redundant '' will affect textAlign in line. : ((text || !tokensLen || isEmptyStr) && tokens.push(token)); } // Other tokens always start a new line. else { // If there is '', insert it as a placeholder. lines.push({tokens: [token]}); } } } function makeFont(style) { // FIXME in node-canvas fontWeight is before fontStyle // Use `fontSize` `fontFamily` to check whether font properties are defined. var font = (style.fontSize || style.fontFamily) && [ style.fontStyle, style.fontWeight, (style.fontSize || 12) + 'px', // If font properties are defined, `fontFamily` should not be ignored. style.fontFamily || 'sans-serif' ].join(' '); return font && trim(font) || style.textFont || style.font; } function buildPath(ctx, shape) { var x = shape.x; var y = shape.y; var width = shape.width; var height = shape.height; var r = shape.r; var r1; var r2; var r3; var r4; // Convert width and height to positive for better borderRadius if (width < 0) { x = x + width; width = -width; } if (height < 0) { y = y + height; height = -height; } if (typeof r === 'number') { r1 = r2 = r3 = r4 = r; } else if (r instanceof Array) { if (r.length === 1) { r1 = r2 = r3 = r4 = r[0]; } else if (r.length === 2) { r1 = r3 = r[0]; r2 = r4 = r[1]; } else if (r.length === 3) { r1 = r[0]; r2 = r4 = r[1]; r3 = r[2]; } else { r1 = r[0]; r2 = r[1]; r3 = r[2]; r4 = r[3]; } } else { r1 = r2 = r3 = r4 = 0; } var total; if (r1 + r2 > width) { total = r1 + r2; r1 *= width / total; r2 *= width / total; } if (r3 + r4 > width) { total = r3 + r4; r3 *= width / total; r4 *= width / total; } if (r2 + r3 > height) { total = r2 + r3; r2 *= height / total; r3 *= height / total; } if (r1 + r4 > height) { total = r1 + r4; r1 *= height / total; r4 *= height / total; } ctx.moveTo(x + r1, y); ctx.lineTo(x + width - r2, y); r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0); ctx.lineTo(x + width, y + height - r3); r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2); ctx.lineTo(x + r4, y + height); r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI); ctx.lineTo(x, y + r1); r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5); } // TODO: Have not support 'start', 'end' yet. var VALID_TEXT_ALIGN = {left: 1, right: 1, center: 1}; var VALID_TEXT_VERTICAL_ALIGN = {top: 1, bottom: 1, middle: 1}; /** * @param {module:zrender/graphic/Style} style * @return {module:zrender/graphic/Style} The input style. */ function normalizeTextStyle(style) { normalizeStyle(style); each$1(style.rich, normalizeStyle); return style; } function normalizeStyle(style) { if (style) { style.font = makeFont(style); var textAlign = style.textAlign; textAlign === 'middle' && (textAlign = 'center'); style.textAlign = ( textAlign == null || VALID_TEXT_ALIGN[textAlign] ) ? textAlign : 'left'; // Compatible with textBaseline. var textVerticalAlign = style.textVerticalAlign || style.textBaseline; textVerticalAlign === 'center' && (textVerticalAlign = 'middle'); style.textVerticalAlign = ( textVerticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[textVerticalAlign] ) ? textVerticalAlign : 'top'; var textPadding = style.textPadding; if (textPadding) { style.textPadding = normalizeCssArray(style.textPadding); } } } /** * @param {CanvasRenderingContext2D} ctx * @param {string} text * @param {module:zrender/graphic/Style} style * @param {Object|boolean} [rect] {x, y, width, height} * If set false, rect text is not used. */ function renderText(hostEl, ctx, text, style, rect) { style.rich ? renderRichText(hostEl, ctx, text, style, rect) : renderPlainText(hostEl, ctx, text, style, rect); } function renderPlainText(hostEl, ctx, text, style, rect) { var font = setCtx(ctx, 'font', style.font || DEFAULT_FONT); var textPadding = style.textPadding; var contentBlock = hostEl.__textCotentBlock; if (!contentBlock || hostEl.__dirty) { contentBlock = hostEl.__textCotentBlock = parsePlainText( text, font, textPadding, style.truncate ); } var outerHeight = contentBlock.outerHeight; var textLines = contentBlock.lines; var lineHeight = contentBlock.lineHeight; var boxPos = getBoxPosition(outerHeight, style, rect); var baseX = boxPos.baseX; var baseY = boxPos.baseY; var textAlign = boxPos.textAlign; var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing. applyTextRotation(ctx, style, rect, baseX, baseY); var boxY = adjustTextY(baseY, outerHeight, textVerticalAlign); var textX = baseX; var textY = boxY; var needDrawBg = needDrawBackground(style); if (needDrawBg || textPadding) { // Consider performance, do not call getTextWidth util necessary. var textWidth = getWidth(text, font); var outerWidth = textWidth; textPadding && (outerWidth += textPadding[1] + textPadding[3]); var boxX = adjustTextX(baseX, outerWidth, textAlign); needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight); if (textPadding) { textX = getTextXForPadding(baseX, textAlign, textPadding); textY += textPadding[0]; } } setCtx(ctx, 'textAlign', textAlign || 'left'); // Force baseline to be "middle". Otherwise, if using "top", the // text will offset downward a little bit in font "Microsoft YaHei". setCtx(ctx, 'textBaseline', 'middle'); // Always set shadowBlur and shadowOffset to avoid leak from displayable. setCtx(ctx, 'shadowBlur', style.textShadowBlur || 0); setCtx(ctx, 'shadowColor', style.textShadowColor || 'transparent'); setCtx(ctx, 'shadowOffsetX', style.textShadowOffsetX || 0); setCtx(ctx, 'shadowOffsetY', style.textShadowOffsetY || 0); // `textBaseline` is set as 'middle'. textY += lineHeight / 2; var textStrokeWidth = style.textStrokeWidth; var textStroke = getStroke(style.textStroke, textStrokeWidth); var textFill = getFill(style.textFill); if (textStroke) { setCtx(ctx, 'lineWidth', textStrokeWidth); setCtx(ctx, 'strokeStyle', textStroke); } if (textFill) { setCtx(ctx, 'fillStyle', textFill); } for (var i = 0; i < textLines.length; i++) { // Fill after stroke so the outline will not cover the main part. textStroke && ctx.strokeText(textLines[i], textX, textY); textFill && ctx.fillText(textLines[i], textX, textY); textY += lineHeight; } } function renderRichText(hostEl, ctx, text, style, rect) { var contentBlock = hostEl.__textCotentBlock; if (!contentBlock || hostEl.__dirty) { contentBlock = hostEl.__textCotentBlock = parseRichText(text, style); } drawRichText(hostEl, ctx, contentBlock, style, rect); } function drawRichText(hostEl, ctx, contentBlock, style, rect) { var contentWidth = contentBlock.width; var outerWidth = contentBlock.outerWidth; var outerHeight = contentBlock.outerHeight; var textPadding = style.textPadding; var boxPos = getBoxPosition(outerHeight, style, rect); var baseX = boxPos.baseX; var baseY = boxPos.baseY; var textAlign = boxPos.textAlign; var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing. applyTextRotation(ctx, style, rect, baseX, baseY); var boxX = adjustTextX(baseX, outerWidth, textAlign); var boxY = adjustTextY(baseY, outerHeight, textVerticalAlign); var xLeft = boxX; var lineTop = boxY; if (textPadding) { xLeft += textPadding[3]; lineTop += textPadding[0]; } var xRight = xLeft + contentWidth; needDrawBackground(style) && drawBackground( hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight ); for (var i = 0; i < contentBlock.lines.length; i++) { var line = contentBlock.lines[i]; var tokens = line.tokens; var tokenCount = tokens.length; var lineHeight = line.lineHeight; var usedWidth = line.width; var leftIndex = 0; var lineXLeft = xLeft; var lineXRight = xRight; var rightIndex = tokenCount - 1; var token; while ( leftIndex < tokenCount && (token = tokens[leftIndex], !token.textAlign || token.textAlign === 'left') ) { placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft, 'left'); usedWidth -= token.width; lineXLeft += token.width; leftIndex++; } while ( rightIndex >= 0 && (token = tokens[rightIndex], token.textAlign === 'right') ) { placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXRight, 'right'); usedWidth -= token.width; lineXRight -= token.width; rightIndex--; } // The other tokens are placed as textAlign 'center' if there is enough space. lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - usedWidth) / 2; while (leftIndex <= rightIndex) { token = tokens[leftIndex]; // Consider width specified by user, use 'center' rather than 'left'. placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center'); lineXLeft += token.width; leftIndex++; } lineTop += lineHeight; } } function applyTextRotation(ctx, style, rect, x, y) { // textRotation only apply in RectText. if (rect && style.textRotation) { var origin = style.textOrigin; if (origin === 'center') { x = rect.width / 2 + rect.x; y = rect.height / 2 + rect.y; } else if (origin) { x = origin[0] + rect.x; y = origin[1] + rect.y; } ctx.translate(x, y); // Positive: anticlockwise ctx.rotate(-style.textRotation); ctx.translate(-x, -y); } } function placeToken(hostEl, ctx, token, style, lineHeight, lineTop, x, textAlign) { var tokenStyle = style.rich[token.styleName] || {}; // 'ctx.textBaseline' is always set as 'middle', for sake of // the bias of "Microsoft YaHei". var textVerticalAlign = token.textVerticalAlign; var y = lineTop + lineHeight / 2; if (textVerticalAlign === 'top') { y = lineTop + token.height / 2; } else if (textVerticalAlign === 'bottom') { y = lineTop + lineHeight - token.height / 2; } !token.isLineHolder && needDrawBackground(tokenStyle) && drawBackground( hostEl, ctx, tokenStyle, textAlign === 'right' ? x - token.width : textAlign === 'center' ? x - token.width / 2 : x, y - token.height / 2, token.width, token.height ); var textPadding = token.textPadding; if (textPadding) { x = getTextXForPadding(x, textAlign, textPadding); y -= token.height / 2 - textPadding[2] - token.textHeight / 2; } setCtx(ctx, 'shadowBlur', retrieve3(tokenStyle.textShadowBlur, style.textShadowBlur, 0)); setCtx(ctx, 'shadowColor', tokenStyle.textShadowColor || style.textShadowColor || 'transparent'); setCtx(ctx, 'shadowOffsetX', retrieve3(tokenStyle.textShadowOffsetX, style.textShadowOffsetX, 0)); setCtx(ctx, 'shadowOffsetY', retrieve3(tokenStyle.textShadowOffsetY, style.textShadowOffsetY, 0)); setCtx(ctx, 'textAlign', textAlign); // Force baseline to be "middle". Otherwise, if using "top", the // text will offset downward a little bit in font "Microsoft YaHei". setCtx(ctx, 'textBaseline', 'middle'); setCtx(ctx, 'font', token.font || DEFAULT_FONT); var textStroke = getStroke(tokenStyle.textStroke || style.textStroke, textStrokeWidth); var textFill = getFill(tokenStyle.textFill || style.textFill); var textStrokeWidth = retrieve2(tokenStyle.textStrokeWidth, style.textStrokeWidth); // Fill after stroke so the outline will not cover the main part. if (textStroke) { setCtx(ctx, 'lineWidth', textStrokeWidth); setCtx(ctx, 'strokeStyle', textStroke); ctx.strokeText(token.text, x, y); } if (textFill) { setCtx(ctx, 'fillStyle', textFill); ctx.fillText(token.text, x, y); } } function needDrawBackground(style) { return style.textBackgroundColor || (style.textBorderWidth && style.textBorderColor); } // style: {textBackgroundColor, textBorderWidth, textBorderColor, textBorderRadius} // shape: {x, y, width, height} function drawBackground(hostEl, ctx, style, x, y, width, height) { var textBackgroundColor = style.textBackgroundColor; var textBorderWidth = style.textBorderWidth; var textBorderColor = style.textBorderColor; var isPlainBg = isString(textBackgroundColor); setCtx(ctx, 'shadowBlur', style.textBoxShadowBlur || 0); setCtx(ctx, 'shadowColor', style.textBoxShadowColor || 'transparent'); setCtx(ctx, 'shadowOffsetX', style.textBoxShadowOffsetX || 0); setCtx(ctx, 'shadowOffsetY', style.textBoxShadowOffsetY || 0); if (isPlainBg || (textBorderWidth && textBorderColor)) { ctx.beginPath(); var textBorderRadius = style.textBorderRadius; if (!textBorderRadius) { ctx.rect(x, y, width, height); } else { buildPath(ctx, { x: x, y: y, width: width, height: height, r: textBorderRadius }); } ctx.closePath(); } if (isPlainBg) { setCtx(ctx, 'fillStyle', textBackgroundColor); ctx.fill(); } else if (isObject$1(textBackgroundColor)) { var image = textBackgroundColor.image; image = createOrUpdateImage( image, null, hostEl, onBgImageLoaded, textBackgroundColor ); if (image && isImageReady(image)) { ctx.drawImage(image, x, y, width, height); } } if (textBorderWidth && textBorderColor) { setCtx(ctx, 'lineWidth', textBorderWidth); setCtx(ctx, 'strokeStyle', textBorderColor); ctx.stroke(); } } function onBgImageLoaded(image, textBackgroundColor) { // Replace image, so that `contain/text.js#parseRichText` // will get correct result in next tick. textBackgroundColor.image = image; } function getBoxPosition(blockHeiht, style, rect) { var baseX = style.x || 0; var baseY = style.y || 0; var textAlign = style.textAlign; var textVerticalAlign = style.textVerticalAlign; // Text position represented by coord if (rect) { var textPosition = style.textPosition; if (textPosition instanceof Array) { // Percent baseX = rect.x + parsePercent(textPosition[0], rect.width); baseY = rect.y + parsePercent(textPosition[1], rect.height); } else { var res = adjustTextPositionOnRect( textPosition, rect, style.textDistance ); baseX = res.x; baseY = res.y; // Default align and baseline when has textPosition textAlign = textAlign || res.textAlign; textVerticalAlign = textVerticalAlign || res.textVerticalAlign; } // textOffset is only support in RectText, otherwise // we have to adjust boundingRect for textOffset. var textOffset = style.textOffset; if (textOffset) { baseX += textOffset[0]; baseY += textOffset[1]; } } return { baseX: baseX, baseY: baseY, textAlign: textAlign, textVerticalAlign: textVerticalAlign }; } function setCtx(ctx, prop, value) { ctx[prop] = fixShadow(ctx, prop, value); return ctx[prop]; } /** * @param {string} [stroke] If specified, do not check style.textStroke. * @param {string} [lineWidth] If specified, do not check style.textStroke. * @param {number} style */ function getStroke(stroke, lineWidth) { return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none') ? null // TODO pattern and gradient? : (stroke.image || stroke.colorStops) ? '#000' : stroke; } function getFill(fill) { return (fill == null || fill === 'none') ? null // TODO pattern and gradient? : (fill.image || fill.colorStops) ? '#000' : fill; } function parsePercent(value, maxValue) { if (typeof value === 'string') { if (value.lastIndexOf('%') >= 0) { return parseFloat(value) / 100 * maxValue; } return parseFloat(value); } return value; } function getTextXForPadding(x, textAlign, textPadding) { return textAlign === 'right' ? (x - textPadding[1]) : textAlign === 'center' ? (x + textPadding[3] / 2 - textPadding[1] / 2) : (x + textPadding[3]); } /** * @param {string} text * @param {module:zrender/Style} style * @return {boolean} */ function needDrawText(text, style) { return text != null && (text || style.textBackgroundColor || (style.textBorderWidth && style.textBorderColor) || style.textPadding ); } /** * Mixin for drawing text in a element bounding rect * @module zrender/mixin/RectText */ var tmpRect$1 = new BoundingRect(); var RectText = function () {}; RectText.prototype = { constructor: RectText, /** * Draw text in a rect with specified position. * @param {CanvasRenderingContext2D} ctx * @param {Object} rect Displayable rect */ drawRectText: function (ctx, rect) { var style = this.style; rect = style.textRect || rect; // Optimize, avoid normalize every time. this.__dirty && normalizeTextStyle(style, true); var text = style.text; // Convert to string text != null && (text += ''); if (!needDrawText(text, style)) { return; } // FIXME ctx.save(); // Transform rect to view space var transform = this.transform; if (!style.transformText) { if (transform) { tmpRect$1.copy(rect); tmpRect$1.applyTransform(transform); rect = tmpRect$1; } } else { this.setTransform(ctx); } // transformText and textRotation can not be used at the same time. renderText(this, ctx, text, style, rect); ctx.restore(); } }; /** * 可绘制的图形基类 * Base class of all displayable graphic objects * @module zrender/graphic/Displayable */ /** * @alias module:zrender/graphic/Displayable * @extends module:zrender/Element * @extends module:zrender/graphic/mixin/RectText */ function Displayable(opts) { opts = opts || {}; Element.call(this, opts); // Extend properties for (var name in opts) { if ( opts.hasOwnProperty(name) && name !== 'style' ) { this[name] = opts[name]; } } /** * @type {module:zrender/graphic/Style} */ this.style = new Style(opts.style, this); this._rect = null; // Shapes for cascade clipping. this.__clipPaths = []; // FIXME Stateful must be mixined after style is setted // Stateful.call(this, opts); } Displayable.prototype = { constructor: Displayable, type: 'displayable', /** * Displayable 是否为脏,Painter 中会根据该标记判断是否需要是否需要重新绘制 * Dirty flag. From which painter will determine if this displayable object needs brush * @name module:zrender/graphic/Displayable#__dirty * @type {boolean} */ __dirty: true, /** * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件 * If ignore drawing of the displayable object. Mouse event will still be triggered * @name module:/zrender/graphic/Displayable#invisible * @type {boolean} * @default false */ invisible: false, /** * @name module:/zrender/graphic/Displayable#z * @type {number} * @default 0 */ z: 0, /** * @name module:/zrender/graphic/Displayable#z * @type {number} * @default 0 */ z2: 0, /** * z层level,决定绘画在哪层canvas中 * @name module:/zrender/graphic/Displayable#zlevel * @type {number} * @default 0 */ zlevel: 0, /** * 是否可拖拽 * @name module:/zrender/graphic/Displayable#draggable * @type {boolean} * @default false */ draggable: false, /** * 是否正在拖拽 * @name module:/zrender/graphic/Displayable#draggable * @type {boolean} * @default false */ dragging: false, /** * 是否相应鼠标事件 * @name module:/zrender/graphic/Displayable#silent * @type {boolean} * @default false */ silent: false, /** * If enable culling * @type {boolean} * @default false */ culling: false, /** * Mouse cursor when hovered * @name module:/zrender/graphic/Displayable#cursor * @type {string} */ cursor: 'pointer', /** * If hover area is bounding rect * @name module:/zrender/graphic/Displayable#rectHover * @type {string} */ rectHover: false, /** * Render the element progressively when the value >= 0, * usefull for large data. * @type {boolean} */ progressive: false, /** * @type {boolean} */ incremental: false, // inplace is used with incremental inplace: false, beforeBrush: function (ctx) {}, afterBrush: function (ctx) {}, /** * 图形绘制方法 * @param {CanvasRenderingContext2D} ctx */ // Interface brush: function (ctx, prevEl) {}, /** * 获取最小包围盒 * @return {module:zrender/core/BoundingRect} */ // Interface getBoundingRect: function () {}, /** * 判断坐标 x, y 是否在图形上 * If displayable element contain coord x, y * @param {number} x * @param {number} y * @return {boolean} */ contain: function (x, y) { return this.rectContain(x, y); }, /** * @param {Function} cb * @param {} context */ traverse: function (cb, context) { cb.call(context, this); }, /** * 判断坐标 x, y 是否在图形的包围盒上 * If bounding rect of element contain coord x, y * @param {number} x * @param {number} y * @return {boolean} */ rectContain: function (x, y) { var coord = this.transformCoordToLocal(x, y); var rect = this.getBoundingRect(); return rect.contain(coord[0], coord[1]); }, /** * 标记图形元素为脏,并且在下一帧重绘 * Mark displayable element dirty and refresh next frame */ dirty: function () { this.__dirty = true; this._rect = null; this.__zr && this.__zr.refresh(); }, /** * 图形是否会触发事件 * If displayable object binded any event * @return {boolean} */ // TODO, 通过 bind 绑定的事件 // isSilent: function () { // return !( // this.hoverable || this.draggable // || this.onmousemove || this.onmouseover || this.onmouseout // || this.onmousedown || this.onmouseup || this.onclick // || this.ondragenter || this.ondragover || this.ondragleave // || this.ondrop // ); // }, /** * Alias for animate('style') * @param {boolean} loop */ animateStyle: function (loop) { return this.animate('style', loop); }, attrKV: function (key, value) { if (key !== 'style') { Element.prototype.attrKV.call(this, key, value); } else { this.style.set(value); } }, /** * @param {Object|string} key * @param {*} value */ setStyle: function (key, value) { this.style.set(key, value); this.dirty(false); return this; }, /** * Use given style object * @param {Object} obj */ useStyle: function (obj) { this.style = new Style(obj, this); this.dirty(false); return this; } }; inherits(Displayable, Element); mixin(Displayable, RectText); /** * @alias zrender/graphic/Image * @extends module:zrender/graphic/Displayable * @constructor * @param {Object} opts */ function ZImage(opts) { Displayable.call(this, opts); } ZImage.prototype = { constructor: ZImage, type: 'image', brush: function (ctx, prevEl) { var style = this.style; var src = style.image; // Must bind each time style.bind(ctx, this, prevEl); var image = this._image = createOrUpdateImage( src, this._image, this, this.onload ); if (!image || !isImageReady(image)) { return; } // 图片已经加载完成 // if (image.nodeName.toUpperCase() == 'IMG') { // if (!image.complete) { // return; // } // } // Else is canvas var x = style.x || 0; var y = style.y || 0; var width = style.width; var height = style.height; var aspect = image.width / image.height; if (width == null && height != null) { // Keep image/height ratio width = height * aspect; } else if (height == null && width != null) { height = width / aspect; } else if (width == null && height == null) { width = image.width; height = image.height; } // 设置transform this.setTransform(ctx); if (style.sWidth && style.sHeight) { var sx = style.sx || 0; var sy = style.sy || 0; ctx.drawImage( image, sx, sy, style.sWidth, style.sHeight, x, y, width, height ); } else if (style.sx && style.sy) { var sx = style.sx; var sy = style.sy; var sWidth = width - sx; var sHeight = height - sy; ctx.drawImage( image, sx, sy, sWidth, sHeight, x, y, width, height ); } else { ctx.drawImage(image, x, y, width, height); } // Draw rect text if (style.text != null) { // Only restore transform when needs draw text. this.restoreTransform(ctx); this.drawRectText(ctx, this.getBoundingRect()); } }, getBoundingRect: function () { var style = this.style; if (! this._rect) { this._rect = new BoundingRect( style.x || 0, style.y || 0, style.width || 0, style.height || 0 ); } return this._rect; } }; inherits(ZImage, Displayable); var HOVER_LAYER_ZLEVEL = 1e5; var CANVAS_ZLEVEL = 314159; var EL_AFTER_INCREMENTAL_INC = 0.01; var INCREMENTAL_INC = 0.001; function parseInt10(val) { return parseInt(val, 10); } function isLayerValid(layer) { if (!layer) { return false; } if (layer.__builtin__) { return true; } if (typeof(layer.resize) !== 'function' || typeof(layer.refresh) !== 'function' ) { return false; } return true; } var tmpRect = new BoundingRect(0, 0, 0, 0); var viewRect = new BoundingRect(0, 0, 0, 0); function isDisplayableCulled(el, width, height) { tmpRect.copy(el.getBoundingRect()); if (el.transform) { tmpRect.applyTransform(el.transform); } viewRect.width = width; viewRect.height = height; return !tmpRect.intersect(viewRect); } function isClipPathChanged(clipPaths, prevClipPaths) { if (clipPaths == prevClipPaths) { // Can both be null or undefined return false; } if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) { return true; } for (var i = 0; i < clipPaths.length; i++) { if (clipPaths[i] !== prevClipPaths[i]) { return true; } } } function doClip(clipPaths, ctx) { for (var i = 0; i < clipPaths.length; i++) { var clipPath = clipPaths[i]; clipPath.setTransform(ctx); ctx.beginPath(); clipPath.buildPath(ctx, clipPath.shape); ctx.clip(); // Transform back clipPath.restoreTransform(ctx); } } function createRoot(width, height) { var domRoot = document.createElement('div'); // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 domRoot.style.cssText = [ 'position:relative', 'overflow:hidden', 'width:' + width + 'px', 'height:' + height + 'px', 'padding:0', 'margin:0', 'border-width:0' ].join(';') + ';'; return domRoot; } /** * @alias module:zrender/Painter * @constructor * @param {HTMLElement} root 绘图容器 * @param {module:zrender/Storage} storage * @param {Object} opts */ var Painter = function (root, storage, opts) { this.type = 'canvas'; // In node environment using node-canvas var singleCanvas = !root.nodeName // In node ? || root.nodeName.toUpperCase() === 'CANVAS'; this._opts = opts = extend({}, opts || {}); /** * @type {number} */ this.dpr = opts.devicePixelRatio || devicePixelRatio; /** * @type {boolean} * @private */ this._singleCanvas = singleCanvas; /** * 绘图容器 * @type {HTMLElement} */ this.root = root; var rootStyle = root.style; if (rootStyle) { rootStyle['-webkit-tap-highlight-color'] = 'transparent'; rootStyle['-webkit-user-select'] = rootStyle['user-select'] = rootStyle['-webkit-touch-callout'] = 'none'; root.innerHTML = ''; } /** * @type {module:zrender/Storage} */ this.storage = storage; /** * @type {Array.} * @private */ var zlevelList = this._zlevelList = []; /** * @type {Object.} * @private */ var layers = this._layers = {}; /** * @type {Object.} * @private */ this._layerConfig = {}; /** * zrender will do compositing when root is a canvas and have multiple zlevels. */ this._needsManuallyCompositing = false; if (!singleCanvas) { this._width = this._getSize(0); this._height = this._getSize(1); var domRoot = this._domRoot = createRoot( this._width, this._height ); root.appendChild(domRoot); } else { var width = root.width; var height = root.height; if (opts.width != null) { width = opts.width; } if (opts.height != null) { height = opts.height; } this.dpr = opts.devicePixelRatio || 1; // Use canvas width and height directly root.width = width * this.dpr; root.height = height * this.dpr; this._width = width; this._height = height; // Create layer if only one given canvas // Device can be specified to create a high dpi image. var mainLayer = new Layer(root, this, this.dpr); mainLayer.__builtin__ = true; mainLayer.initContext(); // FIXME Use canvas width and height // mainLayer.resize(width, height); layers[CANVAS_ZLEVEL] = mainLayer; mainLayer.zlevel = CANVAS_ZLEVEL; // Not use common zlevel. zlevelList.push(CANVAS_ZLEVEL); this._domRoot = root; } /** * @type {module:zrender/Layer} * @private */ this._hoverlayer = null; this._hoverElements = []; }; Painter.prototype = { constructor: Painter, getType: function () { return 'canvas'; }, /** * If painter use a single canvas * @return {boolean} */ isSingleCanvas: function () { return this._singleCanvas; }, /** * @return {HTMLDivElement} */ getViewportRoot: function () { return this._domRoot; }, getViewportRootOffset: function () { var viewportRoot = this.getViewportRoot(); if (viewportRoot) { return { offsetLeft: viewportRoot.offsetLeft || 0, offsetTop: viewportRoot.offsetTop || 0 }; } }, /** * 刷新 * @param {boolean} [paintAll=false] 强制绘制所有displayable */ refresh: function (paintAll) { var list = this.storage.getDisplayList(true); var zlevelList = this._zlevelList; this._redrawId = Math.random(); this._paintList(list, paintAll, this._redrawId); // Paint custum layers for (var i = 0; i < zlevelList.length; i++) { var z = zlevelList[i]; var layer = this._layers[z]; if (!layer.__builtin__ && layer.refresh) { var clearColor = i === 0 ? this._backgroundColor : null; layer.refresh(clearColor); } } this.refreshHover(); return this; }, addHover: function (el, hoverStyle) { if (el.__hoverMir) { return; } var elMirror = new el.constructor({ style: el.style, shape: el.shape }); elMirror.__from = el; el.__hoverMir = elMirror; elMirror.setStyle(hoverStyle); this._hoverElements.push(elMirror); }, removeHover: function (el) { var elMirror = el.__hoverMir; var hoverElements = this._hoverElements; var idx = indexOf(hoverElements, elMirror); if (idx >= 0) { hoverElements.splice(idx, 1); } el.__hoverMir = null; }, clearHover: function (el) { var hoverElements = this._hoverElements; for (var i = 0; i < hoverElements.length; i++) { var from = hoverElements[i].__from; if (from) { from.__hoverMir = null; } } hoverElements.length = 0; }, refreshHover: function () { var hoverElements = this._hoverElements; var len = hoverElements.length; var hoverLayer = this._hoverlayer; hoverLayer && hoverLayer.clear(); if (!len) { return; } sort(hoverElements, this.storage.displayableSortFunc); // Use a extream large zlevel // FIXME? if (!hoverLayer) { hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL); } var scope = {}; hoverLayer.ctx.save(); for (var i = 0; i < len;) { var el = hoverElements[i]; var originalEl = el.__from; // Original el is removed // PENDING if (!(originalEl && originalEl.__zr)) { hoverElements.splice(i, 1); originalEl.__hoverMir = null; len--; continue; } i++; // Use transform // FIXME style and shape ? if (!originalEl.invisible) { el.transform = originalEl.transform; el.invTransform = originalEl.invTransform; el.__clipPaths = originalEl.__clipPaths; // el. this._doPaintEl(el, hoverLayer, true, scope); } } hoverLayer.ctx.restore(); }, getHoverLayer: function () { return this.getLayer(HOVER_LAYER_ZLEVEL); }, _paintList: function (list, paintAll, redrawId) { if (this._redrawId !== redrawId) { return; } paintAll = paintAll || false; this._updateLayerStatus(list); var finished = this._doPaintList(list, paintAll); if (this._needsManuallyCompositing) { this._compositeManually(); } if (!finished) { var self = this; requestAnimationFrame(function () { self._paintList(list, paintAll, redrawId); }); } }, _compositeManually: function () { var ctx = this.getLayer(CANVAS_ZLEVEL).ctx; var width = this._domRoot.width; var height = this._domRoot.height; ctx.clearRect(0, 0, width, height); // PENDING, If only builtin layer? this.eachBuiltinLayer(function (layer) { if (layer.virtual) { ctx.drawImage(layer.dom, 0, 0, width, height); } }); }, _doPaintList: function (list, paintAll) { var layerList = []; for (var zi = 0; zi < this._zlevelList.length; zi++) { var zlevel = this._zlevelList[zi]; var layer = this._layers[zlevel]; if (layer.__builtin__ && layer !== this._hoverlayer && (layer.__dirty || paintAll) ) { layerList.push(layer); } } var finished = true; for (var k = 0; k < layerList.length; k++) { var layer = layerList[k]; var ctx = layer.ctx; var scope = {}; ctx.save(); var start = paintAll ? layer.__startIndex : layer.__drawIndex; var useTimer = !paintAll && layer.incremental && Date.now; var startTime = useTimer && Date.now(); var clearColor = layer.zlevel === this._zlevelList[0] ? this._backgroundColor : null; // All elements in this layer are cleared. if (layer.__startIndex === layer.__endIndex) { layer.clear(false, clearColor); } else if (start === layer.__startIndex) { var firstEl = list[start]; if (!firstEl.incremental || !firstEl.notClear || paintAll) { layer.clear(false, clearColor); } } if (start === -1) { console.error('For some unknown reason. drawIndex is -1'); start = layer.__startIndex; } for (var i = start; i < layer.__endIndex; i++) { var el = list[i]; this._doPaintEl(el, layer, paintAll, scope); el.__dirty = false; if (useTimer) { // Date.now can be executed in 13,025,305 ops/second. var dTime = Date.now() - startTime; // Give 15 millisecond to draw. // The rest elements will be drawn in the next frame. if (dTime > 15) { break; } } } layer.__drawIndex = i; if (layer.__drawIndex < layer.__endIndex) { finished = false; } if (scope.prevElClipPaths) { // Needs restore the state. If last drawn element is in the clipping area. ctx.restore(); } ctx.restore(); } if (env$1.wxa) { // Flush for weixin application each$1(this._layers, function (layer) { if (layer && layer.ctx && layer.ctx.draw) { layer.ctx.draw(); } }); } return finished; }, _doPaintEl: function (el, currentLayer, forcePaint, scope) { var ctx = currentLayer.ctx; var m = el.transform; if ( (currentLayer.__dirty || forcePaint) // Ignore invisible element && !el.invisible // Ignore transparent element && el.style.opacity !== 0 // Ignore scale 0 element, in some environment like node-canvas // Draw a scale 0 element can cause all following draw wrong // And setTransform with scale 0 will cause set back transform failed. && !(m && !m[0] && !m[3]) // Ignore culled element && !(el.culling && isDisplayableCulled(el, this._width, this._height)) ) { var clipPaths = el.__clipPaths; // Optimize when clipping on group with several elements if (!scope.prevElClipPaths || isClipPathChanged(clipPaths, scope.prevElClipPaths) ) { // If has previous clipping state, restore from it if (scope.prevElClipPaths) { currentLayer.ctx.restore(); scope.prevElClipPaths = null; // Reset prevEl since context has been restored scope.prevEl = null; } // New clipping state if (clipPaths) { ctx.save(); doClip(clipPaths, ctx); scope.prevElClipPaths = clipPaths; } } el.beforeBrush && el.beforeBrush(ctx); el.brush(ctx, scope.prevEl || null); scope.prevEl = el; el.afterBrush && el.afterBrush(ctx); } }, /** * 获取 zlevel 所在层,如果不存在则会创建一个新的层 * @param {number} zlevel * @param {boolean} virtual Virtual layer will not be inserted into dom. * @return {module:zrender/Layer} */ getLayer: function (zlevel, virtual) { if (this._singleCanvas && !this._needsManuallyCompositing) { zlevel = CANVAS_ZLEVEL; } var layer = this._layers[zlevel]; if (!layer) { // Create a new layer layer = new Layer('zr_' + zlevel, this, this.dpr); layer.zlevel = zlevel; layer.__builtin__ = true; if (this._layerConfig[zlevel]) { merge(layer, this._layerConfig[zlevel], true); } if (virtual) { layer.virtual = virtual; } this.insertLayer(zlevel, layer); // Context is created after dom inserted to document // Or excanvas will get 0px clientWidth and clientHeight layer.initContext(); } return layer; }, insertLayer: function (zlevel, layer) { var layersMap = this._layers; var zlevelList = this._zlevelList; var len = zlevelList.length; var prevLayer = null; var i = -1; var domRoot = this._domRoot; if (layersMap[zlevel]) { zrLog('ZLevel ' + zlevel + ' has been used already'); return; } // Check if is a valid layer if (!isLayerValid(layer)) { zrLog('Layer of zlevel ' + zlevel + ' is not valid'); return; } if (len > 0 && zlevel > zlevelList[0]) { for (i = 0; i < len - 1; i++) { if ( zlevelList[i] < zlevel && zlevelList[i + 1] > zlevel ) { break; } } prevLayer = layersMap[zlevelList[i]]; } zlevelList.splice(i + 1, 0, zlevel); layersMap[zlevel] = layer; // Vitual layer will not directly show on the screen. // (It can be a WebGL layer and assigned to a ZImage element) // But it still under management of zrender. if (!layer.virtual) { if (prevLayer) { var prevDom = prevLayer.dom; if (prevDom.nextSibling) { domRoot.insertBefore( layer.dom, prevDom.nextSibling ); } else { domRoot.appendChild(layer.dom); } } else { if (domRoot.firstChild) { domRoot.insertBefore(layer.dom, domRoot.firstChild); } else { domRoot.appendChild(layer.dom); } } } }, // Iterate each layer eachLayer: function (cb, context) { var zlevelList = this._zlevelList; var z; var i; for (i = 0; i < zlevelList.length; i++) { z = zlevelList[i]; cb.call(context, this._layers[z], z); } }, // Iterate each buildin layer eachBuiltinLayer: function (cb, context) { var zlevelList = this._zlevelList; var layer; var z; var i; for (i = 0; i < zlevelList.length; i++) { z = zlevelList[i]; layer = this._layers[z]; if (layer.__builtin__) { cb.call(context, layer, z); } } }, // Iterate each other layer except buildin layer eachOtherLayer: function (cb, context) { var zlevelList = this._zlevelList; var layer; var z; var i; for (i = 0; i < zlevelList.length; i++) { z = zlevelList[i]; layer = this._layers[z]; if (!layer.__builtin__) { cb.call(context, layer, z); } } }, /** * 获取所有已创建的层 * @param {Array.} [prevLayer] */ getLayers: function () { return this._layers; }, _updateLayerStatus: function (list) { this.eachBuiltinLayer(function (layer, z) { layer.__dirty = layer.__used = false; }); function updatePrevLayer(idx) { if (prevLayer) { if (prevLayer.__endIndex !== idx) { prevLayer.__dirty = true; } prevLayer.__endIndex = idx; } } if (this._singleCanvas) { for (var i = 1; i < list.length; i++) { var el = list[i]; if (el.zlevel !== list[i - 1].zlevel || el.incremental) { this._needsManuallyCompositing = true; break; } } } var prevLayer = null; var incrementalLayerCount = 0; for (var i = 0; i < list.length; i++) { var el = list[i]; var zlevel = el.zlevel; var layer; // PENDING If change one incremental element style ? // TODO Where there are non-incremental elements between incremental elements. if (el.incremental) { layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing); layer.incremental = true; incrementalLayerCount = 1; } else { layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing); } if (!layer.__builtin__) { zrLog('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id); } if (layer !== prevLayer) { layer.__used = true; if (layer.__startIndex !== i) { layer.__dirty = true; } layer.__startIndex = i; if (!layer.incremental) { layer.__drawIndex = i; } else { // Mark layer draw index needs to update. layer.__drawIndex = -1; } updatePrevLayer(i); prevLayer = layer; } if (el.__dirty) { layer.__dirty = true; if (layer.incremental && layer.__drawIndex < 0) { // Start draw from the first dirty element. layer.__drawIndex = i; } } } updatePrevLayer(i); this.eachBuiltinLayer(function (layer, z) { // Used in last frame but not in this frame. Needs clear if (!layer.__used && layer.getElementCount() > 0) { layer.__dirty = true; layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0; } // For incremental layer. In case start index changed and no elements are dirty. if (layer.__dirty && layer.__drawIndex < 0) { layer.__drawIndex = layer.__startIndex; } }); }, /** * 清除hover层外所有内容 */ clear: function () { this.eachBuiltinLayer(this._clearLayer); return this; }, _clearLayer: function (layer) { layer.clear(); }, setBackgroundColor: function (backgroundColor) { this._backgroundColor = backgroundColor; }, /** * 修改指定zlevel的绘制参数 * * @param {string} zlevel * @param {Object} config 配置对象 * @param {string} [config.clearColor=0] 每次清空画布的颜色 * @param {string} [config.motionBlur=false] 是否开启动态模糊 * @param {number} [config.lastFrameAlpha=0.7] * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 */ configLayer: function (zlevel, config) { if (config) { var layerConfig = this._layerConfig; if (!layerConfig[zlevel]) { layerConfig[zlevel] = config; } else { merge(layerConfig[zlevel], config, true); } for (var i = 0; i < this._zlevelList.length; i++) { var _zlevel = this._zlevelList[i]; if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) { var layer = this._layers[_zlevel]; merge(layer, layerConfig[zlevel], true); } } } }, /** * 删除指定层 * @param {number} zlevel 层所在的zlevel */ delLayer: function (zlevel) { var layers = this._layers; var zlevelList = this._zlevelList; var layer = layers[zlevel]; if (!layer) { return; } layer.dom.parentNode.removeChild(layer.dom); delete layers[zlevel]; zlevelList.splice(indexOf(zlevelList, zlevel), 1); }, /** * 区域大小变化后重绘 */ resize: function (width, height) { if (!this._domRoot.style) { // Maybe in node or worker if (width == null || height == null) { return; } this._width = width; this._height = height; this.getLayer(CANVAS_ZLEVEL).resize(width, height); } else { var domRoot = this._domRoot; // FIXME Why ? domRoot.style.display = 'none'; // Save input w/h var opts = this._opts; width != null && (opts.width = width); height != null && (opts.height = height); width = this._getSize(0); height = this._getSize(1); domRoot.style.display = ''; // 优化没有实际改变的resize if (this._width != width || height != this._height) { domRoot.style.width = width + 'px'; domRoot.style.height = height + 'px'; for (var id in this._layers) { if (this._layers.hasOwnProperty(id)) { this._layers[id].resize(width, height); } } each$1(this._progressiveLayers, function (layer) { layer.resize(width, height); }); this.refresh(true); } this._width = width; this._height = height; } return this; }, /** * 清除单独的一个层 * @param {number} zlevel */ clearLayer: function (zlevel) { var layer = this._layers[zlevel]; if (layer) { layer.clear(); } }, /** * 释放 */ dispose: function () { this.root.innerHTML = ''; this.root = this.storage = this._domRoot = this._layers = null; }, /** * Get canvas which has all thing rendered * @param {Object} opts * @param {string} [opts.backgroundColor] * @param {number} [opts.pixelRatio] */ getRenderedCanvas: function (opts) { opts = opts || {}; if (this._singleCanvas && !this._compositeManually) { return this._layers[CANVAS_ZLEVEL].dom; } var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr); imageLayer.initContext(); imageLayer.clear(false, opts.backgroundColor || this._backgroundColor); if (opts.pixelRatio <= this.dpr) { this.refresh(); var width = imageLayer.dom.width; var height = imageLayer.dom.height; var ctx = imageLayer.ctx; this.eachLayer(function (layer) { if (layer.__builtin__) { ctx.drawImage(layer.dom, 0, 0, width, height); } else if (layer.renderToCanvas) { imageLayer.ctx.save(); layer.renderToCanvas(imageLayer.ctx); imageLayer.ctx.restore(); } }); } else { // PENDING, echarts-gl and incremental rendering. var scope = {}; var displayList = this.storage.getDisplayList(true); for (var i = 0; i < displayList.length; i++) { var el = displayList[i]; this._doPaintEl(el, imageLayer, true, scope); } } return imageLayer.dom; }, /** * 获取绘图区域宽度 */ getWidth: function () { return this._width; }, /** * 获取绘图区域高度 */ getHeight: function () { return this._height; }, _getSize: function (whIdx) { var opts = this._opts; var wh = ['width', 'height'][whIdx]; var cwh = ['clientWidth', 'clientHeight'][whIdx]; var plt = ['paddingLeft', 'paddingTop'][whIdx]; var prb = ['paddingRight', 'paddingBottom'][whIdx]; if (opts[wh] != null && opts[wh] !== 'auto') { return parseFloat(opts[wh]); } var root = this.root; // IE8 does not support getComputedStyle, but it use VML. var stl = document.defaultView.getComputedStyle(root); return ( (root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh])) - (parseInt10(stl[plt]) || 0) - (parseInt10(stl[prb]) || 0) ) | 0; }, pathToImage: function (path, dpr) { dpr = dpr || this.dpr; var canvas = document.createElement('canvas'); var ctx = canvas.getContext('2d'); var rect = path.getBoundingRect(); var style = path.style; var shadowBlurSize = style.shadowBlur * dpr; var shadowOffsetX = style.shadowOffsetX * dpr; var shadowOffsetY = style.shadowOffsetY * dpr; var lineWidth = style.hasStroke() ? style.lineWidth : 0; var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize); var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize); var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize); var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize); var width = rect.width + leftMargin + rightMargin; var height = rect.height + topMargin + bottomMargin; canvas.width = width * dpr; canvas.height = height * dpr; ctx.scale(dpr, dpr); ctx.clearRect(0, 0, width, height); ctx.dpr = dpr; var pathTransform = { position: path.position, rotation: path.rotation, scale: path.scale }; path.position = [leftMargin - rect.x, topMargin - rect.y]; path.rotation = 0; path.scale = [1, 1]; path.updateTransform(); if (path) { path.brush(ctx); } var ImageShape = ZImage; var imgShape = new ImageShape({ style: { x: 0, y: 0, image: canvas } }); if (pathTransform.position != null) { imgShape.position = path.position = pathTransform.position; } if (pathTransform.rotation != null) { imgShape.rotation = path.rotation = pathTransform.rotation; } if (pathTransform.scale != null) { imgShape.scale = path.scale = pathTransform.scale; } return imgShape; } }; /** * 事件辅助类 * @module zrender/core/event * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) */ var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener; var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/; function getBoundingClientRect(el) { // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect return el.getBoundingClientRect ? el.getBoundingClientRect() : {left: 0, top: 0}; } // `calculate` is optional, default false function clientToLocal(el, e, out, calculate) { out = out || {}; // According to the W3C Working Draft, offsetX and offsetY should be relative // to the padding edge of the target element. The only browser using this convention // is IE. Webkit uses the border edge, Opera uses the content edge, and FireFox does // not support the properties. // (see http://www.jacklmoore.com/notes/mouse-position/) // In zr painter.dom, padding edge equals to border edge. // FIXME // When mousemove event triggered on ec tooltip, target is not zr painter.dom, and // offsetX/Y is relative to e.target, where the calculation of zrX/Y via offsetX/Y // is too complex. So css-transfrom dont support in this case temporarily. if (calculate || !env$1.canvasSupported) { defaultGetZrXY(el, e, out); } // Caution: In FireFox, layerX/layerY Mouse position relative to the closest positioned // ancestor element, so we should make sure el is positioned (e.g., not position:static). // BTW1, Webkit don't return the same results as FF in non-simple cases (like add // zoom-factor, overflow / opacity layers, transforms ...) // BTW2, (ev.offsetY || ev.pageY - $(ev.target).offset().top) is not correct in preserve-3d. // // BTW3, In ff, offsetX/offsetY is always 0. else if (env$1.browser.firefox && e.layerX != null && e.layerX !== e.offsetX) { out.zrX = e.layerX; out.zrY = e.layerY; } // For IE6+, chrome, safari, opera. (When will ff support offsetX?) else if (e.offsetX != null) { out.zrX = e.offsetX; out.zrY = e.offsetY; } // For some other device, e.g., IOS safari. else { defaultGetZrXY(el, e, out); } return out; } function defaultGetZrXY(el, e, out) { // This well-known method below does not support css transform. var box = getBoundingClientRect(el); out.zrX = e.clientX - box.left; out.zrY = e.clientY - box.top; } /** * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标. * `calculate` is optional, default false. */ function normalizeEvent(el, e, calculate) { e = e || window.event; if (e.zrX != null) { return e; } var eventType = e.type; var isTouch = eventType && eventType.indexOf('touch') >= 0; if (!isTouch) { clientToLocal(el, e, e, calculate); e.zrDelta = (e.wheelDelta) ? e.wheelDelta / 120 : -(e.detail || 0) / 3; } else { var touch = eventType != 'touchend' ? e.targetTouches[0] : e.changedTouches[0]; touch && clientToLocal(el, touch, e, calculate); } // Add which for click: 1 === left; 2 === middle; 3 === right; otherwise: 0; // See jQuery: https://github.com/jquery/jquery/blob/master/src/event.js // If e.which has been defined, if may be readonly, // see: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which var button = e.button; if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) { e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0))); } return e; } /** * @param {HTMLElement} el * @param {string} name * @param {Function} handler */ function addEventListener(el, name, handler) { if (isDomLevel2) { // Reproduct the console warning: // [Violation] Added non-passive event listener to a scroll-blocking event. // Consider marking event handler as 'passive' to make the page more responsive. // Just set console log level: verbose in chrome dev tool. // then the warning log will be printed when addEventListener called. // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md // We have not yet found a neat way to using passive. Because in zrender the dom event // listener delegate all of the upper events of element. Some of those events need // to prevent default. For example, the feature `preventDefaultMouseMove` of echarts. // Before passive can be adopted, these issues should be considered: // (1) Whether and how a zrender user specifies an event listener passive. And by default, // passive or not. // (2) How to tread that some zrender event listener is passive, and some is not. If // we use other way but not preventDefault of mousewheel and touchmove, browser // compatibility should be handled. // var opts = (env.passiveSupported && name === 'mousewheel') // ? {passive: true} // // By default, the third param of el.addEventListener is `capture: false`. // : void 0; // el.addEventListener(name, handler /* , opts */); el.addEventListener(name, handler); } else { el.attachEvent('on' + name, handler); } } function removeEventListener(el, name, handler) { if (isDomLevel2) { el.removeEventListener(name, handler); } else { el.detachEvent('on' + name, handler); } } /** * preventDefault and stopPropagation. * Notice: do not do that in zrender. Upper application * do that if necessary. * * @memberOf module:zrender/core/event * @method * @param {Event} e : event对象 */ var stop = isDomLevel2 ? function (e) { e.preventDefault(); e.stopPropagation(); e.cancelBubble = true; } : function (e) { e.returnValue = false; e.cancelBubble = true; }; function notLeftMouse(e) { // If e.which is undefined, considered as left mouse event. return e.which > 1; } /** * 动画主类, 调度和管理所有动画控制器 * * @module zrender/animation/Animation * @author pissang(https://github.com/pissang) */ // TODO Additive animation // http://iosoteric.com/additive-animations-animatewithduration-in-ios-8/ // https://developer.apple.com/videos/wwdc2014/#236 /** * @typedef {Object} IZRenderStage * @property {Function} update */ /** * @alias module:zrender/animation/Animation * @constructor * @param {Object} [options] * @param {Function} [options.onframe] * @param {IZRenderStage} [options.stage] * @example * var animation = new Animation(); * var obj = { * x: 100, * y: 100 * }; * animation.animate(node.position) * .when(1000, { * x: 500, * y: 500 * }) * .when(2000, { * x: 100, * y: 100 * }) * .start('spline'); */ var Animation = function (options) { options = options || {}; this.stage = options.stage || {}; this.onframe = options.onframe || function() {}; // private properties this._clips = []; this._running = false; this._time; this._pausedTime; this._pauseStart; this._paused = false; Eventful.call(this); }; Animation.prototype = { constructor: Animation, /** * 添加 clip * @param {module:zrender/animation/Clip} clip */ addClip: function (clip) { this._clips.push(clip); }, /** * 添加 animator * @param {module:zrender/animation/Animator} animator */ addAnimator: function (animator) { animator.animation = this; var clips = animator.getClips(); for (var i = 0; i < clips.length; i++) { this.addClip(clips[i]); } }, /** * 删除动画片段 * @param {module:zrender/animation/Clip} clip */ removeClip: function(clip) { var idx = indexOf(this._clips, clip); if (idx >= 0) { this._clips.splice(idx, 1); } }, /** * 删除动画片段 * @param {module:zrender/animation/Animator} animator */ removeAnimator: function (animator) { var clips = animator.getClips(); for (var i = 0; i < clips.length; i++) { this.removeClip(clips[i]); } animator.animation = null; }, _update: function() { var time = new Date().getTime() - this._pausedTime; var delta = time - this._time; var clips = this._clips; var len = clips.length; var deferredEvents = []; var deferredClips = []; for (var i = 0; i < len; i++) { var clip = clips[i]; var e = clip.step(time, delta); // Throw out the events need to be called after // stage.update, like destroy if (e) { deferredEvents.push(e); deferredClips.push(clip); } } // Remove the finished clip for (var i = 0; i < len;) { if (clips[i]._needsRemove) { clips[i] = clips[len - 1]; clips.pop(); len--; } else { i++; } } len = deferredEvents.length; for (var i = 0; i < len; i++) { deferredClips[i].fire(deferredEvents[i]); } this._time = time; this.onframe(delta); // 'frame' should be triggered before stage, because upper application // depends on the sequence (e.g., echarts-stream and finish // event judge) this.trigger('frame', delta); if (this.stage.update) { this.stage.update(); } }, _startLoop: function () { var self = this; this._running = true; function step() { if (self._running) { requestAnimationFrame(step); !self._paused && self._update(); } } requestAnimationFrame(step); }, /** * Start animation. */ start: function () { this._time = new Date().getTime(); this._pausedTime = 0; this._startLoop(); }, /** * Stop animation. */ stop: function () { this._running = false; }, /** * Pause animation. */ pause: function () { if (!this._paused) { this._pauseStart = new Date().getTime(); this._paused = true; } }, /** * Resume animation. */ resume: function () { if (this._paused) { this._pausedTime += (new Date().getTime()) - this._pauseStart; this._paused = false; } }, /** * Clear animation. */ clear: function () { this._clips = []; }, /** * Whether animation finished. */ isFinished: function () { return !this._clips.length; }, /** * Creat animator for a target, whose props can be animated. * * @param {Object} target * @param {Object} options * @param {boolean} [options.loop=false] Whether loop animation. * @param {Function} [options.getter=null] Get value from target. * @param {Function} [options.setter=null] Set value to target. * @return {module:zrender/animation/Animation~Animator} */ // TODO Gap animate: function (target, options) { options = options || {}; var animator = new Animator( target, options.loop, options.getter, options.setter ); this.addAnimator(animator); return animator; } }; mixin(Animation, Eventful); /** * Only implements needed gestures for mobile. */ var GestureMgr = function () { /** * @private * @type {Array.} */ this._track = []; }; GestureMgr.prototype = { constructor: GestureMgr, recognize: function (event, target, root) { this._doTrack(event, target, root); return this._recognize(event); }, clear: function () { this._track.length = 0; return this; }, _doTrack: function (event, target, root) { var touches = event.touches; if (!touches) { return; } var trackItem = { points: [], touches: [], target: target, event: event }; for (var i = 0, len = touches.length; i < len; i++) { var touch = touches[i]; var pos = clientToLocal(root, touch, {}); trackItem.points.push([pos.zrX, pos.zrY]); trackItem.touches.push(touch); } this._track.push(trackItem); }, _recognize: function (event) { for (var eventName in recognizers) { if (recognizers.hasOwnProperty(eventName)) { var gestureInfo = recognizers[eventName](this._track, event); if (gestureInfo) { return gestureInfo; } } } } }; function dist$1(pointPair) { var dx = pointPair[1][0] - pointPair[0][0]; var dy = pointPair[1][1] - pointPair[0][1]; return Math.sqrt(dx * dx + dy * dy); } function center(pointPair) { return [ (pointPair[0][0] + pointPair[1][0]) / 2, (pointPair[0][1] + pointPair[1][1]) / 2 ]; } var recognizers = { pinch: function (track, event) { var trackLen = track.length; if (!trackLen) { return; } var pinchEnd = (track[trackLen - 1] || {}).points; var pinchPre = (track[trackLen - 2] || {}).points || pinchEnd; if (pinchPre && pinchPre.length > 1 && pinchEnd && pinchEnd.length > 1 ) { var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre); !isFinite(pinchScale) && (pinchScale = 1); event.pinchScale = pinchScale; var pinchCenter = center(pinchEnd); event.pinchX = pinchCenter[0]; event.pinchY = pinchCenter[1]; return { type: 'pinch', target: track[0].target, event: event }; } } // Only pinch currently. }; var TOUCH_CLICK_DELAY = 300; var mouseHandlerNames = [ 'click', 'dblclick', 'mousewheel', 'mouseout', 'mouseup', 'mousedown', 'mousemove', 'contextmenu' ]; var touchHandlerNames = [ 'touchstart', 'touchend', 'touchmove' ]; var pointerEventNames = { pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1 }; var pointerHandlerNames = map(mouseHandlerNames, function (name) { var nm = name.replace('mouse', 'pointer'); return pointerEventNames[nm] ? nm : name; }); function eventNameFix(name) { return (name === 'mousewheel' && env$1.browser.firefox) ? 'DOMMouseScroll' : name; } function processGesture(proxy, event, stage) { var gestureMgr = proxy._gestureMgr; stage === 'start' && gestureMgr.clear(); var gestureInfo = gestureMgr.recognize( event, proxy.handler.findHover(event.zrX, event.zrY, null).target, proxy.dom ); stage === 'end' && gestureMgr.clear(); // Do not do any preventDefault here. Upper application do that if necessary. if (gestureInfo) { var type = gestureInfo.type; event.gestureEvent = type; proxy.handler.dispatchToElement({target: gestureInfo.target}, type, gestureInfo.event); } } // function onMSGestureChange(proxy, event) { // if (event.translationX || event.translationY) { // // mousemove is carried by MSGesture to reduce the sensitivity. // proxy.handler.dispatchToElement(event.target, 'mousemove', event); // } // if (event.scale !== 1) { // event.pinchX = event.offsetX; // event.pinchY = event.offsetY; // event.pinchScale = event.scale; // proxy.handler.dispatchToElement(event.target, 'pinch', event); // } // } /** * Prevent mouse event from being dispatched after Touch Events action * @see * 1. Mobile browsers dispatch mouse events 300ms after touchend. * 2. Chrome for Android dispatch mousedown for long-touch about 650ms * Result: Blocking Mouse Events for 700ms. */ function setTouchTimer(instance) { instance._touching = true; clearTimeout(instance._touchTimer); instance._touchTimer = setTimeout(function () { instance._touching = false; }, 700); } var domHandlers = { /** * Mouse move handler * @inner * @param {Event} event */ mousemove: function (event) { event = normalizeEvent(this.dom, event); this.trigger('mousemove', event); }, /** * Mouse out handler * @inner * @param {Event} event */ mouseout: function (event) { event = normalizeEvent(this.dom, event); var element = event.toElement || event.relatedTarget; if (element != this.dom) { while (element && element.nodeType != 9) { // 忽略包含在root中的dom引起的mouseOut if (element === this.dom) { return; } element = element.parentNode; } } this.trigger('mouseout', event); }, /** * Touch开始响应函数 * @inner * @param {Event} event */ touchstart: function (event) { // Default mouse behaviour should not be disabled here. // For example, page may needs to be slided. event = normalizeEvent(this.dom, event); // Mark touch, which is useful in distinguish touch and // mouse event in upper applicatoin. event.zrByTouch = true; this._lastTouchMoment = new Date(); processGesture(this, event, 'start'); // In touch device, trigger `mousemove`(`mouseover`) should // be triggered, and must before `mousedown` triggered. domHandlers.mousemove.call(this, event); domHandlers.mousedown.call(this, event); setTouchTimer(this); }, /** * Touch移动响应函数 * @inner * @param {Event} event */ touchmove: function (event) { event = normalizeEvent(this.dom, event); // Mark touch, which is useful in distinguish touch and // mouse event in upper applicatoin. event.zrByTouch = true; processGesture(this, event, 'change'); // Mouse move should always be triggered no matter whether // there is gestrue event, because mouse move and pinch may // be used at the same time. domHandlers.mousemove.call(this, event); setTouchTimer(this); }, /** * Touch结束响应函数 * @inner * @param {Event} event */ touchend: function (event) { event = normalizeEvent(this.dom, event); // Mark touch, which is useful in distinguish touch and // mouse event in upper applicatoin. event.zrByTouch = true; processGesture(this, event, 'end'); domHandlers.mouseup.call(this, event); // Do not trigger `mouseout` here, in spite of `mousemove`(`mouseover`) is // triggered in `touchstart`. This seems to be illogical, but by this mechanism, // we can conveniently implement "hover style" in both PC and touch device just // by listening to `mouseover` to add "hover style" and listening to `mouseout` // to remove "hover style" on an element, without any additional code for // compatibility. (`mouseout` will not be triggered in `touchend`, so "hover // style" will remain for user view) // click event should always be triggered no matter whether // there is gestrue event. System click can not be prevented. if (+new Date() - this._lastTouchMoment < TOUCH_CLICK_DELAY) { domHandlers.click.call(this, event); } setTouchTimer(this); }, pointerdown: function (event) { domHandlers.mousedown.call(this, event); // if (useMSGuesture(this, event)) { // this._msGesture.addPointer(event.pointerId); // } }, pointermove: function (event) { // FIXME // pointermove is so sensitive that it always triggered when // tap(click) on touch screen, which affect some judgement in // upper application. So, we dont support mousemove on MS touch // device yet. if (!isPointerFromTouch(event)) { domHandlers.mousemove.call(this, event); } }, pointerup: function (event) { domHandlers.mouseup.call(this, event); }, pointerout: function (event) { // pointerout will be triggered when tap on touch screen // (IE11+/Edge on MS Surface) after click event triggered, // which is inconsistent with the mousout behavior we defined // in touchend. So we unify them. // (check domHandlers.touchend for detailed explanation) if (!isPointerFromTouch(event)) { domHandlers.mouseout.call(this, event); } } }; function isPointerFromTouch(event) { var pointerType = event.pointerType; return pointerType === 'pen' || pointerType === 'touch'; } // function useMSGuesture(handlerProxy, event) { // return isPointerFromTouch(event) && !!handlerProxy._msGesture; // } // Common handlers each$1(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) { domHandlers[name] = function (event) { event = normalizeEvent(this.dom, event); this.trigger(name, event); }; }); /** * 为控制类实例初始化dom 事件处理函数 * * @inner * @param {module:zrender/Handler} instance 控制类实例 */ function initDomHandler(instance) { each$1(touchHandlerNames, function (name) { instance._handlers[name] = bind(domHandlers[name], instance); }); each$1(pointerHandlerNames, function (name) { instance._handlers[name] = bind(domHandlers[name], instance); }); each$1(mouseHandlerNames, function (name) { instance._handlers[name] = makeMouseHandler(domHandlers[name], instance); }); function makeMouseHandler(fn, instance) { return function () { if (instance._touching) { return; } return fn.apply(instance, arguments); }; } } function HandlerDomProxy(dom) { Eventful.call(this); this.dom = dom; /** * @private * @type {boolean} */ this._touching = false; /** * @private * @type {number} */ this._touchTimer; /** * @private * @type {module:zrender/core/GestureMgr} */ this._gestureMgr = new GestureMgr(); this._handlers = {}; initDomHandler(this); if (env$1.pointerEventsSupported) { // Only IE11+/Edge // 1. On devices that both enable touch and mouse (e.g., MS Surface and lenovo X240), // IE11+/Edge do not trigger touch event, but trigger pointer event and mouse event // at the same time. // 2. On MS Surface, it probablely only trigger mousedown but no mouseup when tap on // screen, which do not occurs in pointer event. // So we use pointer event to both detect touch gesture and mouse behavior. mountHandlers(pointerHandlerNames, this); // FIXME // Note: MS Gesture require CSS touch-action set. But touch-action is not reliable, // which does not prevent defuault behavior occasionally (which may cause view port // zoomed in but use can not zoom it back). And event.preventDefault() does not work. // So we have to not to use MSGesture and not to support touchmove and pinch on MS // touch screen. And we only support click behavior on MS touch screen now. // MS Gesture Event is only supported on IE11+/Edge and on Windows 8+. // We dont support touch on IE on win7. // See // if (typeof MSGesture === 'function') { // (this._msGesture = new MSGesture()).target = dom; // jshint ignore:line // dom.addEventListener('MSGestureChange', onMSGestureChange); // } } else { if (env$1.touchEventsSupported) { mountHandlers(touchHandlerNames, this); // Handler of 'mouseout' event is needed in touch mode, which will be mounted below. // addEventListener(root, 'mouseout', this._mouseoutHandler); } // 1. Considering some devices that both enable touch and mouse event (like on MS Surface // and lenovo X240, @see #2350), we make mouse event be always listened, otherwise // mouse event can not be handle in those devices. // 2. On MS Surface, Chrome will trigger both touch event and mouse event. How to prevent // mouseevent after touch event triggered, see `setTouchTimer`. mountHandlers(mouseHandlerNames, this); } function mountHandlers(handlerNames, instance) { each$1(handlerNames, function (name) { addEventListener(dom, eventNameFix(name), instance._handlers[name]); }, instance); } } var handlerDomProxyProto = HandlerDomProxy.prototype; handlerDomProxyProto.dispose = function () { var handlerNames = mouseHandlerNames.concat(touchHandlerNames); for (var i = 0; i < handlerNames.length; i++) { var name = handlerNames[i]; removeEventListener(this.dom, eventNameFix(name), this._handlers[name]); } }; handlerDomProxyProto.setCursor = function (cursorStyle) { this.dom.style && (this.dom.style.cursor = cursorStyle || 'default'); }; mixin(HandlerDomProxy, Eventful); /*! * ZRender, a high performance 2d drawing library. * * Copyright (c) 2013, Baidu Inc. * All rights reserved. * * LICENSE * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ var useVML = !env$1.canvasSupported; var painterCtors = { canvas: Painter }; var instances$1 = {}; // ZRender实例map索引 /** * @type {string} */ var version$1 = '4.0.4'; /** * Initializing a zrender instance * @param {HTMLElement} dom * @param {Object} opts * @param {string} [opts.renderer='canvas'] 'canvas' or 'svg' * @param {number} [opts.devicePixelRatio] * @param {number|string} [opts.width] Can be 'auto' (the same as null/undefined) * @param {number|string} [opts.height] Can be 'auto' (the same as null/undefined) * @return {module:zrender/ZRender} */ function init$1(dom, opts) { var zr = new ZRender(guid(), dom, opts); instances$1[zr.id] = zr; return zr; } /** * Dispose zrender instance * @param {module:zrender/ZRender} zr */ function dispose$1(zr) { if (zr) { zr.dispose(); } else { for (var key in instances$1) { if (instances$1.hasOwnProperty(key)) { instances$1[key].dispose(); } } instances$1 = {}; } return this; } /** * Get zrender instance by id * @param {string} id zrender instance id * @return {module:zrender/ZRender} */ function getInstance(id) { return instances$1[id]; } function registerPainter(name, Ctor) { painterCtors[name] = Ctor; } function delInstance(id) { delete instances$1[id]; } /** * @module zrender/ZRender */ /** * @constructor * @alias module:zrender/ZRender * @param {string} id * @param {HTMLElement} dom * @param {Object} opts * @param {string} [opts.renderer='canvas'] 'canvas' or 'svg' * @param {number} [opts.devicePixelRatio] * @param {number} [opts.width] Can be 'auto' (the same as null/undefined) * @param {number} [opts.height] Can be 'auto' (the same as null/undefined) */ var ZRender = function (id, dom, opts) { opts = opts || {}; /** * @type {HTMLDomElement} */ this.dom = dom; /** * @type {string} */ this.id = id; var self = this; var storage = new Storage(); var rendererType = opts.renderer; // TODO WebGL if (useVML) { if (!painterCtors.vml) { throw new Error('You need to require \'zrender/vml/vml\' to support IE8'); } rendererType = 'vml'; } else if (!rendererType || !painterCtors[rendererType]) { rendererType = 'canvas'; } var painter = new painterCtors[rendererType](dom, storage, opts, id); this.storage = storage; this.painter = painter; var handerProxy = (!env$1.node && !env$1.worker) ? new HandlerDomProxy(painter.getViewportRoot()) : null; this.handler = new Handler(storage, painter, handerProxy, painter.root); /** * @type {module:zrender/animation/Animation} */ this.animation = new Animation({ stage: { update: bind(this.flush, this) } }); this.animation.start(); /** * @type {boolean} * @private */ this._needsRefresh; // 修改 storage.delFromStorage, 每次删除元素之前删除动画 // FIXME 有点ugly var oldDelFromStorage = storage.delFromStorage; var oldAddToStorage = storage.addToStorage; storage.delFromStorage = function (el) { oldDelFromStorage.call(storage, el); el && el.removeSelfFromZr(self); }; storage.addToStorage = function (el) { oldAddToStorage.call(storage, el); el.addSelfToZr(self); }; }; ZRender.prototype = { constructor: ZRender, /** * 获取实例唯一标识 * @return {string} */ getId: function () { return this.id; }, /** * 添加元素 * @param {module:zrender/Element} el */ add: function (el) { this.storage.addRoot(el); this._needsRefresh = true; }, /** * 删除元素 * @param {module:zrender/Element} el */ remove: function (el) { this.storage.delRoot(el); this._needsRefresh = true; }, /** * Change configuration of layer * @param {string} zLevel * @param {Object} config * @param {string} [config.clearColor=0] Clear color * @param {string} [config.motionBlur=false] If enable motion blur * @param {number} [config.lastFrameAlpha=0.7] Motion blur factor. Larger value cause longer trailer */ configLayer: function (zLevel, config) { if (this.painter.configLayer) { this.painter.configLayer(zLevel, config); } this._needsRefresh = true; }, /** * Set background color * @param {string} backgroundColor */ setBackgroundColor: function (backgroundColor) { if (this.painter.setBackgroundColor) { this.painter.setBackgroundColor(backgroundColor); } this._needsRefresh = true; }, /** * Repaint the canvas immediately */ refreshImmediately: function () { // var start = new Date(); // Clear needsRefresh ahead to avoid something wrong happens in refresh // Or it will cause zrender refreshes again and again. this._needsRefresh = false; this.painter.refresh(); /** * Avoid trigger zr.refresh in Element#beforeUpdate hook */ this._needsRefresh = false; // var end = new Date(); // var log = document.getElementById('log'); // if (log) { // log.innerHTML = log.innerHTML + '
          ' + (end - start); // } }, /** * Mark and repaint the canvas in the next frame of browser */ refresh: function() { this._needsRefresh = true; }, /** * Perform all refresh */ flush: function () { var triggerRendered; if (this._needsRefresh) { triggerRendered = true; this.refreshImmediately(); } if (this._needsRefreshHover) { triggerRendered = true; this.refreshHoverImmediately(); } triggerRendered && this.trigger('rendered'); }, /** * Add element to hover layer * @param {module:zrender/Element} el * @param {Object} style */ addHover: function (el, style) { if (this.painter.addHover) { this.painter.addHover(el, style); this.refreshHover(); } }, /** * Add element from hover layer * @param {module:zrender/Element} el */ removeHover: function (el) { if (this.painter.removeHover) { this.painter.removeHover(el); this.refreshHover(); } }, /** * Clear all hover elements in hover layer * @param {module:zrender/Element} el */ clearHover: function () { if (this.painter.clearHover) { this.painter.clearHover(); this.refreshHover(); } }, /** * Refresh hover in next frame */ refreshHover: function () { this._needsRefreshHover = true; }, /** * Refresh hover immediately */ refreshHoverImmediately: function () { this._needsRefreshHover = false; this.painter.refreshHover && this.painter.refreshHover(); }, /** * Resize the canvas. * Should be invoked when container size is changed * @param {Object} [opts] * @param {number|string} [opts.width] Can be 'auto' (the same as null/undefined) * @param {number|string} [opts.height] Can be 'auto' (the same as null/undefined) */ resize: function(opts) { opts = opts || {}; this.painter.resize(opts.width, opts.height); this.handler.resize(); }, /** * Stop and clear all animation immediately */ clearAnimation: function () { this.animation.clear(); }, /** * Get container width */ getWidth: function() { return this.painter.getWidth(); }, /** * Get container height */ getHeight: function() { return this.painter.getHeight(); }, /** * Export the canvas as Base64 URL * @param {string} type * @param {string} [backgroundColor='#fff'] * @return {string} Base64 URL */ // toDataURL: function(type, backgroundColor) { // return this.painter.getRenderedCanvas({ // backgroundColor: backgroundColor // }).toDataURL(type); // }, /** * Converting a path to image. * It has much better performance of drawing image rather than drawing a vector path. * @param {module:zrender/graphic/Path} e * @param {number} width * @param {number} height */ pathToImage: function(e, dpr) { return this.painter.pathToImage(e, dpr); }, /** * Set default cursor * @param {string} [cursorStyle='default'] 例如 crosshair */ setCursorStyle: function (cursorStyle) { this.handler.setCursorStyle(cursorStyle); }, /** * Find hovered element * @param {number} x * @param {number} y * @return {Object} {target, topTarget} */ findHover: function (x, y) { return this.handler.findHover(x, y); }, /** * Bind event * * @param {string} eventName Event name * @param {Function} eventHandler Handler function * @param {Object} [context] Context object */ on: function(eventName, eventHandler, context) { this.handler.on(eventName, eventHandler, context); }, /** * Unbind event * @param {string} eventName Event name * @param {Function} [eventHandler] Handler function */ off: function(eventName, eventHandler) { this.handler.off(eventName, eventHandler); }, /** * Trigger event manually * * @param {string} eventName Event name * @param {event=} event Event object */ trigger: function (eventName, event) { this.handler.trigger(eventName, event); }, /** * Clear all objects and the canvas. */ clear: function () { this.storage.delRoot(); this.painter.clear(); }, /** * Dispose self. */ dispose: function () { this.animation.stop(); this.clear(); this.storage.dispose(); this.painter.dispose(); this.handler.dispose(); this.animation = this.storage = this.painter = this.handler = null; delInstance(this.id); } }; var zrender = (Object.freeze || Object)({ version: version$1, init: init$1, dispose: dispose$1, getInstance: getInstance, registerPainter: registerPainter }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$2 = each$1; var isObject$2 = isObject$1; var isArray$1 = isArray; /** * Make the name displayable. But we should * make sure it is not duplicated with user * specified name, so use '\0'; */ var DUMMY_COMPONENT_NAME_PREFIX = 'series\0'; /** * If value is not array, then translate it to array. * @param {*} value * @return {Array} [value] or value */ function normalizeToArray(value) { return value instanceof Array ? value : value == null ? [] : [value]; } /** * Sync default option between normal and emphasis like `position` and `show` * In case some one will write code like * label: { * show: false, * position: 'outside', * fontSize: 18 * }, * emphasis: { * label: { show: true } * } * @param {Object} opt * @param {string} key * @param {Array.} subOpts */ function defaultEmphasis(opt, key, subOpts) { // Caution: performance sensitive. if (opt) { opt[key] = opt[key] || {}; opt.emphasis = opt.emphasis || {}; opt.emphasis[key] = opt.emphasis[key] || {}; // Default emphasis option from normal for (var i = 0, len = subOpts.length; i < len; i++) { var subOptName = subOpts[i]; if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName) ) { opt.emphasis[key][subOptName] = opt[key][subOptName]; } } } } var TEXT_STYLE_OPTIONS = [ 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth', 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY', 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding' ]; // modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([ // 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter', // 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily', // // FIXME: deprecated, check and remove it. // 'textStyle' // ]); /** * The method do not ensure performance. * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}] * This helper method retieves value from data. * @param {string|number|Date|Array|Object} dataItem * @return {number|string|Date|Array.} */ function getDataItemValue(dataItem) { return (isObject$2(dataItem) && !isArray$1(dataItem) && !(dataItem instanceof Date)) ? dataItem.value : dataItem; } /** * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}] * This helper method determine if dataItem has extra option besides value * @param {string|number|Date|Array|Object} dataItem */ function isDataItemOption(dataItem) { return isObject$2(dataItem) && !(dataItem instanceof Array); // // markLine data can be array // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array)); } /** * Mapping to exists for merge. * * @public * @param {Array.|Array.} exists * @param {Object|Array.} newCptOptions * @return {Array.} Result, like [{exist: ..., option: ...}, {}], * index of which is the same as exists. */ function mappingToExists(exists, newCptOptions) { // Mapping by the order by original option (but not order of // new option) in merge mode. Because we should ensure // some specified index (like xAxisIndex) is consistent with // original option, which is easy to understand, espatially in // media query. And in most case, merge option is used to // update partial option but not be expected to change order. newCptOptions = (newCptOptions || []).slice(); var result = map(exists || [], function (obj, index) { return {exist: obj}; }); // Mapping by id or name if specified. each$2(newCptOptions, function (cptOption, index) { if (!isObject$2(cptOption)) { return; } // id has highest priority. for (var i = 0; i < result.length; i++) { if (!result[i].option // Consider name: two map to one. && cptOption.id != null && result[i].exist.id === cptOption.id + '' ) { result[i].option = cptOption; newCptOptions[index] = null; return; } } for (var i = 0; i < result.length; i++) { var exist = result[i].exist; if (!result[i].option // Consider name: two map to one. // Can not match when both ids exist but different. && (exist.id == null || cptOption.id == null) && cptOption.name != null && !isIdInner(cptOption) && !isIdInner(exist) && exist.name === cptOption.name + '' ) { result[i].option = cptOption; newCptOptions[index] = null; return; } } }); // Otherwise mapping by index. each$2(newCptOptions, function (cptOption, index) { if (!isObject$2(cptOption)) { return; } var i = 0; for (; i < result.length; i++) { var exist = result[i].exist; if (!result[i].option // Existing model that already has id should be able to // mapped to (because after mapping performed model may // be assigned with a id, whish should not affect next // mapping), except those has inner id. && !isIdInner(exist) // Caution: // Do not overwrite id. But name can be overwritten, // because axis use name as 'show label text'. // 'exist' always has id and name and we dont // need to check it. && cptOption.id == null ) { result[i].option = cptOption; break; } } if (i >= result.length) { result.push({option: cptOption}); } }); return result; } /** * Make id and name for mapping result (result of mappingToExists) * into `keyInfo` field. * * @public * @param {Array.} Result, like [{exist: ..., option: ...}, {}], * which order is the same as exists. * @return {Array.} The input. */ function makeIdAndName(mapResult) { // We use this id to hash component models and view instances // in echarts. id can be specified by user, or auto generated. // The id generation rule ensures new view instance are able // to mapped to old instance when setOption are called in // no-merge mode. So we generate model id by name and plus // type in view id. // name can be duplicated among components, which is convenient // to specify multi components (like series) by one name. // Ensure that each id is distinct. var idMap = createHashMap(); each$2(mapResult, function (item, index) { var existCpt = item.exist; existCpt && idMap.set(existCpt.id, item); }); each$2(mapResult, function (item, index) { var opt = item.option; assert$1( !opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id) ); opt && opt.id != null && idMap.set(opt.id, item); !item.keyInfo && (item.keyInfo = {}); }); // Make name and id. each$2(mapResult, function (item, index) { var existCpt = item.exist; var opt = item.option; var keyInfo = item.keyInfo; if (!isObject$2(opt)) { return; } // name can be overwitten. Consider case: axis.name = '20km'. // But id generated by name will not be changed, which affect // only in that case: setOption with 'not merge mode' and view // instance will be recreated, which can be accepted. keyInfo.name = opt.name != null ? opt.name + '' : existCpt ? existCpt.name // Avoid diffferent series has the same name, // because name may be used like in color pallet. : DUMMY_COMPONENT_NAME_PREFIX + index; if (existCpt) { keyInfo.id = existCpt.id; } else if (opt.id != null) { keyInfo.id = opt.id + ''; } else { // Consider this situatoin: // optionA: [{name: 'a'}, {name: 'a'}, {..}] // optionB [{..}, {name: 'a'}, {name: 'a'}] // Series with the same name between optionA and optionB // should be mapped. var idNum = 0; do { keyInfo.id = '\0' + keyInfo.name + '\0' + idNum++; } while (idMap.get(keyInfo.id)); } idMap.set(keyInfo.id, item); }); } function isNameSpecified(componentModel) { var name = componentModel.name; // Is specified when `indexOf` get -1 or > 0. return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX)); } /** * @public * @param {Object} cptOption * @return {boolean} */ function isIdInner(cptOption) { return isObject$2(cptOption) && cptOption.id && (cptOption.id + '').indexOf('\0_ec_\0') === 0; } /** * A helper for removing duplicate items between batchA and batchB, * and in themselves, and categorize by series. * * @param {Array.} batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...] * @param {Array.} batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...] * @return {Array., Array.>} result: [resultBatchA, resultBatchB] */ function compressBatches(batchA, batchB) { var mapA = {}; var mapB = {}; makeMap(batchA || [], mapA); makeMap(batchB || [], mapB, mapA); return [mapToArray(mapA), mapToArray(mapB)]; function makeMap(sourceBatch, map$$1, otherMap) { for (var i = 0, len = sourceBatch.length; i < len; i++) { var seriesId = sourceBatch[i].seriesId; var dataIndices = normalizeToArray(sourceBatch[i].dataIndex); var otherDataIndices = otherMap && otherMap[seriesId]; for (var j = 0, lenj = dataIndices.length; j < lenj; j++) { var dataIndex = dataIndices[j]; if (otherDataIndices && otherDataIndices[dataIndex]) { otherDataIndices[dataIndex] = null; } else { (map$$1[seriesId] || (map$$1[seriesId] = {}))[dataIndex] = 1; } } } } function mapToArray(map$$1, isData) { var result = []; for (var i in map$$1) { if (map$$1.hasOwnProperty(i) && map$$1[i] != null) { if (isData) { result.push(+i); } else { var dataIndices = mapToArray(map$$1[i], true); dataIndices.length && result.push({seriesId: i, dataIndex: dataIndices}); } } } return result; } } /** * @param {module:echarts/data/List} data * @param {Object} payload Contains dataIndex (means rawIndex) / dataIndexInside / name * each of which can be Array or primary type. * @return {number|Array.} dataIndex If not found, return undefined/null. */ function queryDataIndex(data, payload) { if (payload.dataIndexInside != null) { return payload.dataIndexInside; } else if (payload.dataIndex != null) { return isArray(payload.dataIndex) ? map(payload.dataIndex, function (value) { return data.indexOfRawIndex(value); }) : data.indexOfRawIndex(payload.dataIndex); } else if (payload.name != null) { return isArray(payload.name) ? map(payload.name, function (value) { return data.indexOfName(value); }) : data.indexOfName(payload.name); } } /** * Enable property storage to any host object. * Notice: Serialization is not supported. * * For example: * var inner = zrUitl.makeInner(); * * function some1(hostObj) { * inner(hostObj).someProperty = 1212; * ... * } * function some2() { * var fields = inner(this); * fields.someProperty1 = 1212; * fields.someProperty2 = 'xx'; * ... * } * * @return {Function} */ function makeInner() { // Consider different scope by es module import. var key = '__\0ec_inner_' + innerUniqueIndex++ + '_' + Math.random().toFixed(5); return function (hostObj) { return hostObj[key] || (hostObj[key] = {}); }; } var innerUniqueIndex = 0; /** * @param {module:echarts/model/Global} ecModel * @param {string|Object} finder * If string, e.g., 'geo', means {geoIndex: 0}. * If Object, could contain some of these properties below: * { * seriesIndex, seriesId, seriesName, * geoIndex, geoId, geoName, * bmapIndex, bmapId, bmapName, * xAxisIndex, xAxisId, xAxisName, * yAxisIndex, yAxisId, yAxisName, * gridIndex, gridId, gridName, * ... (can be extended) * } * Each properties can be number|string|Array.|Array. * For example, a finder could be * { * seriesIndex: 3, * geoId: ['aa', 'cc'], * gridName: ['xx', 'rr'] * } * xxxIndex can be set as 'all' (means all xxx) or 'none' (means not specify) * If nothing or null/undefined specified, return nothing. * @param {Object} [opt] * @param {string} [opt.defaultMainType] * @param {Array.} [opt.includeMainTypes] * @return {Object} result like: * { * seriesModels: [seriesModel1, seriesModel2], * seriesModel: seriesModel1, // The first model * geoModels: [geoModel1, geoModel2], * geoModel: geoModel1, // The first model * ... * } */ function parseFinder(ecModel, finder, opt) { if (isString(finder)) { var obj = {}; obj[finder + 'Index'] = 0; finder = obj; } var defaultMainType = opt && opt.defaultMainType; if (defaultMainType && !has(finder, defaultMainType + 'Index') && !has(finder, defaultMainType + 'Id') && !has(finder, defaultMainType + 'Name') ) { finder[defaultMainType + 'Index'] = 0; } var result = {}; each$2(finder, function (value, key) { var value = finder[key]; // Exclude 'dataIndex' and other illgal keys. if (key === 'dataIndex' || key === 'dataIndexInside') { result[key] = value; return; } var parsedKey = key.match(/^(\w+)(Index|Id|Name)$/) || []; var mainType = parsedKey[1]; var queryType = (parsedKey[2] || '').toLowerCase(); if (!mainType || !queryType || value == null || (queryType === 'index' && value === 'none') || (opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) ) { return; } var queryParam = {mainType: mainType}; if (queryType !== 'index' || value !== 'all') { queryParam[queryType] = value; } var models = ecModel.queryComponents(queryParam); result[mainType + 'Models'] = models; result[mainType + 'Model'] = models[0]; }); return result; } function has(obj, prop) { return obj && obj.hasOwnProperty(prop); } function setAttribute(dom, key, value) { dom.setAttribute ? dom.setAttribute(key, value) : (dom[key] = value); } function getAttribute(dom, key) { return dom.getAttribute ? dom.getAttribute(key) : dom[key]; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var TYPE_DELIMITER = '.'; var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___'; /** * Notice, parseClassType('') should returns {main: '', sub: ''} * @public */ function parseClassType$1(componentType) { var ret = {main: '', sub: ''}; if (componentType) { componentType = componentType.split(TYPE_DELIMITER); ret.main = componentType[0] || ''; ret.sub = componentType[1] || ''; } return ret; } /** * @public */ function checkClassType(componentType) { assert$1( /^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType "' + componentType + '" illegal' ); } /** * @public */ function enableClassExtend(RootClass, mandatoryMethods) { RootClass.$constructor = RootClass; RootClass.extend = function (proto) { if (__DEV__) { each$1(mandatoryMethods, function (method) { if (!proto[method]) { console.warn( 'Method `' + method + '` should be implemented' + (proto.type ? ' in ' + proto.type : '') + '.' ); } }); } var superClass = this; var ExtendedClass = function () { if (!proto.$constructor) { superClass.apply(this, arguments); } else { proto.$constructor.apply(this, arguments); } }; extend(ExtendedClass.prototype, proto); ExtendedClass.extend = this.extend; ExtendedClass.superCall = superCall; ExtendedClass.superApply = superApply; inherits(ExtendedClass, this); ExtendedClass.superClass = superClass; return ExtendedClass; }; } var classBase = 0; /** * Can not use instanceof, consider different scope by * cross domain or es module import in ec extensions. * Mount a method "isInstance()" to Clz. */ function enableClassCheck(Clz) { var classAttr = ['__\0is_clz', classBase++, Math.random().toFixed(3)].join('_'); Clz.prototype[classAttr] = true; if (__DEV__) { assert$1(!Clz.isInstance, 'The method "is" can not be defined.'); } Clz.isInstance = function (obj) { return !!(obj && obj[classAttr]); }; } // superCall should have class info, which can not be fetch from 'this'. // Consider this case: // class A has method f, // class B inherits class A, overrides method f, f call superApply('f'), // class C inherits class B, do not overrides method f, // then when method of class C is called, dead loop occured. function superCall(context, methodName) { var args = slice(arguments, 2); return this.superClass.prototype[methodName].apply(context, args); } function superApply(context, methodName, args) { return this.superClass.prototype[methodName].apply(context, args); } /** * @param {Object} entity * @param {Object} options * @param {boolean} [options.registerWhenExtend] * @public */ function enableClassManagement(entity, options) { options = options || {}; /** * Component model classes * key: componentType, * value: * componentClass, when componentType is 'xxx' * or Object., when componentType is 'xxx.yy' * @type {Object} */ var storage = {}; entity.registerClass = function (Clazz, componentType) { if (componentType) { checkClassType(componentType); componentType = parseClassType$1(componentType); if (!componentType.sub) { if (__DEV__) { if (storage[componentType.main]) { console.warn(componentType.main + ' exists.'); } } storage[componentType.main] = Clazz; } else if (componentType.sub !== IS_CONTAINER) { var container = makeContainer(componentType); container[componentType.sub] = Clazz; } } return Clazz; }; entity.getClass = function (componentMainType, subType, throwWhenNotFound) { var Clazz = storage[componentMainType]; if (Clazz && Clazz[IS_CONTAINER]) { Clazz = subType ? Clazz[subType] : null; } if (throwWhenNotFound && !Clazz) { throw new Error( !subType ? componentMainType + '.' + 'type should be specified.' : 'Component ' + componentMainType + '.' + (subType || '') + ' not exists. Load it first.' ); } return Clazz; }; entity.getClassesByMainType = function (componentType) { componentType = parseClassType$1(componentType); var result = []; var obj = storage[componentType.main]; if (obj && obj[IS_CONTAINER]) { each$1(obj, function (o, type) { type !== IS_CONTAINER && result.push(o); }); } else { result.push(obj); } return result; }; entity.hasClass = function (componentType) { // Just consider componentType.main. componentType = parseClassType$1(componentType); return !!storage[componentType.main]; }; /** * @return {Array.} Like ['aa', 'bb'], but can not be ['aa.xx'] */ entity.getAllClassMainTypes = function () { var types = []; each$1(storage, function (obj, type) { types.push(type); }); return types; }; /** * If a main type is container and has sub types * @param {string} mainType * @return {boolean} */ entity.hasSubTypes = function (componentType) { componentType = parseClassType$1(componentType); var obj = storage[componentType.main]; return obj && obj[IS_CONTAINER]; }; entity.parseClassType = parseClassType$1; function makeContainer(componentType) { var container = storage[componentType.main]; if (!container || !container[IS_CONTAINER]) { container = storage[componentType.main] = {}; container[IS_CONTAINER] = true; } return container; } if (options.registerWhenExtend) { var originalExtend = entity.extend; if (originalExtend) { entity.extend = function (proto) { var ExtendedClass = originalExtend.call(this, proto); return entity.registerClass(ExtendedClass, proto.type); }; } } return entity; } /** * @param {string|Array.} properties */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // TODO Parse shadow style // TODO Only shallow path support var makeStyleMapper = function (properties) { // Normalize for (var i = 0; i < properties.length; i++) { if (!properties[i][1]) { properties[i][1] = properties[i][0]; } } return function (model, excludes, includes) { var style = {}; for (var i = 0; i < properties.length; i++) { var propName = properties[i][1]; if ((excludes && indexOf(excludes, propName) >= 0) || (includes && indexOf(includes, propName) < 0) ) { continue; } var val = model.getShallow(propName); if (val != null) { style[properties[i][0]] = val; } } return style; }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var getLineStyle = makeStyleMapper( [ ['lineWidth', 'width'], ['stroke', 'color'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'] ] ); var lineStyleMixin = { getLineStyle: function (excludes) { var style = getLineStyle(this, excludes); var lineDash = this.getLineDash(style.lineWidth); lineDash && (style.lineDash = lineDash); return style; }, getLineDash: function (lineWidth) { if (lineWidth == null) { lineWidth = 1; } var lineType = this.get('type'); var dotSize = Math.max(lineWidth, 2); var dashSize = lineWidth * 4; return (lineType === 'solid' || lineType == null) ? null : (lineType === 'dashed' ? [dashSize, dashSize] : [dotSize, dotSize]); } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var getAreaStyle = makeStyleMapper( [ ['fill', 'color'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['opacity'], ['shadowColor'] ] ); var areaStyleMixin = { getAreaStyle: function (excludes, includes) { return getAreaStyle(this, excludes, includes); } }; /** * 曲线辅助模块 * @module zrender/core/curve * @author pissang(https://www.github.com/pissang) */ var mathPow = Math.pow; var mathSqrt$2 = Math.sqrt; var EPSILON$1 = 1e-8; var EPSILON_NUMERIC = 1e-4; var THREE_SQRT = mathSqrt$2(3); var ONE_THIRD = 1 / 3; // 临时变量 var _v0 = create(); var _v1 = create(); var _v2 = create(); function isAroundZero(val) { return val > -EPSILON$1 && val < EPSILON$1; } function isNotAroundZero$1(val) { return val > EPSILON$1 || val < -EPSILON$1; } /** * 计算三次贝塞尔值 * @memberOf module:zrender/core/curve * @param {number} p0 * @param {number} p1 * @param {number} p2 * @param {number} p3 * @param {number} t * @return {number} */ function cubicAt(p0, p1, p2, p3, t) { var onet = 1 - t; return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2); } /** * 计算三次贝塞尔导数值 * @memberOf module:zrender/core/curve * @param {number} p0 * @param {number} p1 * @param {number} p2 * @param {number} p3 * @param {number} t * @return {number} */ function cubicDerivativeAt(p0, p1, p2, p3, t) { var onet = 1 - t; return 3 * ( ((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t ); } /** * 计算三次贝塞尔方程根,使用盛金公式 * @memberOf module:zrender/core/curve * @param {number} p0 * @param {number} p1 * @param {number} p2 * @param {number} p3 * @param {number} val * @param {Array.} roots * @return {number} 有效根数目 */ function cubicRootAt(p0, p1, p2, p3, val, roots) { // Evaluate roots of cubic functions var a = p3 + 3 * (p1 - p2) - p0; var b = 3 * (p2 - p1 * 2 + p0); var c = 3 * (p1 - p0); var d = p0 - val; var A = b * b - 3 * a * c; var B = b * c - 9 * a * d; var C = c * c - 3 * b * d; var n = 0; if (isAroundZero(A) && isAroundZero(B)) { if (isAroundZero(b)) { roots[0] = 0; } else { var t1 = -c / b; //t1, t2, t3, b is not zero if (t1 >= 0 && t1 <= 1) { roots[n++] = t1; } } } else { var disc = B * B - 4 * A * C; if (isAroundZero(disc)) { var K = B / A; var t1 = -b / a + K; // t1, a is not zero var t2 = -K / 2; // t2, t3 if (t1 >= 0 && t1 <= 1) { roots[n++] = t1; } if (t2 >= 0 && t2 <= 1) { roots[n++] = t2; } } else if (disc > 0) { var discSqrt = mathSqrt$2(disc); var Y1 = A * b + 1.5 * a * (-B + discSqrt); var Y2 = A * b + 1.5 * a * (-B - discSqrt); if (Y1 < 0) { Y1 = -mathPow(-Y1, ONE_THIRD); } else { Y1 = mathPow(Y1, ONE_THIRD); } if (Y2 < 0) { Y2 = -mathPow(-Y2, ONE_THIRD); } else { Y2 = mathPow(Y2, ONE_THIRD); } var t1 = (-b - (Y1 + Y2)) / (3 * a); if (t1 >= 0 && t1 <= 1) { roots[n++] = t1; } } else { var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt$2(A * A * A)); var theta = Math.acos(T) / 3; var ASqrt = mathSqrt$2(A); var tmp = Math.cos(theta); var t1 = (-b - 2 * ASqrt * tmp) / (3 * a); var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); if (t1 >= 0 && t1 <= 1) { roots[n++] = t1; } if (t2 >= 0 && t2 <= 1) { roots[n++] = t2; } if (t3 >= 0 && t3 <= 1) { roots[n++] = t3; } } } return n; } /** * 计算三次贝塞尔方程极限值的位置 * @memberOf module:zrender/core/curve * @param {number} p0 * @param {number} p1 * @param {number} p2 * @param {number} p3 * @param {Array.} extrema * @return {number} 有效数目 */ function cubicExtrema(p0, p1, p2, p3, extrema) { var b = 6 * p2 - 12 * p1 + 6 * p0; var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; var c = 3 * p1 - 3 * p0; var n = 0; if (isAroundZero(a)) { if (isNotAroundZero$1(b)) { var t1 = -c / b; if (t1 >= 0 && t1 <=1) { extrema[n++] = t1; } } } else { var disc = b * b - 4 * a * c; if (isAroundZero(disc)) { extrema[0] = -b / (2 * a); } else if (disc > 0) { var discSqrt = mathSqrt$2(disc); var t1 = (-b + discSqrt) / (2 * a); var t2 = (-b - discSqrt) / (2 * a); if (t1 >= 0 && t1 <= 1) { extrema[n++] = t1; } if (t2 >= 0 && t2 <= 1) { extrema[n++] = t2; } } } return n; } /** * 细分三次贝塞尔曲线 * @memberOf module:zrender/core/curve * @param {number} p0 * @param {number} p1 * @param {number} p2 * @param {number} p3 * @param {number} t * @param {Array.} out */ function cubicSubdivide(p0, p1, p2, p3, t, out) { var p01 = (p1 - p0) * t + p0; var p12 = (p2 - p1) * t + p1; var p23 = (p3 - p2) * t + p2; var p012 = (p12 - p01) * t + p01; var p123 = (p23 - p12) * t + p12; var p0123 = (p123 - p012) * t + p012; // Seg0 out[0] = p0; out[1] = p01; out[2] = p012; out[3] = p0123; // Seg1 out[4] = p0123; out[5] = p123; out[6] = p23; out[7] = p3; } /** * 投射点到三次贝塞尔曲线上,返回投射距离。 * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 * @param {number} x0 * @param {number} y0 * @param {number} x1 * @param {number} y1 * @param {number} x2 * @param {number} y2 * @param {number} x3 * @param {number} y3 * @param {number} x * @param {number} y * @param {Array.} [out] 投射点 * @return {number} */ function cubicProjectPoint( x0, y0, x1, y1, x2, y2, x3, y3, x, y, out ) { // http://pomax.github.io/bezierinfo/#projections var t; var interval = 0.005; var d = Infinity; var prev; var next; var d1; var d2; _v0[0] = x; _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值 // PENDING for (var _t = 0; _t < 1; _t += 0.05) { _v1[0] = cubicAt(x0, x1, x2, x3, _t); _v1[1] = cubicAt(y0, y1, y2, y3, _t); d1 = distSquare(_v0, _v1); if (d1 < d) { t = _t; d = d1; } } d = Infinity; // At most 32 iteration for (var i = 0; i < 32; i++) { if (interval < EPSILON_NUMERIC) { break; } prev = t - interval; next = t + interval; // t - interval _v1[0] = cubicAt(x0, x1, x2, x3, prev); _v1[1] = cubicAt(y0, y1, y2, y3, prev); d1 = distSquare(_v1, _v0); if (prev >= 0 && d1 < d) { t = prev; d = d1; } else { // t + interval _v2[0] = cubicAt(x0, x1, x2, x3, next); _v2[1] = cubicAt(y0, y1, y2, y3, next); d2 = distSquare(_v2, _v0); if (next <= 1 && d2 < d) { t = next; d = d2; } else { interval *= 0.5; } } } // t if (out) { out[0] = cubicAt(x0, x1, x2, x3, t); out[1] = cubicAt(y0, y1, y2, y3, t); } // console.log(interval, i); return mathSqrt$2(d); } /** * 计算二次方贝塞尔值 * @param {number} p0 * @param {number} p1 * @param {number} p2 * @param {number} t * @return {number} */ function quadraticAt(p0, p1, p2, t) { var onet = 1 - t; return onet * (onet * p0 + 2 * t * p1) + t * t * p2; } /** * 计算二次方贝塞尔导数值 * @param {number} p0 * @param {number} p1 * @param {number} p2 * @param {number} t * @return {number} */ function quadraticDerivativeAt(p0, p1, p2, t) { return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); } /** * 计算二次方贝塞尔方程根 * @param {number} p0 * @param {number} p1 * @param {number} p2 * @param {number} t * @param {Array.} roots * @return {number} 有效根数目 */ function quadraticRootAt(p0, p1, p2, val, roots) { var a = p0 - 2 * p1 + p2; var b = 2 * (p1 - p0); var c = p0 - val; var n = 0; if (isAroundZero(a)) { if (isNotAroundZero$1(b)) { var t1 = -c / b; if (t1 >= 0 && t1 <= 1) { roots[n++] = t1; } } } else { var disc = b * b - 4 * a * c; if (isAroundZero(disc)) { var t1 = -b / (2 * a); if (t1 >= 0 && t1 <= 1) { roots[n++] = t1; } } else if (disc > 0) { var discSqrt = mathSqrt$2(disc); var t1 = (-b + discSqrt) / (2 * a); var t2 = (-b - discSqrt) / (2 * a); if (t1 >= 0 && t1 <= 1) { roots[n++] = t1; } if (t2 >= 0 && t2 <= 1) { roots[n++] = t2; } } } return n; } /** * 计算二次贝塞尔方程极限值 * @memberOf module:zrender/core/curve * @param {number} p0 * @param {number} p1 * @param {number} p2 * @return {number} */ function quadraticExtremum(p0, p1, p2) { var divider = p0 + p2 - 2 * p1; if (divider === 0) { // p1 is center of p0 and p2 return 0.5; } else { return (p0 - p1) / divider; } } /** * 细分二次贝塞尔曲线 * @memberOf module:zrender/core/curve * @param {number} p0 * @param {number} p1 * @param {number} p2 * @param {number} t * @param {Array.} out */ function quadraticSubdivide(p0, p1, p2, t, out) { var p01 = (p1 - p0) * t + p0; var p12 = (p2 - p1) * t + p1; var p012 = (p12 - p01) * t + p01; // Seg0 out[0] = p0; out[1] = p01; out[2] = p012; // Seg1 out[3] = p012; out[4] = p12; out[5] = p2; } /** * 投射点到二次贝塞尔曲线上,返回投射距离。 * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 * @param {number} x0 * @param {number} y0 * @param {number} x1 * @param {number} y1 * @param {number} x2 * @param {number} y2 * @param {number} x * @param {number} y * @param {Array.} out 投射点 * @return {number} */ function quadraticProjectPoint( x0, y0, x1, y1, x2, y2, x, y, out ) { // http://pomax.github.io/bezierinfo/#projections var t; var interval = 0.005; var d = Infinity; _v0[0] = x; _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值 // PENDING for (var _t = 0; _t < 1; _t += 0.05) { _v1[0] = quadraticAt(x0, x1, x2, _t); _v1[1] = quadraticAt(y0, y1, y2, _t); var d1 = distSquare(_v0, _v1); if (d1 < d) { t = _t; d = d1; } } d = Infinity; // At most 32 iteration for (var i = 0; i < 32; i++) { if (interval < EPSILON_NUMERIC) { break; } var prev = t - interval; var next = t + interval; // t - interval _v1[0] = quadraticAt(x0, x1, x2, prev); _v1[1] = quadraticAt(y0, y1, y2, prev); var d1 = distSquare(_v1, _v0); if (prev >= 0 && d1 < d) { t = prev; d = d1; } else { // t + interval _v2[0] = quadraticAt(x0, x1, x2, next); _v2[1] = quadraticAt(y0, y1, y2, next); var d2 = distSquare(_v2, _v0); if (next <= 1 && d2 < d) { t = next; d = d2; } else { interval *= 0.5; } } } // t if (out) { out[0] = quadraticAt(x0, x1, x2, t); out[1] = quadraticAt(y0, y1, y2, t); } // console.log(interval, i); return mathSqrt$2(d); } /** * @author Yi Shen(https://github.com/pissang) */ var mathMin$3 = Math.min; var mathMax$3 = Math.max; var mathSin$2 = Math.sin; var mathCos$2 = Math.cos; var PI2 = Math.PI * 2; var start = create(); var end = create(); var extremity = create(); /** * 从顶点数组中计算出最小包围盒,写入`min`和`max`中 * @module zrender/core/bbox * @param {Array} points 顶点数组 * @param {number} min * @param {number} max */ function fromPoints(points, min$$1, max$$1) { if (points.length === 0) { return; } var p = points[0]; var left = p[0]; var right = p[0]; var top = p[1]; var bottom = p[1]; var i; for (i = 1; i < points.length; i++) { p = points[i]; left = mathMin$3(left, p[0]); right = mathMax$3(right, p[0]); top = mathMin$3(top, p[1]); bottom = mathMax$3(bottom, p[1]); } min$$1[0] = left; min$$1[1] = top; max$$1[0] = right; max$$1[1] = bottom; } /** * @memberOf module:zrender/core/bbox * @param {number} x0 * @param {number} y0 * @param {number} x1 * @param {number} y1 * @param {Array.} min * @param {Array.} max */ function fromLine(x0, y0, x1, y1, min$$1, max$$1) { min$$1[0] = mathMin$3(x0, x1); min$$1[1] = mathMin$3(y0, y1); max$$1[0] = mathMax$3(x0, x1); max$$1[1] = mathMax$3(y0, y1); } var xDim = []; var yDim = []; /** * 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入`min`和`max`中 * @memberOf module:zrender/core/bbox * @param {number} x0 * @param {number} y0 * @param {number} x1 * @param {number} y1 * @param {number} x2 * @param {number} y2 * @param {number} x3 * @param {number} y3 * @param {Array.} min * @param {Array.} max */ function fromCubic( x0, y0, x1, y1, x2, y2, x3, y3, min$$1, max$$1 ) { var cubicExtrema$$1 = cubicExtrema; var cubicAt$$1 = cubicAt; var i; var n = cubicExtrema$$1(x0, x1, x2, x3, xDim); min$$1[0] = Infinity; min$$1[1] = Infinity; max$$1[0] = -Infinity; max$$1[1] = -Infinity; for (i = 0; i < n; i++) { var x = cubicAt$$1(x0, x1, x2, x3, xDim[i]); min$$1[0] = mathMin$3(x, min$$1[0]); max$$1[0] = mathMax$3(x, max$$1[0]); } n = cubicExtrema$$1(y0, y1, y2, y3, yDim); for (i = 0; i < n; i++) { var y = cubicAt$$1(y0, y1, y2, y3, yDim[i]); min$$1[1] = mathMin$3(y, min$$1[1]); max$$1[1] = mathMax$3(y, max$$1[1]); } min$$1[0] = mathMin$3(x0, min$$1[0]); max$$1[0] = mathMax$3(x0, max$$1[0]); min$$1[0] = mathMin$3(x3, min$$1[0]); max$$1[0] = mathMax$3(x3, max$$1[0]); min$$1[1] = mathMin$3(y0, min$$1[1]); max$$1[1] = mathMax$3(y0, max$$1[1]); min$$1[1] = mathMin$3(y3, min$$1[1]); max$$1[1] = mathMax$3(y3, max$$1[1]); } /** * 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入`min`和`max`中 * @memberOf module:zrender/core/bbox * @param {number} x0 * @param {number} y0 * @param {number} x1 * @param {number} y1 * @param {number} x2 * @param {number} y2 * @param {Array.} min * @param {Array.} max */ function fromQuadratic(x0, y0, x1, y1, x2, y2, min$$1, max$$1) { var quadraticExtremum$$1 = quadraticExtremum; var quadraticAt$$1 = quadraticAt; // Find extremities, where derivative in x dim or y dim is zero var tx = mathMax$3( mathMin$3(quadraticExtremum$$1(x0, x1, x2), 1), 0 ); var ty = mathMax$3( mathMin$3(quadraticExtremum$$1(y0, y1, y2), 1), 0 ); var x = quadraticAt$$1(x0, x1, x2, tx); var y = quadraticAt$$1(y0, y1, y2, ty); min$$1[0] = mathMin$3(x0, x2, x); min$$1[1] = mathMin$3(y0, y2, y); max$$1[0] = mathMax$3(x0, x2, x); max$$1[1] = mathMax$3(y0, y2, y); } /** * 从圆弧中计算出最小包围盒,写入`min`和`max`中 * @method * @memberOf module:zrender/core/bbox * @param {number} x * @param {number} y * @param {number} rx * @param {number} ry * @param {number} startAngle * @param {number} endAngle * @param {number} anticlockwise * @param {Array.} min * @param {Array.} max */ function fromArc( x, y, rx, ry, startAngle, endAngle, anticlockwise, min$$1, max$$1 ) { var vec2Min = min; var vec2Max = max; var diff = Math.abs(startAngle - endAngle); if (diff % PI2 < 1e-4 && diff > 1e-4) { // Is a circle min$$1[0] = x - rx; min$$1[1] = y - ry; max$$1[0] = x + rx; max$$1[1] = y + ry; return; } start[0] = mathCos$2(startAngle) * rx + x; start[1] = mathSin$2(startAngle) * ry + y; end[0] = mathCos$2(endAngle) * rx + x; end[1] = mathSin$2(endAngle) * ry + y; vec2Min(min$$1, start, end); vec2Max(max$$1, start, end); // Thresh to [0, Math.PI * 2] startAngle = startAngle % (PI2); if (startAngle < 0) { startAngle = startAngle + PI2; } endAngle = endAngle % (PI2); if (endAngle < 0) { endAngle = endAngle + PI2; } if (startAngle > endAngle && !anticlockwise) { endAngle += PI2; } else if (startAngle < endAngle && anticlockwise) { startAngle += PI2; } if (anticlockwise) { var tmp = endAngle; endAngle = startAngle; startAngle = tmp; } // var number = 0; // var step = (anticlockwise ? -Math.PI : Math.PI) / 2; for (var angle = 0; angle < endAngle; angle += Math.PI / 2) { if (angle > startAngle) { extremity[0] = mathCos$2(angle) * rx + x; extremity[1] = mathSin$2(angle) * ry + y; vec2Min(min$$1, extremity, min$$1); vec2Max(max$$1, extremity, max$$1); } } } /** * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中 * 可以用于 isInsidePath 判断以及获取boundingRect * * @module zrender/core/PathProxy * @author Yi Shen (http://www.github.com/pissang) */ // TODO getTotalLength, getPointAtLength var CMD = { M: 1, L: 2, C: 3, Q: 4, A: 5, Z: 6, // Rect R: 7 }; // var CMD_MEM_SIZE = { // M: 3, // L: 3, // C: 7, // Q: 5, // A: 9, // R: 5, // Z: 1 // }; var min$1 = []; var max$1 = []; var min2 = []; var max2 = []; var mathMin$2 = Math.min; var mathMax$2 = Math.max; var mathCos$1 = Math.cos; var mathSin$1 = Math.sin; var mathSqrt$1 = Math.sqrt; var mathAbs = Math.abs; var hasTypedArray = typeof Float32Array != 'undefined'; /** * @alias module:zrender/core/PathProxy * @constructor */ var PathProxy = function (notSaveData) { this._saveData = !(notSaveData || false); if (this._saveData) { /** * Path data. Stored as flat array * @type {Array.} */ this.data = []; } this._ctx = null; }; /** * 快速计算Path包围盒(并不是最小包围盒) * @return {Object} */ PathProxy.prototype = { constructor: PathProxy, _xi: 0, _yi: 0, _x0: 0, _y0: 0, // Unit x, Unit y. Provide for avoiding drawing that too short line segment _ux: 0, _uy: 0, _len: 0, _lineDash: null, _dashOffset: 0, _dashIdx: 0, _dashSum: 0, /** * @readOnly */ setScale: function (sx, sy) { this._ux = mathAbs(1 / devicePixelRatio / sx) || 0; this._uy = mathAbs(1 / devicePixelRatio / sy) || 0; }, getContext: function () { return this._ctx; }, /** * @param {CanvasRenderingContext2D} ctx * @return {module:zrender/core/PathProxy} */ beginPath: function (ctx) { this._ctx = ctx; ctx && ctx.beginPath(); ctx && (this.dpr = ctx.dpr); // Reset if (this._saveData) { this._len = 0; } if (this._lineDash) { this._lineDash = null; this._dashOffset = 0; } return this; }, /** * @param {number} x * @param {number} y * @return {module:zrender/core/PathProxy} */ moveTo: function (x, y) { this.addData(CMD.M, x, y); this._ctx && this._ctx.moveTo(x, y); // x0, y0, xi, yi 是记录在 _dashedXXXXTo 方法中使用 // xi, yi 记录当前点, x0, y0 在 closePath 的时候回到起始点。 // 有可能在 beginPath 之后直接调用 lineTo,这时候 x0, y0 需要 // 在 lineTo 方法中记录,这里先不考虑这种情况,dashed line 也只在 IE10- 中不支持 this._x0 = x; this._y0 = y; this._xi = x; this._yi = y; return this; }, /** * @param {number} x * @param {number} y * @return {module:zrender/core/PathProxy} */ lineTo: function (x, y) { var exceedUnit = mathAbs(x - this._xi) > this._ux || mathAbs(y - this._yi) > this._uy // Force draw the first segment || this._len < 5; this.addData(CMD.L, x, y); if (this._ctx && exceedUnit) { this._needsDash() ? this._dashedLineTo(x, y) : this._ctx.lineTo(x, y); } if (exceedUnit) { this._xi = x; this._yi = y; } return this; }, /** * @param {number} x1 * @param {number} y1 * @param {number} x2 * @param {number} y2 * @param {number} x3 * @param {number} y3 * @return {module:zrender/core/PathProxy} */ bezierCurveTo: function (x1, y1, x2, y2, x3, y3) { this.addData(CMD.C, x1, y1, x2, y2, x3, y3); if (this._ctx) { this._needsDash() ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3) : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); } this._xi = x3; this._yi = y3; return this; }, /** * @param {number} x1 * @param {number} y1 * @param {number} x2 * @param {number} y2 * @return {module:zrender/core/PathProxy} */ quadraticCurveTo: function (x1, y1, x2, y2) { this.addData(CMD.Q, x1, y1, x2, y2); if (this._ctx) { this._needsDash() ? this._dashedQuadraticTo(x1, y1, x2, y2) : this._ctx.quadraticCurveTo(x1, y1, x2, y2); } this._xi = x2; this._yi = y2; return this; }, /** * @param {number} cx * @param {number} cy * @param {number} r * @param {number} startAngle * @param {number} endAngle * @param {boolean} anticlockwise * @return {module:zrender/core/PathProxy} */ arc: function (cx, cy, r, startAngle, endAngle, anticlockwise) { this.addData( CMD.A, cx, cy, r, r, startAngle, endAngle - startAngle, 0, anticlockwise ? 0 : 1 ); this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); this._xi = mathCos$1(endAngle) * r + cx; this._yi = mathSin$1(endAngle) * r + cx; return this; }, // TODO arcTo: function (x1, y1, x2, y2, radius) { if (this._ctx) { this._ctx.arcTo(x1, y1, x2, y2, radius); } return this; }, // TODO rect: function (x, y, w, h) { this._ctx && this._ctx.rect(x, y, w, h); this.addData(CMD.R, x, y, w, h); return this; }, /** * @return {module:zrender/core/PathProxy} */ closePath: function () { this.addData(CMD.Z); var ctx = this._ctx; var x0 = this._x0; var y0 = this._y0; if (ctx) { this._needsDash() && this._dashedLineTo(x0, y0); ctx.closePath(); } this._xi = x0; this._yi = y0; return this; }, /** * Context 从外部传入,因为有可能是 rebuildPath 完之后再 fill。 * stroke 同样 * @param {CanvasRenderingContext2D} ctx * @return {module:zrender/core/PathProxy} */ fill: function (ctx) { ctx && ctx.fill(); this.toStatic(); }, /** * @param {CanvasRenderingContext2D} ctx * @return {module:zrender/core/PathProxy} */ stroke: function (ctx) { ctx && ctx.stroke(); this.toStatic(); }, /** * 必须在其它绘制命令前调用 * Must be invoked before all other path drawing methods * @return {module:zrender/core/PathProxy} */ setLineDash: function (lineDash) { if (lineDash instanceof Array) { this._lineDash = lineDash; this._dashIdx = 0; var lineDashSum = 0; for (var i = 0; i < lineDash.length; i++) { lineDashSum += lineDash[i]; } this._dashSum = lineDashSum; } return this; }, /** * 必须在其它绘制命令前调用 * Must be invoked before all other path drawing methods * @return {module:zrender/core/PathProxy} */ setLineDashOffset: function (offset) { this._dashOffset = offset; return this; }, /** * * @return {boolean} */ len: function () { return this._len; }, /** * 直接设置 Path 数据 */ setData: function (data) { var len$$1 = data.length; if (! (this.data && this.data.length == len$$1) && hasTypedArray) { this.data = new Float32Array(len$$1); } for (var i = 0; i < len$$1; i++) { this.data[i] = data[i]; } this._len = len$$1; }, /** * 添加子路径 * @param {module:zrender/core/PathProxy|Array.} path */ appendPath: function (path) { if (!(path instanceof Array)) { path = [path]; } var len$$1 = path.length; var appendSize = 0; var offset = this._len; for (var i = 0; i < len$$1; i++) { appendSize += path[i].len(); } if (hasTypedArray && (this.data instanceof Float32Array)) { this.data = new Float32Array(offset + appendSize); } for (var i = 0; i < len$$1; i++) { var appendPathData = path[i].data; for (var k = 0; k < appendPathData.length; k++) { this.data[offset++] = appendPathData[k]; } } this._len = offset; }, /** * 填充 Path 数据。 * 尽量复用而不申明新的数组。大部分图形重绘的指令数据长度都是不变的。 */ addData: function (cmd) { if (!this._saveData) { return; } var data = this.data; if (this._len + arguments.length > data.length) { // 因为之前的数组已经转换成静态的 Float32Array // 所以不够用时需要扩展一个新的动态数组 this._expandData(); data = this.data; } for (var i = 0; i < arguments.length; i++) { data[this._len++] = arguments[i]; } this._prevCmd = cmd; }, _expandData: function () { // Only if data is Float32Array if (!(this.data instanceof Array)) { var newData = []; for (var i = 0; i < this._len; i++) { newData[i] = this.data[i]; } this.data = newData; } }, /** * If needs js implemented dashed line * @return {boolean} * @private */ _needsDash: function () { return this._lineDash; }, _dashedLineTo: function (x1, y1) { var dashSum = this._dashSum; var offset = this._dashOffset; var lineDash = this._lineDash; var ctx = this._ctx; var x0 = this._xi; var y0 = this._yi; var dx = x1 - x0; var dy = y1 - y0; var dist$$1 = mathSqrt$1(dx * dx + dy * dy); var x = x0; var y = y0; var dash; var nDash = lineDash.length; var idx; dx /= dist$$1; dy /= dist$$1; if (offset < 0) { // Convert to positive offset offset = dashSum + offset; } offset %= dashSum; x -= offset * dx; y -= offset * dy; while ((dx > 0 && x <= x1) || (dx < 0 && x >= x1) || (dx == 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) { idx = this._dashIdx; dash = lineDash[idx]; x += dx * dash; y += dy * dash; this._dashIdx = (idx + 1) % nDash; // Skip positive offset if ((dx > 0 && x < x0) || (dx < 0 && x > x0) || (dy > 0 && y < y0) || (dy < 0 && y > y0)) { continue; } ctx[idx % 2 ? 'moveTo' : 'lineTo']( dx >= 0 ? mathMin$2(x, x1) : mathMax$2(x, x1), dy >= 0 ? mathMin$2(y, y1) : mathMax$2(y, y1) ); } // Offset for next lineTo dx = x - x1; dy = y - y1; this._dashOffset = -mathSqrt$1(dx * dx + dy * dy); }, // Not accurate dashed line to _dashedBezierTo: function (x1, y1, x2, y2, x3, y3) { var dashSum = this._dashSum; var offset = this._dashOffset; var lineDash = this._lineDash; var ctx = this._ctx; var x0 = this._xi; var y0 = this._yi; var t; var dx; var dy; var cubicAt$$1 = cubicAt; var bezierLen = 0; var idx = this._dashIdx; var nDash = lineDash.length; var x; var y; var tmpLen = 0; if (offset < 0) { // Convert to positive offset offset = dashSum + offset; } offset %= dashSum; // Bezier approx length for (t = 0; t < 1; t += 0.1) { dx = cubicAt$$1(x0, x1, x2, x3, t + 0.1) - cubicAt$$1(x0, x1, x2, x3, t); dy = cubicAt$$1(y0, y1, y2, y3, t + 0.1) - cubicAt$$1(y0, y1, y2, y3, t); bezierLen += mathSqrt$1(dx * dx + dy * dy); } // Find idx after add offset for (; idx < nDash; idx++) { tmpLen += lineDash[idx]; if (tmpLen > offset) { break; } } t = (tmpLen - offset) / bezierLen; while (t <= 1) { x = cubicAt$$1(x0, x1, x2, x3, t); y = cubicAt$$1(y0, y1, y2, y3, t); // Use line to approximate dashed bezier // Bad result if dash is long idx % 2 ? ctx.moveTo(x, y) : ctx.lineTo(x, y); t += lineDash[idx] / bezierLen; idx = (idx + 1) % nDash; } // Finish the last segment and calculate the new offset (idx % 2 !== 0) && ctx.lineTo(x3, y3); dx = x3 - x; dy = y3 - y; this._dashOffset = -mathSqrt$1(dx * dx + dy * dy); }, _dashedQuadraticTo: function (x1, y1, x2, y2) { // Convert quadratic to cubic using degree elevation var x3 = x2; var y3 = y2; x2 = (x2 + 2 * x1) / 3; y2 = (y2 + 2 * y1) / 3; x1 = (this._xi + 2 * x1) / 3; y1 = (this._yi + 2 * y1) / 3; this._dashedBezierTo(x1, y1, x2, y2, x3, y3); }, /** * 转成静态的 Float32Array 减少堆内存占用 * Convert dynamic array to static Float32Array */ toStatic: function () { var data = this.data; if (data instanceof Array) { data.length = this._len; if (hasTypedArray) { this.data = new Float32Array(data); } } }, /** * @return {module:zrender/core/BoundingRect} */ getBoundingRect: function () { min$1[0] = min$1[1] = min2[0] = min2[1] = Number.MAX_VALUE; max$1[0] = max$1[1] = max2[0] = max2[1] = -Number.MAX_VALUE; var data = this.data; var xi = 0; var yi = 0; var x0 = 0; var y0 = 0; for (var i = 0; i < data.length;) { var cmd = data[i++]; if (i == 1) { // 如果第一个命令是 L, C, Q // 则 previous point 同绘制命令的第一个 point // // 第一个命令为 Arc 的情况下会在后面特殊处理 xi = data[i]; yi = data[i + 1]; x0 = xi; y0 = yi; } switch (cmd) { case CMD.M: // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点 // 在 closePath 的时候使用 x0 = data[i++]; y0 = data[i++]; xi = x0; yi = y0; min2[0] = x0; min2[1] = y0; max2[0] = x0; max2[1] = y0; break; case CMD.L: fromLine(xi, yi, data[i], data[i + 1], min2, max2); xi = data[i++]; yi = data[i++]; break; case CMD.C: fromCubic( xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2 ); xi = data[i++]; yi = data[i++]; break; case CMD.Q: fromQuadratic( xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2 ); xi = data[i++]; yi = data[i++]; break; case CMD.A: // TODO Arc 判断的开销比较大 var cx = data[i++]; var cy = data[i++]; var rx = data[i++]; var ry = data[i++]; var startAngle = data[i++]; var endAngle = data[i++] + startAngle; // TODO Arc 旋转 var psi = data[i++]; var anticlockwise = 1 - data[i++]; if (i == 1) { // 直接使用 arc 命令 // 第一个命令起点还未定义 x0 = mathCos$1(startAngle) * rx + cx; y0 = mathSin$1(startAngle) * ry + cy; } fromArc( cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2 ); xi = mathCos$1(endAngle) * rx + cx; yi = mathSin$1(endAngle) * ry + cy; break; case CMD.R: x0 = xi = data[i++]; y0 = yi = data[i++]; var width = data[i++]; var height = data[i++]; // Use fromLine fromLine(x0, y0, x0 + width, y0 + height, min2, max2); break; case CMD.Z: xi = x0; yi = y0; break; } // Union min(min$1, min$1, min2); max(max$1, max$1, max2); } // No data if (i === 0) { min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0; } return new BoundingRect( min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1] ); }, /** * Rebuild path from current data * Rebuild path will not consider javascript implemented line dash. * @param {CanvasRenderingContext2D} ctx */ rebuildPath: function (ctx) { var d = this.data; var x0, y0; var xi, yi; var x, y; var ux = this._ux; var uy = this._uy; var len$$1 = this._len; for (var i = 0; i < len$$1;) { var cmd = d[i++]; if (i == 1) { // 如果第一个命令是 L, C, Q // 则 previous point 同绘制命令的第一个 point // // 第一个命令为 Arc 的情况下会在后面特殊处理 xi = d[i]; yi = d[i + 1]; x0 = xi; y0 = yi; } switch (cmd) { case CMD.M: x0 = xi = d[i++]; y0 = yi = d[i++]; ctx.moveTo(xi, yi); break; case CMD.L: x = d[i++]; y = d[i++]; // Not draw too small seg between if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len$$1 - 1) { ctx.lineTo(x, y); xi = x; yi = y; } break; case CMD.C: ctx.bezierCurveTo( d[i++], d[i++], d[i++], d[i++], d[i++], d[i++] ); xi = d[i - 2]; yi = d[i - 1]; break; case CMD.Q: ctx.quadraticCurveTo(d[i++], d[i++], d[i++], d[i++]); xi = d[i - 2]; yi = d[i - 1]; break; case CMD.A: var cx = d[i++]; var cy = d[i++]; var rx = d[i++]; var ry = d[i++]; var theta = d[i++]; var dTheta = d[i++]; var psi = d[i++]; var fs = d[i++]; var r = (rx > ry) ? rx : ry; var scaleX = (rx > ry) ? 1 : rx / ry; var scaleY = (rx > ry) ? ry / rx : 1; var isEllipse = Math.abs(rx - ry) > 1e-3; var endAngle = theta + dTheta; if (isEllipse) { ctx.translate(cx, cy); ctx.rotate(psi); ctx.scale(scaleX, scaleY); ctx.arc(0, 0, r, theta, endAngle, 1 - fs); ctx.scale(1 / scaleX, 1 / scaleY); ctx.rotate(-psi); ctx.translate(-cx, -cy); } else { ctx.arc(cx, cy, r, theta, endAngle, 1 - fs); } if (i == 1) { // 直接使用 arc 命令 // 第一个命令起点还未定义 x0 = mathCos$1(theta) * rx + cx; y0 = mathSin$1(theta) * ry + cy; } xi = mathCos$1(endAngle) * rx + cx; yi = mathSin$1(endAngle) * ry + cy; break; case CMD.R: x0 = xi = d[i]; y0 = yi = d[i + 1]; ctx.rect(d[i++], d[i++], d[i++], d[i++]); break; case CMD.Z: ctx.closePath(); xi = x0; yi = y0; } } } }; PathProxy.CMD = CMD; /** * 线段包含判断 * @param {number} x0 * @param {number} y0 * @param {number} x1 * @param {number} y1 * @param {number} lineWidth * @param {number} x * @param {number} y * @return {boolean} */ function containStroke$1(x0, y0, x1, y1, lineWidth, x, y) { if (lineWidth === 0) { return false; } var _l = lineWidth; var _a = 0; var _b = x0; // Quick reject if ( (y > y0 + _l && y > y1 + _l) || (y < y0 - _l && y < y1 - _l) || (x > x0 + _l && x > x1 + _l) || (x < x0 - _l && x < x1 - _l) ) { return false; } if (x0 !== x1) { _a = (y0 - y1) / (x0 - x1); _b = (x0 * y1 - x1 * y0) / (x0 - x1) ; } else { return Math.abs(x - x0) <= _l / 2; } var tmp = _a * x - y + _b; var _s = tmp * tmp / (_a * _a + 1); return _s <= _l / 2 * _l / 2; } /** * 三次贝塞尔曲线描边包含判断 * @param {number} x0 * @param {number} y0 * @param {number} x1 * @param {number} y1 * @param {number} x2 * @param {number} y2 * @param {number} x3 * @param {number} y3 * @param {number} lineWidth * @param {number} x * @param {number} y * @return {boolean} */ function containStroke$2(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) { if (lineWidth === 0) { return false; } var _l = lineWidth; // Quick reject if ( (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l) || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l) || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l) || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) ) { return false; } var d = cubicProjectPoint( x0, y0, x1, y1, x2, y2, x3, y3, x, y, null ); return d <= _l / 2; } /** * 二次贝塞尔曲线描边包含判断 * @param {number} x0 * @param {number} y0 * @param {number} x1 * @param {number} y1 * @param {number} x2 * @param {number} y2 * @param {number} lineWidth * @param {number} x * @param {number} y * @return {boolean} */ function containStroke$3(x0, y0, x1, y1, x2, y2, lineWidth, x, y) { if (lineWidth === 0) { return false; } var _l = lineWidth; // Quick reject if ( (y > y0 + _l && y > y1 + _l && y > y2 + _l) || (y < y0 - _l && y < y1 - _l && y < y2 - _l) || (x > x0 + _l && x > x1 + _l && x > x2 + _l) || (x < x0 - _l && x < x1 - _l && x < x2 - _l) ) { return false; } var d = quadraticProjectPoint( x0, y0, x1, y1, x2, y2, x, y, null ); return d <= _l / 2; } var PI2$3 = Math.PI * 2; function normalizeRadian(angle) { angle %= PI2$3; if (angle < 0) { angle += PI2$3; } return angle; } var PI2$2 = Math.PI * 2; /** * 圆弧描边包含判断 * @param {number} cx * @param {number} cy * @param {number} r * @param {number} startAngle * @param {number} endAngle * @param {boolean} anticlockwise * @param {number} lineWidth * @param {number} x * @param {number} y * @return {Boolean} */ function containStroke$4( cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y ) { if (lineWidth === 0) { return false; } var _l = lineWidth; x -= cx; y -= cy; var d = Math.sqrt(x * x + y * y); if ((d - _l > r) || (d + _l < r)) { return false; } if (Math.abs(startAngle - endAngle) % PI2$2 < 1e-4) { // Is a circle return true; } if (anticlockwise) { var tmp = startAngle; startAngle = normalizeRadian(endAngle); endAngle = normalizeRadian(tmp); } else { startAngle = normalizeRadian(startAngle); endAngle = normalizeRadian(endAngle); } if (startAngle > endAngle) { endAngle += PI2$2; } var angle = Math.atan2(y, x); if (angle < 0) { angle += PI2$2; } return (angle >= startAngle && angle <= endAngle) || (angle + PI2$2 >= startAngle && angle + PI2$2 <= endAngle); } function windingLine(x0, y0, x1, y1, x, y) { if ((y > y0 && y > y1) || (y < y0 && y < y1)) { return 0; } // Ignore horizontal line if (y1 === y0) { return 0; } var dir = y1 < y0 ? 1 : -1; var t = (y - y0) / (y1 - y0); // Avoid winding error when intersection point is the connect point of two line of polygon if (t === 1 || t === 0) { dir = y1 < y0 ? 0.5 : -0.5; } var x_ = t * (x1 - x0) + x0; // If (x, y) on the line, considered as "contain". return x_ === x ? Infinity : x_ > x ? dir : 0; } var CMD$1 = PathProxy.CMD; var PI2$1 = Math.PI * 2; var EPSILON$2 = 1e-4; function isAroundEqual(a, b) { return Math.abs(a - b) < EPSILON$2; } // 临时数组 var roots = [-1, -1, -1]; var extrema = [-1, -1]; function swapExtrema() { var tmp = extrema[0]; extrema[0] = extrema[1]; extrema[1] = tmp; } function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { // Quick reject if ( (y > y0 && y > y1 && y > y2 && y > y3) || (y < y0 && y < y1 && y < y2 && y < y3) ) { return 0; } var nRoots = cubicRootAt(y0, y1, y2, y3, y, roots); if (nRoots === 0) { return 0; } else { var w = 0; var nExtrema = -1; var y0_, y1_; for (var i = 0; i < nRoots; i++) { var t = roots[i]; // Avoid winding error when intersection point is the connect point of two line of polygon var unit = (t === 0 || t === 1) ? 0.5 : 1; var x_ = cubicAt(x0, x1, x2, x3, t); if (x_ < x) { // Quick reject continue; } if (nExtrema < 0) { nExtrema = cubicExtrema(y0, y1, y2, y3, extrema); if (extrema[1] < extrema[0] && nExtrema > 1) { swapExtrema(); } y0_ = cubicAt(y0, y1, y2, y3, extrema[0]); if (nExtrema > 1) { y1_ = cubicAt(y0, y1, y2, y3, extrema[1]); } } if (nExtrema == 2) { // 分成三段单调函数 if (t < extrema[0]) { w += y0_ < y0 ? unit : -unit; } else if (t < extrema[1]) { w += y1_ < y0_ ? unit : -unit; } else { w += y3 < y1_ ? unit : -unit; } } else { // 分成两段单调函数 if (t < extrema[0]) { w += y0_ < y0 ? unit : -unit; } else { w += y3 < y0_ ? unit : -unit; } } } return w; } } function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) { // Quick reject if ( (y > y0 && y > y1 && y > y2) || (y < y0 && y < y1 && y < y2) ) { return 0; } var nRoots = quadraticRootAt(y0, y1, y2, y, roots); if (nRoots === 0) { return 0; } else { var t = quadraticExtremum(y0, y1, y2); if (t >= 0 && t <= 1) { var w = 0; var y_ = quadraticAt(y0, y1, y2, t); for (var i = 0; i < nRoots; i++) { // Remove one endpoint. var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1; var x_ = quadraticAt(x0, x1, x2, roots[i]); if (x_ < x) { // Quick reject continue; } if (roots[i] < t) { w += y_ < y0 ? unit : -unit; } else { w += y2 < y_ ? unit : -unit; } } return w; } else { // Remove one endpoint. var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1; var x_ = quadraticAt(x0, x1, x2, roots[0]); if (x_ < x) { // Quick reject return 0; } return y2 < y0 ? unit : -unit; } } } // TODO // Arc 旋转 function windingArc( cx, cy, r, startAngle, endAngle, anticlockwise, x, y ) { y -= cy; if (y > r || y < -r) { return 0; } var tmp = Math.sqrt(r * r - y * y); roots[0] = -tmp; roots[1] = tmp; var diff = Math.abs(startAngle - endAngle); if (diff < 1e-4) { return 0; } if (diff % PI2$1 < 1e-4) { // Is a circle startAngle = 0; endAngle = PI2$1; var dir = anticlockwise ? 1 : -1; if (x >= roots[0] + cx && x <= roots[1] + cx) { return dir; } else { return 0; } } if (anticlockwise) { var tmp = startAngle; startAngle = normalizeRadian(endAngle); endAngle = normalizeRadian(tmp); } else { startAngle = normalizeRadian(startAngle); endAngle = normalizeRadian(endAngle); } if (startAngle > endAngle) { endAngle += PI2$1; } var w = 0; for (var i = 0; i < 2; i++) { var x_ = roots[i]; if (x_ + cx > x) { var angle = Math.atan2(y, x_); var dir = anticlockwise ? 1 : -1; if (angle < 0) { angle = PI2$1 + angle; } if ( (angle >= startAngle && angle <= endAngle) || (angle + PI2$1 >= startAngle && angle + PI2$1 <= endAngle) ) { if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { dir = -dir; } w += dir; } } } return w; } function containPath(data, lineWidth, isStroke, x, y) { var w = 0; var xi = 0; var yi = 0; var x0 = 0; var y0 = 0; for (var i = 0; i < data.length;) { var cmd = data[i++]; // Begin a new subpath if (cmd === CMD$1.M && i > 1) { // Close previous subpath if (!isStroke) { w += windingLine(xi, yi, x0, y0, x, y); } // 如果被任何一个 subpath 包含 // if (w !== 0) { // return true; // } } if (i == 1) { // 如果第一个命令是 L, C, Q // 则 previous point 同绘制命令的第一个 point // // 第一个命令为 Arc 的情况下会在后面特殊处理 xi = data[i]; yi = data[i + 1]; x0 = xi; y0 = yi; } switch (cmd) { case CMD$1.M: // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点 // 在 closePath 的时候使用 x0 = data[i++]; y0 = data[i++]; xi = x0; yi = y0; break; case CMD$1.L: if (isStroke) { if (containStroke$1(xi, yi, data[i], data[i + 1], lineWidth, x, y)) { return true; } } else { // NOTE 在第一个命令为 L, C, Q 的时候会计算出 NaN w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0; } xi = data[i++]; yi = data[i++]; break; case CMD$1.C: if (isStroke) { if (containStroke$2(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y )) { return true; } } else { w += windingCubic( xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y ) || 0; } xi = data[i++]; yi = data[i++]; break; case CMD$1.Q: if (isStroke) { if (containStroke$3(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y )) { return true; } } else { w += windingQuadratic( xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y ) || 0; } xi = data[i++]; yi = data[i++]; break; case CMD$1.A: // TODO Arc 判断的开销比较大 var cx = data[i++]; var cy = data[i++]; var rx = data[i++]; var ry = data[i++]; var theta = data[i++]; var dTheta = data[i++]; // TODO Arc 旋转 var psi = data[i++]; var anticlockwise = 1 - data[i++]; var x1 = Math.cos(theta) * rx + cx; var y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令 if (i > 1) { w += windingLine(xi, yi, x1, y1, x, y); } else { // 第一个命令起点还未定义 x0 = x1; y0 = y1; } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放 var _x = (x - cx) * ry / rx + cx; if (isStroke) { if (containStroke$4( cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y )) { return true; } } else { w += windingArc( cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y ); } xi = Math.cos(theta + dTheta) * rx + cx; yi = Math.sin(theta + dTheta) * ry + cy; break; case CMD$1.R: x0 = xi = data[i++]; y0 = yi = data[i++]; var width = data[i++]; var height = data[i++]; var x1 = x0 + width; var y1 = y0 + height; if (isStroke) { if (containStroke$1(x0, y0, x1, y0, lineWidth, x, y) || containStroke$1(x1, y0, x1, y1, lineWidth, x, y) || containStroke$1(x1, y1, x0, y1, lineWidth, x, y) || containStroke$1(x0, y1, x0, y0, lineWidth, x, y) ) { return true; } } else { // FIXME Clockwise ? w += windingLine(x1, y0, x1, y1, x, y); w += windingLine(x0, y1, x0, y0, x, y); } break; case CMD$1.Z: if (isStroke) { if (containStroke$1( xi, yi, x0, y0, lineWidth, x, y )) { return true; } } else { // Close a subpath w += windingLine(xi, yi, x0, y0, x, y); // 如果被任何一个 subpath 包含 // FIXME subpaths may overlap // if (w !== 0) { // return true; // } } xi = x0; yi = y0; break; } } if (!isStroke && !isAroundEqual(yi, y0)) { w += windingLine(xi, yi, x0, y0, x, y) || 0; } return w !== 0; } function contain(pathData, x, y) { return containPath(pathData, 0, false, x, y); } function containStroke(pathData, lineWidth, x, y) { return containPath(pathData, lineWidth, true, x, y); } var getCanvasPattern = Pattern.prototype.getCanvasPattern; var abs = Math.abs; var pathProxyForDraw = new PathProxy(true); /** * @alias module:zrender/graphic/Path * @extends module:zrender/graphic/Displayable * @constructor * @param {Object} opts */ function Path(opts) { Displayable.call(this, opts); /** * @type {module:zrender/core/PathProxy} * @readOnly */ this.path = null; } Path.prototype = { constructor: Path, type: 'path', __dirtyPath: true, strokeContainThreshold: 5, brush: function (ctx, prevEl) { var style = this.style; var path = this.path || pathProxyForDraw; var hasStroke = style.hasStroke(); var hasFill = style.hasFill(); var fill = style.fill; var stroke = style.stroke; var hasFillGradient = hasFill && !!(fill.colorStops); var hasStrokeGradient = hasStroke && !!(stroke.colorStops); var hasFillPattern = hasFill && !!(fill.image); var hasStrokePattern = hasStroke && !!(stroke.image); style.bind(ctx, this, prevEl); this.setTransform(ctx); if (this.__dirty) { var rect; // Update gradient because bounding rect may changed if (hasFillGradient) { rect = rect || this.getBoundingRect(); this._fillGradient = style.getGradient(ctx, fill, rect); } if (hasStrokeGradient) { rect = rect || this.getBoundingRect(); this._strokeGradient = style.getGradient(ctx, stroke, rect); } } // Use the gradient or pattern if (hasFillGradient) { // PENDING If may have affect the state ctx.fillStyle = this._fillGradient; } else if (hasFillPattern) { ctx.fillStyle = getCanvasPattern.call(fill, ctx); } if (hasStrokeGradient) { ctx.strokeStyle = this._strokeGradient; } else if (hasStrokePattern) { ctx.strokeStyle = getCanvasPattern.call(stroke, ctx); } var lineDash = style.lineDash; var lineDashOffset = style.lineDashOffset; var ctxLineDash = !!ctx.setLineDash; // Update path sx, sy var scale = this.getGlobalScale(); path.setScale(scale[0], scale[1]); // Proxy context // Rebuild path in following 2 cases // 1. Path is dirty // 2. Path needs javascript implemented lineDash stroking. // In this case, lineDash information will not be saved in PathProxy if (this.__dirtyPath || (lineDash && !ctxLineDash && hasStroke) ) { path.beginPath(ctx); // Setting line dash before build path if (lineDash && !ctxLineDash) { path.setLineDash(lineDash); path.setLineDashOffset(lineDashOffset); } this.buildPath(path, this.shape, false); // Clear path dirty flag if (this.path) { this.__dirtyPath = false; } } else { // Replay path building ctx.beginPath(); this.path.rebuildPath(ctx); } hasFill && path.fill(ctx); if (lineDash && ctxLineDash) { ctx.setLineDash(lineDash); ctx.lineDashOffset = lineDashOffset; } hasStroke && path.stroke(ctx); if (lineDash && ctxLineDash) { // PENDING // Remove lineDash ctx.setLineDash([]); } // Draw rect text if (style.text != null) { // Only restore transform when needs draw text. this.restoreTransform(ctx); this.drawRectText(ctx, this.getBoundingRect()); } }, // When bundling path, some shape may decide if use moveTo to begin a new subpath or closePath // Like in circle buildPath: function (ctx, shapeCfg, inBundle) {}, createPathProxy: function () { this.path = new PathProxy(); }, getBoundingRect: function () { var rect = this._rect; var style = this.style; var needsUpdateRect = !rect; if (needsUpdateRect) { var path = this.path; if (!path) { // Create path on demand. path = this.path = new PathProxy(); } if (this.__dirtyPath) { path.beginPath(); this.buildPath(path, this.shape, false); } rect = path.getBoundingRect(); } this._rect = rect; if (style.hasStroke()) { // Needs update rect with stroke lineWidth when // 1. Element changes scale or lineWidth // 2. Shape is changed var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone()); if (this.__dirty || needsUpdateRect) { rectWithStroke.copy(rect); // FIXME Must after updateTransform var w = style.lineWidth; // PENDING, Min line width is needed when line is horizontal or vertical var lineScale = style.strokeNoScale ? this.getLineScale() : 1; // Only add extra hover lineWidth when there are no fill if (!style.hasFill()) { w = Math.max(w, this.strokeContainThreshold || 4); } // Consider line width // Line scale can't be 0; if (lineScale > 1e-10) { rectWithStroke.width += w / lineScale; rectWithStroke.height += w / lineScale; rectWithStroke.x -= w / lineScale / 2; rectWithStroke.y -= w / lineScale / 2; } } // Return rect with stroke return rectWithStroke; } return rect; }, contain: function (x, y) { var localPos = this.transformCoordToLocal(x, y); var rect = this.getBoundingRect(); var style = this.style; x = localPos[0]; y = localPos[1]; if (rect.contain(x, y)) { var pathData = this.path.data; if (style.hasStroke()) { var lineWidth = style.lineWidth; var lineScale = style.strokeNoScale ? this.getLineScale() : 1; // Line scale can't be 0; if (lineScale > 1e-10) { // Only add extra hover lineWidth when there are no fill if (!style.hasFill()) { lineWidth = Math.max(lineWidth, this.strokeContainThreshold); } if (containStroke( pathData, lineWidth / lineScale, x, y )) { return true; } } } if (style.hasFill()) { return contain(pathData, x, y); } } return false; }, /** * @param {boolean} dirtyPath */ dirty: function (dirtyPath) { if (dirtyPath == null) { dirtyPath = true; } // Only mark dirty, not mark clean if (dirtyPath) { this.__dirtyPath = dirtyPath; this._rect = null; } this.__dirty = true; this.__zr && this.__zr.refresh(); // Used as a clipping path if (this.__clipTarget) { this.__clipTarget.dirty(); } }, /** * Alias for animate('shape') * @param {boolean} loop */ animateShape: function (loop) { return this.animate('shape', loop); }, // Overwrite attrKV attrKV: function (key, value) { // FIXME if (key === 'shape') { this.setShape(value); this.__dirtyPath = true; this._rect = null; } else { Displayable.prototype.attrKV.call(this, key, value); } }, /** * @param {Object|string} key * @param {*} value */ setShape: function (key, value) { var shape = this.shape; // Path from string may not have shape if (shape) { if (isObject$1(key)) { for (var name in key) { if (key.hasOwnProperty(name)) { shape[name] = key[name]; } } } else { shape[key] = value; } this.dirty(true); } return this; }, getLineScale: function () { var m = this.transform; // Get the line scale. // Determinant of `m` means how much the area is enlarged by the // transformation. So its square root can be used as a scale factor // for width. return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10 ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1])) : 1; } }; /** * 扩展一个 Path element, 比如星形,圆等。 * Extend a path element * @param {Object} props * @param {string} props.type Path type * @param {Function} props.init Initialize * @param {Function} props.buildPath Overwrite buildPath method * @param {Object} [props.style] Extended default style config * @param {Object} [props.shape] Extended default shape config */ Path.extend = function (defaults$$1) { var Sub = function (opts) { Path.call(this, opts); if (defaults$$1.style) { // Extend default style this.style.extendFrom(defaults$$1.style, false); } // Extend default shape var defaultShape = defaults$$1.shape; if (defaultShape) { this.shape = this.shape || {}; var thisShape = this.shape; for (var name in defaultShape) { if ( ! thisShape.hasOwnProperty(name) && defaultShape.hasOwnProperty(name) ) { thisShape[name] = defaultShape[name]; } } } defaults$$1.init && defaults$$1.init.call(this, opts); }; inherits(Sub, Path); // FIXME 不能 extend position, rotation 等引用对象 for (var name in defaults$$1) { // Extending prototype values and methods if (name !== 'style' && name !== 'shape') { Sub.prototype[name] = defaults$$1[name]; } } return Sub; }; inherits(Path, Displayable); var CMD$2 = PathProxy.CMD; var points = [[], [], []]; var mathSqrt$3 = Math.sqrt; var mathAtan2 = Math.atan2; var transformPath = function (path, m) { var data = path.data; var cmd; var nPoint; var i; var j; var k; var p; var M = CMD$2.M; var C = CMD$2.C; var L = CMD$2.L; var R = CMD$2.R; var A = CMD$2.A; var Q = CMD$2.Q; for (i = 0, j = 0; i < data.length;) { cmd = data[i++]; j = i; nPoint = 0; switch (cmd) { case M: nPoint = 1; break; case L: nPoint = 1; break; case C: nPoint = 3; break; case Q: nPoint = 2; break; case A: var x = m[4]; var y = m[5]; var sx = mathSqrt$3(m[0] * m[0] + m[1] * m[1]); var sy = mathSqrt$3(m[2] * m[2] + m[3] * m[3]); var angle = mathAtan2(-m[1] / sy, m[0] / sx); // cx data[i] *= sx; data[i++] += x; // cy data[i] *= sy; data[i++] += y; // Scale rx and ry // FIXME Assume psi is 0 here data[i++] *= sx; data[i++] *= sy; // Start angle data[i++] += angle; // end angle data[i++] += angle; // FIXME psi i += 2; j = i; break; case R: // x0, y0 p[0] = data[i++]; p[1] = data[i++]; applyTransform(p, p, m); data[j++] = p[0]; data[j++] = p[1]; // x1, y1 p[0] += data[i++]; p[1] += data[i++]; applyTransform(p, p, m); data[j++] = p[0]; data[j++] = p[1]; } for (k = 0; k < nPoint; k++) { var p = points[k]; p[0] = data[i++]; p[1] = data[i++]; applyTransform(p, p, m); // Write back data[j++] = p[0]; data[j++] = p[1]; } } }; // command chars var cc = [ 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' ]; var mathSqrt = Math.sqrt; var mathSin = Math.sin; var mathCos = Math.cos; var PI = Math.PI; var vMag = function(v) { return Math.sqrt(v[0] * v[0] + v[1] * v[1]); }; var vRatio = function(u, v) { return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); }; var vAngle = function(u, v) { return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v)); }; function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) { var psi = psiDeg * (PI / 180.0); var xp = mathCos(psi) * (x1 - x2) / 2.0 + mathSin(psi) * (y1 - y2) / 2.0; var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0 + mathCos(psi) * (y1 - y2) / 2.0; var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry); if (lambda > 1) { rx *= mathSqrt(lambda); ry *= mathSqrt(lambda); } var f = (fa === fs ? -1 : 1) * mathSqrt((((rx * rx) * (ry * ry)) - ((rx * rx) * (yp * yp)) - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp) + (ry * ry) * (xp * xp)) ) || 0; var cxp = f * rx * yp / ry; var cyp = f * -ry * xp / rx; var cx = (x1 + x2) / 2.0 + mathCos(psi) * cxp - mathSin(psi) * cyp; var cy = (y1 + y2) / 2.0 + mathSin(psi) * cxp + mathCos(psi) * cyp; var theta = vAngle([ 1, 0 ], [ (xp - cxp) / rx, (yp - cyp) / ry ]); var u = [ (xp - cxp) / rx, (yp - cyp) / ry ]; var v = [ (-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry ]; var dTheta = vAngle(u, v); if (vRatio(u, v) <= -1) { dTheta = PI; } if (vRatio(u, v) >= 1) { dTheta = 0; } if (fs === 0 && dTheta > 0) { dTheta = dTheta - 2 * PI; } if (fs === 1 && dTheta < 0) { dTheta = dTheta + 2 * PI; } path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs); } function createPathProxyFromString(data) { if (!data) { return []; } // command string var cs = data.replace(/-/g, ' -') .replace(/ /g, ' ') .replace(/ /g, ',') .replace(/,,/g, ','); var n; // create pipes so that we can split the data for (n = 0; n < cc.length; n++) { cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); } // create array var arr = cs.split('|'); // init context point var cpx = 0; var cpy = 0; var path = new PathProxy(); var CMD = PathProxy.CMD; var prevCmd; for (n = 1; n < arr.length; n++) { var str = arr[n]; var c = str.charAt(0); var off = 0; var p = str.slice(1).replace(/e,-/g, 'e-').split(','); var cmd; if (p.length > 0 && p[0] === '') { p.shift(); } for (var i = 0; i < p.length; i++) { p[i] = parseFloat(p[i]); } while (off < p.length && !isNaN(p[off])) { if (isNaN(p[0])) { break; } var ctlPtx; var ctlPty; var rx; var ry; var psi; var fa; var fs; var x1 = cpx; var y1 = cpy; // convert l, H, h, V, and v to L switch (c) { case 'l': cpx += p[off++]; cpy += p[off++]; cmd = CMD.L; path.addData(cmd, cpx, cpy); break; case 'L': cpx = p[off++]; cpy = p[off++]; cmd = CMD.L; path.addData(cmd, cpx, cpy); break; case 'm': cpx += p[off++]; cpy += p[off++]; cmd = CMD.M; path.addData(cmd, cpx, cpy); c = 'l'; break; case 'M': cpx = p[off++]; cpy = p[off++]; cmd = CMD.M; path.addData(cmd, cpx, cpy); c = 'L'; break; case 'h': cpx += p[off++]; cmd = CMD.L; path.addData(cmd, cpx, cpy); break; case 'H': cpx = p[off++]; cmd = CMD.L; path.addData(cmd, cpx, cpy); break; case 'v': cpy += p[off++]; cmd = CMD.L; path.addData(cmd, cpx, cpy); break; case 'V': cpy = p[off++]; cmd = CMD.L; path.addData(cmd, cpx, cpy); break; case 'C': cmd = CMD.C; path.addData( cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++] ); cpx = p[off - 2]; cpy = p[off - 1]; break; case 'c': cmd = CMD.C; path.addData( cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy ); cpx += p[off - 2]; cpy += p[off - 1]; break; case 'S': ctlPtx = cpx; ctlPty = cpy; var len = path.len(); var pathData = path.data; if (prevCmd === CMD.C) { ctlPtx += cpx - pathData[len - 4]; ctlPty += cpy - pathData[len - 3]; } cmd = CMD.C; x1 = p[off++]; y1 = p[off++]; cpx = p[off++]; cpy = p[off++]; path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy); break; case 's': ctlPtx = cpx; ctlPty = cpy; var len = path.len(); var pathData = path.data; if (prevCmd === CMD.C) { ctlPtx += cpx - pathData[len - 4]; ctlPty += cpy - pathData[len - 3]; } cmd = CMD.C; x1 = cpx + p[off++]; y1 = cpy + p[off++]; cpx += p[off++]; cpy += p[off++]; path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy); break; case 'Q': x1 = p[off++]; y1 = p[off++]; cpx = p[off++]; cpy = p[off++]; cmd = CMD.Q; path.addData(cmd, x1, y1, cpx, cpy); break; case 'q': x1 = p[off++] + cpx; y1 = p[off++] + cpy; cpx += p[off++]; cpy += p[off++]; cmd = CMD.Q; path.addData(cmd, x1, y1, cpx, cpy); break; case 'T': ctlPtx = cpx; ctlPty = cpy; var len = path.len(); var pathData = path.data; if (prevCmd === CMD.Q) { ctlPtx += cpx - pathData[len - 4]; ctlPty += cpy - pathData[len - 3]; } cpx = p[off++]; cpy = p[off++]; cmd = CMD.Q; path.addData(cmd, ctlPtx, ctlPty, cpx, cpy); break; case 't': ctlPtx = cpx; ctlPty = cpy; var len = path.len(); var pathData = path.data; if (prevCmd === CMD.Q) { ctlPtx += cpx - pathData[len - 4]; ctlPty += cpy - pathData[len - 3]; } cpx += p[off++]; cpy += p[off++]; cmd = CMD.Q; path.addData(cmd, ctlPtx, ctlPty, cpx, cpy); break; case 'A': rx = p[off++]; ry = p[off++]; psi = p[off++]; fa = p[off++]; fs = p[off++]; x1 = cpx, y1 = cpy; cpx = p[off++]; cpy = p[off++]; cmd = CMD.A; processArc( x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path ); break; case 'a': rx = p[off++]; ry = p[off++]; psi = p[off++]; fa = p[off++]; fs = p[off++]; x1 = cpx, y1 = cpy; cpx += p[off++]; cpy += p[off++]; cmd = CMD.A; processArc( x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path ); break; } } if (c === 'z' || c === 'Z') { cmd = CMD.Z; path.addData(cmd); } prevCmd = cmd; } path.toStatic(); return path; } // TODO Optimize double memory cost problem function createPathOptions(str, opts) { var pathProxy = createPathProxyFromString(str); opts = opts || {}; opts.buildPath = function (path) { if (path.setData) { path.setData(pathProxy.data); // Svg and vml renderer don't have context var ctx = path.getContext(); if (ctx) { path.rebuildPath(ctx); } } else { var ctx = path; pathProxy.rebuildPath(ctx); } }; opts.applyTransform = function (m) { transformPath(pathProxy, m); this.dirty(true); }; return opts; } /** * Create a Path object from path string data * http://www.w3.org/TR/SVG/paths.html#PathData * @param {Object} opts Other options */ function createFromString(str, opts) { return new Path(createPathOptions(str, opts)); } /** * Create a Path class from path string data * @param {string} str * @param {Object} opts Other options */ function extendFromString(str, opts) { return Path.extend(createPathOptions(str, opts)); } /** * Merge multiple paths */ // TODO Apply transform // TODO stroke dash // TODO Optimize double memory cost problem function mergePath$1(pathEls, opts) { var pathList = []; var len = pathEls.length; for (var i = 0; i < len; i++) { var pathEl = pathEls[i]; if (!pathEl.path) { pathEl.createPathProxy(); } if (pathEl.__dirtyPath) { pathEl.buildPath(pathEl.path, pathEl.shape, true); } pathList.push(pathEl.path); } var pathBundle = new Path(opts); // Need path proxy. pathBundle.createPathProxy(); pathBundle.buildPath = function (path) { path.appendPath(pathList); // Svg and vml renderer don't have context var ctx = path.getContext(); if (ctx) { path.rebuildPath(ctx); } }; return pathBundle; } /** * @alias zrender/graphic/Text * @extends module:zrender/graphic/Displayable * @constructor * @param {Object} opts */ var Text = function (opts) { // jshint ignore:line Displayable.call(this, opts); }; Text.prototype = { constructor: Text, type: 'text', brush: function (ctx, prevEl) { var style = this.style; // Optimize, avoid normalize every time. this.__dirty && normalizeTextStyle(style, true); // Use props with prefix 'text'. style.fill = style.stroke = style.shadowBlur = style.shadowColor = style.shadowOffsetX = style.shadowOffsetY = null; var text = style.text; // Convert to string text != null && (text += ''); // Always bind style style.bind(ctx, this, prevEl); if (!needDrawText(text, style)) { return; } this.setTransform(ctx); renderText(this, ctx, text, style); this.restoreTransform(ctx); }, getBoundingRect: function () { var style = this.style; // Optimize, avoid normalize every time. this.__dirty && normalizeTextStyle(style, true); if (!this._rect) { var text = style.text; text != null ? (text += '') : (text = ''); var rect = getBoundingRect( style.text + '', style.font, style.textAlign, style.textVerticalAlign, style.textPadding, style.rich ); rect.x += style.x || 0; rect.y += style.y || 0; if (getStroke(style.textStroke, style.textStrokeWidth)) { var w = style.textStrokeWidth; rect.x -= w / 2; rect.y -= w / 2; rect.width += w; rect.height += w; } this._rect = rect; } return this._rect; } }; inherits(Text, Displayable); /** * 圆形 * @module zrender/shape/Circle */ var Circle = Path.extend({ type: 'circle', shape: { cx: 0, cy: 0, r: 0 }, buildPath : function (ctx, shape, inBundle) { // Better stroking in ShapeBundle // Always do it may have performence issue ( fill may be 2x more cost) if (inBundle) { ctx.moveTo(shape.cx + shape.r, shape.cy); } // else { // if (ctx.allocate && !ctx.data.length) { // ctx.allocate(ctx.CMD_MEM_SIZE.A); // } // } // Better stroking in ShapeBundle // ctx.moveTo(shape.cx + shape.r, shape.cy); ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2, true); } }); // Fix weird bug in some version of IE11 (like 11.0.9600.178**), // where exception "unexpected call to method or property access" // might be thrown when calling ctx.fill or ctx.stroke after a path // whose area size is zero is drawn and ctx.clip() is called and // shadowBlur is set. See #4572, #3112, #5777. // (e.g., // ctx.moveTo(10, 10); // ctx.lineTo(20, 10); // ctx.closePath(); // ctx.clip(); // ctx.shadowBlur = 10; // ... // ctx.fill(); // ) var shadowTemp = [ ['shadowBlur', 0], ['shadowColor', '#000'], ['shadowOffsetX', 0], ['shadowOffsetY', 0] ]; var fixClipWithShadow = function (orignalBrush) { // version string can be: '11.0' return (env$1.browser.ie && env$1.browser.version >= 11) ? function () { var clipPaths = this.__clipPaths; var style = this.style; var modified; if (clipPaths) { for (var i = 0; i < clipPaths.length; i++) { var clipPath = clipPaths[i]; var shape = clipPath && clipPath.shape; var type = clipPath && clipPath.type; if (shape && ( (type === 'sector' && shape.startAngle === shape.endAngle) || (type === 'rect' && (!shape.width || !shape.height)) )) { for (var j = 0; j < shadowTemp.length; j++) { // It is save to put shadowTemp static, because shadowTemp // will be all modified each item brush called. shadowTemp[j][2] = style[shadowTemp[j][0]]; style[shadowTemp[j][0]] = shadowTemp[j][1]; } modified = true; break; } } } orignalBrush.apply(this, arguments); if (modified) { for (var j = 0; j < shadowTemp.length; j++) { style[shadowTemp[j][0]] = shadowTemp[j][2]; } } } : orignalBrush; }; /** * 扇形 * @module zrender/graphic/shape/Sector */ var Sector = Path.extend({ type: 'sector', shape: { cx: 0, cy: 0, r0: 0, r: 0, startAngle: 0, endAngle: Math.PI * 2, clockwise: true }, brush: fixClipWithShadow(Path.prototype.brush), buildPath: function (ctx, shape) { var x = shape.cx; var y = shape.cy; var r0 = Math.max(shape.r0 || 0, 0); var r = Math.max(shape.r, 0); var startAngle = shape.startAngle; var endAngle = shape.endAngle; var clockwise = shape.clockwise; var unitX = Math.cos(startAngle); var unitY = Math.sin(startAngle); ctx.moveTo(unitX * r0 + x, unitY * r0 + y); ctx.lineTo(unitX * r + x, unitY * r + y); ctx.arc(x, y, r, startAngle, endAngle, !clockwise); ctx.lineTo( Math.cos(endAngle) * r0 + x, Math.sin(endAngle) * r0 + y ); if (r0 !== 0) { ctx.arc(x, y, r0, endAngle, startAngle, clockwise); } ctx.closePath(); } }); /** * 圆环 * @module zrender/graphic/shape/Ring */ var Ring = Path.extend({ type: 'ring', shape: { cx: 0, cy: 0, r: 0, r0: 0 }, buildPath: function (ctx, shape) { var x = shape.cx; var y = shape.cy; var PI2 = Math.PI * 2; ctx.moveTo(x + shape.r, y); ctx.arc(x, y, shape.r, 0, PI2, false); ctx.moveTo(x + shape.r0, y); ctx.arc(x, y, shape.r0, 0, PI2, true); } }); /** * Catmull-Rom spline 插值折线 * @module zrender/shape/util/smoothSpline * @author pissang (https://www.github.com/pissang) * Kener (@Kener-林峰, kener.linfeng@gmail.com) * errorrik (errorrik@gmail.com) */ /** * @inner */ function interpolate(p0, p1, p2, p3, t, t2, t3) { var v0 = (p2 - p0) * 0.5; var v1 = (p3 - p1) * 0.5; return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; } /** * @alias module:zrender/shape/util/smoothSpline * @param {Array} points 线段顶点数组 * @param {boolean} isLoop * @return {Array} */ var smoothSpline = function (points, isLoop) { var len$$1 = points.length; var ret = []; var distance$$1 = 0; for (var i = 1; i < len$$1; i++) { distance$$1 += distance(points[i - 1], points[i]); } var segs = distance$$1 / 2; segs = segs < len$$1 ? len$$1 : segs; for (var i = 0; i < segs; i++) { var pos = i / (segs - 1) * (isLoop ? len$$1 : len$$1 - 1); var idx = Math.floor(pos); var w = pos - idx; var p0; var p1 = points[idx % len$$1]; var p2; var p3; if (!isLoop) { p0 = points[idx === 0 ? idx : idx - 1]; p2 = points[idx > len$$1 - 2 ? len$$1 - 1 : idx + 1]; p3 = points[idx > len$$1 - 3 ? len$$1 - 1 : idx + 2]; } else { p0 = points[(idx - 1 + len$$1) % len$$1]; p2 = points[(idx + 1) % len$$1]; p3 = points[(idx + 2) % len$$1]; } var w2 = w * w; var w3 = w * w2; ret.push([ interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3), interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3) ]); } return ret; }; /** * 贝塞尔平滑曲线 * @module zrender/shape/util/smoothBezier * @author pissang (https://www.github.com/pissang) * Kener (@Kener-林峰, kener.linfeng@gmail.com) * errorrik (errorrik@gmail.com) */ /** * 贝塞尔平滑曲线 * @alias module:zrender/shape/util/smoothBezier * @param {Array} points 线段顶点数组 * @param {number} smooth 平滑等级, 0-1 * @param {boolean} isLoop * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内 * 比如 [[0, 0], [100, 100]], 这个包围盒会与 * 整个折线的包围盒做一个并集用来约束控制点。 * @param {Array} 计算出来的控制点数组 */ var smoothBezier = function (points, smooth, isLoop, constraint) { var cps = []; var v = []; var v1 = []; var v2 = []; var prevPoint; var nextPoint; var min$$1, max$$1; if (constraint) { min$$1 = [Infinity, Infinity]; max$$1 = [-Infinity, -Infinity]; for (var i = 0, len$$1 = points.length; i < len$$1; i++) { min(min$$1, min$$1, points[i]); max(max$$1, max$$1, points[i]); } // 与指定的包围盒做并集 min(min$$1, min$$1, constraint[0]); max(max$$1, max$$1, constraint[1]); } for (var i = 0, len$$1 = points.length; i < len$$1; i++) { var point = points[i]; if (isLoop) { prevPoint = points[i ? i - 1 : len$$1 - 1]; nextPoint = points[(i + 1) % len$$1]; } else { if (i === 0 || i === len$$1 - 1) { cps.push(clone$1(points[i])); continue; } else { prevPoint = points[i - 1]; nextPoint = points[i + 1]; } } sub(v, nextPoint, prevPoint); // use degree to scale the handle length scale(v, v, smooth); var d0 = distance(point, prevPoint); var d1 = distance(point, nextPoint); var sum = d0 + d1; if (sum !== 0) { d0 /= sum; d1 /= sum; } scale(v1, v, -d0); scale(v2, v, d1); var cp0 = add([], point, v1); var cp1 = add([], point, v2); if (constraint) { max(cp0, cp0, min$$1); min(cp0, cp0, max$$1); max(cp1, cp1, min$$1); min(cp1, cp1, max$$1); } cps.push(cp0); cps.push(cp1); } if (isLoop) { cps.push(cps.shift()); } return cps; }; function buildPath$1(ctx, shape, closePath) { var points = shape.points; var smooth = shape.smooth; if (points && points.length >= 2) { if (smooth && smooth !== 'spline') { var controlPoints = smoothBezier( points, smooth, closePath, shape.smoothConstraint ); ctx.moveTo(points[0][0], points[0][1]); var len = points.length; for (var i = 0; i < (closePath ? len : len - 1); i++) { var cp1 = controlPoints[i * 2]; var cp2 = controlPoints[i * 2 + 1]; var p = points[(i + 1) % len]; ctx.bezierCurveTo( cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] ); } } else { if (smooth === 'spline') { points = smoothSpline(points, closePath); } ctx.moveTo(points[0][0], points[0][1]); for (var i = 1, l = points.length; i < l; i++) { ctx.lineTo(points[i][0], points[i][1]); } } closePath && ctx.closePath(); } } /** * 多边形 * @module zrender/shape/Polygon */ var Polygon = Path.extend({ type: 'polygon', shape: { points: null, smooth: false, smoothConstraint: null }, buildPath: function (ctx, shape) { buildPath$1(ctx, shape, true); } }); /** * @module zrender/graphic/shape/Polyline */ var Polyline = Path.extend({ type: 'polyline', shape: { points: null, smooth: false, smoothConstraint: null }, style: { stroke: '#000', fill: null }, buildPath: function (ctx, shape) { buildPath$1(ctx, shape, false); } }); /** * 矩形 * @module zrender/graphic/shape/Rect */ var Rect = Path.extend({ type: 'rect', shape: { // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 // r缩写为1 相当于 [1, 1, 1, 1] // r缩写为[1] 相当于 [1, 1, 1, 1] // r缩写为[1, 2] 相当于 [1, 2, 1, 2] // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] r: 0, x: 0, y: 0, width: 0, height: 0 }, buildPath: function (ctx, shape) { var x = shape.x; var y = shape.y; var width = shape.width; var height = shape.height; if (!shape.r) { ctx.rect(x, y, width, height); } else { buildPath(ctx, shape); } ctx.closePath(); return; } }); /** * 直线 * @module zrender/graphic/shape/Line */ var Line = Path.extend({ type: 'line', shape: { // Start point x1: 0, y1: 0, // End point x2: 0, y2: 0, percent: 1 }, style: { stroke: '#000', fill: null }, buildPath: function (ctx, shape) { var x1 = shape.x1; var y1 = shape.y1; var x2 = shape.x2; var y2 = shape.y2; var percent = shape.percent; if (percent === 0) { return; } ctx.moveTo(x1, y1); if (percent < 1) { x2 = x1 * (1 - percent) + x2 * percent; y2 = y1 * (1 - percent) + y2 * percent; } ctx.lineTo(x2, y2); }, /** * Get point at percent * @param {number} percent * @return {Array.} */ pointAt: function (p) { var shape = this.shape; return [ shape.x1 * (1 - p) + shape.x2 * p, shape.y1 * (1 - p) + shape.y2 * p ]; } }); /** * 贝塞尔曲线 * @module zrender/shape/BezierCurve */ var out = []; function someVectorAt(shape, t, isTangent) { var cpx2 = shape.cpx2; var cpy2 = shape.cpy2; if (cpx2 === null || cpy2 === null) { return [ (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t), (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t) ]; } else { return [ (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t), (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t) ]; } } var BezierCurve = Path.extend({ type: 'bezier-curve', shape: { x1: 0, y1: 0, x2: 0, y2: 0, cpx1: 0, cpy1: 0, // cpx2: 0, // cpy2: 0 // Curve show percent, for animating percent: 1 }, style: { stroke: '#000', fill: null }, buildPath: function (ctx, shape) { var x1 = shape.x1; var y1 = shape.y1; var x2 = shape.x2; var y2 = shape.y2; var cpx1 = shape.cpx1; var cpy1 = shape.cpy1; var cpx2 = shape.cpx2; var cpy2 = shape.cpy2; var percent = shape.percent; if (percent === 0) { return; } ctx.moveTo(x1, y1); if (cpx2 == null || cpy2 == null) { if (percent < 1) { quadraticSubdivide( x1, cpx1, x2, percent, out ); cpx1 = out[1]; x2 = out[2]; quadraticSubdivide( y1, cpy1, y2, percent, out ); cpy1 = out[1]; y2 = out[2]; } ctx.quadraticCurveTo( cpx1, cpy1, x2, y2 ); } else { if (percent < 1) { cubicSubdivide( x1, cpx1, cpx2, x2, percent, out ); cpx1 = out[1]; cpx2 = out[2]; x2 = out[3]; cubicSubdivide( y1, cpy1, cpy2, y2, percent, out ); cpy1 = out[1]; cpy2 = out[2]; y2 = out[3]; } ctx.bezierCurveTo( cpx1, cpy1, cpx2, cpy2, x2, y2 ); } }, /** * Get point at percent * @param {number} t * @return {Array.} */ pointAt: function (t) { return someVectorAt(this.shape, t, false); }, /** * Get tangent at percent * @param {number} t * @return {Array.} */ tangentAt: function (t) { var p = someVectorAt(this.shape, t, true); return normalize(p, p); } }); /** * 圆弧 * @module zrender/graphic/shape/Arc */ var Arc = Path.extend({ type: 'arc', shape: { cx: 0, cy: 0, r: 0, startAngle: 0, endAngle: Math.PI * 2, clockwise: true }, style: { stroke: '#000', fill: null }, buildPath: function (ctx, shape) { var x = shape.cx; var y = shape.cy; var r = Math.max(shape.r, 0); var startAngle = shape.startAngle; var endAngle = shape.endAngle; var clockwise = shape.clockwise; var unitX = Math.cos(startAngle); var unitY = Math.sin(startAngle); ctx.moveTo(unitX * r + x, unitY * r + y); ctx.arc(x, y, r, startAngle, endAngle, !clockwise); } }); // CompoundPath to improve performance var CompoundPath = Path.extend({ type: 'compound', shape: { paths: null }, _updatePathDirty: function () { var dirtyPath = this.__dirtyPath; var paths = this.shape.paths; for (var i = 0; i < paths.length; i++) { // Mark as dirty if any subpath is dirty dirtyPath = dirtyPath || paths[i].__dirtyPath; } this.__dirtyPath = dirtyPath; this.__dirty = this.__dirty || dirtyPath; }, beforeBrush: function () { this._updatePathDirty(); var paths = this.shape.paths || []; var scale = this.getGlobalScale(); // Update path scale for (var i = 0; i < paths.length; i++) { if (!paths[i].path) { paths[i].createPathProxy(); } paths[i].path.setScale(scale[0], scale[1]); } }, buildPath: function (ctx, shape) { var paths = shape.paths || []; for (var i = 0; i < paths.length; i++) { paths[i].buildPath(ctx, paths[i].shape, true); } }, afterBrush: function () { var paths = this.shape.paths || []; for (var i = 0; i < paths.length; i++) { paths[i].__dirtyPath = false; } }, getBoundingRect: function () { this._updatePathDirty(); return Path.prototype.getBoundingRect.call(this); } }); /** * @param {Array.} colorStops */ var Gradient = function (colorStops) { this.colorStops = colorStops || []; }; Gradient.prototype = { constructor: Gradient, addColorStop: function (offset, color) { this.colorStops.push({ offset: offset, color: color }); } }; /** * x, y, x2, y2 are all percent from 0 to 1 * @param {number} [x=0] * @param {number} [y=0] * @param {number} [x2=1] * @param {number} [y2=0] * @param {Array.} colorStops * @param {boolean} [globalCoord=false] */ var LinearGradient = function (x, y, x2, y2, colorStops, globalCoord) { // Should do nothing more in this constructor. Because gradient can be // declard by `color: {type: 'linear', colorStops: ...}`, where // this constructor will not be called. this.x = x == null ? 0 : x; this.y = y == null ? 0 : y; this.x2 = x2 == null ? 1 : x2; this.y2 = y2 == null ? 0 : y2; // Can be cloned this.type = 'linear'; // If use global coord this.global = globalCoord || false; Gradient.call(this, colorStops); }; LinearGradient.prototype = { constructor: LinearGradient }; inherits(LinearGradient, Gradient); /** * x, y, r are all percent from 0 to 1 * @param {number} [x=0.5] * @param {number} [y=0.5] * @param {number} [r=0.5] * @param {Array.} [colorStops] * @param {boolean} [globalCoord=false] */ var RadialGradient = function (x, y, r, colorStops, globalCoord) { // Should do nothing more in this constructor. Because gradient can be // declard by `color: {type: 'radial', colorStops: ...}`, where // this constructor will not be called. this.x = x == null ? 0.5 : x; this.y = y == null ? 0.5 : y; this.r = r == null ? 0.5 : r; // Can be cloned this.type = 'radial'; // If use global coord this.global = globalCoord || false; Gradient.call(this, colorStops); }; RadialGradient.prototype = { constructor: RadialGradient }; inherits(RadialGradient, Gradient); /** * Displayable for incremental rendering. It will be rendered in a separate layer * IncrementalDisplay have too main methods. `clearDisplayables` and `addDisplayables` * addDisplayables will render the added displayables incremetally. * * It use a not clearFlag to tell the painter don't clear the layer if it's the first element. */ // TODO Style override ? function IncrementalDisplayble(opts) { Displayable.call(this, opts); this._displayables = []; this._temporaryDisplayables = []; this._cursor = 0; this.notClear = true; } IncrementalDisplayble.prototype.incremental = true; IncrementalDisplayble.prototype.clearDisplaybles = function () { this._displayables = []; this._temporaryDisplayables = []; this._cursor = 0; this.dirty(); this.notClear = false; }; IncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) { if (notPersistent) { this._temporaryDisplayables.push(displayable); } else { this._displayables.push(displayable); } this.dirty(); }; IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) { notPersistent = notPersistent || false; for (var i = 0; i < displayables.length; i++) { this.addDisplayable(displayables[i], notPersistent); } }; IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) { for (var i = this._cursor; i < this._displayables.length; i++) { cb && cb(this._displayables[i]); } for (var i = 0; i < this._temporaryDisplayables.length; i++) { cb && cb(this._temporaryDisplayables[i]); } }; IncrementalDisplayble.prototype.update = function () { this.updateTransform(); for (var i = this._cursor; i < this._displayables.length; i++) { var displayable = this._displayables[i]; // PENDING displayable.parent = this; displayable.update(); displayable.parent = null; } for (var i = 0; i < this._temporaryDisplayables.length; i++) { var displayable = this._temporaryDisplayables[i]; // PENDING displayable.parent = this; displayable.update(); displayable.parent = null; } }; IncrementalDisplayble.prototype.brush = function (ctx, prevEl) { // Render persistant displayables. for (var i = this._cursor; i < this._displayables.length; i++) { var displayable = this._displayables[i]; displayable.beforeBrush && displayable.beforeBrush(ctx); displayable.brush(ctx, i === this._cursor ? null : this._displayables[i - 1]); displayable.afterBrush && displayable.afterBrush(ctx); } this._cursor = i; // Render temporary displayables. for (var i = 0; i < this._temporaryDisplayables.length; i++) { var displayable = this._temporaryDisplayables[i]; displayable.beforeBrush && displayable.beforeBrush(ctx); displayable.brush(ctx, i === 0 ? null : this._temporaryDisplayables[i - 1]); displayable.afterBrush && displayable.afterBrush(ctx); } this._temporaryDisplayables = []; this.notClear = true; }; var m = []; IncrementalDisplayble.prototype.getBoundingRect = function () { if (!this._rect) { var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity); for (var i = 0; i < this._displayables.length; i++) { var displayable = this._displayables[i]; var childRect = displayable.getBoundingRect().clone(); if (displayable.needLocalTransform()) { childRect.applyTransform(displayable.getLocalTransform(m)); } rect.union(childRect); } this._rect = rect; } return this._rect; }; IncrementalDisplayble.prototype.contain = function (x, y) { var localPos = this.transformCoordToLocal(x, y); var rect = this.getBoundingRect(); if (rect.contain(localPos[0], localPos[1])) { for (var i = 0; i < this._displayables.length; i++) { var displayable = this._displayables[i]; if (displayable.contain(x, y)) { return true; } } } return false; }; inherits(IncrementalDisplayble, Displayable); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var round = Math.round; var mathMax$1 = Math.max; var mathMin$1 = Math.min; var EMPTY_OBJ = {}; /** * Extend shape with parameters */ function extendShape(opts) { return Path.extend(opts); } /** * Extend path */ function extendPath(pathData, opts) { return extendFromString(pathData, opts); } /** * Create a path element from path data string * @param {string} pathData * @param {Object} opts * @param {module:zrender/core/BoundingRect} rect * @param {string} [layout=cover] 'center' or 'cover' */ function makePath(pathData, opts, rect, layout) { var path = createFromString(pathData, opts); var boundingRect = path.getBoundingRect(); if (rect) { if (layout === 'center') { rect = centerGraphic(rect, boundingRect); } resizePath(path, rect); } return path; } /** * Create a image element from image url * @param {string} imageUrl image url * @param {Object} opts options * @param {module:zrender/core/BoundingRect} rect constrain rect * @param {string} [layout=cover] 'center' or 'cover' */ function makeImage(imageUrl, rect, layout) { var path = new ZImage({ style: { image: imageUrl, x: rect.x, y: rect.y, width: rect.width, height: rect.height }, onload: function (img) { if (layout === 'center') { var boundingRect = { width: img.width, height: img.height }; path.setStyle(centerGraphic(rect, boundingRect)); } } }); return path; } /** * Get position of centered element in bounding box. * * @param {Object} rect element local bounding box * @param {Object} boundingRect constraint bounding box * @return {Object} element position containing x, y, width, and height */ function centerGraphic(rect, boundingRect) { // Set rect to center, keep width / height ratio. var aspect = boundingRect.width / boundingRect.height; var width = rect.height * aspect; var height; if (width <= rect.width) { height = rect.height; } else { width = rect.width; height = width / aspect; } var cx = rect.x + rect.width / 2; var cy = rect.y + rect.height / 2; return { x: cx - width / 2, y: cy - height / 2, width: width, height: height }; } var mergePath = mergePath$1; /** * Resize a path to fit the rect * @param {module:zrender/graphic/Path} path * @param {Object} rect */ function resizePath(path, rect) { if (!path.applyTransform) { return; } var pathRect = path.getBoundingRect(); var m = pathRect.calculateTransform(rect); path.applyTransform(m); } /** * Sub pixel optimize line for canvas * * @param {Object} param * @param {Object} [param.shape] * @param {number} [param.shape.x1] * @param {number} [param.shape.y1] * @param {number} [param.shape.x2] * @param {number} [param.shape.y2] * @param {Object} [param.style] * @param {number} [param.style.lineWidth] * @return {Object} Modified param */ function subPixelOptimizeLine(param) { var shape = param.shape; var lineWidth = param.style.lineWidth; if (round(shape.x1 * 2) === round(shape.x2 * 2)) { shape.x1 = shape.x2 = subPixelOptimize(shape.x1, lineWidth, true); } if (round(shape.y1 * 2) === round(shape.y2 * 2)) { shape.y1 = shape.y2 = subPixelOptimize(shape.y1, lineWidth, true); } return param; } /** * Sub pixel optimize rect for canvas * * @param {Object} param * @param {Object} [param.shape] * @param {number} [param.shape.x] * @param {number} [param.shape.y] * @param {number} [param.shape.width] * @param {number} [param.shape.height] * @param {Object} [param.style] * @param {number} [param.style.lineWidth] * @return {Object} Modified param */ function subPixelOptimizeRect(param) { var shape = param.shape; var lineWidth = param.style.lineWidth; var originX = shape.x; var originY = shape.y; var originWidth = shape.width; var originHeight = shape.height; shape.x = subPixelOptimize(shape.x, lineWidth, true); shape.y = subPixelOptimize(shape.y, lineWidth, true); shape.width = Math.max( subPixelOptimize(originX + originWidth, lineWidth, false) - shape.x, originWidth === 0 ? 0 : 1 ); shape.height = Math.max( subPixelOptimize(originY + originHeight, lineWidth, false) - shape.y, originHeight === 0 ? 0 : 1 ); return param; } /** * Sub pixel optimize for canvas * * @param {number} position Coordinate, such as x, y * @param {number} lineWidth Should be nonnegative integer. * @param {boolean=} positiveOrNegative Default false (negative). * @return {number} Optimized position. */ function subPixelOptimize(position, lineWidth, positiveOrNegative) { // Assure that (position + lineWidth / 2) is near integer edge, // otherwise line will be fuzzy in canvas. var doubledPosition = round(position * 2); return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2; } function hasFillOrStroke(fillOrStroke) { return fillOrStroke != null && fillOrStroke != 'none'; } function liftColor(color) { return typeof color === 'string' ? lift(color, -0.1) : color; } /** * @private */ function cacheElementStl(el) { if (el.__hoverStlDirty) { var stroke = el.style.stroke; var fill = el.style.fill; // Create hoverStyle on mouseover var hoverStyle = el.__hoverStl; hoverStyle.fill = hoverStyle.fill || (hasFillOrStroke(fill) ? liftColor(fill) : null); hoverStyle.stroke = hoverStyle.stroke || (hasFillOrStroke(stroke) ? liftColor(stroke) : null); var normalStyle = {}; for (var name in hoverStyle) { // See comment in `doSingleEnterHover`. if (hoverStyle[name] != null) { normalStyle[name] = el.style[name]; } } el.__normalStl = normalStyle; el.__hoverStlDirty = false; } } /** * @private */ function doSingleEnterHover(el) { if (el.__isHover) { return; } cacheElementStl(el); if (el.useHoverLayer) { el.__zr && el.__zr.addHover(el, el.__hoverStl); } else { var style = el.style; var insideRollbackOpt = style.insideRollbackOpt; // Consider case: only `position: 'top'` is set on emphasis, then text // color should be returned to `autoColor`, rather than remain '#fff'. // So we should rollback then apply again after style merging. insideRollbackOpt && rollbackInsideStyle(style); // styles can be: // { // label: { // show: false, // position: 'outside', // fontSize: 18 // }, // emphasis: { // label: { // show: true // } // } // }, // where properties of `emphasis` may not appear in `normal`. We previously use // module:echarts/util/model#defaultEmphasis to merge `normal` to `emphasis`. // But consider rich text and setOption in merge mode, it is impossible to cover // all properties in merge. So we use merge mode when setting style here, where // only properties that is not `null/undefined` can be set. The disadventage: // null/undefined can not be used to remove style any more in `emphasis`. style.extendFrom(el.__hoverStl); // Do not save `insideRollback`. if (insideRollbackOpt) { applyInsideStyle(style, style.insideOriginalTextPosition, insideRollbackOpt); // textFill may be rollbacked to null. if (style.textFill == null) { style.textFill = insideRollbackOpt.autoColor; } } el.dirty(false); el.z2 += 1; } el.__isHover = true; } /** * @inner */ function doSingleLeaveHover(el) { if (!el.__isHover) { return; } var normalStl = el.__normalStl; if (el.useHoverLayer) { el.__zr && el.__zr.removeHover(el); } else { // Consider null/undefined value, should use // `setStyle` but not `extendFrom(stl, true)`. normalStl && el.setStyle(normalStl); el.z2 -= 1; } el.__isHover = false; } /** * @inner */ function doEnterHover(el) { el.type === 'group' ? el.traverse(function (child) { if (child.type !== 'group') { doSingleEnterHover(child); } }) : doSingleEnterHover(el); } function doLeaveHover(el) { el.type === 'group' ? el.traverse(function (child) { if (child.type !== 'group') { doSingleLeaveHover(child); } }) : doSingleLeaveHover(el); } /** * @inner */ function setElementHoverStl(el, hoverStl) { // If element has sepcified hoverStyle, then use it instead of given hoverStyle // Often used when item group has a label element and it's hoverStyle is different el.__hoverStl = el.hoverStyle || hoverStl || {}; el.__hoverStlDirty = true; if (el.__isHover) { cacheElementStl(el); } } /** * @inner */ function onElementMouseOver(e) { if (this.__hoverSilentOnTouch && e.zrByTouch) { return; } // Only if element is not in emphasis status !this.__isEmphasis && doEnterHover(this); } /** * @inner */ function onElementMouseOut(e) { if (this.__hoverSilentOnTouch && e.zrByTouch) { return; } // Only if element is not in emphasis status !this.__isEmphasis && doLeaveHover(this); } /** * @inner */ function enterEmphasis() { this.__isEmphasis = true; doEnterHover(this); } /** * @inner */ function leaveEmphasis() { this.__isEmphasis = false; doLeaveHover(this); } /** * Set hover style of element. * This method can be called repeatly without side-effects. * @param {module:zrender/Element} el * @param {Object} [hoverStyle] * @param {Object} [opt] * @param {boolean} [opt.hoverSilentOnTouch=false] * In touch device, mouseover event will be trigger on touchstart event * (see module:zrender/dom/HandlerProxy). By this mechanism, we can * conviniently use hoverStyle when tap on touch screen without additional * code for compatibility. * But if the chart/component has select feature, which usually also use * hoverStyle, there might be conflict between 'select-highlight' and * 'hover-highlight' especially when roam is enabled (see geo for example). * In this case, hoverSilentOnTouch should be used to disable hover-highlight * on touch device. */ function setHoverStyle(el, hoverStyle, opt) { el.__hoverSilentOnTouch = opt && opt.hoverSilentOnTouch; el.type === 'group' ? el.traverse(function (child) { if (child.type !== 'group') { setElementHoverStl(child, hoverStyle); } }) : setElementHoverStl(el, hoverStyle); // Duplicated function will be auto-ignored, see Eventful.js. el.on('mouseover', onElementMouseOver) .on('mouseout', onElementMouseOut); // Emphasis, normal can be triggered manually el.on('emphasis', enterEmphasis) .on('normal', leaveEmphasis); } /** * @param {Object|module:zrender/graphic/Style} normalStyle * @param {Object} emphasisStyle * @param {module:echarts/model/Model} normalModel * @param {module:echarts/model/Model} emphasisModel * @param {Object} opt Check `opt` of `setTextStyleCommon` to find other props. * @param {string|Function} [opt.defaultText] * @param {module:echarts/model/Model} [opt.labelFetcher] Fetch text by * `opt.labelFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)` * @param {module:echarts/model/Model} [opt.labelDataIndex] Fetch text by * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)` * @param {module:echarts/model/Model} [opt.labelDimIndex] Fetch text by * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)` * @param {Object} [normalSpecified] * @param {Object} [emphasisSpecified] */ function setLabelStyle( normalStyle, emphasisStyle, normalModel, emphasisModel, opt, normalSpecified, emphasisSpecified ) { opt = opt || EMPTY_OBJ; var labelFetcher = opt.labelFetcher; var labelDataIndex = opt.labelDataIndex; var labelDimIndex = opt.labelDimIndex; // This scenario, `label.normal.show = true; label.emphasis.show = false`, // is not supported util someone requests. var showNormal = normalModel.getShallow('show'); var showEmphasis = emphasisModel.getShallow('show'); // Consider performance, only fetch label when necessary. // If `normal.show` is `false` and `emphasis.show` is `true` and `emphasis.formatter` is not set, // label should be displayed, where text is fetched by `normal.formatter` or `opt.defaultText`. var baseText; if (showNormal || showEmphasis) { if (labelFetcher) { baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex); } if (baseText == null) { baseText = isFunction$1(opt.defaultText) ? opt.defaultText(labelDataIndex, opt) : opt.defaultText; } } var normalStyleText = showNormal ? baseText : null; var emphasisStyleText = showEmphasis ? retrieve2( labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, 'emphasis', null, labelDimIndex) : null, baseText ) : null; // Optimize: If style.text is null, text will not be drawn. if (normalStyleText != null || emphasisStyleText != null) { // Always set `textStyle` even if `normalStyle.text` is null, because default // values have to be set on `normalStyle`. // If we set default values on `emphasisStyle`, consider case: // Firstly, `setOption(... label: {normal: {text: null}, emphasis: {show: true}} ...);` // Secondly, `setOption(... label: {noraml: {show: true, text: 'abc', color: 'red'} ...);` // Then the 'red' will not work on emphasis. setTextStyle(normalStyle, normalModel, normalSpecified, opt); setTextStyle(emphasisStyle, emphasisModel, emphasisSpecified, opt, true); } normalStyle.text = normalStyleText; emphasisStyle.text = emphasisStyleText; } /** * Set basic textStyle properties. * @param {Object|module:zrender/graphic/Style} textStyle * @param {module:echarts/model/Model} model * @param {Object} [specifiedTextStyle] Can be overrided by settings in model. * @param {Object} [opt] See `opt` of `setTextStyleCommon`. * @param {boolean} [isEmphasis] */ function setTextStyle( textStyle, textStyleModel, specifiedTextStyle, opt, isEmphasis ) { setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis); specifiedTextStyle && extend(textStyle, specifiedTextStyle); textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false); return textStyle; } /** * Set text option in the style. * @deprecated * @param {Object} textStyle * @param {module:echarts/model/Model} labelModel * @param {string|boolean} defaultColor Default text color. * If set as false, it will be processed as a emphasis style. */ function setText(textStyle, labelModel, defaultColor) { var opt = {isRectText: true}; var isEmphasis; if (defaultColor === false) { isEmphasis = true; } else { // Support setting color as 'auto' to get visual color. opt.autoColor = defaultColor; } setTextStyleCommon(textStyle, labelModel, opt, isEmphasis); textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false); } /** * { * disableBox: boolean, Whether diable drawing box of block (outer most). * isRectText: boolean, * autoColor: string, specify a color when color is 'auto', * for textFill, textStroke, textBackgroundColor, and textBorderColor. * If autoColor specified, it is used as default textFill. * useInsideStyle: * `true`: Use inside style (textFill, textStroke, textStrokeWidth) * if `textFill` is not specified. * `false`: Do not use inside style. * `null/undefined`: use inside style if `isRectText` is true and * `textFill` is not specified and textPosition contains `'inside'`. * forceRich: boolean * } */ function setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis) { // Consider there will be abnormal when merge hover style to normal style if given default value. opt = opt || EMPTY_OBJ; if (opt.isRectText) { var textPosition = textStyleModel.getShallow('position') || (isEmphasis ? null : 'inside'); // 'outside' is not a valid zr textPostion value, but used // in bar series, and magric type should be considered. textPosition === 'outside' && (textPosition = 'top'); textStyle.textPosition = textPosition; textStyle.textOffset = textStyleModel.getShallow('offset'); var labelRotate = textStyleModel.getShallow('rotate'); labelRotate != null && (labelRotate *= Math.PI / 180); textStyle.textRotation = labelRotate; textStyle.textDistance = retrieve2( textStyleModel.getShallow('distance'), isEmphasis ? null : 5 ); } var ecModel = textStyleModel.ecModel; var globalTextStyle = ecModel && ecModel.option.textStyle; // Consider case: // { // data: [{ // value: 12, // label: { // rich: { // // no 'a' here but using parent 'a'. // } // } // }], // rich: { // a: { ... } // } // } var richItemNames = getRichItemNames(textStyleModel); var richResult; if (richItemNames) { richResult = {}; for (var name in richItemNames) { if (richItemNames.hasOwnProperty(name)) { // Cascade is supported in rich. var richTextStyle = textStyleModel.getModel(['rich', name]); // In rich, never `disableBox`. setTokenTextStyle(richResult[name] = {}, richTextStyle, globalTextStyle, opt, isEmphasis); } } } textStyle.rich = richResult; setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEmphasis, true); if (opt.forceRich && !opt.textStyle) { opt.textStyle = {}; } return textStyle; } // Consider case: // { // data: [{ // value: 12, // label: { // rich: { // // no 'a' here but using parent 'a'. // } // } // }], // rich: { // a: { ... } // } // } function getRichItemNames(textStyleModel) { // Use object to remove duplicated names. var richItemNameMap; while (textStyleModel && textStyleModel !== textStyleModel.ecModel) { var rich = (textStyleModel.option || EMPTY_OBJ).rich; if (rich) { richItemNameMap = richItemNameMap || {}; for (var name in rich) { if (rich.hasOwnProperty(name)) { richItemNameMap[name] = 1; } } } textStyleModel = textStyleModel.parentModel; } return richItemNameMap; } function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEmphasis, isBlock) { // In merge mode, default value should not be given. globalTextStyle = !isEmphasis && globalTextStyle || EMPTY_OBJ; textStyle.textFill = getAutoColor(textStyleModel.getShallow('color'), opt) || globalTextStyle.color; textStyle.textStroke = getAutoColor(textStyleModel.getShallow('textBorderColor'), opt) || globalTextStyle.textBorderColor; textStyle.textStrokeWidth = retrieve2( textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth ); if (!isEmphasis) { if (isBlock) { // Always set `insideRollback`, for clearing previous. var originalTextPosition = textStyle.textPosition; textStyle.insideRollback = applyInsideStyle(textStyle, originalTextPosition, opt); // Save original textPosition, because style.textPosition will be repalced by // real location (like [10, 30]) in zrender. textStyle.insideOriginalTextPosition = originalTextPosition; textStyle.insideRollbackOpt = opt; } // Set default finally. if (textStyle.textFill == null) { textStyle.textFill = opt.autoColor; } } // Do not use `getFont` here, because merge should be supported, where // part of these properties may be changed in emphasis style, and the // others should remain their original value got from normal style. textStyle.fontStyle = textStyleModel.getShallow('fontStyle') || globalTextStyle.fontStyle; textStyle.fontWeight = textStyleModel.getShallow('fontWeight') || globalTextStyle.fontWeight; textStyle.fontSize = textStyleModel.getShallow('fontSize') || globalTextStyle.fontSize; textStyle.fontFamily = textStyleModel.getShallow('fontFamily') || globalTextStyle.fontFamily; textStyle.textAlign = textStyleModel.getShallow('align'); textStyle.textVerticalAlign = textStyleModel.getShallow('verticalAlign') || textStyleModel.getShallow('baseline'); textStyle.textLineHeight = textStyleModel.getShallow('lineHeight'); textStyle.textWidth = textStyleModel.getShallow('width'); textStyle.textHeight = textStyleModel.getShallow('height'); textStyle.textTag = textStyleModel.getShallow('tag'); if (!isBlock || !opt.disableBox) { textStyle.textBackgroundColor = getAutoColor(textStyleModel.getShallow('backgroundColor'), opt); textStyle.textPadding = textStyleModel.getShallow('padding'); textStyle.textBorderColor = getAutoColor(textStyleModel.getShallow('borderColor'), opt); textStyle.textBorderWidth = textStyleModel.getShallow('borderWidth'); textStyle.textBorderRadius = textStyleModel.getShallow('borderRadius'); textStyle.textBoxShadowColor = textStyleModel.getShallow('shadowColor'); textStyle.textBoxShadowBlur = textStyleModel.getShallow('shadowBlur'); textStyle.textBoxShadowOffsetX = textStyleModel.getShallow('shadowOffsetX'); textStyle.textBoxShadowOffsetY = textStyleModel.getShallow('shadowOffsetY'); } textStyle.textShadowColor = textStyleModel.getShallow('textShadowColor') || globalTextStyle.textShadowColor; textStyle.textShadowBlur = textStyleModel.getShallow('textShadowBlur') || globalTextStyle.textShadowBlur; textStyle.textShadowOffsetX = textStyleModel.getShallow('textShadowOffsetX') || globalTextStyle.textShadowOffsetX; textStyle.textShadowOffsetY = textStyleModel.getShallow('textShadowOffsetY') || globalTextStyle.textShadowOffsetY; } function getAutoColor(color, opt) { return color !== 'auto' ? color : (opt && opt.autoColor) ? opt.autoColor : null; } function applyInsideStyle(textStyle, textPosition, opt) { var useInsideStyle = opt.useInsideStyle; var insideRollback; if (textStyle.textFill == null && useInsideStyle !== false && (useInsideStyle === true || (opt.isRectText && textPosition // textPosition can be [10, 30] && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0 ) ) ) { insideRollback = { textFill: null, textStroke: textStyle.textStroke, textStrokeWidth: textStyle.textStrokeWidth }; textStyle.textFill = '#fff'; // Consider text with #fff overflow its container. if (textStyle.textStroke == null) { textStyle.textStroke = opt.autoColor; textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2); } } return insideRollback; } function rollbackInsideStyle(style) { var insideRollback = style.insideRollback; if (insideRollback) { style.textFill = insideRollback.textFill; style.textStroke = insideRollback.textStroke; style.textStrokeWidth = insideRollback.textStrokeWidth; } } function getFont(opt, ecModel) { // ecModel or default text style model. var gTextStyleModel = ecModel || ecModel.getModel('textStyle'); return trim([ // FIXME in node-canvas fontWeight is before fontStyle opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '', opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '', (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px', opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif' ].join(' ')); } function animateOrSetProps(isUpdate, el, props, animatableModel, dataIndex, cb) { if (typeof dataIndex === 'function') { cb = dataIndex; dataIndex = null; } // Do not check 'animation' property directly here. Consider this case: // animation model is an `itemModel`, whose does not have `isAnimationEnabled` // but its parent model (`seriesModel`) does. var animationEnabled = animatableModel && animatableModel.isAnimationEnabled(); if (animationEnabled) { var postfix = isUpdate ? 'Update' : ''; var duration = animatableModel.getShallow('animationDuration' + postfix); var animationEasing = animatableModel.getShallow('animationEasing' + postfix); var animationDelay = animatableModel.getShallow('animationDelay' + postfix); if (typeof animationDelay === 'function') { animationDelay = animationDelay( dataIndex, animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null ); } if (typeof duration === 'function') { duration = duration(dataIndex); } duration > 0 ? el.animateTo(props, duration, animationDelay || 0, animationEasing, cb, !!cb) : (el.stopAnimation(), el.attr(props), cb && cb()); } else { el.stopAnimation(); el.attr(props); cb && cb(); } } /** * Update graphic element properties with or without animation according to the * configuration in series. * * Caution: this method will stop previous animation. * So if do not use this method to one element twice before * animation starts, unless you know what you are doing. * * @param {module:zrender/Element} el * @param {Object} props * @param {module:echarts/model/Model} [animatableModel] * @param {number} [dataIndex] * @param {Function} [cb] * @example * graphic.updateProps(el, { * position: [100, 100] * }, seriesModel, dataIndex, function () { console.log('Animation done!'); }); * // Or * graphic.updateProps(el, { * position: [100, 100] * }, seriesModel, function () { console.log('Animation done!'); }); */ function updateProps(el, props, animatableModel, dataIndex, cb) { animateOrSetProps(true, el, props, animatableModel, dataIndex, cb); } /** * Init graphic element properties with or without animation according to the * configuration in series. * * Caution: this method will stop previous animation. * So if do not use this method to one element twice before * animation starts, unless you know what you are doing. * * @param {module:zrender/Element} el * @param {Object} props * @param {module:echarts/model/Model} [animatableModel] * @param {number} [dataIndex] * @param {Function} cb */ function initProps(el, props, animatableModel, dataIndex, cb) { animateOrSetProps(false, el, props, animatableModel, dataIndex, cb); } /** * Get transform matrix of target (param target), * in coordinate of its ancestor (param ancestor) * * @param {module:zrender/mixin/Transformable} target * @param {module:zrender/mixin/Transformable} [ancestor] */ function getTransform(target, ancestor) { var mat = identity([]); while (target && target !== ancestor) { mul$1(mat, target.getLocalTransform(), mat); target = target.parent; } return mat; } /** * Apply transform to an vertex. * @param {Array.} target [x, y] * @param {Array.|TypedArray.|Object} transform Can be: * + Transform matrix: like [1, 0, 0, 1, 0, 0] * + {position, rotation, scale}, the same as `zrender/Transformable`. * @param {boolean=} invert Whether use invert matrix. * @return {Array.} [x, y] */ function applyTransform$1(target, transform, invert$$1) { if (transform && !isArrayLike(transform)) { transform = Transformable.getLocalTransform(transform); } if (invert$$1) { transform = invert([], transform); } return applyTransform([], target, transform); } /** * @param {string} direction 'left' 'right' 'top' 'bottom' * @param {Array.} transform Transform matrix: like [1, 0, 0, 1, 0, 0] * @param {boolean=} invert Whether use invert matrix. * @return {string} Transformed direction. 'left' 'right' 'top' 'bottom' */ function transformDirection(direction, transform, invert$$1) { // Pick a base, ensure that transform result will not be (0, 0). var hBase = (transform[4] === 0 || transform[5] === 0 || transform[0] === 0) ? 1 : Math.abs(2 * transform[4] / transform[0]); var vBase = (transform[4] === 0 || transform[5] === 0 || transform[2] === 0) ? 1 : Math.abs(2 * transform[4] / transform[2]); var vertex = [ direction === 'left' ? -hBase : direction === 'right' ? hBase : 0, direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0 ]; vertex = applyTransform$1(vertex, transform, invert$$1); return Math.abs(vertex[0]) > Math.abs(vertex[1]) ? (vertex[0] > 0 ? 'right' : 'left') : (vertex[1] > 0 ? 'bottom' : 'top'); } /** * Apply group transition animation from g1 to g2. * If no animatableModel, no animation. */ function groupTransition(g1, g2, animatableModel, cb) { if (!g1 || !g2) { return; } function getElMap(g) { var elMap = {}; g.traverse(function (el) { if (!el.isGroup && el.anid) { elMap[el.anid] = el; } }); return elMap; } function getAnimatableProps(el) { var obj = { position: clone$1(el.position), rotation: el.rotation }; if (el.shape) { obj.shape = extend({}, el.shape); } return obj; } var elMap1 = getElMap(g1); g2.traverse(function (el) { if (!el.isGroup && el.anid) { var oldEl = elMap1[el.anid]; if (oldEl) { var newProp = getAnimatableProps(el); el.attr(getAnimatableProps(oldEl)); updateProps(el, newProp, animatableModel, el.dataIndex); } // else { // if (el.previousProps) { // graphic.updateProps // } // } } }); } /** * @param {Array.>} points Like: [[23, 44], [53, 66], ...] * @param {Object} rect {x, y, width, height} * @return {Array.>} A new clipped points. */ function clipPointsByRect(points, rect) { return map(points, function (point) { var x = point[0]; x = mathMax$1(x, rect.x); x = mathMin$1(x, rect.x + rect.width); var y = point[1]; y = mathMax$1(y, rect.y); y = mathMin$1(y, rect.y + rect.height); return [x, y]; }); } /** * @param {Object} targetRect {x, y, width, height} * @param {Object} rect {x, y, width, height} * @return {Object} A new clipped rect. If rect size are negative, return undefined. */ function clipRectByRect(targetRect, rect) { var x = mathMax$1(targetRect.x, rect.x); var x2 = mathMin$1(targetRect.x + targetRect.width, rect.x + rect.width); var y = mathMax$1(targetRect.y, rect.y); var y2 = mathMin$1(targetRect.y + targetRect.height, rect.y + rect.height); if (x2 >= x && y2 >= y) { return { x: x, y: y, width: x2 - x, height: y2 - y }; } } /** * @param {string} iconStr Support 'image://' or 'path://' or direct svg path. * @param {Object} [opt] Properties of `module:zrender/Element`, except `style`. * @param {Object} [rect] {x, y, width, height} * @return {module:zrender/Element} Icon path or image element. */ function createIcon(iconStr, opt, rect) { opt = extend({rectHover: true}, opt); var style = opt.style = {strokeNoScale: true}; rect = rect || {x: -1, y: -1, width: 2, height: 2}; if (iconStr) { return iconStr.indexOf('image://') === 0 ? ( style.image = iconStr.slice(8), defaults(style, rect), new ZImage(opt) ) : ( makePath( iconStr.replace('path://', ''), opt, rect, 'center' ) ); } } var graphic = (Object.freeze || Object)({ extendShape: extendShape, extendPath: extendPath, makePath: makePath, makeImage: makeImage, mergePath: mergePath, resizePath: resizePath, subPixelOptimizeLine: subPixelOptimizeLine, subPixelOptimizeRect: subPixelOptimizeRect, subPixelOptimize: subPixelOptimize, setHoverStyle: setHoverStyle, setLabelStyle: setLabelStyle, setTextStyle: setTextStyle, setText: setText, getFont: getFont, updateProps: updateProps, initProps: initProps, getTransform: getTransform, applyTransform: applyTransform$1, transformDirection: transformDirection, groupTransition: groupTransition, clipPointsByRect: clipPointsByRect, clipRectByRect: clipRectByRect, createIcon: createIcon, Group: Group, Image: ZImage, Text: Text, Circle: Circle, Sector: Sector, Ring: Ring, Polygon: Polygon, Polyline: Polyline, Rect: Rect, Line: Line, BezierCurve: BezierCurve, Arc: Arc, IncrementalDisplayable: IncrementalDisplayble, CompoundPath: CompoundPath, LinearGradient: LinearGradient, RadialGradient: RadialGradient, BoundingRect: BoundingRect }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var PATH_COLOR = ['textStyle', 'color']; var textStyleMixin = { /** * Get color property or get color from option.textStyle.color * @param {boolean} [isEmphasis] * @return {string} */ getTextColor: function (isEmphasis) { var ecModel = this.ecModel; return this.getShallow('color') || ( (!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null ); }, /** * Create font string from fontStyle, fontWeight, fontSize, fontFamily * @return {string} */ getFont: function () { return getFont({ fontStyle: this.getShallow('fontStyle'), fontWeight: this.getShallow('fontWeight'), fontSize: this.getShallow('fontSize'), fontFamily: this.getShallow('fontFamily') }, this.ecModel); }, getTextRect: function (text) { return getBoundingRect( text, this.getFont(), this.getShallow('align'), this.getShallow('verticalAlign') || this.getShallow('baseline'), this.getShallow('padding'), this.getShallow('rich'), this.getShallow('truncateText') ); } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var getItemStyle = makeStyleMapper( [ ['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['textPosition'], ['textAlign'] ] ); var itemStyleMixin = { getItemStyle: function (excludes, includes) { var style = getItemStyle(this, excludes, includes); var lineDash = this.getBorderLineDash(); lineDash && (style.lineDash = lineDash); return style; }, getBorderLineDash: function () { var lineType = this.get('borderType'); return (lineType === 'solid' || lineType == null) ? null : (lineType === 'dashed' ? [5, 5] : [1, 1]); } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @module echarts/model/Model */ var mixin$1 = mixin; var inner = makeInner(); /** * @alias module:echarts/model/Model * @constructor * @param {Object} option * @param {module:echarts/model/Model} [parentModel] * @param {module:echarts/model/Global} [ecModel] */ function Model(option, parentModel, ecModel) { /** * @type {module:echarts/model/Model} * @readOnly */ this.parentModel = parentModel; /** * @type {module:echarts/model/Global} * @readOnly */ this.ecModel = ecModel; /** * @type {Object} * @protected */ this.option = option; // Simple optimization // if (this.init) { // if (arguments.length <= 4) { // this.init(option, parentModel, ecModel, extraOpt); // } // else { // this.init.apply(this, arguments); // } // } } Model.prototype = { constructor: Model, /** * Model 的初始化函数 * @param {Object} option */ init: null, /** * 从新的 Option merge */ mergeOption: function (option) { merge(this.option, option, true); }, /** * @param {string|Array.} path * @param {boolean} [ignoreParent=false] * @return {*} */ get: function (path, ignoreParent) { if (path == null) { return this.option; } return doGet( this.option, this.parsePath(path), !ignoreParent && getParent(this, path) ); }, /** * @param {string} key * @param {boolean} [ignoreParent=false] * @return {*} */ getShallow: function (key, ignoreParent) { var option = this.option; var val = option == null ? option : option[key]; var parentModel = !ignoreParent && getParent(this, key); if (val == null && parentModel) { val = parentModel.getShallow(key); } return val; }, /** * @param {string|Array.} [path] * @param {module:echarts/model/Model} [parentModel] * @return {module:echarts/model/Model} */ getModel: function (path, parentModel) { var obj = path == null ? this.option : doGet(this.option, path = this.parsePath(path)); var thisParentModel; parentModel = parentModel || ( (thisParentModel = getParent(this, path)) && thisParentModel.getModel(path) ); return new Model(obj, parentModel, this.ecModel); }, /** * If model has option */ isEmpty: function () { return this.option == null; }, restoreData: function () {}, // Pending clone: function () { var Ctor = this.constructor; return new Ctor(clone(this.option)); }, setReadOnly: function (properties) { // clazzUtil.setReadOnly(this, properties); }, // If path is null/undefined, return null/undefined. parsePath: function(path) { if (typeof path === 'string') { path = path.split('.'); } return path; }, /** * @param {Function} getParentMethod * param {Array.|string} path * return {module:echarts/model/Model} */ customizeGetParent: function (getParentMethod) { inner(this).getParent = getParentMethod; }, isAnimationEnabled: function () { if (!env$1.node) { if (this.option.animation != null) { return !!this.option.animation; } else if (this.parentModel) { return this.parentModel.isAnimationEnabled(); } } } }; function doGet(obj, pathArr, parentModel) { for (var i = 0; i < pathArr.length; i++) { // Ignore empty if (!pathArr[i]) { continue; } // obj could be number/string/... (like 0) obj = (obj && typeof obj === 'object') ? obj[pathArr[i]] : null; if (obj == null) { break; } } if (obj == null && parentModel) { obj = parentModel.get(pathArr); } return obj; } // `path` can be null/undefined function getParent(model, path) { var getParentMethod = inner(model).getParent; return getParentMethod ? getParentMethod.call(model, path) : model.parentModel; } // Enable Model.extend. enableClassExtend(Model); enableClassCheck(Model); mixin$1(Model, lineStyleMixin); mixin$1(Model, areaStyleMixin); mixin$1(Model, textStyleMixin); mixin$1(Model, itemStyleMixin); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var base = 0; /** * @public * @param {string} type * @return {string} */ function getUID(type) { // Considering the case of crossing js context, // use Math.random to make id as unique as possible. return [(type || ''), base++, Math.random().toFixed(5)].join('_'); } /** * @inner */ function enableSubTypeDefaulter(entity) { var subTypeDefaulters = {}; entity.registerSubTypeDefaulter = function (componentType, defaulter) { componentType = parseClassType$1(componentType); subTypeDefaulters[componentType.main] = defaulter; }; entity.determineSubType = function (componentType, option) { var type = option.type; if (!type) { var componentTypeMain = parseClassType$1(componentType).main; if (entity.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) { type = subTypeDefaulters[componentTypeMain](option); } } return type; }; return entity; } /** * Topological travel on Activity Network (Activity On Vertices). * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis']. * * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology. * * If there is circle dependencey, Error will be thrown. * */ function enableTopologicalTravel(entity, dependencyGetter) { /** * @public * @param {Array.} targetNameList Target Component type list. * Can be ['aa', 'bb', 'aa.xx'] * @param {Array.} fullNameList By which we can build dependency graph. * @param {Function} callback Params: componentType, dependencies. * @param {Object} context Scope of callback. */ entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) { if (!targetNameList.length) { return; } var result = makeDepndencyGraph(fullNameList); var graph = result.graph; var stack = result.noEntryList; var targetNameSet = {}; each$1(targetNameList, function (name) { targetNameSet[name] = true; }); while (stack.length) { var currComponentType = stack.pop(); var currVertex = graph[currComponentType]; var isInTargetNameSet = !!targetNameSet[currComponentType]; if (isInTargetNameSet) { callback.call(context, currComponentType, currVertex.originalDeps.slice()); delete targetNameSet[currComponentType]; } each$1( currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge ); } each$1(targetNameSet, function () { throw new Error('Circle dependency may exists'); }); function removeEdge(succComponentType) { graph[succComponentType].entryCount--; if (graph[succComponentType].entryCount === 0) { stack.push(succComponentType); } } // Consider this case: legend depends on series, and we call // chart.setOption({series: [...]}), where only series is in option. // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will // not be called, but only sereis.mergeOption is called. Thus legend // have no chance to update its local record about series (like which // name of series is available in legend). function removeEdgeAndAdd(succComponentType) { targetNameSet[succComponentType] = true; removeEdge(succComponentType); } }; /** * DepndencyGraph: {Object} * key: conponentType, * value: { * successor: [conponentTypes...], * originalDeps: [conponentTypes...], * entryCount: {number} * } */ function makeDepndencyGraph(fullNameList) { var graph = {}; var noEntryList = []; each$1(fullNameList, function (name) { var thisItem = createDependencyGraphItem(graph, name); var originalDeps = thisItem.originalDeps = dependencyGetter(name); var availableDeps = getAvailableDependencies(originalDeps, fullNameList); thisItem.entryCount = availableDeps.length; if (thisItem.entryCount === 0) { noEntryList.push(name); } each$1(availableDeps, function (dependentName) { if (indexOf(thisItem.predecessor, dependentName) < 0) { thisItem.predecessor.push(dependentName); } var thatItem = createDependencyGraphItem(graph, dependentName); if (indexOf(thatItem.successor, dependentName) < 0) { thatItem.successor.push(name); } }); }); return {graph: graph, noEntryList: noEntryList}; } function createDependencyGraphItem(graph, name) { if (!graph[name]) { graph[name] = {predecessor: [], successor: []}; } return graph[name]; } function getAvailableDependencies(originalDeps, fullNameList) { var availableDeps = []; each$1(originalDeps, function (dep) { indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep); }); return availableDeps; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var RADIAN_EPSILON = 1e-4; function _trim(str) { return str.replace(/^\s+/, '').replace(/\s+$/, ''); } /** * Linear mapping a value from domain to range * @memberOf module:echarts/util/number * @param {(number|Array.)} val * @param {Array.} domain Domain extent domain[0] can be bigger than domain[1] * @param {Array.} range Range extent range[0] can be bigger than range[1] * @param {boolean} clamp * @return {(number|Array.} */ function linearMap(val, domain, range, clamp) { var subDomain = domain[1] - domain[0]; var subRange = range[1] - range[0]; if (subDomain === 0) { return subRange === 0 ? range[0] : (range[0] + range[1]) / 2; } // Avoid accuracy problem in edge, such as // 146.39 - 62.83 === 83.55999999999999. // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError // It is a little verbose for efficiency considering this method // is a hotspot. if (clamp) { if (subDomain > 0) { if (val <= domain[0]) { return range[0]; } else if (val >= domain[1]) { return range[1]; } } else { if (val >= domain[0]) { return range[0]; } else if (val <= domain[1]) { return range[1]; } } } else { if (val === domain[0]) { return range[0]; } if (val === domain[1]) { return range[1]; } } return (val - domain[0]) / subDomain * subRange + range[0]; } /** * Convert a percent string to absolute number. * Returns NaN if percent is not a valid string or number * @memberOf module:echarts/util/number * @param {string|number} percent * @param {number} all * @return {number} */ function parsePercent$1(percent, all) { switch (percent) { case 'center': case 'middle': percent = '50%'; break; case 'left': case 'top': percent = '0%'; break; case 'right': case 'bottom': percent = '100%'; break; } if (typeof percent === 'string') { if (_trim(percent).match(/%$/)) { return parseFloat(percent) / 100 * all; } return parseFloat(percent); } return percent == null ? NaN : +percent; } /** * (1) Fix rounding error of float numbers. * (2) Support return string to avoid scientific notation like '3.5e-7'. * * @param {number} x * @param {number} [precision] * @param {boolean} [returnStr] * @return {number|string} */ function round$1(x, precision, returnStr) { if (precision == null) { precision = 10; } // Avoid range error precision = Math.min(Math.max(0, precision), 20); x = (+x).toFixed(precision); return returnStr ? x : +x; } function asc(arr) { arr.sort(function (a, b) { return a - b; }); return arr; } /** * Get precision * @param {number} val */ function getPrecision(val) { val = +val; if (isNaN(val)) { return 0; } // It is much faster than methods converting number to string as follows // var tmp = val.toString(); // return tmp.length - 1 - tmp.indexOf('.'); // especially when precision is low var e = 1; var count = 0; while (Math.round(val * e) / e !== val) { e *= 10; count++; } return count; } /** * @param {string|number} val * @return {number} */ function getPrecisionSafe(val) { var str = val.toString(); // Consider scientific notation: '3.4e-12' '3.4e+12' var eIndex = str.indexOf('e'); if (eIndex > 0) { var precision = +str.slice(eIndex + 1); return precision < 0 ? -precision : 0; } else { var dotIndex = str.indexOf('.'); return dotIndex < 0 ? 0 : str.length - 1 - dotIndex; } } /** * Minimal dicernible data precisioin according to a single pixel. * * @param {Array.} dataExtent * @param {Array.} pixelExtent * @return {number} precision */ function getPixelPrecision(dataExtent, pixelExtent) { var log = Math.log; var LN10 = Math.LN10; var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10); var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10); // toFixed() digits argument must be between 0 and 20. var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20); return !isFinite(precision) ? 20 : precision; } /** * Get a data of given precision, assuring the sum of percentages * in valueList is 1. * The largest remainer method is used. * https://en.wikipedia.org/wiki/Largest_remainder_method * * @param {Array.} valueList a list of all data * @param {number} idx index of the data to be processed in valueList * @param {number} precision integer number showing digits of precision * @return {number} percent ranging from 0 to 100 */ function getPercentWithPrecision(valueList, idx, precision) { if (!valueList[idx]) { return 0; } var sum = reduce(valueList, function (acc, val) { return acc + (isNaN(val) ? 0 : val); }, 0); if (sum === 0) { return 0; } var digits = Math.pow(10, precision); var votesPerQuota = map(valueList, function (val) { return (isNaN(val) ? 0 : val) / sum * digits * 100; }); var targetSeats = digits * 100; var seats = map(votesPerQuota, function (votes) { // Assign automatic seats. return Math.floor(votes); }); var currentSum = reduce(seats, function (acc, val) { return acc + val; }, 0); var remainder = map(votesPerQuota, function (votes, idx) { return votes - seats[idx]; }); // Has remainding votes. while (currentSum < targetSeats) { // Find next largest remainder. var max = Number.NEGATIVE_INFINITY; var maxId = null; for (var i = 0, len = remainder.length; i < len; ++i) { if (remainder[i] > max) { max = remainder[i]; maxId = i; } } // Add a vote to max remainder. ++seats[maxId]; remainder[maxId] = 0; ++currentSum; } return seats[idx] / digits; } // Number.MAX_SAFE_INTEGER, ie do not support. var MAX_SAFE_INTEGER = 9007199254740991; /** * To 0 - 2 * PI, considering negative radian. * @param {number} radian * @return {number} */ function remRadian(radian) { var pi2 = Math.PI * 2; return (radian % pi2 + pi2) % pi2; } /** * @param {type} radian * @return {boolean} */ function isRadianAroundZero(val) { return val > -RADIAN_EPSILON && val < RADIAN_EPSILON; } var TIME_REG = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/; // jshint ignore:line /** * @param {string|Date|number} value These values can be accepted: * + An instance of Date, represent a time in its own time zone. * + Or string in a subset of ISO 8601, only including: * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06', * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123', * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00', * all of which will be treated as local time if time zone is not specified * (see ). * + Or other string format, including (all of which will be treated as loacal time): * '2012', '2012-3-1', '2012/3/1', '2012/03/01', * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123' * + a timestamp, which represent a time in UTC. * @return {Date} date */ function parseDate(value) { if (value instanceof Date) { return value; } else if (typeof value === 'string') { // Different browsers parse date in different way, so we parse it manually. // Some other issues: // new Date('1970-01-01') is UTC, // new Date('1970/01/01') and new Date('1970-1-01') is local. // See issue #3623 var match = TIME_REG.exec(value); if (!match) { // return Invalid Date. return new Date(NaN); } // Use local time when no timezone offset specifed. if (!match[8]) { // match[n] can only be string or undefined. // But take care of '12' + 1 => '121'. return new Date( +match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, +match[7] || 0 ); } // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time, // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment). // For example, system timezone is set as "Time Zone: America/Toronto", // then these code will get different result: // `new Date(1478411999999).getTimezoneOffset(); // get 240` // `new Date(1478412000000).getTimezoneOffset(); // get 300` // So we should not use `new Date`, but use `Date.UTC`. else { var hour = +match[4] || 0; if (match[8].toUpperCase() !== 'Z') { hour -= match[8].slice(0, 3); } return new Date(Date.UTC( +match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, +match[7] || 0 )); } } else if (value == null) { return new Date(NaN); } return new Date(Math.round(value)); } /** * Quantity of a number. e.g. 0.1, 1, 10, 100 * * @param {number} val * @return {number} */ function quantity(val) { return Math.pow(10, quantityExponent(val)); } function quantityExponent(val) { return Math.floor(Math.log(val) / Math.LN10); } /** * find a “nice” number approximately equal to x. Round the number if round = true, * take ceiling if round = false. The primary observation is that the “nicest” * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers. * * See "Nice Numbers for Graph Labels" of Graphic Gems. * * @param {number} val Non-negative value. * @param {boolean} round * @return {number} */ function nice(val, round) { var exponent = quantityExponent(val); var exp10 = Math.pow(10, exponent); var f = val / exp10; // 1 <= f < 10 var nf; if (round) { if (f < 1.5) { nf = 1; } else if (f < 2.5) { nf = 2; } else if (f < 4) { nf = 3; } else if (f < 7) { nf = 5; } else { nf = 10; } } else { if (f < 1) { nf = 1; } else if (f < 2) { nf = 2; } else if (f < 3) { nf = 3; } else if (f < 5) { nf = 5; } else { nf = 10; } } val = nf * exp10; // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754). // 20 is the uppper bound of toFixed. return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val; } /** * Order intervals asc, and split them when overlap. * expect(numberUtil.reformIntervals([ * {interval: [18, 62], close: [1, 1]}, * {interval: [-Infinity, -70], close: [0, 0]}, * {interval: [-70, -26], close: [1, 1]}, * {interval: [-26, 18], close: [1, 1]}, * {interval: [62, 150], close: [1, 1]}, * {interval: [106, 150], close: [1, 1]}, * {interval: [150, Infinity], close: [0, 0]} * ])).toEqual([ * {interval: [-Infinity, -70], close: [0, 0]}, * {interval: [-70, -26], close: [1, 1]}, * {interval: [-26, 18], close: [0, 1]}, * {interval: [18, 62], close: [0, 1]}, * {interval: [62, 150], close: [0, 1]}, * {interval: [150, Infinity], close: [0, 0]} * ]); * @param {Array.} list, where `close` mean open or close * of the interval, and Infinity can be used. * @return {Array.} The origin list, which has been reformed. */ function reformIntervals(list) { list.sort(function (a, b) { return littleThan(a, b, 0) ? -1 : 1; }); var curr = -Infinity; var currClose = 1; for (var i = 0; i < list.length;) { var interval = list[i].interval; var close = list[i].close; for (var lg = 0; lg < 2; lg++) { if (interval[lg] <= curr) { interval[lg] = curr; close[lg] = !lg ? 1 - currClose : 1; } curr = interval[lg]; currClose = close[lg]; } if (interval[0] === interval[1] && close[0] * close[1] !== 1) { list.splice(i, 1); } else { i++; } } return list; function littleThan(a, b, lg) { return a.interval[lg] < b.interval[lg] || ( a.interval[lg] === b.interval[lg] && ( (a.close[lg] - b.close[lg] === (!lg ? 1 : -1)) || (!lg && littleThan(a, b, 1)) ) ); } } /** * parseFloat NaNs numeric-cast false positives (null|true|false|"") * ...but misinterprets leading-number strings, particularly hex literals ("0x...") * subtraction forces infinities to NaN * * @param {*} v * @return {boolean} */ function isNumeric(v) { return v - parseFloat(v) >= 0; } var number = (Object.freeze || Object)({ linearMap: linearMap, parsePercent: parsePercent$1, round: round$1, asc: asc, getPrecision: getPrecision, getPrecisionSafe: getPrecisionSafe, getPixelPrecision: getPixelPrecision, getPercentWithPrecision: getPercentWithPrecision, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER, remRadian: remRadian, isRadianAroundZero: isRadianAroundZero, parseDate: parseDate, quantity: quantity, nice: nice, reformIntervals: reformIntervals, isNumeric: isNumeric }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * 每三位默认加,格式化 * @param {string|number} x * @return {string} */ function addCommas(x) { if (isNaN(x)) { return '-'; } x = (x + '').split('.'); return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,'$1,') + (x.length > 1 ? ('.' + x[1]) : ''); } /** * @param {string} str * @param {boolean} [upperCaseFirst=false] * @return {string} str */ function toCamelCase(str, upperCaseFirst) { str = (str || '').toLowerCase().replace(/-(.)/g, function(match, group1) { return group1.toUpperCase(); }); if (upperCaseFirst && str) { str = str.charAt(0).toUpperCase() + str.slice(1); } return str; } var normalizeCssArray$1 = normalizeCssArray; var replaceReg = /([&<>"'])/g; var replaceMap = { '&': '&', '<': '<', '>': '>', '"': '"', '\'': ''' }; function encodeHTML(source) { return source == null ? '' : (source + '').replace(replaceReg, function (str, c) { return replaceMap[c]; }); } var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g']; var wrapVar = function (varName, seriesIdx) { return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}'; }; /** * Template formatter * @param {string} tpl * @param {Array.|Object} paramsList * @param {boolean} [encode=false] * @return {string} */ function formatTpl(tpl, paramsList, encode) { if (!isArray(paramsList)) { paramsList = [paramsList]; } var seriesLen = paramsList.length; if (!seriesLen) { return ''; } var $vars = paramsList[0].$vars || []; for (var i = 0; i < $vars.length; i++) { var alias = TPL_VAR_ALIAS[i]; tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0)); } for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) { for (var k = 0; k < $vars.length; k++) { var val = paramsList[seriesIdx][$vars[k]]; tpl = tpl.replace( wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val ); } } return tpl; } /** * simple Template formatter * * @param {string} tpl * @param {Object} param * @param {boolean} [encode=false] * @return {string} */ function formatTplSimple(tpl, param, encode) { each$1(param, function (value, key) { tpl = tpl.replace( '{' + key + '}', encode ? encodeHTML(value) : value ); }); return tpl; } /** * @param {Object|string} [opt] If string, means color. * @param {string} [opt.color] * @param {string} [opt.extraCssText] * @param {string} [opt.type='item'] 'item' or 'subItem' * @return {string} */ function getTooltipMarker(opt, extraCssText) { opt = isString(opt) ? {color: opt, extraCssText: extraCssText} : (opt || {}); var color = opt.color; var type = opt.type; var extraCssText = opt.extraCssText; if (!color) { return ''; } return type === 'subItem' ? '' : ''; } function pad(str, len) { str += ''; return '0000'.substr(0, len - str.length) + str; } /** * ISO Date format * @param {string} tpl * @param {number} value * @param {boolean} [isUTC=false] Default in local time. * see `module:echarts/scale/Time` * and `module:echarts/util/number#parseDate`. * @inner */ function formatTime(tpl, value, isUTC) { if (tpl === 'week' || tpl === 'month' || tpl === 'quarter' || tpl === 'half-year' || tpl === 'year' ) { tpl = 'MM-dd\nyyyy'; } var date = parseDate(value); var utc = isUTC ? 'UTC' : ''; var y = date['get' + utc + 'FullYear'](); var M = date['get' + utc + 'Month']() + 1; var d = date['get' + utc + 'Date'](); var h = date['get' + utc + 'Hours'](); var m = date['get' + utc + 'Minutes'](); var s = date['get' + utc + 'Seconds'](); var S = date['get' + utc + 'Milliseconds'](); tpl = tpl.replace('MM', pad(M, 2)) .replace('M', M) .replace('yyyy', y) .replace('yy', y % 100) .replace('dd', pad(d, 2)) .replace('d', d) .replace('hh', pad(h, 2)) .replace('h', h) .replace('mm', pad(m, 2)) .replace('m', m) .replace('ss', pad(s, 2)) .replace('s', s) .replace('SSS', pad(S, 3)); return tpl; } /** * Capital first * @param {string} str * @return {string} */ function capitalFirst(str) { return str ? str.charAt(0).toUpperCase() + str.substr(1) : str; } var truncateText$1 = truncateText; var getTextRect = getBoundingRect; var format = (Object.freeze || Object)({ addCommas: addCommas, toCamelCase: toCamelCase, normalizeCssArray: normalizeCssArray$1, encodeHTML: encodeHTML, formatTpl: formatTpl, formatTplSimple: formatTplSimple, getTooltipMarker: getTooltipMarker, formatTime: formatTime, capitalFirst: capitalFirst, truncateText: truncateText$1, getTextRect: getTextRect }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Layout helpers for each component positioning var each$3 = each$1; /** * @public */ var LOCATION_PARAMS = [ 'left', 'right', 'top', 'bottom', 'width', 'height' ]; /** * @public */ var HV_NAMES = [ ['width', 'left', 'right'], ['height', 'top', 'bottom'] ]; function boxLayout(orient, group, gap, maxWidth, maxHeight) { var x = 0; var y = 0; if (maxWidth == null) { maxWidth = Infinity; } if (maxHeight == null) { maxHeight = Infinity; } var currentLineMaxSize = 0; group.eachChild(function (child, idx) { var position = child.position; var rect = child.getBoundingRect(); var nextChild = group.childAt(idx + 1); var nextChildRect = nextChild && nextChild.getBoundingRect(); var nextX; var nextY; if (orient === 'horizontal') { var moveX = rect.width + (nextChildRect ? (-nextChildRect.x + rect.x) : 0); nextX = x + moveX; // Wrap when width exceeds maxWidth or meet a `newline` group // FIXME compare before adding gap? if (nextX > maxWidth || child.newline) { x = 0; nextX = moveX; y += currentLineMaxSize + gap; currentLineMaxSize = rect.height; } else { // FIXME: consider rect.y is not `0`? currentLineMaxSize = Math.max(currentLineMaxSize, rect.height); } } else { var moveY = rect.height + (nextChildRect ? (-nextChildRect.y + rect.y) : 0); nextY = y + moveY; // Wrap when width exceeds maxHeight or meet a `newline` group if (nextY > maxHeight || child.newline) { x += currentLineMaxSize + gap; y = 0; nextY = moveY; currentLineMaxSize = rect.width; } else { currentLineMaxSize = Math.max(currentLineMaxSize, rect.width); } } if (child.newline) { return; } position[0] = x; position[1] = y; orient === 'horizontal' ? (x = nextX + gap) : (y = nextY + gap); }); } /** * VBox or HBox layouting * @param {string} orient * @param {module:zrender/container/Group} group * @param {number} gap * @param {number} [width=Infinity] * @param {number} [height=Infinity] */ var box = boxLayout; /** * VBox layouting * @param {module:zrender/container/Group} group * @param {number} gap * @param {number} [width=Infinity] * @param {number} [height=Infinity] */ var vbox = curry(boxLayout, 'vertical'); /** * HBox layouting * @param {module:zrender/container/Group} group * @param {number} gap * @param {number} [width=Infinity] * @param {number} [height=Infinity] */ var hbox = curry(boxLayout, 'horizontal'); /** * If x or x2 is not specified or 'center' 'left' 'right', * the width would be as long as possible. * If y or y2 is not specified or 'middle' 'top' 'bottom', * the height would be as long as possible. * * @param {Object} positionInfo * @param {number|string} [positionInfo.x] * @param {number|string} [positionInfo.y] * @param {number|string} [positionInfo.x2] * @param {number|string} [positionInfo.y2] * @param {Object} containerRect {width, height} * @param {string|number} margin * @return {Object} {width, height} */ function getAvailableSize(positionInfo, containerRect, margin) { var containerWidth = containerRect.width; var containerHeight = containerRect.height; var x = parsePercent$1(positionInfo.x, containerWidth); var y = parsePercent$1(positionInfo.y, containerHeight); var x2 = parsePercent$1(positionInfo.x2, containerWidth); var y2 = parsePercent$1(positionInfo.y2, containerHeight); (isNaN(x) || isNaN(parseFloat(positionInfo.x))) && (x = 0); (isNaN(x2) || isNaN(parseFloat(positionInfo.x2))) && (x2 = containerWidth); (isNaN(y) || isNaN(parseFloat(positionInfo.y))) && (y = 0); (isNaN(y2) || isNaN(parseFloat(positionInfo.y2))) && (y2 = containerHeight); margin = normalizeCssArray$1(margin || 0); return { width: Math.max(x2 - x - margin[1] - margin[3], 0), height: Math.max(y2 - y - margin[0] - margin[2], 0) }; } /** * Parse position info. * * @param {Object} positionInfo * @param {number|string} [positionInfo.left] * @param {number|string} [positionInfo.top] * @param {number|string} [positionInfo.right] * @param {number|string} [positionInfo.bottom] * @param {number|string} [positionInfo.width] * @param {number|string} [positionInfo.height] * @param {number|string} [positionInfo.aspect] Aspect is width / height * @param {Object} containerRect * @param {string|number} [margin] * * @return {module:zrender/core/BoundingRect} */ function getLayoutRect( positionInfo, containerRect, margin ) { margin = normalizeCssArray$1(margin || 0); var containerWidth = containerRect.width; var containerHeight = containerRect.height; var left = parsePercent$1(positionInfo.left, containerWidth); var top = parsePercent$1(positionInfo.top, containerHeight); var right = parsePercent$1(positionInfo.right, containerWidth); var bottom = parsePercent$1(positionInfo.bottom, containerHeight); var width = parsePercent$1(positionInfo.width, containerWidth); var height = parsePercent$1(positionInfo.height, containerHeight); var verticalMargin = margin[2] + margin[0]; var horizontalMargin = margin[1] + margin[3]; var aspect = positionInfo.aspect; // If width is not specified, calculate width from left and right if (isNaN(width)) { width = containerWidth - right - horizontalMargin - left; } if (isNaN(height)) { height = containerHeight - bottom - verticalMargin - top; } if (aspect != null) { // If width and height are not given // 1. Graph should not exceeds the container // 2. Aspect must be keeped // 3. Graph should take the space as more as possible // FIXME // Margin is not considered, because there is no case that both // using margin and aspect so far. if (isNaN(width) && isNaN(height)) { if (aspect > containerWidth / containerHeight) { width = containerWidth * 0.8; } else { height = containerHeight * 0.8; } } // Calculate width or height with given aspect if (isNaN(width)) { width = aspect * height; } if (isNaN(height)) { height = width / aspect; } } // If left is not specified, calculate left from right and width if (isNaN(left)) { left = containerWidth - right - width - horizontalMargin; } if (isNaN(top)) { top = containerHeight - bottom - height - verticalMargin; } // Align left and top switch (positionInfo.left || positionInfo.right) { case 'center': left = containerWidth / 2 - width / 2 - margin[3]; break; case 'right': left = containerWidth - width - horizontalMargin; break; } switch (positionInfo.top || positionInfo.bottom) { case 'middle': case 'center': top = containerHeight / 2 - height / 2 - margin[0]; break; case 'bottom': top = containerHeight - height - verticalMargin; break; } // If something is wrong and left, top, width, height are calculated as NaN left = left || 0; top = top || 0; if (isNaN(width)) { // Width may be NaN if only one value is given except width width = containerWidth - horizontalMargin - left - (right || 0); } if (isNaN(height)) { // Height may be NaN if only one value is given except height height = containerHeight - verticalMargin - top - (bottom || 0); } var rect = new BoundingRect(left + margin[3], top + margin[0], width, height); rect.margin = margin; return rect; } /** * Position a zr element in viewport * Group position is specified by either * {left, top}, {right, bottom} * If all properties exists, right and bottom will be igonred. * * Logic: * 1. Scale (against origin point in parent coord) * 2. Rotate (against origin point in parent coord) * 3. Traslate (with el.position by this method) * So this method only fixes the last step 'Traslate', which does not affect * scaling and rotating. * * If be called repeatly with the same input el, the same result will be gotten. * * @param {module:zrender/Element} el Should have `getBoundingRect` method. * @param {Object} positionInfo * @param {number|string} [positionInfo.left] * @param {number|string} [positionInfo.top] * @param {number|string} [positionInfo.right] * @param {number|string} [positionInfo.bottom] * @param {number|string} [positionInfo.width] Only for opt.boundingModel: 'raw' * @param {number|string} [positionInfo.height] Only for opt.boundingModel: 'raw' * @param {Object} containerRect * @param {string|number} margin * @param {Object} [opt] * @param {Array.} [opt.hv=[1,1]] Only horizontal or only vertical. * @param {Array.} [opt.boundingMode='all'] * Specify how to calculate boundingRect when locating. * 'all': Position the boundingRect that is transformed and uioned * both itself and its descendants. * This mode simplies confine the elements in the bounding * of their container (e.g., using 'right: 0'). * 'raw': Position the boundingRect that is not transformed and only itself. * This mode is useful when you want a element can overflow its * container. (Consider a rotated circle needs to be located in a corner.) * In this mode positionInfo.width/height can only be number. */ function positionElement(el, positionInfo, containerRect, margin, opt) { var h = !opt || !opt.hv || opt.hv[0]; var v = !opt || !opt.hv || opt.hv[1]; var boundingMode = opt && opt.boundingMode || 'all'; if (!h && !v) { return; } var rect; if (boundingMode === 'raw') { rect = el.type === 'group' ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect(); } else { rect = el.getBoundingRect(); if (el.needLocalTransform()) { var transform = el.getLocalTransform(); // Notice: raw rect may be inner object of el, // which should not be modified. rect = rect.clone(); rect.applyTransform(transform); } } // The real width and height can not be specified but calculated by the given el. positionInfo = getLayoutRect( defaults( {width: rect.width, height: rect.height}, positionInfo ), containerRect, margin ); // Because 'tranlate' is the last step in transform // (see zrender/core/Transformable#getLocalTransform), // we can just only modify el.position to get final result. var elPos = el.position; var dx = h ? positionInfo.x - rect.x : 0; var dy = v ? positionInfo.y - rect.y : 0; el.attr('position', boundingMode === 'raw' ? [dx, dy] : [elPos[0] + dx, elPos[1] + dy]); } /** * @param {Object} option Contains some of the properties in HV_NAMES. * @param {number} hvIdx 0: horizontal; 1: vertical. */ function sizeCalculable(option, hvIdx) { return option[HV_NAMES[hvIdx][0]] != null || (option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null); } /** * Consider Case: * When defulat option has {left: 0, width: 100}, and we set {right: 0} * through setOption or media query, using normal zrUtil.merge will cause * {right: 0} does not take effect. * * @example * ComponentModel.extend({ * init: function () { * ... * var inputPositionParams = layout.getLayoutParams(option); * this.mergeOption(inputPositionParams); * }, * mergeOption: function (newOption) { * newOption && zrUtil.merge(thisOption, newOption, true); * layout.mergeLayoutParam(thisOption, newOption); * } * }); * * @param {Object} targetOption * @param {Object} newOption * @param {Object|string} [opt] * @param {boolean|Array.} [opt.ignoreSize=false] Used for the components * that width (or height) should not be calculated by left and right (or top and bottom). */ function mergeLayoutParam(targetOption, newOption, opt) { !isObject$1(opt) && (opt = {}); var ignoreSize = opt.ignoreSize; !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]); var hResult = merge$$1(HV_NAMES[0], 0); var vResult = merge$$1(HV_NAMES[1], 1); copy(HV_NAMES[0], targetOption, hResult); copy(HV_NAMES[1], targetOption, vResult); function merge$$1(names, hvIdx) { var newParams = {}; var newValueCount = 0; var merged = {}; var mergedValueCount = 0; var enoughParamNumber = 2; each$3(names, function (name) { merged[name] = targetOption[name]; }); each$3(names, function (name) { // Consider case: newOption.width is null, which is // set by user for removing width setting. hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]); hasValue(newParams, name) && newValueCount++; hasValue(merged, name) && mergedValueCount++; }); if (ignoreSize[hvIdx]) { // Only one of left/right is premitted to exist. if (hasValue(newOption, names[1])) { merged[names[2]] = null; } else if (hasValue(newOption, names[2])) { merged[names[1]] = null; } return merged; } // Case: newOption: {width: ..., right: ...}, // or targetOption: {right: ...} and newOption: {width: ...}, // There is no conflict when merged only has params count // little than enoughParamNumber. if (mergedValueCount === enoughParamNumber || !newValueCount) { return merged; } // Case: newOption: {width: ..., right: ...}, // Than we can make sure user only want those two, and ignore // all origin params in targetOption. else if (newValueCount >= enoughParamNumber) { return newParams; } else { // Chose another param from targetOption by priority. for (var i = 0; i < names.length; i++) { var name = names[i]; if (!hasProp(newParams, name) && hasProp(targetOption, name)) { newParams[name] = targetOption[name]; break; } } return newParams; } } function hasProp(obj, name) { return obj.hasOwnProperty(name); } function hasValue(obj, name) { return obj[name] != null && obj[name] !== 'auto'; } function copy(names, target, source) { each$3(names, function (name) { target[name] = source[name]; }); } } /** * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object. * @param {Object} source * @return {Object} Result contains those props. */ function getLayoutParams(source) { return copyLayoutParams({}, source); } /** * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object. * @param {Object} source * @return {Object} Result contains those props. */ function copyLayoutParams(target, source) { source && target && each$3(LOCATION_PARAMS, function (name) { source.hasOwnProperty(name) && (target[name] = source[name]); }); return target; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var boxLayoutMixin = { getBoxLayoutParams: function () { return { left: this.get('left'), top: this.get('top'), right: this.get('right'), bottom: this.get('bottom'), width: this.get('width'), height: this.get('height') }; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Component model * * @module echarts/model/Component */ var inner$1 = makeInner(); /** * @alias module:echarts/model/Component * @constructor * @param {Object} option * @param {module:echarts/model/Model} parentModel * @param {module:echarts/model/Model} ecModel */ var ComponentModel = Model.extend({ type: 'component', /** * @readOnly * @type {string} */ id: '', /** * Because simplified concept is probably better, series.name (or component.name) * has been having too many resposibilities: * (1) Generating id (which requires name in option should not be modified). * (2) As an index to mapping series when merging option or calling API (a name * can refer to more then one components, which is convinient is some case). * (3) Display. * @readOnly */ name: '', /** * @readOnly * @type {string} */ mainType: '', /** * @readOnly * @type {string} */ subType: '', /** * @readOnly * @type {number} */ componentIndex: 0, /** * @type {Object} * @protected */ defaultOption: null, /** * @type {module:echarts/model/Global} * @readOnly */ ecModel: null, /** * key: componentType * value: Component model list, can not be null. * @type {Object.>} * @readOnly */ dependentModels: [], /** * @type {string} * @readOnly */ uid: null, /** * Support merge layout params. * Only support 'box' now (left/right/top/bottom/width/height). * @type {string|Object} Object can be {ignoreSize: true} * @readOnly */ layoutMode: null, $constructor: function (option, parentModel, ecModel, extraOpt) { Model.call(this, option, parentModel, ecModel, extraOpt); this.uid = getUID('ec_cpt_model'); }, init: function (option, parentModel, ecModel, extraOpt) { this.mergeDefaultAndTheme(option, ecModel); }, mergeDefaultAndTheme: function (option, ecModel) { var layoutMode = this.layoutMode; var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; var themeModel = ecModel.getTheme(); merge(option, themeModel.get(this.mainType)); merge(option, this.getDefaultOption()); if (layoutMode) { mergeLayoutParam(option, inputPositionParams, layoutMode); } }, mergeOption: function (option, extraOpt) { merge(this.option, option, true); var layoutMode = this.layoutMode; if (layoutMode) { mergeLayoutParam(this.option, option, layoutMode); } }, // Hooker after init or mergeOption optionUpdated: function (newCptOption, isInit) {}, getDefaultOption: function () { var fields = inner$1(this); if (!fields.defaultOption) { var optList = []; var Class = this.constructor; while (Class) { var opt = Class.prototype.defaultOption; opt && optList.push(opt); Class = Class.superClass; } var defaultOption = {}; for (var i = optList.length - 1; i >= 0; i--) { defaultOption = merge(defaultOption, optList[i], true); } fields.defaultOption = defaultOption; } return fields.defaultOption; }, getReferringComponents: function (mainType) { return this.ecModel.queryComponents({ mainType: mainType, index: this.get(mainType + 'Index', true), id: this.get(mainType + 'Id', true) }); } }); // Reset ComponentModel.extend, add preConstruct. // clazzUtil.enableClassExtend( // ComponentModel, // function (option, parentModel, ecModel, extraOpt) { // // Set dependentModels, componentIndex, name, id, mainType, subType. // zrUtil.extend(this, extraOpt); // this.uid = componentUtil.getUID('componentModel'); // // this.setReadOnly([ // // 'type', 'id', 'uid', 'name', 'mainType', 'subType', // // 'dependentModels', 'componentIndex' // // ]); // } // ); // Add capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on. enableClassManagement( ComponentModel, {registerWhenExtend: true} ); enableSubTypeDefaulter(ComponentModel); // Add capability of ComponentModel.topologicalTravel. enableTopologicalTravel(ComponentModel, getDependencies); function getDependencies(componentType) { var deps = []; each$1(ComponentModel.getClassesByMainType(componentType), function (Clazz) { deps = deps.concat(Clazz.prototype.dependencies || []); }); // Ensure main type. deps = map(deps, function (type) { return parseClassType$1(type).main; }); // Hack dataset for convenience. if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) { deps.unshift('dataset'); } return deps; } mixin(ComponentModel, boxLayoutMixin); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var platform = ''; // Navigator not exists in node if (typeof navigator !== 'undefined') { platform = navigator.platform || ''; } var globalDefault = { // backgroundColor: 'rgba(0,0,0,0)', // https://dribbble.com/shots/1065960-Infographic-Pie-chart-visualization // color: ['#5793f3', '#d14a61', '#fd9c35', '#675bba', '#fec42c', '#dd4444', '#d4df5a', '#cd4870'], // Light colors: // color: ['#bcd3bb', '#e88f70', '#edc1a5', '#9dc5c8', '#e1e8c8', '#7b7c68', '#e5b5b5', '#f0b489', '#928ea8', '#bda29a'], // color: ['#cc5664', '#9bd6ec', '#ea946e', '#8acaaa', '#f1ec64', '#ee8686', '#a48dc1', '#5da6bc', '#b9dcae'], // Dark colors: color: ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622', '#bda29a','#6e7074', '#546570', '#c4ccd3'], gradientColor: ['#f6efa6', '#d88273', '#bf444c'], // If xAxis and yAxis declared, grid is created by default. // grid: {}, textStyle: { // color: '#000', // decoration: 'none', // PENDING fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif', // fontFamily: 'Arial, Verdana, sans-serif', fontSize: 12, fontStyle: 'normal', fontWeight: 'normal' }, // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/ // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation // Default is source-over blendMode: null, animation: 'auto', animationDuration: 1000, animationDurationUpdate: 300, animationEasing: 'exponentialOut', animationEasingUpdate: 'cubicOut', animationThreshold: 2000, // Configuration for progressive/incremental rendering progressiveThreshold: 3000, progressive: 400, // Threshold of if use single hover layer to optimize. // It is recommended that `hoverLayerThreshold` is equivalent to or less than // `progressiveThreshold`, otherwise hover will cause restart of progressive, // which is unexpected. // see example . hoverLayerThreshold: 3000, // See: module:echarts/scale/Time useUTC: false }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var inner$2 = makeInner(); function getNearestColorPalette(colors, requestColorNum) { var paletteNum = colors.length; // TODO colors must be in order for (var i = 0; i < paletteNum; i++) { if (colors[i].length > requestColorNum) { return colors[i]; } } return colors[paletteNum - 1]; } var colorPaletteMixin = { clearColorPalette: function () { inner$2(this).colorIdx = 0; inner$2(this).colorNameMap = {}; }, /** * @param {string} name MUST NOT be null/undefined. Otherwise call this function * twise with the same parameters will get different result. * @param {Object} [scope=this] * @param {Object} [requestColorNum] * @return {string} color string. */ getColorFromPalette: function (name, scope, requestColorNum) { scope = scope || this; var scopeFields = inner$2(scope); var colorIdx = scopeFields.colorIdx || 0; var colorNameMap = scopeFields.colorNameMap = scopeFields.colorNameMap || {}; // Use `hasOwnProperty` to avoid conflict with Object.prototype. if (colorNameMap.hasOwnProperty(name)) { return colorNameMap[name]; } var defaultColorPalette = normalizeToArray(this.get('color', true)); var layeredColorPalette = this.get('colorLayer', true); var colorPalette = ((requestColorNum == null || !layeredColorPalette) ? defaultColorPalette : getNearestColorPalette(layeredColorPalette, requestColorNum)); // In case can't find in layered color palette. colorPalette = colorPalette || defaultColorPalette; if (!colorPalette || !colorPalette.length) { return; } var color = colorPalette[colorIdx]; if (name) { colorNameMap[name] = color; } scopeFields.colorIdx = (colorIdx + 1) % colorPalette.length; return color; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Helper for model references. * There are many manners to refer axis/coordSys. */ // TODO // merge relevant logic to this file? // check: "modelHelper" of tooltip and "BrushTargetManager". /** * @return {Object} For example: * { * coordSysName: 'cartesian2d', * coordSysDims: ['x', 'y', ...], * axisMap: HashMap({ * x: xAxisModel, * y: yAxisModel * }), * categoryAxisMap: HashMap({ * x: xAxisModel, * y: undefined * }), * // It also indicate that whether there is category axis. * firstCategoryDimIndex: 1, * // To replace user specified encode. * } */ function getCoordSysDefineBySeries(seriesModel) { var coordSysName = seriesModel.get('coordinateSystem'); var result = { coordSysName: coordSysName, coordSysDims: [], axisMap: createHashMap(), categoryAxisMap: createHashMap() }; var fetch = fetchers[coordSysName]; if (fetch) { fetch(seriesModel, result, result.axisMap, result.categoryAxisMap); return result; } } var fetchers = { cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) { var xAxisModel = seriesModel.getReferringComponents('xAxis')[0]; var yAxisModel = seriesModel.getReferringComponents('yAxis')[0]; if (__DEV__) { if (!xAxisModel) { throw new Error('xAxis "' + retrieve( seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0 ) + '" not found'); } if (!yAxisModel) { throw new Error('yAxis "' + retrieve( seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0 ) + '" not found'); } } result.coordSysDims = ['x', 'y']; axisMap.set('x', xAxisModel); axisMap.set('y', yAxisModel); if (isCategory(xAxisModel)) { categoryAxisMap.set('x', xAxisModel); result.firstCategoryDimIndex = 0; } if (isCategory(yAxisModel)) { categoryAxisMap.set('y', yAxisModel); result.firstCategoryDimIndex = 1; } }, singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) { var singleAxisModel = seriesModel.getReferringComponents('singleAxis')[0]; if (__DEV__) { if (!singleAxisModel) { throw new Error('singleAxis should be specified.'); } } result.coordSysDims = ['single']; axisMap.set('single', singleAxisModel); if (isCategory(singleAxisModel)) { categoryAxisMap.set('single', singleAxisModel); result.firstCategoryDimIndex = 0; } }, polar: function (seriesModel, result, axisMap, categoryAxisMap) { var polarModel = seriesModel.getReferringComponents('polar')[0]; var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); var angleAxisModel = polarModel.findAxisModel('angleAxis'); if (__DEV__) { if (!angleAxisModel) { throw new Error('angleAxis option not found'); } if (!radiusAxisModel) { throw new Error('radiusAxis option not found'); } } result.coordSysDims = ['radius', 'angle']; axisMap.set('radius', radiusAxisModel); axisMap.set('angle', angleAxisModel); if (isCategory(radiusAxisModel)) { categoryAxisMap.set('radius', radiusAxisModel); result.firstCategoryDimIndex = 0; } if (isCategory(angleAxisModel)) { categoryAxisMap.set('angle', angleAxisModel); result.firstCategoryDimIndex = 1; } }, geo: function (seriesModel, result, axisMap, categoryAxisMap) { result.coordSysDims = ['lng', 'lat']; }, parallel: function (seriesModel, result, axisMap, categoryAxisMap) { var ecModel = seriesModel.ecModel; var parallelModel = ecModel.getComponent( 'parallel', seriesModel.get('parallelIndex') ); var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice(); each$1(parallelModel.parallelAxisIndex, function (axisIndex, index) { var axisModel = ecModel.getComponent('parallelAxis', axisIndex); var axisDim = coordSysDims[index]; axisMap.set(axisDim, axisModel); if (isCategory(axisModel) && result.firstCategoryDimIndex == null) { categoryAxisMap.set(axisDim, axisModel); result.firstCategoryDimIndex = index; } }); } }; function isCategory(axisModel) { return axisModel.get('type') === 'category'; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Avoid typo. var SOURCE_FORMAT_ORIGINAL = 'original'; var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows'; var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows'; var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns'; var SOURCE_FORMAT_UNKNOWN = 'unknown'; // ??? CHANGE A NAME var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray'; var SERIES_LAYOUT_BY_COLUMN = 'column'; var SERIES_LAYOUT_BY_ROW = 'row'; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * [sourceFormat] * * + "original": * This format is only used in series.data, where * itemStyle can be specified in data item. * * + "arrayRows": * [ * ['product', 'score', 'amount'], * ['Matcha Latte', 89.3, 95.8], * ['Milk Tea', 92.1, 89.4], * ['Cheese Cocoa', 94.4, 91.2], * ['Walnut Brownie', 85.4, 76.9] * ] * * + "objectRows": * [ * {product: 'Matcha Latte', score: 89.3, amount: 95.8}, * {product: 'Milk Tea', score: 92.1, amount: 89.4}, * {product: 'Cheese Cocoa', score: 94.4, amount: 91.2}, * {product: 'Walnut Brownie', score: 85.4, amount: 76.9} * ] * * + "keyedColumns": * { * 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'], * 'count': [823, 235, 1042, 988], * 'score': [95.8, 81.4, 91.2, 76.9] * } * * + "typedArray" * * + "unknown" */ /** * @constructor * @param {Object} fields * @param {string} fields.sourceFormat * @param {Array|Object} fields.fromDataset * @param {Array|Object} [fields.data] * @param {string} [seriesLayoutBy='column'] * @param {Array.} [dimensionsDefine] * @param {Objet|HashMap} [encodeDefine] * @param {number} [startIndex=0] * @param {number} [dimensionsDetectCount] */ function Source(fields) { /** * @type {boolean} */ this.fromDataset = fields.fromDataset; /** * Not null/undefined. * @type {Array|Object} */ this.data = fields.data || ( fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : [] ); /** * See also "detectSourceFormat". * Not null/undefined. * @type {string} */ this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; /** * 'row' or 'column' * Not null/undefined. * @type {string} seriesLayoutBy */ this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN; /** * dimensions definition in option. * can be null/undefined. * @type {Array.} */ this.dimensionsDefine = fields.dimensionsDefine; /** * encode definition in option. * can be null/undefined. * @type {Objet|HashMap} */ this.encodeDefine = fields.encodeDefine && createHashMap(fields.encodeDefine); /** * Not null/undefined, uint. * @type {number} */ this.startIndex = fields.startIndex || 0; /** * Can be null/undefined (when unknown), uint. * @type {number} */ this.dimensionsDetectCount = fields.dimensionsDetectCount; } /** * Wrap original series data for some compatibility cases. */ Source.seriesDataToSource = function (data) { return new Source({ data: data, sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL, fromDataset: false }); }; enableClassCheck(Source); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var inner$3 = makeInner(); /** * @see {module:echarts/data/Source} * @param {module:echarts/component/dataset/DatasetModel} datasetModel * @return {string} sourceFormat */ function detectSourceFormat(datasetModel) { var data = datasetModel.option.source; var sourceFormat = SOURCE_FORMAT_UNKNOWN; if (isTypedArray(data)) { sourceFormat = SOURCE_FORMAT_TYPED_ARRAY; } else if (isArray(data)) { // FIXME Whether tolerate null in top level array? for (var i = 0, len = data.length; i < len; i++) { var item = data[i]; if (item == null) { continue; } else if (isArray(item)) { sourceFormat = SOURCE_FORMAT_ARRAY_ROWS; break; } else if (isObject$1(item)) { sourceFormat = SOURCE_FORMAT_OBJECT_ROWS; break; } } } else if (isObject$1(data)) { for (var key in data) { if (data.hasOwnProperty(key) && isArrayLike(data[key])) { sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS; break; } } } else if (data != null) { throw new Error('Invalid data'); } inner$3(datasetModel).sourceFormat = sourceFormat; } /** * [Scenarios]: * (1) Provide source data directly: * series: { * encode: {...}, * dimensions: [...] * seriesLayoutBy: 'row', * data: [[...]] * } * (2) Refer to datasetModel. * series: [{ * encode: {...} * // Ignore datasetIndex means `datasetIndex: 0` * // and the dimensions defination in dataset is used * }, { * encode: {...}, * seriesLayoutBy: 'column', * datasetIndex: 1 * }] * * Get data from series itself or datset. * @return {module:echarts/data/Source} source */ function getSource(seriesModel) { return inner$3(seriesModel).source; } /** * MUST be called before mergeOption of all series. * @param {module:echarts/model/Global} ecModel */ function resetSourceDefaulter(ecModel) { // `datasetMap` is used to make default encode. inner$3(ecModel).datasetMap = createHashMap(); } /** * [Caution]: * MUST be called after series option merged and * before "series.getInitailData()" called. * * [The rule of making default encode]: * Category axis (if exists) alway map to the first dimension. * Each other axis occupies a subsequent dimension. * * [Why make default encode]: * Simplify the typing of encode in option, avoiding the case like that: * series: [{encode: {x: 0, y: 1}}, {encode: {x: 0, y: 2}}, {encode: {x: 0, y: 3}}], * where the "y" have to be manually typed as "1, 2, 3, ...". * * @param {module:echarts/model/Series} seriesModel */ function prepareSource(seriesModel) { var seriesOption = seriesModel.option; var data = seriesOption.data; var sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL; var fromDataset = false; var seriesLayoutBy = seriesOption.seriesLayoutBy; var sourceHeader = seriesOption.sourceHeader; var dimensionsDefine = seriesOption.dimensions; var datasetModel = getDatasetModel(seriesModel); if (datasetModel) { var datasetOption = datasetModel.option; data = datasetOption.source; sourceFormat = inner$3(datasetModel).sourceFormat; fromDataset = true; // These settings from series has higher priority. seriesLayoutBy = seriesLayoutBy || datasetOption.seriesLayoutBy; sourceHeader == null && (sourceHeader = datasetOption.sourceHeader); dimensionsDefine = dimensionsDefine || datasetOption.dimensions; } var completeResult = completeBySourceData( data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine ); // Note: dataset option does not have `encode`. var encodeDefine = seriesOption.encode; if (!encodeDefine && datasetModel) { encodeDefine = makeDefaultEncode( seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult ); } inner$3(seriesModel).source = new Source({ data: data, fromDataset: fromDataset, seriesLayoutBy: seriesLayoutBy, sourceFormat: sourceFormat, dimensionsDefine: completeResult.dimensionsDefine, startIndex: completeResult.startIndex, dimensionsDetectCount: completeResult.dimensionsDetectCount, encodeDefine: encodeDefine }); } // return {startIndex, dimensionsDefine, dimensionsCount} function completeBySourceData(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) { if (!data) { return {dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine)}; } var dimensionsDetectCount; var startIndex; var findPotentialName; if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { // Rule: Most of the first line are string: it is header. // Caution: consider a line with 5 string and 1 number, // it still can not be sure it is a head, because the // 5 string may be 5 values of category columns. if (sourceHeader === 'auto' || sourceHeader == null) { arrayRowsTravelFirst(function (val) { // '-' is regarded as null/undefined. if (val != null && val !== '-') { if (isString(val)) { startIndex == null && (startIndex = 1); } else { startIndex = 0; } } // 10 is an experience number, avoid long loop. }, seriesLayoutBy, data, 10); } else { startIndex = sourceHeader ? 1 : 0; } if (!dimensionsDefine && startIndex === 1) { dimensionsDefine = []; arrayRowsTravelFirst(function (val, index) { dimensionsDefine[index] = val != null ? val : ''; }, seriesLayoutBy, data); } dimensionsDetectCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? data.length : data[0] ? data[0].length : null; } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { if (!dimensionsDefine) { dimensionsDefine = objectRowsCollectDimensions(data); findPotentialName = true; } } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { if (!dimensionsDefine) { dimensionsDefine = []; findPotentialName = true; each$1(data, function (colArr, key) { dimensionsDefine.push(key); }); } } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { var value0 = getDataItemValue(data[0]); dimensionsDetectCount = isArray(value0) && value0.length || 1; } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { if (__DEV__) { assert$1(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.'); } } var potentialNameDimIndex; if (findPotentialName) { each$1(dimensionsDefine, function (dim, idx) { if ((isObject$1(dim) ? dim.name : dim) === 'name') { potentialNameDimIndex = idx; } }); } return { startIndex: startIndex, dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine), dimensionsDetectCount: dimensionsDetectCount, potentialNameDimIndex: potentialNameDimIndex // TODO: potentialIdDimIdx }; } // Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'], // which is reasonable. But dimension name is duplicated. // Returns undefined or an array contains only object without null/undefiend or string. function normalizeDimensionsDefine(dimensionsDefine) { if (!dimensionsDefine) { // The meaning of null/undefined is different from empty array. return; } var nameMap = createHashMap(); return map(dimensionsDefine, function (item, index) { item = extend({}, isObject$1(item) ? item : {name: item}); // User can set null in dimensions. // We dont auto specify name, othewise a given name may // cause it be refered unexpectedly. if (item.name == null) { return item; } // Also consider number form like 2012. item.name += ''; // User may also specify displayName. // displayName will always exists except user not // specified or dim name is not specified or detected. // (A auto generated dim name will not be used as // displayName). if (item.displayName == null) { item.displayName = item.name; } var exist = nameMap.get(item.name); if (!exist) { nameMap.set(item.name, {count: 1}); } else { item.name += '-' + exist.count++; } return item; }); } function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) { maxLoop == null && (maxLoop = Infinity); if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { for (var i = 0; i < data.length && i < maxLoop; i++) { cb(data[i] ? data[i][0] : null, i); } } else { var value0 = data[0] || []; for (var i = 0; i < value0.length && i < maxLoop; i++) { cb(value0[i], i); } } } function objectRowsCollectDimensions(data) { var firstIndex = 0; var obj; while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line if (obj) { var dimensions = []; each$1(obj, function (value, key) { dimensions.push(key); }); return dimensions; } } // ??? TODO merge to completedimensions, where also has // default encode making logic. And the default rule // should depends on series? consider 'map'. function makeDefaultEncode( seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult ) { var coordSysDefine = getCoordSysDefineBySeries(seriesModel); var encode = {}; // var encodeTooltip = []; // var encodeLabel = []; var encodeItemName = []; var encodeSeriesName = []; var seriesType = seriesModel.subType; // ??? TODO refactor: provide by series itself. // Consider the case: 'map' series is based on geo coordSys, // 'graph', 'heatmap' can be based on cartesian. But can not // give default rule simply here. var nSeriesMap = createHashMap(['pie', 'map', 'funnel']); var cSeriesMap = createHashMap([ 'line', 'bar', 'pictorialBar', 'scatter', 'effectScatter', 'candlestick', 'boxplot' ]); // Usually in this case series will use the first data // dimension as the "value" dimension, or other default // processes respectively. if (coordSysDefine && cSeriesMap.get(seriesType) != null) { var ecModel = seriesModel.ecModel; var datasetMap = inner$3(ecModel).datasetMap; var key = datasetModel.uid + '_' + seriesLayoutBy; var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {categoryWayDim: 1, valueWayDim: 0}); // TODO // Auto detect first time axis and do arrangement. each$1(coordSysDefine.coordSysDims, function (coordDim) { // In value way. if (coordSysDefine.firstCategoryDimIndex == null) { var dataDim = datasetRecord.valueWayDim++; encode[coordDim] = dataDim; // ??? TODO give a better default series name rule? // especially when encode x y specified. // consider: when mutiple series share one dimension // category axis, series name should better use // the other dimsion name. On the other hand, use // both dimensions name. encodeSeriesName.push(dataDim); // encodeTooltip.push(dataDim); // encodeLabel.push(dataDim); } // In category way, category axis. else if (coordSysDefine.categoryAxisMap.get(coordDim)) { encode[coordDim] = 0; encodeItemName.push(0); } // In category way, non-category axis. else { var dataDim = datasetRecord.categoryWayDim++; encode[coordDim] = dataDim; // encodeTooltip.push(dataDim); // encodeLabel.push(dataDim); encodeSeriesName.push(dataDim); } }); } // Do not make a complex rule! Hard to code maintain and not necessary. // ??? TODO refactor: provide by series itself. // [{name: ..., value: ...}, ...] like: else if (nSeriesMap.get(seriesType) != null) { // Find the first not ordinal. (5 is an experience value) var firstNotOrdinal; for (var i = 0; i < 5 && firstNotOrdinal == null; i++) { if (!doGuessOrdinal( data, sourceFormat, seriesLayoutBy, completeResult.dimensionsDefine, completeResult.startIndex, i )) { firstNotOrdinal = i; } } if (firstNotOrdinal != null) { encode.value = firstNotOrdinal; var nameDimIndex = completeResult.potentialNameDimIndex || Math.max(firstNotOrdinal - 1, 0); // By default, label use itemName in charts. // So we dont set encodeLabel here. encodeSeriesName.push(nameDimIndex); encodeItemName.push(nameDimIndex); // encodeTooltip.push(firstNotOrdinal); } } // encodeTooltip.length && (encode.tooltip = encodeTooltip); // encodeLabel.length && (encode.label = encodeLabel); encodeItemName.length && (encode.itemName = encodeItemName); encodeSeriesName.length && (encode.seriesName = encodeSeriesName); return encode; } /** * If return null/undefined, indicate that should not use datasetModel. */ function getDatasetModel(seriesModel) { var option = seriesModel.option; // Caution: consider the scenario: // A dataset is declared and a series is not expected to use the dataset, // and at the beginning `setOption({series: { noData })` (just prepare other // option but no data), then `setOption({series: {data: [...]}); In this case, // the user should set an empty array to avoid that dataset is used by default. var thisData = option.data; if (!thisData) { return seriesModel.ecModel.getComponent('dataset', option.datasetIndex || 0); } } /** * The rule should not be complex, otherwise user might not * be able to known where the data is wrong. * The code is ugly, but how to make it neat? * * @param {module:echars/data/Source} source * @param {number} dimIndex * @return {boolean} Whether ordinal. */ function guessOrdinal(source, dimIndex) { return doGuessOrdinal( source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex ); } // dimIndex may be overflow source data. function doGuessOrdinal( data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex ) { var result; // Experience value. var maxLoop = 5; if (isTypedArray(data)) { return false; } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine // always exists in source. var dimName; if (dimensionsDefine) { dimName = dimensionsDefine[dimIndex]; dimName = isObject$1(dimName) ? dimName.name : dimName; } if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { var sample = data[dimIndex]; for (var i = 0; i < (sample || []).length && i < maxLoop; i++) { if ((result = detectValue(sample[startIndex + i])) != null) { return result; } } } else { for (var i = 0; i < data.length && i < maxLoop; i++) { var row = data[startIndex + i]; if (row && (result = detectValue(row[dimIndex])) != null) { return result; } } } } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { if (!dimName) { return; } for (var i = 0; i < data.length && i < maxLoop; i++) { var item = data[i]; if (item && (result = detectValue(item[dimName])) != null) { return result; } } } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { if (!dimName) { return; } var sample = data[dimName]; if (!sample || isTypedArray(sample)) { return false; } for (var i = 0; i < sample.length && i < maxLoop; i++) { if ((result = detectValue(sample[i])) != null) { return result; } } } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { for (var i = 0; i < data.length && i < maxLoop; i++) { var item = data[i]; var val = getDataItemValue(item); if (!isArray(val)) { return false; } if ((result = detectValue(val[dimIndex])) != null) { return result; } } } function detectValue(val) { // Consider usage convenience, '1', '2' will be treated as "number". // `isFinit('')` get `true`. if (val != null && isFinite(val) && val !== '') { return false; } else if (isString(val) && val !== '-') { return true; } } return false; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * ECharts global model * * @module {echarts/model/Global} */ /** * Caution: If the mechanism should be changed some day, these cases * should be considered: * * (1) In `merge option` mode, if using the same option to call `setOption` * many times, the result should be the same (try our best to ensure that). * (2) In `merge option` mode, if a component has no id/name specified, it * will be merged by index, and the result sequence of the components is * consistent to the original sequence. * (3) `reset` feature (in toolbox). Find detailed info in comments about * `mergeOption` in module:echarts/model/OptionManager. */ var OPTION_INNER_KEY = '\0_ec_inner'; /** * @alias module:echarts/model/Global * * @param {Object} option * @param {module:echarts/model/Model} parentModel * @param {Object} theme */ var GlobalModel = Model.extend({ init: function (option, parentModel, theme, optionManager) { theme = theme || {}; this.option = null; // Mark as not initialized. /** * @type {module:echarts/model/Model} * @private */ this._theme = new Model(theme); /** * @type {module:echarts/model/OptionManager} */ this._optionManager = optionManager; }, setOption: function (option, optionPreprocessorFuncs) { assert$1( !(OPTION_INNER_KEY in option), 'please use chart.getOption()' ); this._optionManager.setOption(option, optionPreprocessorFuncs); this.resetOption(null); }, /** * @param {string} type null/undefined: reset all. * 'recreate': force recreate all. * 'timeline': only reset timeline option * 'media': only reset media query option * @return {boolean} Whether option changed. */ resetOption: function (type) { var optionChanged = false; var optionManager = this._optionManager; if (!type || type === 'recreate') { var baseOption = optionManager.mountOption(type === 'recreate'); if (!this.option || type === 'recreate') { initBase.call(this, baseOption); } else { this.restoreData(); this.mergeOption(baseOption); } optionChanged = true; } if (type === 'timeline' || type === 'media') { this.restoreData(); } if (!type || type === 'recreate' || type === 'timeline') { var timelineOption = optionManager.getTimelineOption(this); timelineOption && (this.mergeOption(timelineOption), optionChanged = true); } if (!type || type === 'recreate' || type === 'media') { var mediaOptions = optionManager.getMediaOption(this, this._api); if (mediaOptions.length) { each$1(mediaOptions, function (mediaOption) { this.mergeOption(mediaOption, optionChanged = true); }, this); } } return optionChanged; }, /** * @protected */ mergeOption: function (newOption) { var option = this.option; var componentsMap = this._componentsMap; var newCptTypes = []; resetSourceDefaulter(this); // If no component class, merge directly. // For example: color, animaiton options, etc. each$1(newOption, function (componentOption, mainType) { if (componentOption == null) { return; } if (!ComponentModel.hasClass(mainType)) { // globalSettingTask.dirty(); option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true); } else if (mainType) { newCptTypes.push(mainType); } }); ComponentModel.topologicalTravel( newCptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this ); function visitComponent(mainType, dependencies) { var newCptOptionList = normalizeToArray(newOption[mainType]); var mapResult = mappingToExists( componentsMap.get(mainType), newCptOptionList ); makeIdAndName(mapResult); // Set mainType and complete subType. each$1(mapResult, function (item, index) { var opt = item.option; if (isObject$1(opt)) { item.keyInfo.mainType = mainType; item.keyInfo.subType = determineSubType(mainType, opt, item.exist); } }); var dependentModels = getComponentsByTypes( componentsMap, dependencies ); option[mainType] = []; componentsMap.set(mainType, []); each$1(mapResult, function (resultItem, index) { var componentModel = resultItem.exist; var newCptOption = resultItem.option; assert$1( isObject$1(newCptOption) || componentModel, 'Empty component definition' ); // Consider where is no new option and should be merged using {}, // see removeEdgeAndAdd in topologicalTravel and // ComponentModel.getAllClassMainTypes. if (!newCptOption) { componentModel.mergeOption({}, this); componentModel.optionUpdated({}, false); } else { var ComponentModelClass = ComponentModel.getClass( mainType, resultItem.keyInfo.subType, true ); if (componentModel && componentModel instanceof ComponentModelClass) { componentModel.name = resultItem.keyInfo.name; // componentModel.settingTask && componentModel.settingTask.dirty(); componentModel.mergeOption(newCptOption, this); componentModel.optionUpdated(newCptOption, false); } else { // PENDING Global as parent ? var extraOpt = extend( { dependentModels: dependentModels, componentIndex: index }, resultItem.keyInfo ); componentModel = new ComponentModelClass( newCptOption, this, this, extraOpt ); extend(componentModel, extraOpt); componentModel.init(newCptOption, this, this, extraOpt); // Call optionUpdated after init. // newCptOption has been used as componentModel.option // and may be merged with theme and default, so pass null // to avoid confusion. componentModel.optionUpdated(null, true); } } componentsMap.get(mainType)[index] = componentModel; option[mainType][index] = componentModel.option; }, this); // Backup series for filtering. if (mainType === 'series') { createSeriesIndices(this, componentsMap.get('series')); } } this._seriesIndicesMap = createHashMap( this._seriesIndices = this._seriesIndices || [] ); }, /** * Get option for output (cloned option and inner info removed) * @public * @return {Object} */ getOption: function () { var option = clone(this.option); each$1(option, function (opts, mainType) { if (ComponentModel.hasClass(mainType)) { var opts = normalizeToArray(opts); for (var i = opts.length - 1; i >= 0; i--) { // Remove options with inner id. if (isIdInner(opts[i])) { opts.splice(i, 1); } } option[mainType] = opts; } }); delete option[OPTION_INNER_KEY]; return option; }, /** * @return {module:echarts/model/Model} */ getTheme: function () { return this._theme; }, /** * @param {string} mainType * @param {number} [idx=0] * @return {module:echarts/model/Component} */ getComponent: function (mainType, idx) { var list = this._componentsMap.get(mainType); if (list) { return list[idx || 0]; } }, /** * If none of index and id and name used, return all components with mainType. * @param {Object} condition * @param {string} condition.mainType * @param {string} [condition.subType] If ignore, only query by mainType * @param {number|Array.} [condition.index] Either input index or id or name. * @param {string|Array.} [condition.id] Either input index or id or name. * @param {string|Array.} [condition.name] Either input index or id or name. * @return {Array.} */ queryComponents: function (condition) { var mainType = condition.mainType; if (!mainType) { return []; } var index = condition.index; var id = condition.id; var name = condition.name; var cpts = this._componentsMap.get(mainType); if (!cpts || !cpts.length) { return []; } var result; if (index != null) { if (!isArray(index)) { index = [index]; } result = filter(map(index, function (idx) { return cpts[idx]; }), function (val) { return !!val; }); } else if (id != null) { var isIdArray = isArray(id); result = filter(cpts, function (cpt) { return (isIdArray && indexOf(id, cpt.id) >= 0) || (!isIdArray && cpt.id === id); }); } else if (name != null) { var isNameArray = isArray(name); result = filter(cpts, function (cpt) { return (isNameArray && indexOf(name, cpt.name) >= 0) || (!isNameArray && cpt.name === name); }); } else { // Return all components with mainType result = cpts.slice(); } return filterBySubType(result, condition); }, /** * The interface is different from queryComponents, * which is convenient for inner usage. * * @usage * var result = findComponents( * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}} * ); * var result = findComponents( * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}} * ); * var result = findComponents( * {mainType: 'series'}, * function (model, index) {...} * ); * // result like [component0, componnet1, ...] * * @param {Object} condition * @param {string} condition.mainType Mandatory. * @param {string} [condition.subType] Optional. * @param {Object} [condition.query] like {xxxIndex, xxxId, xxxName}, * where xxx is mainType. * If query attribute is null/undefined or has no index/id/name, * do not filtering by query conditions, which is convenient for * no-payload situations or when target of action is global. * @param {Function} [condition.filter] parameter: component, return boolean. * @return {Array.} */ findComponents: function (condition) { var query = condition.query; var mainType = condition.mainType; var queryCond = getQueryCond(query); var result = queryCond ? this.queryComponents(queryCond) : this._componentsMap.get(mainType); return doFilter(filterBySubType(result, condition)); function getQueryCond(q) { var indexAttr = mainType + 'Index'; var idAttr = mainType + 'Id'; var nameAttr = mainType + 'Name'; return q && ( q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null ) ? { mainType: mainType, // subType will be filtered finally. index: q[indexAttr], id: q[idAttr], name: q[nameAttr] } : null; } function doFilter(res) { return condition.filter ? filter(res, condition.filter) : res; } }, /** * @usage * eachComponent('legend', function (legendModel, index) { * ... * }); * eachComponent(function (componentType, model, index) { * // componentType does not include subType * // (componentType is 'xxx' but not 'xxx.aa') * }); * eachComponent( * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}, * function (model, index) {...} * ); * eachComponent( * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}, * function (model, index) {...} * ); * * @param {string|Object=} mainType When mainType is object, the definition * is the same as the method 'findComponents'. * @param {Function} cb * @param {*} context */ eachComponent: function (mainType, cb, context) { var componentsMap = this._componentsMap; if (typeof mainType === 'function') { context = cb; cb = mainType; componentsMap.each(function (components, componentType) { each$1(components, function (component, index) { cb.call(context, componentType, component, index); }); }); } else if (isString(mainType)) { each$1(componentsMap.get(mainType), cb, context); } else if (isObject$1(mainType)) { var queryResult = this.findComponents(mainType); each$1(queryResult, cb, context); } }, /** * @param {string} name * @return {Array.} */ getSeriesByName: function (name) { var series = this._componentsMap.get('series'); return filter(series, function (oneSeries) { return oneSeries.name === name; }); }, /** * @param {number} seriesIndex * @return {module:echarts/model/Series} */ getSeriesByIndex: function (seriesIndex) { return this._componentsMap.get('series')[seriesIndex]; }, /** * Get series list before filtered by type. * FIXME: rename to getRawSeriesByType? * * @param {string} subType * @return {Array.} */ getSeriesByType: function (subType) { var series = this._componentsMap.get('series'); return filter(series, function (oneSeries) { return oneSeries.subType === subType; }); }, /** * @return {Array.} */ getSeries: function () { return this._componentsMap.get('series').slice(); }, /** * @return {number} */ getSeriesCount: function () { return this._componentsMap.get('series').length; }, /** * After filtering, series may be different * frome raw series. * * @param {Function} cb * @param {*} context */ eachSeries: function (cb, context) { assertSeriesInitialized(this); each$1(this._seriesIndices, function (rawSeriesIndex) { var series = this._componentsMap.get('series')[rawSeriesIndex]; cb.call(context, series, rawSeriesIndex); }, this); }, /** * Iterate raw series before filtered. * * @param {Function} cb * @param {*} context */ eachRawSeries: function (cb, context) { each$1(this._componentsMap.get('series'), cb, context); }, /** * After filtering, series may be different. * frome raw series. * * @parma {string} subType * @param {Function} cb * @param {*} context */ eachSeriesByType: function (subType, cb, context) { assertSeriesInitialized(this); each$1(this._seriesIndices, function (rawSeriesIndex) { var series = this._componentsMap.get('series')[rawSeriesIndex]; if (series.subType === subType) { cb.call(context, series, rawSeriesIndex); } }, this); }, /** * Iterate raw series before filtered of given type. * * @parma {string} subType * @param {Function} cb * @param {*} context */ eachRawSeriesByType: function (subType, cb, context) { return each$1(this.getSeriesByType(subType), cb, context); }, /** * @param {module:echarts/model/Series} seriesModel */ isSeriesFiltered: function (seriesModel) { assertSeriesInitialized(this); return this._seriesIndicesMap.get(seriesModel.componentIndex) == null; }, /** * @return {Array.} */ getCurrentSeriesIndices: function () { return (this._seriesIndices || []).slice(); }, /** * @param {Function} cb * @param {*} context */ filterSeries: function (cb, context) { assertSeriesInitialized(this); var filteredSeries = filter( this._componentsMap.get('series'), cb, context ); createSeriesIndices(this, filteredSeries); }, restoreData: function (payload) { var componentsMap = this._componentsMap; createSeriesIndices(this, componentsMap.get('series')); var componentTypes = []; componentsMap.each(function (components, componentType) { componentTypes.push(componentType); }); ComponentModel.topologicalTravel( componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType, dependencies) { each$1(componentsMap.get(componentType), function (component) { (componentType !== 'series' || !isNotTargetSeries(component, payload)) && component.restoreData(); }); } ); } }); function isNotTargetSeries(seriesModel, payload) { if (payload) { var index = payload.seiresIndex; var id = payload.seriesId; var name = payload.seriesName; return (index != null && seriesModel.componentIndex !== index) || (id != null && seriesModel.id !== id) || (name != null && seriesModel.name !== name); } } /** * @inner */ function mergeTheme(option, theme) { // PENDING // NOT use `colorLayer` in theme if option has `color` var notMergeColorLayer = option.color && !option.colorLayer; each$1(theme, function (themeItem, name) { if (name === 'colorLayer' && notMergeColorLayer) { return; } // 如果有 component model 则把具体的 merge 逻辑交给该 model 处理 if (!ComponentModel.hasClass(name)) { if (typeof themeItem === 'object') { option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false); } else { if (option[name] == null) { option[name] = themeItem; } } } }); } function initBase(baseOption) { baseOption = baseOption; // Using OPTION_INNER_KEY to mark that this option can not be used outside, // i.e. `chart.setOption(chart.getModel().option);` is forbiden. this.option = {}; this.option[OPTION_INNER_KEY] = 1; /** * Init with series: [], in case of calling findSeries method * before series initialized. * @type {Object.>} * @private */ this._componentsMap = createHashMap({series: []}); /** * Mapping between filtered series list and raw series list. * key: filtered series indices, value: raw series indices. * @type {Array.} * @private */ this._seriesIndices; this._seriesIndicesMap; mergeTheme(baseOption, this._theme.option); // TODO Needs clone when merging to the unexisted property merge(baseOption, globalDefault, false); this.mergeOption(baseOption); } /** * @inner * @param {Array.|string} types model types * @return {Object} key: {string} type, value: {Array.} models */ function getComponentsByTypes(componentsMap, types) { if (!isArray(types)) { types = types ? [types] : []; } var ret = {}; each$1(types, function (type) { ret[type] = (componentsMap.get(type) || []).slice(); }); return ret; } /** * @inner */ function determineSubType(mainType, newCptOption, existComponent) { var subType = newCptOption.type ? newCptOption.type : existComponent ? existComponent.subType // Use determineSubType only when there is no existComponent. : ComponentModel.determineSubType(mainType, newCptOption); // tooltip, markline, markpoint may always has no subType return subType; } /** * @inner */ function createSeriesIndices(ecModel, seriesModels) { ecModel._seriesIndicesMap = createHashMap( ecModel._seriesIndices = map(seriesModels, function (series) { return series.componentIndex; }) || [] ); } /** * @inner */ function filterBySubType(components, condition) { // Using hasOwnProperty for restrict. Consider // subType is undefined in user payload. return condition.hasOwnProperty('subType') ? filter(components, function (cpt) { return cpt.subType === condition.subType; }) : components; } /** * @inner */ function assertSeriesInitialized(ecModel) { // Components that use _seriesIndices should depends on series component, // which make sure that their initialization is after series. if (__DEV__) { if (!ecModel._seriesIndices) { throw new Error('Option should contains series.'); } } } mixin(GlobalModel, colorPaletteMixin); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var echartsAPIList = [ 'getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL', 'getModel', 'getOption', 'getViewOfComponentModel', 'getViewOfSeriesModel' ]; // And `getCoordinateSystems` and `getComponentByElement` will be injected in echarts.js function ExtensionAPI(chartInstance) { each$1(echartsAPIList, function (name) { this[name] = bind(chartInstance[name], chartInstance); }, this); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var coordinateSystemCreators = {}; function CoordinateSystemManager() { this._coordinateSystems = []; } CoordinateSystemManager.prototype = { constructor: CoordinateSystemManager, create: function (ecModel, api) { var coordinateSystems = []; each$1(coordinateSystemCreators, function (creater, type) { var list = creater.create(ecModel, api); coordinateSystems = coordinateSystems.concat(list || []); }); this._coordinateSystems = coordinateSystems; }, update: function (ecModel, api) { each$1(this._coordinateSystems, function (coordSys) { coordSys.update && coordSys.update(ecModel, api); }); }, getCoordinateSystems: function () { return this._coordinateSystems.slice(); } }; CoordinateSystemManager.register = function (type, coordinateSystemCreator) { coordinateSystemCreators[type] = coordinateSystemCreator; }; CoordinateSystemManager.get = function (type) { return coordinateSystemCreators[type]; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * ECharts option manager * * @module {echarts/model/OptionManager} */ var each$4 = each$1; var clone$3 = clone; var map$1 = map; var merge$1 = merge; var QUERY_REG = /^(min|max)?(.+)$/; /** * TERM EXPLANATIONS: * * [option]: * * An object that contains definitions of components. For example: * var option = { * title: {...}, * legend: {...}, * visualMap: {...}, * series: [ * {data: [...]}, * {data: [...]}, * ... * ] * }; * * [rawOption]: * * An object input to echarts.setOption. 'rawOption' may be an * 'option', or may be an object contains multi-options. For example: * var option = { * baseOption: { * title: {...}, * legend: {...}, * series: [ * {data: [...]}, * {data: [...]}, * ... * ] * }, * timeline: {...}, * options: [ * {title: {...}, series: {data: [...]}}, * {title: {...}, series: {data: [...]}}, * ... * ], * media: [ * { * query: {maxWidth: 320}, * option: {series: {x: 20}, visualMap: {show: false}} * }, * { * query: {minWidth: 320, maxWidth: 720}, * option: {series: {x: 500}, visualMap: {show: true}} * }, * { * option: {series: {x: 1200}, visualMap: {show: true}} * } * ] * }; * * @alias module:echarts/model/OptionManager * @param {module:echarts/ExtensionAPI} api */ function OptionManager(api) { /** * @private * @type {module:echarts/ExtensionAPI} */ this._api = api; /** * @private * @type {Array.} */ this._timelineOptions = []; /** * @private * @type {Array.} */ this._mediaList = []; /** * @private * @type {Object} */ this._mediaDefault; /** * -1, means default. * empty means no media. * @private * @type {Array.} */ this._currentMediaIndices = []; /** * @private * @type {Object} */ this._optionBackup; /** * @private * @type {Object} */ this._newBaseOption; } // timeline.notMerge is not supported in ec3. Firstly there is rearly // case that notMerge is needed. Secondly supporting 'notMerge' requires // rawOption cloned and backuped when timeline changed, which does no // good to performance. What's more, that both timeline and setOption // method supply 'notMerge' brings complex and some problems. // Consider this case: // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false); // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false); OptionManager.prototype = { constructor: OptionManager, /** * @public * @param {Object} rawOption Raw option. * @param {module:echarts/model/Global} ecModel * @param {Array.} optionPreprocessorFuncs * @return {Object} Init option */ setOption: function (rawOption, optionPreprocessorFuncs) { if (rawOption) { // That set dat primitive is dangerous if user reuse the data when setOption again. each$1(normalizeToArray(rawOption.series), function (series) { series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data); }); } // Caution: some series modify option data, if do not clone, // it should ensure that the repeat modify correctly // (create a new object when modify itself). rawOption = clone$3(rawOption, true); // FIXME // 如果 timeline options 或者 media 中设置了某个属性,而baseOption中没有设置,则进行警告。 var oldOptionBackup = this._optionBackup; var newParsedOption = parseRawOption.call( this, rawOption, optionPreprocessorFuncs, !oldOptionBackup ); this._newBaseOption = newParsedOption.baseOption; // For setOption at second time (using merge mode); if (oldOptionBackup) { // Only baseOption can be merged. mergeOption(oldOptionBackup.baseOption, newParsedOption.baseOption); // For simplicity, timeline options and media options do not support merge, // that is, if you `setOption` twice and both has timeline options, the latter // timeline opitons will not be merged to the formers, but just substitude them. if (newParsedOption.timelineOptions.length) { oldOptionBackup.timelineOptions = newParsedOption.timelineOptions; } if (newParsedOption.mediaList.length) { oldOptionBackup.mediaList = newParsedOption.mediaList; } if (newParsedOption.mediaDefault) { oldOptionBackup.mediaDefault = newParsedOption.mediaDefault; } } else { this._optionBackup = newParsedOption; } }, /** * @param {boolean} isRecreate * @return {Object} */ mountOption: function (isRecreate) { var optionBackup = this._optionBackup; // TODO // 如果没有reset功能则不clone。 this._timelineOptions = map$1(optionBackup.timelineOptions, clone$3); this._mediaList = map$1(optionBackup.mediaList, clone$3); this._mediaDefault = clone$3(optionBackup.mediaDefault); this._currentMediaIndices = []; return clone$3(isRecreate // this._optionBackup.baseOption, which is created at the first `setOption` // called, and is merged into every new option by inner method `mergeOption` // each time `setOption` called, can be only used in `isRecreate`, because // its reliability is under suspicion. In other cases option merge is // performed by `model.mergeOption`. ? optionBackup.baseOption : this._newBaseOption ); }, /** * @param {module:echarts/model/Global} ecModel * @return {Object} */ getTimelineOption: function (ecModel) { var option; var timelineOptions = this._timelineOptions; if (timelineOptions.length) { // getTimelineOption can only be called after ecModel inited, // so we can get currentIndex from timelineModel. var timelineModel = ecModel.getComponent('timeline'); if (timelineModel) { option = clone$3( timelineOptions[timelineModel.getCurrentIndex()], true ); } } return option; }, /** * @param {module:echarts/model/Global} ecModel * @return {Array.} */ getMediaOption: function (ecModel) { var ecWidth = this._api.getWidth(); var ecHeight = this._api.getHeight(); var mediaList = this._mediaList; var mediaDefault = this._mediaDefault; var indices = []; var result = []; // No media defined. if (!mediaList.length && !mediaDefault) { return result; } // Multi media may be applied, the latter defined media has higher priority. for (var i = 0, len = mediaList.length; i < len; i++) { if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) { indices.push(i); } } // FIXME // 是否mediaDefault应该强制用户设置,否则可能修改不能回归。 if (!indices.length && mediaDefault) { indices = [-1]; } if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) { result = map$1(indices, function (index) { return clone$3( index === -1 ? mediaDefault.option : mediaList[index].option ); }); } // Otherwise return nothing. this._currentMediaIndices = indices; return result; } }; function parseRawOption(rawOption, optionPreprocessorFuncs, isNew) { var timelineOptions = []; var mediaList = []; var mediaDefault; var baseOption; // Compatible with ec2. var timelineOpt = rawOption.timeline; if (rawOption.baseOption) { baseOption = rawOption.baseOption; } // For timeline if (timelineOpt || rawOption.options) { baseOption = baseOption || {}; timelineOptions = (rawOption.options || []).slice(); } // For media query if (rawOption.media) { baseOption = baseOption || {}; var media = rawOption.media; each$4(media, function (singleMedia) { if (singleMedia && singleMedia.option) { if (singleMedia.query) { mediaList.push(singleMedia); } else if (!mediaDefault) { // Use the first media default. mediaDefault = singleMedia; } } }); } // For normal option if (!baseOption) { baseOption = rawOption; } // Set timelineOpt to baseOption in ec3, // which is convenient for merge option. if (!baseOption.timeline) { baseOption.timeline = timelineOpt; } // Preprocess. each$4([baseOption].concat(timelineOptions) .concat(map(mediaList, function (media) { return media.option; })), function (option) { each$4(optionPreprocessorFuncs, function (preProcess) { preProcess(option, isNew); }); } ); return { baseOption: baseOption, timelineOptions: timelineOptions, mediaDefault: mediaDefault, mediaList: mediaList }; } /** * @see * Support: width, height, aspectRatio * Can use max or min as prefix. */ function applyMediaQuery(query, ecWidth, ecHeight) { var realMap = { width: ecWidth, height: ecHeight, aspectratio: ecWidth / ecHeight // lowser case for convenientce. }; var applicatable = true; each$1(query, function (value, attr) { var matched = attr.match(QUERY_REG); if (!matched || !matched[1] || !matched[2]) { return; } var operator = matched[1]; var realAttr = matched[2].toLowerCase(); if (!compare(realMap[realAttr], value, operator)) { applicatable = false; } }); return applicatable; } function compare(real, expect, operator) { if (operator === 'min') { return real >= expect; } else if (operator === 'max') { return real <= expect; } else { // Equals return real === expect; } } function indicesEquals(indices1, indices2) { // indices is always order by asc and has only finite number. return indices1.join(',') === indices2.join(','); } /** * Consider case: * `chart.setOption(opt1);` * Then user do some interaction like dataZoom, dataView changing. * `chart.setOption(opt2);` * Then user press 'reset button' in toolbox. * * After doing that all of the interaction effects should be reset, the * chart should be the same as the result of invoke * `chart.setOption(opt1); chart.setOption(opt2);`. * * Although it is not able ensure that * `chart.setOption(opt1); chart.setOption(opt2);` is equivalents to * `chart.setOption(merge(opt1, opt2));` exactly, * this might be the only simple way to implement that feature. * * MEMO: We've considered some other approaches: * 1. Each model handle its self restoration but not uniform treatment. * (Too complex in logic and error-prone) * 2. Use a shadow ecModel. (Performace expensive) */ function mergeOption(oldOption, newOption) { newOption = newOption || {}; each$4(newOption, function (newCptOpt, mainType) { if (newCptOpt == null) { return; } var oldCptOpt = oldOption[mainType]; if (!ComponentModel.hasClass(mainType)) { oldOption[mainType] = merge$1(oldCptOpt, newCptOpt, true); } else { newCptOpt = normalizeToArray(newCptOpt); oldCptOpt = normalizeToArray(oldCptOpt); var mapResult = mappingToExists(oldCptOpt, newCptOpt); oldOption[mainType] = map$1(mapResult, function (item) { return (item.option && item.exist) ? merge$1(item.exist, item.option, true) : (item.exist || item.option); }); } }); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$5 = each$1; var isObject$3 = isObject$1; var POSSIBLE_STYLES = [ 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', 'chordStyle', 'label', 'labelLine' ]; function compatEC2ItemStyle(opt) { var itemStyleOpt = opt && opt.itemStyle; if (!itemStyleOpt) { return; } for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) { var styleName = POSSIBLE_STYLES[i]; var normalItemStyleOpt = itemStyleOpt.normal; var emphasisItemStyleOpt = itemStyleOpt.emphasis; if (normalItemStyleOpt && normalItemStyleOpt[styleName]) { opt[styleName] = opt[styleName] || {}; if (!opt[styleName].normal) { opt[styleName].normal = normalItemStyleOpt[styleName]; } else { merge(opt[styleName].normal, normalItemStyleOpt[styleName]); } normalItemStyleOpt[styleName] = null; } if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) { opt[styleName] = opt[styleName] || {}; if (!opt[styleName].emphasis) { opt[styleName].emphasis = emphasisItemStyleOpt[styleName]; } else { merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]); } emphasisItemStyleOpt[styleName] = null; } } } function convertNormalEmphasis(opt, optType, useExtend) { if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) { var normalOpt = opt[optType].normal; var emphasisOpt = opt[optType].emphasis; if (normalOpt) { // Timeline controlStyle has other properties besides normal and emphasis if (useExtend) { opt[optType].normal = opt[optType].emphasis = null; defaults(opt[optType], normalOpt); } else { opt[optType] = normalOpt; } } if (emphasisOpt) { opt.emphasis = opt.emphasis || {}; opt.emphasis[optType] = emphasisOpt; } } } function removeEC3NormalStatus(opt) { convertNormalEmphasis(opt, 'itemStyle'); convertNormalEmphasis(opt, 'lineStyle'); convertNormalEmphasis(opt, 'areaStyle'); convertNormalEmphasis(opt, 'label'); convertNormalEmphasis(opt, 'labelLine'); // treemap convertNormalEmphasis(opt, 'upperLabel'); // graph convertNormalEmphasis(opt, 'edgeLabel'); } function compatTextStyle(opt, propName) { // Check whether is not object (string\null\undefined ...) var labelOptSingle = isObject$3(opt) && opt[propName]; var textStyle = isObject$3(labelOptSingle) && labelOptSingle.textStyle; if (textStyle) { for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) { var propName = TEXT_STYLE_OPTIONS[i]; if (textStyle.hasOwnProperty(propName)) { labelOptSingle[propName] = textStyle[propName]; } } } } function compatEC3CommonStyles(opt) { if (opt) { removeEC3NormalStatus(opt); compatTextStyle(opt, 'label'); opt.emphasis && compatTextStyle(opt.emphasis, 'label'); } } function processSeries(seriesOpt) { if (!isObject$3(seriesOpt)) { return; } compatEC2ItemStyle(seriesOpt); removeEC3NormalStatus(seriesOpt); compatTextStyle(seriesOpt, 'label'); // treemap compatTextStyle(seriesOpt, 'upperLabel'); // graph compatTextStyle(seriesOpt, 'edgeLabel'); if (seriesOpt.emphasis) { compatTextStyle(seriesOpt.emphasis, 'label'); // treemap compatTextStyle(seriesOpt.emphasis, 'upperLabel'); // graph compatTextStyle(seriesOpt.emphasis, 'edgeLabel'); } var markPoint = seriesOpt.markPoint; if (markPoint) { compatEC2ItemStyle(markPoint); compatEC3CommonStyles(markPoint); } var markLine = seriesOpt.markLine; if (markLine) { compatEC2ItemStyle(markLine); compatEC3CommonStyles(markLine); } var markArea = seriesOpt.markArea; if (markArea) { compatEC3CommonStyles(markArea); } var data = seriesOpt.data; // Break with ec3: if `setOption` again, there may be no `type` in option, // then the backward compat based on option type will not be performed. if (seriesOpt.type === 'graph') { data = data || seriesOpt.nodes; var edgeData = seriesOpt.links || seriesOpt.edges; if (edgeData && !isTypedArray(edgeData)) { for (var i = 0; i < edgeData.length; i++) { compatEC3CommonStyles(edgeData[i]); } } each$1(seriesOpt.categories, function (opt) { removeEC3NormalStatus(opt); }); } if (data && !isTypedArray(data)) { for (var i = 0; i < data.length; i++) { compatEC3CommonStyles(data[i]); } } // mark point data var markPoint = seriesOpt.markPoint; if (markPoint && markPoint.data) { var mpData = markPoint.data; for (var i = 0; i < mpData.length; i++) { compatEC3CommonStyles(mpData[i]); } } // mark line data var markLine = seriesOpt.markLine; if (markLine && markLine.data) { var mlData = markLine.data; for (var i = 0; i < mlData.length; i++) { if (isArray(mlData[i])) { compatEC3CommonStyles(mlData[i][0]); compatEC3CommonStyles(mlData[i][1]); } else { compatEC3CommonStyles(mlData[i]); } } } // Series if (seriesOpt.type === 'gauge') { compatTextStyle(seriesOpt, 'axisLabel'); compatTextStyle(seriesOpt, 'title'); compatTextStyle(seriesOpt, 'detail'); } else if (seriesOpt.type === 'treemap') { convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle'); each$1(seriesOpt.levels, function (opt) { removeEC3NormalStatus(opt); }); } else if (seriesOpt.type === 'tree') { removeEC3NormalStatus(seriesOpt.leaves); } // sunburst starts from ec4, so it does not need to compat levels. } function toArr(o) { return isArray(o) ? o : o ? [o] : []; } function toObj(o) { return (isArray(o) ? o[0] : o) || {}; } var compatStyle = function (option, isTheme) { each$5(toArr(option.series), function (seriesOpt) { isObject$3(seriesOpt) && processSeries(seriesOpt); }); var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar']; isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis'); each$5( axes, function (axisName) { each$5(toArr(option[axisName]), function (axisOpt) { if (axisOpt) { compatTextStyle(axisOpt, 'axisLabel'); compatTextStyle(axisOpt.axisPointer, 'label'); } }); } ); each$5(toArr(option.parallel), function (parallelOpt) { var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault; compatTextStyle(parallelAxisDefault, 'axisLabel'); compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label'); }); each$5(toArr(option.calendar), function (calendarOpt) { convertNormalEmphasis(calendarOpt, 'itemStyle'); compatTextStyle(calendarOpt, 'dayLabel'); compatTextStyle(calendarOpt, 'monthLabel'); compatTextStyle(calendarOpt, 'yearLabel'); }); // radar.name.textStyle each$5(toArr(option.radar), function (radarOpt) { compatTextStyle(radarOpt, 'name'); }); each$5(toArr(option.geo), function (geoOpt) { if (isObject$3(geoOpt)) { compatEC3CommonStyles(geoOpt); each$5(toArr(geoOpt.regions), function (regionObj) { compatEC3CommonStyles(regionObj); }); } }); each$5(toArr(option.timeline), function (timelineOpt) { compatEC3CommonStyles(timelineOpt); convertNormalEmphasis(timelineOpt, 'label'); convertNormalEmphasis(timelineOpt, 'itemStyle'); convertNormalEmphasis(timelineOpt, 'controlStyle', true); var data = timelineOpt.data; isArray(data) && each$1(data, function (item) { if (isObject$1(item)) { convertNormalEmphasis(item, 'label'); convertNormalEmphasis(item, 'itemStyle'); } }); }); each$5(toArr(option.toolbox), function (toolboxOpt) { convertNormalEmphasis(toolboxOpt, 'iconStyle'); each$5(toolboxOpt.feature, function (featureOpt) { convertNormalEmphasis(featureOpt, 'iconStyle'); }); }); compatTextStyle(toObj(option.axisPointer), 'label'); compatTextStyle(toObj(option.tooltip).axisPointer, 'label'); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Compatitable with 2.0 function get(opt, path) { path = path.split(','); var obj = opt; for (var i = 0; i < path.length; i++) { obj = obj && obj[path[i]]; if (obj == null) { break; } } return obj; } function set$1(opt, path, val, overwrite) { path = path.split(','); var obj = opt; var key; for (var i = 0; i < path.length - 1; i++) { key = path[i]; if (obj[key] == null) { obj[key] = {}; } obj = obj[key]; } if (overwrite || obj[path[i]] == null) { obj[path[i]] = val; } } function compatLayoutProperties(option) { each$1(LAYOUT_PROPERTIES, function (prop) { if (prop[0] in option && !(prop[1] in option)) { option[prop[1]] = option[prop[0]]; } }); } var LAYOUT_PROPERTIES = [ ['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom'] ]; var COMPATITABLE_COMPONENTS = [ 'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline' ]; var backwardCompat = function (option, isTheme) { compatStyle(option, isTheme); // Make sure series array for model initialization. option.series = normalizeToArray(option.series); each$1(option.series, function (seriesOpt) { if (!isObject$1(seriesOpt)) { return; } var seriesType = seriesOpt.type; if (seriesType === 'pie' || seriesType === 'gauge') { if (seriesOpt.clockWise != null) { seriesOpt.clockwise = seriesOpt.clockWise; } } if (seriesType === 'gauge') { var pointerColor = get(seriesOpt, 'pointer.color'); pointerColor != null && set$1(seriesOpt, 'itemStyle.normal.color', pointerColor); } compatLayoutProperties(seriesOpt); }); // dataRange has changed to visualMap if (option.dataRange) { option.visualMap = option.dataRange; } each$1(COMPATITABLE_COMPONENTS, function (componentName) { var options = option[componentName]; if (options) { if (!isArray(options)) { options = [options]; } each$1(options, function (option) { compatLayoutProperties(option); }); } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // (1) [Caution]: the logic is correct based on the premises: // data processing stage is blocked in stream. // See // (2) Only register once when import repeatly. // Should be executed before after series filtered and before stack calculation. var dataStack = function (ecModel) { var stackInfoMap = createHashMap(); ecModel.eachSeries(function (seriesModel) { var stack = seriesModel.get('stack'); // Compatibal: when `stack` is set as '', do not stack. if (stack) { var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []); var data = seriesModel.getData(); var stackInfo = { // Used for calculate axis extent automatically. stackResultDimension: data.getCalculationInfo('stackResultDimension'), stackedOverDimension: data.getCalculationInfo('stackedOverDimension'), stackedDimension: data.getCalculationInfo('stackedDimension'), stackedByDimension: data.getCalculationInfo('stackedByDimension'), isStackedByIndex: data.getCalculationInfo('isStackedByIndex'), data: data, seriesModel: seriesModel }; // If stacked on axis that do not support data stack. if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension) ) { return; } stackInfoList.length && data.setCalculationInfo( 'stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel ); stackInfoList.push(stackInfo); } }); stackInfoMap.each(calculateStack); }; function calculateStack(stackInfoList) { each$1(stackInfoList, function (targetStackInfo, idxInStack) { var resultVal = []; var resultNaN = [NaN, NaN]; var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension]; var targetData = targetStackInfo.data; var isStackedByIndex = targetStackInfo.isStackedByIndex; // Should not write on raw data, because stack series model list changes // depending on legend selection. var newData = targetData.map(dims, function (v0, v1, dataIndex) { var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex); // Consider `connectNulls` of line area, if value is NaN, stackedOver // should also be NaN, to draw a appropriate belt area. if (isNaN(sum)) { return resultNaN; } var byValue; var stackedDataRawIndex; if (isStackedByIndex) { stackedDataRawIndex = targetData.getRawIndex(dataIndex); } else { byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex); } // If stackOver is NaN, chart view will render point on value start. var stackedOver = NaN; for (var j = idxInStack - 1; j >= 0; j--) { var stackInfo = stackInfoList[j]; // Has been optimized by inverted indices on `stackedByDimension`. if (!isStackedByIndex) { stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue); } if (stackedDataRawIndex >= 0) { var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex); // Considering positive stack, negative stack and empty data if ((sum >= 0 && val > 0) // Positive stack || (sum <= 0 && val < 0) // Negative stack ) { sum += val; stackedOver = val; break; } } } resultVal[0] = sum; resultVal[1] = stackedOver; return resultVal; }); targetData.hostModel.setData(newData); // Update for consequent calculation targetStackInfo.data = newData; }); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // TODO // ??? refactor? check the outer usage of data provider. // merge with defaultDimValueGetter? /** * If normal array used, mutable chunk size is supported. * If typed array used, chunk size must be fixed. */ function DefaultDataProvider(source, dimSize) { if (!Source.isInstance(source)) { source = Source.seriesDataToSource(source); } this._source = source; var data = this._data = source.data; var sourceFormat = source.sourceFormat; // Typed array. TODO IE10+? if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { if (__DEV__) { if (dimSize == null) { throw new Error('Typed array data must specify dimension size'); } } this._offset = 0; this._dimSize = dimSize; this._data = data; } var methods = providerMethods[ sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + source.seriesLayoutBy : sourceFormat ]; if (__DEV__) { assert$1(methods, 'Invalide sourceFormat: ' + sourceFormat); } extend(this, methods); } var providerProto = DefaultDataProvider.prototype; // If data is pure without style configuration providerProto.pure = false; // If data is persistent and will not be released after use. providerProto.persistent = true; // ???! FIXME legacy data provider do not has method getSource providerProto.getSource = function () { return this._source; }; var providerMethods = { 'arrayRows_column': { pure: true, count: function () { return Math.max(0, this._data.length - this._source.startIndex); }, getItem: function (idx) { return this._data[idx + this._source.startIndex]; }, appendData: appendDataSimply }, 'arrayRows_row': { pure: true, count: function () { var row = this._data[0]; return row ? Math.max(0, row.length - this._source.startIndex) : 0; }, getItem: function (idx) { idx += this._source.startIndex; var item = []; var data = this._data; for (var i = 0; i < data.length; i++) { var row = data[i]; item.push(row ? row[idx] : null); } return item; }, appendData: function () { throw new Error('Do not support appendData when set seriesLayoutBy: "row".'); } }, 'objectRows': { pure: true, count: countSimply, getItem: getItemSimply, appendData: appendDataSimply }, 'keyedColumns': { pure: true, count: function () { var dimName = this._source.dimensionsDefine[0].name; var col = this._data[dimName]; return col ? col.length : 0; }, getItem: function (idx) { var item = []; var dims = this._source.dimensionsDefine; for (var i = 0; i < dims.length; i++) { var col = this._data[dims[i].name]; item.push(col ? col[idx] : null); } return item; }, appendData: function (newData) { var data = this._data; each$1(newData, function (newCol, key) { var oldCol = data[key] || (data[key] = []); for (var i = 0; i < (newCol || []).length; i++) { oldCol.push(newCol[i]); } }); } }, 'original': { count: countSimply, getItem: getItemSimply, appendData: appendDataSimply }, 'typedArray': { persistent: false, pure: true, count: function () { return this._data ? (this._data.length / this._dimSize) : 0; }, getItem: function (idx, out) { idx = idx - this._offset; out = out || []; var offset = this._dimSize * idx; for (var i = 0; i < this._dimSize; i++) { out[i] = this._data[offset + i]; } return out; }, appendData: function (newData) { if (__DEV__) { assert$1( isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray' ); } this._data = newData; }, // Clean self if data is already used. clean: function () { // PENDING this._offset += this.count(); this._data = null; } } }; function countSimply() { return this._data.length; } function getItemSimply(idx) { return this._data[idx]; } function appendDataSimply(newData) { for (var i = 0; i < newData.length; i++) { this._data.push(newData[i]); } } var rawValueGetters = { arrayRows: getRawValueSimply, objectRows: function (dataItem, dataIndex, dimIndex, dimName) { return dimIndex != null ? dataItem[dimName] : dataItem; }, keyedColumns: getRawValueSimply, original: function (dataItem, dataIndex, dimIndex, dimName) { // FIXME // In some case (markpoint in geo (geo-map.html)), dataItem // is {coord: [...]} var value = getDataItemValue(dataItem); return (dimIndex == null || !(value instanceof Array)) ? value : value[dimIndex]; }, typedArray: getRawValueSimply }; function getRawValueSimply(dataItem, dataIndex, dimIndex, dimName) { return dimIndex != null ? dataItem[dimIndex] : dataItem; } var defaultDimValueGetters = { arrayRows: getDimValueSimply, objectRows: function (dataItem, dimName, dataIndex, dimIndex) { return converDataValue(dataItem[dimName], this._dimensionInfos[dimName]); }, keyedColumns: getDimValueSimply, original: function (dataItem, dimName, dataIndex, dimIndex) { // Performance sensitive, do not use modelUtil.getDataItemValue. // If dataItem is an plain object with no value field, the var `value` // will be assigned with the object, but it will be tread correctly // in the `convertDataValue`. var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value); // If any dataItem is like { value: 10 } if (!this._rawData.pure && isDataItemOption(dataItem)) { this.hasItemOption = true; } return converDataValue( (value instanceof Array) ? value[dimIndex] // If value is a single number or something else not array. : value, this._dimensionInfos[dimName] ); }, typedArray: function (dataItem, dimName, dataIndex, dimIndex) { return dataItem[dimIndex]; } }; function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) { return converDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]); } /** * This helper method convert value in data. * @param {string|number|Date} value * @param {Object|string} [dimInfo] If string (like 'x'), dimType defaults 'number'. * If "dimInfo.ordinalParseAndSave", ordinal value can be parsed. */ function converDataValue(value, dimInfo) { // Performance sensitive. var dimType = dimInfo && dimInfo.type; if (dimType === 'ordinal') { // If given value is a category string var ordinalMeta = dimInfo && dimInfo.ordinalMeta; return ordinalMeta ? ordinalMeta.parseAndCollect(value) : value; } if (dimType === 'time' // spead up when using timestamp && typeof value !== 'number' && value != null && value !== '-' ) { value = +parseDate(value); } // dimType defaults 'number'. // If dimType is not ordinal and value is null or undefined or NaN or '-', // parse to NaN. return (value == null || value === '') ? NaN // If string (like '-'), using '+' parse to NaN // If object, also parse to NaN : +value; } // ??? FIXME can these logic be more neat: getRawValue, getRawDataItem, // Consider persistent. // Caution: why use raw value to display on label or tooltip? // A reason is to avoid format. For example time value we do not know // how to format is expected. More over, if stack is used, calculated // value may be 0.91000000001, which have brings trouble to display. // TODO: consider how to treat null/undefined/NaN when display? /** * @param {module:echarts/data/List} data * @param {number} dataIndex * @param {string|number} [dim] dimName or dimIndex * @return {Array.|string|number} can be null/undefined. */ function retrieveRawValue(data, dataIndex, dim) { if (!data) { return; } // Consider data may be not persistent. var dataItem = data.getRawDataItem(dataIndex); if (dataItem == null) { return; } var sourceFormat = data.getProvider().getSource().sourceFormat; var dimName; var dimIndex; var dimInfo = data.getDimensionInfo(dim); if (dimInfo) { dimName = dimInfo.name; dimIndex = dimInfo.index; } return rawValueGetters[sourceFormat](dataItem, dataIndex, dimIndex, dimName); } /** * Compatible with some cases (in pie, map) like: * data: [{name: 'xx', value: 5, selected: true}, ...] * where only sourceFormat is 'original' and 'objectRows' supported. * * ??? TODO * Supported detail options in data item when using 'arrayRows'. * * @param {module:echarts/data/List} data * @param {number} dataIndex * @param {string} attr like 'selected' */ function retrieveRawAttr(data, dataIndex, attr) { if (!data) { return; } var sourceFormat = data.getProvider().getSource().sourceFormat; if (sourceFormat !== SOURCE_FORMAT_ORIGINAL && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS ) { return; } var dataItem = data.getRawDataItem(dataIndex); if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject$1(dataItem)) { dataItem = null; } if (dataItem) { return dataItem[attr]; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var DIMENSION_LABEL_REG = /\{@(.+?)\}/g; // PENDING A little ugly var dataFormatMixin = { /** * Get params for formatter * @param {number} dataIndex * @param {string} [dataType] * @return {Object} */ getDataParams: function (dataIndex, dataType) { var data = this.getData(dataType); var rawValue = this.getRawValue(dataIndex, dataType); var rawDataIndex = data.getRawIndex(dataIndex); var name = data.getName(dataIndex); var itemOpt = data.getRawDataItem(dataIndex); var color = data.getItemVisual(dataIndex, 'color'); return { componentType: this.mainType, componentSubType: this.subType, seriesType: this.mainType === 'series' ? this.subType : null, seriesIndex: this.seriesIndex, seriesId: this.id, seriesName: this.name, name: name, dataIndex: rawDataIndex, data: itemOpt, dataType: dataType, value: rawValue, color: color, marker: getTooltipMarker(color), // Param name list for mapping `a`, `b`, `c`, `d`, `e` $vars: ['seriesName', 'name', 'value'] }; }, /** * Format label * @param {number} dataIndex * @param {string} [status='normal'] 'normal' or 'emphasis' * @param {string} [dataType] * @param {number} [dimIndex] * @param {string} [labelProp='label'] * @return {string} If not formatter, return null/undefined */ getFormattedLabel: function (dataIndex, status, dataType, dimIndex, labelProp) { status = status || 'normal'; var data = this.getData(dataType); var itemModel = data.getItemModel(dataIndex); var params = this.getDataParams(dataIndex, dataType); if (dimIndex != null && (params.value instanceof Array)) { params.value = params.value[dimIndex]; } var formatter = itemModel.get( status === 'normal' ? [labelProp || 'label', 'formatter'] : [status, labelProp || 'label', 'formatter'] ); if (typeof formatter === 'function') { params.status = status; return formatter(params); } else if (typeof formatter === 'string') { var str = formatTpl(formatter, params); // Support 'aaa{@[3]}bbb{@product}ccc'. // Do not support '}' in dim name util have to. return str.replace(DIMENSION_LABEL_REG, function (origin, dim) { var len = dim.length; if (dim.charAt(0) === '[' && dim.charAt(len - 1) === ']') { dim = +dim.slice(1, len - 1); // Also: '[]' => 0 } return retrieveRawValue(data, dataIndex, dim); }); } }, /** * Get raw value in option * @param {number} idx * @param {string} [dataType] * @return {Array|number|string} */ getRawValue: function (idx, dataType) { return retrieveRawValue(this.getData(dataType), idx); }, /** * Should be implemented. * @param {number} dataIndex * @param {boolean} [multipleSeries=false] * @param {number} [dataType] * @return {string} tooltip string */ formatTooltip: function () { // Empty function } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @param {Object} define * @return See the return of `createTask`. */ function createTask(define) { return new Task(define); } /** * @constructor * @param {Object} define * @param {Function} define.reset Custom reset * @param {Function} [define.plan] Returns 'reset' indicate reset immediately. * @param {Function} [define.count] count is used to determin data task. * @param {Function} [define.onDirty] count is used to determin data task. */ function Task(define) { define = define || {}; this._reset = define.reset; this._plan = define.plan; this._count = define.count; this._onDirty = define.onDirty; this._dirty = true; // Context must be specified implicitly, to // avoid miss update context when model changed. this.context; } var taskProto = Task.prototype; /** * @param {Object} performArgs * @param {number} [performArgs.step] Specified step. * @param {number} [performArgs.skip] Skip customer perform call. * @param {number} [performArgs.modBy] Sampling window size. * @param {number} [performArgs.modDataCount] Sampling count. */ taskProto.perform = function (performArgs) { var upTask = this._upstream; var skip = performArgs && performArgs.skip; // TODO some refactor. // Pull data. Must pull data each time, because context.data // may be updated by Series.setData. if (this._dirty && upTask) { var context = this.context; context.data = context.outputData = upTask.context.outputData; } if (this.__pipeline) { this.__pipeline.currentTask = this; } var planResult; if (this._plan && !skip) { planResult = this._plan(this.context); } // Support sharding by mod, which changes the render sequence and makes the rendered graphic // elements uniformed distributed when progress, especially when moving or zooming. var lastModBy = normalizeModBy(this._modBy); var lastModDataCount = this._modDataCount || 0; var modBy = normalizeModBy(performArgs && performArgs.modBy); var modDataCount = performArgs && performArgs.modDataCount || 0; if (lastModBy !== modBy || lastModDataCount !== modDataCount) { planResult = 'reset'; } function normalizeModBy(val) { !(val >= 1) && (val = 1); // jshint ignore:line return val; } var forceFirstProgress; if (this._dirty || planResult === 'reset') { this._dirty = false; forceFirstProgress = reset(this, skip); } this._modBy = modBy; this._modDataCount = modDataCount; var step = performArgs && performArgs.step; if (upTask) { if (__DEV__) { assert$1(upTask._outputDueEnd != null); } this._dueEnd = upTask._outputDueEnd; } // DataTask or overallTask else { if (__DEV__) { assert$1(!this._progress || this._count); } this._dueEnd = this._count ? this._count(this.context) : Infinity; } // Note: Stubs, that its host overall task let it has progress, has progress. // If no progress, pass index from upstream to downstream each time plan called. if (this._progress) { var start = this._dueIndex; var end = Math.min( step != null ? this._dueIndex + step : Infinity, this._dueEnd ); if (!skip && (forceFirstProgress || start < end)) { var progress = this._progress; if (isArray(progress)) { for (var i = 0; i < progress.length; i++) { doProgress(this, progress[i], start, end, modBy, modDataCount); } } else { doProgress(this, progress, start, end, modBy, modDataCount); } } this._dueIndex = end; // If no `outputDueEnd`, assume that output data and // input data is the same, so use `dueIndex` as `outputDueEnd`. var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end; if (__DEV__) { // ??? Can not rollback. assert$1(outputDueEnd >= this._outputDueEnd); } this._outputDueEnd = outputDueEnd; } else { // (1) Some overall task has no progress. // (2) Stubs, that its host overall task do not let it has progress, has no progress. // This should always be performed so it can be passed to downstream. this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd; } return this.unfinished(); }; var iterator = (function () { var end; var current; var modBy; var modDataCount; var winCount; var it = { reset: function (s, e, sStep, sCount) { current = s; end = e; modBy = sStep; modDataCount = sCount; winCount = Math.ceil(modDataCount / modBy); it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext; } }; return it; function sequentialNext() { return current < end ? current++ : null; } function modNext() { var dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount); var result = current >= end ? null : dataIndex < modDataCount ? dataIndex // If modDataCount is smaller than data.count() (consider `appendData` case), // Use normal linear rendering mode. : current; current++; return result; } })(); taskProto.dirty = function () { this._dirty = true; this._onDirty && this._onDirty(this.context); }; function doProgress(taskIns, progress, start, end, modBy, modDataCount) { iterator.reset(start, end, modBy, modDataCount); taskIns._callingProgress = progress; taskIns._callingProgress({ start: start, end: end, count: end - start, next: iterator.next }, taskIns.context); } function reset(taskIns, skip) { taskIns._dueIndex = taskIns._outputDueEnd = taskIns._dueEnd = 0; taskIns._settedOutputEnd = null; var progress; var forceFirstProgress; if (!skip && taskIns._reset) { progress = taskIns._reset(taskIns.context); if (progress && progress.progress) { forceFirstProgress = progress.forceFirstProgress; progress = progress.progress; } // To simplify no progress checking, array must has item. if (isArray(progress) && !progress.length) { progress = null; } } taskIns._progress = progress; taskIns._modBy = taskIns._modDataCount = null; var downstream = taskIns._downstream; downstream && downstream.dirty(); return forceFirstProgress; } /** * @return {boolean} */ taskProto.unfinished = function () { return this._progress && this._dueIndex < this._dueEnd; }; /** * @param {Object} downTask The downstream task. * @return {Object} The downstream task. */ taskProto.pipe = function (downTask) { if (__DEV__) { assert$1(downTask && !downTask._disposed && downTask !== this); } // If already downstream, do not dirty downTask. if (this._downstream !== downTask || this._dirty) { this._downstream = downTask; downTask._upstream = this; downTask.dirty(); } }; taskProto.dispose = function () { if (this._disposed) { return; } this._upstream && (this._upstream._downstream = null); this._downstream && (this._downstream._upstream = null); this._dirty = false; this._disposed = true; }; taskProto.getUpstream = function () { return this._upstream; }; taskProto.getDownstream = function () { return this._downstream; }; taskProto.setOutputEnd = function (end) { // This only happend in dataTask, dataZoom, map, currently. // where dataZoom do not set end each time, but only set // when reset. So we should record the setted end, in case // that the stub of dataZoom perform again and earse the // setted end by upstream. this._outputDueEnd = this._settedOutputEnd = end; }; /////////////////////////////////////////////////////////// // For stream debug (Should be commented out after used!) // Usage: printTask(this, 'begin'); // Usage: printTask(this, null, {someExtraProp}); // function printTask(task, prefix, extra) { // window.ecTaskUID == null && (window.ecTaskUID = 0); // task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`); // task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`); // var props = []; // if (task.__pipeline) { // var val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`; // props.push({text: 'idx', value: val}); // } else { // var stubCount = 0; // task.agentStubMap.each(() => stubCount++); // props.push({text: 'idx', value: `overall (stubs: ${stubCount})`}); // } // props.push({text: 'uid', value: task.uidDebug}); // if (task.__pipeline) { // props.push({text: 'pid', value: task.__pipeline.id}); // task.agent && props.push( // {text: 'stubFor', value: task.agent.uidDebug} // ); // } // props.push( // {text: 'dirty', value: task._dirty}, // {text: 'dueIndex', value: task._dueIndex}, // {text: 'dueEnd', value: task._dueEnd}, // {text: 'outputDueEnd', value: task._outputDueEnd} // ); // if (extra) { // Object.keys(extra).forEach(key => { // props.push({text: key, value: extra[key]}); // }); // } // var args = ['color: blue']; // var msg = `%c[${prefix || 'T'}] %c` + props.map(item => ( // args.push('color: black', 'color: red'), // `${item.text}: %c${item.value}` // )).join('%c, '); // console.log.apply(console, [msg].concat(args)); // // console.log(this); // } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var inner$4 = makeInner(); var SeriesModel = ComponentModel.extend({ type: 'series.__base__', /** * @readOnly */ seriesIndex: 0, // coodinateSystem will be injected in the echarts/CoordinateSystem coordinateSystem: null, /** * @type {Object} * @protected */ defaultOption: null, /** * Data provided for legend * @type {Function} */ // PENDING legendDataProvider: null, /** * Access path of color for visual */ visualColorAccessPath: 'itemStyle.color', /** * Support merge layout params. * Only support 'box' now (left/right/top/bottom/width/height). * @type {string|Object} Object can be {ignoreSize: true} * @readOnly */ layoutMode: null, init: function (option, parentModel, ecModel, extraOpt) { /** * @type {number} * @readOnly */ this.seriesIndex = this.componentIndex; this.dataTask = createTask({ count: dataTaskCount, reset: dataTaskReset }); this.dataTask.context = {model: this}; this.mergeDefaultAndTheme(option, ecModel); prepareSource(this); var data = this.getInitialData(option, ecModel); wrapData(data, this); this.dataTask.context.data = data; if (__DEV__) { assert$1(data, 'getInitialData returned invalid data.'); } /** * @type {module:echarts/data/List|module:echarts/data/Tree|module:echarts/data/Graph} * @private */ inner$4(this).dataBeforeProcessed = data; // If we reverse the order (make data firstly, and then make // dataBeforeProcessed by cloneShallow), cloneShallow will // cause data.graph.data !== data when using // module:echarts/data/Graph or module:echarts/data/Tree. // See module:echarts/data/helper/linkList // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model // init or merge stage, because the data can be restored. So we do not `restoreData` // and `setData` here, which forbids calling `seriesModel.getData()` in this stage. // Call `seriesModel.getRawData()` instead. // this.restoreData(); autoSeriesName(this); }, /** * Util for merge default and theme to option * @param {Object} option * @param {module:echarts/model/Global} ecModel */ mergeDefaultAndTheme: function (option, ecModel) { var layoutMode = this.layoutMode; var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; // Backward compat: using subType on theme. // But if name duplicate between series subType // (for example: parallel) add component mainType, // add suffix 'Series'. var themeSubType = this.subType; if (ComponentModel.hasClass(themeSubType)) { themeSubType += 'Series'; } merge( option, ecModel.getTheme().get(this.subType) ); merge(option, this.getDefaultOption()); // Default label emphasis `show` defaultEmphasis(option, 'label', ['show']); this.fillDataTextStyle(option.data); if (layoutMode) { mergeLayoutParam(option, inputPositionParams, layoutMode); } }, mergeOption: function (newSeriesOption, ecModel) { // this.settingTask.dirty(); newSeriesOption = merge(this.option, newSeriesOption, true); this.fillDataTextStyle(newSeriesOption.data); var layoutMode = this.layoutMode; if (layoutMode) { mergeLayoutParam(this.option, newSeriesOption, layoutMode); } prepareSource(this); var data = this.getInitialData(newSeriesOption, ecModel); wrapData(data, this); this.dataTask.dirty(); this.dataTask.context.data = data; inner$4(this).dataBeforeProcessed = data; autoSeriesName(this); }, fillDataTextStyle: function (data) { // Default data label emphasis `show` // FIXME Tree structure data ? // FIXME Performance ? if (data && !isTypedArray(data)) { var props = ['show']; for (var i = 0; i < data.length; i++) { if (data[i] && data[i].label) { defaultEmphasis(data[i], 'label', props); } } } }, /** * Init a data structure from data related option in series * Must be overwritten */ getInitialData: function () {}, /** * Append data to list * @param {Object} params * @param {Array|TypedArray} params.data */ appendData: function (params) { // FIXME ??? // (1) If data from dataset, forbidden append. // (2) support append data of dataset. var data = this.getRawData(); data.appendData(params.data); }, /** * Consider some method like `filter`, `map` need make new data, * We should make sure that `seriesModel.getData()` get correct * data in the stream procedure. So we fetch data from upstream * each time `task.perform` called. * @param {string} [dataType] * @return {module:echarts/data/List} */ getData: function (dataType) { var task = getCurrentTask(this); if (task) { var data = task.context.data; return dataType == null ? data : data.getLinkedData(dataType); } else { // When series is not alive (that may happen when click toolbox // restore or setOption with not merge mode), series data may // be still need to judge animation or something when graphic // elements want to know whether fade out. return inner$4(this).data; } }, /** * @param {module:echarts/data/List} data */ setData: function (data) { var task = getCurrentTask(this); if (task) { var context = task.context; // Consider case: filter, data sample. if (context.data !== data && task.modifyOutputEnd) { task.setOutputEnd(data.count()); } context.outputData = data; // Caution: setData should update context.data, // Because getData may be called multiply in a // single stage and expect to get the data just // set. (For example, AxisProxy, x y both call // getData and setDate sequentially). // So the context.data should be fetched from // upstream each time when a stage starts to be // performed. if (task !== this.dataTask) { context.data = data; } } inner$4(this).data = data; }, /** * @see {module:echarts/data/helper/sourceHelper#getSource} * @return {module:echarts/data/Source} source */ getSource: function () { return getSource(this); }, /** * Get data before processed * @return {module:echarts/data/List} */ getRawData: function () { return inner$4(this).dataBeforeProcessed; }, /** * Get base axis if has coordinate system and has axis. * By default use coordSys.getBaseAxis(); * Can be overrided for some chart. * @return {type} description */ getBaseAxis: function () { var coordSys = this.coordinateSystem; return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis(); }, // FIXME /** * Default tooltip formatter * * @param {number} dataIndex * @param {boolean} [multipleSeries=false] * @param {number} [dataType] */ formatTooltip: function (dataIndex, multipleSeries, dataType) { function formatArrayValue(value) { // ??? TODO refactor these logic. // check: category-no-encode-has-axis-data in dataset.html var vertially = reduce(value, function (vertially, val, idx) { var dimItem = data.getDimensionInfo(idx); return vertially |= dimItem && dimItem.tooltip !== false && dimItem.displayName != null; }, 0); var result = []; tooltipDims.length ? each$1(tooltipDims, function (dim) { setEachItem(retrieveRawValue(data, dataIndex, dim), dim); }) // By default, all dims is used on tooltip. : each$1(value, setEachItem); function setEachItem(val, dim) { var dimInfo = data.getDimensionInfo(dim); // If `dimInfo.tooltip` is not set, show tooltip. if (!dimInfo || dimInfo.otherDims.tooltip === false) { return; } var dimType = dimInfo.type; var dimHead = getTooltipMarker({color: color, type: 'subItem'}); var valStr = (vertially ? dimHead + encodeHTML(dimInfo.displayName || '-') + ': ' : '' ) // FIXME should not format time for raw data? + encodeHTML(dimType === 'ordinal' ? val + '' : dimType === 'time' ? (multipleSeries ? '' : formatTime('yyyy/MM/dd hh:mm:ss', val)) : addCommas(val) ); valStr && result.push(valStr); } return (vertially ? '
          ' : '') + result.join(vertially ? '
          ' : ', '); } function formatSingleValue(val) { return encodeHTML(addCommas(val)); } var data = this.getData(); var tooltipDims = data.mapDimension('defaultedTooltip', true); var tooltipDimLen = tooltipDims.length; var value = this.getRawValue(dataIndex); var isValueArr = isArray(value); var color = data.getItemVisual(dataIndex, 'color'); if (isObject$1(color) && color.colorStops) { color = (color.colorStops[0] || {}).color; } color = color || 'transparent'; // Complicated rule for pretty tooltip. var formattedValue = (tooltipDimLen > 1 || (isValueArr && !tooltipDimLen)) ? formatArrayValue(value) : tooltipDimLen ? formatSingleValue(retrieveRawValue(data, dataIndex, tooltipDims[0])) : formatSingleValue(isValueArr ? value[0] : value); var colorEl = getTooltipMarker(color); var name = data.getName(dataIndex); var seriesName = this.name; if (!isNameSpecified(this)) { seriesName = ''; } seriesName = seriesName ? encodeHTML(seriesName) + (!multipleSeries ? '
          ' : ': ') : ''; return !multipleSeries ? seriesName + colorEl + (name ? encodeHTML(name) + ': ' + formattedValue : formattedValue ) : colorEl + seriesName + formattedValue; }, /** * @return {boolean} */ isAnimationEnabled: function () { if (env$1.node) { return false; } var animationEnabled = this.getShallow('animation'); if (animationEnabled) { if (this.getData().count() > this.getShallow('animationThreshold')) { animationEnabled = false; } } return animationEnabled; }, restoreData: function () { this.dataTask.dirty(); }, getColorFromPalette: function (name, scope, requestColorNum) { var ecModel = this.ecModel; // PENDING var color = colorPaletteMixin.getColorFromPalette.call(this, name, scope, requestColorNum); if (!color) { color = ecModel.getColorFromPalette(name, scope, requestColorNum); } return color; }, /** * Use `data.mapDimension(coordDim, true)` instead. * @deprecated */ coordDimToDataDim: function (coordDim) { return this.getRawData().mapDimension(coordDim, true); }, /** * Get progressive rendering count each step * @return {number} */ getProgressive: function () { return this.get('progressive'); }, /** * Get progressive rendering count each step * @return {number} */ getProgressiveThreshold: function () { return this.get('progressiveThreshold'); }, /** * Get data indices for show tooltip content. See tooltip. * @abstract * @param {Array.|string} dim * @param {Array.} value * @param {module:echarts/coord/single/SingleAxis} baseAxis * @return {Object} {dataIndices, nestestValue}. */ getAxisTooltipData: null, /** * See tooltip. * @abstract * @param {number} dataIndex * @return {Array.} Point of tooltip. null/undefined can be returned. */ getTooltipPosition: null, /** * @see {module:echarts/stream/Scheduler} */ pipeTask: null, /** * Convinient for override in extended class. * @protected * @type {Function} */ preventIncremental: null, /** * @public * @readOnly * @type {Object} */ pipelineContext: null }); mixin(SeriesModel, dataFormatMixin); mixin(SeriesModel, colorPaletteMixin); /** * MUST be called after `prepareSource` called * Here we need to make auto series, especially for auto legend. But we * do not modify series.name in option to avoid side effects. */ function autoSeriesName(seriesModel) { // User specified name has higher priority, otherwise it may cause // series can not be queried unexpectedly. var name = seriesModel.name; if (!isNameSpecified(seriesModel)) { seriesModel.name = getSeriesAutoName(seriesModel) || name; } } function getSeriesAutoName(seriesModel) { var data = seriesModel.getRawData(); var dataDims = data.mapDimension('seriesName', true); var nameArr = []; each$1(dataDims, function (dataDim) { var dimInfo = data.getDimensionInfo(dataDim); dimInfo.displayName && nameArr.push(dimInfo.displayName); }); return nameArr.join(' '); } function dataTaskCount(context) { return context.model.getRawData().count(); } function dataTaskReset(context) { var seriesModel = context.model; seriesModel.setData(seriesModel.getRawData().cloneShallow()); return dataTaskProgress; } function dataTaskProgress(param, context) { // Avoid repead cloneShallow when data just created in reset. if (param.end > context.outputData.count()) { context.model.getRawData().cloneShallow(context.outputData); } } // TODO refactor function wrapData(data, seriesModel) { each$1(data.CHANGABLE_METHODS, function (methodName) { data.wrapMethod(methodName, curry(onDataSelfChange, seriesModel)); }); } function onDataSelfChange(seriesModel) { var task = getCurrentTask(seriesModel); if (task) { // Consider case: filter, selectRange task.setOutputEnd(this.count()); } } function getCurrentTask(seriesModel) { var scheduler = (seriesModel.ecModel || {}).scheduler; var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid); if (pipeline) { // When pipline finished, the currrentTask keep the last // task (renderTask). var task = pipeline.currentTask; if (task) { var agentStubMap = task.agentStubMap; if (agentStubMap) { task = agentStubMap.get(seriesModel.uid); } } return task; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var Component = function () { /** * @type {module:zrender/container/Group} * @readOnly */ this.group = new Group(); /** * @type {string} * @readOnly */ this.uid = getUID('viewComponent'); }; Component.prototype = { constructor: Component, init: function (ecModel, api) {}, render: function (componentModel, ecModel, api, payload) {}, dispose: function () {} }; var componentProto = Component.prototype; componentProto.updateView = componentProto.updateLayout = componentProto.updateVisual = function (seriesModel, ecModel, api, payload) { // Do nothing; }; // Enable Component.extend. enableClassExtend(Component); // Enable capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on. enableClassManagement(Component, {registerWhenExtend: true}); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @return {string} If large mode changed, return string 'reset'; */ var createRenderPlanner = function () { var inner = makeInner(); return function (seriesModel) { var fields = inner(seriesModel); var pipelineContext = seriesModel.pipelineContext; var originalLarge = fields.large; var originalProgressive = fields.progressiveRender; var large = fields.large = pipelineContext.large; var progressive = fields.progressiveRender = pipelineContext.progressiveRender; return !!((originalLarge ^ large) || (originalProgressive ^ progressive)) && 'reset'; }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var inner$5 = makeInner(); var renderPlanner = createRenderPlanner(); function Chart() { /** * @type {module:zrender/container/Group} * @readOnly */ this.group = new Group(); /** * @type {string} * @readOnly */ this.uid = getUID('viewChart'); this.renderTask = createTask({ plan: renderTaskPlan, reset: renderTaskReset }); this.renderTask.context = {view: this}; } Chart.prototype = { type: 'chart', /** * Init the chart. * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api */ init: function (ecModel, api) {}, /** * Render the chart. * @param {module:echarts/model/Series} seriesModel * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api * @param {Object} payload */ render: function (seriesModel, ecModel, api, payload) {}, /** * Highlight series or specified data item. * @param {module:echarts/model/Series} seriesModel * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api * @param {Object} payload */ highlight: function (seriesModel, ecModel, api, payload) { toggleHighlight(seriesModel.getData(), payload, 'emphasis'); }, /** * Downplay series or specified data item. * @param {module:echarts/model/Series} seriesModel * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api * @param {Object} payload */ downplay: function (seriesModel, ecModel, api, payload) { toggleHighlight(seriesModel.getData(), payload, 'normal'); }, /** * Remove self. * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api */ remove: function (ecModel, api) { this.group.removeAll(); }, /** * Dispose self. * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api */ dispose: function () {}, /** * Rendering preparation in progressive mode. * @param {module:echarts/model/Series} seriesModel * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api * @param {Object} payload */ incrementalPrepareRender: null, /** * Render in progressive mode. * @param {module:echarts/model/Series} seriesModel * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api * @param {Object} payload */ incrementalRender: null, /** * Update transform directly. * @param {module:echarts/model/Series} seriesModel * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api * @param {Object} payload * @return {Object} {update: true} */ updateTransform: null /** * The view contains the given point. * @interface * @param {Array.} point * @return {boolean} */ // containPoint: function () {} }; var chartProto = Chart.prototype; chartProto.updateView = chartProto.updateLayout = chartProto.updateVisual = function (seriesModel, ecModel, api, payload) { this.render(seriesModel, ecModel, api, payload); }; /** * Set state of single element * @param {module:zrender/Element} el * @param {string} state */ function elSetState(el, state) { if (el) { el.trigger(state); if (el.type === 'group') { for (var i = 0; i < el.childCount(); i++) { elSetState(el.childAt(i), state); } } } } /** * @param {module:echarts/data/List} data * @param {Object} payload * @param {string} state 'normal'|'emphasis' */ function toggleHighlight(data, payload, state) { var dataIndex = queryDataIndex(data, payload); if (dataIndex != null) { each$1(normalizeToArray(dataIndex), function (dataIdx) { elSetState(data.getItemGraphicEl(dataIdx), state); }); } else { data.eachItemGraphicEl(function (el) { elSetState(el, state); }); } } // Enable Chart.extend. enableClassExtend(Chart, ['dispose']); // Add capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on. enableClassManagement(Chart, {registerWhenExtend: true}); Chart.markUpdateMethod = function (payload, methodName) { inner$5(payload).updateMethod = methodName; }; function renderTaskPlan(context) { return renderPlanner(context.model); } function renderTaskReset(context) { var seriesModel = context.model; var ecModel = context.ecModel; var api = context.api; var payload = context.payload; // ???! remove updateView updateVisual var progressiveRender = seriesModel.pipelineContext.progressiveRender; var view = context.view; var updateMethod = payload && inner$5(payload).updateMethod; var methodName = progressiveRender ? 'incrementalPrepareRender' : (updateMethod && view[updateMethod]) ? updateMethod // `appendData` is also supported when data amount // is less than progressive threshold. : 'render'; if (methodName !== 'render') { view[methodName](seriesModel, ecModel, api, payload); } return progressMethodMap[methodName]; } var progressMethodMap = { incrementalPrepareRender: { progress: function (params, context) { context.view.incrementalRender( params, context.model, context.ecModel, context.api, context.payload ); } }, render: { // Put view.render in `progress` to support appendData. But in this case // view.render should not be called in reset, otherwise it will be called // twise. Use `forceFirstProgress` to make sure that view.render is called // in any cases. forceFirstProgress: true, progress: function (params, context) { context.view.render( context.model, context.ecModel, context.api, context.payload ); } } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var ORIGIN_METHOD = '\0__throttleOriginMethod'; var RATE = '\0__throttleRate'; var THROTTLE_TYPE = '\0__throttleType'; /** * @public * @param {(Function)} fn * @param {number} [delay=0] Unit: ms. * @param {boolean} [debounce=false] * true: If call interval less than `delay`, only the last call works. * false: If call interval less than `delay, call works on fixed rate. * @return {(Function)} throttled fn. */ function throttle(fn, delay, debounce) { var currCall; var lastCall = 0; var lastExec = 0; var timer = null; var diff; var scope; var args; var debounceNextCall; delay = delay || 0; function exec() { lastExec = (new Date()).getTime(); timer = null; fn.apply(scope, args || []); } var cb = function () { currCall = (new Date()).getTime(); scope = this; args = arguments; var thisDelay = debounceNextCall || delay; var thisDebounce = debounceNextCall || debounce; debounceNextCall = null; diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay; clearTimeout(timer); // Here we should make sure that: the `exec` SHOULD NOT be called later // than a new call of `cb`, that is, preserving the command order. Consider // calculating "scale rate" when roaming as an example. When a call of `cb` // happens, either the `exec` is called dierectly, or the call is delayed. // But the delayed call should never be later than next call of `cb`. Under // this assurance, we can simply update view state each time `dispatchAction` // triggered by user roaming, but not need to add extra code to avoid the // state being "rolled-back". if (thisDebounce) { timer = setTimeout(exec, thisDelay); } else { if (diff >= 0) { exec(); } else { timer = setTimeout(exec, -diff); } } lastCall = currCall; }; /** * Clear throttle. * @public */ cb.clear = function () { if (timer) { clearTimeout(timer); timer = null; } }; /** * Enable debounce once. */ cb.debounceNextCall = function (debounceDelay) { debounceNextCall = debounceDelay; }; return cb; } /** * Create throttle method or update throttle rate. * * @example * ComponentView.prototype.render = function () { * ... * throttle.createOrUpdate( * this, * '_dispatchAction', * this.model.get('throttle'), * 'fixRate' * ); * }; * ComponentView.prototype.remove = function () { * throttle.clear(this, '_dispatchAction'); * }; * ComponentView.prototype.dispose = function () { * throttle.clear(this, '_dispatchAction'); * }; * * @public * @param {Object} obj * @param {string} fnAttr * @param {number} [rate] * @param {string} [throttleType='fixRate'] 'fixRate' or 'debounce' * @return {Function} throttled function. */ function createOrUpdate(obj, fnAttr, rate, throttleType) { var fn = obj[fnAttr]; if (!fn) { return; } var originFn = fn[ORIGIN_METHOD] || fn; var lastThrottleType = fn[THROTTLE_TYPE]; var lastRate = fn[RATE]; if (lastRate !== rate || lastThrottleType !== throttleType) { if (rate == null || !throttleType) { return (obj[fnAttr] = originFn); } fn = obj[fnAttr] = throttle( originFn, rate, throttleType === 'debounce' ); fn[ORIGIN_METHOD] = originFn; fn[THROTTLE_TYPE] = throttleType; fn[RATE] = rate; } return fn; } /** * Clear throttle. Example see throttle.createOrUpdate. * * @public * @param {Object} obj * @param {string} fnAttr */ function clear(obj, fnAttr) { var fn = obj[fnAttr]; if (fn && fn[ORIGIN_METHOD]) { obj[fnAttr] = fn[ORIGIN_METHOD]; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var seriesColor = { createOnAllSeries: true, performRawSeries: true, reset: function (seriesModel, ecModel) { var data = seriesModel.getData(); var colorAccessPath = (seriesModel.visualColorAccessPath || 'itemStyle.color').split('.'); var color = seriesModel.get(colorAccessPath) // Set in itemStyle || seriesModel.getColorFromPalette( // TODO series count changed. seriesModel.name, null, ecModel.getSeriesCount() ); // Default color // FIXME Set color function or use the platte color data.setVisual('color', color); // Only visible series has each data be visual encoded if (!ecModel.isSeriesFiltered(seriesModel)) { if (typeof color === 'function' && !(color instanceof Gradient)) { data.each(function (idx) { data.setItemVisual( idx, 'color', color(seriesModel.getDataParams(idx)) ); }); } // itemStyle in each data item var dataEach = function (data, idx) { var itemModel = data.getItemModel(idx); var color = itemModel.get(colorAccessPath, true); if (color != null) { data.setItemVisual(idx, 'color', color); } }; return { dataEach: data.hasItemOption ? dataEach : null }; } } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var lang = { toolbox: { brush: { title: { rect: '矩形选择', polygon: '圈选', lineX: '横向选择', lineY: '纵向选择', keep: '保持选择', clear: '清除选择' } }, dataView: { title: '数据视图', lang: ['数据视图', '关闭', '刷新'] }, dataZoom: { title: { zoom: '区域缩放', back: '区域缩放还原' } }, magicType: { title: { line: '切换为折线图', bar: '切换为柱状图', stack: '切换为堆叠', tiled: '切换为平铺' } }, restore: { title: '还原' }, saveAsImage: { title: '保存为图片', lang: ['右键另存为图片'] } }, series: { typeNames: { pie: '饼图', bar: '柱状图', line: '折线图', scatter: '散点图', effectScatter: '涟漪散点图', radar: '雷达图', tree: '树图', treemap: '矩形树图', boxplot: '箱型图', candlestick: 'K线图', k: 'K线图', heatmap: '热力图', map: '地图', parallel: '平行坐标图', lines: '线图', graph: '关系图', sankey: '桑基图', funnel: '漏斗图', gauge: '仪表盘图', pictorialBar: '象形柱图', themeRiver: '主题河流图', sunburst: '旭日图' } }, aria: { general: { withTitle: '这是一个关于“{title}”的图表。', withoutTitle: '这是一个图表,' }, series: { single: { prefix: '', withName: '图表类型是{seriesType},表示{seriesName}。', withoutName: '图表类型是{seriesType}。' }, multiple: { prefix: '它由{seriesCount}个图表系列组成。', withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},', withoutName: '第{seriesId}个系列是一个{seriesType},', separator: { middle: ';', end: '。' } } }, data: { allData: '其数据是——', partialData: '其中,前{displayCnt}项是——', withName: '{name}的数据是{value}', withoutName: '{value}', separator: { middle: ',', end: '' } } } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var aria = function (dom, ecModel) { var ariaModel = ecModel.getModel('aria'); if (!ariaModel.get('show')) { return; } else if (ariaModel.get('description')) { dom.setAttribute('aria-label', ariaModel.get('description')); return; } var seriesCnt = 0; ecModel.eachSeries(function (seriesModel, idx) { ++seriesCnt; }, this); var maxDataCnt = ariaModel.get('data.maxCount') || 10; var maxSeriesCnt = ariaModel.get('series.maxCount') || 10; var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt); var ariaLabel; if (seriesCnt < 1) { // No series, no aria label return; } else { var title = getTitle(); if (title) { ariaLabel = replace(getConfig('general.withTitle'), { title: title }); } else { ariaLabel = getConfig('general.withoutTitle'); } var seriesLabels = []; var prefix = seriesCnt > 1 ? 'series.multiple.prefix' : 'series.single.prefix'; ariaLabel += replace(getConfig(prefix), { seriesCount: seriesCnt }); ecModel.eachSeries(function (seriesModel, idx) { if (idx < displaySeriesCnt) { var seriesLabel; var seriesName = seriesModel.get('name'); var seriesTpl = 'series.' + (seriesCnt > 1 ? 'multiple' : 'single') + '.'; seriesLabel = getConfig(seriesName ? seriesTpl + 'withName' : seriesTpl + 'withoutName'); seriesLabel = replace(seriesLabel, { seriesId: seriesModel.seriesIndex, seriesName: seriesModel.get('name'), seriesType: getSeriesTypeName(seriesModel.subType) }); var data = seriesModel.getData(); window.data = data; if (data.count() > maxDataCnt) { // Show part of data seriesLabel += replace(getConfig('data.partialData'), { displayCnt: maxDataCnt }); } else { seriesLabel += getConfig('data.allData'); } var dataLabels = []; for (var i = 0; i < data.count(); i++) { if (i < maxDataCnt) { var name = data.getName(i); var value = retrieveRawValue(data, i); dataLabels.push( replace( name ? getConfig('data.withName') : getConfig('data.withoutName'), { name: name, value: value } ) ); } } seriesLabel += dataLabels .join(getConfig('data.separator.middle')) + getConfig('data.separator.end'); seriesLabels.push(seriesLabel); } }); ariaLabel += seriesLabels .join(getConfig('series.multiple.separator.middle')) + getConfig('series.multiple.separator.end'); dom.setAttribute('aria-label', ariaLabel); } function replace(str, keyValues) { if (typeof str !== 'string') { return str; } var result = str; each$1(keyValues, function (value, key) { result = result.replace( new RegExp('\\{\\s*' + key + '\\s*\\}', 'g'), value ); }); return result; } function getConfig(path) { var userConfig = ariaModel.get(path); if (userConfig == null) { var pathArr = path.split('.'); var result = lang.aria; for (var i = 0; i < pathArr.length; ++i) { result = result[pathArr[i]]; } return result; } else { return userConfig; } } function getTitle() { var title = ecModel.getModel('title').option; if (title && title.length) { title = title[0]; } return title && title.text; } function getSeriesTypeName(type) { return lang.series.typeNames[type] || '自定义图'; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var PI$1 = Math.PI; /** * @param {module:echarts/ExtensionAPI} api * @param {Object} [opts] * @param {string} [opts.text] * @param {string} [opts.color] * @param {string} [opts.textColor] * @return {module:zrender/Element} */ var loadingDefault = function (api, opts) { opts = opts || {}; defaults(opts, { text: 'loading', color: '#c23531', textColor: '#000', maskColor: 'rgba(255, 255, 255, 0.8)', zlevel: 0 }); var mask = new Rect({ style: { fill: opts.maskColor }, zlevel: opts.zlevel, z: 10000 }); var arc = new Arc({ shape: { startAngle: -PI$1 / 2, endAngle: -PI$1 / 2 + 0.1, r: 10 }, style: { stroke: opts.color, lineCap: 'round', lineWidth: 5 }, zlevel: opts.zlevel, z: 10001 }); var labelRect = new Rect({ style: { fill: 'none', text: opts.text, textPosition: 'right', textDistance: 10, textFill: opts.textColor }, zlevel: opts.zlevel, z: 10001 }); arc.animateShape(true) .when(1000, { endAngle: PI$1 * 3 / 2 }) .start('circularInOut'); arc.animateShape(true) .when(1000, { startAngle: PI$1 * 3 / 2 }) .delay(300) .start('circularInOut'); var group = new Group(); group.add(arc); group.add(labelRect); group.add(mask); // Inject resize group.resize = function () { var cx = api.getWidth() / 2; var cy = api.getHeight() / 2; arc.setShape({ cx: cx, cy: cy }); var r = arc.shape.r; labelRect.setShape({ x: cx - r, y: cy - r, width: r * 2, height: r * 2 }); mask.setShape({ x: 0, y: 0, width: api.getWidth(), height: api.getHeight() }); }; group.resize(); return group; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @module echarts/stream/Scheduler */ /** * @constructor */ function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) { this.ecInstance = ecInstance; this.api = api; this.unfinished; // Fix current processors in case that in some rear cases that // processors might be registered after echarts instance created. // Register processors incrementally for a echarts instance is // not supported by this stream architecture. var dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice(); var visualHandlers = this._visualHandlers = visualHandlers.slice(); this._allHandlers = dataProcessorHandlers.concat(visualHandlers); /** * @private * @type { * [handlerUID: string]: { * seriesTaskMap?: { * [seriesUID: string]: Task * }, * overallTask?: Task * } * } */ this._stageTaskMap = createHashMap(); } var proto = Scheduler.prototype; /** * @param {module:echarts/model/Global} ecModel * @param {Object} payload */ proto.restoreData = function (ecModel, payload) { // TODO: Only restroe needed series and components, but not all components. // Currently `restoreData` of all of the series and component will be called. // But some independent components like `title`, `legend`, `graphic`, `toolbox`, // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`, // and some components like coordinate system, axes, dataZoom, visualMap only // need their target series refresh. // (1) If we are implementing this feature some day, we should consider these cases: // if a data processor depends on a component (e.g., dataZoomProcessor depends // on the settings of `dataZoom`), it should be re-performed if the component // is modified by `setOption`. // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`, // it should be re-performed when the result array of `getTargetSeries` changed. // We use `dependencies` to cover these issues. // (3) How to update target series when coordinate system related components modified. // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty, // and this case all of the tasks will be set as dirty. ecModel.restoreData(payload); // Theoretically an overall task not only depends on each of its target series, but also // depends on all of the series. // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure // that the overall task is set as dirty and to be performed, otherwise it probably cause // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it // probably cause state chaos (consider `dataZoomProcessor`). this._stageTaskMap.each(function (taskRecord) { var overallTask = taskRecord.overallTask; overallTask && overallTask.dirty(); }); }; // If seriesModel provided, incremental threshold is check by series data. proto.getPerformArgs = function (task, isBlock) { // For overall task if (!task.__pipeline) { return; } var pipeline = this._pipelineMap.get(task.__pipeline.id); var pCtx = pipeline.context; var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex; var step = incremental ? pipeline.step : null; var modDataCount = pCtx && pCtx.modDataCount; var modBy = modDataCount != null ? Math.ceil(modDataCount / step): null; return {step: step, modBy: modBy, modDataCount: modDataCount}; }; proto.getPipeline = function (pipelineId) { return this._pipelineMap.get(pipelineId); }; /** * Current, progressive rendering starts from visual and layout. * Always detect render mode in the same stage, avoiding that incorrect * detection caused by data filtering. * Caution: * `updateStreamModes` use `seriesModel.getData()`. */ proto.updateStreamModes = function (seriesModel, view) { var pipeline = this._pipelineMap.get(seriesModel.uid); var data = seriesModel.getData(); var dataLen = data.count(); // `progressiveRender` means that can render progressively in each // animation frame. Note that some types of series do not provide // `view.incrementalPrepareRender` but support `chart.appendData`. We // use the term `incremental` but not `progressive` to describe the // case that `chart.appendData`. var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold; var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold'); // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint. // see `test/candlestick-large3.html` var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null; seriesModel.pipelineContext = pipeline.context = { progressiveRender: progressiveRender, modDataCount: modDataCount, large: large }; }; proto.restorePipelines = function (ecModel) { var scheduler = this; var pipelineMap = scheduler._pipelineMap = createHashMap(); ecModel.eachSeries(function (seriesModel) { var progressive = seriesModel.getProgressive(); var pipelineId = seriesModel.uid; pipelineMap.set(pipelineId, { id: pipelineId, head: null, tail: null, threshold: seriesModel.getProgressiveThreshold(), progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()), blockIndex: -1, step: Math.round(progressive || 700), count: 0 }); pipe(scheduler, seriesModel, seriesModel.dataTask); }); }; proto.prepareStageTasks = function () { var stageTaskMap = this._stageTaskMap; var ecModel = this.ecInstance.getModel(); var api = this.api; each$1(this._allHandlers, function (handler) { var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, []); handler.reset && createSeriesStageTask(this, handler, record, ecModel, api); handler.overallReset && createOverallStageTask(this, handler, record, ecModel, api); }, this); }; proto.prepareView = function (view, model, ecModel, api) { var renderTask = view.renderTask; var context = renderTask.context; context.model = model; context.ecModel = ecModel; context.api = api; renderTask.__block = !view.incrementalPrepareRender; pipe(this, model, renderTask); }; proto.performDataProcessorTasks = function (ecModel, payload) { // If we do not use `block` here, it should be considered when to update modes. performStageTasks(this, this._dataProcessorHandlers, ecModel, payload, {block: true}); }; // opt // opt.visualType: 'visual' or 'layout' // opt.setDirty proto.performVisualTasks = function (ecModel, payload, opt) { performStageTasks(this, this._visualHandlers, ecModel, payload, opt); }; function performStageTasks(scheduler, stageHandlers, ecModel, payload, opt) { opt = opt || {}; var unfinished; each$1(stageHandlers, function (stageHandler, idx) { if (opt.visualType && opt.visualType !== stageHandler.visualType) { return; } var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid); var seriesTaskMap = stageHandlerRecord.seriesTaskMap; var overallTask = stageHandlerRecord.overallTask; if (overallTask) { var overallNeedDirty; var agentStubMap = overallTask.agentStubMap; agentStubMap.each(function (stub) { if (needSetDirty(opt, stub)) { stub.dirty(); overallNeedDirty = true; } }); overallNeedDirty && overallTask.dirty(); updatePayload(overallTask, payload); var performArgs = scheduler.getPerformArgs(overallTask, opt.block); // Execute stubs firstly, which may set the overall task dirty, // then execute the overall task. And stub will call seriesModel.setData, // which ensures that in the overallTask seriesModel.getData() will not // return incorrect data. agentStubMap.each(function (stub) { stub.perform(performArgs); }); unfinished |= overallTask.perform(performArgs); } else if (seriesTaskMap) { seriesTaskMap.each(function (task, pipelineId) { if (needSetDirty(opt, task)) { task.dirty(); } var performArgs = scheduler.getPerformArgs(task, opt.block); performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model); updatePayload(task, payload); unfinished |= task.perform(performArgs); }); } }); function needSetDirty(opt, task) { return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id)); } scheduler.unfinished |= unfinished; } proto.performSeriesTasks = function (ecModel) { var unfinished; ecModel.eachSeries(function (seriesModel) { // Progress to the end for dataInit and dataRestore. unfinished |= seriesModel.dataTask.perform(); }); this.unfinished |= unfinished; }; proto.plan = function () { // Travel pipelines, check block. this._pipelineMap.each(function (pipeline) { var task = pipeline.tail; do { if (task.__block) { pipeline.blockIndex = task.__idxInPipeline; break; } task = task.getUpstream(); } while (task); }); }; var updatePayload = proto.updatePayload = function (task, payload) { payload !== 'remain' && (task.context.payload = payload); }; function createSeriesStageTask(scheduler, stageHandler, stageHandlerRecord, ecModel, api) { var seriesTaskMap = stageHandlerRecord.seriesTaskMap || (stageHandlerRecord.seriesTaskMap = createHashMap()); var seriesType = stageHandler.seriesType; var getTargetSeries = stageHandler.getTargetSeries; // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily, // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`, // it works but it may cause other irrelevant charts blocked. if (stageHandler.createOnAllSeries) { ecModel.eachRawSeries(create); } else if (seriesType) { ecModel.eachRawSeriesByType(seriesType, create); } else if (getTargetSeries) { getTargetSeries(ecModel, api).each(create); } function create(seriesModel) { var pipelineId = seriesModel.uid; // Init tasks for each seriesModel only once. // Reuse original task instance. var task = seriesTaskMap.get(pipelineId) || seriesTaskMap.set(pipelineId, createTask({ plan: seriesTaskPlan, reset: seriesTaskReset, count: seriesTaskCount })); task.context = { model: seriesModel, ecModel: ecModel, api: api, useClearVisual: stageHandler.isVisual && !stageHandler.isLayout, plan: stageHandler.plan, reset: stageHandler.reset, scheduler: scheduler }; pipe(scheduler, seriesModel, task); } // Clear unused series tasks. var pipelineMap = scheduler._pipelineMap; seriesTaskMap.each(function (task, pipelineId) { if (!pipelineMap.get(pipelineId)) { task.dispose(); seriesTaskMap.removeKey(pipelineId); } }); } function createOverallStageTask(scheduler, stageHandler, stageHandlerRecord, ecModel, api) { var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask // For overall task, the function only be called on reset stage. || createTask({reset: overallTaskReset}); overallTask.context = { ecModel: ecModel, api: api, overallReset: stageHandler.overallReset, scheduler: scheduler }; // Reuse orignal stubs. var agentStubMap = overallTask.agentStubMap = overallTask.agentStubMap || createHashMap(); var seriesType = stageHandler.seriesType; var getTargetSeries = stageHandler.getTargetSeries; var overallProgress = true; var modifyOutputEnd = stageHandler.modifyOutputEnd; // An overall task with seriesType detected or has `getTargetSeries`, we add // stub in each pipelines, it will set the overall task dirty when the pipeline // progress. Moreover, to avoid call the overall task each frame (too frequent), // we set the pipeline block. if (seriesType) { ecModel.eachRawSeriesByType(seriesType, createStub); } else if (getTargetSeries) { getTargetSeries(ecModel, api).each(createStub); } // Otherwise, (usually it is legancy case), the overall task will only be // executed when upstream dirty. Otherwise the progressive rendering of all // pipelines will be disabled unexpectedly. But it still needs stubs to receive // dirty info from upsteam. else { overallProgress = false; each$1(ecModel.getSeries(), createStub); } function createStub(seriesModel) { var pipelineId = seriesModel.uid; var stub = agentStubMap.get(pipelineId); if (!stub) { stub = agentStubMap.set(pipelineId, createTask( {reset: stubReset, onDirty: stubOnDirty} )); // When the result of `getTargetSeries` changed, the overallTask // should be set as dirty and re-performed. overallTask.dirty(); } stub.context = { model: seriesModel, overallProgress: overallProgress, modifyOutputEnd: modifyOutputEnd }; stub.agent = overallTask; stub.__block = overallProgress; pipe(scheduler, seriesModel, stub); } // Clear unused stubs. var pipelineMap = scheduler._pipelineMap; agentStubMap.each(function (stub, pipelineId) { if (!pipelineMap.get(pipelineId)) { stub.dispose(); // When the result of `getTargetSeries` changed, the overallTask // should be set as dirty and re-performed. overallTask.dirty(); agentStubMap.removeKey(pipelineId); } }); } function overallTaskReset(context) { context.overallReset( context.ecModel, context.api, context.payload ); } function stubReset(context, upstreamContext) { return context.overallProgress && stubProgress; } function stubProgress() { this.agent.dirty(); this.getDownstream().dirty(); } function stubOnDirty() { this.agent && this.agent.dirty(); } function seriesTaskPlan(context) { return context.plan && context.plan( context.model, context.ecModel, context.api, context.payload ); } function seriesTaskReset(context) { if (context.useClearVisual) { context.data.clearAllVisual(); } var resetDefines = context.resetDefines = normalizeToArray(context.reset( context.model, context.ecModel, context.api, context.payload )); return resetDefines.length > 1 ? map(resetDefines, function (v, idx) { return makeSeriesTaskProgress(idx); }) : singleSeriesTaskProgress; } var singleSeriesTaskProgress = makeSeriesTaskProgress(0); function makeSeriesTaskProgress(resetDefineIdx) { return function (params, context) { var data = context.data; var resetDefine = context.resetDefines[resetDefineIdx]; if (resetDefine && resetDefine.dataEach) { for (var i = params.start; i < params.end; i++) { resetDefine.dataEach(data, i); } } else if (resetDefine && resetDefine.progress) { resetDefine.progress(params, data); } }; } function seriesTaskCount(context) { return context.data.count(); } function pipe(scheduler, seriesModel, task) { var pipelineId = seriesModel.uid; var pipeline = scheduler._pipelineMap.get(pipelineId); !pipeline.head && (pipeline.head = task); pipeline.tail && pipeline.tail.pipe(task); pipeline.tail = task; task.__idxInPipeline = pipeline.count++; task.__pipeline = pipeline; } Scheduler.wrapStageHandler = function (stageHandler, visualType) { if (isFunction$1(stageHandler)) { stageHandler = { overallReset: stageHandler, seriesType: detectSeriseType(stageHandler) }; } stageHandler.uid = getUID('stageHandler'); visualType && (stageHandler.visualType = visualType); return stageHandler; }; /** * Only some legacy stage handlers (usually in echarts extensions) are pure function. * To ensure that they can work normally, they should work in block mode, that is, * they should not be started util the previous tasks finished. So they cause the * progressive rendering disabled. We try to detect the series type, to narrow down * the block range to only the series type they concern, but not all series. */ function detectSeriseType(legacyFunc) { seriesType = null; try { // Assume there is no async when calling `eachSeriesByType`. legacyFunc(ecModelMock, apiMock); } catch (e) { } return seriesType; } var ecModelMock = {}; var apiMock = {}; var seriesType; mockMethods(ecModelMock, GlobalModel); mockMethods(apiMock, ExtensionAPI); ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) { seriesType = type; }; ecModelMock.eachComponent = function (cond) { if (cond.mainType === 'series' && cond.subType) { seriesType = cond.subType; } }; function mockMethods(target, Clz) { for (var name in Clz.prototype) { // Do not use hasOwnProperty target[name] = noop; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C','#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF']; var lightTheme = { color: colorAll, colorLayer: [ ['#37A2DA', '#ffd85c', '#fd7b5f'], ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'], ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'], colorAll ] }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var contrastColor = '#eee'; var axisCommon = function () { return { axisLine: { lineStyle: { color: contrastColor } }, axisTick: { lineStyle: { color: contrastColor } }, axisLabel: { textStyle: { color: contrastColor } }, splitLine: { lineStyle: { type: 'dashed', color: '#aaa' } }, splitArea: { areaStyle: { color: contrastColor } } }; }; var colorPalette = ['#dd6b66','#759aa0','#e69d87','#8dc1a9','#ea7e53','#eedd78','#73a373','#73b9bc','#7289ab', '#91ca8c','#f49f42']; var theme = { color: colorPalette, backgroundColor: '#333', tooltip: { axisPointer: { lineStyle: { color: contrastColor }, crossStyle: { color: contrastColor } } }, legend: { textStyle: { color: contrastColor } }, textStyle: { color: contrastColor }, title: { textStyle: { color: contrastColor } }, toolbox: { iconStyle: { normal: { borderColor: contrastColor } } }, dataZoom: { textStyle: { color: contrastColor } }, visualMap: { textStyle: { color: contrastColor } }, timeline: { lineStyle: { color: contrastColor }, itemStyle: { normal: { color: colorPalette[1] } }, label: { normal: { textStyle: { color: contrastColor } } }, controlStyle: { normal: { color: contrastColor, borderColor: contrastColor } } }, timeAxis: axisCommon(), logAxis: axisCommon(), valueAxis: axisCommon(), categoryAxis: axisCommon(), line: { symbol: 'circle' }, graph: { color: colorPalette }, gauge: { title: { textStyle: { color: contrastColor } } }, candlestick: { itemStyle: { normal: { color: '#FD1050', color0: '#0CF49B', borderColor: '#FD1050', borderColor0: '#0CF49B' } } } }; theme.categoryAxis.splitLine.show = false; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * This module is imported by echarts directly. * * Notice: * Always keep this file exists for backward compatibility. * Because before 4.1.0, dataset is an optional component, * some users may import this module manually. */ ComponentModel.extend({ type: 'dataset', /** * @protected */ defaultOption: { // 'row', 'column' seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN, // null/'auto': auto detect header, see "module:echarts/data/helper/sourceHelper" sourceHeader: null, dimensions: null, source: null }, optionUpdated: function () { detectSourceFormat(this); } }); Component.extend({ type: 'dataset' }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var assert = assert$1; var each = each$1; var isFunction = isFunction$1; var isObject = isObject$1; var parseClassType = ComponentModel.parseClassType; var version = '4.1.0'; var dependencies = { zrender: '4.0.4' }; var TEST_FRAME_REMAIN_TIME = 1; var PRIORITY_PROCESSOR_FILTER = 1000; var PRIORITY_PROCESSOR_STATISTIC = 5000; var PRIORITY_VISUAL_LAYOUT = 1000; var PRIORITY_VISUAL_GLOBAL = 2000; var PRIORITY_VISUAL_CHART = 3000; var PRIORITY_VISUAL_COMPONENT = 4000; // FIXME // necessary? var PRIORITY_VISUAL_BRUSH = 5000; var PRIORITY = { PROCESSOR: { FILTER: PRIORITY_PROCESSOR_FILTER, STATISTIC: PRIORITY_PROCESSOR_STATISTIC }, VISUAL: { LAYOUT: PRIORITY_VISUAL_LAYOUT, GLOBAL: PRIORITY_VISUAL_GLOBAL, CHART: PRIORITY_VISUAL_CHART, COMPONENT: PRIORITY_VISUAL_COMPONENT, BRUSH: PRIORITY_VISUAL_BRUSH } }; // Main process have three entries: `setOption`, `dispatchAction` and `resize`, // where they must not be invoked nestedly, except the only case: invoke // dispatchAction with updateMethod "none" in main process. // This flag is used to carry out this rule. // All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]). var IN_MAIN_PROCESS = '__flagInMainProcess'; var OPTION_UPDATED = '__optionUpdated'; var ACTION_REG = /^[a-zA-Z0-9_]+$/; function createRegisterEventWithLowercaseName(method) { return function (eventName, handler, context) { // Event name is all lowercase eventName = eventName && eventName.toLowerCase(); Eventful.prototype[method].call(this, eventName, handler, context); }; } /** * @module echarts~MessageCenter */ function MessageCenter() { Eventful.call(this); } MessageCenter.prototype.on = createRegisterEventWithLowercaseName('on'); MessageCenter.prototype.off = createRegisterEventWithLowercaseName('off'); MessageCenter.prototype.one = createRegisterEventWithLowercaseName('one'); mixin(MessageCenter, Eventful); /** * @module echarts~ECharts */ function ECharts(dom, theme$$1, opts) { opts = opts || {}; // Get theme by name if (typeof theme$$1 === 'string') { theme$$1 = themeStorage[theme$$1]; } /** * @type {string} */ this.id; /** * Group id * @type {string} */ this.group; /** * @type {HTMLElement} * @private */ this._dom = dom; var defaultRenderer = 'canvas'; if (__DEV__) { defaultRenderer = ( typeof window === 'undefined' ? global : window ).__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer; } /** * @type {module:zrender/ZRender} * @private */ var zr = this._zr = init$1(dom, { renderer: opts.renderer || defaultRenderer, devicePixelRatio: opts.devicePixelRatio, width: opts.width, height: opts.height }); /** * Expect 60 pfs. * @type {Function} * @private */ this._throttledZrFlush = throttle(bind(zr.flush, zr), 17); var theme$$1 = clone(theme$$1); theme$$1 && backwardCompat(theme$$1, true); /** * @type {Object} * @private */ this._theme = theme$$1; /** * @type {Array.} * @private */ this._chartsViews = []; /** * @type {Object.} * @private */ this._chartsMap = {}; /** * @type {Array.} * @private */ this._componentsViews = []; /** * @type {Object.} * @private */ this._componentsMap = {}; /** * @type {module:echarts/CoordinateSystem} * @private */ this._coordSysMgr = new CoordinateSystemManager(); /** * @type {module:echarts/ExtensionAPI} * @private */ var api = this._api = createExtensionAPI(this); // Sort on demand function prioritySortFunc(a, b) { return a.__prio - b.__prio; } sort(visualFuncs, prioritySortFunc); sort(dataProcessorFuncs, prioritySortFunc); /** * @type {module:echarts/stream/Scheduler} */ this._scheduler = new Scheduler(this, api, dataProcessorFuncs, visualFuncs); Eventful.call(this); /** * @type {module:echarts~MessageCenter} * @private */ this._messageCenter = new MessageCenter(); // Init mouse events this._initEvents(); // In case some people write `window.onresize = chart.resize` this.resize = bind(this.resize, this); // Can't dispatch action during rendering procedure this._pendingActions = []; zr.animation.on('frame', this._onframe, this); bindRenderedEvent(zr, this); // ECharts instance can be used as value. setAsPrimitive(this); } var echartsProto = ECharts.prototype; echartsProto._onframe = function () { if (this._disposed) { return; } var scheduler = this._scheduler; // Lazy update if (this[OPTION_UPDATED]) { var silent = this[OPTION_UPDATED].silent; this[IN_MAIN_PROCESS] = true; prepare(this); updateMethods.update.call(this); this[IN_MAIN_PROCESS] = false; this[OPTION_UPDATED] = false; flushPendingActions.call(this, silent); triggerUpdatedEvent.call(this, silent); } // Avoid do both lazy update and progress in one frame. else if (scheduler.unfinished) { // Stream progress. var remainTime = TEST_FRAME_REMAIN_TIME; var ecModel = this._model; var api = this._api; scheduler.unfinished = false; do { var startTime = +new Date(); scheduler.performSeriesTasks(ecModel); // Currently dataProcessorFuncs do not check threshold. scheduler.performDataProcessorTasks(ecModel); updateStreamModes(this, ecModel); // Do not update coordinate system here. Because that coord system update in // each frame is not a good user experience. So we follow the rule that // the extent of the coordinate system is determin in the first frame (the // frame is executed immedietely after task reset. // this._coordSysMgr.update(ecModel, api); // console.log('--- ec frame visual ---', remainTime); scheduler.performVisualTasks(ecModel); renderSeries(this, this._model, api, 'remain'); remainTime -= (+new Date() - startTime); } while (remainTime > 0 && scheduler.unfinished); // Call flush explicitly for trigger finished event. if (!scheduler.unfinished) { this._zr.flush(); } // Else, zr flushing be ensue within the same frame, // because zr flushing is after onframe event. } }; /** * @return {HTMLElement} */ echartsProto.getDom = function () { return this._dom; }; /** * @return {module:zrender~ZRender} */ echartsProto.getZr = function () { return this._zr; }; /** * Usage: * chart.setOption(option, notMerge, lazyUpdate); * chart.setOption(option, { * notMerge: ..., * lazyUpdate: ..., * silent: ... * }); * * @param {Object} option * @param {Object|boolean} [opts] opts or notMerge. * @param {boolean} [opts.notMerge=false] * @param {boolean} [opts.lazyUpdate=false] Useful when setOption frequently. */ echartsProto.setOption = function (option, notMerge, lazyUpdate) { if (__DEV__) { assert(!this[IN_MAIN_PROCESS], '`setOption` should not be called during main process.'); } var silent; if (isObject(notMerge)) { lazyUpdate = notMerge.lazyUpdate; silent = notMerge.silent; notMerge = notMerge.notMerge; } this[IN_MAIN_PROCESS] = true; if (!this._model || notMerge) { var optionManager = new OptionManager(this._api); var theme$$1 = this._theme; var ecModel = this._model = new GlobalModel(null, null, theme$$1, optionManager); ecModel.scheduler = this._scheduler; ecModel.init(null, null, theme$$1, optionManager); } this._model.setOption(option, optionPreprocessorFuncs); if (lazyUpdate) { this[OPTION_UPDATED] = {silent: silent}; this[IN_MAIN_PROCESS] = false; } else { prepare(this); updateMethods.update.call(this); // Ensure zr refresh sychronously, and then pixel in canvas can be // fetched after `setOption`. this._zr.flush(); this[OPTION_UPDATED] = false; this[IN_MAIN_PROCESS] = false; flushPendingActions.call(this, silent); triggerUpdatedEvent.call(this, silent); } }; /** * @DEPRECATED */ echartsProto.setTheme = function () { console.log('ECharts#setTheme() is DEPRECATED in ECharts 3.0'); }; /** * @return {module:echarts/model/Global} */ echartsProto.getModel = function () { return this._model; }; /** * @return {Object} */ echartsProto.getOption = function () { return this._model && this._model.getOption(); }; /** * @return {number} */ echartsProto.getWidth = function () { return this._zr.getWidth(); }; /** * @return {number} */ echartsProto.getHeight = function () { return this._zr.getHeight(); }; /** * @return {number} */ echartsProto.getDevicePixelRatio = function () { return this._zr.painter.dpr || window.devicePixelRatio || 1; }; /** * Get canvas which has all thing rendered * @param {Object} opts * @param {string} [opts.backgroundColor] * @return {string} */ echartsProto.getRenderedCanvas = function (opts) { if (!env$1.canvasSupported) { return; } opts = opts || {}; opts.pixelRatio = opts.pixelRatio || 1; opts.backgroundColor = opts.backgroundColor || this._model.get('backgroundColor'); var zr = this._zr; // var list = zr.storage.getDisplayList(); // Stop animations // Never works before in init animation, so remove it. // zrUtil.each(list, function (el) { // el.stopAnimation(true); // }); return zr.painter.getRenderedCanvas(opts); }; /** * Get svg data url * @return {string} */ echartsProto.getSvgDataUrl = function () { if (!env$1.svgSupported) { return; } var zr = this._zr; var list = zr.storage.getDisplayList(); // Stop animations each$1(list, function (el) { el.stopAnimation(true); }); return zr.painter.pathToDataUrl(); }; /** * @return {string} * @param {Object} opts * @param {string} [opts.type='png'] * @param {string} [opts.pixelRatio=1] * @param {string} [opts.backgroundColor] * @param {string} [opts.excludeComponents] */ echartsProto.getDataURL = function (opts) { opts = opts || {}; var excludeComponents = opts.excludeComponents; var ecModel = this._model; var excludesComponentViews = []; var self = this; each(excludeComponents, function (componentType) { ecModel.eachComponent({ mainType: componentType }, function (component) { var view = self._componentsMap[component.__viewId]; if (!view.group.ignore) { excludesComponentViews.push(view); view.group.ignore = true; } }); }); var url = this._zr.painter.getType() === 'svg' ? this.getSvgDataUrl() : this.getRenderedCanvas(opts).toDataURL( 'image/' + (opts && opts.type || 'png') ); each(excludesComponentViews, function (view) { view.group.ignore = false; }); return url; }; /** * @return {string} * @param {Object} opts * @param {string} [opts.type='png'] * @param {string} [opts.pixelRatio=1] * @param {string} [opts.backgroundColor] */ echartsProto.getConnectedDataURL = function (opts) { if (!env$1.canvasSupported) { return; } var groupId = this.group; var mathMin = Math.min; var mathMax = Math.max; var MAX_NUMBER = Infinity; if (connectedGroups[groupId]) { var left = MAX_NUMBER; var top = MAX_NUMBER; var right = -MAX_NUMBER; var bottom = -MAX_NUMBER; var canvasList = []; var dpr = (opts && opts.pixelRatio) || 1; each$1(instances, function (chart, id) { if (chart.group === groupId) { var canvas = chart.getRenderedCanvas( clone(opts) ); var boundingRect = chart.getDom().getBoundingClientRect(); left = mathMin(boundingRect.left, left); top = mathMin(boundingRect.top, top); right = mathMax(boundingRect.right, right); bottom = mathMax(boundingRect.bottom, bottom); canvasList.push({ dom: canvas, left: boundingRect.left, top: boundingRect.top }); } }); left *= dpr; top *= dpr; right *= dpr; bottom *= dpr; var width = right - left; var height = bottom - top; var targetCanvas = createCanvas(); targetCanvas.width = width; targetCanvas.height = height; var zr = init$1(targetCanvas); each(canvasList, function (item) { var img = new ZImage({ style: { x: item.left * dpr - left, y: item.top * dpr - top, image: item.dom } }); zr.add(img); }); zr.refreshImmediately(); return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png')); } else { return this.getDataURL(opts); } }; /** * Convert from logical coordinate system to pixel coordinate system. * See CoordinateSystem#convertToPixel. * @param {string|Object} finder * If string, e.g., 'geo', means {geoIndex: 0}. * If Object, could contain some of these properties below: * { * seriesIndex / seriesId / seriesName, * geoIndex / geoId, geoName, * bmapIndex / bmapId / bmapName, * xAxisIndex / xAxisId / xAxisName, * yAxisIndex / yAxisId / yAxisName, * gridIndex / gridId / gridName, * ... (can be extended) * } * @param {Array|number} value * @return {Array|number} result */ echartsProto.convertToPixel = curry(doConvertPixel, 'convertToPixel'); /** * Convert from pixel coordinate system to logical coordinate system. * See CoordinateSystem#convertFromPixel. * @param {string|Object} finder * If string, e.g., 'geo', means {geoIndex: 0}. * If Object, could contain some of these properties below: * { * seriesIndex / seriesId / seriesName, * geoIndex / geoId / geoName, * bmapIndex / bmapId / bmapName, * xAxisIndex / xAxisId / xAxisName, * yAxisIndex / yAxisId / yAxisName * gridIndex / gridId / gridName, * ... (can be extended) * } * @param {Array|number} value * @return {Array|number} result */ echartsProto.convertFromPixel = curry(doConvertPixel, 'convertFromPixel'); function doConvertPixel(methodName, finder, value) { var ecModel = this._model; var coordSysList = this._coordSysMgr.getCoordinateSystems(); var result; finder = parseFinder(ecModel, finder); for (var i = 0; i < coordSysList.length; i++) { var coordSys = coordSysList[i]; if (coordSys[methodName] && (result = coordSys[methodName](ecModel, finder, value)) != null ) { return result; } } if (__DEV__) { console.warn( 'No coordinate system that supports ' + methodName + ' found by the given finder.' ); } } /** * Is the specified coordinate systems or components contain the given pixel point. * @param {string|Object} finder * If string, e.g., 'geo', means {geoIndex: 0}. * If Object, could contain some of these properties below: * { * seriesIndex / seriesId / seriesName, * geoIndex / geoId / geoName, * bmapIndex / bmapId / bmapName, * xAxisIndex / xAxisId / xAxisName, * yAxisIndex / yAxisId / yAxisName, * gridIndex / gridId / gridName, * ... (can be extended) * } * @param {Array|number} value * @return {boolean} result */ echartsProto.containPixel = function (finder, value) { var ecModel = this._model; var result; finder = parseFinder(ecModel, finder); each$1(finder, function (models, key) { key.indexOf('Models') >= 0 && each$1(models, function (model) { var coordSys = model.coordinateSystem; if (coordSys && coordSys.containPoint) { result |= !!coordSys.containPoint(value); } else if (key === 'seriesModels') { var view = this._chartsMap[model.__viewId]; if (view && view.containPoint) { result |= view.containPoint(value, model); } else { if (__DEV__) { console.warn(key + ': ' + (view ? 'The found component do not support containPoint.' : 'No view mapping to the found component.' )); } } } else { if (__DEV__) { console.warn(key + ': containPoint is not supported'); } } }, this); }, this); return !!result; }; /** * Get visual from series or data. * @param {string|Object} finder * If string, e.g., 'series', means {seriesIndex: 0}. * If Object, could contain some of these properties below: * { * seriesIndex / seriesId / seriesName, * dataIndex / dataIndexInside * } * If dataIndex is not specified, series visual will be fetched, * but not data item visual. * If all of seriesIndex, seriesId, seriesName are not specified, * visual will be fetched from first series. * @param {string} visualType 'color', 'symbol', 'symbolSize' */ echartsProto.getVisual = function (finder, visualType) { var ecModel = this._model; finder = parseFinder(ecModel, finder, {defaultMainType: 'series'}); var seriesModel = finder.seriesModel; if (__DEV__) { if (!seriesModel) { console.warn('There is no specified seires model'); } } var data = seriesModel.getData(); var dataIndexInside = finder.hasOwnProperty('dataIndexInside') ? finder.dataIndexInside : finder.hasOwnProperty('dataIndex') ? data.indexOfRawIndex(finder.dataIndex) : null; return dataIndexInside != null ? data.getItemVisual(dataIndexInside, visualType) : data.getVisual(visualType); }; /** * Get view of corresponding component model * @param {module:echarts/model/Component} componentModel * @return {module:echarts/view/Component} */ echartsProto.getViewOfComponentModel = function (componentModel) { return this._componentsMap[componentModel.__viewId]; }; /** * Get view of corresponding series model * @param {module:echarts/model/Series} seriesModel * @return {module:echarts/view/Chart} */ echartsProto.getViewOfSeriesModel = function (seriesModel) { return this._chartsMap[seriesModel.__viewId]; }; var updateMethods = { prepareAndUpdate: function (payload) { prepare(this); updateMethods.update.call(this, payload); }, /** * @param {Object} payload * @private */ update: function (payload) { // console.profile && console.profile('update'); var ecModel = this._model; var api = this._api; var zr = this._zr; var coordSysMgr = this._coordSysMgr; var scheduler = this._scheduler; // update before setOption if (!ecModel) { return; } scheduler.restoreData(ecModel, payload); scheduler.performSeriesTasks(ecModel); // TODO // Save total ecModel here for undo/redo (after restoring data and before processing data). // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call. // Create new coordinate system each update // In LineView may save the old coordinate system and use it to get the orignal point coordSysMgr.create(ecModel, api); scheduler.performDataProcessorTasks(ecModel, payload); // Current stream render is not supported in data process. So we can update // stream modes after data processing, where the filtered data is used to // deteming whether use progressive rendering. updateStreamModes(this, ecModel); // We update stream modes before coordinate system updated, then the modes info // can be fetched when coord sys updating (consider the barGrid extent fix). But // the drawback is the full coord info can not be fetched. Fortunately this full // coord is not requied in stream mode updater currently. coordSysMgr.update(ecModel, api); clearColorPalette(ecModel); scheduler.performVisualTasks(ecModel, payload); render(this, ecModel, api, payload); // Set background var backgroundColor = ecModel.get('backgroundColor') || 'transparent'; // In IE8 if (!env$1.canvasSupported) { var colorArr = parse(backgroundColor); backgroundColor = stringify(colorArr, 'rgb'); if (colorArr[3] === 0) { backgroundColor = 'transparent'; } } else { zr.setBackgroundColor(backgroundColor); } performPostUpdateFuncs(ecModel, api); // console.profile && console.profileEnd('update'); }, /** * @param {Object} payload * @private */ updateTransform: function (payload) { var ecModel = this._model; var ecIns = this; var api = this._api; // update before setOption if (!ecModel) { return; } // ChartView.markUpdateMethod(payload, 'updateTransform'); var componentDirtyList = []; ecModel.eachComponent(function (componentType, componentModel) { var componentView = ecIns.getViewOfComponentModel(componentModel); if (componentView && componentView.__alive) { if (componentView.updateTransform) { var result = componentView.updateTransform(componentModel, ecModel, api, payload); result && result.update && componentDirtyList.push(componentView); } else { componentDirtyList.push(componentView); } } }); var seriesDirtyMap = createHashMap(); ecModel.eachSeries(function (seriesModel) { var chartView = ecIns._chartsMap[seriesModel.__viewId]; if (chartView.updateTransform) { var result = chartView.updateTransform(seriesModel, ecModel, api, payload); result && result.update && seriesDirtyMap.set(seriesModel.uid, 1); } else { seriesDirtyMap.set(seriesModel.uid, 1); } }); clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true); this._scheduler.performVisualTasks( ecModel, payload, {setDirty: true, dirtyMap: seriesDirtyMap} ); // Currently, not call render of components. Geo render cost a lot. // renderComponents(ecIns, ecModel, api, payload, componentDirtyList); renderSeries(ecIns, ecModel, api, payload, seriesDirtyMap); performPostUpdateFuncs(ecModel, this._api); }, /** * @param {Object} payload * @private */ updateView: function (payload) { var ecModel = this._model; // update before setOption if (!ecModel) { return; } Chart.markUpdateMethod(payload, 'updateView'); clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. this._scheduler.performVisualTasks(ecModel, payload, {setDirty: true}); render(this, this._model, this._api, payload); performPostUpdateFuncs(ecModel, this._api); }, /** * @param {Object} payload * @private */ updateVisual: function (payload) { updateMethods.update.call(this, payload); // var ecModel = this._model; // // update before setOption // if (!ecModel) { // return; // } // ChartView.markUpdateMethod(payload, 'updateVisual'); // clearColorPalette(ecModel); // // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. // this._scheduler.performVisualTasks(ecModel, payload, {visualType: 'visual', setDirty: true}); // render(this, this._model, this._api, payload); // performPostUpdateFuncs(ecModel, this._api); }, /** * @param {Object} payload * @private */ updateLayout: function (payload) { updateMethods.update.call(this, payload); // var ecModel = this._model; // // update before setOption // if (!ecModel) { // return; // } // ChartView.markUpdateMethod(payload, 'updateLayout'); // // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. // // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true); // this._scheduler.performVisualTasks(ecModel, payload, {setDirty: true}); // render(this, this._model, this._api, payload); // performPostUpdateFuncs(ecModel, this._api); } }; function prepare(ecIns) { var ecModel = ecIns._model; var scheduler = ecIns._scheduler; scheduler.restorePipelines(ecModel); scheduler.prepareStageTasks(); prepareView(ecIns, 'component', ecModel, scheduler); prepareView(ecIns, 'chart', ecModel, scheduler); scheduler.plan(); } /** * @private */ function updateDirectly(ecIns, method, payload, mainType, subType) { var ecModel = ecIns._model; // broadcast if (!mainType) { // FIXME // Chart will not be update directly here, except set dirty. // But there is no such scenario now. each(ecIns._componentsViews.concat(ecIns._chartsViews), callView); return; } var query = {}; query[mainType + 'Id'] = payload[mainType + 'Id']; query[mainType + 'Index'] = payload[mainType + 'Index']; query[mainType + 'Name'] = payload[mainType + 'Name']; var condition = {mainType: mainType, query: query}; subType && (condition.subType = subType); // subType may be '' by parseClassType; var excludeSeriesId = payload.excludeSeriesId; if (excludeSeriesId != null) { excludeSeriesId = createHashMap(normalizeToArray(excludeSeriesId)); } // If dispatchAction before setOption, do nothing. ecModel && ecModel.eachComponent(condition, function (model) { if (!excludeSeriesId || excludeSeriesId.get(model.id) == null) { callView(ecIns[ mainType === 'series' ? '_chartsMap' : '_componentsMap' ][model.__viewId]); } }, ecIns); function callView(view) { view && view.__alive && view[method] && view[method]( view.__model, ecModel, ecIns._api, payload ); } } /** * Resize the chart * @param {Object} opts * @param {number} [opts.width] Can be 'auto' (the same as null/undefined) * @param {number} [opts.height] Can be 'auto' (the same as null/undefined) * @param {boolean} [opts.silent=false] */ echartsProto.resize = function (opts) { if (__DEV__) { assert(!this[IN_MAIN_PROCESS], '`resize` should not be called during main process.'); } this._zr.resize(opts); var ecModel = this._model; // Resize loading effect this._loadingFX && this._loadingFX.resize(); if (!ecModel) { return; } var optionChanged = ecModel.resetOption('media'); var silent = opts && opts.silent; this[IN_MAIN_PROCESS] = true; optionChanged && prepare(this); updateMethods.update.call(this); this[IN_MAIN_PROCESS] = false; flushPendingActions.call(this, silent); triggerUpdatedEvent.call(this, silent); }; function updateStreamModes(ecIns, ecModel) { var chartsMap = ecIns._chartsMap; var scheduler = ecIns._scheduler; ecModel.eachSeries(function (seriesModel) { scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]); }); } /** * Show loading effect * @param {string} [name='default'] * @param {Object} [cfg] */ echartsProto.showLoading = function (name, cfg) { if (isObject(name)) { cfg = name; name = ''; } name = name || 'default'; this.hideLoading(); if (!loadingEffects[name]) { if (__DEV__) { console.warn('Loading effects ' + name + ' not exists.'); } return; } var el = loadingEffects[name](this._api, cfg); var zr = this._zr; this._loadingFX = el; zr.add(el); }; /** * Hide loading effect */ echartsProto.hideLoading = function () { this._loadingFX && this._zr.remove(this._loadingFX); this._loadingFX = null; }; /** * @param {Object} eventObj * @return {Object} */ echartsProto.makeActionFromEvent = function (eventObj) { var payload = extend({}, eventObj); payload.type = eventActionMap[eventObj.type]; return payload; }; /** * @pubilc * @param {Object} payload * @param {string} [payload.type] Action type * @param {Object|boolean} [opt] If pass boolean, means opt.silent * @param {boolean} [opt.silent=false] Whether trigger events. * @param {boolean} [opt.flush=undefined] * true: Flush immediately, and then pixel in canvas can be fetched * immediately. Caution: it might affect performance. * false: Not not flush. * undefined: Auto decide whether perform flush. */ echartsProto.dispatchAction = function (payload, opt) { if (!isObject(opt)) { opt = {silent: !!opt}; } if (!actions[payload.type]) { return; } // Avoid dispatch action before setOption. Especially in `connect`. if (!this._model) { return; } // May dispatchAction in rendering procedure if (this[IN_MAIN_PROCESS]) { this._pendingActions.push(payload); return; } doDispatchAction.call(this, payload, opt.silent); if (opt.flush) { this._zr.flush(true); } else if (opt.flush !== false && env$1.browser.weChat) { // In WeChat embeded browser, `requestAnimationFrame` and `setInterval` // hang when sliding page (on touch event), which cause that zr does not // refresh util user interaction finished, which is not expected. // But `dispatchAction` may be called too frequently when pan on touch // screen, which impacts performance if do not throttle them. this._throttledZrFlush(); } flushPendingActions.call(this, opt.silent); triggerUpdatedEvent.call(this, opt.silent); }; function doDispatchAction(payload, silent) { var payloadType = payload.type; var escapeConnect = payload.escapeConnect; var actionWrap = actions[payloadType]; var actionInfo = actionWrap.actionInfo; var cptType = (actionInfo.update || 'update').split(':'); var updateMethod = cptType.pop(); cptType = cptType[0] != null && parseClassType(cptType[0]); this[IN_MAIN_PROCESS] = true; var payloads = [payload]; var batched = false; // Batch action if (payload.batch) { batched = true; payloads = map(payload.batch, function (item) { item = defaults(extend({}, item), payload); item.batch = null; return item; }); } var eventObjBatch = []; var eventObj; var isHighDown = payloadType === 'highlight' || payloadType === 'downplay'; each(payloads, function (batchItem) { // Action can specify the event by return it. eventObj = actionWrap.action(batchItem, this._model, this._api); // Emit event outside eventObj = eventObj || extend({}, batchItem); // Convert type to eventType eventObj.type = actionInfo.event || eventObj.type; eventObjBatch.push(eventObj); // light update does not perform data process, layout and visual. if (isHighDown) { // method, payload, mainType, subType updateDirectly(this, updateMethod, batchItem, 'series'); } else if (cptType) { updateDirectly(this, updateMethod, batchItem, cptType.main, cptType.sub); } }, this); if (updateMethod !== 'none' && !isHighDown && !cptType) { // Still dirty if (this[OPTION_UPDATED]) { // FIXME Pass payload ? prepare(this); updateMethods.update.call(this, payload); this[OPTION_UPDATED] = false; } else { updateMethods[updateMethod].call(this, payload); } } // Follow the rule of action batch if (batched) { eventObj = { type: actionInfo.event || payloadType, escapeConnect: escapeConnect, batch: eventObjBatch }; } else { eventObj = eventObjBatch[0]; } this[IN_MAIN_PROCESS] = false; !silent && this._messageCenter.trigger(eventObj.type, eventObj); } function flushPendingActions(silent) { var pendingActions = this._pendingActions; while (pendingActions.length) { var payload = pendingActions.shift(); doDispatchAction.call(this, payload, silent); } } function triggerUpdatedEvent(silent) { !silent && this.trigger('updated'); } /** * Event `rendered` is triggered when zr * rendered. It is useful for realtime * snapshot (reflect animation). * * Event `finished` is triggered when: * (1) zrender rendering finished. * (2) initial animation finished. * (3) progressive rendering finished. * (4) no pending action. * (5) no delayed setOption needs to be processed. */ function bindRenderedEvent(zr, ecIns) { zr.on('rendered', function () { ecIns.trigger('rendered'); // The `finished` event should not be triggered repeatly, // so it should only be triggered when rendering indeed happend // in zrender. (Consider the case that dipatchAction is keep // triggering when mouse move). if ( // Although zr is dirty if initial animation is not finished // and this checking is called on frame, we also check // animation finished for robustness. zr.animation.isFinished() && !ecIns[OPTION_UPDATED] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length ) { ecIns.trigger('finished'); } }); } /** * @param {Object} params * @param {number} params.seriesIndex * @param {Array|TypedArray} params.data */ echartsProto.appendData = function (params) { var seriesIndex = params.seriesIndex; var ecModel = this.getModel(); var seriesModel = ecModel.getSeriesByIndex(seriesIndex); if (__DEV__) { assert(params.data && seriesModel); } seriesModel.appendData(params); // Note: `appendData` does not support that update extent of coordinate // system, util some scenario require that. In the expected usage of // `appendData`, the initial extent of coordinate system should better // be fixed by axis `min`/`max` setting or initial data, otherwise if // the extent changed while `appendData`, the location of the painted // graphic elements have to be changed, which make the usage of // `appendData` meaningless. this._scheduler.unfinished = true; }; /** * Register event * @method */ echartsProto.on = createRegisterEventWithLowercaseName('on'); echartsProto.off = createRegisterEventWithLowercaseName('off'); echartsProto.one = createRegisterEventWithLowercaseName('one'); /** * Prepare view instances of charts and components * @param {module:echarts/model/Global} ecModel * @private */ function prepareView(ecIns, type, ecModel, scheduler) { var isComponent = type === 'component'; var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews; var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap; var zr = ecIns._zr; var api = ecIns._api; for (var i = 0; i < viewList.length; i++) { viewList[i].__alive = false; } isComponent ? ecModel.eachComponent(function (componentType, model) { componentType !== 'series' && doPrepare(model); }) : ecModel.eachSeries(doPrepare); function doPrepare(model) { // Consider: id same and type changed. var viewId = '_ec_' + model.id + '_' + model.type; var view = viewMap[viewId]; if (!view) { var classType = parseClassType(model.type); var Clazz = isComponent ? Component.getClass(classType.main, classType.sub) : Chart.getClass(classType.sub); if (__DEV__) { assert(Clazz, classType.sub + ' does not exist.'); } view = new Clazz(); view.init(ecModel, api); viewMap[viewId] = view; viewList.push(view); zr.add(view.group); } model.__viewId = view.__id = viewId; view.__alive = true; view.__model = model; view.group.__ecComponentInfo = { mainType: model.mainType, index: model.componentIndex }; !isComponent && scheduler.prepareView(view, model, ecModel, api); } for (var i = 0; i < viewList.length;) { var view = viewList[i]; if (!view.__alive) { !isComponent && view.renderTask.dispose(); zr.remove(view.group); view.dispose(ecModel, api); viewList.splice(i, 1); delete viewMap[view.__id]; view.__id = view.group.__ecComponentInfo = null; } else { i++; } } } // /** // * Encode visual infomation from data after data processing // * // * @param {module:echarts/model/Global} ecModel // * @param {object} layout // * @param {boolean} [layoutFilter] `true`: only layout, // * `false`: only not layout, // * `null`/`undefined`: all. // * @param {string} taskBaseTag // * @private // */ // function startVisualEncoding(ecIns, ecModel, api, payload, layoutFilter) { // each(visualFuncs, function (visual, index) { // var isLayout = visual.isLayout; // if (layoutFilter == null // || (layoutFilter === false && !isLayout) // || (layoutFilter === true && isLayout) // ) { // visual.func(ecModel, api, payload); // } // }); // } function clearColorPalette(ecModel) { ecModel.clearColorPalette(); ecModel.eachSeries(function (seriesModel) { seriesModel.clearColorPalette(); }); } function render(ecIns, ecModel, api, payload) { renderComponents(ecIns, ecModel, api, payload); each(ecIns._chartsViews, function (chart) { chart.__alive = false; }); renderSeries(ecIns, ecModel, api, payload); // Remove groups of unrendered charts each(ecIns._chartsViews, function (chart) { if (!chart.__alive) { chart.remove(ecModel, api); } }); } function renderComponents(ecIns, ecModel, api, payload, dirtyList) { each(dirtyList || ecIns._componentsViews, function (componentView) { var componentModel = componentView.__model; componentView.render(componentModel, ecModel, api, payload); updateZ(componentModel, componentView); }); } /** * Render each chart and component * @private */ function renderSeries(ecIns, ecModel, api, payload, dirtyMap) { // Render all charts var scheduler = ecIns._scheduler; var unfinished; ecModel.eachSeries(function (seriesModel) { var chartView = ecIns._chartsMap[seriesModel.__viewId]; chartView.__alive = true; var renderTask = chartView.renderTask; scheduler.updatePayload(renderTask, payload); if (dirtyMap && dirtyMap.get(seriesModel.uid)) { renderTask.dirty(); } unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask)); chartView.group.silent = !!seriesModel.get('silent'); updateZ(seriesModel, chartView); updateBlend(seriesModel, chartView); }); scheduler.unfinished |= unfinished; // If use hover layer updateHoverLayerStatus(ecIns._zr, ecModel); // Add aria aria(ecIns._zr.dom, ecModel); } function performPostUpdateFuncs(ecModel, api) { each(postUpdateFuncs, function (func) { func(ecModel, api); }); } var MOUSE_EVENT_NAMES = [ 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'globalout', 'contextmenu' ]; /** * @private */ echartsProto._initEvents = function () { each(MOUSE_EVENT_NAMES, function (eveName) { this._zr.on(eveName, function (e) { var ecModel = this.getModel(); var el = e.target; var params; // no e.target when 'globalout'. if (eveName === 'globalout') { params = {}; } else if (el && el.dataIndex != null) { var dataModel = el.dataModel || ecModel.getSeriesByIndex(el.seriesIndex); params = dataModel && dataModel.getDataParams(el.dataIndex, el.dataType) || {}; } // If element has custom eventData of components else if (el && el.eventData) { params = extend({}, el.eventData); } if (params) { params.event = e; params.type = eveName; this.trigger(eveName, params); } }, this); }, this); each(eventActionMap, function (actionType, eventType) { this._messageCenter.on(eventType, function (event) { this.trigger(eventType, event); }, this); }, this); }; /** * @return {boolean} */ echartsProto.isDisposed = function () { return this._disposed; }; /** * Clear */ echartsProto.clear = function () { this.setOption({ series: [] }, true); }; /** * Dispose instance */ echartsProto.dispose = function () { if (this._disposed) { if (__DEV__) { console.warn('Instance ' + this.id + ' has been disposed'); } return; } this._disposed = true; setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, ''); var api = this._api; var ecModel = this._model; each(this._componentsViews, function (component) { component.dispose(ecModel, api); }); each(this._chartsViews, function (chart) { chart.dispose(ecModel, api); }); // Dispose after all views disposed this._zr.dispose(); delete instances[this.id]; }; mixin(ECharts, Eventful); function updateHoverLayerStatus(zr, ecModel) { var storage = zr.storage; var elCount = 0; storage.traverse(function (el) { if (!el.isGroup) { elCount++; } }); if (elCount > ecModel.get('hoverLayerThreshold') && !env$1.node) { storage.traverse(function (el) { if (!el.isGroup) { // Don't switch back. el.useHoverLayer = true; } }); } } /** * Update chart progressive and blend. * @param {module:echarts/model/Series|module:echarts/model/Component} model * @param {module:echarts/view/Component|module:echarts/view/Chart} view */ function updateBlend(seriesModel, chartView) { var blendMode = seriesModel.get('blendMode') || null; if (__DEV__) { if (!env$1.canvasSupported && blendMode && blendMode !== 'source-over') { console.warn('Only canvas support blendMode'); } } chartView.group.traverse(function (el) { // FIXME marker and other components if (!el.isGroup) { // Only set if blendMode is changed. In case element is incremental and don't wan't to rerender. if (el.style.blend !== blendMode) { el.setStyle('blend', blendMode); } } if (el.eachPendingDisplayable) { el.eachPendingDisplayable(function (displayable) { displayable.setStyle('blend', blendMode); }); } }); } /** * @param {module:echarts/model/Series|module:echarts/model/Component} model * @param {module:echarts/view/Component|module:echarts/view/Chart} view */ function updateZ(model, view) { var z = model.get('z'); var zlevel = model.get('zlevel'); // Set z and zlevel view.group.traverse(function (el) { if (el.type !== 'group') { z != null && (el.z = z); zlevel != null && (el.zlevel = zlevel); } }); } function createExtensionAPI(ecInstance) { var coordSysMgr = ecInstance._coordSysMgr; return extend(new ExtensionAPI(ecInstance), { // Inject methods getCoordinateSystems: bind( coordSysMgr.getCoordinateSystems, coordSysMgr ), getComponentByElement: function (el) { while (el) { var modelInfo = el.__ecComponentInfo; if (modelInfo != null) { return ecInstance._model.getComponent(modelInfo.mainType, modelInfo.index); } el = el.parent; } } }); } /** * @type {Object} key: actionType. * @inner */ var actions = {}; /** * Map eventType to actionType * @type {Object} */ var eventActionMap = {}; /** * Data processor functions of each stage * @type {Array.>} * @inner */ var dataProcessorFuncs = []; /** * @type {Array.} * @inner */ var optionPreprocessorFuncs = []; /** * @type {Array.} * @inner */ var postUpdateFuncs = []; /** * Visual encoding functions of each stage * @type {Array.>} */ var visualFuncs = []; /** * Theme storage * @type {Object.} */ var themeStorage = {}; /** * Loading effects */ var loadingEffects = {}; var instances = {}; var connectedGroups = {}; var idBase = new Date() - 0; var groupIdBase = new Date() - 0; var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; var mapDataStores = {}; function enableConnect(chart) { var STATUS_PENDING = 0; var STATUS_UPDATING = 1; var STATUS_UPDATED = 2; var STATUS_KEY = '__connectUpdateStatus'; function updateConnectedChartsStatus(charts, status) { for (var i = 0; i < charts.length; i++) { var otherChart = charts[i]; otherChart[STATUS_KEY] = status; } } each(eventActionMap, function (actionType, eventType) { chart._messageCenter.on(eventType, function (event) { if (connectedGroups[chart.group] && chart[STATUS_KEY] !== STATUS_PENDING) { if (event && event.escapeConnect) { return; } var action = chart.makeActionFromEvent(event); var otherCharts = []; each(instances, function (otherChart) { if (otherChart !== chart && otherChart.group === chart.group) { otherCharts.push(otherChart); } }); updateConnectedChartsStatus(otherCharts, STATUS_PENDING); each(otherCharts, function (otherChart) { if (otherChart[STATUS_KEY] !== STATUS_UPDATING) { otherChart.dispatchAction(action); } }); updateConnectedChartsStatus(otherCharts, STATUS_UPDATED); } }); }); } /** * @param {HTMLElement} dom * @param {Object} [theme] * @param {Object} opts * @param {number} [opts.devicePixelRatio] Use window.devicePixelRatio by default * @param {string} [opts.renderer] Currently only 'canvas' is supported. * @param {number} [opts.width] Use clientWidth of the input `dom` by default. * Can be 'auto' (the same as null/undefined) * @param {number} [opts.height] Use clientHeight of the input `dom` by default. * Can be 'auto' (the same as null/undefined) */ function init(dom, theme$$1, opts) { if (__DEV__) { // Check version if ((version$1.replace('.', '') - 0) < (dependencies.zrender.replace('.', '') - 0)) { throw new Error( 'zrender/src ' + version$1 + ' is too old for ECharts ' + version + '. Current version need ZRender ' + dependencies.zrender + '+' ); } if (!dom) { throw new Error('Initialize failed: invalid dom.'); } } var existInstance = getInstanceByDom(dom); if (existInstance) { if (__DEV__) { console.warn('There is a chart instance already initialized on the dom.'); } return existInstance; } if (__DEV__) { if (isDom(dom) && dom.nodeName.toUpperCase() !== 'CANVAS' && ( (!dom.clientWidth && (!opts || opts.width == null)) || (!dom.clientHeight && (!opts || opts.height == null)) ) ) { console.warn('Can\'t get dom width or height'); } } var chart = new ECharts(dom, theme$$1, opts); chart.id = 'ec_' + idBase++; instances[chart.id] = chart; setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id); enableConnect(chart); return chart; } /** * @return {string|Array.} groupId */ function connect(groupId) { // Is array of charts if (isArray(groupId)) { var charts = groupId; groupId = null; // If any chart has group each(charts, function (chart) { if (chart.group != null) { groupId = chart.group; } }); groupId = groupId || ('g_' + groupIdBase++); each(charts, function (chart) { chart.group = groupId; }); } connectedGroups[groupId] = true; return groupId; } /** * @DEPRECATED * @return {string} groupId */ function disConnect(groupId) { connectedGroups[groupId] = false; } /** * @return {string} groupId */ var disconnect = disConnect; /** * Dispose a chart instance * @param {module:echarts~ECharts|HTMLDomElement|string} chart */ function dispose(chart) { if (typeof chart === 'string') { chart = instances[chart]; } else if (!(chart instanceof ECharts)){ // Try to treat as dom chart = getInstanceByDom(chart); } if ((chart instanceof ECharts) && !chart.isDisposed()) { chart.dispose(); } } /** * @param {HTMLElement} dom * @return {echarts~ECharts} */ function getInstanceByDom(dom) { return instances[getAttribute(dom, DOM_ATTRIBUTE_KEY)]; } /** * @param {string} key * @return {echarts~ECharts} */ function getInstanceById(key) { return instances[key]; } /** * Register theme */ function registerTheme(name, theme$$1) { themeStorage[name] = theme$$1; } /** * Register option preprocessor * @param {Function} preprocessorFunc */ function registerPreprocessor(preprocessorFunc) { optionPreprocessorFuncs.push(preprocessorFunc); } /** * @param {number} [priority=1000] * @param {Object|Function} processor */ function registerProcessor(priority, processor) { normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_FILTER); } /** * Register postUpdater * @param {Function} postUpdateFunc */ function registerPostUpdate(postUpdateFunc) { postUpdateFuncs.push(postUpdateFunc); } /** * Usage: * registerAction('someAction', 'someEvent', function () { ... }); * registerAction('someAction', function () { ... }); * registerAction( * {type: 'someAction', event: 'someEvent', update: 'updateView'}, * function () { ... } * ); * * @param {(string|Object)} actionInfo * @param {string} actionInfo.type * @param {string} [actionInfo.event] * @param {string} [actionInfo.update] * @param {string} [eventName] * @param {Function} action */ function registerAction(actionInfo, eventName, action) { if (typeof eventName === 'function') { action = eventName; eventName = ''; } var actionType = isObject(actionInfo) ? actionInfo.type : ([actionInfo, actionInfo = { event: eventName }][0]); // Event name is all lowercase actionInfo.event = (actionInfo.event || actionType).toLowerCase(); eventName = actionInfo.event; // Validate action type and event name. assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName)); if (!actions[actionType]) { actions[actionType] = {action: action, actionInfo: actionInfo}; } eventActionMap[eventName] = actionType; } /** * @param {string} type * @param {*} CoordinateSystem */ function registerCoordinateSystem(type, CoordinateSystem$$1) { CoordinateSystemManager.register(type, CoordinateSystem$$1); } /** * Get dimensions of specified coordinate system. * @param {string} type * @return {Array.} */ function getCoordinateSystemDimensions(type) { var coordSysCreator = CoordinateSystemManager.get(type); if (coordSysCreator) { return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice(); } } /** * Layout is a special stage of visual encoding * Most visual encoding like color are common for different chart * But each chart has it's own layout algorithm * * @param {number} [priority=1000] * @param {Function} layoutTask */ function registerLayout(priority, layoutTask) { normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout'); } /** * @param {number} [priority=3000] * @param {module:echarts/stream/Task} visualTask */ function registerVisual(priority, visualTask) { normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual'); } /** * @param {Object|Function} fn: {seriesType, createOnAllSeries, performRawSeries, reset} */ function normalizeRegister(targetList, priority, fn, defaultPriority, visualType) { if (isFunction(priority) || isObject(priority)) { fn = priority; priority = defaultPriority; } if (__DEV__) { if (isNaN(priority) || priority == null) { throw new Error('Illegal priority'); } // Check duplicate each(targetList, function (wrap) { assert(wrap.__raw !== fn); }); } var stageHandler = Scheduler.wrapStageHandler(fn, visualType); stageHandler.__prio = priority; stageHandler.__raw = fn; targetList.push(stageHandler); return stageHandler; } /** * @param {string} name */ function registerLoading(name, loadingFx) { loadingEffects[name] = loadingFx; } /** * @param {Object} opts * @param {string} [superClass] */ function extendComponentModel(opts/*, superClass*/) { // var Clazz = ComponentModel; // if (superClass) { // var classType = parseClassType(superClass); // Clazz = ComponentModel.getClass(classType.main, classType.sub, true); // } return ComponentModel.extend(opts); } /** * @param {Object} opts * @param {string} [superClass] */ function extendComponentView(opts/*, superClass*/) { // var Clazz = ComponentView; // if (superClass) { // var classType = parseClassType(superClass); // Clazz = ComponentView.getClass(classType.main, classType.sub, true); // } return Component.extend(opts); } /** * @param {Object} opts * @param {string} [superClass] */ function extendSeriesModel(opts/*, superClass*/) { // var Clazz = SeriesModel; // if (superClass) { // superClass = 'series.' + superClass.replace('series.', ''); // var classType = parseClassType(superClass); // Clazz = ComponentModel.getClass(classType.main, classType.sub, true); // } return SeriesModel.extend(opts); } /** * @param {Object} opts * @param {string} [superClass] */ function extendChartView(opts/*, superClass*/) { // var Clazz = ChartView; // if (superClass) { // superClass = superClass.replace('series.', ''); // var classType = parseClassType(superClass); // Clazz = ChartView.getClass(classType.main, true); // } return Chart.extend(opts); } /** * ZRender need a canvas context to do measureText. * But in node environment canvas may be created by node-canvas. * So we need to specify how to create a canvas instead of using document.createElement('canvas') * * Be careful of using it in the browser. * * @param {Function} creator * @example * var Canvas = require('canvas'); * var echarts = require('echarts'); * echarts.setCanvasCreator(function () { * // Small size is enough. * return new Canvas(32, 32); * }); */ function setCanvasCreator(creator) { $override('createCanvas', creator); } /** * @param {string} mapName * @param {Object|string} geoJson * @param {Object} [specialAreas] * * @example * $.get('USA.json', function (geoJson) { * echarts.registerMap('USA', geoJson); * // Or * echarts.registerMap('USA', { * geoJson: geoJson, * specialAreas: {} * }) * }); */ function registerMap(mapName, geoJson, specialAreas) { if (geoJson.geoJson && !geoJson.features) { specialAreas = geoJson.specialAreas; geoJson = geoJson.geoJson; } if (typeof geoJson === 'string') { geoJson = (typeof JSON !== 'undefined' && JSON.parse) ? JSON.parse(geoJson) : (new Function('return (' + geoJson + ');'))(); } mapDataStores[mapName] = { geoJson: geoJson, specialAreas: specialAreas }; } /** * @param {string} mapName * @return {Object} */ function getMap(mapName) { return mapDataStores[mapName]; } registerVisual(PRIORITY_VISUAL_GLOBAL, seriesColor); registerPreprocessor(backwardCompat); registerProcessor(PRIORITY_PROCESSOR_STATISTIC, dataStack); registerLoading('default', loadingDefault); // Default actions registerAction({ type: 'highlight', event: 'highlight', update: 'highlight' }, noop); registerAction({ type: 'downplay', event: 'downplay', update: 'downplay' }, noop); // Default theme registerTheme('light', lightTheme); registerTheme('dark', theme); // For backward compatibility, where the namespace `dataTool` will // be mounted on `echarts` is the extension `dataTool` is imported. var dataTool = {}; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function defaultKeyGetter(item) { return item; } /** * @param {Array} oldArr * @param {Array} newArr * @param {Function} oldKeyGetter * @param {Function} newKeyGetter * @param {Object} [context] Can be visited by this.context in callback. */ function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context) { this._old = oldArr; this._new = newArr; this._oldKeyGetter = oldKeyGetter || defaultKeyGetter; this._newKeyGetter = newKeyGetter || defaultKeyGetter; this.context = context; } DataDiffer.prototype = { constructor: DataDiffer, /** * Callback function when add a data */ add: function (func) { this._add = func; return this; }, /** * Callback function when update a data */ update: function (func) { this._update = func; return this; }, /** * Callback function when remove a data */ remove: function (func) { this._remove = func; return this; }, execute: function () { var oldArr = this._old; var newArr = this._new; var oldDataIndexMap = {}; var newDataIndexMap = {}; var oldDataKeyArr = []; var newDataKeyArr = []; var i; initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter', this); initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter', this); // Travel by inverted order to make sure order consistency // when duplicate keys exists (consider newDataIndex.pop() below). // For performance consideration, these code below do not look neat. for (i = 0; i < oldArr.length; i++) { var key = oldDataKeyArr[i]; var idx = newDataIndexMap[key]; // idx can never be empty array here. see 'set null' logic below. if (idx != null) { // Consider there is duplicate key (for example, use dataItem.name as key). // We should make sure every item in newArr and oldArr can be visited. var len = idx.length; if (len) { len === 1 && (newDataIndexMap[key] = null); idx = idx.unshift(); } else { newDataIndexMap[key] = null; } this._update && this._update(idx, i); } else { this._remove && this._remove(i); } } for (var i = 0; i < newDataKeyArr.length; i++) { var key = newDataKeyArr[i]; if (newDataIndexMap.hasOwnProperty(key)) { var idx = newDataIndexMap[key]; if (idx == null) { continue; } // idx can never be empty array here. see 'set null' logic above. if (!idx.length) { this._add && this._add(idx); } else { for (var j = 0, len = idx.length; j < len; j++) { this._add && this._add(idx[j]); } } } } } }; function initIndexMap(arr, map, keyArr, keyGetterName, dataDiffer) { for (var i = 0; i < arr.length; i++) { // Add prefix to avoid conflict with Object.prototype. var key = '_ec_' + dataDiffer[keyGetterName](arr[i], i); var existence = map[key]; if (existence == null) { keyArr.push(key); map[key] = i; } else { if (!existence.length) { map[key] = existence = [existence]; } existence.push(i); } } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var OTHER_DIMENSIONS = createHashMap([ 'tooltip', 'label', 'itemName', 'itemId', 'seriesName' ]); function summarizeDimensions(data) { var summary = {}; var encode = summary.encode = {}; var notExtraCoordDimMap = createHashMap(); var defaultedLabel = []; var defaultedTooltip = []; each$1(data.dimensions, function (dimName) { var dimItem = data.getDimensionInfo(dimName); var coordDim = dimItem.coordDim; if (coordDim) { if (__DEV__) { assert$1(OTHER_DIMENSIONS.get(coordDim) == null); } var coordDimArr = encode[coordDim]; if (!encode.hasOwnProperty(coordDim)) { coordDimArr = encode[coordDim] = []; } coordDimArr[dimItem.coordDimIndex] = dimName; if (!dimItem.isExtraCoord) { notExtraCoordDimMap.set(coordDim, 1); // Use the last coord dim (and label friendly) as default label, // because when dataset is used, it is hard to guess which dimension // can be value dimension. If both show x, y on label is not look good, // and conventionally y axis is focused more. if (mayLabelDimType(dimItem.type)) { defaultedLabel[0] = dimName; } } if (dimItem.defaultTooltip) { defaultedTooltip.push(dimName); } } OTHER_DIMENSIONS.each(function (v, otherDim) { var otherDimArr = encode[otherDim]; if (!encode.hasOwnProperty(otherDim)) { otherDimArr = encode[otherDim] = []; } var dimIndex = dimItem.otherDims[otherDim]; if (dimIndex != null && dimIndex !== false) { otherDimArr[dimIndex] = dimItem.name; } }); }); var dataDimsOnCoord = []; var encodeFirstDimNotExtra = {}; notExtraCoordDimMap.each(function (v, coordDim) { var dimArr = encode[coordDim]; // ??? FIXME extra coord should not be set in dataDimsOnCoord. // But should fix the case that radar axes: simplify the logic // of `completeDimension`, remove `extraPrefix`. encodeFirstDimNotExtra[coordDim] = dimArr[0]; // Not necessary to remove duplicate, because a data // dim canot on more than one coordDim. dataDimsOnCoord = dataDimsOnCoord.concat(dimArr); }); summary.dataDimsOnCoord = dataDimsOnCoord; summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra; var encodeLabel = encode.label; // FIXME `encode.label` is not recommanded, because formatter can not be set // in this way. Use label.formatter instead. May be remove this approach someday. if (encodeLabel && encodeLabel.length) { defaultedLabel = encodeLabel.slice(); } var encodeTooltip = encode.tooltip; if (encodeTooltip && encodeTooltip.length) { defaultedTooltip = encodeTooltip.slice(); } else if (!defaultedTooltip.length) { defaultedTooltip = defaultedLabel.slice(); } encode.defaultedLabel = defaultedLabel; encode.defaultedTooltip = defaultedTooltip; return summary; } function getDimensionTypeByAxis(axisType) { return axisType === 'category' ? 'ordinal' : axisType === 'time' ? 'time' : 'float'; } function mayLabelDimType(dimType) { // In most cases, ordinal and time do not suitable for label. // Ordinal info can be displayed on axis. Time is too long. return !(dimType === 'ordinal' || dimType === 'time'); } // function findTheLastDimMayLabel(data) { // // Get last value dim // var dimensions = data.dimensions.slice(); // var valueType; // var valueDim; // while (dimensions.length && ( // valueDim = dimensions.pop(), // valueType = data.getDimensionInfo(valueDim).type, // valueType === 'ordinal' || valueType === 'time' // )) {} // jshint ignore:line // return valueDim; // } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * List for data storage * @module echarts/data/List */ var isObject$4 = isObject$1; var UNDEFINED = 'undefined'; // Use prefix to avoid index to be the same as otherIdList[idx], // which will cause weird udpate animation. var ID_PREFIX = 'e\0\0'; var dataCtors = { 'float': typeof Float64Array === UNDEFINED ? Array : Float64Array, 'int': typeof Int32Array === UNDEFINED ? Array : Int32Array, // Ordinal data type can be string or int 'ordinal': Array, 'number': Array, 'time': Array }; // Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is // different from the Ctor of typed array. var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array; var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array; function getIndicesCtor(list) { // The possible max value in this._indicies is always this._rawCount despite of filtering. return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array; } function cloneChunk(originalChunk) { var Ctor = originalChunk.constructor; // Only shallow clone is enough when Array. return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk); } var TRANSFERABLE_PROPERTIES = [ 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_rawData', '_chunkSize', '_chunkCount', '_dimValueGetter', '_count', '_rawCount', '_nameDimIdx', '_idDimIdx' ]; var CLONE_PROPERTIES = [ '_extent', '_approximateExtent', '_rawExtent' ]; function transferProperties(target, source) { each$1(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) { if (source.hasOwnProperty(propName)) { target[propName] = source[propName]; } }); target.__wrappedMethods = source.__wrappedMethods; each$1(CLONE_PROPERTIES, function (propName) { target[propName] = clone(source[propName]); }); target._calculationInfo = extend(source._calculationInfo); } /** * @constructor * @alias module:echarts/data/List * * @param {Array.} dimensions * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...]. * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius * Spetial fields: { * ordinalMeta: * createInvertedIndices: * } * @param {module:echarts/model/Model} hostModel */ var List = function (dimensions, hostModel) { dimensions = dimensions || ['x', 'y']; var dimensionInfos = {}; var dimensionNames = []; var invertedIndicesMap = {}; for (var i = 0; i < dimensions.length; i++) { // Use the original dimensions[i], where other flag props may exists. var dimensionInfo = dimensions[i]; if (isString(dimensionInfo)) { dimensionInfo = {name: dimensionInfo}; } var dimensionName = dimensionInfo.name; dimensionInfo.type = dimensionInfo.type || 'float'; if (!dimensionInfo.coordDim) { dimensionInfo.coordDim = dimensionName; dimensionInfo.coordDimIndex = 0; } dimensionInfo.otherDims = dimensionInfo.otherDims || {}; dimensionNames.push(dimensionName); dimensionInfos[dimensionName] = dimensionInfo; dimensionInfo.index = i; if (dimensionInfo.createInvertedIndices) { invertedIndicesMap[dimensionName] = []; } } /** * @readOnly * @type {Array.} */ this.dimensions = dimensionNames; /** * Infomation of each data dimension, like data type. * @type {Object} */ this._dimensionInfos = dimensionInfos; /** * @type {module:echarts/model/Model} */ this.hostModel = hostModel; /** * @type {module:echarts/model/Model} */ this.dataType; /** * Indices stores the indices of data subset after filtered. * This data subset will be used in chart. * @type {Array.} * @readOnly */ this._indices = null; this._count = 0; this._rawCount = 0; /** * Data storage * @type {Object.>} * @private */ this._storage = {}; /** * @type {Array.} */ this._nameList = []; /** * @type {Array.} */ this._idList = []; /** * Models of data option is stored sparse for optimizing memory cost * @type {Array.} * @private */ this._optionModels = []; /** * Global visual properties after visual coding * @type {Object} * @private */ this._visual = {}; /** * Globel layout properties. * @type {Object} * @private */ this._layout = {}; /** * Item visual properties after visual coding * @type {Array.} * @private */ this._itemVisuals = []; /** * Key: visual type, Value: boolean * @type {Object} * @readOnly */ this.hasItemVisual = {}; /** * Item layout properties after layout * @type {Array.} * @private */ this._itemLayouts = []; /** * Graphic elemnents * @type {Array.} * @private */ this._graphicEls = []; /** * Max size of each chunk. * @type {number} * @private */ this._chunkSize = 1e5; /** * @type {number} * @private */ this._chunkCount = 0; /** * @type {Array.} * @private */ this._rawData; /** * Raw extent will not be cloned, but only transfered. * It will not be calculated util needed. * key: dim, * value: {end: number, extent: Array.} * @type {Object} * @private */ this._rawExtent = {}; /** * @type {Object} * @private */ this._extent = {}; /** * key: dim * value: extent * @type {Object} * @private */ this._approximateExtent = {}; /** * Cache summary info for fast visit. See "dimensionHelper". * @type {Object} * @private */ this._dimensionsSummary = summarizeDimensions(this); /** * @type {Object.} * @private */ this._invertedIndicesMap = invertedIndicesMap; /** * @type {Object} * @private */ this._calculationInfo = {}; }; var listProto = List.prototype; listProto.type = 'list'; /** * If each data item has it's own option * @type {boolean} */ listProto.hasItemOption = true; /** * Get dimension name * @param {string|number} dim * Dimension can be concrete names like x, y, z, lng, lat, angle, radius * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius' * @return {string} Concrete dim name. */ listProto.getDimension = function (dim) { if (!isNaN(dim)) { dim = this.dimensions[dim] || dim; } return dim; }; /** * Get type and calculation info of particular dimension * @param {string|number} dim * Dimension can be concrete names like x, y, z, lng, lat, angle, radius * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius' */ listProto.getDimensionInfo = function (dim) { // Do not clone, because there may be categories in dimInfo. return this._dimensionInfos[this.getDimension(dim)]; }; /** * @return {Array.} concrete dimension name list on coord. */ listProto.getDimensionsOnCoord = function () { return this._dimensionsSummary.dataDimsOnCoord.slice(); }; /** * @param {string} coordDim * @param {number} [idx] A coordDim may map to more than one data dim. * If idx is `true`, return a array of all mapped dims. * If idx is not specified, return the first dim not extra. * @return {string|Array.} concrete data dim. * If idx is number, and not found, return null/undefined. * If idx is `true`, and not found, return empty array (always return array). */ listProto.mapDimension = function (coordDim, idx) { var dimensionsSummary = this._dimensionsSummary; if (idx == null) { return dimensionsSummary.encodeFirstDimNotExtra[coordDim]; } var dims = dimensionsSummary.encode[coordDim]; return idx === true // always return array if idx is `true` ? (dims || []).slice() : (dims && dims[idx]); }; /** * Initialize from data * @param {Array.} data source or data or data provider. * @param {Array.} [nameLIst] The name of a datum is used on data diff and * defualt label/tooltip. * A name can be specified in encode.itemName, * or dataItem.name (only for series option data), * or provided in nameList from outside. * @param {Function} [dimValueGetter] (dataItem, dimName, dataIndex, dimIndex) => number */ listProto.initData = function (data, nameList, dimValueGetter) { var notProvider = Source.isInstance(data) || isArrayLike(data); if (notProvider) { data = new DefaultDataProvider(data, this.dimensions.length); } if (__DEV__) { if (!notProvider && (typeof data.getItem != 'function' || typeof data.count != 'function')) { throw new Error('Inavlid data provider.'); } } this._rawData = data; // Clear this._storage = {}; this._indices = null; this._nameList = nameList || []; this._idList = []; this._nameRepeatCount = {}; if (!dimValueGetter) { this.hasItemOption = false; } /** * @readOnly */ this.defaultDimValueGetter = defaultDimValueGetters[ this._rawData.getSource().sourceFormat ]; // Default dim value getter this._dimValueGetter = dimValueGetter = dimValueGetter || this.defaultDimValueGetter; // Reset raw extent. this._rawExtent = {}; this._initDataFromProvider(0, data.count()); // If data has no item option. if (data.pure) { this.hasItemOption = false; } }; listProto.getProvider = function () { return this._rawData; }; listProto.appendData = function (data) { if (__DEV__) { assert$1(!this._indices, 'appendData can only be called on raw data.'); } var rawData = this._rawData; var start = this.count(); rawData.appendData(data); var end = rawData.count(); if (!rawData.persistent) { end += start; } this._initDataFromProvider(start, end); }; listProto._initDataFromProvider = function (start, end) { // Optimize. if (start >= end) { return; } var chunkSize = this._chunkSize; var rawData = this._rawData; var storage = this._storage; var dimensions = this.dimensions; var dimLen = dimensions.length; var dimensionInfoMap = this._dimensionInfos; var nameList = this._nameList; var idList = this._idList; var rawExtent = this._rawExtent; var nameRepeatCount = this._nameRepeatCount = {}; var nameDimIdx; var chunkCount = this._chunkCount; var lastChunkIndex = chunkCount - 1; for (var i = 0; i < dimLen; i++) { var dim = dimensions[i]; if (!rawExtent[dim]) { rawExtent[dim] = getInitialExtent(); } var dimInfo = dimensionInfoMap[dim]; if (dimInfo.otherDims.itemName === 0) { nameDimIdx = this._nameDimIdx = i; } if (dimInfo.otherDims.itemId === 0) { this._idDimIdx = i; } var DataCtor = dataCtors[dimInfo.type]; if (!storage[dim]) { storage[dim] = []; } var resizeChunkArray = storage[dim][lastChunkIndex]; if (resizeChunkArray && resizeChunkArray.length < chunkSize) { var newStore = new DataCtor(Math.min(end - lastChunkIndex * chunkSize, chunkSize)); // The cost of the copy is probably inconsiderable // within the initial chunkSize. for (var j = 0; j < resizeChunkArray.length; j++) { newStore[j] = resizeChunkArray[j]; } storage[dim][lastChunkIndex] = newStore; } // Create new chunks. for (var k = chunkCount * chunkSize; k < end; k += chunkSize) { storage[dim].push(new DataCtor(Math.min(end - k, chunkSize))); } this._chunkCount = storage[dim].length; } var dataItem = new Array(dimLen); for (var idx = start; idx < end; idx++) { // NOTICE: Try not to write things into dataItem dataItem = rawData.getItem(idx, dataItem); // Each data item is value // [1, 2] // 2 // Bar chart, line chart which uses category axis // only gives the 'y' value. 'x' value is the indices of category // Use a tempValue to normalize the value to be a (x, y) value var chunkIndex = Math.floor(idx / chunkSize); var chunkOffset = idx % chunkSize; // Store the data by dimensions for (var k = 0; k < dimLen; k++) { var dim = dimensions[k]; var dimStorage = storage[dim][chunkIndex]; // PENDING NULL is empty or zero var val = this._dimValueGetter(dataItem, dim, idx, k); dimStorage[chunkOffset] = val; var dimRawExtent = rawExtent[dim]; if (val < dimRawExtent[0]) { dimRawExtent[0] = val; } if (val > dimRawExtent[1]) { dimRawExtent[1] = val; } } // ??? FIXME not check by pure but sourceFormat? // TODO refactor these logic. if (!rawData.pure) { var name = nameList[idx]; if (dataItem && name == null) { // If dataItem is {name: ...}, it has highest priority. // That is appropriate for many common cases. if (dataItem.name != null) { // There is no other place to persistent dataItem.name, // so save it to nameList. nameList[idx] = name = dataItem.name; } else if (nameDimIdx != null) { var nameDim = dimensions[nameDimIdx]; var nameDimChunk = storage[nameDim][chunkIndex]; if (nameDimChunk) { name = nameDimChunk[chunkOffset]; var ordinalMeta = dimensionInfoMap[nameDim].ordinalMeta; if (ordinalMeta && ordinalMeta.categories.length) { name = ordinalMeta.categories[name]; } } } } // Try using the id in option // id or name is used on dynamical data, mapping old and new items. var id = dataItem == null ? null : dataItem.id; if (id == null && name != null) { // Use name as id and add counter to avoid same name nameRepeatCount[name] = nameRepeatCount[name] || 0; id = name; if (nameRepeatCount[name] > 0) { id += '__ec__' + nameRepeatCount[name]; } nameRepeatCount[name]++; } id != null && (idList[idx] = id); } } if (!rawData.persistent && rawData.clean) { // Clean unused data if data source is typed array. rawData.clean(); } this._rawCount = this._count = end; // Reset data extent this._extent = {}; prepareInvertedIndex(this); }; function prepareInvertedIndex(list) { var invertedIndicesMap = list._invertedIndicesMap; each$1(invertedIndicesMap, function (invertedIndices, dim) { var dimInfo = list._dimensionInfos[dim]; // Currently, only dimensions that has ordinalMeta can create inverted indices. var ordinalMeta = dimInfo.ordinalMeta; if (ordinalMeta) { invertedIndices = invertedIndicesMap[dim] = new CtorUint32Array( ordinalMeta.categories.length ); // The default value of TypedArray is 0. To avoid miss // mapping to 0, we should set it as NaN. for (var i = 0; i < invertedIndices.length; i++) { invertedIndices[i] = NaN; } for (var i = 0; i < list._count; i++) { // Only support the case that all values are distinct. invertedIndices[list.get(dim, i)] = i; } } }); } function getRawValueFromStore(list, dimIndex, rawIndex) { var val; if (dimIndex != null) { var chunkSize = list._chunkSize; var chunkIndex = Math.floor(rawIndex / chunkSize); var chunkOffset = rawIndex % chunkSize; var dim = list.dimensions[dimIndex]; var chunk = list._storage[dim][chunkIndex]; if (chunk) { val = chunk[chunkOffset]; var ordinalMeta = list._dimensionInfos[dim].ordinalMeta; if (ordinalMeta && ordinalMeta.categories.length) { val = ordinalMeta.categories[val]; } } } return val; } /** * @return {number} */ listProto.count = function () { return this._count; }; listProto.getIndices = function () { var newIndices; var indices = this._indices; if (indices) { var Ctor = indices.constructor; var thisCount = this._count; // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`. if (Ctor === Array) { newIndices = new Ctor(thisCount); for (var i = 0; i < thisCount; i++) { newIndices[i] = indices[i]; } } else { newIndices = new Ctor(indices.buffer, 0, thisCount); } } else { var Ctor = getIndicesCtor(this); var newIndices = new Ctor(this.count()); for (var i = 0; i < newIndices.length; i++) { newIndices[i] = i; } } return newIndices; }; /** * Get value. Return NaN if idx is out of range. * @param {string} dim Dim must be concrete name. * @param {number} idx * @param {boolean} stack * @return {number} */ listProto.get = function (dim, idx /*, stack */) { if (!(idx >= 0 && idx < this._count)) { return NaN; } var storage = this._storage; if (!storage[dim]) { // TODO Warn ? return NaN; } idx = this.getRawIndex(idx); var chunkIndex = Math.floor(idx / this._chunkSize); var chunkOffset = idx % this._chunkSize; var chunkStore = storage[dim][chunkIndex]; var value = chunkStore[chunkOffset]; // FIXME ordinal data type is not stackable // if (stack) { // var dimensionInfo = this._dimensionInfos[dim]; // if (dimensionInfo && dimensionInfo.stackable) { // var stackedOn = this.stackedOn; // while (stackedOn) { // // Get no stacked data of stacked on // var stackedValue = stackedOn.get(dim, idx); // // Considering positive stack, negative stack and empty data // if ((value >= 0 && stackedValue > 0) // Positive stack // || (value <= 0 && stackedValue < 0) // Negative stack // ) { // value += stackedValue; // } // stackedOn = stackedOn.stackedOn; // } // } // } return value; }; /** * @param {string} dim concrete dim * @param {number} rawIndex * @return {number|string} */ listProto.getByRawIndex = function (dim, rawIdx) { if (!(rawIdx >= 0 && rawIdx < this._rawCount)) { return NaN; } var dimStore = this._storage[dim]; if (!dimStore) { // TODO Warn ? return NaN; } var chunkIndex = Math.floor(rawIdx / this._chunkSize); var chunkOffset = rawIdx % this._chunkSize; var chunkStore = dimStore[chunkIndex]; return chunkStore[chunkOffset]; }; /** * FIXME Use `get` on chrome maybe slow(in filterSelf and selectRange). * Hack a much simpler _getFast * @private */ listProto._getFast = function (dim, rawIdx) { var chunkIndex = Math.floor(rawIdx / this._chunkSize); var chunkOffset = rawIdx % this._chunkSize; var chunkStore = this._storage[dim][chunkIndex]; return chunkStore[chunkOffset]; }; /** * Get value for multi dimensions. * @param {Array.} [dimensions] If ignored, using all dimensions. * @param {number} idx * @return {number} */ listProto.getValues = function (dimensions, idx /*, stack */) { var values = []; if (!isArray(dimensions)) { // stack = idx; idx = dimensions; dimensions = this.dimensions; } for (var i = 0, len = dimensions.length; i < len; i++) { values.push(this.get(dimensions[i], idx /*, stack */)); } return values; }; /** * If value is NaN. Inlcuding '-' * Only check the coord dimensions. * @param {string} dim * @param {number} idx * @return {number} */ listProto.hasValue = function (idx) { var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord; var dimensionInfos = this._dimensionInfos; for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) { if ( // Ordinal type can be string or number dimensionInfos[dataDimsOnCoord[i]].type !== 'ordinal' // FIXME check ordinal when using index? && isNaN(this.get(dataDimsOnCoord[i], idx)) ) { return false; } } return true; }; /** * Get extent of data in one dimension * @param {string} dim * @param {boolean} stack */ listProto.getDataExtent = function (dim /*, stack */) { // Make sure use concrete dim as cache name. dim = this.getDimension(dim); var dimData = this._storage[dim]; var initialExtent = getInitialExtent(); // stack = !!((stack || false) && this.getCalculationInfo(dim)); if (!dimData) { return initialExtent; } // Make more strict checkings to ensure hitting cache. var currEnd = this.count(); // var cacheName = [dim, !!stack].join('_'); // var cacheName = dim; // Consider the most cases when using data zoom, `getDataExtent` // happened before filtering. We cache raw extent, which is not // necessary to be cleared and recalculated when restore data. var useRaw = !this._indices; // && !stack; var dimExtent; if (useRaw) { return this._rawExtent[dim].slice(); } dimExtent = this._extent[dim]; if (dimExtent) { return dimExtent.slice(); } dimExtent = initialExtent; var min = dimExtent[0]; var max = dimExtent[1]; for (var i = 0; i < currEnd; i++) { // var value = stack ? this.get(dim, i, true) : this._getFast(dim, this.getRawIndex(i)); var value = this._getFast(dim, this.getRawIndex(i)); value < min && (min = value); value > max && (max = value); } dimExtent = [min, max]; this._extent[dim] = dimExtent; return dimExtent; }; /** * Optimize for the scenario that data is filtered by a given extent. * Consider that if data amount is more than hundreds of thousand, * extent calculation will cost more than 10ms and the cache will * be erased because of the filtering. */ listProto.getApproximateExtent = function (dim /*, stack */) { dim = this.getDimension(dim); return this._approximateExtent[dim] || this.getDataExtent(dim /*, stack */); }; listProto.setApproximateExtent = function (extent, dim /*, stack */) { dim = this.getDimension(dim); this._approximateExtent[dim] = extent.slice(); }; /** * @param {string} key * @return {*} */ listProto.getCalculationInfo = function (key) { return this._calculationInfo[key]; }; /** * @param {string|Object} key or k-v object * @param {*} [value] */ listProto.setCalculationInfo = function (key, value) { isObject$4(key) ? extend(this._calculationInfo, key) : (this._calculationInfo[key] = value); }; /** * Get sum of data in one dimension * @param {string} dim */ listProto.getSum = function (dim /*, stack */) { var dimData = this._storage[dim]; var sum = 0; if (dimData) { for (var i = 0, len = this.count(); i < len; i++) { var value = this.get(dim, i /*, stack */); if (!isNaN(value)) { sum += value; } } } return sum; }; /** * Get median of data in one dimension * @param {string} dim */ listProto.getMedian = function (dim /*, stack */) { var dimDataArray = []; // map all data of one dimension this.each(dim, function (val, idx) { if (!isNaN(val)) { dimDataArray.push(val); } }); // TODO // Use quick select? // immutability & sort var sortedDimDataArray = [].concat(dimDataArray).sort(function(a, b) { return a - b; }); var len = this.count(); // calculate median return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2; }; // /** // * Retreive the index with given value // * @param {string} dim Concrete dimension. // * @param {number} value // * @return {number} // */ // Currently incorrect: should return dataIndex but not rawIndex. // Do not fix it until this method is to be used somewhere. // FIXME Precision of float value // listProto.indexOf = function (dim, value) { // var storage = this._storage; // var dimData = storage[dim]; // var chunkSize = this._chunkSize; // if (dimData) { // for (var i = 0, len = this.count(); i < len; i++) { // var chunkIndex = Math.floor(i / chunkSize); // var chunkOffset = i % chunkSize; // if (dimData[chunkIndex][chunkOffset] === value) { // return i; // } // } // } // return -1; // }; /** * Only support the dimension which inverted index created. * Do not support other cases until required. * @param {string} concrete dim * @param {number|string} value * @return {number} rawIndex */ listProto.rawIndexOf = function (dim, value) { var invertedIndices = dim && this._invertedIndicesMap[dim]; if (__DEV__) { if (!invertedIndices) { throw new Error('Do not supported yet'); } } var rawIndex = invertedIndices[value]; if (rawIndex == null || isNaN(rawIndex)) { return -1; } return rawIndex; }; /** * Retreive the index with given name * @param {number} idx * @param {number} name * @return {number} */ listProto.indexOfName = function (name) { for (var i = 0, len = this.count(); i < len; i++) { if (this.getName(i) === name) { return i; } } return -1; }; /** * Retreive the index with given raw data index * @param {number} idx * @param {number} name * @return {number} */ listProto.indexOfRawIndex = function (rawIndex) { if (!this._indices) { return rawIndex; } if (rawIndex >= this._rawCount || rawIndex < 0) { return -1; } // Indices are ascending var indices = this._indices; // If rawIndex === dataIndex var rawDataIndex = indices[rawIndex]; if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) { return rawIndex; } var left = 0; var right = this._count - 1; while (left <= right) { var mid = (left + right) / 2 | 0; if (indices[mid] < rawIndex) { left = mid + 1; } else if (indices[mid] > rawIndex) { right = mid - 1; } else { return mid; } } return -1; }; /** * Retreive the index of nearest value * @param {string} dim * @param {number} value * @param {number} [maxDistance=Infinity] * @return {Array.} Considere multiple points has the same value. */ listProto.indicesOfNearest = function (dim, value, maxDistance) { var storage = this._storage; var dimData = storage[dim]; var nearestIndices = []; if (!dimData) { return nearestIndices; } if (maxDistance == null) { maxDistance = Infinity; } var minDist = Number.MAX_VALUE; var minDiff = -1; for (var i = 0, len = this.count(); i < len; i++) { var diff = value - this.get(dim, i /*, stack */); var dist = Math.abs(diff); if (diff <= maxDistance && dist <= minDist) { // For the case of two data are same on xAxis, which has sequence data. // Show the nearest index // https://github.com/ecomfe/echarts/issues/2869 if (dist < minDist || (diff >= 0 && minDiff < 0)) { minDist = dist; minDiff = diff; nearestIndices.length = 0; } nearestIndices.push(i); } } return nearestIndices; }; /** * Get raw data index * @param {number} idx * @return {number} */ listProto.getRawIndex = getRawIndexWithoutIndices; function getRawIndexWithoutIndices(idx) { return idx; } function getRawIndexWithIndices(idx) { if (idx < this._count && idx >= 0) { return this._indices[idx]; } return -1; } /** * Get raw data item * @param {number} idx * @return {number} */ listProto.getRawDataItem = function (idx) { if (!this._rawData.persistent) { var val = []; for (var i = 0; i < this.dimensions.length; i++) { var dim = this.dimensions[i]; val.push(this.get(dim, idx)); } return val; } else { return this._rawData.getItem(this.getRawIndex(idx)); } }; /** * @param {number} idx * @param {boolean} [notDefaultIdx=false] * @return {string} */ listProto.getName = function (idx) { var rawIndex = this.getRawIndex(idx); return this._nameList[rawIndex] || getRawValueFromStore(this, this._nameDimIdx, rawIndex) || ''; }; /** * @param {number} idx * @param {boolean} [notDefaultIdx=false] * @return {string} */ listProto.getId = function (idx) { return getId(this, this.getRawIndex(idx)); }; function getId(list, rawIndex) { var id = list._idList[rawIndex]; if (id == null) { id = getRawValueFromStore(list, list._idDimIdx, rawIndex); } if (id == null) { // FIXME Check the usage in graph, should not use prefix. id = ID_PREFIX + rawIndex; } return id; } function normalizeDimensions(dimensions) { if (!isArray(dimensions)) { dimensions = [dimensions]; } return dimensions; } function validateDimensions(list, dims) { for (var i = 0; i < dims.length; i++) { // stroage may be empty when no data, so use // dimensionInfos to check. if (!list._dimensionInfos[dims[i]]) { console.error('Unkown dimension ' + dims[i]); } } } /** * Data iteration * @param {string|Array.} * @param {Function} cb * @param {*} [context=this] * * @example * list.each('x', function (x, idx) {}); * list.each(['x', 'y'], function (x, y, idx) {}); * list.each(function (idx) {}) */ listProto.each = function (dims, cb, context, contextCompat) { 'use strict'; if (!this._count) { return; } if (typeof dims === 'function') { contextCompat = context; context = cb; cb = dims; dims = []; } // contextCompat just for compat echarts3 context = context || contextCompat || this; dims = map(normalizeDimensions(dims), this.getDimension, this); if (__DEV__) { validateDimensions(this, dims); } var dimSize = dims.length; for (var i = 0; i < this.count(); i++) { // Simple optimization switch (dimSize) { case 0: cb.call(context, i); break; case 1: cb.call(context, this.get(dims[0], i), i); break; case 2: cb.call(context, this.get(dims[0], i), this.get(dims[1], i), i); break; default: var k = 0; var value = []; for (; k < dimSize; k++) { value[k] = this.get(dims[k], i); } // Index value[k] = i; cb.apply(context, value); } } }; /** * Data filter * @param {string|Array.} * @param {Function} cb * @param {*} [context=this] */ listProto.filterSelf = function (dimensions, cb, context, contextCompat) { 'use strict'; if (!this._count) { return; } if (typeof dimensions === 'function') { contextCompat = context; context = cb; cb = dimensions; dimensions = []; } // contextCompat just for compat echarts3 context = context || contextCompat || this; dimensions = map( normalizeDimensions(dimensions), this.getDimension, this ); if (__DEV__) { validateDimensions(this, dimensions); } var count = this.count(); var Ctor = getIndicesCtor(this); var newIndices = new Ctor(count); var value = []; var dimSize = dimensions.length; var offset = 0; var dim0 = dimensions[0]; for (var i = 0; i < count; i++) { var keep; var rawIdx = this.getRawIndex(i); // Simple optimization if (dimSize === 0) { keep = cb.call(context, i); } else if (dimSize === 1) { var val = this._getFast(dim0, rawIdx); keep = cb.call(context, val, i); } else { for (var k = 0; k < dimSize; k++) { value[k] = this._getFast(dim0, rawIdx); } value[k] = i; keep = cb.apply(context, value); } if (keep) { newIndices[offset++] = rawIdx; } } // Set indices after filtered. if (offset < count) { this._indices = newIndices; } this._count = offset; // Reset data extent this._extent = {}; this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices; return this; }; /** * Select data in range. (For optimization of filter) * (Manually inline code, support 5 million data filtering in data zoom.) */ listProto.selectRange = function (range) { 'use strict'; if (!this._count) { return; } var dimensions = []; for (var dim in range) { if (range.hasOwnProperty(dim)) { dimensions.push(dim); } } if (__DEV__) { validateDimensions(this, dimensions); } var dimSize = dimensions.length; if (!dimSize) { return; } var originalCount = this.count(); var Ctor = getIndicesCtor(this); var newIndices = new Ctor(originalCount); var offset = 0; var dim0 = dimensions[0]; var min = range[dim0][0]; var max = range[dim0][1]; var quickFinished = false; if (!this._indices) { // Extreme optimization for common case. About 2x faster in chrome. var idx = 0; if (dimSize === 1) { var dimStorage = this._storage[dimensions[0]]; for (var k = 0; k < this._chunkCount; k++) { var chunkStorage = dimStorage[k]; var len = Math.min(this._count - k * this._chunkSize, this._chunkSize); for (var i = 0; i < len; i++) { var val = chunkStorage[i]; // NaN will not be filtered. Consider the case, in line chart, empty // value indicates the line should be broken. But for the case like // scatter plot, a data item with empty value will not be rendered, // but the axis extent may be effected if some other dim of the data // item has value. Fortunately it is not a significant negative effect. if ( (val >= min && val <= max) || isNaN(val) ) { newIndices[offset++] = idx; } idx++; } } quickFinished = true; } else if (dimSize === 2) { var dimStorage = this._storage[dim0]; var dimStorage2 = this._storage[dimensions[1]]; var min2 = range[dimensions[1]][0]; var max2 = range[dimensions[1]][1]; for (var k = 0; k < this._chunkCount; k++) { var chunkStorage = dimStorage[k]; var chunkStorage2= dimStorage2[k]; var len = Math.min(this._count - k * this._chunkSize, this._chunkSize); for (var i = 0; i < len; i++) { var val = chunkStorage[i]; var val2 = chunkStorage2[i]; // Do not filter NaN, see comment above. if (( (val >= min && val <= max) || isNaN(val) ) && ( (val2 >= min2 && val2 <= max2) || isNaN(val2) ) ) { newIndices[offset++] = idx; } idx++; } } quickFinished = true; } } if (!quickFinished) { if (dimSize === 1) { for (var i = 0; i < originalCount; i++) { var rawIndex = this.getRawIndex(i); var val = this._getFast(dim0, rawIndex); // Do not filter NaN, see comment above. if ( (val >= min && val <= max) || isNaN(val) ) { newIndices[offset++] = rawIndex; } } } else { for (var i = 0; i < originalCount; i++) { var keep = true; var rawIndex = this.getRawIndex(i); for (var k = 0; k < dimSize; k++) { var dimk = dimensions[k]; var val = this._getFast(dim, rawIndex); // Do not filter NaN, see comment above. if (val < range[dimk][0] || val > range[dimk][1]) { keep = false; } } if (keep) { newIndices[offset++] = this.getRawIndex(i); } } } } // Set indices after filtered. if (offset < originalCount) { this._indices = newIndices; } this._count = offset; // Reset data extent this._extent = {}; this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices; return this; }; /** * Data mapping to a plain array * @param {string|Array.} [dimensions] * @param {Function} cb * @param {*} [context=this] * @return {Array} */ listProto.mapArray = function (dimensions, cb, context, contextCompat) { 'use strict'; if (typeof dimensions === 'function') { contextCompat = context; context = cb; cb = dimensions; dimensions = []; } // contextCompat just for compat echarts3 context = context || contextCompat || this; var result = []; this.each(dimensions, function () { result.push(cb && cb.apply(this, arguments)); }, context); return result; }; // Data in excludeDimensions is copied, otherwise transfered. function cloneListForMapAndSample(original, excludeDimensions) { var allDimensions = original.dimensions; var list = new List( map(allDimensions, original.getDimensionInfo, original), original.hostModel ); // FIXME If needs stackedOn, value may already been stacked transferProperties(list, original); var storage = list._storage = {}; var originalStorage = original._storage; // Init storage for (var i = 0; i < allDimensions.length; i++) { var dim = allDimensions[i]; if (originalStorage[dim]) { // Notice that we do not reset invertedIndicesMap here, becuase // there is no scenario of mapping or sampling ordinal dimension. if (indexOf(excludeDimensions, dim) >= 0) { storage[dim] = cloneDimStore(originalStorage[dim]); list._rawExtent[dim] = getInitialExtent(); list._extent[dim] = null; } else { // Direct reference for other dimensions storage[dim] = originalStorage[dim]; } } } return list; } function cloneDimStore(originalDimStore) { var newDimStore = new Array(originalDimStore.length); for (var j = 0; j < originalDimStore.length; j++) { newDimStore[j] = cloneChunk(originalDimStore[j]); } return newDimStore; } function getInitialExtent() { return [Infinity, -Infinity]; } /** * Data mapping to a new List with given dimensions * @param {string|Array.} dimensions * @param {Function} cb * @param {*} [context=this] * @return {Array} */ listProto.map = function (dimensions, cb, context, contextCompat) { 'use strict'; // contextCompat just for compat echarts3 context = context || contextCompat || this; dimensions = map( normalizeDimensions(dimensions), this.getDimension, this ); if (__DEV__) { validateDimensions(this, dimensions); } var list = cloneListForMapAndSample(this, dimensions); // Following properties are all immutable. // So we can reference to the same value list._indices = this._indices; list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices; var storage = list._storage; var tmpRetValue = []; var chunkSize = this._chunkSize; var dimSize = dimensions.length; var dataCount = this.count(); var values = []; var rawExtent = list._rawExtent; for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) { for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) { values[dimIndex] = this.get(dimensions[dimIndex], dataIndex /*, stack */); } values[dimSize] = dataIndex; var retValue = cb && cb.apply(context, values); if (retValue != null) { // a number or string (in oridinal dimension)? if (typeof retValue !== 'object') { tmpRetValue[0] = retValue; retValue = tmpRetValue; } var rawIndex = this.getRawIndex(dataIndex); var chunkIndex = Math.floor(rawIndex / chunkSize); var chunkOffset = rawIndex % chunkSize; for (var i = 0; i < retValue.length; i++) { var dim = dimensions[i]; var val = retValue[i]; var rawExtentOnDim = rawExtent[dim]; var dimStore = storage[dim]; if (dimStore) { dimStore[chunkIndex][chunkOffset] = val; } if (val < rawExtentOnDim[0]) { rawExtentOnDim[0] = val; } if (val > rawExtentOnDim[1]) { rawExtentOnDim[1] = val; } } } } return list; }; /** * Large data down sampling on given dimension * @param {string} dimension * @param {number} rate * @param {Function} sampleValue * @param {Function} sampleIndex Sample index for name and id */ listProto.downSample = function (dimension, rate, sampleValue, sampleIndex) { var list = cloneListForMapAndSample(this, [dimension]); var targetStorage = list._storage; var frameValues = []; var frameSize = Math.floor(1 / rate); var dimStore = targetStorage[dimension]; var len = this.count(); var chunkSize = this._chunkSize; var rawExtentOnDim = list._rawExtent[dimension]; var newIndices = new (getIndicesCtor(this))(len); var offset = 0; for (var i = 0; i < len; i += frameSize) { // Last frame if (frameSize > len - i) { frameSize = len - i; frameValues.length = frameSize; } for (var k = 0; k < frameSize; k++) { var dataIdx = this.getRawIndex(i + k); var originalChunkIndex = Math.floor(dataIdx / chunkSize); var originalChunkOffset = dataIdx % chunkSize; frameValues[k] = dimStore[originalChunkIndex][originalChunkOffset]; } var value = sampleValue(frameValues); var sampleFrameIdx = this.getRawIndex( Math.min(i + sampleIndex(frameValues, value) || 0, len - 1) ); var sampleChunkIndex = Math.floor(sampleFrameIdx / chunkSize); var sampleChunkOffset = sampleFrameIdx % chunkSize; // Only write value on the filtered data dimStore[sampleChunkIndex][sampleChunkOffset] = value; if (value < rawExtentOnDim[0]) { rawExtentOnDim[0] = value; } if (value > rawExtentOnDim[1]) { rawExtentOnDim[1] = value; } newIndices[offset++] = sampleFrameIdx; } list._count = offset; list._indices = newIndices; list.getRawIndex = getRawIndexWithIndices; return list; }; /** * Get model of one data item. * * @param {number} idx */ // FIXME Model proxy ? listProto.getItemModel = function (idx) { var hostModel = this.hostModel; return new Model(this.getRawDataItem(idx), hostModel, hostModel && hostModel.ecModel); }; /** * Create a data differ * @param {module:echarts/data/List} otherList * @return {module:echarts/data/DataDiffer} */ listProto.diff = function (otherList) { var thisList = this; return new DataDiffer( otherList ? otherList.getIndices() : [], this.getIndices(), function (idx) { return getId(otherList, idx); }, function (idx) { return getId(thisList, idx); } ); }; /** * Get visual property. * @param {string} key */ listProto.getVisual = function (key) { var visual = this._visual; return visual && visual[key]; }; /** * Set visual property * @param {string|Object} key * @param {*} [value] * * @example * setVisual('color', color); * setVisual({ * 'color': color * }); */ listProto.setVisual = function (key, val) { if (isObject$4(key)) { for (var name in key) { if (key.hasOwnProperty(name)) { this.setVisual(name, key[name]); } } return; } this._visual = this._visual || {}; this._visual[key] = val; }; /** * Set layout property. * @param {string|Object} key * @param {*} [val] */ listProto.setLayout = function (key, val) { if (isObject$4(key)) { for (var name in key) { if (key.hasOwnProperty(name)) { this.setLayout(name, key[name]); } } return; } this._layout[key] = val; }; /** * Get layout property. * @param {string} key. * @return {*} */ listProto.getLayout = function (key) { return this._layout[key]; }; /** * Get layout of single data item * @param {number} idx */ listProto.getItemLayout = function (idx) { return this._itemLayouts[idx]; }; /** * Set layout of single data item * @param {number} idx * @param {Object} layout * @param {boolean=} [merge=false] */ listProto.setItemLayout = function (idx, layout, merge$$1) { this._itemLayouts[idx] = merge$$1 ? extend(this._itemLayouts[idx] || {}, layout) : layout; }; /** * Clear all layout of single data item */ listProto.clearItemLayouts = function () { this._itemLayouts.length = 0; }; /** * Get visual property of single data item * @param {number} idx * @param {string} key * @param {boolean} [ignoreParent=false] */ listProto.getItemVisual = function (idx, key, ignoreParent) { var itemVisual = this._itemVisuals[idx]; var val = itemVisual && itemVisual[key]; if (val == null && !ignoreParent) { // Use global visual property return this.getVisual(key); } return val; }; /** * Set visual property of single data item * * @param {number} idx * @param {string|Object} key * @param {*} [value] * * @example * setItemVisual(0, 'color', color); * setItemVisual(0, { * 'color': color * }); */ listProto.setItemVisual = function (idx, key, value) { var itemVisual = this._itemVisuals[idx] || {}; var hasItemVisual = this.hasItemVisual; this._itemVisuals[idx] = itemVisual; if (isObject$4(key)) { for (var name in key) { if (key.hasOwnProperty(name)) { itemVisual[name] = key[name]; hasItemVisual[name] = true; } } return; } itemVisual[key] = value; hasItemVisual[key] = true; }; /** * Clear itemVisuals and list visual. */ listProto.clearAllVisual = function () { this._visual = {}; this._itemVisuals = []; this.hasItemVisual = {}; }; var setItemDataAndSeriesIndex = function (child) { child.seriesIndex = this.seriesIndex; child.dataIndex = this.dataIndex; child.dataType = this.dataType; }; /** * Set graphic element relative to data. It can be set as null * @param {number} idx * @param {module:zrender/Element} [el] */ listProto.setItemGraphicEl = function (idx, el) { var hostModel = this.hostModel; if (el) { // Add data index and series index for indexing the data by element // Useful in tooltip el.dataIndex = idx; el.dataType = this.dataType; el.seriesIndex = hostModel && hostModel.seriesIndex; if (el.type === 'group') { el.traverse(setItemDataAndSeriesIndex, el); } } this._graphicEls[idx] = el; }; /** * @param {number} idx * @return {module:zrender/Element} */ listProto.getItemGraphicEl = function (idx) { return this._graphicEls[idx]; }; /** * @param {Function} cb * @param {*} context */ listProto.eachItemGraphicEl = function (cb, context) { each$1(this._graphicEls, function (el, idx) { if (el) { cb && cb.call(context, el, idx); } }); }; /** * Shallow clone a new list except visual and layout properties, and graph elements. * New list only change the indices. */ listProto.cloneShallow = function (list) { if (!list) { var dimensionInfoList = map(this.dimensions, this.getDimensionInfo, this); list = new List(dimensionInfoList, this.hostModel); } // FIXME list._storage = this._storage; transferProperties(list, this); // Clone will not change the data extent and indices if (this._indices) { var Ctor = this._indices.constructor; list._indices = new Ctor(this._indices); } else { list._indices = null; } list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices; return list; }; /** * Wrap some method to add more feature * @param {string} methodName * @param {Function} injectFunction */ listProto.wrapMethod = function (methodName, injectFunction) { var originalMethod = this[methodName]; if (typeof originalMethod !== 'function') { return; } this.__wrappedMethods = this.__wrappedMethods || []; this.__wrappedMethods.push(methodName); this[methodName] = function () { var res = originalMethod.apply(this, arguments); return injectFunction.apply(this, [res].concat(slice(arguments))); }; }; // Methods that create a new list based on this list should be listed here. // Notice that those method should `RETURN` the new list. listProto.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'map']; // Methods that change indices of this list should be listed here. listProto.CHANGABLE_METHODS = ['filterSelf', 'selectRange']; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @deprecated * Use `echarts/data/helper/createDimensions` instead. */ /** * @see {module:echarts/test/ut/spec/data/completeDimensions} * * Complete the dimensions array, by user defined `dimension` and `encode`, * and guessing from the data structure. * If no 'value' dimension specified, the first no-named dimension will be * named as 'value'. * * @param {Array.} sysDims Necessary dimensions, like ['x', 'y'], which * provides not only dim template, but also default order. * properties: 'name', 'type', 'displayName'. * `name` of each item provides default coord name. * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and * provide dims count that the sysDim required. * [{ordinalMeta}] can be specified. * @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious) * @param {Object} [opt] * @param {Array.} [opt.dimsDef] option.series.dimensions User defined dimensions * For example: ['asdf', {name, type}, ...]. * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3} * @param {string} [opt.generateCoord] Generate coord dim with the given name. * If not specified, extra dim names will be: * 'value', 'value0', 'value1', ... * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`. * If `generateCoordCount` specified, the generated dim names will be: * `generateCoord` + 0, `generateCoord` + 1, ... * can be Infinity, indicate that use all of the remain columns. * @param {number} [opt.dimCount] If not specified, guess by the first data item. * @param {number} [opt.encodeDefaulter] If not specified, auto find the next available data dim. * @return {Array.} [{ * name: string mandatory, * displayName: string, the origin name in dimsDef, see source helper. * If displayName given, the tooltip will displayed vertically. * coordDim: string mandatory, * coordDimIndex: number mandatory, * type: string optional, * otherDims: { never null/undefined * tooltip: number optional, * label: number optional, * itemName: number optional, * seriesName: number optional, * }, * isExtraCoord: boolean true if coord is generated * (not specified in encode and not series specified) * other props ... * }] */ function completeDimensions(sysDims, source, opt) { if (!Source.isInstance(source)) { source = Source.seriesDataToSource(source); } opt = opt || {}; sysDims = (sysDims || []).slice(); var dimsDef = (opt.dimsDef || []).slice(); var encodeDef = createHashMap(opt.encodeDef); var dataDimNameMap = createHashMap(); var coordDimNameMap = createHashMap(); // var valueCandidate; var result = []; var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount); // Apply user defined dims (`name` and `type`) and init result. for (var i = 0; i < dimCount; i++) { var dimDefItem = dimsDef[i] = extend( {}, isObject$1(dimsDef[i]) ? dimsDef[i] : {name: dimsDef[i]} ); var userDimName = dimDefItem.name; var resultItem = result[i] = {otherDims: {}}; // Name will be applied later for avoiding duplication. if (userDimName != null && dataDimNameMap.get(userDimName) == null) { // Only if `series.dimensions` is defined in option // displayName, will be set, and dimension will be diplayed vertically in // tooltip by default. resultItem.name = resultItem.displayName = userDimName; dataDimNameMap.set(userDimName, i); } dimDefItem.type != null && (resultItem.type = dimDefItem.type); dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName); } // Set `coordDim` and `coordDimIndex` by `encodeDef` and normalize `encodeDef`. encodeDef.each(function (dataDims, coordDim) { dataDims = normalizeToArray(dataDims).slice(); var validDataDims = encodeDef.set(coordDim, []); each$1(dataDims, function (resultDimIdx, idx) { // The input resultDimIdx can be dim name or index. isString(resultDimIdx) && (resultDimIdx = dataDimNameMap.get(resultDimIdx)); if (resultDimIdx != null && resultDimIdx < dimCount) { validDataDims[idx] = resultDimIdx; applyDim(result[resultDimIdx], coordDim, idx); } }); }); // Apply templetes and default order from `sysDims`. var availDimIdx = 0; each$1(sysDims, function (sysDimItem, sysDimIndex) { var coordDim; var sysDimItem; var sysDimItemDimsDef; var sysDimItemOtherDims; if (isString(sysDimItem)) { coordDim = sysDimItem; sysDimItem = {}; } else { coordDim = sysDimItem.name; var ordinalMeta = sysDimItem.ordinalMeta; sysDimItem.ordinalMeta = null; sysDimItem = clone(sysDimItem); sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly. sysDimItemDimsDef = sysDimItem.dimsDef; sysDimItemOtherDims = sysDimItem.otherDims; sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null; } var dataDims = normalizeToArray(encodeDef.get(coordDim)); // dimensions provides default dim sequences. if (!dataDims.length) { for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) { while (availDimIdx < result.length && result[availDimIdx].coordDim != null) { availDimIdx++; } availDimIdx < result.length && dataDims.push(availDimIdx++); } } // Apply templates. each$1(dataDims, function (resultDimIdx, coordDimIndex) { var resultItem = result[resultDimIdx]; applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex); if (resultItem.name == null && sysDimItemDimsDef) { var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex]; !isObject$1(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {name: sysDimItemDimsDefItem}); resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name; resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip; } // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}} sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims); }); }); function applyDim(resultItem, coordDim, coordDimIndex) { if (OTHER_DIMENSIONS.get(coordDim) != null) { resultItem.otherDims[coordDim] = coordDimIndex; } else { resultItem.coordDim = coordDim; resultItem.coordDimIndex = coordDimIndex; coordDimNameMap.set(coordDim, true); } } // Make sure the first extra dim is 'value'. var generateCoord = opt.generateCoord; var generateCoordCount = opt.generateCoordCount; var fromZero = generateCoordCount != null; generateCoordCount = generateCoord ? (generateCoordCount || 1) : 0; var extra = generateCoord || 'value'; // Set dim `name` and other `coordDim` and other props. for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) { var resultItem = result[resultDimIdx] = result[resultDimIdx] || {}; var coordDim = resultItem.coordDim; if (coordDim == null) { resultItem.coordDim = genName( extra, coordDimNameMap, fromZero ); resultItem.coordDimIndex = 0; if (!generateCoord || generateCoordCount <= 0) { resultItem.isExtraCoord = true; } generateCoordCount--; } resultItem.name == null && (resultItem.name = genName( resultItem.coordDim, dataDimNameMap )); if (resultItem.type == null && guessOrdinal(source, resultDimIdx, resultItem.name)) { resultItem.type = 'ordinal'; } } return result; } // ??? TODO // Originally detect dimCount by data[0]. Should we // optimize it to only by sysDims and dimensions and encode. // So only necessary dims will be initialized. // But // (1) custom series should be considered. where other dims // may be visited. // (2) sometimes user need to calcualte bubble size or use visualMap // on other dimensions besides coordSys needed. // So, dims that is not used by system, should be shared in storage? function getDimCount(source, sysDims, dimsDef, optDimCount) { // Note that the result dimCount should not small than columns count // of data, otherwise `dataDimNameMap` checking will be incorrect. var dimCount = Math.max( source.dimensionsDetectCount || 1, sysDims.length, dimsDef.length, optDimCount || 0 ); each$1(sysDims, function (sysDimItem) { var sysDimItemDimsDef = sysDimItem.dimsDef; sysDimItemDimsDef && (dimCount = Math.max(dimCount, sysDimItemDimsDef.length)); }); return dimCount; } function genName(name, map$$1, fromZero) { if (fromZero || map$$1.get(name) != null) { var i = 0; while (map$$1.get(name + i) != null) { i++; } name += i; } map$$1.set(name, true); return name; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Substitute `completeDimensions`. * `completeDimensions` is to be deprecated. */ /** * @param {module:echarts/data/Source|module:echarts/data/List} source or data. * @param {Object|Array} [opt] * @param {Array.} [opt.coordDimensions=[]] * @param {number} [opt.dimensionsCount] * @param {string} [opt.generateCoord] * @param {string} [opt.generateCoordCount] * @param {Array.} [opt.dimensionsDefine=source.dimensionsDefine] Overwrite source define. * @param {Object|HashMap} [opt.encodeDefine=source.encodeDefine] Overwrite source define. * @return {Array.} dimensionsInfo */ var createDimensions = function (source, opt) { opt = opt || {}; return completeDimensions(opt.coordDimensions || [], source, { dimsDef: opt.dimensionsDefine || source.dimensionsDefine, encodeDef: opt.encodeDefine || source.encodeDefine, dimCount: opt.dimensionsCount, generateCoord: opt.generateCoord, generateCoordCount: opt.generateCoordCount }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Note that it is too complicated to support 3d stack by value * (have to create two-dimension inverted index), so in 3d case * we just support that stacked by index. * * @param {module:echarts/model/Series} seriesModel * @param {Array.} dimensionInfoList The same as the input of . * The input dimensionInfoList will be modified. * @param {Object} [opt] * @param {boolean} [opt.stackedCoordDimension=''] Specify a coord dimension if needed. * @param {boolean} [opt.byIndex=false] * @return {Object} calculationInfo * { * stackedDimension: string * stackedByDimension: string * isStackedByIndex: boolean * stackedOverDimension: string * stackResultDimension: string * } */ function enableDataStack(seriesModel, dimensionInfoList, opt) { opt = opt || {}; var byIndex = opt.byIndex; var stackedCoordDimension = opt.stackedCoordDimension; // Compatibal: when `stack` is set as '', do not stack. var mayStack = !!(seriesModel && seriesModel.get('stack')); var stackedByDimInfo; var stackedDimInfo; var stackResultDimension; var stackedOverDimension; each$1(dimensionInfoList, function (dimensionInfo, index) { if (isString(dimensionInfo)) { dimensionInfoList[index] = dimensionInfo = {name: dimensionInfo}; } if (mayStack && !dimensionInfo.isExtraCoord) { // Find the first ordinal dimension as the stackedByDimInfo. if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) { stackedByDimInfo = dimensionInfo; } // Find the first stackable dimension as the stackedDimInfo. if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim) ) { stackedDimInfo = dimensionInfo; } } }); if (stackedDimInfo && !byIndex && !stackedByDimInfo) { // Compatible with previous design, value axis (time axis) only stack by index. // It may make sense if the user provides elaborately constructed data. byIndex = true; } // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`. // That put stack logic in List is for using conveniently in echarts extensions, but it // might not be a good way. if (stackedDimInfo) { // Use a weird name that not duplicated with other names. stackResultDimension = '__\0ecstackresult'; stackedOverDimension = '__\0ecstackedover'; // Create inverted index to fast query index by value. if (stackedByDimInfo) { stackedByDimInfo.createInvertedIndices = true; } var stackedDimCoordDim = stackedDimInfo.coordDim; var stackedDimType = stackedDimInfo.type; var stackedDimCoordIndex = 0; each$1(dimensionInfoList, function (dimensionInfo) { if (dimensionInfo.coordDim === stackedDimCoordDim) { stackedDimCoordIndex++; } }); dimensionInfoList.push({ name: stackResultDimension, coordDim: stackedDimCoordDim, coordDimIndex: stackedDimCoordIndex, type: stackedDimType, isExtraCoord: true, isCalculationCoord: true }); stackedDimCoordIndex++; dimensionInfoList.push({ name: stackedOverDimension, // This dimension contains stack base (generally, 0), so do not set it as // `stackedDimCoordDim` to avoid extent calculation, consider log scale. coordDim: stackedOverDimension, coordDimIndex: stackedDimCoordIndex, type: stackedDimType, isExtraCoord: true, isCalculationCoord: true }); } return { stackedDimension: stackedDimInfo && stackedDimInfo.name, stackedByDimension: stackedByDimInfo && stackedByDimInfo.name, isStackedByIndex: byIndex, stackedOverDimension: stackedOverDimension, stackResultDimension: stackResultDimension }; } /** * @param {module:echarts/data/List} data * @param {string} stackedDim */ function isDimensionStacked(data, stackedDim /*, stackedByDim*/) { // Each single series only maps to one pair of axis. So we do not need to // check stackByDim, whatever stacked by a dimension or stacked by index. return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension'); // && ( // stackedByDim != null // ? stackedByDim === data.getCalculationInfo('stackedByDimension') // : data.getCalculationInfo('isStackedByIndex') // ); } /** * @param {module:echarts/data/List} data * @param {string} targetDim * @param {string} [stackedByDim] If not input this parameter, check whether * stacked by index. * @return {string} dimension */ function getStackedDimension(data, targetDim) { return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @param {module:echarts/data/Source|Array} source Or raw data. * @param {module:echarts/model/Series} seriesModel * @param {Object} [opt] * @param {string} [opt.generateCoord] */ function createListFromArray(source, seriesModel, opt) { opt = opt || {}; if (!Source.isInstance(source)) { source = Source.seriesDataToSource(source); } var coordSysName = seriesModel.get('coordinateSystem'); var registeredCoordSys = CoordinateSystemManager.get(coordSysName); var coordSysDefine = getCoordSysDefineBySeries(seriesModel); var coordSysDimDefs; if (coordSysDefine) { coordSysDimDefs = map(coordSysDefine.coordSysDims, function (dim) { var dimInfo = {name: dim}; var axisModel = coordSysDefine.axisMap.get(dim); if (axisModel) { var axisType = axisModel.get('type'); dimInfo.type = getDimensionTypeByAxis(axisType); // dimInfo.stackable = isStackable(axisType); } return dimInfo; }); } if (!coordSysDimDefs) { // Get dimensions from registered coordinate system coordSysDimDefs = (registeredCoordSys && ( registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice() )) || ['x', 'y']; } var dimInfoList = createDimensions(source, { coordDimensions: coordSysDimDefs, generateCoord: opt.generateCoord }); var firstCategoryDimIndex; var hasNameEncode; coordSysDefine && each$1(dimInfoList, function (dimInfo, dimIndex) { var coordDim = dimInfo.coordDim; var categoryAxisModel = coordSysDefine.categoryAxisMap.get(coordDim); if (categoryAxisModel) { if (firstCategoryDimIndex == null) { firstCategoryDimIndex = dimIndex; } dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta(); } if (dimInfo.otherDims.itemName != null) { hasNameEncode = true; } }); if (!hasNameEncode && firstCategoryDimIndex != null) { dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0; } var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList); var list = new List(dimInfoList, seriesModel); list.setCalculationInfo(stackCalculationInfo); var dimValueGetter = (firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source)) ? function (itemOpt, dimName, dataIndex, dimIndex) { // Use dataIndex as ordinal value in categoryAxis return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex); } : null; list.hasItemOption = false; list.initData(source, null, dimValueGetter); return list; } function isNeedCompleteOrdinalData(source) { if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) { var sampleItem = firstDataNotNull(source.data || []); return sampleItem != null && !isArray(getDataItemValue(sampleItem)); } } function firstDataNotNull(data) { var i = 0; while (i < data.length && data[i] == null) { i++; } return data[i]; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * // Scale class management * @module echarts/scale/Scale */ /** * @param {Object} [setting] */ function Scale(setting) { this._setting = setting || {}; /** * Extent * @type {Array.} * @protected */ this._extent = [Infinity, -Infinity]; /** * Step is calculated in adjustExtent * @type {Array.} * @protected */ this._interval = 0; this.init && this.init.apply(this, arguments); } /** * Parse input val to valid inner number. * @param {*} val * @return {number} */ Scale.prototype.parse = function (val) { // Notice: This would be a trap here, If the implementation // of this method depends on extent, and this method is used // before extent set (like in dataZoom), it would be wrong. // Nevertheless, parse does not depend on extent generally. return val; }; Scale.prototype.getSetting = function (name) { return this._setting[name]; }; Scale.prototype.contain = function (val) { var extent = this._extent; return val >= extent[0] && val <= extent[1]; }; /** * Normalize value to linear [0, 1], return 0.5 if extent span is 0 * @param {number} val * @return {number} */ Scale.prototype.normalize = function (val) { var extent = this._extent; if (extent[1] === extent[0]) { return 0.5; } return (val - extent[0]) / (extent[1] - extent[0]); }; /** * Scale normalized value * @param {number} val * @return {number} */ Scale.prototype.scale = function (val) { var extent = this._extent; return val * (extent[1] - extent[0]) + extent[0]; }; /** * Set extent from data * @param {Array.} other */ Scale.prototype.unionExtent = function (other) { var extent = this._extent; other[0] < extent[0] && (extent[0] = other[0]); other[1] > extent[1] && (extent[1] = other[1]); // not setExtent because in log axis it may transformed to power // this.setExtent(extent[0], extent[1]); }; /** * Set extent from data * @param {module:echarts/data/List} data * @param {string} dim */ Scale.prototype.unionExtentFromData = function (data, dim) { this.unionExtent(data.getApproximateExtent(dim)); }; /** * Get extent * @return {Array.} */ Scale.prototype.getExtent = function () { return this._extent.slice(); }; /** * Set extent * @param {number} start * @param {number} end */ Scale.prototype.setExtent = function (start, end) { var thisExtent = this._extent; if (!isNaN(start)) { thisExtent[0] = start; } if (!isNaN(end)) { thisExtent[1] = end; } }; /** * When axis extent depends on data and no data exists, * axis ticks should not be drawn, which is named 'blank'. */ Scale.prototype.isBlank = function () { return this._isBlank; }, /** * When axis extent depends on data and no data exists, * axis ticks should not be drawn, which is named 'blank'. */ Scale.prototype.setBlank = function (isBlank) { this._isBlank = isBlank; }; /** * @abstract * @param {*} tick * @return {string} label of the tick. */ Scale.prototype.getLabel = null; enableClassExtend(Scale); enableClassManagement(Scale, { registerWhenExtend: true }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @constructor * @param {Object} [opt] * @param {Object} [opt.categories=[]] * @param {Object} [opt.needCollect=false] * @param {Object} [opt.deduplication=false] */ function OrdinalMeta(opt) { /** * @readOnly * @type {Array.} */ this.categories = opt.categories || []; /** * @private * @type {boolean} */ this._needCollect = opt.needCollect; /** * @private * @type {boolean} */ this._deduplication = opt.deduplication; /** * @private * @type {boolean} */ this._map; } /** * @param {module:echarts/model/Model} axisModel * @return {module:echarts/data/OrdinalMeta} */ OrdinalMeta.createByAxisModel = function (axisModel) { var option = axisModel.option; var data = option.data; var categories = data && map(data, getName); return new OrdinalMeta({ categories: categories, needCollect: !categories, // deduplication is default in axis. deduplication: option.dedplication !== false }); }; var proto$1 = OrdinalMeta.prototype; /** * @param {string} category * @return {number} ordinal */ proto$1.getOrdinal = function (category) { return getOrCreateMap(this).get(category); }; /** * @param {*} category * @return {number} The ordinal. If not found, return NaN. */ proto$1.parseAndCollect = function (category) { var index; var needCollect = this._needCollect; // The value of category dim can be the index of the given category set. // This feature is only supported when !needCollect, because we should // consider a common case: a value is 2017, which is a number but is // expected to be tread as a category. This case usually happen in dataset, // where it happent to be no need of the index feature. if (typeof category !== 'string' && !needCollect) { return category; } // Optimize for the scenario: // category is ['2012-01-01', '2012-01-02', ...], where the input // data has been ensured not duplicate and is large data. // Notice, if a dataset dimension provide categroies, usually echarts // should remove duplication except user tell echarts dont do that // (set axis.deduplication = false), because echarts do not know whether // the values in the category dimension has duplication (consider the // parallel-aqi example) if (needCollect && !this._deduplication) { index = this.categories.length; this.categories[index] = category; return index; } var map$$1 = getOrCreateMap(this); index = map$$1.get(category); if (index == null) { if (needCollect) { index = this.categories.length; this.categories[index] = category; map$$1.set(category, index); } else { index = NaN; } } return index; }; // Consider big data, do not create map until needed. function getOrCreateMap(ordinalMeta) { return ordinalMeta._map || ( ordinalMeta._map = createHashMap(ordinalMeta.categories) ); } function getName(obj) { if (isObject$1(obj) && obj.value != null) { return obj.value; } else { return obj + ''; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Linear continuous scale * @module echarts/coord/scale/Ordinal * * http://en.wikipedia.org/wiki/Level_of_measurement */ // FIXME only one data var scaleProto = Scale.prototype; var OrdinalScale = Scale.extend({ type: 'ordinal', /** * @param {module:echarts/data/OrdianlMeta|Array.} ordinalMeta */ init: function (ordinalMeta, extent) { // Caution: Should not use instanceof, consider ec-extensions using // import approach to get OrdinalMeta class. if (!ordinalMeta || isArray(ordinalMeta)) { ordinalMeta = new OrdinalMeta({categories: ordinalMeta}); } this._ordinalMeta = ordinalMeta; this._extent = extent || [0, ordinalMeta.categories.length - 1]; }, parse: function (val) { return typeof val === 'string' ? this._ordinalMeta.getOrdinal(val) // val might be float. : Math.round(val); }, contain: function (rank) { rank = this.parse(rank); return scaleProto.contain.call(this, rank) && this._ordinalMeta.categories[rank] != null; }, /** * Normalize given rank or name to linear [0, 1] * @param {number|string} [val] * @return {number} */ normalize: function (val) { return scaleProto.normalize.call(this, this.parse(val)); }, scale: function (val) { return Math.round(scaleProto.scale.call(this, val)); }, /** * @return {Array} */ getTicks: function () { var ticks = []; var extent = this._extent; var rank = extent[0]; while (rank <= extent[1]) { ticks.push(rank); rank++; } return ticks; }, /** * Get item on rank n * @param {number} n * @return {string} */ getLabel: function (n) { if (!this.isBlank()) { // Note that if no data, ordinalMeta.categories is an empty array. return this._ordinalMeta.categories[n]; } }, /** * @return {number} */ count: function () { return this._extent[1] - this._extent[0] + 1; }, /** * @override */ unionExtentFromData: function (data, dim) { this.unionExtent(data.getApproximateExtent(dim)); }, getOrdinalMeta: function () { return this._ordinalMeta; }, niceTicks: noop, niceExtent: noop }); /** * @return {module:echarts/scale/Time} */ OrdinalScale.create = function () { return new OrdinalScale(); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * For testable. */ var roundNumber$1 = round$1; /** * @param {Array.} extent Both extent[0] and extent[1] should be valid number. * Should be extent[0] < extent[1]. * @param {number} splitNumber splitNumber should be >= 1. * @param {number} [minInterval] * @param {number} [maxInterval] * @return {Object} {interval, intervalPrecision, niceTickExtent} */ function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) { var result = {}; var span = extent[1] - extent[0]; var interval = result.interval = nice(span / splitNumber, true); if (minInterval != null && interval < minInterval) { interval = result.interval = minInterval; } if (maxInterval != null && interval > maxInterval) { interval = result.interval = maxInterval; } // Tow more digital for tick. var precision = result.intervalPrecision = getIntervalPrecision(interval); // Niced extent inside original extent var niceTickExtent = result.niceTickExtent = [ roundNumber$1(Math.ceil(extent[0] / interval) * interval, precision), roundNumber$1(Math.floor(extent[1] / interval) * interval, precision) ]; fixExtent(niceTickExtent, extent); return result; } /** * @param {number} interval * @return {number} interval precision */ function getIntervalPrecision(interval) { // Tow more digital for tick. return getPrecisionSafe(interval) + 2; } function clamp(niceTickExtent, idx, extent) { niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]); } // In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent. function fixExtent(niceTickExtent, extent) { !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]); !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]); clamp(niceTickExtent, 0, extent); clamp(niceTickExtent, 1, extent); if (niceTickExtent[0] > niceTickExtent[1]) { niceTickExtent[0] = niceTickExtent[1]; } } function intervalScaleGetTicks(interval, extent, niceTickExtent, intervalPrecision) { var ticks = []; // If interval is 0, return []; if (!interval) { return ticks; } // Consider this case: using dataZoom toolbox, zoom and zoom. var safeLimit = 10000; if (extent[0] < niceTickExtent[0]) { ticks.push(extent[0]); } var tick = niceTickExtent[0]; while (tick <= niceTickExtent[1]) { ticks.push(tick); // Avoid rounding error tick = roundNumber$1(tick + interval, intervalPrecision); if (tick === ticks[ticks.length - 1]) { // Consider out of safe float point, e.g., // -3711126.9907707 + 2e-10 === -3711126.9907707 break; } if (ticks.length > safeLimit) { return []; } } // Consider this case: the last item of ticks is smaller // than niceTickExtent[1] and niceTickExtent[1] === extent[1]. if (extent[1] > (ticks.length ? ticks[ticks.length - 1] : niceTickExtent[1])) { ticks.push(extent[1]); } return ticks; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Interval scale * @module echarts/scale/Interval */ var roundNumber = round$1; /** * @alias module:echarts/coord/scale/Interval * @constructor */ var IntervalScale = Scale.extend({ type: 'interval', _interval: 0, _intervalPrecision: 2, setExtent: function (start, end) { var thisExtent = this._extent; //start,end may be a Number like '25',so... if (!isNaN(start)) { thisExtent[0] = parseFloat(start); } if (!isNaN(end)) { thisExtent[1] = parseFloat(end); } }, unionExtent: function (other) { var extent = this._extent; other[0] < extent[0] && (extent[0] = other[0]); other[1] > extent[1] && (extent[1] = other[1]); // unionExtent may called by it's sub classes IntervalScale.prototype.setExtent.call(this, extent[0], extent[1]); }, /** * Get interval */ getInterval: function () { return this._interval; }, /** * Set interval */ setInterval: function (interval) { this._interval = interval; // Dropped auto calculated niceExtent and use user setted extent // We assume user wan't to set both interval, min, max to get a better result this._niceExtent = this._extent.slice(); this._intervalPrecision = getIntervalPrecision(interval); }, /** * @return {Array.} */ getTicks: function () { return intervalScaleGetTicks( this._interval, this._extent, this._niceExtent, this._intervalPrecision ); }, /** * @param {number} data * @param {Object} [opt] * @param {number|string} [opt.precision] If 'auto', use nice presision. * @param {boolean} [opt.pad] returns 1.50 but not 1.5 if precision is 2. * @return {string} */ getLabel: function (data, opt) { if (data == null) { return ''; } var precision = opt && opt.precision; if (precision == null) { precision = getPrecisionSafe(data) || 0; } else if (precision === 'auto') { // Should be more precise then tick. precision = this._intervalPrecision; } // (1) If `precision` is set, 12.005 should be display as '12.00500'. // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'. data = roundNumber(data, precision, true); return addCommas(data); }, /** * Update interval and extent of intervals for nice ticks * * @param {number} [splitNumber = 5] Desired number of ticks * @param {number} [minInterval] * @param {number} [maxInterval] */ niceTicks: function (splitNumber, minInterval, maxInterval) { splitNumber = splitNumber || 5; var extent = this._extent; var span = extent[1] - extent[0]; if (!isFinite(span)) { return; } // User may set axis min 0 and data are all negative // FIXME If it needs to reverse ? if (span < 0) { span = -span; extent.reverse(); } var result = intervalScaleNiceTicks( extent, splitNumber, minInterval, maxInterval ); this._intervalPrecision = result.intervalPrecision; this._interval = result.interval; this._niceExtent = result.niceTickExtent; }, /** * Nice extent. * @param {Object} opt * @param {number} [opt.splitNumber = 5] Given approx tick number * @param {boolean} [opt.fixMin=false] * @param {boolean} [opt.fixMax=false] * @param {boolean} [opt.minInterval] * @param {boolean} [opt.maxInterval] */ niceExtent: function (opt) { var extent = this._extent; // If extent start and end are same, expand them if (extent[0] === extent[1]) { if (extent[0] !== 0) { // Expand extent var expandSize = extent[0]; // In the fowllowing case // Axis has been fixed max 100 // Plus data are all 100 and axis extent are [100, 100]. // Extend to the both side will cause expanded max is larger than fixed max. // So only expand to the smaller side. if (!opt.fixMax) { extent[1] += expandSize / 2; extent[0] -= expandSize / 2; } else { extent[0] -= expandSize / 2; } } else { extent[1] = 1; } } var span = extent[1] - extent[0]; // If there are no data and extent are [Infinity, -Infinity] if (!isFinite(span)) { extent[0] = 0; extent[1] = 1; } this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); // var extent = this._extent; var interval = this._interval; if (!opt.fixMin) { extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval); } if (!opt.fixMax) { extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval); } } }); /** * @return {module:echarts/scale/Time} */ IntervalScale.create = function () { return new IntervalScale(); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var STACK_PREFIX = '__ec_stack_'; var LARGE_BAR_MIN_WIDTH = 0.5; var LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array; function getSeriesStackId(seriesModel) { return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex; } function getAxisKey(axis) { return axis.dim + axis.index; } /** * @param {Object} opt * @param {module:echarts/coord/Axis} opt.axis Only support category axis currently. * @param {number} opt.count Positive interger. * @param {number} [opt.barWidth] * @param {number} [opt.barMaxWidth] * @param {number} [opt.barGap] * @param {number} [opt.barCategoryGap] * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined. */ function getLayoutOnAxis(opt) { var params = []; var baseAxis = opt.axis; var axisKey = 'axis0'; if (baseAxis.type !== 'category') { return; } var bandWidth = baseAxis.getBandWidth(); for (var i = 0; i < opt.count || 0; i++) { params.push(defaults({ bandWidth: bandWidth, axisKey: axisKey, stackId: STACK_PREFIX + i }, opt)); } var widthAndOffsets = doCalBarWidthAndOffset(params); var result = []; for (var i = 0; i < opt.count; i++) { var item = widthAndOffsets[axisKey][STACK_PREFIX + i]; item.offsetCenter = item.offset + item.width / 2; result.push(item); } return result; } function prepareLayoutBarSeries(seriesType, ecModel) { var seriesModels = []; ecModel.eachSeriesByType(seriesType, function (seriesModel) { // Check series coordinate, do layout for cartesian2d only if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) { seriesModels.push(seriesModel); } }); return seriesModels; } function makeColumnLayout(barSeries) { var seriesInfoList = []; each$1(barSeries, function (seriesModel) { var data = seriesModel.getData(); var cartesian = seriesModel.coordinateSystem; var baseAxis = cartesian.getBaseAxis(); var axisExtent = baseAxis.getExtent(); var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count()); var barWidth = parsePercent$1( seriesModel.get('barWidth'), bandWidth ); var barMaxWidth = parsePercent$1( seriesModel.get('barMaxWidth'), bandWidth ); var barGap = seriesModel.get('barGap'); var barCategoryGap = seriesModel.get('barCategoryGap'); seriesInfoList.push({ bandWidth: bandWidth, barWidth: barWidth, barMaxWidth: barMaxWidth, barGap: barGap, barCategoryGap: barCategoryGap, axisKey: getAxisKey(baseAxis), stackId: getSeriesStackId(seriesModel) }); }); return doCalBarWidthAndOffset(seriesInfoList); } function doCalBarWidthAndOffset(seriesInfoList) { // Columns info on each category axis. Key is cartesian name var columnsMap = {}; each$1(seriesInfoList, function (seriesInfo, idx) { var axisKey = seriesInfo.axisKey; var bandWidth = seriesInfo.bandWidth; var columnsOnAxis = columnsMap[axisKey] || { bandWidth: bandWidth, remainedWidth: bandWidth, autoWidthCount: 0, categoryGap: '20%', gap: '30%', stacks: {} }; var stacks = columnsOnAxis.stacks; columnsMap[axisKey] = columnsOnAxis; var stackId = seriesInfo.stackId; if (!stacks[stackId]) { columnsOnAxis.autoWidthCount++; } stacks[stackId] = stacks[stackId] || { width: 0, maxWidth: 0 }; // Caution: In a single coordinate system, these barGrid attributes // will be shared by series. Consider that they have default values, // only the attributes set on the last series will work. // Do not change this fact unless there will be a break change. // TODO var barWidth = seriesInfo.barWidth; if (barWidth && !stacks[stackId].width) { // See #6312, do not restrict width. stacks[stackId].width = barWidth; barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); columnsOnAxis.remainedWidth -= barWidth; } var barMaxWidth = seriesInfo.barMaxWidth; barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); var barGap = seriesInfo.barGap; (barGap != null) && (columnsOnAxis.gap = barGap); var barCategoryGap = seriesInfo.barCategoryGap; (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap); }); var result = {}; each$1(columnsMap, function (columnsOnAxis, coordSysName) { result[coordSysName] = {}; var stacks = columnsOnAxis.stacks; var bandWidth = columnsOnAxis.bandWidth; var categoryGap = parsePercent$1(columnsOnAxis.categoryGap, bandWidth); var barGapPercent = parsePercent$1(columnsOnAxis.gap, 1); var remainedWidth = columnsOnAxis.remainedWidth; var autoWidthCount = columnsOnAxis.autoWidthCount; var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth each$1(stacks, function (column, stack) { var maxWidth = column.maxWidth; if (maxWidth && maxWidth < autoWidth) { maxWidth = Math.min(maxWidth, remainedWidth); if (column.width) { maxWidth = Math.min(maxWidth, column.width); } remainedWidth -= maxWidth; column.width = maxWidth; autoWidthCount--; } }); // Recalculate width again autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); autoWidth = Math.max(autoWidth, 0); var widthSum = 0; var lastColumn; each$1(stacks, function (column, idx) { if (!column.width) { column.width = autoWidth; } lastColumn = column; widthSum += column.width * (1 + barGapPercent); }); if (lastColumn) { widthSum -= lastColumn.width * barGapPercent; } var offset = -widthSum / 2; each$1(stacks, function (column, stackId) { result[coordSysName][stackId] = result[coordSysName][stackId] || { offset: offset, width: column.width }; offset += column.width * (1 + barGapPercent); }); }); return result; } /** * @param {Object} barWidthAndOffset The result of makeColumnLayout * @param {module:echarts/coord/Axis} axis * @param {module:echarts/model/Series} [seriesModel] If not provided, return all. * @return {Object} {stackId: {offset, width}} or {offset, width} if seriesModel provided. */ function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) { if (barWidthAndOffset && axis) { var result = barWidthAndOffset[getAxisKey(axis)]; if (result != null && seriesModel != null) { result = result[getSeriesStackId(seriesModel)]; } return result; } } /** * @param {string} seriesType * @param {module:echarts/model/Global} ecModel */ function layout(seriesType, ecModel) { var seriesModels = prepareLayoutBarSeries(seriesType, ecModel); var barWidthAndOffset = makeColumnLayout(seriesModels); var lastStackCoords = {}; each$1(seriesModels, function (seriesModel) { var data = seriesModel.getData(); var cartesian = seriesModel.coordinateSystem; var baseAxis = cartesian.getBaseAxis(); var stackId = getSeriesStackId(seriesModel); var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId]; var columnOffset = columnLayoutInfo.offset; var columnWidth = columnLayoutInfo.width; var valueAxis = cartesian.getOtherAxis(baseAxis); var barMinHeight = seriesModel.get('barMinHeight') || 0; lastStackCoords[stackId] = lastStackCoords[stackId] || []; data.setLayout({ offset: columnOffset, size: columnWidth }); var valueDim = data.mapDimension(valueAxis.dim); var baseDim = data.mapDimension(baseAxis.dim); var stacked = isDimensionStacked(data, valueDim /*, baseDim*/); var isValueAxisH = valueAxis.isHorizontal(); var valueAxisStart = getValueAxisStart(baseAxis, valueAxis, stacked); for (var idx = 0, len = data.count(); idx < len; idx++) { var value = data.get(valueDim, idx); var baseValue = data.get(baseDim, idx); if (isNaN(value)) { continue; } var sign = value >= 0 ? 'p' : 'n'; var baseCoord = valueAxisStart; // Because of the barMinHeight, we can not use the value in // stackResultDimension directly. if (stacked) { // Only ordinal axis can be stacked. if (!lastStackCoords[stackId][baseValue]) { lastStackCoords[stackId][baseValue] = { p: valueAxisStart, // Positive stack n: valueAxisStart // Negative stack }; } // Should also consider #4243 baseCoord = lastStackCoords[stackId][baseValue][sign]; } var x; var y; var width; var height; if (isValueAxisH) { var coord = cartesian.dataToPoint([value, baseValue]); x = baseCoord; y = coord[1] + columnOffset; width = coord[0] - valueAxisStart; height = columnWidth; if (Math.abs(width) < barMinHeight) { width = (width < 0 ? -1 : 1) * barMinHeight; } stacked && (lastStackCoords[stackId][baseValue][sign] += width); } else { var coord = cartesian.dataToPoint([baseValue, value]); x = coord[0] + columnOffset; y = baseCoord; width = columnWidth; height = coord[1] - valueAxisStart; if (Math.abs(height) < barMinHeight) { // Include zero to has a positive bar height = (height <= 0 ? -1 : 1) * barMinHeight; } stacked && (lastStackCoords[stackId][baseValue][sign] += height); } data.setItemLayout(idx, { x: x, y: y, width: width, height: height }); } }, this); } // TODO: Do not support stack in large mode yet. var largeLayout = { seriesType: 'bar', plan: createRenderPlanner(), reset: function (seriesModel) { if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) { return; } var data = seriesModel.getData(); var cartesian = seriesModel.coordinateSystem; var baseAxis = cartesian.getBaseAxis(); var valueAxis = cartesian.getOtherAxis(baseAxis); var valueDim = data.mapDimension(valueAxis.dim); var baseDim = data.mapDimension(baseAxis.dim); var valueAxisHorizontal = valueAxis.isHorizontal(); var valueDimIdx = valueAxisHorizontal ? 0 : 1; var barWidth = retrieveColumnLayout( makeColumnLayout([seriesModel]), baseAxis, seriesModel ).width; if (!(barWidth > LARGE_BAR_MIN_WIDTH)) { // jshint ignore:line barWidth = LARGE_BAR_MIN_WIDTH; } return {progress: progress}; function progress(params, data) { var largePoints = new LargeArr(params.count * 2); var dataIndex; var coord = []; var valuePair = []; var offset = 0; while ((dataIndex = params.next()) != null) { valuePair[valueDimIdx] = data.get(valueDim, dataIndex); valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex); coord = cartesian.dataToPoint(valuePair, null, coord); largePoints[offset++] = coord[0]; largePoints[offset++] = coord[1]; } data.setLayout({ largePoints: largePoints, barWidth: barWidth, valueAxisStart: getValueAxisStart(baseAxis, valueAxis, false), valueAxisHorizontal: valueAxisHorizontal }); } } }; function isOnCartesian(seriesModel) { return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d'; } function isInLargeMode(seriesModel) { return seriesModel.pipelineContext && seriesModel.pipelineContext.large; } function getValueAxisStart(baseAxis, valueAxis, stacked) { return ( indexOf(baseAxis.getAxesOnZeroOf(), valueAxis) >= 0 || stacked ) ? valueAxis.toGlobalCoord(valueAxis.dataToCoord(0)) : valueAxis.getGlobalExtent()[0]; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * The `scaleLevels` references to d3.js. The use of the source * code of this file is also subject to the terms and consitions * of its license (BSD-3Clause, see ). */ // [About UTC and local time zone]: // In most cases, `number.parseDate` will treat input data string as local time // (except time zone is specified in time string). And `format.formateTime` returns // local time by default. option.useUTC is false by default. This design have // concidered these common case: // (1) Time that is persistent in server is in UTC, but it is needed to be diplayed // in local time by default. // (2) By default, the input data string (e.g., '2011-01-02') should be displayed // as its original time, without any time difference. var intervalScaleProto = IntervalScale.prototype; var mathCeil = Math.ceil; var mathFloor = Math.floor; var ONE_SECOND = 1000; var ONE_MINUTE = ONE_SECOND * 60; var ONE_HOUR = ONE_MINUTE * 60; var ONE_DAY = ONE_HOUR * 24; // FIXME 公用? var bisect = function (a, x, lo, hi) { while (lo < hi) { var mid = lo + hi >>> 1; if (a[mid][1] < x) { lo = mid + 1; } else { hi = mid; } } return lo; }; /** * @alias module:echarts/coord/scale/Time * @constructor */ var TimeScale = IntervalScale.extend({ type: 'time', /** * @override */ getLabel: function (val) { var stepLvl = this._stepLvl; var date = new Date(val); return formatTime(stepLvl[0], date, this.getSetting('useUTC')); }, /** * @override */ niceExtent: function (opt) { var extent = this._extent; // If extent start and end are same, expand them if (extent[0] === extent[1]) { // Expand extent extent[0] -= ONE_DAY; extent[1] += ONE_DAY; } // If there are no data and extent are [Infinity, -Infinity] if (extent[1] === -Infinity && extent[0] === Infinity) { var d = new Date(); extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate()); extent[0] = extent[1] - ONE_DAY; } this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); // var extent = this._extent; var interval = this._interval; if (!opt.fixMin) { extent[0] = round$1(mathFloor(extent[0] / interval) * interval); } if (!opt.fixMax) { extent[1] = round$1(mathCeil(extent[1] / interval) * interval); } }, /** * @override */ niceTicks: function (approxTickNum, minInterval, maxInterval) { approxTickNum = approxTickNum || 10; var extent = this._extent; var span = extent[1] - extent[0]; var approxInterval = span / approxTickNum; if (minInterval != null && approxInterval < minInterval) { approxInterval = minInterval; } if (maxInterval != null && approxInterval > maxInterval) { approxInterval = maxInterval; } var scaleLevelsLen = scaleLevels.length; var idx = bisect(scaleLevels, approxInterval, 0, scaleLevelsLen); var level = scaleLevels[Math.min(idx, scaleLevelsLen - 1)]; var interval = level[1]; // Same with interval scale if span is much larger than 1 year if (level[0] === 'year') { var yearSpan = span / interval; // From "Nice Numbers for Graph Labels" of Graphic Gems // var niceYearSpan = numberUtil.nice(yearSpan, false); var yearStep = nice(yearSpan / approxTickNum, true); interval *= yearStep; } var timezoneOffset = this.getSetting('useUTC') ? 0 : (new Date(+extent[0] || +extent[1])).getTimezoneOffset() * 60 * 1000; var niceExtent = [ Math.round(mathCeil((extent[0] - timezoneOffset) / interval) * interval + timezoneOffset), Math.round(mathFloor((extent[1] - timezoneOffset) / interval) * interval + timezoneOffset) ]; fixExtent(niceExtent, extent); this._stepLvl = level; // Interval will be used in getTicks this._interval = interval; this._niceExtent = niceExtent; }, parse: function (val) { // val might be float. return +parseDate(val); } }); each$1(['contain', 'normalize'], function (methodName) { TimeScale.prototype[methodName] = function (val) { return intervalScaleProto[methodName].call(this, this.parse(val)); }; }); // Steps from d3, see the license statement at the top of this file. var scaleLevels = [ // Format interval ['hh:mm:ss', ONE_SECOND], // 1s ['hh:mm:ss', ONE_SECOND * 5], // 5s ['hh:mm:ss', ONE_SECOND * 10], // 10s ['hh:mm:ss', ONE_SECOND * 15], // 15s ['hh:mm:ss', ONE_SECOND * 30], // 30s ['hh:mm\nMM-dd', ONE_MINUTE], // 1m ['hh:mm\nMM-dd', ONE_MINUTE * 5], // 5m ['hh:mm\nMM-dd', ONE_MINUTE * 10], // 10m ['hh:mm\nMM-dd', ONE_MINUTE * 15], // 15m ['hh:mm\nMM-dd', ONE_MINUTE * 30], // 30m ['hh:mm\nMM-dd', ONE_HOUR], // 1h ['hh:mm\nMM-dd', ONE_HOUR * 2], // 2h ['hh:mm\nMM-dd', ONE_HOUR * 6], // 6h ['hh:mm\nMM-dd', ONE_HOUR * 12], // 12h ['MM-dd\nyyyy', ONE_DAY], // 1d ['MM-dd\nyyyy', ONE_DAY * 2], // 2d ['MM-dd\nyyyy', ONE_DAY * 3], // 3d ['MM-dd\nyyyy', ONE_DAY * 4], // 4d ['MM-dd\nyyyy', ONE_DAY * 5], // 5d ['MM-dd\nyyyy', ONE_DAY * 6], // 6d ['week', ONE_DAY * 7], // 7d ['MM-dd\nyyyy', ONE_DAY * 10], // 10d ['week', ONE_DAY * 14], // 2w ['week', ONE_DAY * 21], // 3w ['month', ONE_DAY * 31], // 1M ['week', ONE_DAY * 42], // 6w ['month', ONE_DAY * 62], // 2M ['week', ONE_DAY * 42], // 10w ['quarter', ONE_DAY * 380 / 4], // 3M ['month', ONE_DAY * 31 * 4], // 4M ['month', ONE_DAY * 31 * 5], // 5M ['half-year', ONE_DAY * 380 / 2], // 6M ['month', ONE_DAY * 31 * 8], // 8M ['month', ONE_DAY * 31 * 10], // 10M ['year', ONE_DAY * 380] // 1Y ]; /** * @param {module:echarts/model/Model} * @return {module:echarts/scale/Time} */ TimeScale.create = function (model) { return new TimeScale({useUTC: model.ecModel.get('useUTC')}); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Log scale * @module echarts/scale/Log */ // Use some method of IntervalScale var scaleProto$1 = Scale.prototype; var intervalScaleProto$1 = IntervalScale.prototype; var getPrecisionSafe$1 = getPrecisionSafe; var roundingErrorFix = round$1; var mathFloor$1 = Math.floor; var mathCeil$1 = Math.ceil; var mathPow$1 = Math.pow; var mathLog = Math.log; var LogScale = Scale.extend({ type: 'log', base: 10, $constructor: function () { Scale.apply(this, arguments); this._originalScale = new IntervalScale(); }, /** * @return {Array.} */ getTicks: function () { var originalScale = this._originalScale; var extent = this._extent; var originalExtent = originalScale.getExtent(); return map(intervalScaleProto$1.getTicks.call(this), function (val) { var powVal = round$1(mathPow$1(this.base, val)); // Fix #4158 powVal = (val === extent[0] && originalScale.__fixMin) ? fixRoundingError(powVal, originalExtent[0]) : powVal; powVal = (val === extent[1] && originalScale.__fixMax) ? fixRoundingError(powVal, originalExtent[1]) : powVal; return powVal; }, this); }, /** * @param {number} val * @return {string} */ getLabel: intervalScaleProto$1.getLabel, /** * @param {number} val * @return {number} */ scale: function (val) { val = scaleProto$1.scale.call(this, val); return mathPow$1(this.base, val); }, /** * @param {number} start * @param {number} end */ setExtent: function (start, end) { var base = this.base; start = mathLog(start) / mathLog(base); end = mathLog(end) / mathLog(base); intervalScaleProto$1.setExtent.call(this, start, end); }, /** * @return {number} end */ getExtent: function () { var base = this.base; var extent = scaleProto$1.getExtent.call(this); extent[0] = mathPow$1(base, extent[0]); extent[1] = mathPow$1(base, extent[1]); // Fix #4158 var originalScale = this._originalScale; var originalExtent = originalScale.getExtent(); originalScale.__fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0])); originalScale.__fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1])); return extent; }, /** * @param {Array.} extent */ unionExtent: function (extent) { this._originalScale.unionExtent(extent); var base = this.base; extent[0] = mathLog(extent[0]) / mathLog(base); extent[1] = mathLog(extent[1]) / mathLog(base); scaleProto$1.unionExtent.call(this, extent); }, /** * @override */ unionExtentFromData: function (data, dim) { // TODO // filter value that <= 0 this.unionExtent(data.getApproximateExtent(dim)); }, /** * Update interval and extent of intervals for nice ticks * @param {number} [approxTickNum = 10] Given approx tick number */ niceTicks: function (approxTickNum) { approxTickNum = approxTickNum || 10; var extent = this._extent; var span = extent[1] - extent[0]; if (span === Infinity || span <= 0) { return; } var interval = quantity(span); var err = approxTickNum / span * interval; // Filter ticks to get closer to the desired count. if (err <= 0.5) { interval *= 10; } // Interval should be integer while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) { interval *= 10; } var niceExtent = [ round$1(mathCeil$1(extent[0] / interval) * interval), round$1(mathFloor$1(extent[1] / interval) * interval) ]; this._interval = interval; this._niceExtent = niceExtent; }, /** * Nice extent. * @override */ niceExtent: function (opt) { intervalScaleProto$1.niceExtent.call(this, opt); var originalScale = this._originalScale; originalScale.__fixMin = opt.fixMin; originalScale.__fixMax = opt.fixMax; } }); each$1(['contain', 'normalize'], function (methodName) { LogScale.prototype[methodName] = function (val) { val = mathLog(val) / mathLog(this.base); return scaleProto$1[methodName].call(this, val); }; }); LogScale.create = function () { return new LogScale(); }; function fixRoundingError(val, originalVal) { return roundingErrorFix(val, getPrecisionSafe$1(originalVal)); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Get axis scale extent before niced. * Item of returned array can only be number (including Infinity and NaN). */ function getScaleExtent(scale, model) { var scaleType = scale.type; var min = model.getMin(); var max = model.getMax(); var fixMin = min != null; var fixMax = max != null; var originalExtent = scale.getExtent(); var axisDataLen; var boundaryGap; var span; if (scaleType === 'ordinal') { axisDataLen = model.getCategories().length; } else { boundaryGap = model.get('boundaryGap'); if (!isArray(boundaryGap)) { boundaryGap = [boundaryGap || 0, boundaryGap || 0]; } if (typeof boundaryGap[0] === 'boolean') { if (__DEV__) { console.warn('Boolean type for boundaryGap is only ' + 'allowed for ordinal axis. Please use string in ' + 'percentage instead, e.g., "20%". Currently, ' + 'boundaryGap is set to be 0.'); } boundaryGap = [0, 0]; } boundaryGap[0] = parsePercent$1(boundaryGap[0], 1); boundaryGap[1] = parsePercent$1(boundaryGap[1], 1); span = (originalExtent[1] - originalExtent[0]) || Math.abs(originalExtent[0]); } // Notice: When min/max is not set (that is, when there are null/undefined, // which is the most common case), these cases should be ensured: // (1) For 'ordinal', show all axis.data. // (2) For others: // + `boundaryGap` is applied (if min/max set, boundaryGap is // disabled). // + If `needCrossZero`, min/max should be zero, otherwise, min/max should // be the result that originalExtent enlarged by boundaryGap. // (3) If no data, it should be ensured that `scale.setBlank` is set. // FIXME // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used? // (2) When `needCrossZero` and all data is positive/negative, should it be ensured // that the results processed by boundaryGap are positive/negative? if (min == null) { min = scaleType === 'ordinal' ? (axisDataLen ? 0 : NaN) : originalExtent[0] - boundaryGap[0] * span; } if (max == null) { max = scaleType === 'ordinal' ? (axisDataLen ? axisDataLen - 1 : NaN) : originalExtent[1] + boundaryGap[1] * span; } if (min === 'dataMin') { min = originalExtent[0]; } else if (typeof min === 'function') { min = min({ min: originalExtent[0], max: originalExtent[1] }); } if (max === 'dataMax') { max = originalExtent[1]; } else if (typeof max === 'function') { max = max({ min: originalExtent[0], max: originalExtent[1] }); } (min == null || !isFinite(min)) && (min = NaN); (max == null || !isFinite(max)) && (max = NaN); scale.setBlank( eqNaN(min) || eqNaN(max) || (scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length) ); // Evaluate if axis needs cross zero if (model.getNeedCrossZero()) { // Axis is over zero and min is not set if (min > 0 && max > 0 && !fixMin) { min = 0; } // Axis is under zero and max is not set if (min < 0 && max < 0 && !fixMax) { max = 0; } } // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis // is base axis // FIXME // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly. // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent? // Should not depend on series type `bar`? // (3) Fix that might overlap when using dataZoom. // (4) Consider other chart types using `barGrid`? // See #6728, #4862, `test/bar-overflow-time-plot.html` var ecModel = model.ecModel; if (ecModel && (scaleType === 'time' /*|| scaleType === 'interval' */)) { var barSeriesModels = prepareLayoutBarSeries('bar', ecModel); var isBaseAxisAndHasBarSeries; each$1(barSeriesModels, function (seriesModel) { isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis; }); if (isBaseAxisAndHasBarSeries) { // Calculate placement of bars on axis var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset); min = adjustedScale.min; max = adjustedScale.max; } } return [min, max]; } function adjustScaleForOverflow(min, max, model, barWidthAndOffset) { // Get Axis Length var axisExtent = model.axis.getExtent(); var axisLength = axisExtent[1] - axisExtent[0]; // Get bars on current base axis and calculate min and max overflow var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis); if (barsOnCurrentAxis === undefined) { return {min: min, max: max}; } var minOverflow = Infinity; each$1(barsOnCurrentAxis, function (item) { minOverflow = Math.min(item.offset, minOverflow); }); var maxOverflow = -Infinity; each$1(barsOnCurrentAxis, function (item) { maxOverflow = Math.max(item.offset + item.width, maxOverflow); }); minOverflow = Math.abs(minOverflow); maxOverflow = Math.abs(maxOverflow); var totalOverFlow = minOverflow + maxOverflow; // Calulate required buffer based on old range and overflow var oldRange = max - min; var oldRangePercentOfNew = (1 - (minOverflow + maxOverflow) / axisLength); var overflowBuffer = ((oldRange / oldRangePercentOfNew) - oldRange); max += overflowBuffer * (maxOverflow / totalOverFlow); min -= overflowBuffer * (minOverflow / totalOverFlow); return {min: min, max: max}; } function niceScaleExtent(scale, model) { var extent = getScaleExtent(scale, model); var fixMin = model.getMin() != null; var fixMax = model.getMax() != null; var splitNumber = model.get('splitNumber'); if (scale.type === 'log') { scale.base = model.get('logBase'); } var scaleType = scale.type; scale.setExtent(extent[0], extent[1]); scale.niceExtent({ splitNumber: splitNumber, fixMin: fixMin, fixMax: fixMax, minInterval: (scaleType === 'interval' || scaleType === 'time') ? model.get('minInterval') : null, maxInterval: (scaleType === 'interval' || scaleType === 'time') ? model.get('maxInterval') : null }); // If some one specified the min, max. And the default calculated interval // is not good enough. He can specify the interval. It is often appeared // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard // to be 60. // FIXME var interval = model.get('interval'); if (interval != null) { scale.setInterval && scale.setInterval(interval); } } /** * @param {module:echarts/model/Model} model * @param {string} [axisType] Default retrieve from model.type * @return {module:echarts/scale/*} */ function createScaleByModel(model, axisType) { axisType = axisType || model.get('type'); if (axisType) { switch (axisType) { // Buildin scale case 'category': return new OrdinalScale( model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(), [Infinity, -Infinity] ); case 'value': return new IntervalScale(); // Extended scale, like time and log default: return (Scale.getClass(axisType) || IntervalScale).create(model); } } } /** * Check if the axis corss 0 */ function ifAxisCrossZero(axis) { var dataExtent = axis.scale.getExtent(); var min = dataExtent[0]; var max = dataExtent[1]; return !((min > 0 && max > 0) || (min < 0 && max < 0)); } /** * @param {module:echarts/coord/Axis} axis * @return {Function} Label formatter function. * param: {number} tickValue, * param: {number} idx, the index in all ticks. * If category axis, this param is not requied. * return: {string} label string. */ function makeLabelFormatter(axis) { var labelFormatter = axis.getLabelModel().get('formatter'); var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null; if (typeof labelFormatter === 'string') { labelFormatter = (function (tpl) { return function (val) { return tpl.replace('{value}', val != null ? val : ''); }; })(labelFormatter); // Consider empty array return labelFormatter; } else if (typeof labelFormatter === 'function') { return function (tickValue, idx) { // The original intention of `idx` is "the index of the tick in all ticks". // But the previous implementation of category axis do not consider the // `axisLabel.interval`, which cause that, for example, the `interval` is // `1`, then the ticks "name5", "name7", "name9" are displayed, where the // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep // the definition here for back compatibility. if (categoryTickStart != null) { idx = tickValue - categoryTickStart; } return labelFormatter(getAxisRawValue(axis, tickValue), idx); }; } else { return function (tick) { return axis.scale.getLabel(tick); }; } } function getAxisRawValue(axis, value) { // In category axis with data zoom, tick is not the original // index of axis.data. So tick should not be exposed to user // in category axis. return axis.type === 'category' ? axis.scale.getLabel(value) : value; } /** * @param {module:echarts/coord/Axis} axis * @return {module:zrender/core/BoundingRect} Be null/undefined if no labels. */ function estimateLabelUnionRect(axis) { var axisModel = axis.model; var scale = axis.scale; if (!axisModel.get('axisLabel.show') || scale.isBlank()) { return; } var isCategory = axis.type === 'category'; var realNumberScaleTicks; var tickCount; var categoryScaleExtent = scale.getExtent(); // Optimize for large category data, avoid call `getTicks()`. if (isCategory) { tickCount = scale.count(); } else { realNumberScaleTicks = scale.getTicks(); tickCount = realNumberScaleTicks.length; } var axisLabelModel = axis.getLabelModel(); var labelFormatter = makeLabelFormatter(axis); var rect; var step = 1; // Simple optimization for large amount of labels if (tickCount > 40) { step = Math.ceil(tickCount / 40); } for (var i = 0; i < tickCount; i += step) { var tickValue = realNumberScaleTicks ? realNumberScaleTicks[i] : categoryScaleExtent[0] + i; var label = labelFormatter(tickValue); var unrotatedSingleRect = axisLabelModel.getTextRect(label); var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0); rect ? rect.union(singleRect) : (rect = singleRect); } return rect; } function rotateTextRect(textRect, rotate) { var rotateRadians = rotate * Math.PI / 180; var boundingBox = textRect.plain(); var beforeWidth = boundingBox.width; var beforeHeight = boundingBox.height; var afterWidth = beforeWidth * Math.cos(rotateRadians) + beforeHeight * Math.sin(rotateRadians); var afterHeight = beforeWidth * Math.sin(rotateRadians) + beforeHeight * Math.cos(rotateRadians); var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight); return rotatedRect; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var axisModelCommonMixin = { /** * @param {boolean} origin * @return {number|string} min value or 'dataMin' or null/undefined (means auto) or NaN */ getMin: function (origin) { var option = this.option; var min = (!origin && option.rangeStart != null) ? option.rangeStart : option.min; if (this.axis && min != null && min !== 'dataMin' && typeof min !== 'function' && !eqNaN(min) ) { min = this.axis.scale.parse(min); } return min; }, /** * @param {boolean} origin * @return {number|string} max value or 'dataMax' or null/undefined (means auto) or NaN */ getMax: function (origin) { var option = this.option; var max = (!origin && option.rangeEnd != null) ? option.rangeEnd : option.max; if (this.axis && max != null && max !== 'dataMax' && typeof max !== 'function' && !eqNaN(max) ) { max = this.axis.scale.parse(max); } return max; }, /** * @return {boolean} */ getNeedCrossZero: function () { var option = this.option; return (option.rangeStart != null || option.rangeEnd != null) ? false : !option.scale; }, /** * Should be implemented by each axis model if necessary. * @return {module:echarts/model/Component} coordinate system model */ getCoordSysModel: noop, /** * @param {number} rangeStart Can only be finite number or null/undefined or NaN. * @param {number} rangeEnd Can only be finite number or null/undefined or NaN. */ setRange: function (rangeStart, rangeEnd) { this.option.rangeStart = rangeStart; this.option.rangeEnd = rangeEnd; }, /** * Reset range */ resetRange: function () { // rangeStart and rangeEnd is readonly. this.option.rangeStart = this.option.rangeEnd = null; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Symbol factory /** * Triangle shape * @inner */ var Triangle = extendShape({ type: 'triangle', shape: { cx: 0, cy: 0, width: 0, height: 0 }, buildPath: function (path, shape) { var cx = shape.cx; var cy = shape.cy; var width = shape.width / 2; var height = shape.height / 2; path.moveTo(cx, cy - height); path.lineTo(cx + width, cy + height); path.lineTo(cx - width, cy + height); path.closePath(); } }); /** * Diamond shape * @inner */ var Diamond = extendShape({ type: 'diamond', shape: { cx: 0, cy: 0, width: 0, height: 0 }, buildPath: function (path, shape) { var cx = shape.cx; var cy = shape.cy; var width = shape.width / 2; var height = shape.height / 2; path.moveTo(cx, cy - height); path.lineTo(cx + width, cy); path.lineTo(cx, cy + height); path.lineTo(cx - width, cy); path.closePath(); } }); /** * Pin shape * @inner */ var Pin = extendShape({ type: 'pin', shape: { // x, y on the cusp x: 0, y: 0, width: 0, height: 0 }, buildPath: function (path, shape) { var x = shape.x; var y = shape.y; var w = shape.width / 5 * 3; // Height must be larger than width var h = Math.max(w, shape.height); var r = w / 2; // Dist on y with tangent point and circle center var dy = r * r / (h - r); var cy = y - h + r + dy; var angle = Math.asin(dy / r); // Dist on x with tangent point and circle center var dx = Math.cos(angle) * r; var tanX = Math.sin(angle); var tanY = Math.cos(angle); var cpLen = r * 0.6; var cpLen2 = r * 0.7; path.moveTo(x - dx, cy + dy); path.arc( x, cy, r, Math.PI - angle, Math.PI * 2 + angle ); path.bezierCurveTo( x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y ); path.bezierCurveTo( x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy ); path.closePath(); } }); /** * Arrow shape * @inner */ var Arrow = extendShape({ type: 'arrow', shape: { x: 0, y: 0, width: 0, height: 0 }, buildPath: function (ctx, shape) { var height = shape.height; var width = shape.width; var x = shape.x; var y = shape.y; var dx = width / 3 * 2; ctx.moveTo(x, y); ctx.lineTo(x + dx, y + height); ctx.lineTo(x, y + height / 4 * 3); ctx.lineTo(x - dx, y + height); ctx.lineTo(x, y); ctx.closePath(); } }); /** * Map of path contructors * @type {Object.} */ var symbolCtors = { line: Line, rect: Rect, roundRect: Rect, square: Rect, circle: Circle, diamond: Diamond, pin: Pin, arrow: Arrow, triangle: Triangle }; var symbolShapeMakers = { line: function (x, y, w, h, shape) { // FIXME shape.x1 = x; shape.y1 = y + h / 2; shape.x2 = x + w; shape.y2 = y + h / 2; }, rect: function (x, y, w, h, shape) { shape.x = x; shape.y = y; shape.width = w; shape.height = h; }, roundRect: function (x, y, w, h, shape) { shape.x = x; shape.y = y; shape.width = w; shape.height = h; shape.r = Math.min(w, h) / 4; }, square: function (x, y, w, h, shape) { var size = Math.min(w, h); shape.x = x; shape.y = y; shape.width = size; shape.height = size; }, circle: function (x, y, w, h, shape) { // Put circle in the center of square shape.cx = x + w / 2; shape.cy = y + h / 2; shape.r = Math.min(w, h) / 2; }, diamond: function (x, y, w, h, shape) { shape.cx = x + w / 2; shape.cy = y + h / 2; shape.width = w; shape.height = h; }, pin: function (x, y, w, h, shape) { shape.x = x + w / 2; shape.y = y + h / 2; shape.width = w; shape.height = h; }, arrow: function (x, y, w, h, shape) { shape.x = x + w / 2; shape.y = y + h / 2; shape.width = w; shape.height = h; }, triangle: function (x, y, w, h, shape) { shape.cx = x + w / 2; shape.cy = y + h / 2; shape.width = w; shape.height = h; } }; var symbolBuildProxies = {}; each$1(symbolCtors, function (Ctor, name) { symbolBuildProxies[name] = new Ctor(); }); var SymbolClz = extendShape({ type: 'symbol', shape: { symbolType: '', x: 0, y: 0, width: 0, height: 0 }, beforeBrush: function () { var style = this.style; var shape = this.shape; // FIXME if (shape.symbolType === 'pin' && style.textPosition === 'inside') { style.textPosition = ['50%', '40%']; style.textAlign = 'center'; style.textVerticalAlign = 'middle'; } }, buildPath: function (ctx, shape, inBundle) { var symbolType = shape.symbolType; var proxySymbol = symbolBuildProxies[symbolType]; if (shape.symbolType !== 'none') { if (!proxySymbol) { // Default rect symbolType = 'rect'; proxySymbol = symbolBuildProxies[symbolType]; } symbolShapeMakers[symbolType]( shape.x, shape.y, shape.width, shape.height, proxySymbol.shape ); proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle); } } }); // Provide setColor helper method to avoid determine if set the fill or stroke outside function symbolPathSetColor(color, innerColor) { if (this.type !== 'image') { var symbolStyle = this.style; var symbolShape = this.shape; if (symbolShape && symbolShape.symbolType === 'line') { symbolStyle.stroke = color; } else if (this.__isEmptyBrush) { symbolStyle.stroke = color; symbolStyle.fill = innerColor || '#fff'; } else { // FIXME 判断图形默认是填充还是描边,使用 onlyStroke ? symbolStyle.fill && (symbolStyle.fill = color); symbolStyle.stroke && (symbolStyle.stroke = color); } this.dirty(false); } } /** * Create a symbol element with given symbol configuration: shape, x, y, width, height, color * @param {string} symbolType * @param {number} x * @param {number} y * @param {number} w * @param {number} h * @param {string} color * @param {boolean} [keepAspect=false] whether to keep the ratio of w/h, * for path and image only. */ function createSymbol(symbolType, x, y, w, h, color, keepAspect) { // TODO Support image object, DynamicImage. var isEmpty = symbolType.indexOf('empty') === 0; if (isEmpty) { symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6); } var symbolPath; if (symbolType.indexOf('image://') === 0) { symbolPath = makeImage( symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover' ); } else if (symbolType.indexOf('path://') === 0) { symbolPath = makePath( symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover' ); } else { symbolPath = new SymbolClz({ shape: { symbolType: symbolType, x: x, y: y, width: w, height: h } }); } symbolPath.__isEmptyBrush = isEmpty; symbolPath.setColor = symbolPathSetColor; symbolPath.setColor(color); return symbolPath; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // import createGraphFromNodeEdge from './chart/helper/createGraphFromNodeEdge'; /** * Create a muti dimension List structure from seriesModel. * @param {module:echarts/model/Model} seriesModel * @return {module:echarts/data/List} list */ function createList(seriesModel) { return createListFromArray(seriesModel.getSource(), seriesModel); } var dataStack$1 = { isDimensionStacked: isDimensionStacked, enableDataStack: enableDataStack, getStackedDimension: getStackedDimension }; /** * Create scale * @param {Array.} dataExtent * @param {Object|module:echarts/Model} option */ function createScale(dataExtent, option) { var axisModel = option; if (!Model.isInstance(option)) { axisModel = new Model(option); mixin(axisModel, axisModelCommonMixin); } var scale = createScaleByModel(axisModel); scale.setExtent(dataExtent[0], dataExtent[1]); niceScaleExtent(scale, axisModel); return scale; } /** * Mixin common methods to axis model, * * Inlcude methods * `getFormattedLabels() => Array.` * `getCategories() => Array.` * `getMin(origin: boolean) => number` * `getMax(origin: boolean) => number` * `getNeedCrossZero() => boolean` * `setRange(start: number, end: number)` * `resetRange()` */ function mixinAxisModelCommonMethods(Model$$1) { mixin(Model$$1, axisModelCommonMixin); } var helper = (Object.freeze || Object)({ createList: createList, getLayoutRect: getLayoutRect, dataStack: dataStack$1, createScale: createScale, mixinAxisModelCommonMethods: mixinAxisModelCommonMethods, completeDimensions: completeDimensions, createDimensions: createDimensions, createSymbol: createSymbol }); var EPSILON$3 = 1e-8; function isAroundEqual$1(a, b) { return Math.abs(a - b) < EPSILON$3; } function contain$1(points, x, y) { var w = 0; var p = points[0]; if (!p) { return false; } for (var i = 1; i < points.length; i++) { var p2 = points[i]; w += windingLine(p[0], p[1], p2[0], p2[1], x, y); p = p2; } // Close polygon var p0 = points[0]; if (!isAroundEqual$1(p[0], p0[0]) || !isAroundEqual$1(p[1], p0[1])) { w += windingLine(p[0], p[1], p0[0], p0[1], x, y); } return w !== 0; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @module echarts/coord/geo/Region */ /** * @param {string} name * @param {Array} geometries * @param {Array.} cp */ function Region(name, geometries, cp) { /** * @type {string} * @readOnly */ this.name = name; /** * @type {Array.} * @readOnly */ this.geometries = geometries; if (!cp) { var rect = this.getBoundingRect(); cp = [ rect.x + rect.width / 2, rect.y + rect.height / 2 ]; } else { cp = [cp[0], cp[1]]; } /** * @type {Array.} */ this.center = cp; } Region.prototype = { constructor: Region, properties: null, /** * @return {module:zrender/core/BoundingRect} */ getBoundingRect: function () { var rect = this._rect; if (rect) { return rect; } var MAX_NUMBER = Number.MAX_VALUE; var min$$1 = [MAX_NUMBER, MAX_NUMBER]; var max$$1 = [-MAX_NUMBER, -MAX_NUMBER]; var min2 = []; var max2 = []; var geometries = this.geometries; for (var i = 0; i < geometries.length; i++) { // Only support polygon if (geometries[i].type !== 'polygon') { continue; } // Doesn't consider hole var exterior = geometries[i].exterior; fromPoints(exterior, min2, max2); min(min$$1, min$$1, min2); max(max$$1, max$$1, max2); } // No data if (i === 0) { min$$1[0] = min$$1[1] = max$$1[0] = max$$1[1] = 0; } return (this._rect = new BoundingRect( min$$1[0], min$$1[1], max$$1[0] - min$$1[0], max$$1[1] - min$$1[1] )); }, /** * @param {} coord * @return {boolean} */ contain: function (coord) { var rect = this.getBoundingRect(); var geometries = this.geometries; if (!rect.contain(coord[0], coord[1])) { return false; } loopGeo: for (var i = 0, len$$1 = geometries.length; i < len$$1; i++) { // Only support polygon. if (geometries[i].type !== 'polygon') { continue; } var exterior = geometries[i].exterior; var interiors = geometries[i].interiors; if (contain$1(exterior, coord[0], coord[1])) { // Not in the region if point is in the hole. for (var k = 0; k < (interiors ? interiors.length : 0); k++) { if (contain$1(interiors[k])) { continue loopGeo; } } return true; } } return false; }, transformTo: function (x, y, width, height) { var rect = this.getBoundingRect(); var aspect = rect.width / rect.height; if (!width) { width = aspect * height; } else if (!height) { height = width / aspect ; } var target = new BoundingRect(x, y, width, height); var transform = rect.calculateTransform(target); var geometries = this.geometries; for (var i = 0; i < geometries.length; i++) { // Only support polygon. if (geometries[i].type !== 'polygon') { continue; } var exterior = geometries[i].exterior; var interiors = geometries[i].interiors; for (var p = 0; p < exterior.length; p++) { applyTransform(exterior[p], exterior[p], transform); } for (var h = 0; h < (interiors ? interiors.length : 0); h++) { for (var p = 0; p < interiors[h].length; p++) { applyTransform(interiors[h][p], interiors[h][p], transform); } } } rect = this._rect; rect.copy(target); // Update center this.center = [ rect.x + rect.width / 2, rect.y + rect.height / 2 ]; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Parse and decode geo json * @module echarts/coord/geo/parseGeoJson */ function decode(json) { if (!json.UTF8Encoding) { return json; } var encodeScale = json.UTF8Scale; if (encodeScale == null) { encodeScale = 1024; } var features = json.features; for (var f = 0; f < features.length; f++) { var feature = features[f]; var geometry = feature.geometry; var coordinates = geometry.coordinates; var encodeOffsets = geometry.encodeOffsets; for (var c = 0; c < coordinates.length; c++) { var coordinate = coordinates[c]; if (geometry.type === 'Polygon') { coordinates[c] = decodePolygon( coordinate, encodeOffsets[c], encodeScale ); } else if (geometry.type === 'MultiPolygon') { for (var c2 = 0; c2 < coordinate.length; c2++) { var polygon = coordinate[c2]; coordinate[c2] = decodePolygon( polygon, encodeOffsets[c][c2], encodeScale ); } } } } // Has been decoded json.UTF8Encoding = false; return json; } function decodePolygon(coordinate, encodeOffsets, encodeScale) { var result = []; var prevX = encodeOffsets[0]; var prevY = encodeOffsets[1]; for (var i = 0; i < coordinate.length; i += 2) { var x = coordinate.charCodeAt(i) - 64; var y = coordinate.charCodeAt(i + 1) - 64; // ZigZag decoding x = (x >> 1) ^ (-(x & 1)); y = (y >> 1) ^ (-(y & 1)); // Delta deocding x += prevX; y += prevY; prevX = x; prevY = y; // Dequantize result.push([x / encodeScale, y / encodeScale]); } return result; } /** * @alias module:echarts/coord/geo/parseGeoJson * @param {Object} geoJson * @return {module:zrender/container/Group} */ var parseGeoJson$1 = function (geoJson) { decode(geoJson); return map(filter(geoJson.features, function (featureObj) { // Output of mapshaper may have geometry null return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0; }), function (featureObj) { var properties = featureObj.properties; var geo = featureObj.geometry; var coordinates = geo.coordinates; var geometries = []; if (geo.type === 'Polygon') { geometries.push({ type: 'polygon', // According to the GeoJSON specification. // First must be exterior, and the rest are all interior(holes). exterior: coordinates[0], interiors: coordinates.slice(1) }); } if (geo.type === 'MultiPolygon') { each$1(coordinates, function (item) { if (item[0]) { geometries.push({ type: 'polygon', exterior: item[0], interiors: item.slice(1) }); } }); } var region = new Region( properties.name, geometries, properties.cp ); region.properties = properties; return region; }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var inner$6 = makeInner(); /** * @param {module:echats/coord/Axis} axis * @return {Object} { * labels: [{ * formattedLabel: string, * rawLabel: string, * tickValue: number * }, ...], * labelCategoryInterval: number * } */ function createAxisLabels(axis) { // Only ordinal scale support tick interval return axis.type === 'category' ? makeCategoryLabels(axis) : makeRealNumberLabels(axis); } /** * @param {module:echats/coord/Axis} axis * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea. * @return {Object} { * ticks: Array. * tickCategoryInterval: number * } */ function createAxisTicks(axis, tickModel) { // Only ordinal scale support tick interval return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : {ticks: axis.scale.getTicks()}; } function makeCategoryLabels(axis) { var labelModel = axis.getLabelModel(); var result = makeCategoryLabelsActually(axis, labelModel); return (!labelModel.get('show') || axis.scale.isBlank()) ? {labels: [], labelCategoryInterval: result.labelCategoryInterval} : result; } function makeCategoryLabelsActually(axis, labelModel) { var labelsCache = getListCache(axis, 'labels'); var optionLabelInterval = getOptionCategoryInterval(labelModel); var result = listCacheGet(labelsCache, optionLabelInterval); if (result) { return result; } var labels; var numericLabelInterval; if (isFunction$1(optionLabelInterval)) { labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval); } else { numericLabelInterval = optionLabelInterval === 'auto' ? makeAutoCategoryInterval(axis) : optionLabelInterval; labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval); } // Cache to avoid calling interval function repeatly. return listCacheSet(labelsCache, optionLabelInterval, { labels: labels, labelCategoryInterval: numericLabelInterval }); } function makeCategoryTicks(axis, tickModel) { var ticksCache = getListCache(axis, 'ticks'); var optionTickInterval = getOptionCategoryInterval(tickModel); var result = listCacheGet(ticksCache, optionTickInterval); if (result) { return result; } var ticks; var tickCategoryInterval; // Optimize for the case that large category data and no label displayed, // we should not return all ticks. if (!tickModel.get('show') || axis.scale.isBlank()) { ticks = []; } if (isFunction$1(optionTickInterval)) { ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true); } // Always use label interval by default despite label show. Consider this // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows // labels. `splitLine` and `axisTick` should be consistent in this case. else if (optionTickInterval === 'auto') { var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel()); tickCategoryInterval = labelsResult.labelCategoryInterval; ticks = map(labelsResult.labels, function (labelItem) { return labelItem.tickValue; }); } else { tickCategoryInterval = optionTickInterval; ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true); } // Cache to avoid calling interval function repeatly. return listCacheSet(ticksCache, optionTickInterval, { ticks: ticks, tickCategoryInterval: tickCategoryInterval }); } function makeRealNumberLabels(axis) { var ticks = axis.scale.getTicks(); var labelFormatter = makeLabelFormatter(axis); return { labels: map(ticks, function (tickValue, idx) { return { formattedLabel: labelFormatter(tickValue, idx), rawLabel: axis.scale.getLabel(tickValue), tickValue: tickValue }; }) }; } // Large category data calculation is performence sensitive, and ticks and label // probably be fetched by multiple times. So we cache the result. // axis is created each time during a ec process, so we do not need to clear cache. function getListCache(axis, prop) { // Because key can be funciton, and cache size always be small, we use array cache. return inner$6(axis)[prop] || (inner$6(axis)[prop] = []); } function listCacheGet(cache, key) { for (var i = 0; i < cache.length; i++) { if (cache[i].key === key) { return cache[i].value; } } } function listCacheSet(cache, key, value) { cache.push({key: key, value: value}); return value; } function makeAutoCategoryInterval(axis) { var result = inner$6(axis).autoInterval; return result != null ? result : (inner$6(axis).autoInterval = axis.calculateCategoryInterval()); } /** * Calculate interval for category axis ticks and labels. * To get precise result, at least one of `getRotate` and `isHorizontal` * should be implemented in axis. */ function calculateCategoryInterval(axis) { var params = fetchAutoCategoryIntervalCalculationParams(axis); var labelFormatter = makeLabelFormatter(axis); var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI; var ordinalScale = axis.scale; var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization: // avoid generating a long array by `getTicks` // in large category data case. var tickCount = ordinalScale.count(); if (ordinalExtent[1] - ordinalExtent[0] < 1) { return 0; } var step = 1; // Simple optimization. Empirical value: tick count should less than 40. if (tickCount > 40) { step = Math.max(1, Math.floor(tickCount / 40)); } var tickValue = ordinalExtent[0]; var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); var unitW = Math.abs(unitSpan * Math.cos(rotation)); var unitH = Math.abs(unitSpan * Math.sin(rotation)); var maxW = 0; var maxH = 0; // Caution: Performance sensitive for large category data. // Consider dataZoom, we should make appropriate step to avoid O(n) loop. for (; tickValue <= ordinalExtent[1]; tickValue += step) { var width = 0; var height = 0; // Polar is also calculated in assumptive linear layout here. // Not precise, do not consider align and vertical align // and each distance from axis line yet. var rect = getBoundingRect( labelFormatter(tickValue), params.font, 'center', 'top' ); // Magic number width = rect.width * 1.3; height = rect.height * 1.3; // Min size, void long loop. maxW = Math.max(maxW, width, 7); maxH = Math.max(maxH, height, 7); } var dw = maxW / unitW; var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity. isNaN(dw) && (dw = Infinity); isNaN(dh) && (dh = Infinity); var interval = Math.max(0, Math.floor(Math.min(dw, dh))); var cache = inner$6(axis.model); var lastAutoInterval = cache.lastAutoInterval; var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window, // otherwise the calculated interval might jitter when the zoom // window size is close to the interval-changing size. if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical // point is not the same when zooming in or zooming out. && lastAutoInterval > interval ) { interval = lastAutoInterval; } // Only update cache if cache not used, otherwise the // changing of interval is too insensitive. else { cache.lastTickCount = tickCount; cache.lastAutoInterval = interval; } return interval; } function fetchAutoCategoryIntervalCalculationParams(axis) { var labelModel = axis.getLabelModel(); return { axisRotate: axis.getRotate ? axis.getRotate() : (axis.isHorizontal && !axis.isHorizontal()) ? 90 : 0, labelRotate: labelModel.get('rotate') || 0, font: labelModel.getFont() }; } function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) { var labelFormatter = makeLabelFormatter(axis); var ordinalScale = axis.scale; var ordinalExtent = ordinalScale.getExtent(); var labelModel = axis.getLabelModel(); var result = []; // TODO: axisType: ordinalTime, pick the tick from each month/day/year/... var step = Math.max((categoryInterval || 0) + 1, 1); var startTick = ordinalExtent[0]; var tickCount = ordinalScale.count(); // Calculate start tick based on zero if possible to keep label consistent // while zooming and moving while interval > 0. Otherwise the selection // of displayable ticks and symbols probably keep changing. // 3 is empirical value. if (startTick !== 0 && step > 1 && tickCount / step > 2) { startTick = Math.round(Math.ceil(startTick / step) * step); } // (1) Only add min max label here but leave overlap checking // to render stage, which also ensure the returned list // suitable for splitLine and splitArea rendering. // (2) Scales except category always contain min max label so // do not need to perform this process. var showMinMax = { min: labelModel.get('showMinLabel'), max: labelModel.get('showMaxLabel') }; if (showMinMax.min && startTick !== ordinalExtent[0]) { addItem(ordinalExtent[0]); } // Optimize: avoid generating large array by `ordinalScale.getTicks()`. var tickValue = startTick; for (; tickValue <= ordinalExtent[1]; tickValue += step) { addItem(tickValue); } if (showMinMax.max && tickValue !== ordinalExtent[1]) { addItem(ordinalExtent[1]); } function addItem(tVal) { result.push(onlyTick ? tVal : { formattedLabel: labelFormatter(tVal), rawLabel: ordinalScale.getLabel(tVal), tickValue: tVal } ); } return result; } // When interval is function, the result `false` means ignore the tick. // It is time consuming for large category data. function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) { var ordinalScale = axis.scale; var labelFormatter = makeLabelFormatter(axis); var result = []; each$1(ordinalScale.getTicks(), function (tickValue) { var rawLabel = ordinalScale.getLabel(tickValue); if (categoryInterval(tickValue, rawLabel)) { result.push(onlyTick ? tickValue : { formattedLabel: labelFormatter(tickValue), rawLabel: rawLabel, tickValue: tickValue } ); } }); return result; } // Can be null|'auto'|number|function function getOptionCategoryInterval(model) { var interval = model.get('interval'); return interval == null ? 'auto' : interval; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var NORMALIZED_EXTENT = [0, 1]; /** * Base class of Axis. * @constructor */ var Axis = function (dim, scale, extent) { /** * Axis dimension. Such as 'x', 'y', 'z', 'angle', 'radius'. * @type {string} */ this.dim = dim; /** * Axis scale * @type {module:echarts/coord/scale/*} */ this.scale = scale; /** * @type {Array.} * @private */ this._extent = extent || [0, 0]; /** * @type {boolean} */ this.inverse = false; /** * Usually true when axis has a ordinal scale * @type {boolean} */ this.onBand = false; }; Axis.prototype = { constructor: Axis, /** * If axis extent contain given coord * @param {number} coord * @return {boolean} */ contain: function (coord) { var extent = this._extent; var min = Math.min(extent[0], extent[1]); var max = Math.max(extent[0], extent[1]); return coord >= min && coord <= max; }, /** * If axis extent contain given data * @param {number} data * @return {boolean} */ containData: function (data) { return this.contain(this.dataToCoord(data)); }, /** * Get coord extent. * @return {Array.} */ getExtent: function () { return this._extent.slice(); }, /** * Get precision used for formatting * @param {Array.} [dataExtent] * @return {number} */ getPixelPrecision: function (dataExtent) { return getPixelPrecision( dataExtent || this.scale.getExtent(), this._extent ); }, /** * Set coord extent * @param {number} start * @param {number} end */ setExtent: function (start, end) { var extent = this._extent; extent[0] = start; extent[1] = end; }, /** * Convert data to coord. Data is the rank if it has an ordinal scale * @param {number} data * @param {boolean} clamp * @return {number} */ dataToCoord: function (data, clamp) { var extent = this._extent; var scale = this.scale; data = scale.normalize(data); if (this.onBand && scale.type === 'ordinal') { extent = extent.slice(); fixExtentWithBands(extent, scale.count()); } return linearMap(data, NORMALIZED_EXTENT, extent, clamp); }, /** * Convert coord to data. Data is the rank if it has an ordinal scale * @param {number} coord * @param {boolean} clamp * @return {number} */ coordToData: function (coord, clamp) { var extent = this._extent; var scale = this.scale; if (this.onBand && scale.type === 'ordinal') { extent = extent.slice(); fixExtentWithBands(extent, scale.count()); } var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp); return this.scale.scale(t); }, /** * Convert pixel point to data in axis * @param {Array.} point * @param {boolean} clamp * @return {number} data */ pointToData: function (point, clamp) { // Should be implemented in derived class if necessary. }, /** * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`, * `axis.getTicksCoords` considers `onBand`, which is used by * `boundaryGap:true` of category axis and splitLine and splitArea. * @param {Object} [opt] * @param {number} [opt.tickModel=axis.model.getModel('axisTick')] * @param {boolean} [opt.clamp] If `true`, the first and the last * tick must be at the axis end points. Otherwise, clip ticks * that outside the axis extent. * @return {Array.} [{ * coord: ..., * tickValue: ... * }, ...] */ getTicksCoords: function (opt) { opt = opt || {}; var tickModel = opt.tickModel || this.getTickModel(); var result = createAxisTicks(this, tickModel); var ticks = result.ticks; var ticksCoords = map(ticks, function (tickValue) { return { coord: this.dataToCoord(tickValue), tickValue: tickValue }; }, this); var alignWithLabel = tickModel.get('alignWithLabel'); fixOnBandTicksCoords( this, ticksCoords, result.tickCategoryInterval, alignWithLabel, opt.clamp ); return ticksCoords; }, /** * @return {Array.} [{ * formattedLabel: string, * rawLabel: axis.scale.getLabel(tickValue) * tickValue: number * }, ...] */ getViewLabels: function () { return createAxisLabels(this).labels; }, /** * @return {module:echarts/coord/model/Model} */ getLabelModel: function () { return this.model.getModel('axisLabel'); }, /** * Notice here we only get the default tick model. For splitLine * or splitArea, we should pass the splitLineModel or splitAreaModel * manually when calling `getTicksCoords`. * In GL, this method may be overrided to: * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));` * @return {module:echarts/coord/model/Model} */ getTickModel: function () { return this.model.getModel('axisTick'); }, /** * Get width of band * @return {number} */ getBandWidth: function () { var axisExtent = this._extent; var dataExtent = this.scale.getExtent(); var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0); // Fix #2728, avoid NaN when only one data. len === 0 && (len = 1); var size = Math.abs(axisExtent[1] - axisExtent[0]); return Math.abs(size) / len; }, /** * @abstract * @return {boolean} Is horizontal */ isHorizontal: null, /** * @abstract * @return {number} Get axis rotate, by degree. */ getRotate: null, /** * Only be called in category axis. * Can be overrided, consider other axes like in 3D. * @return {number} Auto interval for cateogry axis tick and label */ calculateCategoryInterval: function () { return calculateCategoryInterval(this); } }; function fixExtentWithBands(extent, nTick) { var size = extent[1] - extent[0]; var len = nTick; var margin = size / len / 2; extent[0] += margin; extent[1] -= margin; } // If axis has labels [1, 2, 3, 4]. Bands on the axis are // |---1---|---2---|---3---|---4---|. // So the displayed ticks and splitLine/splitArea should between // each data item, otherwise cause misleading (e.g., split tow bars // of a single data item when there are two bar series). // Also consider if tickCategoryInterval > 0 and onBand, ticks and // splitLine/spliteArea should layout appropriately corresponding // to displayed labels. (So we should not use `getBandWidth` in this // case). function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) { var ticksLen = ticksCoords.length; if (!axis.onBand || alignWithLabel || !ticksLen) { return; } var axisExtent = axis.getExtent(); var last; if (ticksLen === 1) { ticksCoords[0].coord = axisExtent[0]; last = ticksCoords[1] = {coord: axisExtent[0]}; } else { var shift = (ticksCoords[1].coord - ticksCoords[0].coord); each$1(ticksCoords, function (ticksItem) { ticksItem.coord -= shift / 2; var tickCategoryInterval = tickCategoryInterval || 0; // Avoid split a single data item when odd interval. if (tickCategoryInterval % 2 > 0) { ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2); } }); last = {coord: ticksCoords[ticksLen - 1].coord + shift}; ticksCoords.push(last); } var inverse = axisExtent[0] > axisExtent[1]; if (littleThan(ticksCoords[0].coord, axisExtent[0])) { clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift(); } if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) { ticksCoords.unshift({coord: axisExtent[0]}); } if (littleThan(axisExtent[1], last.coord)) { clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop(); } if (clamp && littleThan(last.coord, axisExtent[1])) { ticksCoords.push({coord: axisExtent[1]}); } function littleThan(a, b) { return inverse ? a > b : a < b; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Do not mount those modules on 'src/echarts' for better tree shaking. */ var parseGeoJson = parseGeoJson$1; var ecUtil = {}; each$1([ 'map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter', 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction', 'extend', 'defaults', 'clone', 'merge' ], function (name) { ecUtil[name] = zrUtil[name]; } ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ SeriesModel.extend({ type: 'series.line', dependencies: ['grid', 'polar'], getInitialData: function (option, ecModel) { if (__DEV__) { var coordSys = option.coordinateSystem; if (coordSys !== 'polar' && coordSys !== 'cartesian2d') { throw new Error('Line not support coordinateSystem besides cartesian and polar'); } } return createListFromArray(this.getSource(), this); }, defaultOption: { zlevel: 0, z: 2, coordinateSystem: 'cartesian2d', legendHoverLink: true, hoverAnimation: true, // stack: null // xAxisIndex: 0, // yAxisIndex: 0, // polarIndex: 0, // If clip the overflow value clipOverflow: true, // cursor: null, label: { position: 'top' }, // itemStyle: { // }, lineStyle: { width: 2, type: 'solid' }, // areaStyle: { // origin of areaStyle. Valid values: // `'auto'/null/undefined`: from axisLine to data // `'start'`: from min to data // `'end'`: from data to max // origin: 'auto' // }, // false, 'start', 'end', 'middle' step: false, // Disabled if step is true smooth: false, smoothMonotone: null, symbol: 'emptyCircle', symbolSize: 4, symbolRotate: null, showSymbol: true, // `false`: follow the label interval strategy. // `true`: show all symbols. // `'auto'`: If possible, show all symbols, otherwise // follow the label interval strategy. showAllSymbol: 'auto', // Whether to connect break point. connectNulls: false, // Sampling for large data. Can be: 'average', 'max', 'min', 'sum'. sampling: 'none', animationEasing: 'linear', // Disable progressive progressive: 0, hoverLayerThreshold: Infinity } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @param {module:echarts/data/List} data * @param {number} dataIndex * @return {string} label string. Not null/undefined */ function getDefaultLabel(data, dataIndex) { var labelDims = data.mapDimension('defaultedLabel', true); var len = labelDims.length; // Simple optimization (in lots of cases, label dims length is 1) if (len === 1) { return retrieveRawValue(data, dataIndex, labelDims[0]); } else if (len) { var vals = []; for (var i = 0; i < labelDims.length; i++) { var val = retrieveRawValue(data, dataIndex, labelDims[i]); vals.push(val); } return vals.join(' '); } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @module echarts/chart/helper/Symbol */ /** * @constructor * @alias {module:echarts/chart/helper/Symbol} * @param {module:echarts/data/List} data * @param {number} idx * @extends {module:zrender/graphic/Group} */ function SymbolClz$1(data, idx, seriesScope) { Group.call(this); this.updateData(data, idx, seriesScope); } var symbolProto = SymbolClz$1.prototype; /** * @public * @static * @param {module:echarts/data/List} data * @param {number} dataIndex * @return {Array.} [width, height] */ var getSymbolSize = SymbolClz$1.getSymbolSize = function (data, idx) { var symbolSize = data.getItemVisual(idx, 'symbolSize'); return symbolSize instanceof Array ? symbolSize.slice() : [+symbolSize, +symbolSize]; }; function getScale(symbolSize) { return [symbolSize[0] / 2, symbolSize[1] / 2]; } function driftSymbol(dx, dy) { this.parent.drift(dx, dy); } symbolProto._createSymbol = function ( symbolType, data, idx, symbolSize, keepAspect ) { // Remove paths created before this.removeAll(); var color = data.getItemVisual(idx, 'color'); // var symbolPath = createSymbol( // symbolType, -0.5, -0.5, 1, 1, color // ); // If width/height are set too small (e.g., set to 1) on ios10 // and macOS Sierra, a circle stroke become a rect, no matter what // the scale is set. So we set width/height as 2. See #4150. var symbolPath = createSymbol( symbolType, -1, -1, 2, 2, color, keepAspect ); symbolPath.attr({ z2: 100, culling: true, scale: getScale(symbolSize) }); // Rewrite drift method symbolPath.drift = driftSymbol; this._symbolType = symbolType; this.add(symbolPath); }; /** * Stop animation * @param {boolean} toLastFrame */ symbolProto.stopSymbolAnimation = function (toLastFrame) { this.childAt(0).stopAnimation(toLastFrame); }; /** * FIXME: * Caution: This method breaks the encapsulation of this module, * but it indeed brings convenience. So do not use the method * unless you detailedly know all the implements of `Symbol`, * especially animation. * * Get symbol path element. */ symbolProto.getSymbolPath = function () { return this.childAt(0); }; /** * Get scale(aka, current symbol size). * Including the change caused by animation */ symbolProto.getScale = function () { return this.childAt(0).scale; }; /** * Highlight symbol */ symbolProto.highlight = function () { this.childAt(0).trigger('emphasis'); }; /** * Downplay symbol */ symbolProto.downplay = function () { this.childAt(0).trigger('normal'); }; /** * @param {number} zlevel * @param {number} z */ symbolProto.setZ = function (zlevel, z) { var symbolPath = this.childAt(0); symbolPath.zlevel = zlevel; symbolPath.z = z; }; symbolProto.setDraggable = function (draggable) { var symbolPath = this.childAt(0); symbolPath.draggable = draggable; symbolPath.cursor = draggable ? 'move' : 'pointer'; }; /** * Update symbol properties * @param {module:echarts/data/List} data * @param {number} idx * @param {Object} [seriesScope] * @param {Object} [seriesScope.itemStyle] * @param {Object} [seriesScope.hoverItemStyle] * @param {Object} [seriesScope.symbolRotate] * @param {Object} [seriesScope.symbolOffset] * @param {module:echarts/model/Model} [seriesScope.labelModel] * @param {module:echarts/model/Model} [seriesScope.hoverLabelModel] * @param {boolean} [seriesScope.hoverAnimation] * @param {Object} [seriesScope.cursorStyle] * @param {module:echarts/model/Model} [seriesScope.itemModel] * @param {string} [seriesScope.symbolInnerColor] * @param {Object} [seriesScope.fadeIn=false] */ symbolProto.updateData = function (data, idx, seriesScope) { this.silent = false; var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; var seriesModel = data.hostModel; var symbolSize = getSymbolSize(data, idx); var isInit = symbolType !== this._symbolType; if (isInit) { var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect'); this._createSymbol(symbolType, data, idx, symbolSize, keepAspect); } else { var symbolPath = this.childAt(0); symbolPath.silent = false; updateProps(symbolPath, { scale: getScale(symbolSize) }, seriesModel, idx); } this._updateCommon(data, idx, symbolSize, seriesScope); if (isInit) { var symbolPath = this.childAt(0); var fadeIn = seriesScope && seriesScope.fadeIn; var target = {scale: symbolPath.scale.slice()}; fadeIn && (target.style = {opacity: symbolPath.style.opacity}); symbolPath.scale = [0, 0]; fadeIn && (symbolPath.style.opacity = 0); initProps(symbolPath, target, seriesModel, idx); } this._seriesModel = seriesModel; }; // Update common properties var normalStyleAccessPath = ['itemStyle']; var emphasisStyleAccessPath = ['emphasis', 'itemStyle']; var normalLabelAccessPath = ['label']; var emphasisLabelAccessPath = ['emphasis', 'label']; /** * @param {module:echarts/data/List} data * @param {number} idx * @param {Array.} symbolSize * @param {Object} [seriesScope] */ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) { var symbolPath = this.childAt(0); var seriesModel = data.hostModel; var color = data.getItemVisual(idx, 'color'); // Reset style if (symbolPath.type !== 'image') { symbolPath.useStyle({ strokeNoScale: true }); } var itemStyle = seriesScope && seriesScope.itemStyle; var hoverItemStyle = seriesScope && seriesScope.hoverItemStyle; var symbolRotate = seriesScope && seriesScope.symbolRotate; var symbolOffset = seriesScope && seriesScope.symbolOffset; var labelModel = seriesScope && seriesScope.labelModel; var hoverLabelModel = seriesScope && seriesScope.hoverLabelModel; var hoverAnimation = seriesScope && seriesScope.hoverAnimation; var cursorStyle = seriesScope && seriesScope.cursorStyle; if (!seriesScope || data.hasItemOption) { var itemModel = (seriesScope && seriesScope.itemModel) ? seriesScope.itemModel : data.getItemModel(idx); // Color must be excluded. // Because symbol provide setColor individually to set fill and stroke itemStyle = itemModel.getModel(normalStyleAccessPath).getItemStyle(['color']); hoverItemStyle = itemModel.getModel(emphasisStyleAccessPath).getItemStyle(); symbolRotate = itemModel.getShallow('symbolRotate'); symbolOffset = itemModel.getShallow('symbolOffset'); labelModel = itemModel.getModel(normalLabelAccessPath); hoverLabelModel = itemModel.getModel(emphasisLabelAccessPath); hoverAnimation = itemModel.getShallow('hoverAnimation'); cursorStyle = itemModel.getShallow('cursor'); } else { hoverItemStyle = extend({}, hoverItemStyle); } var elStyle = symbolPath.style; symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0); if (symbolOffset) { symbolPath.attr('position', [ parsePercent$1(symbolOffset[0], symbolSize[0]), parsePercent$1(symbolOffset[1], symbolSize[1]) ]); } cursorStyle && symbolPath.attr('cursor', cursorStyle); // PENDING setColor before setStyle!!! symbolPath.setColor(color, seriesScope && seriesScope.symbolInnerColor); symbolPath.setStyle(itemStyle); var opacity = data.getItemVisual(idx, 'opacity'); if (opacity != null) { elStyle.opacity = opacity; } var liftZ = data.getItemVisual(idx, 'liftZ'); var z2Origin = symbolPath.__z2Origin; if (liftZ != null) { if (z2Origin == null) { symbolPath.__z2Origin = symbolPath.z2; symbolPath.z2 += liftZ; } } else if (z2Origin != null) { symbolPath.z2 = z2Origin; symbolPath.__z2Origin = null; } var useNameLabel = seriesScope && seriesScope.useNameLabel; setLabelStyle( elStyle, hoverItemStyle, labelModel, hoverLabelModel, { labelFetcher: seriesModel, labelDataIndex: idx, defaultText: getLabelDefaultText, isRectText: true, autoColor: color } ); // Do not execute util needed. function getLabelDefaultText(idx, opt) { return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx); } symbolPath.off('mouseover') .off('mouseout') .off('emphasis') .off('normal'); symbolPath.hoverStyle = hoverItemStyle; // FIXME // Do not use symbol.trigger('emphasis'), but use symbol.highlight() instead. setHoverStyle(symbolPath); var scale = getScale(symbolSize); if (hoverAnimation && seriesModel.isAnimationEnabled()) { var onEmphasis = function() { // Do not support this hover animation util some scenario required. // Animation can only be supported in hover layer when using `el.incremetal`. if (this.incremental) { return; } var ratio = scale[1] / scale[0]; this.animateTo({ scale: [ Math.max(scale[0] * 1.1, scale[0] + 3), Math.max(scale[1] * 1.1, scale[1] + 3 * ratio) ] }, 400, 'elasticOut'); }; var onNormal = function() { if (this.incremental) { return; } this.animateTo({ scale: scale }, 400, 'elasticOut'); }; symbolPath.on('mouseover', onEmphasis) .on('mouseout', onNormal) .on('emphasis', onEmphasis) .on('normal', onNormal); } }; /** * @param {Function} cb * @param {Object} [opt] * @param {Object} [opt.keepLabel=true] */ symbolProto.fadeOut = function (cb, opt) { var symbolPath = this.childAt(0); // Avoid mistaken hover when fading out this.silent = symbolPath.silent = true; // Not show text when animating !(opt && opt.keepLabel) && (symbolPath.style.text = null); updateProps( symbolPath, { style: {opacity: 0}, scale: [0, 0] }, this._seriesModel, this.dataIndex, cb ); }; inherits(SymbolClz$1, Group); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @module echarts/chart/helper/SymbolDraw */ /** * @constructor * @alias module:echarts/chart/helper/SymbolDraw * @param {module:zrender/graphic/Group} [symbolCtor] */ function SymbolDraw(symbolCtor) { this.group = new Group(); this._symbolCtor = symbolCtor || SymbolClz$1; } var symbolDrawProto = SymbolDraw.prototype; function symbolNeedsDraw(data, point, idx, opt) { return point && !isNaN(point[0]) && !isNaN(point[1]) && !(opt.isIgnore && opt.isIgnore(idx)) // We do not set clipShape on group, because it will cut part of // the symbol element shape. We use the same clip shape here as // the line clip. && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, 'symbol') !== 'none'; } /** * Update symbols draw by new data * @param {module:echarts/data/List} data * @param {Object} [opt] Or isIgnore * @param {Function} [opt.isIgnore] * @param {Object} [opt.clipShape] */ symbolDrawProto.updateData = function (data, opt) { opt = normalizeUpdateOpt(opt); var group = this.group; var seriesModel = data.hostModel; var oldData = this._data; var SymbolCtor = this._symbolCtor; var seriesScope = makeSeriesScope(data); // There is no oldLineData only when first rendering or switching from // stream mode to normal mode, where previous elements should be removed. if (!oldData) { group.removeAll(); } data.diff(oldData) .add(function (newIdx) { var point = data.getItemLayout(newIdx); if (symbolNeedsDraw(data, point, newIdx, opt)) { var symbolEl = new SymbolCtor(data, newIdx, seriesScope); symbolEl.attr('position', point); data.setItemGraphicEl(newIdx, symbolEl); group.add(symbolEl); } }) .update(function (newIdx, oldIdx) { var symbolEl = oldData.getItemGraphicEl(oldIdx); var point = data.getItemLayout(newIdx); if (!symbolNeedsDraw(data, point, newIdx, opt)) { group.remove(symbolEl); return; } if (!symbolEl) { symbolEl = new SymbolCtor(data, newIdx); symbolEl.attr('position', point); } else { symbolEl.updateData(data, newIdx, seriesScope); updateProps(symbolEl, { position: point }, seriesModel); } // Add back group.add(symbolEl); data.setItemGraphicEl(newIdx, symbolEl); }) .remove(function (oldIdx) { var el = oldData.getItemGraphicEl(oldIdx); el && el.fadeOut(function () { group.remove(el); }); }) .execute(); this._data = data; }; symbolDrawProto.isPersistent = function () { return true; }; symbolDrawProto.updateLayout = function () { var data = this._data; if (data) { // Not use animation data.eachItemGraphicEl(function (el, idx) { var point = data.getItemLayout(idx); el.attr('position', point); }); } }; symbolDrawProto.incrementalPrepareUpdate = function (data) { this._seriesScope = makeSeriesScope(data); this._data = null; this.group.removeAll(); }; /** * Update symbols draw by new data * @param {module:echarts/data/List} data * @param {Object} [opt] Or isIgnore * @param {Function} [opt.isIgnore] * @param {Object} [opt.clipShape] */ symbolDrawProto.incrementalUpdate = function (taskParams, data, opt) { opt = normalizeUpdateOpt(opt); function updateIncrementalAndHover(el) { if (!el.isGroup) { el.incremental = el.useHoverLayer = true; } } for (var idx = taskParams.start; idx < taskParams.end; idx++) { var point = data.getItemLayout(idx); if (symbolNeedsDraw(data, point, idx, opt)) { var el = new this._symbolCtor(data, idx, this._seriesScope); el.traverse(updateIncrementalAndHover); el.attr('position', point); this.group.add(el); data.setItemGraphicEl(idx, el); } } }; function normalizeUpdateOpt(opt) { if (opt != null && !isObject$1(opt)) { opt = {isIgnore: opt}; } return opt || {}; } symbolDrawProto.remove = function (enableAnimation) { var group = this.group; var data = this._data; // Incremental model do not have this._data. if (data && enableAnimation) { data.eachItemGraphicEl(function (el) { el.fadeOut(function () { group.remove(el); }); }); } else { group.removeAll(); } }; function makeSeriesScope(data) { var seriesModel = data.hostModel; return { itemStyle: seriesModel.getModel('itemStyle').getItemStyle(['color']), hoverItemStyle: seriesModel.getModel('emphasis.itemStyle').getItemStyle(), symbolRotate: seriesModel.get('symbolRotate'), symbolOffset: seriesModel.get('symbolOffset'), hoverAnimation: seriesModel.get('hoverAnimation'), labelModel: seriesModel.getModel('label'), hoverLabelModel: seriesModel.getModel('emphasis.label'), cursorStyle: seriesModel.get('cursor') }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @param {Object} coordSys * @param {module:echarts/data/List} data * @param {string} valueOrigin lineSeries.option.areaStyle.origin */ function prepareDataCoordInfo(coordSys, data, valueOrigin) { var baseAxis = coordSys.getBaseAxis(); var valueAxis = coordSys.getOtherAxis(baseAxis); var valueStart = getValueStart(valueAxis, valueOrigin); var baseAxisDim = baseAxis.dim; var valueAxisDim = valueAxis.dim; var valueDim = data.mapDimension(valueAxisDim); var baseDim = data.mapDimension(baseAxisDim); var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0; var dims = map(coordSys.dimensions, function (coordDim) { return data.mapDimension(coordDim); }); var stacked; var stackResultDim = data.getCalculationInfo('stackResultDimension'); if (stacked |= isDimensionStacked(data, dims[0] /*, dims[1]*/)) { // jshint ignore:line dims[0] = stackResultDim; } if (stacked |= isDimensionStacked(data, dims[1] /*, dims[0]*/)) { // jshint ignore:line dims[1] = stackResultDim; } return { dataDimsForPoint: dims, valueStart: valueStart, valueAxisDim: valueAxisDim, baseAxisDim: baseAxisDim, stacked: !!stacked, valueDim: valueDim, baseDim: baseDim, baseDataOffset: baseDataOffset, stackedOverDimension: data.getCalculationInfo('stackedOverDimension') }; } function getValueStart(valueAxis, valueOrigin) { var valueStart = 0; var extent = valueAxis.scale.getExtent(); if (valueOrigin === 'start') { valueStart = extent[0]; } else if (valueOrigin === 'end') { valueStart = extent[1]; } // auto else { // Both positive if (extent[0] > 0) { valueStart = extent[0]; } // Both negative else if (extent[1] < 0) { valueStart = extent[1]; } // If is one positive, and one negative, onZero shall be true } return valueStart; } function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) { var value = NaN; if (dataCoordInfo.stacked) { value = data.get(data.getCalculationInfo('stackedOverDimension'), idx); } if (isNaN(value)) { value = dataCoordInfo.valueStart; } var baseDataOffset = dataCoordInfo.baseDataOffset; var stackedData = []; stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx); stackedData[1 - baseDataOffset] = value; return coordSys.dataToPoint(stackedData); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // var arrayDiff = require('zrender/src/core/arrayDiff'); // 'zrender/src/core/arrayDiff' has been used before, but it did // not do well in performance when roam with fixed dataZoom window. // function convertToIntId(newIdList, oldIdList) { // // Generate int id instead of string id. // // Compare string maybe slow in score function of arrDiff // // Assume id in idList are all unique // var idIndicesMap = {}; // var idx = 0; // for (var i = 0; i < newIdList.length; i++) { // idIndicesMap[newIdList[i]] = idx; // newIdList[i] = idx++; // } // for (var i = 0; i < oldIdList.length; i++) { // var oldId = oldIdList[i]; // // Same with newIdList // if (idIndicesMap[oldId]) { // oldIdList[i] = idIndicesMap[oldId]; // } // else { // oldIdList[i] = idx++; // } // } // } function diffData(oldData, newData) { var diffResult = []; newData.diff(oldData) .add(function (idx) { diffResult.push({cmd: '+', idx: idx}); }) .update(function (newIdx, oldIdx) { diffResult.push({cmd: '=', idx: oldIdx, idx1: newIdx}); }) .remove(function (idx) { diffResult.push({cmd: '-', idx: idx}); }) .execute(); return diffResult; } var lineAnimationDiff = function ( oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin ) { var diff = diffData(oldData, newData); // var newIdList = newData.mapArray(newData.getId); // var oldIdList = oldData.mapArray(oldData.getId); // convertToIntId(newIdList, oldIdList); // // FIXME One data ? // diff = arrayDiff(oldIdList, newIdList); var currPoints = []; var nextPoints = []; // Points for stacking base line var currStackedPoints = []; var nextStackedPoints = []; var status = []; var sortedIndices = []; var rawIndices = []; var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin); var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin); for (var i = 0; i < diff.length; i++) { var diffItem = diff[i]; var pointAdded = true; // FIXME, animation is not so perfect when dataZoom window moves fast // Which is in case remvoing or add more than one data in the tail or head switch (diffItem.cmd) { case '=': var currentPt = oldData.getItemLayout(diffItem.idx); var nextPt = newData.getItemLayout(diffItem.idx1); // If previous data is NaN, use next point directly if (isNaN(currentPt[0]) || isNaN(currentPt[1])) { currentPt = nextPt.slice(); } currPoints.push(currentPt); nextPoints.push(nextPt); currStackedPoints.push(oldStackedOnPoints[diffItem.idx]); nextStackedPoints.push(newStackedOnPoints[diffItem.idx1]); rawIndices.push(newData.getRawIndex(diffItem.idx1)); break; case '+': var idx = diffItem.idx; currPoints.push( oldCoordSys.dataToPoint([ newData.get(newDataOldCoordInfo.dataDimsForPoint[0], idx), newData.get(newDataOldCoordInfo.dataDimsForPoint[1], idx) ]) ); nextPoints.push(newData.getItemLayout(idx).slice()); currStackedPoints.push( getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, idx) ); nextStackedPoints.push(newStackedOnPoints[idx]); rawIndices.push(newData.getRawIndex(idx)); break; case '-': var idx = diffItem.idx; var rawIndex = oldData.getRawIndex(idx); // Data is replaced. In the case of dynamic data queue // FIXME FIXME FIXME if (rawIndex !== idx) { currPoints.push(oldData.getItemLayout(idx)); nextPoints.push(newCoordSys.dataToPoint([ oldData.get(oldDataNewCoordInfo.dataDimsForPoint[0], idx), oldData.get(oldDataNewCoordInfo.dataDimsForPoint[1], idx) ])); currStackedPoints.push(oldStackedOnPoints[idx]); nextStackedPoints.push( getStackedOnPoint(oldDataNewCoordInfo, newCoordSys, oldData, idx) ); rawIndices.push(rawIndex); } else { pointAdded = false; } } // Original indices if (pointAdded) { status.push(diffItem); sortedIndices.push(sortedIndices.length); } } // Diff result may be crossed if all items are changed // Sort by data index sortedIndices.sort(function (a, b) { return rawIndices[a] - rawIndices[b]; }); var sortedCurrPoints = []; var sortedNextPoints = []; var sortedCurrStackedPoints = []; var sortedNextStackedPoints = []; var sortedStatus = []; for (var i = 0; i < sortedIndices.length; i++) { var idx = sortedIndices[i]; sortedCurrPoints[i] = currPoints[idx]; sortedNextPoints[i] = nextPoints[idx]; sortedCurrStackedPoints[i] = currStackedPoints[idx]; sortedNextStackedPoints[i] = nextStackedPoints[idx]; sortedStatus[i] = status[idx]; } return { current: sortedCurrPoints, next: sortedNextPoints, stackedOnCurrent: sortedCurrStackedPoints, stackedOnNext: sortedNextStackedPoints, status: sortedStatus }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Poly path support NaN point var vec2Min = min; var vec2Max = max; var scaleAndAdd$1 = scaleAndAdd; var v2Copy = copy; // Temporary variable var v = []; var cp0 = []; var cp1 = []; function isPointNull(p) { return isNaN(p[0]) || isNaN(p[1]); } function drawSegment( ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls ) { // if (smoothMonotone == null) { // if (isMono(points, 'x')) { // return drawMono(ctx, points, start, segLen, allLen, // dir, smoothMin, smoothMax, smooth, 'x', connectNulls); // } // else if (isMono(points, 'y')) { // return drawMono(ctx, points, start, segLen, allLen, // dir, smoothMin, smoothMax, smooth, 'y', connectNulls); // } // else { // return drawNonMono.apply(this, arguments); // } // } // else if (smoothMonotone !== 'none' && isMono(points, smoothMonotone)) { // return drawMono.apply(this, arguments); // } // else { // return drawNonMono.apply(this, arguments); // } if (smoothMonotone === 'none' || !smoothMonotone) { return drawNonMono.apply(this, arguments); } else { return drawMono.apply(this, arguments); } } /** * Check if points is in monotone. * * @param {number[][]} points Array of points which is in [x, y] form * @param {string} smoothMonotone 'x', 'y', or 'none', stating for which * dimension that is checking. * If is 'none', `drawNonMono` should be * called. * If is undefined, either being monotone * in 'x' or 'y' will call `drawMono`. */ // function isMono(points, smoothMonotone) { // if (points.length <= 1) { // return true; // } // var dim = smoothMonotone === 'x' ? 0 : 1; // var last = points[0][dim]; // var lastDiff = 0; // for (var i = 1; i < points.length; ++i) { // var diff = points[i][dim] - last; // if (!isNaN(diff) && !isNaN(lastDiff) // && diff !== 0 && lastDiff !== 0 // && ((diff >= 0) !== (lastDiff >= 0)) // ) { // return false; // } // if (!isNaN(diff) && diff !== 0) { // lastDiff = diff; // last = points[i][dim]; // } // } // return true; // } /** * Draw smoothed line in monotone, in which only vertical or horizontal bezier * control points will be used. This should be used when points are monotone * either in x or y dimension. */ function drawMono( ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls ) { var prevIdx = 0; var idx = start; for (var k = 0; k < segLen; k++) { var p = points[idx]; if (idx >= allLen || idx < 0) { break; } if (isPointNull(p)) { if (connectNulls) { idx += dir; continue; } break; } if (idx === start) { ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]); } else { if (smooth > 0) { var prevP = points[prevIdx]; var dim = smoothMonotone === 'y' ? 1 : 0; // Length of control point to p, either in x or y, but not both var ctrlLen = (p[dim] - prevP[dim]) * smooth; v2Copy(cp0, prevP); cp0[dim] = prevP[dim] + ctrlLen; v2Copy(cp1, p); cp1[dim] = p[dim] - ctrlLen; ctx.bezierCurveTo( cp0[0], cp0[1], cp1[0], cp1[1], p[0], p[1] ); } else { ctx.lineTo(p[0], p[1]); } } prevIdx = idx; idx += dir; } return k; } /** * Draw smoothed line in non-monotone, in may cause undesired curve in extreme * situations. This should be used when points are non-monotone neither in x or * y dimension. */ function drawNonMono( ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls ) { var prevIdx = 0; var idx = start; for (var k = 0; k < segLen; k++) { var p = points[idx]; if (idx >= allLen || idx < 0) { break; } if (isPointNull(p)) { if (connectNulls) { idx += dir; continue; } break; } if (idx === start) { ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]); v2Copy(cp0, p); } else { if (smooth > 0) { var nextIdx = idx + dir; var nextP = points[nextIdx]; if (connectNulls) { // Find next point not null while (nextP && isPointNull(points[nextIdx])) { nextIdx += dir; nextP = points[nextIdx]; } } var ratioNextSeg = 0.5; var prevP = points[prevIdx]; var nextP = points[nextIdx]; // Last point if (!nextP || isPointNull(nextP)) { v2Copy(cp1, p); } else { // If next data is null in not connect case if (isPointNull(nextP) && !connectNulls) { nextP = p; } sub(v, nextP, prevP); var lenPrevSeg; var lenNextSeg; if (smoothMonotone === 'x' || smoothMonotone === 'y') { var dim = smoothMonotone === 'x' ? 0 : 1; lenPrevSeg = Math.abs(p[dim] - prevP[dim]); lenNextSeg = Math.abs(p[dim] - nextP[dim]); } else { lenPrevSeg = dist(p, prevP); lenNextSeg = dist(p, nextP); } // Use ratio of seg length ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg); scaleAndAdd$1(cp1, p, v, -smooth * (1 - ratioNextSeg)); } // Smooth constraint vec2Min(cp0, cp0, smoothMax); vec2Max(cp0, cp0, smoothMin); vec2Min(cp1, cp1, smoothMax); vec2Max(cp1, cp1, smoothMin); ctx.bezierCurveTo( cp0[0], cp0[1], cp1[0], cp1[1], p[0], p[1] ); // cp0 of next segment scaleAndAdd$1(cp0, p, v, smooth * ratioNextSeg); } else { ctx.lineTo(p[0], p[1]); } } prevIdx = idx; idx += dir; } return k; } function getBoundingBox(points, smoothConstraint) { var ptMin = [Infinity, Infinity]; var ptMax = [-Infinity, -Infinity]; if (smoothConstraint) { for (var i = 0; i < points.length; i++) { var pt = points[i]; if (pt[0] < ptMin[0]) { ptMin[0] = pt[0]; } if (pt[1] < ptMin[1]) { ptMin[1] = pt[1]; } if (pt[0] > ptMax[0]) { ptMax[0] = pt[0]; } if (pt[1] > ptMax[1]) { ptMax[1] = pt[1]; } } } return { min: smoothConstraint ? ptMin : ptMax, max: smoothConstraint ? ptMax : ptMin }; } var Polyline$1 = Path.extend({ type: 'ec-polyline', shape: { points: [], smooth: 0, smoothConstraint: true, smoothMonotone: null, connectNulls: false }, style: { fill: null, stroke: '#000' }, brush: fixClipWithShadow(Path.prototype.brush), buildPath: function (ctx, shape) { var points = shape.points; var i = 0; var len$$1 = points.length; var result = getBoundingBox(points, shape.smoothConstraint); if (shape.connectNulls) { // Must remove first and last null values avoid draw error in polygon for (; len$$1 > 0; len$$1--) { if (!isPointNull(points[len$$1 - 1])) { break; } } for (; i < len$$1; i++) { if (!isPointNull(points[i])) { break; } } } while (i < len$$1) { i += drawSegment( ctx, points, i, len$$1, len$$1, 1, result.min, result.max, shape.smooth, shape.smoothMonotone, shape.connectNulls ) + 1; } } }); var Polygon$1 = Path.extend({ type: 'ec-polygon', shape: { points: [], // Offset between stacked base points and points stackedOnPoints: [], smooth: 0, stackedOnSmooth: 0, smoothConstraint: true, smoothMonotone: null, connectNulls: false }, brush: fixClipWithShadow(Path.prototype.brush), buildPath: function (ctx, shape) { var points = shape.points; var stackedOnPoints = shape.stackedOnPoints; var i = 0; var len$$1 = points.length; var smoothMonotone = shape.smoothMonotone; var bbox = getBoundingBox(points, shape.smoothConstraint); var stackedOnBBox = getBoundingBox(stackedOnPoints, shape.smoothConstraint); if (shape.connectNulls) { // Must remove first and last null values avoid draw error in polygon for (; len$$1 > 0; len$$1--) { if (!isPointNull(points[len$$1 - 1])) { break; } } for (; i < len$$1; i++) { if (!isPointNull(points[i])) { break; } } } while (i < len$$1) { var k = drawSegment( ctx, points, i, len$$1, len$$1, 1, bbox.min, bbox.max, shape.smooth, smoothMonotone, shape.connectNulls ); drawSegment( ctx, stackedOnPoints, i + k - 1, k, len$$1, -1, stackedOnBBox.min, stackedOnBBox.max, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls ); i += k + 1; ctx.closePath(); } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // FIXME step not support polar function isPointsSame(points1, points2) { if (points1.length !== points2.length) { return; } for (var i = 0; i < points1.length; i++) { var p1 = points1[i]; var p2 = points2[i]; if (p1[0] !== p2[0] || p1[1] !== p2[1]) { return; } } return true; } function getSmooth(smooth) { return typeof (smooth) === 'number' ? smooth : (smooth ? 0.5 : 0); } function getAxisExtentWithGap(axis) { var extent = axis.getGlobalExtent(); if (axis.onBand) { // Remove extra 1px to avoid line miter in clipped edge var halfBandWidth = axis.getBandWidth() / 2 - 1; var dir = extent[1] > extent[0] ? 1 : -1; extent[0] += dir * halfBandWidth; extent[1] -= dir * halfBandWidth; } return extent; } /** * @param {module:echarts/coord/cartesian/Cartesian2D|module:echarts/coord/polar/Polar} coordSys * @param {module:echarts/data/List} data * @param {Object} dataCoordInfo * @param {Array.>} points */ function getStackedOnPoints(coordSys, data, dataCoordInfo) { if (!dataCoordInfo.valueDim) { return []; } var points = []; for (var idx = 0, len = data.count(); idx < len; idx++) { points.push(getStackedOnPoint(dataCoordInfo, coordSys, data, idx)); } return points; } function createGridClipShape(cartesian, hasAnimation, forSymbol, seriesModel) { var xExtent = getAxisExtentWithGap(cartesian.getAxis('x')); var yExtent = getAxisExtentWithGap(cartesian.getAxis('y')); var isHorizontal = cartesian.getBaseAxis().isHorizontal(); var x = Math.min(xExtent[0], xExtent[1]); var y = Math.min(yExtent[0], yExtent[1]); var width = Math.max(xExtent[0], xExtent[1]) - x; var height = Math.max(yExtent[0], yExtent[1]) - y; // Avoid float number rounding error for symbol on the edge of axis extent. // See #7913 and `test/dataZoom-clip.html`. if (forSymbol) { x -= 0.5; width += 0.5; y -= 0.5; height += 0.5; } else { var lineWidth = seriesModel.get('lineStyle.width') || 2; // Expand clip shape to avoid clipping when line value exceeds axis var expandSize = seriesModel.get('clipOverflow') ? lineWidth / 2 : Math.max(width, height); if (isHorizontal) { y -= expandSize; height += expandSize * 2; } else { x -= expandSize; width += expandSize * 2; } } var clipPath = new Rect({ shape: { x: x, y: y, width: width, height: height } }); if (hasAnimation) { clipPath.shape[isHorizontal ? 'width' : 'height'] = 0; initProps(clipPath, { shape: { width: width, height: height } }, seriesModel); } return clipPath; } function createPolarClipShape(polar, hasAnimation, forSymbol, seriesModel) { var angleAxis = polar.getAngleAxis(); var radiusAxis = polar.getRadiusAxis(); var radiusExtent = radiusAxis.getExtent().slice(); radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse(); var angleExtent = angleAxis.getExtent(); var RADIAN = Math.PI / 180; // Avoid float number rounding error for symbol on the edge of axis extent. if (forSymbol) { radiusExtent[0] -= 0.5; radiusExtent[1] += 0.5; } var clipPath = new Sector({ shape: { cx: round$1(polar.cx, 1), cy: round$1(polar.cy, 1), r0: round$1(radiusExtent[0], 1), r: round$1(radiusExtent[1], 1), startAngle: -angleExtent[0] * RADIAN, endAngle: -angleExtent[1] * RADIAN, clockwise: angleAxis.inverse } }); if (hasAnimation) { clipPath.shape.endAngle = -angleExtent[0] * RADIAN; initProps(clipPath, { shape: { endAngle: -angleExtent[1] * RADIAN } }, seriesModel); } return clipPath; } function createClipShape(coordSys, hasAnimation, forSymbol, seriesModel) { return coordSys.type === 'polar' ? createPolarClipShape(coordSys, hasAnimation, forSymbol, seriesModel) : createGridClipShape(coordSys, hasAnimation, forSymbol, seriesModel); } function turnPointsIntoStep(points, coordSys, stepTurnAt) { var baseAxis = coordSys.getBaseAxis(); var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1; var stepPoints = []; for (var i = 0; i < points.length - 1; i++) { var nextPt = points[i + 1]; var pt = points[i]; stepPoints.push(pt); var stepPt = []; switch (stepTurnAt) { case 'end': stepPt[baseIndex] = nextPt[baseIndex]; stepPt[1 - baseIndex] = pt[1 - baseIndex]; // default is start stepPoints.push(stepPt); break; case 'middle': // default is start var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2; var stepPt2 = []; stepPt[baseIndex] = stepPt2[baseIndex] = middle; stepPt[1 - baseIndex] = pt[1 - baseIndex]; stepPt2[1 - baseIndex] = nextPt[1 - baseIndex]; stepPoints.push(stepPt); stepPoints.push(stepPt2); break; default: stepPt[baseIndex] = pt[baseIndex]; stepPt[1 - baseIndex] = nextPt[1 - baseIndex]; // default is start stepPoints.push(stepPt); } } // Last points points[i] && stepPoints.push(points[i]); return stepPoints; } function getVisualGradient(data, coordSys) { var visualMetaList = data.getVisual('visualMeta'); if (!visualMetaList || !visualMetaList.length || !data.count()) { // When data.count() is 0, gradient range can not be calculated. return; } if (coordSys.type !== 'cartesian2d') { if (__DEV__) { console.warn('Visual map on line style is only supported on cartesian2d.'); } return; } var coordDim; var visualMeta; for (var i = visualMetaList.length - 1; i >= 0; i--) { var dimIndex = visualMetaList[i].dimension; var dimName = data.dimensions[dimIndex]; var dimInfo = data.getDimensionInfo(dimName); coordDim = dimInfo && dimInfo.coordDim; // Can only be x or y if (coordDim === 'x' || coordDim === 'y') { visualMeta = visualMetaList[i]; break; } } if (!visualMeta) { if (__DEV__) { console.warn('Visual map on line style only support x or y dimension.'); } return; } // If the area to be rendered is bigger than area defined by LinearGradient, // the canvas spec prescribes that the color of the first stop and the last // stop should be used. But if two stops are added at offset 0, in effect // browsers use the color of the second stop to render area outside // LinearGradient. So we can only infinitesimally extend area defined in // LinearGradient to render `outerColors`. var axis = coordSys.getAxis(coordDim); // dataToCoor mapping may not be linear, but must be monotonic. var colorStops = map(visualMeta.stops, function (stop) { return { coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)), color: stop.color }; }); var stopLen = colorStops.length; var outerColors = visualMeta.outerColors.slice(); if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) { colorStops.reverse(); outerColors.reverse(); } var tinyExtent = 10; // Arbitrary value: 10px var minCoord = colorStops[0].coord - tinyExtent; var maxCoord = colorStops[stopLen - 1].coord + tinyExtent; var coordSpan = maxCoord - minCoord; if (coordSpan < 1e-3) { return 'transparent'; } each$1(colorStops, function (stop) { stop.offset = (stop.coord - minCoord) / coordSpan; }); colorStops.push({ offset: stopLen ? colorStops[stopLen - 1].offset : 0.5, color: outerColors[1] || 'transparent' }); colorStops.unshift({ // notice colorStops.length have been changed. offset: stopLen ? colorStops[0].offset : 0.5, color: outerColors[0] || 'transparent' }); // zrUtil.each(colorStops, function (colorStop) { // // Make sure each offset has rounded px to avoid not sharp edge // colorStop.offset = (Math.round(colorStop.offset * (end - start) + start) - start) / (end - start); // }); var gradient = new LinearGradient(0, 0, 0, 0, colorStops, true); gradient[coordDim] = minCoord; gradient[coordDim + '2'] = maxCoord; return gradient; } function getIsIgnoreFunc(seriesModel, data, coordSys) { var showAllSymbol = seriesModel.get('showAllSymbol'); var isAuto = showAllSymbol === 'auto'; if (showAllSymbol && !isAuto) { return; } var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; if (!categoryAxis) { return; } // Note that category label interval strategy might bring some weird effect // in some scenario: users may wonder why some of the symbols are not // displayed. So we show all symbols as possible as we can. if (isAuto // Simplify the logic, do not determine label overlap here. && canShowAllSymbolForCategory(categoryAxis, data) ) { return; } // Otherwise follow the label interval strategy on category axis. var categoryDataDim = data.mapDimension(categoryAxis.dim); var labelMap = {}; each$1(categoryAxis.getViewLabels(), function (labelItem) { labelMap[labelItem.tickValue] = 1; }); return function (dataIndex) { return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex)); }; } function canShowAllSymbolForCategory(categoryAxis, data) { // In mose cases, line is monotonous on category axis, and the label size // is close with each other. So we check the symbol size and some of the // label size alone with the category axis to estimate whether all symbol // can be shown without overlap. var axisExtent = categoryAxis.getExtent(); var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count(); isNaN(availSize) && (availSize = 0); // 0/0 is NaN. // Sampling some points, max 5. var dataLen = data.count(); var step = Math.max(1, Math.round(dataLen / 5)); for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) { if (SymbolClz$1.getSymbolSize( data, dataIndex // Only for cartesian, where `isHorizontal` exists. )[categoryAxis.isHorizontal() ? 1 : 0] // Empirical number * 1.5 > availSize ) { return false; } } return true; } Chart.extend({ type: 'line', init: function () { var lineGroup = new Group(); var symbolDraw = new SymbolDraw(); this.group.add(symbolDraw.group); this._symbolDraw = symbolDraw; this._lineGroup = lineGroup; }, render: function (seriesModel, ecModel, api) { var coordSys = seriesModel.coordinateSystem; var group = this.group; var data = seriesModel.getData(); var lineStyleModel = seriesModel.getModel('lineStyle'); var areaStyleModel = seriesModel.getModel('areaStyle'); var points = data.mapArray(data.getItemLayout); var isCoordSysPolar = coordSys.type === 'polar'; var prevCoordSys = this._coordSys; var symbolDraw = this._symbolDraw; var polyline = this._polyline; var polygon = this._polygon; var lineGroup = this._lineGroup; var hasAnimation = seriesModel.get('animation'); var isAreaChart = !areaStyleModel.isEmpty(); var valueOrigin = areaStyleModel.get('origin'); var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin); var stackedOnPoints = getStackedOnPoints(coordSys, data, dataCoordInfo); var showSymbol = seriesModel.get('showSymbol'); var isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys); // Remove temporary symbols var oldData = this._data; oldData && oldData.eachItemGraphicEl(function (el, idx) { if (el.__temp) { group.remove(el); oldData.setItemGraphicEl(idx, null); } }); // Remove previous created symbols if showSymbol changed to false if (!showSymbol) { symbolDraw.remove(); } group.add(lineGroup); // FIXME step not support polar var step = !isCoordSysPolar && seriesModel.get('step'); // Initialization animation or coordinate system changed if ( !(polyline && prevCoordSys.type === coordSys.type && step === this._step) ) { showSymbol && symbolDraw.updateData(data, { isIgnore: isIgnoreFunc, clipShape: createClipShape(coordSys, false, true, seriesModel) }); if (step) { // TODO If stacked series is not step points = turnPointsIntoStep(points, coordSys, step); stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step); } polyline = this._newPolyline(points, coordSys, hasAnimation); if (isAreaChart) { polygon = this._newPolygon( points, stackedOnPoints, coordSys, hasAnimation ); } lineGroup.setClipPath(createClipShape(coordSys, true, false, seriesModel)); } else { if (isAreaChart && !polygon) { // If areaStyle is added polygon = this._newPolygon( points, stackedOnPoints, coordSys, hasAnimation ); } else if (polygon && !isAreaChart) { // If areaStyle is removed lineGroup.remove(polygon); polygon = this._polygon = null; } // Update clipPath lineGroup.setClipPath(createClipShape(coordSys, false, false, seriesModel)); // Always update, or it is wrong in the case turning on legend // because points are not changed showSymbol && symbolDraw.updateData(data, { isIgnore: isIgnoreFunc, clipShape: createClipShape(coordSys, false, true, seriesModel) }); // Stop symbol animation and sync with line points // FIXME performance? data.eachItemGraphicEl(function (el) { el.stopAnimation(true); }); // In the case data zoom triggerred refreshing frequently // Data may not change if line has a category axis. So it should animate nothing if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points) ) { if (hasAnimation) { this._updateAnimation( data, stackedOnPoints, coordSys, api, step, valueOrigin ); } else { // Not do it in update with animation if (step) { // TODO If stacked series is not step points = turnPointsIntoStep(points, coordSys, step); stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step); } polyline.setShape({ points: points }); polygon && polygon.setShape({ points: points, stackedOnPoints: stackedOnPoints }); } } } var visualColor = getVisualGradient(data, coordSys) || data.getVisual('color'); polyline.useStyle(defaults( // Use color in lineStyle first lineStyleModel.getLineStyle(), { fill: 'none', stroke: visualColor, lineJoin: 'bevel' } )); var smooth = seriesModel.get('smooth'); smooth = getSmooth(seriesModel.get('smooth')); polyline.setShape({ smooth: smooth, smoothMonotone: seriesModel.get('smoothMonotone'), connectNulls: seriesModel.get('connectNulls') }); if (polygon) { var stackedOnSeries = data.getCalculationInfo('stackedOnSeries'); var stackedOnSmooth = 0; polygon.useStyle(defaults( areaStyleModel.getAreaStyle(), { fill: visualColor, opacity: 0.7, lineJoin: 'bevel' } )); if (stackedOnSeries) { stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth')); } polygon.setShape({ smooth: smooth, stackedOnSmooth: stackedOnSmooth, smoothMonotone: seriesModel.get('smoothMonotone'), connectNulls: seriesModel.get('connectNulls') }); } this._data = data; // Save the coordinate system for transition animation when data changed this._coordSys = coordSys; this._stackedOnPoints = stackedOnPoints; this._points = points; this._step = step; this._valueOrigin = valueOrigin; }, dispose: function () {}, highlight: function (seriesModel, ecModel, api, payload) { var data = seriesModel.getData(); var dataIndex = queryDataIndex(data, payload); if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) { var symbol = data.getItemGraphicEl(dataIndex); if (!symbol) { // Create a temporary symbol if it is not exists var pt = data.getItemLayout(dataIndex); if (!pt) { // Null data return; } symbol = new SymbolClz$1(data, dataIndex); symbol.position = pt; symbol.setZ( seriesModel.get('zlevel'), seriesModel.get('z') ); symbol.ignore = isNaN(pt[0]) || isNaN(pt[1]); symbol.__temp = true; data.setItemGraphicEl(dataIndex, symbol); // Stop scale animation symbol.stopSymbolAnimation(true); this.group.add(symbol); } symbol.highlight(); } else { // Highlight whole series Chart.prototype.highlight.call( this, seriesModel, ecModel, api, payload ); } }, downplay: function (seriesModel, ecModel, api, payload) { var data = seriesModel.getData(); var dataIndex = queryDataIndex(data, payload); if (dataIndex != null && dataIndex >= 0) { var symbol = data.getItemGraphicEl(dataIndex); if (symbol) { if (symbol.__temp) { data.setItemGraphicEl(dataIndex, null); this.group.remove(symbol); } else { symbol.downplay(); } } } else { // FIXME // can not downplay completely. // Downplay whole series Chart.prototype.downplay.call( this, seriesModel, ecModel, api, payload ); } }, /** * @param {module:zrender/container/Group} group * @param {Array.>} points * @private */ _newPolyline: function (points) { var polyline = this._polyline; // Remove previous created polyline if (polyline) { this._lineGroup.remove(polyline); } polyline = new Polyline$1({ shape: { points: points }, silent: true, z2: 10 }); this._lineGroup.add(polyline); this._polyline = polyline; return polyline; }, /** * @param {module:zrender/container/Group} group * @param {Array.>} stackedOnPoints * @param {Array.>} points * @private */ _newPolygon: function (points, stackedOnPoints) { var polygon = this._polygon; // Remove previous created polygon if (polygon) { this._lineGroup.remove(polygon); } polygon = new Polygon$1({ shape: { points: points, stackedOnPoints: stackedOnPoints }, silent: true }); this._lineGroup.add(polygon); this._polygon = polygon; return polygon; }, /** * @private */ // FIXME Two value axis _updateAnimation: function (data, stackedOnPoints, coordSys, api, step, valueOrigin) { var polyline = this._polyline; var polygon = this._polygon; var seriesModel = data.hostModel; var diff = lineAnimationDiff( this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin ); var current = diff.current; var stackedOnCurrent = diff.stackedOnCurrent; var next = diff.next; var stackedOnNext = diff.stackedOnNext; if (step) { // TODO If stacked series is not step current = turnPointsIntoStep(diff.current, coordSys, step); stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step); next = turnPointsIntoStep(diff.next, coordSys, step); stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step); } // `diff.current` is subset of `current` (which should be ensured by // turnPointsIntoStep), so points in `__points` can be updated when // points in `current` are update during animation. polyline.shape.__points = diff.current; polyline.shape.points = current; updateProps(polyline, { shape: { points: next } }, seriesModel); if (polygon) { polygon.setShape({ points: current, stackedOnPoints: stackedOnCurrent }); updateProps(polygon, { shape: { points: next, stackedOnPoints: stackedOnNext } }, seriesModel); } var updatedDataInfo = []; var diffStatus = diff.status; for (var i = 0; i < diffStatus.length; i++) { var cmd = diffStatus[i].cmd; if (cmd === '=') { var el = data.getItemGraphicEl(diffStatus[i].idx1); if (el) { updatedDataInfo.push({ el: el, ptIdx: i // Index of points }); } } } if (polyline.animators && polyline.animators.length) { polyline.animators[0].during(function () { for (var i = 0; i < updatedDataInfo.length; i++) { var el = updatedDataInfo[i].el; el.attr('position', polyline.shape.__points[updatedDataInfo[i].ptIdx]); } }); } }, remove: function (ecModel) { var group = this.group; var oldData = this._data; this._lineGroup.removeAll(); this._symbolDraw.remove(true); // Remove temporary created elements when highlighting oldData && oldData.eachItemGraphicEl(function (el, idx) { if (el.__temp) { group.remove(el); oldData.setItemGraphicEl(idx, null); } }); this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._data = null; } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) { // Encoding visual for all series include which is filtered for legend drawing return { seriesType: seriesType, // For legend. performRawSeries: true, reset: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var symbolType = seriesModel.get('symbol') || defaultSymbolType; var symbolSize = seriesModel.get('symbolSize'); var keepAspect = seriesModel.get('symbolKeepAspect'); data.setVisual({ legendSymbol: legendSymbol || symbolType, symbol: symbolType, symbolSize: symbolSize, symbolKeepAspect: keepAspect }); // Only visible series has each data be visual encoded if (ecModel.isSeriesFiltered(seriesModel)) { return; } var hasCallback = typeof symbolSize === 'function'; function dataEach(data, idx) { if (typeof symbolSize === 'function') { var rawValue = seriesModel.getRawValue(idx); // FIXME var params = seriesModel.getDataParams(idx); data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params)); } if (data.hasItemOption) { var itemModel = data.getItemModel(idx); var itemSymbolType = itemModel.getShallow('symbol', true); var itemSymbolSize = itemModel.getShallow('symbolSize', true); var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect',true); // If has item symbol if (itemSymbolType != null) { data.setItemVisual(idx, 'symbol', itemSymbolType); } if (itemSymbolSize != null) { // PENDING Transform symbolSize ? data.setItemVisual(idx, 'symbolSize', itemSymbolSize); } if (itemSymbolKeepAspect != null) { data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect); } } } return { dataEach: (data.hasItemOption || hasCallback) ? dataEach : null }; } }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var pointsLayout = function (seriesType) { return { seriesType: seriesType, plan: createRenderPlanner(), reset: function (seriesModel) { var data = seriesModel.getData(); var coordSys = seriesModel.coordinateSystem; var pipelineContext = seriesModel.pipelineContext; var isLargeRender = pipelineContext.large; if (!coordSys) { return; } var dims = map(coordSys.dimensions, function (dim) { return data.mapDimension(dim); }).slice(0, 2); var dimLen = dims.length; var stackResultDim = data.getCalculationInfo('stackResultDimension'); if (isDimensionStacked(data, dims[0] /*, dims[1]*/)) { dims[0] = stackResultDim; } if (isDimensionStacked(data, dims[1] /*, dims[0]*/)) { dims[1] = stackResultDim; } function progress(params, data) { var segCount = params.end - params.start; var points = isLargeRender && new Float32Array(segCount * dimLen); for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) { var point; if (dimLen === 1) { var x = data.get(dims[0], i); point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut); } else { var x = tmpIn[0] = data.get(dims[0], i); var y = tmpIn[1] = data.get(dims[1], i); // Also {Array.}, not undefined to avoid if...else... statement point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut); } if (isLargeRender) { points[offset++] = point ? point[0] : NaN; points[offset++] = point ? point[1] : NaN; } else { data.setItemLayout(i, (point && point.slice()) || [NaN, NaN]); } } isLargeRender && data.setLayout('symbolPoints', points); } return dimLen && {progress: progress}; } }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var samplers = { average: function (frame) { var sum = 0; var count = 0; for (var i = 0; i < frame.length; i++) { if (!isNaN(frame[i])) { sum += frame[i]; count++; } } // Return NaN if count is 0 return count === 0 ? NaN : sum / count; }, sum: function (frame) { var sum = 0; for (var i = 0; i < frame.length; i++) { // Ignore NaN sum += frame[i] || 0; } return sum; }, max: function (frame) { var max = -Infinity; for (var i = 0; i < frame.length; i++) { frame[i] > max && (max = frame[i]); } // NaN will cause illegal axis extent. return isFinite(max) ? max : NaN; }, min: function (frame) { var min = Infinity; for (var i = 0; i < frame.length; i++) { frame[i] < min && (min = frame[i]); } // NaN will cause illegal axis extent. return isFinite(min) ? min : NaN; }, // TODO // Median nearest: function (frame) { return frame[0]; } }; var indexSampler = function (frame, value) { return Math.round(frame.length / 2); }; var dataSample = function (seriesType) { return { seriesType: seriesType, modifyOutputEnd: true, reset: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var sampling = seriesModel.get('sampling'); var coordSys = seriesModel.coordinateSystem; // Only cartesian2d support down sampling if (coordSys.type === 'cartesian2d' && sampling) { var baseAxis = coordSys.getBaseAxis(); var valueAxis = coordSys.getOtherAxis(baseAxis); var extent = baseAxis.getExtent(); // Coordinste system has been resized var size = extent[1] - extent[0]; var rate = Math.round(data.count() / size); if (rate > 1) { var sampler; if (typeof sampling === 'string') { sampler = samplers[sampling]; } else if (typeof sampling === 'function') { sampler = sampling; } if (sampler) { // Only support sample the first dim mapped from value axis. seriesModel.setData(data.downSample( data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler )); } } } } }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Cartesian coordinate system * @module echarts/coord/Cartesian * */ function dimAxisMapper(dim) { return this._axes[dim]; } /** * @alias module:echarts/coord/Cartesian * @constructor */ var Cartesian = function (name) { this._axes = {}; this._dimList = []; /** * @type {string} */ this.name = name || ''; }; Cartesian.prototype = { constructor: Cartesian, type: 'cartesian', /** * Get axis * @param {number|string} dim * @return {module:echarts/coord/Cartesian~Axis} */ getAxis: function (dim) { return this._axes[dim]; }, /** * Get axes list * @return {Array.} */ getAxes: function () { return map(this._dimList, dimAxisMapper, this); }, /** * Get axes list by given scale type */ getAxesByScale: function (scaleType) { scaleType = scaleType.toLowerCase(); return filter( this.getAxes(), function (axis) { return axis.scale.type === scaleType; } ); }, /** * Add axis * @param {module:echarts/coord/Cartesian.Axis} */ addAxis: function (axis) { var dim = axis.dim; this._axes[dim] = axis; this._dimList.push(dim); }, /** * Convert data to coord in nd space * @param {Array.|Object.} val * @return {Array.|Object.} */ dataToCoord: function (val) { return this._dataCoordConvert(val, 'dataToCoord'); }, /** * Convert coord in nd space to data * @param {Array.|Object.} val * @return {Array.|Object.} */ coordToData: function (val) { return this._dataCoordConvert(val, 'coordToData'); }, _dataCoordConvert: function (input, method) { var dimList = this._dimList; var output = input instanceof Array ? [] : {}; for (var i = 0; i < dimList.length; i++) { var dim = dimList[i]; var axis = this._axes[dim]; output[dim] = axis[method](input[dim]); } return output; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function Cartesian2D(name) { Cartesian.call(this, name); } Cartesian2D.prototype = { constructor: Cartesian2D, type: 'cartesian2d', /** * @type {Array.} * @readOnly */ dimensions: ['x', 'y'], /** * Base axis will be used on stacking. * * @return {module:echarts/coord/cartesian/Axis2D} */ getBaseAxis: function () { return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAxis('x'); }, /** * If contain point * @param {Array.} point * @return {boolean} */ containPoint: function (point) { var axisX = this.getAxis('x'); var axisY = this.getAxis('y'); return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1])); }, /** * If contain data * @param {Array.} data * @return {boolean} */ containData: function (data) { return this.getAxis('x').containData(data[0]) && this.getAxis('y').containData(data[1]); }, /** * @param {Array.} data * @param {Array.} out * @return {Array.} */ dataToPoint: function (data, reserved, out) { var xAxis = this.getAxis('x'); var yAxis = this.getAxis('y'); out = out || []; out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(data[0])); out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(data[1])); return out; }, /** * @param {Array.} data * @param {Array.} out * @return {Array.} */ clampData: function (data, out) { var xScale = this.getAxis('x').scale; var yScale = this.getAxis('y').scale; var xAxisExtent = xScale.getExtent(); var yAxisExtent = yScale.getExtent(); var x = xScale.parse(data[0]); var y = yScale.parse(data[1]); out = out || []; out[0] = Math.min( Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]) ); out[1] = Math.min( Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]) ); return out; }, /** * @param {Array.} point * @param {Array.} out * @return {Array.} */ pointToData: function (point, out) { var xAxis = this.getAxis('x'); var yAxis = this.getAxis('y'); out = out || []; out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0])); out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1])); return out; }, /** * Get other axis * @param {module:echarts/coord/cartesian/Axis2D} axis */ getOtherAxis: function (axis) { return this.getAxis(axis.dim === 'x' ? 'y' : 'x'); } }; inherits(Cartesian2D, Cartesian); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Extend axis 2d * @constructor module:echarts/coord/cartesian/Axis2D * @extends {module:echarts/coord/cartesian/Axis} * @param {string} dim * @param {*} scale * @param {Array.} coordExtent * @param {string} axisType * @param {string} position */ var Axis2D = function (dim, scale, coordExtent, axisType, position) { Axis.call(this, dim, scale, coordExtent); /** * Axis type * - 'category' * - 'value' * - 'time' * - 'log' * @type {string} */ this.type = axisType || 'value'; /** * Axis position * - 'top' * - 'bottom' * - 'left' * - 'right' */ this.position = position || 'bottom'; }; Axis2D.prototype = { constructor: Axis2D, /** * Index of axis, can be used as key */ index: 0, /** * Implemented in . * @return {Array.} * If not on zero of other axis, return null/undefined. * If no axes, return an empty array. */ getAxesOnZeroOf: null, /** * Axis model * @param {module:echarts/coord/cartesian/AxisModel} */ model: null, isHorizontal: function () { var position = this.position; return position === 'top' || position === 'bottom'; }, /** * Each item cooresponds to this.getExtent(), which * means globalExtent[0] may greater than globalExtent[1], * unless `asc` is input. * * @param {boolean} [asc] * @return {Array.} */ getGlobalExtent: function (asc) { var ret = this.getExtent(); ret[0] = this.toGlobalCoord(ret[0]); ret[1] = this.toGlobalCoord(ret[1]); asc && ret[0] > ret[1] && ret.reverse(); return ret; }, getOtherAxis: function () { this.grid.getOtherAxis(); }, /** * @override */ pointToData: function (point, clamp) { return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp); }, /** * Transform global coord to local coord, * i.e. var localCoord = axis.toLocalCoord(80); * designate by module:echarts/coord/cartesian/Grid. * @type {Function} */ toLocalCoord: null, /** * Transform global coord to local coord, * i.e. var globalCoord = axis.toLocalCoord(40); * designate by module:echarts/coord/cartesian/Grid. * @type {Function} */ toGlobalCoord: null }; inherits(Axis2D, Axis); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var defaultOption = { show: true, zlevel: 0, z: 0, // Inverse the axis. inverse: false, // Axis name displayed. name: '', // 'start' | 'middle' | 'end' nameLocation: 'end', // By degree. By defualt auto rotate by nameLocation. nameRotate: null, nameTruncate: { maxWidth: null, ellipsis: '...', placeholder: '.' }, // Use global text style by default. nameTextStyle: {}, // The gap between axisName and axisLine. nameGap: 15, // Default `false` to support tooltip. silent: false, // Default `false` to avoid legacy user event listener fail. triggerEvent: false, tooltip: { show: false }, axisPointer: {}, axisLine: { show: true, onZero: true, onZeroAxisIndex: null, lineStyle: { color: '#333', width: 1, type: 'solid' }, // The arrow at both ends the the axis. symbol: ['none', 'none'], symbolSize: [10, 15] }, axisTick: { show: true, // Whether axisTick is inside the grid or outside the grid. inside: false, // The length of axisTick. length: 5, lineStyle: { width: 1 } }, axisLabel: { show: true, // Whether axisLabel is inside the grid or outside the grid. inside: false, rotate: 0, // true | false | null/undefined (auto) showMinLabel: null, // true | false | null/undefined (auto) showMaxLabel: null, margin: 8, // formatter: null, fontSize: 12 }, splitLine: { show: true, lineStyle: { color: ['#ccc'], width: 1, type: 'solid' } }, splitArea: { show: false, areaStyle: { color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] } } }; var axisDefault = {}; axisDefault.categoryAxis = merge({ // The gap at both ends of the axis. For categoryAxis, boolean. boundaryGap: true, // Set false to faster category collection. // Only usefull in the case like: category is // ['2012-01-01', '2012-01-02', ...], where the input // data has been ensured not duplicate and is large data. // null means "auto": // if axis.data provided, do not deduplication, // else do deduplication. deduplication: null, // splitArea: { // show: false // }, splitLine: { show: false }, axisTick: { // If tick is align with label when boundaryGap is true alignWithLabel: false, interval: 'auto' }, axisLabel: { interval: 'auto' } }, defaultOption); axisDefault.valueAxis = merge({ // The gap at both ends of the axis. For value axis, [GAP, GAP], where // `GAP` can be an absolute pixel number (like `35`), or percent (like `'30%'`) boundaryGap: [0, 0], // TODO // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60] // Min value of the axis. can be: // + a number // + 'dataMin': use the min value in data. // + null/undefined: auto decide min value (consider pretty look and boundaryGap). // min: null, // Max value of the axis. can be: // + a number // + 'dataMax': use the max value in data. // + null/undefined: auto decide max value (consider pretty look and boundaryGap). // max: null, // Readonly prop, specifies start value of the range when using data zoom. // rangeStart: null // Readonly prop, specifies end value of the range when using data zoom. // rangeEnd: null // Optional value can be: // + `false`: always include value 0. // + `true`: the extent do not consider value 0. // scale: false, // AxisTick and axisLabel and splitLine are caculated based on splitNumber. splitNumber: 5 // Interval specifies the span of the ticks is mandatorily. // interval: null // Specify min interval when auto calculate tick interval. // minInterval: null // Specify max interval when auto calculate tick interval. // maxInterval: null }, defaultOption); axisDefault.timeAxis = defaults({ scale: true, min: 'dataMin', max: 'dataMax' }, axisDefault.valueAxis); axisDefault.logAxis = defaults({ scale: true, logBase: 10 }, axisDefault.valueAxis); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // FIXME axisType is fixed ? var AXIS_TYPES = ['value', 'category', 'time', 'log']; /** * Generate sub axis model class * @param {string} axisName 'x' 'y' 'radius' 'angle' 'parallel' * @param {module:echarts/model/Component} BaseAxisModelClass * @param {Function} axisTypeDefaulter * @param {Object} [extraDefaultOption] */ var axisModelCreator = function (axisName, BaseAxisModelClass, axisTypeDefaulter, extraDefaultOption) { each$1(AXIS_TYPES, function (axisType) { BaseAxisModelClass.extend({ /** * @readOnly */ type: axisName + 'Axis.' + axisType, mergeDefaultAndTheme: function (option, ecModel) { var layoutMode = this.layoutMode; var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; var themeModel = ecModel.getTheme(); merge(option, themeModel.get(axisType + 'Axis')); merge(option, this.getDefaultOption()); option.type = axisTypeDefaulter(axisName, option); if (layoutMode) { mergeLayoutParam(option, inputPositionParams, layoutMode); } }, /** * @override */ optionUpdated: function () { var thisOption = this.option; if (thisOption.type === 'category') { this.__ordinalMeta = OrdinalMeta.createByAxisModel(this); } }, /** * Should not be called before all of 'getInitailData' finished. * Because categories are collected during initializing data. */ getCategories: function (rawData) { var option = this.option; // FIXME // warning if called before all of 'getInitailData' finished. if (option.type === 'category') { if (rawData) { return option.data; } return this.__ordinalMeta.categories; } }, getOrdinalMeta: function () { return this.__ordinalMeta; }, defaultOption: mergeAll( [ {}, axisDefault[axisType + 'Axis'], extraDefaultOption ], true ) }); }); ComponentModel.registerSubTypeDefaulter( axisName + 'Axis', curry(axisTypeDefaulter, axisName) ); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var AxisModel = ComponentModel.extend({ type: 'cartesian2dAxis', /** * @type {module:echarts/coord/cartesian/Axis2D} */ axis: null, /** * @override */ init: function () { AxisModel.superApply(this, 'init', arguments); this.resetRange(); }, /** * @override */ mergeOption: function () { AxisModel.superApply(this, 'mergeOption', arguments); this.resetRange(); }, /** * @override */ restoreData: function () { AxisModel.superApply(this, 'restoreData', arguments); this.resetRange(); }, /** * @override * @return {module:echarts/model/Component} */ getCoordSysModel: function () { return this.ecModel.queryComponents({ mainType: 'grid', index: this.option.gridIndex, id: this.option.gridId })[0]; } }); function getAxisType(axisDim, option) { // Default axis with data is category axis return option.type || (option.data ? 'category' : 'value'); } merge(AxisModel.prototype, axisModelCommonMixin); var extraOption = { // gridIndex: 0, // gridId: '', // Offset is for multiple axis on the same position offset: 0 }; axisModelCreator('x', AxisModel, getAxisType, extraOption); axisModelCreator('y', AxisModel, getAxisType, extraOption); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Grid 是在有直角坐标系的时候必须要存在的 // 所以这里也要被 Cartesian2D 依赖 ComponentModel.extend({ type: 'grid', dependencies: ['xAxis', 'yAxis'], layoutMode: 'box', /** * @type {module:echarts/coord/cartesian/Grid} */ coordinateSystem: null, defaultOption: { show: false, zlevel: 0, z: 0, left: '10%', top: 60, right: '10%', bottom: 60, // If grid size contain label containLabel: false, // width: {totalWidth} - left - right, // height: {totalHeight} - top - bottom, backgroundColor: 'rgba(0,0,0,0)', borderWidth: 1, borderColor: '#ccc' } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Grid is a region which contains at most 4 cartesian systems * * TODO Default cartesian */ // Depends on GridModel, AxisModel, which performs preprocess. /** * Check if the axis is used in the specified grid * @inner */ function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) { return axisModel.getCoordSysModel() === gridModel; } function Grid(gridModel, ecModel, api) { /** * @type {Object.} * @private */ this._coordsMap = {}; /** * @type {Array.} * @private */ this._coordsList = []; /** * @type {Object.} * @private */ this._axesMap = {}; /** * @type {Array.} * @private */ this._axesList = []; this._initCartesian(gridModel, ecModel, api); this.model = gridModel; } var gridProto = Grid.prototype; gridProto.type = 'grid'; gridProto.axisPointerEnabled = true; gridProto.getRect = function () { return this._rect; }; gridProto.update = function (ecModel, api) { var axesMap = this._axesMap; this._updateScale(ecModel, this.model); each$1(axesMap.x, function (xAxis) { niceScaleExtent(xAxis.scale, xAxis.model); }); each$1(axesMap.y, function (yAxis) { niceScaleExtent(yAxis.scale, yAxis.model); }); each$1(axesMap.x, function (xAxis) { fixAxisOnZero(axesMap, 'y', xAxis); }); each$1(axesMap.y, function (yAxis) { fixAxisOnZero(axesMap, 'x', yAxis); }); // Resize again if containLabel is enabled // FIXME It may cause getting wrong grid size in data processing stage this.resize(this.model, api); }; function fixAxisOnZero(axesMap, otherAxisDim, axis) { axis.getAxesOnZeroOf = function () { // TODO: onZero of multiple axes. return otherAxis ? [otherAxis] : []; }; // onZero can not be enabled in these two situations: // 1. When any other axis is a category axis. // 2. When no axis is cross 0 point. var otherAxes = axesMap[otherAxisDim]; var otherAxis; var axisModel = axis.model; var onZero = axisModel.get('axisLine.onZero'); var onZeroAxisIndex = axisModel.get('axisLine.onZeroAxisIndex'); if (!onZero) { return; } // If target axis is specified. if (onZeroAxisIndex != null) { if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) { otherAxis = otherAxes[onZeroAxisIndex]; } return; } // Find the first available other axis. for (var idx in otherAxes) { if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx])) { otherAxis = otherAxes[idx]; break; } } } function canOnZeroToAxis(axis) { return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis); } /** * Resize the grid * @param {module:echarts/coord/cartesian/GridModel} gridModel * @param {module:echarts/ExtensionAPI} api */ gridProto.resize = function (gridModel, api, ignoreContainLabel) { var gridRect = getLayoutRect( gridModel.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() }); this._rect = gridRect; var axesList = this._axesList; adjustAxes(); // Minus label size if (!ignoreContainLabel && gridModel.get('containLabel')) { each$1(axesList, function (axis) { if (!axis.model.get('axisLabel.inside')) { var labelUnionRect = estimateLabelUnionRect(axis); if (labelUnionRect) { var dim = axis.isHorizontal() ? 'height' : 'width'; var margin = axis.model.get('axisLabel.margin'); gridRect[dim] -= labelUnionRect[dim] + margin; if (axis.position === 'top') { gridRect.y += labelUnionRect.height + margin; } else if (axis.position === 'left') { gridRect.x += labelUnionRect.width + margin; } } } }); adjustAxes(); } function adjustAxes() { each$1(axesList, function (axis) { var isHorizontal = axis.isHorizontal(); var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height]; var idx = axis.inverse ? 1 : 0; axis.setExtent(extent[idx], extent[1 - idx]); updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y); }); } }; /** * @param {string} axisType * @param {number} [axisIndex] */ gridProto.getAxis = function (axisType, axisIndex) { var axesMapOnDim = this._axesMap[axisType]; if (axesMapOnDim != null) { if (axisIndex == null) { // Find first axis for (var name in axesMapOnDim) { if (axesMapOnDim.hasOwnProperty(name)) { return axesMapOnDim[name]; } } } return axesMapOnDim[axisIndex]; } }; /** * @return {Array.} */ gridProto.getAxes = function () { return this._axesList.slice(); }; /** * Usage: * grid.getCartesian(xAxisIndex, yAxisIndex); * grid.getCartesian(xAxisIndex); * grid.getCartesian(null, yAxisIndex); * grid.getCartesian({xAxisIndex: ..., yAxisIndex: ...}); * * @param {number|Object} [xAxisIndex] * @param {number} [yAxisIndex] */ gridProto.getCartesian = function (xAxisIndex, yAxisIndex) { if (xAxisIndex != null && yAxisIndex != null) { var key = 'x' + xAxisIndex + 'y' + yAxisIndex; return this._coordsMap[key]; } if (isObject$1(xAxisIndex)) { yAxisIndex = xAxisIndex.yAxisIndex; xAxisIndex = xAxisIndex.xAxisIndex; } // When only xAxisIndex or yAxisIndex given, find its first cartesian. for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) { if (coordList[i].getAxis('x').index === xAxisIndex || coordList[i].getAxis('y').index === yAxisIndex ) { return coordList[i]; } } }; gridProto.getCartesians = function () { return this._coordsList.slice(); }; /** * @implements * see {module:echarts/CoodinateSystem} */ gridProto.convertToPixel = function (ecModel, finder, value) { var target = this._findConvertTarget(ecModel, finder); return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null; }; /** * @implements * see {module:echarts/CoodinateSystem} */ gridProto.convertFromPixel = function (ecModel, finder, value) { var target = this._findConvertTarget(ecModel, finder); return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null; }; /** * @inner */ gridProto._findConvertTarget = function (ecModel, finder) { var seriesModel = finder.seriesModel; var xAxisModel = finder.xAxisModel || (seriesModel && seriesModel.getReferringComponents('xAxis')[0]); var yAxisModel = finder.yAxisModel || (seriesModel && seriesModel.getReferringComponents('yAxis')[0]); var gridModel = finder.gridModel; var coordsList = this._coordsList; var cartesian; var axis; if (seriesModel) { cartesian = seriesModel.coordinateSystem; indexOf(coordsList, cartesian) < 0 && (cartesian = null); } else if (xAxisModel && yAxisModel) { cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); } else if (xAxisModel) { axis = this.getAxis('x', xAxisModel.componentIndex); } else if (yAxisModel) { axis = this.getAxis('y', yAxisModel.componentIndex); } // Lowest priority. else if (gridModel) { var grid = gridModel.coordinateSystem; if (grid === this) { cartesian = this._coordsList[0]; } } return {cartesian: cartesian, axis: axis}; }; /** * @implements * see {module:echarts/CoodinateSystem} */ gridProto.containPoint = function (point) { var coord = this._coordsList[0]; if (coord) { return coord.containPoint(point); } }; /** * Initialize cartesian coordinate systems * @private */ gridProto._initCartesian = function (gridModel, ecModel, api) { var axisPositionUsed = { left: false, right: false, top: false, bottom: false }; var axesMap = { x: {}, y: {} }; var axesCount = { x: 0, y: 0 }; /// Create axis ecModel.eachComponent('xAxis', createAxisCreator('x'), this); ecModel.eachComponent('yAxis', createAxisCreator('y'), this); if (!axesCount.x || !axesCount.y) { // Roll back when there no either x or y axis this._axesMap = {}; this._axesList = []; return; } this._axesMap = axesMap; /// Create cartesian2d each$1(axesMap.x, function (xAxis, xAxisIndex) { each$1(axesMap.y, function (yAxis, yAxisIndex) { var key = 'x' + xAxisIndex + 'y' + yAxisIndex; var cartesian = new Cartesian2D(key); cartesian.grid = this; cartesian.model = gridModel; this._coordsMap[key] = cartesian; this._coordsList.push(cartesian); cartesian.addAxis(xAxis); cartesian.addAxis(yAxis); }, this); }, this); function createAxisCreator(axisType) { return function (axisModel, idx) { if (!isAxisUsedInTheGrid(axisModel, gridModel, ecModel)) { return; } var axisPosition = axisModel.get('position'); if (axisType === 'x') { // Fix position if (axisPosition !== 'top' && axisPosition !== 'bottom') { // Default bottom of X axisPosition = 'bottom'; if (axisPositionUsed[axisPosition]) { axisPosition = axisPosition === 'top' ? 'bottom' : 'top'; } } } else { // Fix position if (axisPosition !== 'left' && axisPosition !== 'right') { // Default left of Y axisPosition = 'left'; if (axisPositionUsed[axisPosition]) { axisPosition = axisPosition === 'left' ? 'right' : 'left'; } } } axisPositionUsed[axisPosition] = true; var axis = new Axis2D( axisType, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition ); var isCategory = axis.type === 'category'; axis.onBand = isCategory && axisModel.get('boundaryGap'); axis.inverse = axisModel.get('inverse'); // Inject axis into axisModel axisModel.axis = axis; // Inject axisModel into axis axis.model = axisModel; // Inject grid info axis axis.grid = this; // Index of axis, can be used as key axis.index = idx; this._axesList.push(axis); axesMap[axisType][idx] = axis; axesCount[axisType]++; }; } }; /** * Update cartesian properties from series * @param {module:echarts/model/Option} option * @private */ gridProto._updateScale = function (ecModel, gridModel) { // Reset scale each$1(this._axesList, function (axis) { axis.scale.setExtent(Infinity, -Infinity); }); ecModel.eachSeries(function (seriesModel) { if (isCartesian2D(seriesModel)) { var axesModels = findAxesModels(seriesModel, ecModel); var xAxisModel = axesModels[0]; var yAxisModel = axesModels[1]; if (!isAxisUsedInTheGrid(xAxisModel, gridModel, ecModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel, ecModel) ) { return; } var cartesian = this.getCartesian( xAxisModel.componentIndex, yAxisModel.componentIndex ); var data = seriesModel.getData(); var xAxis = cartesian.getAxis('x'); var yAxis = cartesian.getAxis('y'); if (data.type === 'list') { unionExtent(data, xAxis, seriesModel); unionExtent(data, yAxis, seriesModel); } } }, this); function unionExtent(data, axis, seriesModel) { each$1(data.mapDimension(axis.dim, true), function (dim) { axis.scale.unionExtentFromData( // For example, the extent of the orginal dimension // is [0.1, 0.5], the extent of the `stackResultDimension` // is [7, 9], the final extent should not include [0.1, 0.5]. data, getStackedDimension(data, dim) ); }); } }; /** * @param {string} [dim] 'x' or 'y' or 'auto' or null/undefined * @return {Object} {baseAxes: [], otherAxes: []} */ gridProto.getTooltipAxes = function (dim) { var baseAxes = []; var otherAxes = []; each$1(this.getCartesians(), function (cartesian) { var baseAxis = (dim != null && dim !== 'auto') ? cartesian.getAxis(dim) : cartesian.getBaseAxis(); var otherAxis = cartesian.getOtherAxis(baseAxis); indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis); indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis); }); return {baseAxes: baseAxes, otherAxes: otherAxes}; }; /** * @inner */ function updateAxisTransform(axis, coordBase) { var axisExtent = axis.getExtent(); var axisExtentSum = axisExtent[0] + axisExtent[1]; // Fast transform axis.toGlobalCoord = axis.dim === 'x' ? function (coord) { return coord + coordBase; } : function (coord) { return axisExtentSum - coord + coordBase; }; axis.toLocalCoord = axis.dim === 'x' ? function (coord) { return coord - coordBase; } : function (coord) { return axisExtentSum - coord + coordBase; }; } var axesTypes = ['xAxis', 'yAxis']; /** * @inner */ function findAxesModels(seriesModel, ecModel) { return map(axesTypes, function (axisType) { var axisModel = seriesModel.getReferringComponents(axisType)[0]; if (__DEV__) { if (!axisModel) { throw new Error(axisType + ' "' + retrieve( seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0 ) + '" not found'); } } return axisModel; }); } /** * @inner */ function isCartesian2D(seriesModel) { return seriesModel.get('coordinateSystem') === 'cartesian2d'; } Grid.create = function (ecModel, api) { var grids = []; ecModel.eachComponent('grid', function (gridModel, idx) { var grid = new Grid(gridModel, ecModel, api); grid.name = 'grid_' + idx; // dataSampling requires axis extent, so resize // should be performed in create stage. grid.resize(gridModel, api, true); gridModel.coordinateSystem = grid; grids.push(grid); }); // Inject the coordinateSystems into seriesModel ecModel.eachSeries(function (seriesModel) { if (!isCartesian2D(seriesModel)) { return; } var axesModels = findAxesModels(seriesModel, ecModel); var xAxisModel = axesModels[0]; var yAxisModel = axesModels[1]; var gridModel = xAxisModel.getCoordSysModel(); if (__DEV__) { if (!gridModel) { throw new Error( 'Grid "' + retrieve( xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0 ) + '" not found' ); } if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) { throw new Error('xAxis and yAxis must use the same grid'); } } var grid = gridModel.coordinateSystem; seriesModel.coordinateSystem = grid.getCartesian( xAxisModel.componentIndex, yAxisModel.componentIndex ); }); return grids; }; // For deciding which dimensions to use when creating list data Grid.dimensions = Grid.prototype.dimensions = Cartesian2D.prototype.dimensions; CoordinateSystemManager.register('cartesian2d', Grid); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var PI$2 = Math.PI; function makeAxisEventDataBase(axisModel) { var eventData = { componentType: axisModel.mainType }; eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex; return eventData; } /** * A final axis is translated and rotated from a "standard axis". * So opt.position and opt.rotation is required. * * A standard axis is and axis from [0, 0] to [0, axisExtent[1]], * for example: (0, 0) ------------> (0, 50) * * nameDirection or tickDirection or labelDirection is 1 means tick * or label is below the standard axis, whereas is -1 means above * the standard axis. labelOffset means offset between label and axis, * which is useful when 'onZero', where axisLabel is in the grid and * label in outside grid. * * Tips: like always, * positive rotation represents anticlockwise, and negative rotation * represents clockwise. * The direction of position coordinate is the same as the direction * of screen coordinate. * * Do not need to consider axis 'inverse', which is auto processed by * axis extent. * * @param {module:zrender/container/Group} group * @param {Object} axisModel * @param {Object} opt Standard axis parameters. * @param {Array.} opt.position [x, y] * @param {number} opt.rotation by radian * @param {number} [opt.nameDirection=1] 1 or -1 Used when nameLocation is 'middle' or 'center'. * @param {number} [opt.tickDirection=1] 1 or -1 * @param {number} [opt.labelDirection=1] 1 or -1 * @param {number} [opt.labelOffset=0] Usefull when onZero. * @param {string} [opt.axisLabelShow] default get from axisModel. * @param {string} [opt.axisName] default get from axisModel. * @param {number} [opt.axisNameAvailableWidth] * @param {number} [opt.labelRotate] by degree, default get from axisModel. * @param {number} [opt.strokeContainThreshold] Default label interval when label * @param {number} [opt.nameTruncateMaxWidth] */ var AxisBuilder = function (axisModel, opt) { /** * @readOnly */ this.opt = opt; /** * @readOnly */ this.axisModel = axisModel; // Default value defaults( opt, { labelOffset: 0, nameDirection: 1, tickDirection: 1, labelDirection: 1, silent: true } ); /** * @readOnly */ this.group = new Group(); // FIXME Not use a seperate text group? var dumbGroup = new Group({ position: opt.position.slice(), rotation: opt.rotation }); // this.group.add(dumbGroup); // this._dumbGroup = dumbGroup; dumbGroup.updateTransform(); this._transform = dumbGroup.transform; this._dumbGroup = dumbGroup; }; AxisBuilder.prototype = { constructor: AxisBuilder, hasBuilder: function (name) { return !!builders[name]; }, add: function (name) { builders[name].call(this); }, getGroup: function () { return this.group; } }; var builders = { /** * @private */ axisLine: function () { var opt = this.opt; var axisModel = this.axisModel; if (!axisModel.get('axisLine.show')) { return; } var extent = this.axisModel.axis.getExtent(); var matrix = this._transform; var pt1 = [extent[0], 0]; var pt2 = [extent[1], 0]; if (matrix) { applyTransform(pt1, pt1, matrix); applyTransform(pt2, pt2, matrix); } var lineStyle = extend( { lineCap: 'round' }, axisModel.getModel('axisLine.lineStyle').getLineStyle() ); this.group.add(new Line(subPixelOptimizeLine({ // Id for animation anid: 'line', shape: { x1: pt1[0], y1: pt1[1], x2: pt2[0], y2: pt2[1] }, style: lineStyle, strokeContainThreshold: opt.strokeContainThreshold || 5, silent: true, z2: 1 }))); var arrows = axisModel.get('axisLine.symbol'); var arrowSize = axisModel.get('axisLine.symbolSize'); var arrowOffset = axisModel.get('axisLine.symbolOffset') || 0; if (typeof arrowOffset === 'number') { arrowOffset = [arrowOffset, arrowOffset]; } if (arrows != null) { if (typeof arrows === 'string') { // Use the same arrow for start and end point arrows = [arrows, arrows]; } if (typeof arrowSize === 'string' || typeof arrowSize === 'number' ) { // Use the same size for width and height arrowSize = [arrowSize, arrowSize]; } var symbolWidth = arrowSize[0]; var symbolHeight = arrowSize[1]; each$1([{ rotate: opt.rotation + Math.PI / 2, offset: arrowOffset[0], r: 0 }, { rotate: opt.rotation - Math.PI / 2, offset: arrowOffset[1], r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0]) + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1])) }], function (point, index) { if (arrows[index] !== 'none' && arrows[index] != null) { var symbol = createSymbol( arrows[index], -symbolWidth / 2, -symbolHeight / 2, symbolWidth, symbolHeight, lineStyle.stroke, true ); // Calculate arrow position with offset var r = point.r + point.offset; var pos = [ pt1[0] + r * Math.cos(opt.rotation), pt1[1] - r * Math.sin(opt.rotation) ]; symbol.attr({ rotation: point.rotate, position: pos, silent: true }); this.group.add(symbol); } }, this); } }, /** * @private */ axisTickLabel: function () { var axisModel = this.axisModel; var opt = this.opt; var tickEls = buildAxisTick(this, axisModel, opt); var labelEls = buildAxisLabel(this, axisModel, opt); fixMinMaxLabelShow(axisModel, labelEls, tickEls); }, /** * @private */ axisName: function () { var opt = this.opt; var axisModel = this.axisModel; var name = retrieve(opt.axisName, axisModel.get('name')); if (!name) { return; } var nameLocation = axisModel.get('nameLocation'); var nameDirection = opt.nameDirection; var textStyleModel = axisModel.getModel('nameTextStyle'); var gap = axisModel.get('nameGap') || 0; var extent = this.axisModel.axis.getExtent(); var gapSignal = extent[0] > extent[1] ? -1 : 1; var pos = [ nameLocation === 'start' ? extent[0] - gapSignal * gap : nameLocation === 'end' ? extent[1] + gapSignal * gap : (extent[0] + extent[1]) / 2, // 'middle' // Reuse labelOffset. isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0 ]; var labelLayout; var nameRotation = axisModel.get('nameRotate'); if (nameRotation != null) { nameRotation = nameRotation * PI$2 / 180; // To radian. } var axisNameAvailableWidth; if (isNameLocationCenter(nameLocation)) { labelLayout = innerTextLayout( opt.rotation, nameRotation != null ? nameRotation : opt.rotation, // Adapt to axis. nameDirection ); } else { labelLayout = endTextLayout( opt, nameLocation, nameRotation || 0, extent ); axisNameAvailableWidth = opt.axisNameAvailableWidth; if (axisNameAvailableWidth != null) { axisNameAvailableWidth = Math.abs( axisNameAvailableWidth / Math.sin(labelLayout.rotation) ); !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null); } } var textFont = textStyleModel.getFont(); var truncateOpt = axisModel.get('nameTruncate', true) || {}; var ellipsis = truncateOpt.ellipsis; var maxWidth = retrieve( opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth ); // FIXME // truncate rich text? (consider performance) var truncatedText = (ellipsis != null && maxWidth != null) ? truncateText$1( name, maxWidth, textFont, ellipsis, {minChar: 2, placeholder: truncateOpt.placeholder} ) : name; var tooltipOpt = axisModel.get('tooltip', true); var mainType = axisModel.mainType; var formatterParams = { componentType: mainType, name: name, $vars: ['name'] }; formatterParams[mainType + 'Index'] = axisModel.componentIndex; var textEl = new Text({ // Id for animation anid: 'name', __fullText: name, __truncatedText: truncatedText, position: pos, rotation: labelLayout.rotation, silent: isSilent(axisModel), z2: 1, tooltip: (tooltipOpt && tooltipOpt.show) ? extend({ content: name, formatter: function () { return name; }, formatterParams: formatterParams }, tooltipOpt) : null }); setTextStyle(textEl.style, textStyleModel, { text: truncatedText, textFont: textFont, textFill: textStyleModel.getTextColor() || axisModel.get('axisLine.lineStyle.color'), textAlign: labelLayout.textAlign, textVerticalAlign: labelLayout.textVerticalAlign }); if (axisModel.get('triggerEvent')) { textEl.eventData = makeAxisEventDataBase(axisModel); textEl.eventData.targetType = 'axisName'; textEl.eventData.name = name; } // FIXME this._dumbGroup.add(textEl); textEl.updateTransform(); this.group.add(textEl); textEl.decomposeTransform(); } }; /** * @public * @static * @param {Object} opt * @param {number} axisRotation in radian * @param {number} textRotation in radian * @param {number} direction * @return {Object} { * rotation, // according to axis * textAlign, * textVerticalAlign * } */ var innerTextLayout = AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) { var rotationDiff = remRadian(textRotation - axisRotation); var textAlign; var textVerticalAlign; if (isRadianAroundZero(rotationDiff)) { // Label is parallel with axis line. textVerticalAlign = direction > 0 ? 'top' : 'bottom'; textAlign = 'center'; } else if (isRadianAroundZero(rotationDiff - PI$2)) { // Label is inverse parallel with axis line. textVerticalAlign = direction > 0 ? 'bottom' : 'top'; textAlign = 'center'; } else { textVerticalAlign = 'middle'; if (rotationDiff > 0 && rotationDiff < PI$2) { textAlign = direction > 0 ? 'right' : 'left'; } else { textAlign = direction > 0 ? 'left' : 'right'; } } return { rotation: rotationDiff, textAlign: textAlign, textVerticalAlign: textVerticalAlign }; }; function endTextLayout(opt, textPosition, textRotate, extent) { var rotationDiff = remRadian(textRotate - opt.rotation); var textAlign; var textVerticalAlign; var inverse = extent[0] > extent[1]; var onLeft = (textPosition === 'start' && !inverse) || (textPosition !== 'start' && inverse); if (isRadianAroundZero(rotationDiff - PI$2 / 2)) { textVerticalAlign = onLeft ? 'bottom' : 'top'; textAlign = 'center'; } else if (isRadianAroundZero(rotationDiff - PI$2 * 1.5)) { textVerticalAlign = onLeft ? 'top' : 'bottom'; textAlign = 'center'; } else { textVerticalAlign = 'middle'; if (rotationDiff < PI$2 * 1.5 && rotationDiff > PI$2 / 2) { textAlign = onLeft ? 'left' : 'right'; } else { textAlign = onLeft ? 'right' : 'left'; } } return { rotation: rotationDiff, textAlign: textAlign, textVerticalAlign: textVerticalAlign }; } function isSilent(axisModel) { var tooltipOpt = axisModel.get('tooltip'); return axisModel.get('silent') // Consider mouse cursor, add these restrictions. || !( axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show) ); } function fixMinMaxLabelShow(axisModel, labelEls, tickEls) { // If min or max are user set, we need to check // If the tick on min(max) are overlap on their neighbour tick // If they are overlapped, we need to hide the min(max) tick label var showMinLabel = axisModel.get('axisLabel.showMinLabel'); var showMaxLabel = axisModel.get('axisLabel.showMaxLabel'); // FIXME // Have not consider onBand yet, where tick els is more than label els. labelEls = labelEls || []; tickEls = tickEls || []; var firstLabel = labelEls[0]; var nextLabel = labelEls[1]; var lastLabel = labelEls[labelEls.length - 1]; var prevLabel = labelEls[labelEls.length - 2]; var firstTick = tickEls[0]; var nextTick = tickEls[1]; var lastTick = tickEls[tickEls.length - 1]; var prevTick = tickEls[tickEls.length - 2]; if (showMinLabel === false) { ignoreEl(firstLabel); ignoreEl(firstTick); } else if (isTwoLabelOverlapped(firstLabel, nextLabel)) { if (showMinLabel) { ignoreEl(nextLabel); ignoreEl(nextTick); } else { ignoreEl(firstLabel); ignoreEl(firstTick); } } if (showMaxLabel === false) { ignoreEl(lastLabel); ignoreEl(lastTick); } else if (isTwoLabelOverlapped(prevLabel, lastLabel)) { if (showMaxLabel) { ignoreEl(prevLabel); ignoreEl(prevTick); } else { ignoreEl(lastLabel); ignoreEl(lastTick); } } } function ignoreEl(el) { el && (el.ignore = true); } function isTwoLabelOverlapped(current, next, labelLayout) { // current and next has the same rotation. var firstRect = current && current.getBoundingRect().clone(); var nextRect = next && next.getBoundingRect().clone(); if (!firstRect || !nextRect) { return; } // When checking intersect of two rotated labels, we use mRotationBack // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`. var mRotationBack = identity([]); rotate(mRotationBack, mRotationBack, -current.rotation); firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform())); nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform())); return firstRect.intersect(nextRect); } function isNameLocationCenter(nameLocation) { return nameLocation === 'middle' || nameLocation === 'center'; } function buildAxisTick(axisBuilder, axisModel, opt) { var axis = axisModel.axis; if (!axisModel.get('axisTick.show') || axis.scale.isBlank()) { return; } var tickModel = axisModel.getModel('axisTick'); var lineStyleModel = tickModel.getModel('lineStyle'); var tickLen = tickModel.get('length'); var ticksCoords = axis.getTicksCoords(); var pt1 = []; var pt2 = []; var matrix = axisBuilder._transform; var tickEls = []; for (var i = 0; i < ticksCoords.length; i++) { var tickCoord = ticksCoords[i].coord; pt1[0] = tickCoord; pt1[1] = 0; pt2[0] = tickCoord; pt2[1] = opt.tickDirection * tickLen; if (matrix) { applyTransform(pt1, pt1, matrix); applyTransform(pt2, pt2, matrix); } // Tick line, Not use group transform to have better line draw var tickEl = new Line(subPixelOptimizeLine({ // Id for animation anid: 'tick_' + ticksCoords[i].tickValue, shape: { x1: pt1[0], y1: pt1[1], x2: pt2[0], y2: pt2[1] }, style: defaults( lineStyleModel.getLineStyle(), { stroke: axisModel.get('axisLine.lineStyle.color') } ), z2: 2, silent: true })); axisBuilder.group.add(tickEl); tickEls.push(tickEl); } return tickEls; } function buildAxisLabel(axisBuilder, axisModel, opt) { var axis = axisModel.axis; var show = retrieve(opt.axisLabelShow, axisModel.get('axisLabel.show')); if (!show || axis.scale.isBlank()) { return; } var labelModel = axisModel.getModel('axisLabel'); var labelMargin = labelModel.get('margin'); var labels = axis.getViewLabels(); // Special label rotate. var labelRotation = ( retrieve(opt.labelRotate, labelModel.get('rotate')) || 0 ) * PI$2 / 180; var labelLayout = innerTextLayout(opt.rotation, labelRotation, opt.labelDirection); var rawCategoryData = axisModel.getCategories(true); var labelEls = []; var silent = isSilent(axisModel); var triggerEvent = axisModel.get('triggerEvent'); each$1(labels, function (labelItem, index) { var tickValue = labelItem.tickValue; var formattedLabel = labelItem.formattedLabel; var rawLabel = labelItem.rawLabel; var itemLabelModel = labelModel; if (rawCategoryData && rawCategoryData[tickValue] && rawCategoryData[tickValue].textStyle) { itemLabelModel = new Model( rawCategoryData[tickValue].textStyle, labelModel, axisModel.ecModel ); } var textColor = itemLabelModel.getTextColor() || axisModel.get('axisLine.lineStyle.color'); var tickCoord = axis.dataToCoord(tickValue); var pos = [ tickCoord, opt.labelOffset + opt.labelDirection * labelMargin ]; var textEl = new Text({ // Id for animation anid: 'label_' + tickValue, position: pos, rotation: labelLayout.rotation, silent: silent, z2: 10 }); setTextStyle(textEl.style, itemLabelModel, { text: formattedLabel, textAlign: itemLabelModel.getShallow('align', true) || labelLayout.textAlign, textVerticalAlign: itemLabelModel.getShallow('verticalAlign', true) || itemLabelModel.getShallow('baseline', true) || labelLayout.textVerticalAlign, textFill: typeof textColor === 'function' ? textColor( // (1) In category axis with data zoom, tick is not the original // index of axis.data. So tick should not be exposed to user // in category axis. // (2) Compatible with previous version, which always use formatted label as // input. But in interval scale the formatted label is like '223,445', which // maked user repalce ','. So we modify it to return original val but remain // it as 'string' to avoid error in replacing. axis.type === 'category' ? rawLabel : axis.type === 'value' ? tickValue + '' : tickValue, index ) : textColor }); // Pack data for mouse event if (triggerEvent) { textEl.eventData = makeAxisEventDataBase(axisModel); textEl.eventData.targetType = 'axisLabel'; textEl.eventData.value = rawLabel; } // FIXME axisBuilder._dumbGroup.add(textEl); textEl.updateTransform(); labelEls.push(textEl); axisBuilder.group.add(textEl); textEl.decomposeTransform(); }); return labelEls; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$6 = each$1; var curry$1 = curry; // Build axisPointerModel, mergin tooltip.axisPointer model for each axis. // allAxesInfo should be updated when setOption performed. function collect(ecModel, api) { var result = { /** * key: makeKey(axis.model) * value: { * axis, * coordSys, * axisPointerModel, * triggerTooltip, * involveSeries, * snap, * seriesModels, * seriesDataCount * } */ axesInfo: {}, seriesInvolved: false, /** * key: makeKey(coordSys.model) * value: Object: key makeKey(axis.model), value: axisInfo */ coordSysAxesInfo: {}, coordSysMap: {} }; collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart. result.seriesInvolved && collectSeriesInfo(result, ecModel); return result; } function collectAxesInfo(result, ecModel, api) { var globalTooltipModel = ecModel.getComponent('tooltip'); var globalAxisPointerModel = ecModel.getComponent('axisPointer'); // links can only be set on global. var linksOption = globalAxisPointerModel.get('link', true) || []; var linkGroups = []; // Collect axes info. each$6(api.getCoordinateSystems(), function (coordSys) { // Some coordinate system do not support axes, like geo. if (!coordSys.axisPointerEnabled) { return; } var coordSysKey = makeKey(coordSys.model); var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {}; result.coordSysMap[coordSysKey] = coordSys; // Set tooltip (like 'cross') is a convienent way to show axisPointer // for user. So we enable seting tooltip on coordSys model. var coordSysModel = coordSys.model; var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel); each$6(coordSys.getAxes(), curry$1(saveTooltipAxisInfo, false, null)); // If axis tooltip used, choose tooltip axis for each coordSys. // Notice this case: coordSys is `grid` but not `cartesian2D` here. if (coordSys.getTooltipAxes && globalTooltipModel // If tooltip.showContent is set as false, tooltip will not // show but axisPointer will show as normal. && baseTooltipModel.get('show') ) { // Compatible with previous logic. But series.tooltip.trigger: 'axis' // or series.data[n].tooltip.trigger: 'axis' are not support any more. var triggerAxis = baseTooltipModel.get('trigger') === 'axis'; var cross = baseTooltipModel.get('axisPointer.type') === 'cross'; var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get('axisPointer.axis')); if (triggerAxis || cross) { each$6(tooltipAxes.baseAxes, curry$1( saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis )); } if (cross) { each$6(tooltipAxes.otherAxes, curry$1(saveTooltipAxisInfo, 'cross', false)); } } // fromTooltip: true | false | 'cross' // triggerTooltip: true | false | null function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) { var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel); var axisPointerShow = axisPointerModel.get('show'); if (!axisPointerShow || ( axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel) )) { return; } if (triggerTooltip == null) { triggerTooltip = axisPointerModel.get('triggerTooltip'); } axisPointerModel = fromTooltip ? makeAxisPointerModel( axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip ) : axisPointerModel; var snap = axisPointerModel.get('snap'); var key = makeKey(axis.model); var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority). var axisInfo = result.axesInfo[key] = { key: key, axis: axis, coordSys: coordSys, axisPointerModel: axisPointerModel, triggerTooltip: triggerTooltip, involveSeries: involveSeries, snap: snap, useHandle: isHandleTrigger(axisPointerModel), seriesModels: [] }; axesInfoInCoordSys[key] = axisInfo; result.seriesInvolved |= involveSeries; var groupIndex = getLinkGroupIndex(linksOption, axis); if (groupIndex != null) { var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {axesInfo: {}}); linkGroup.axesInfo[key] = axisInfo; linkGroup.mapper = linksOption[groupIndex].mapper; axisInfo.linkGroup = linkGroup; } } }); } function makeAxisPointerModel( axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip ) { var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer'); var volatileOption = {}; each$6( [ 'type', 'snap', 'lineStyle', 'shadowStyle', 'label', 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z' ], function (field) { volatileOption[field] = clone(tooltipAxisPointerModel.get(field)); } ); // category axis do not auto snap, otherwise some tick that do not // has value can not be hovered. value/time/log axis default snap if // triggered from tooltip and trigger tooltip. volatileOption.snap = axis.type !== 'category' && !!triggerTooltip; // Compatibel with previous behavior, tooltip axis do not show label by default. // Only these properties can be overrided from tooltip to axisPointer. if (tooltipAxisPointerModel.get('type') === 'cross') { volatileOption.type = 'line'; } var labelOption = volatileOption.label || (volatileOption.label = {}); // Follow the convention, do not show label when triggered by tooltip by default. labelOption.show == null && (labelOption.show = false); if (fromTooltip === 'cross') { // When 'cross', both axes show labels. var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get('label.show'); labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true; // If triggerTooltip, this is a base axis, which should better not use cross style // (cross style is dashed by default) if (!triggerTooltip) { var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle'); crossStyle && defaults(labelOption, crossStyle.textStyle); } } return axis.model.getModel( 'axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel) ); } function collectSeriesInfo(result, ecModel) { // Prepare data for axis trigger ecModel.eachSeries(function (seriesModel) { // Notice this case: this coordSys is `cartesian2D` but not `grid`. var coordSys = seriesModel.coordinateSystem; var seriesTooltipTrigger = seriesModel.get('tooltip.trigger', true); var seriesTooltipShow = seriesModel.get('tooltip.show', true); if (!coordSys || seriesTooltipTrigger === 'none' || seriesTooltipTrigger === false || seriesTooltipTrigger === 'item' || seriesTooltipShow === false || seriesModel.get('axisPointer.show', true) === false ) { return; } each$6(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) { var axis = axisInfo.axis; if (coordSys.getAxis(axis.dim) === axis) { axisInfo.seriesModels.push(seriesModel); axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0); axisInfo.seriesDataCount += seriesModel.getData().count(); } }); }, this); } /** * For example: * { * axisPointer: { * links: [{ * xAxisIndex: [2, 4], * yAxisIndex: 'all' * }, { * xAxisId: ['a5', 'a7'], * xAxisName: 'xxx' * }] * } * } */ function getLinkGroupIndex(linksOption, axis) { var axisModel = axis.model; var dim = axis.dim; for (var i = 0; i < linksOption.length; i++) { var linkOption = linksOption[i] || {}; if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id) || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex) || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name) ) { return i; } } } function checkPropInLink(linkPropValue, axisPropValue) { return linkPropValue === 'all' || (isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0) || linkPropValue === axisPropValue; } function fixValue(axisModel) { var axisInfo = getAxisInfo(axisModel); if (!axisInfo) { return; } var axisPointerModel = axisInfo.axisPointerModel; var scale = axisInfo.axis.scale; var option = axisPointerModel.option; var status = axisPointerModel.get('status'); var value = axisPointerModel.get('value'); // Parse init value for category and time axis. if (value != null) { value = scale.parse(value); } var useHandle = isHandleTrigger(axisPointerModel); // If `handle` used, `axisPointer` will always be displayed, so value // and status should be initialized. if (status == null) { option.status = useHandle ? 'show' : 'hide'; } var extent = scale.getExtent().slice(); extent[0] > extent[1] && extent.reverse(); if (// Pick a value on axis when initializing. value == null // If both `handle` and `dataZoom` are used, value may be out of axis extent, // where we should re-pick a value to keep `handle` displaying normally. || value > extent[1] ) { // Make handle displayed on the end of the axis when init, which looks better. value = extent[1]; } if (value < extent[0]) { value = extent[0]; } option.value = value; if (useHandle) { option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show'; } } function getAxisInfo(axisModel) { var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {}).coordSysAxesInfo; return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)]; } function getAxisPointerModel(axisModel) { var axisInfo = getAxisInfo(axisModel); return axisInfo && axisInfo.axisPointerModel; } function isHandleTrigger(axisPointerModel) { return !!axisPointerModel.get('handle.show'); } /** * @param {module:echarts/model/Model} model * @return {string} unique key */ function makeKey(model) { return model.type + '||' + model.id; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Base class of AxisView. */ var AxisView = extendComponentView({ type: 'axis', /** * @private */ _axisPointer: null, /** * @protected * @type {string} */ axisPointerClass: null, /** * @override */ render: function (axisModel, ecModel, api, payload) { // FIXME // This process should proformed after coordinate systems updated // (axis scale updated), and should be performed each time update. // So put it here temporarily, although it is not appropriate to // put a model-writing procedure in `view`. this.axisPointerClass && fixValue(axisModel); AxisView.superApply(this, 'render', arguments); updateAxisPointer(this, axisModel, ecModel, api, payload, true); }, /** * Action handler. * @public * @param {module:echarts/coord/cartesian/AxisModel} axisModel * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api * @param {Object} payload */ updateAxisPointer: function (axisModel, ecModel, api, payload, force) { updateAxisPointer(this, axisModel, ecModel, api, payload, false); }, /** * @override */ remove: function (ecModel, api) { var axisPointer = this._axisPointer; axisPointer && axisPointer.remove(api); AxisView.superApply(this, 'remove', arguments); }, /** * @override */ dispose: function (ecModel, api) { disposeAxisPointer(this, api); AxisView.superApply(this, 'dispose', arguments); } }); function updateAxisPointer(axisView, axisModel, ecModel, api, payload, forceRender) { var Clazz = AxisView.getAxisPointerClass(axisView.axisPointerClass); if (!Clazz) { return; } var axisPointerModel = getAxisPointerModel(axisModel); axisPointerModel ? (axisView._axisPointer || (axisView._axisPointer = new Clazz())) .render(axisModel, axisPointerModel, api, forceRender) : disposeAxisPointer(axisView, api); } function disposeAxisPointer(axisView, ecModel, api) { var axisPointer = axisView._axisPointer; axisPointer && axisPointer.dispose(ecModel, api); axisView._axisPointer = null; } var axisPointerClazz = []; AxisView.registerAxisPointerClass = function (type, clazz) { if (__DEV__) { if (axisPointerClazz[type]) { throw new Error('axisPointer ' + type + ' exists'); } } axisPointerClazz[type] = clazz; }; AxisView.getAxisPointerClass = function (type) { return type && axisPointerClazz[type]; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Can only be called after coordinate system creation stage. * (Can be called before coordinate system update stage). * * @param {Object} opt {labelInside} * @return {Object} { * position, rotation, labelDirection, labelOffset, * tickDirection, labelRotate, z2 * } */ function layout$1(gridModel, axisModel, opt) { opt = opt || {}; var grid = gridModel.coordinateSystem; var axis = axisModel.axis; var layout = {}; var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0]; var rawAxisPosition = axis.position; var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition; var axisDim = axis.dim; var rect = grid.getRect(); var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; var idx = {left: 0, right: 1, top: 0, bottom: 1, onZero: 2}; var axisOffset = axisModel.get('offset') || 0; var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset]; if (otherAxisOnZeroOf) { var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0)); posBound[idx['onZero']] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]); } // Axis position layout.position = [ axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3] ]; // Axis rotation layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim var dirMap = {top: -1, bottom: 1, left: -1, right: 1}; layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition]; layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx['onZero']] : 0; if (axisModel.get('axisTick.inside')) { layout.tickDirection = -layout.tickDirection; } if (retrieve(opt.labelInside, axisModel.get('axisLabel.inside'))) { layout.labelDirection = -layout.labelDirection; } // Special label rotation var labelRotate = axisModel.get('axisLabel.rotate'); layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea layout.z2 = 1; return layout; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var axisBuilderAttrs = [ 'axisLine', 'axisTickLabel', 'axisName' ]; var selfBuilderAttrs = [ 'splitArea', 'splitLine' ]; // function getAlignWithLabel(model, axisModel) { // var alignWithLabel = model.get('alignWithLabel'); // if (alignWithLabel === 'auto') { // alignWithLabel = axisModel.get('axisTick.alignWithLabel'); // } // return alignWithLabel; // } var CartesianAxisView = AxisView.extend({ type: 'cartesianAxis', axisPointerClass: 'CartesianAxisPointer', /** * @override */ render: function (axisModel, ecModel, api, payload) { this.group.removeAll(); var oldAxisGroup = this._axisGroup; this._axisGroup = new Group(); this.group.add(this._axisGroup); if (!axisModel.get('show')) { return; } var gridModel = axisModel.getCoordSysModel(); var layout = layout$1(gridModel, axisModel); var axisBuilder = new AxisBuilder(axisModel, layout); each$1(axisBuilderAttrs, axisBuilder.add, axisBuilder); this._axisGroup.add(axisBuilder.getGroup()); each$1(selfBuilderAttrs, function (name) { if (axisModel.get(name + '.show')) { this['_' + name](axisModel, gridModel); } }, this); groupTransition(oldAxisGroup, this._axisGroup, axisModel); CartesianAxisView.superCall(this, 'render', axisModel, ecModel, api, payload); }, remove: function () { this._splitAreaColors = null; }, /** * @param {module:echarts/coord/cartesian/AxisModel} axisModel * @param {module:echarts/coord/cartesian/GridModel} gridModel * @private */ _splitLine: function (axisModel, gridModel) { var axis = axisModel.axis; if (axis.scale.isBlank()) { return; } var splitLineModel = axisModel.getModel('splitLine'); var lineStyleModel = splitLineModel.getModel('lineStyle'); var lineColors = lineStyleModel.get('color'); lineColors = isArray(lineColors) ? lineColors : [lineColors]; var gridRect = gridModel.coordinateSystem.getRect(); var isHorizontal = axis.isHorizontal(); var lineCount = 0; var ticksCoords = axis.getTicksCoords({ tickModel: splitLineModel }); var p1 = []; var p2 = []; // Simple optimization // Batching the lines if color are the same var lineStyle = lineStyleModel.getLineStyle(); for (var i = 0; i < ticksCoords.length; i++) { var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); if (isHorizontal) { p1[0] = tickCoord; p1[1] = gridRect.y; p2[0] = tickCoord; p2[1] = gridRect.y + gridRect.height; } else { p1[0] = gridRect.x; p1[1] = tickCoord; p2[0] = gridRect.x + gridRect.width; p2[1] = tickCoord; } var colorIndex = (lineCount++) % lineColors.length; var tickValue = ticksCoords[i].tickValue; this._axisGroup.add(new Line(subPixelOptimizeLine({ anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null, shape: { x1: p1[0], y1: p1[1], x2: p2[0], y2: p2[1] }, style: defaults({ stroke: lineColors[colorIndex] }, lineStyle), silent: true }))); } }, /** * @param {module:echarts/coord/cartesian/AxisModel} axisModel * @param {module:echarts/coord/cartesian/GridModel} gridModel * @private */ _splitArea: function (axisModel, gridModel) { var axis = axisModel.axis; if (axis.scale.isBlank()) { return; } var splitAreaModel = axisModel.getModel('splitArea'); var areaStyleModel = splitAreaModel.getModel('areaStyle'); var areaColors = areaStyleModel.get('color'); var gridRect = gridModel.coordinateSystem.getRect(); var ticksCoords = axis.getTicksCoords({ tickModel: splitAreaModel, clamp: true }); if (!ticksCoords.length) { return; } // For Making appropriate splitArea animation, the color and anid // should be corresponding to previous one if possible. var areaColorsLen = areaColors.length; var lastSplitAreaColors = this._splitAreaColors; var newSplitAreaColors = createHashMap(); var colorIndex = 0; if (lastSplitAreaColors) { for (var i = 0; i < ticksCoords.length; i++) { var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue); if (cIndex != null) { colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen; break; } } } var prev = axis.toGlobalCoord(ticksCoords[0].coord); var areaStyle = areaStyleModel.getAreaStyle(); areaColors = isArray(areaColors) ? areaColors : [areaColors]; for (var i = 1; i < ticksCoords.length; i++) { var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); var x; var y; var width; var height; if (axis.isHorizontal()) { x = prev; y = gridRect.y; width = tickCoord - x; height = gridRect.height; prev = x + width; } else { x = gridRect.x; y = prev; width = gridRect.width; height = tickCoord - y; prev = y + height; } var tickValue = ticksCoords[i - 1].tickValue; tickValue != null && newSplitAreaColors.set(tickValue, colorIndex); this._axisGroup.add(new Rect({ anid: tickValue != null ? 'area_' + tickValue : null, shape: { x: x, y: y, width: width, height: height }, style: defaults({ fill: areaColors[colorIndex] }, areaStyle), silent: true })); colorIndex = (colorIndex + 1) % areaColorsLen; } this._splitAreaColors = newSplitAreaColors; } }); CartesianAxisView.extend({ type: 'xAxis' }); CartesianAxisView.extend({ type: 'yAxis' }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Grid view extendComponentView({ type: 'grid', render: function (gridModel, ecModel) { this.group.removeAll(); if (gridModel.get('show')) { this.group.add(new Rect({ shape: gridModel.coordinateSystem.getRect(), style: defaults({ fill: gridModel.get('backgroundColor') }, gridModel.getItemStyle()), silent: true, z2: -1 })); } } }); registerPreprocessor(function (option) { // Only create grid when need if (option.xAxis && option.yAxis && !option.grid) { option.grid = {}; } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // In case developer forget to include grid component registerVisual(visualSymbol('line', 'circle', 'line')); registerLayout(pointsLayout('line')); // Down sample after filter registerProcessor( PRIORITY.PROCESSOR.STATISTIC, dataSample('line') ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var BaseBarSeries = SeriesModel.extend({ type: 'series.__base_bar__', getInitialData: function (option, ecModel) { return createListFromArray(this.getSource(), this); }, getMarkerPosition: function (value) { var coordSys = this.coordinateSystem; if (coordSys) { // PENDING if clamp ? var pt = coordSys.dataToPoint(coordSys.clampData(value)); var data = this.getData(); var offset = data.getLayout('offset'); var size = data.getLayout('size'); var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1; pt[offsetIndex] += offset + size / 2; return pt; } return [NaN, NaN]; }, defaultOption: { zlevel: 0, // 一级层叠 z: 2, // 二级层叠 coordinateSystem: 'cartesian2d', legendHoverLink: true, // stack: null // Cartesian coordinate system // xAxisIndex: 0, // yAxisIndex: 0, // 最小高度改为0 barMinHeight: 0, // 最小角度为0,仅对极坐标系下的柱状图有效 barMinAngle: 0, // cursor: null, large: false, largeThreshold: 400, progressive: 3e3, progressiveChunkMode: 'mod', // barMaxWidth: null, // 默认自适应 // barWidth: null, // 柱间距离,默认为柱形宽度的30%,可设固定值 // barGap: '30%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 // barCategoryGap: '20%', // label: { // show: false // }, itemStyle: {}, emphasis: {} } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ BaseBarSeries.extend({ type: 'series.bar', dependencies: ['grid', 'polar'], brushSelector: 'rect', /** * @override */ getProgressive: function () { // Do not support progressive in normal mode. return this.get('large') ? this.get('progressive') : false; }, /** * @override */ getProgressiveThreshold: function () { // Do not support progressive in normal mode. var progressiveThreshold = this.get('progressiveThreshold'); var largeThreshold = this.get('largeThreshold'); if (largeThreshold > progressiveThreshold) { progressiveThreshold = largeThreshold; } return progressiveThreshold; } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function setLabel( normalStyle, hoverStyle, itemModel, color, seriesModel, dataIndex, labelPositionOutside ) { var labelModel = itemModel.getModel('label'); var hoverLabelModel = itemModel.getModel('emphasis.label'); setLabelStyle( normalStyle, hoverStyle, labelModel, hoverLabelModel, { labelFetcher: seriesModel, labelDataIndex: dataIndex, defaultText: getDefaultLabel(seriesModel.getData(), dataIndex), isRectText: true, autoColor: color } ); fixPosition(normalStyle); fixPosition(hoverStyle); } function fixPosition(style, labelPositionOutside) { if (style.textPosition === 'outside') { style.textPosition = labelPositionOutside; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var getBarItemStyle = makeStyleMapper( [ ['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], // Compatitable with 2 ['stroke', 'barBorderColor'], ['lineWidth', 'barBorderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'] ] ); var barItemStyle = { getBarItemStyle: function (excludes) { var style = getBarItemStyle(this, excludes); if (this.getBorderLineDash) { var lineDash = this.getBorderLineDash(); lineDash && (style.lineDash = lineDash); } return style; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'barBorderWidth']; // FIXME // Just for compatible with ec2. extend(Model.prototype, barItemStyle); extendChartView({ type: 'bar', render: function (seriesModel, ecModel, api) { this._updateDrawMode(seriesModel); var coordinateSystemType = seriesModel.get('coordinateSystem'); if (coordinateSystemType === 'cartesian2d' || coordinateSystemType === 'polar' ) { this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api) : this._renderNormal(seriesModel, ecModel, api); } else if (__DEV__) { console.warn('Only cartesian2d and polar supported for bar.'); } return this.group; }, incrementalPrepareRender: function (seriesModel, ecModel, api) { this._clear(); this._updateDrawMode(seriesModel); }, incrementalRender: function (params, seriesModel, ecModel, api) { // Do not support progressive in normal mode. this._incrementalRenderLarge(params, seriesModel); }, _updateDrawMode: function (seriesModel) { var isLargeDraw = seriesModel.pipelineContext.large; if (this._isLargeDraw == null || isLargeDraw ^ this._isLargeDraw) { this._isLargeDraw = isLargeDraw; this._clear(); } }, _renderNormal: function (seriesModel, ecModel, api) { var group = this.group; var data = seriesModel.getData(); var oldData = this._data; var coord = seriesModel.coordinateSystem; var baseAxis = coord.getBaseAxis(); var isHorizontalOrRadial; if (coord.type === 'cartesian2d') { isHorizontalOrRadial = baseAxis.isHorizontal(); } else if (coord.type === 'polar') { isHorizontalOrRadial = baseAxis.dim === 'angle'; } var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null; data.diff(oldData) .add(function (dataIndex) { if (!data.hasValue(dataIndex)) { return; } var itemModel = data.getItemModel(dataIndex); var layout = getLayout[coord.type](data, dataIndex, itemModel); var el = elementCreator[coord.type]( data, dataIndex, itemModel, layout, isHorizontalOrRadial, animationModel ); data.setItemGraphicEl(dataIndex, el); group.add(el); updateStyle( el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar' ); }) .update(function (newIndex, oldIndex) { var el = oldData.getItemGraphicEl(oldIndex); if (!data.hasValue(newIndex)) { group.remove(el); return; } var itemModel = data.getItemModel(newIndex); var layout = getLayout[coord.type](data, newIndex, itemModel); if (el) { updateProps(el, {shape: layout}, animationModel, newIndex); } else { el = elementCreator[coord.type]( data, newIndex, itemModel, layout, isHorizontalOrRadial, animationModel, true ); } data.setItemGraphicEl(newIndex, el); // Add back group.add(el); updateStyle( el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar' ); }) .remove(function (dataIndex) { var el = oldData.getItemGraphicEl(dataIndex); if (coord.type === 'cartesian2d') { el && removeRect(dataIndex, animationModel, el); } else { el && removeSector(dataIndex, animationModel, el); } }) .execute(); this._data = data; }, _renderLarge: function (seriesModel, ecModel, api) { this._clear(); createLarge(seriesModel, this.group); }, _incrementalRenderLarge: function (params, seriesModel) { createLarge(seriesModel, this.group, true); }, dispose: noop, remove: function (ecModel) { this._clear(ecModel); }, _clear: function (ecModel) { var group = this.group; var data = this._data; if (ecModel && ecModel.get('animation') && data && !this._isLargeDraw) { data.eachItemGraphicEl(function (el) { if (el.type === 'sector') { removeSector(el.dataIndex, ecModel, el); } else { removeRect(el.dataIndex, ecModel, el); } }); } else { group.removeAll(); } this._data = null; } }); var elementCreator = { cartesian2d: function ( data, dataIndex, itemModel, layout, isHorizontal, animationModel, isUpdate ) { var rect = new Rect({shape: extend({}, layout)}); // Animation if (animationModel) { var rectShape = rect.shape; var animateProperty = isHorizontal ? 'height' : 'width'; var animateTarget = {}; rectShape[animateProperty] = 0; animateTarget[animateProperty] = layout[animateProperty]; graphic[isUpdate ? 'updateProps' : 'initProps'](rect, { shape: animateTarget }, animationModel, dataIndex); } return rect; }, polar: function ( data, dataIndex, itemModel, layout, isRadial, animationModel, isUpdate ) { // Keep the same logic with bar in catesion: use end value to control // direction. Notice that if clockwise is true (by default), the sector // will always draw clockwisely, no matter whether endAngle is greater // or less than startAngle. var clockwise = layout.startAngle < layout.endAngle; var sector = new Sector({ shape: defaults({clockwise: clockwise}, layout) }); // Animation if (animationModel) { var sectorShape = sector.shape; var animateProperty = isRadial ? 'r' : 'endAngle'; var animateTarget = {}; sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle; animateTarget[animateProperty] = layout[animateProperty]; graphic[isUpdate ? 'updateProps' : 'initProps'](sector, { shape: animateTarget }, animationModel, dataIndex); } return sector; } }; function removeRect(dataIndex, animationModel, el) { // Not show text when animating el.style.text = null; updateProps(el, { shape: { width: 0 } }, animationModel, dataIndex, function () { el.parent && el.parent.remove(el); }); } function removeSector(dataIndex, animationModel, el) { // Not show text when animating el.style.text = null; updateProps(el, { shape: { r: el.shape.r0 } }, animationModel, dataIndex, function () { el.parent && el.parent.remove(el); }); } var getLayout = { cartesian2d: function (data, dataIndex, itemModel) { var layout = data.getItemLayout(dataIndex); var fixedLineWidth = getLineWidth(itemModel, layout); // fix layout with lineWidth var signX = layout.width > 0 ? 1 : -1; var signY = layout.height > 0 ? 1 : -1; return { x: layout.x + signX * fixedLineWidth / 2, y: layout.y + signY * fixedLineWidth / 2, width: layout.width - signX * fixedLineWidth, height: layout.height - signY * fixedLineWidth }; }, polar: function (data, dataIndex, itemModel) { var layout = data.getItemLayout(dataIndex); return { cx: layout.cx, cy: layout.cy, r0: layout.r0, r: layout.r, startAngle: layout.startAngle, endAngle: layout.endAngle }; } }; function updateStyle( el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar ) { var color = data.getItemVisual(dataIndex, 'color'); var opacity = data.getItemVisual(dataIndex, 'opacity'); var itemStyleModel = itemModel.getModel('itemStyle'); var hoverStyle = itemModel.getModel('emphasis.itemStyle').getBarItemStyle(); if (!isPolar) { el.setShape('r', itemStyleModel.get('barBorderRadius') || 0); } el.useStyle(defaults( { fill: color, opacity: opacity }, itemStyleModel.getBarItemStyle() )); var cursorStyle = itemModel.getShallow('cursor'); cursorStyle && el.attr('cursor', cursorStyle); var labelPositionOutside = isHorizontal ? (layout.height > 0 ? 'bottom' : 'top') : (layout.width > 0 ? 'left' : 'right'); if (!isPolar) { setLabel( el.style, hoverStyle, itemModel, color, seriesModel, dataIndex, labelPositionOutside ); } setHoverStyle(el, hoverStyle); } // In case width or height are too small. function getLineWidth(itemModel, rawLayout) { var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0; return Math.min(lineWidth, Math.abs(rawLayout.width), Math.abs(rawLayout.height)); } var LargePath = Path.extend({ type: 'largeBar', shape: {points: []}, buildPath: function (ctx, shape) { // Drawing lines is more efficient than drawing // a whole line or drawing rects. var points = shape.points; var startPoint = this.__startPoint; var valueIdx = this.__valueIdx; for (var i = 0; i < points.length; i += 2) { startPoint[this.__valueIdx] = points[i + valueIdx]; ctx.moveTo(startPoint[0], startPoint[1]); ctx.lineTo(points[i], points[i + 1]); } } }); function createLarge(seriesModel, group, incremental) { // TODO support polar var data = seriesModel.getData(); var startPoint = []; var valueIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0; startPoint[1 - valueIdx] = data.getLayout('valueAxisStart'); var el = new LargePath({ shape: {points: data.getLayout('largePoints')}, incremental: !!incremental, __startPoint: startPoint, __valueIdx: valueIdx }); group.add(el); setLargeStyle(el, seriesModel, data); } function setLargeStyle(el, seriesModel, data) { var borderColor = data.getVisual('borderColor') || data.getVisual('color'); var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(['color', 'borderColor']); el.useStyle(itemStyle); el.style.fill = null; el.style.stroke = borderColor; el.style.lineWidth = data.getLayout('barWidth'); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // In case developer forget to include grid component registerLayout(curry(layout, 'bar')); // Should after normal bar layout, otherwise it is blocked by normal bar layout. registerLayout(largeLayout); registerVisual({ seriesType: 'bar', reset: function (seriesModel) { // Visual coding for legend seriesModel.getData().setVisual('legendSymbol', 'roundRect'); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * [Usage]: * (1) * createListSimply(seriesModel, ['value']); * (2) * createListSimply(seriesModel, { * coordDimensions: ['value'], * dimensionsCount: 5 * }); * * @param {module:echarts/model/Series} seriesModel * @param {Object|Array.} opt opt or coordDimensions * The options in opt, see `echarts/data/helper/createDimensions` * @param {Array.} [nameList] * @return {module:echarts/data/List} */ var createListSimply = function (seriesModel, opt, nameList) { opt = isArray(opt) && {coordDimensions: opt} || extend({}, opt); var source = seriesModel.getSource(); var dimensionsInfo = createDimensions(source, opt); var list = new List(dimensionsInfo, seriesModel); list.initData(source, nameList); return list; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Data selectable mixin for chart series. * To eanble data select, option of series must have `selectedMode`. * And each data item will use `selected` to toggle itself selected status */ var selectableMixin = { /** * @param {Array.} targetList [{name, value, selected}, ...] * If targetList is an array, it should like [{name: ..., value: ...}, ...]. * If targetList is a "List", it must have coordDim: 'value' dimension and name. */ updateSelectedMap: function (targetList) { this._targetList = isArray(targetList) ? targetList.slice() : []; this._selectTargetMap = reduce(targetList || [], function (targetMap, target) { targetMap.set(target.name, target); return targetMap; }, createHashMap()); }, /** * Either name or id should be passed as input here. * If both of them are defined, id is used. * * @param {string|undefined} name name of data * @param {number|undefined} id dataIndex of data */ // PENGING If selectedMode is null ? select: function (name, id) { var target = id != null ? this._targetList[id] : this._selectTargetMap.get(name); var selectedMode = this.get('selectedMode'); if (selectedMode === 'single') { this._selectTargetMap.each(function (target) { target.selected = false; }); } target && (target.selected = true); }, /** * Either name or id should be passed as input here. * If both of them are defined, id is used. * * @param {string|undefined} name name of data * @param {number|undefined} id dataIndex of data */ unSelect: function (name, id) { var target = id != null ? this._targetList[id] : this._selectTargetMap.get(name); // var selectedMode = this.get('selectedMode'); // selectedMode !== 'single' && target && (target.selected = false); target && (target.selected = false); }, /** * Either name or id should be passed as input here. * If both of them are defined, id is used. * * @param {string|undefined} name name of data * @param {number|undefined} id dataIndex of data */ toggleSelected: function (name, id) { var target = id != null ? this._targetList[id] : this._selectTargetMap.get(name); if (target != null) { this[target.selected ? 'unSelect' : 'select'](name, id); return target.selected; } }, /** * Either name or id should be passed as input here. * If both of them are defined, id is used. * * @param {string|undefined} name name of data * @param {number|undefined} id dataIndex of data */ isSelected: function (name, id) { var target = id != null ? this._targetList[id] : this._selectTargetMap.get(name); return target && target.selected; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var PieSeries = extendSeriesModel({ type: 'series.pie', // Overwrite init: function (option) { PieSeries.superApply(this, 'init', arguments); // Enable legend selection for each data item // Use a function instead of direct access because data reference may changed this.legendDataProvider = function () { return this.getRawData(); }; this.updateSelectedMap(this._createSelectableList()); this._defaultLabelLine(option); }, // Overwrite mergeOption: function (newOption) { PieSeries.superCall(this, 'mergeOption', newOption); this.updateSelectedMap(this._createSelectableList()); }, getInitialData: function (option, ecModel) { return createListSimply(this, ['value']); }, _createSelectableList: function () { var data = this.getRawData(); var valueDim = data.mapDimension('value'); var targetList = []; for (var i = 0, len = data.count(); i < len; i++) { targetList.push({ name: data.getName(i), value: data.get(valueDim, i), selected: retrieveRawAttr(data, i, 'selected') }); } return targetList; }, // Overwrite getDataParams: function (dataIndex) { var data = this.getData(); var params = PieSeries.superCall(this, 'getDataParams', dataIndex); // FIXME toFixed? var valueList = []; data.each(data.mapDimension('value'), function (value) { valueList.push(value); }); params.percent = getPercentWithPrecision( valueList, dataIndex, data.hostModel.get('percentPrecision') ); params.$vars.push('percent'); return params; }, _defaultLabelLine: function (option) { // Extend labelLine emphasis defaultEmphasis(option, 'labelLine', ['show']); var labelLineNormalOpt = option.labelLine; var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false` labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show; labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show; }, defaultOption: { zlevel: 0, z: 2, legendHoverLink: true, hoverAnimation: true, // 默认全局居中 center: ['50%', '50%'], radius: [0, '75%'], // 默认顺时针 clockwise: true, startAngle: 90, // 最小角度改为0 minAngle: 0, // 选中时扇区偏移量 selectedOffset: 10, // 高亮扇区偏移量 hoverOffset: 10, // If use strategy to avoid label overlapping avoidLabelOverlap: true, // 选择模式,默认关闭,可选single,multiple // selectedMode: false, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) // roseType: null, percentPrecision: 2, // If still show when all data zero. stillShowZeroSum: true, // cursor: null, label: { // If rotate around circle rotate: false, show: true, // 'outer', 'inside', 'center' position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 // 默认使用全局文本样式,详见TEXTSTYLE // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数 }, // Enabled when label.normal.position is 'outer' labelLine: { show: true, // 引导线两段中的第一段长度 length: 15, // 引导线两段中的第二段长度 length2: 15, smooth: false, lineStyle: { // color: 各异, width: 1, type: 'solid' } }, itemStyle: { borderWidth: 1 }, // Animation type canbe expansion, scale animationType: 'expansion', animationEasing: 'cubicOut' } }); mixin(PieSeries, selectableMixin); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @param {module:echarts/model/Series} seriesModel * @param {boolean} hasAnimation * @inner */ function updateDataSelected(uid, seriesModel, hasAnimation, api) { var data = seriesModel.getData(); var dataIndex = this.dataIndex; var name = data.getName(dataIndex); var selectedOffset = seriesModel.get('selectedOffset'); api.dispatchAction({ type: 'pieToggleSelect', from: uid, name: name, seriesId: seriesModel.id }); data.each(function (idx) { toggleItemSelected( data.getItemGraphicEl(idx), data.getItemLayout(idx), seriesModel.isSelected(data.getName(idx)), selectedOffset, hasAnimation ); }); } /** * @param {module:zrender/graphic/Sector} el * @param {Object} layout * @param {boolean} isSelected * @param {number} selectedOffset * @param {boolean} hasAnimation * @inner */ function toggleItemSelected(el, layout, isSelected, selectedOffset, hasAnimation) { var midAngle = (layout.startAngle + layout.endAngle) / 2; var dx = Math.cos(midAngle); var dy = Math.sin(midAngle); var offset = isSelected ? selectedOffset : 0; var position = [dx * offset, dy * offset]; hasAnimation // animateTo will stop revious animation like update transition ? el.animate() .when(200, { position: position }) .start('bounceOut') : el.attr('position', position); } /** * Piece of pie including Sector, Label, LabelLine * @constructor * @extends {module:zrender/graphic/Group} */ function PiePiece(data, idx) { Group.call(this); var sector = new Sector({ z2: 2 }); var polyline = new Polyline(); var text = new Text(); this.add(sector); this.add(polyline); this.add(text); this.updateData(data, idx, true); // Hover to change label and labelLine function onEmphasis() { polyline.ignore = polyline.hoverIgnore; text.ignore = text.hoverIgnore; } function onNormal() { polyline.ignore = polyline.normalIgnore; text.ignore = text.normalIgnore; } this.on('emphasis', onEmphasis) .on('normal', onNormal) .on('mouseover', onEmphasis) .on('mouseout', onNormal); } var piePieceProto = PiePiece.prototype; piePieceProto.updateData = function (data, idx, firstCreate) { var sector = this.childAt(0); var seriesModel = data.hostModel; var itemModel = data.getItemModel(idx); var layout = data.getItemLayout(idx); var sectorShape = extend({}, layout); sectorShape.label = null; if (firstCreate) { sector.setShape(sectorShape); var animationType = seriesModel.getShallow('animationType'); if (animationType === 'scale') { sector.shape.r = layout.r0; initProps(sector, { shape: { r: layout.r } }, seriesModel, idx); } // Expansion else { sector.shape.endAngle = layout.startAngle; updateProps(sector, { shape: { endAngle: layout.endAngle } }, seriesModel, idx); } } else { updateProps(sector, { shape: sectorShape }, seriesModel, idx); } // Update common style var visualColor = data.getItemVisual(idx, 'color'); sector.useStyle( defaults( { lineJoin: 'bevel', fill: visualColor }, itemModel.getModel('itemStyle').getItemStyle() ) ); sector.hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); var cursorStyle = itemModel.getShallow('cursor'); cursorStyle && sector.attr('cursor', cursorStyle); // Toggle selected toggleItemSelected( this, data.getItemLayout(idx), seriesModel.isSelected(null, idx), seriesModel.get('selectedOffset'), seriesModel.get('animation') ); function onEmphasis() { // Sector may has animation of updating data. Force to move to the last frame // Or it may stopped on the wrong shape sector.stopAnimation(true); sector.animateTo({ shape: { r: layout.r + seriesModel.get('hoverOffset') } }, 300, 'elasticOut'); } function onNormal() { sector.stopAnimation(true); sector.animateTo({ shape: { r: layout.r } }, 300, 'elasticOut'); } sector.off('mouseover').off('mouseout').off('emphasis').off('normal'); if (itemModel.get('hoverAnimation') && seriesModel.isAnimationEnabled()) { sector .on('mouseover', onEmphasis) .on('mouseout', onNormal) .on('emphasis', onEmphasis) .on('normal', onNormal); } this._updateLabel(data, idx); setHoverStyle(this); }; piePieceProto._updateLabel = function (data, idx) { var labelLine = this.childAt(1); var labelText = this.childAt(2); var seriesModel = data.hostModel; var itemModel = data.getItemModel(idx); var layout = data.getItemLayout(idx); var labelLayout = layout.label; var visualColor = data.getItemVisual(idx, 'color'); updateProps(labelLine, { shape: { points: labelLayout.linePoints || [ [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y] ] } }, seriesModel, idx); updateProps(labelText, { style: { x: labelLayout.x, y: labelLayout.y } }, seriesModel, idx); labelText.attr({ rotation: labelLayout.rotation, origin: [labelLayout.x, labelLayout.y], z2: 10 }); var labelModel = itemModel.getModel('label'); var labelHoverModel = itemModel.getModel('emphasis.label'); var labelLineModel = itemModel.getModel('labelLine'); var labelLineHoverModel = itemModel.getModel('emphasis.labelLine'); var visualColor = data.getItemVisual(idx, 'color'); setLabelStyle( labelText.style, labelText.hoverStyle = {}, labelModel, labelHoverModel, { labelFetcher: data.hostModel, labelDataIndex: idx, defaultText: data.getName(idx), autoColor: visualColor, useInsideStyle: !!labelLayout.inside }, { textAlign: labelLayout.textAlign, textVerticalAlign: labelLayout.verticalAlign, opacity: data.getItemVisual(idx, 'opacity') } ); labelText.ignore = labelText.normalIgnore = !labelModel.get('show'); labelText.hoverIgnore = !labelHoverModel.get('show'); labelLine.ignore = labelLine.normalIgnore = !labelLineModel.get('show'); labelLine.hoverIgnore = !labelLineHoverModel.get('show'); // Default use item visual color labelLine.setStyle({ stroke: visualColor, opacity: data.getItemVisual(idx, 'opacity') }); labelLine.setStyle(labelLineModel.getModel('lineStyle').getLineStyle()); labelLine.hoverStyle = labelLineHoverModel.getModel('lineStyle').getLineStyle(); var smooth = labelLineModel.get('smooth'); if (smooth && smooth === true) { smooth = 0.4; } labelLine.setShape({ smooth: smooth }); }; inherits(PiePiece, Group); // Pie view var PieView = Chart.extend({ type: 'pie', init: function () { var sectorGroup = new Group(); this._sectorGroup = sectorGroup; }, render: function (seriesModel, ecModel, api, payload) { if (payload && (payload.from === this.uid)) { return; } var data = seriesModel.getData(); var oldData = this._data; var group = this.group; var hasAnimation = ecModel.get('animation'); var isFirstRender = !oldData; var animationType = seriesModel.get('animationType'); var onSectorClick = curry( updateDataSelected, this.uid, seriesModel, hasAnimation, api ); var selectedMode = seriesModel.get('selectedMode'); data.diff(oldData) .add(function (idx) { var piePiece = new PiePiece(data, idx); // Default expansion animation if (isFirstRender && animationType !== 'scale') { piePiece.eachChild(function (child) { child.stopAnimation(true); }); } selectedMode && piePiece.on('click', onSectorClick); data.setItemGraphicEl(idx, piePiece); group.add(piePiece); }) .update(function (newIdx, oldIdx) { var piePiece = oldData.getItemGraphicEl(oldIdx); piePiece.updateData(data, newIdx); piePiece.off('click'); selectedMode && piePiece.on('click', onSectorClick); group.add(piePiece); data.setItemGraphicEl(newIdx, piePiece); }) .remove(function (idx) { var piePiece = oldData.getItemGraphicEl(idx); group.remove(piePiece); }) .execute(); if ( hasAnimation && isFirstRender && data.count() > 0 // Default expansion animation && animationType !== 'scale' ) { var shape = data.getItemLayout(0); var r = Math.max(api.getWidth(), api.getHeight()) / 2; var removeClipPath = bind(group.removeClipPath, group); group.setClipPath(this._createClipPath( shape.cx, shape.cy, r, shape.startAngle, shape.clockwise, removeClipPath, seriesModel )); } this._data = data; }, dispose: function () {}, _createClipPath: function ( cx, cy, r, startAngle, clockwise, cb, seriesModel ) { var clipPath = new Sector({ shape: { cx: cx, cy: cy, r0: 0, r: r, startAngle: startAngle, endAngle: startAngle, clockwise: clockwise } }); initProps(clipPath, { shape: { endAngle: startAngle + (clockwise ? 1 : -1) * Math.PI * 2 } }, seriesModel, cb); return clipPath; }, /** * @implement */ containPoint: function (point, seriesModel) { var data = seriesModel.getData(); var itemLayout = data.getItemLayout(0); if (itemLayout) { var dx = point[0] - itemLayout.cx; var dy = point[1] - itemLayout.cy; var radius = Math.sqrt(dx * dx + dy * dy); return radius <= itemLayout.r && radius >= itemLayout.r0; } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var createDataSelectAction = function (seriesType, actionInfos) { each$1(actionInfos, function (actionInfo) { actionInfo.update = 'updateView'; /** * @payload * @property {string} seriesName * @property {string} name */ registerAction(actionInfo, function (payload, ecModel) { var selected = {}; ecModel.eachComponent( {mainType: 'series', subType: seriesType, query: payload}, function (seriesModel) { if (seriesModel[actionInfo.method]) { seriesModel[actionInfo.method]( payload.name, payload.dataIndex ); } var data = seriesModel.getData(); // Create selected map data.each(function (idx) { var name = data.getName(idx); selected[name] = seriesModel.isSelected(name) || false; }); } ); return { name: payload.name, selected: selected }; }); }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Pick color from palette for each data item. // Applicable for charts that require applying color palette // in data level (like pie, funnel, chord). var dataColor = function (seriesType) { return { getTargetSeries: function (ecModel) { // Pie and funnel may use diferrent scope var paletteScope = {}; var seiresModelMap = createHashMap(); ecModel.eachSeriesByType(seriesType, function (seriesModel) { seriesModel.__paletteScope = paletteScope; seiresModelMap.set(seriesModel.uid, seriesModel); }); return seiresModelMap; }, reset: function (seriesModel, ecModel) { var dataAll = seriesModel.getRawData(); var idxMap = {}; var data = seriesModel.getData(); data.each(function (idx) { var rawIdx = data.getRawIndex(idx); idxMap[rawIdx] = idx; }); dataAll.each(function (rawIdx) { var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true); if (!singleDataColor) { // FIXME Performance var itemModel = dataAll.getItemModel(rawIdx); var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette( dataAll.getName(rawIdx) || (rawIdx + ''), seriesModel.__paletteScope, dataAll.count() ); // Legend may use the visual info in data before processed dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered if (filteredIdx != null) { data.setItemVisual(filteredIdx, 'color', color); } } else { // Set data all color for legend dataAll.setItemVisual(rawIdx, 'color', singleDataColor); } }); } }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // FIXME emphasis label position is not same with normal label position function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) { list.sort(function (a, b) { return a.y - b.y; }); // 压 function shiftDown(start, end, delta, dir) { for (var j = start; j < end; j++) { list[j].y += delta; if (j > start && j + 1 < end && list[j + 1].y > list[j].y + list[j].height ) { shiftUp(j, delta / 2); return; } } shiftUp(end - 1, delta / 2); } // 弹 function shiftUp(end, delta) { for (var j = end; j >= 0; j--) { list[j].y -= delta; if (j > 0 && list[j].y > list[j - 1].y + list[j - 1].height ) { break; } } } function changeX(list, isDownList, cx, cy, r, dir) { var lastDeltaX = dir > 0 ? isDownList // 右侧 ? Number.MAX_VALUE // 下 : 0 // 上 : isDownList // 左侧 ? Number.MAX_VALUE // 下 : 0; // 上 for (var i = 0, l = list.length; i < l; i++) { // Not change x for center label if (list[i].position === 'center') { continue; } var deltaY = Math.abs(list[i].y - cy); var length = list[i].len; var length2 = list[i].len2; var deltaX = (deltaY < r + length) ? Math.sqrt( (r + length + length2) * (r + length + length2) - deltaY * deltaY ) : Math.abs(list[i].x - cx); if (isDownList && deltaX >= lastDeltaX) { // 右下,左下 deltaX = lastDeltaX - 10; } if (!isDownList && deltaX <= lastDeltaX) { // 右上,左上 deltaX = lastDeltaX + 10; } list[i].x = cx + deltaX * dir; lastDeltaX = deltaX; } } var lastY = 0; var delta; var len = list.length; var upList = []; var downList = []; for (var i = 0; i < len; i++) { delta = list[i].y - lastY; if (delta < 0) { shiftDown(i, len, -delta, dir); } lastY = list[i].y + list[i].height; } if (viewHeight - lastY < 0) { shiftUp(len - 1, lastY - viewHeight); } for (var i = 0; i < len; i++) { if (list[i].y >= cy) { downList.push(list[i]); } else { upList.push(list[i]); } } changeX(upList, false, cx, cy, r, dir); changeX(downList, true, cx, cy, r, dir); } function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight) { var leftList = []; var rightList = []; for (var i = 0; i < labelLayoutList.length; i++) { if (labelLayoutList[i].x < cx) { leftList.push(labelLayoutList[i]); } else { rightList.push(labelLayoutList[i]); } } adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight); adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight); for (var i = 0; i < labelLayoutList.length; i++) { var linePoints = labelLayoutList[i].linePoints; if (linePoints) { var dist = linePoints[1][0] - linePoints[2][0]; if (labelLayoutList[i].x < cx) { linePoints[2][0] = labelLayoutList[i].x + 3; } else { linePoints[2][0] = labelLayoutList[i].x - 3; } linePoints[1][1] = linePoints[2][1] = labelLayoutList[i].y; linePoints[1][0] = linePoints[2][0] + dist; } } } var labelLayout = function (seriesModel, r, viewWidth, viewHeight) { var data = seriesModel.getData(); var labelLayoutList = []; var cx; var cy; var hasLabelRotate = false; data.each(function (idx) { var layout = data.getItemLayout(idx); var itemModel = data.getItemModel(idx); var labelModel = itemModel.getModel('label'); // Use position in normal or emphasis var labelPosition = labelModel.get('position') || itemModel.get('emphasis.label.position'); var labelLineModel = itemModel.getModel('labelLine'); var labelLineLen = labelLineModel.get('length'); var labelLineLen2 = labelLineModel.get('length2'); var midAngle = (layout.startAngle + layout.endAngle) / 2; var dx = Math.cos(midAngle); var dy = Math.sin(midAngle); var textX; var textY; var linePoints; var textAlign; cx = layout.cx; cy = layout.cy; var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner'; if (labelPosition === 'center') { textX = layout.cx; textY = layout.cy; textAlign = 'center'; } else { var x1 = (isLabelInside ? (layout.r + layout.r0) / 2 * dx : layout.r * dx) + cx; var y1 = (isLabelInside ? (layout.r + layout.r0) / 2 * dy : layout.r * dy) + cy; textX = x1 + dx * 3; textY = y1 + dy * 3; if (!isLabelInside) { // For roseType var x2 = x1 + dx * (labelLineLen + r - layout.r); var y2 = y1 + dy * (labelLineLen + r - layout.r); var x3 = x2 + ((dx < 0 ? -1 : 1) * labelLineLen2); var y3 = y2; textX = x3 + (dx < 0 ? -5 : 5); textY = y3; linePoints = [[x1, y1], [x2, y2], [x3, y3]]; } textAlign = isLabelInside ? 'center' : (dx > 0 ? 'left' : 'right'); } var font = labelModel.getFont(); var labelRotate = labelModel.get('rotate') ? (dx < 0 ? -midAngle + Math.PI : -midAngle) : 0; var text = seriesModel.getFormattedLabel(idx, 'normal') || data.getName(idx); var textRect = getBoundingRect( text, font, textAlign, 'top' ); hasLabelRotate = !!labelRotate; layout.label = { x: textX, y: textY, position: labelPosition, height: textRect.height, len: labelLineLen, len2: labelLineLen2, linePoints: linePoints, textAlign: textAlign, verticalAlign: 'middle', rotation: labelRotate, inside: isLabelInside }; // Not layout the inside label if (!isLabelInside) { labelLayoutList.push(layout.label); } }); if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) { avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight); } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var PI2$4 = Math.PI * 2; var RADIAN = Math.PI / 180; var pieLayout = function (seriesType, ecModel, api, payload) { ecModel.eachSeriesByType(seriesType, function (seriesModel) { var data = seriesModel.getData(); var valueDim = data.mapDimension('value'); var center = seriesModel.get('center'); var radius = seriesModel.get('radius'); if (!isArray(radius)) { radius = [0, radius]; } if (!isArray(center)) { center = [center, center]; } var width = api.getWidth(); var height = api.getHeight(); var size = Math.min(width, height); var cx = parsePercent$1(center[0], width); var cy = parsePercent$1(center[1], height); var r0 = parsePercent$1(radius[0], size / 2); var r = parsePercent$1(radius[1], size / 2); var startAngle = -seriesModel.get('startAngle') * RADIAN; var minAngle = seriesModel.get('minAngle') * RADIAN; var validDataCount = 0; data.each(valueDim, function (value) { !isNaN(value) && validDataCount++; }); var sum = data.getSum(valueDim); // Sum may be 0 var unitRadian = Math.PI / (sum || validDataCount) * 2; var clockwise = seriesModel.get('clockwise'); var roseType = seriesModel.get('roseType'); var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // [0...max] var extent = data.getDataExtent(valueDim); extent[0] = 0; // In the case some sector angle is smaller than minAngle var restAngle = PI2$4; var valueSumLargerThanMinAngle = 0; var currentAngle = startAngle; var dir = clockwise ? 1 : -1; data.each(valueDim, function (value, idx) { var angle; if (isNaN(value)) { data.setItemLayout(idx, { angle: NaN, startAngle: NaN, endAngle: NaN, clockwise: clockwise, cx: cx, cy: cy, r0: r0, r: roseType ? NaN : r }); return; } // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样? if (roseType !== 'area') { angle = (sum === 0 && stillShowZeroSum) ? unitRadian : (value * unitRadian); } else { angle = PI2$4 / validDataCount; } if (angle < minAngle) { angle = minAngle; restAngle -= minAngle; } else { valueSumLargerThanMinAngle += value; } var endAngle = currentAngle + dir * angle; data.setItemLayout(idx, { angle: angle, startAngle: currentAngle, endAngle: endAngle, clockwise: clockwise, cx: cx, cy: cy, r0: r0, r: roseType ? linearMap(value, extent, [r0, r]) : r }); currentAngle = endAngle; }); // Some sector is constrained by minAngle // Rest sectors needs recalculate angle if (restAngle < PI2$4 && validDataCount) { // Average the angle if rest angle is not enough after all angles is // Constrained by minAngle if (restAngle <= 1e-3) { var angle = PI2$4 / validDataCount; data.each(valueDim, function (value, idx) { if (!isNaN(value)) { var layout = data.getItemLayout(idx); layout.angle = angle; layout.startAngle = startAngle + dir * idx * angle; layout.endAngle = startAngle + dir * (idx + 1) * angle; } }); } else { unitRadian = restAngle / valueSumLargerThanMinAngle; currentAngle = startAngle; data.each(valueDim, function (value, idx) { if (!isNaN(value)) { var layout = data.getItemLayout(idx); var angle = layout.angle === minAngle ? minAngle : value * unitRadian; layout.startAngle = currentAngle; layout.endAngle = currentAngle + dir * angle; currentAngle += dir * angle; } }); } } labelLayout(seriesModel, r, width, height); }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var dataFilter = function (seriesType) { return { seriesType: seriesType, reset: function (seriesModel, ecModel) { var legendModels = ecModel.findComponents({ mainType: 'legend' }); if (!legendModels || !legendModels.length) { return; } var data = seriesModel.getData(); data.filterSelf(function (idx) { var name = data.getName(idx); // If in any legend component the status is not selected. for (var i = 0; i < legendModels.length; i++) { if (!legendModels[i].isSelected(name)) { return false; } } return true; }); } }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ createDataSelectAction('pie', [{ type: 'pieToggleSelect', event: 'pieselectchanged', method: 'toggleSelected' }, { type: 'pieSelect', event: 'pieselected', method: 'select' }, { type: 'pieUnSelect', event: 'pieunselected', method: 'unSelect' }]); registerVisual(dataColor('pie')); registerLayout(curry(pieLayout, 'pie')); registerProcessor(dataFilter('pie')); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ SeriesModel.extend({ type: 'series.scatter', dependencies: ['grid', 'polar', 'geo', 'singleAxis', 'calendar'], getInitialData: function (option, ecModel) { return createListFromArray(this.getSource(), this); }, brushSelector: 'point', getProgressive: function () { var progressive = this.option.progressive; if (progressive == null) { // PENDING return this.option.large ? 5e3 : this.get('progressive'); } return progressive; }, getProgressiveThreshold: function () { var progressiveThreshold = this.option.progressiveThreshold; if (progressiveThreshold == null) { // PENDING return this.option.large ? 1e4 : this.get('progressiveThreshold'); } return progressiveThreshold; }, defaultOption: { coordinateSystem: 'cartesian2d', zlevel: 0, z: 2, legendHoverLink: true, hoverAnimation: true, // Cartesian coordinate system // xAxisIndex: 0, // yAxisIndex: 0, // Polar coordinate system // polarIndex: 0, // Geo coordinate system // geoIndex: 0, // symbol: null, // 图形类型 symbolSize: 10, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 // symbolRotate: null, // 图形旋转控制 large: false, // Available when large is true largeThreshold: 2000, // cursor: null, // label: { // show: false // distance: 5, // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // 默认使用全局文本样式,详见TEXTSTYLE // }, itemStyle: { opacity: 0.8 // color: 各异 } // progressive: null } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // TODO Batch by color var BOOST_SIZE_THRESHOLD = 4; var LargeSymbolPath = extendShape({ shape: { points: null }, symbolProxy: null, buildPath: function (path, shape) { var points = shape.points; var size = shape.size; var symbolProxy = this.symbolProxy; var symbolProxyShape = symbolProxy.shape; var ctx = path.getContext ? path.getContext() : path; var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD; // Do draw in afterBrush. if (canBoost) { return; } for (var i = 0; i < points.length;) { var x = points[i++]; var y = points[i++]; if (isNaN(x) || isNaN(y)) { continue; } symbolProxyShape.x = x - size[0] / 2; symbolProxyShape.y = y - size[1] / 2; symbolProxyShape.width = size[0]; symbolProxyShape.height = size[1]; symbolProxy.buildPath(path, symbolProxyShape, true); } }, afterBrush: function (ctx) { var shape = this.shape; var points = shape.points; var size = shape.size; var canBoost = size[0] < BOOST_SIZE_THRESHOLD; if (!canBoost) { return; } this.setTransform(ctx); // PENDING If style or other canvas status changed? for (var i = 0; i < points.length;) { var x = points[i++]; var y = points[i++]; if (isNaN(x) || isNaN(y)) { continue; } // fillRect is faster than building a rect path and draw. // And it support light globalCompositeOperation. ctx.fillRect( x - size[0] / 2, y - size[1] / 2, size[0], size[1] ); } this.restoreTransform(ctx); }, findDataIndex: function (x, y) { // TODO ??? // Consider transform var shape = this.shape; var points = shape.points; var size = shape.size; var w = Math.max(size[0], 4); var h = Math.max(size[1], 4); // Not consider transform // Treat each element as a rect // top down traverse for (var idx = points.length / 2 - 1; idx >= 0; idx--) { var i = idx * 2; var x0 = points[i] - w / 2; var y0 = points[i + 1] - h / 2; if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) { return idx; } } return -1; } }); function LargeSymbolDraw() { this.group = new Group(); } var largeSymbolProto = LargeSymbolDraw.prototype; largeSymbolProto.isPersistent = function () { return !this._incremental; }; /** * Update symbols draw by new data * @param {module:echarts/data/List} data */ largeSymbolProto.updateData = function (data) { this.group.removeAll(); var symbolEl = new LargeSymbolPath({ rectHover: true, cursor: 'default' }); symbolEl.setShape({ points: data.getLayout('symbolPoints') }); this._setCommon(symbolEl, data); this.group.add(symbolEl); this._incremental = null; }; largeSymbolProto.updateLayout = function (data) { if (this._incremental) { return; } var points = data.getLayout('symbolPoints'); this.group.eachChild(function (child) { if (child.startIndex != null) { var len = (child.endIndex - child.startIndex) * 2; var byteOffset = child.startIndex * 4 * 2; points = new Float32Array(points.buffer, byteOffset, len); } child.setShape('points', points); }); }; largeSymbolProto.incrementalPrepareUpdate = function (data) { this.group.removeAll(); this._clearIncremental(); // Only use incremental displayables when data amount is larger than 2 million. // PENDING Incremental data? if (data.count() > 2e6) { if (!this._incremental) { this._incremental = new IncrementalDisplayble({ silent: true }); } this.group.add(this._incremental); } else { this._incremental = null; } }; largeSymbolProto.incrementalUpdate = function (taskParams, data) { var symbolEl; if (this._incremental) { symbolEl = new LargeSymbolPath(); this._incremental.addDisplayable(symbolEl, true); } else { symbolEl = new LargeSymbolPath({ rectHover: true, cursor: 'default', startIndex: taskParams.start, endIndex: taskParams.end }); symbolEl.incremental = true; this.group.add(symbolEl); } symbolEl.setShape({ points: data.getLayout('symbolPoints') }); this._setCommon(symbolEl, data, !!this._incremental); }; largeSymbolProto._setCommon = function (symbolEl, data, isIncremental) { var hostModel = data.hostModel; // TODO // if (data.hasItemVisual.symbolSize) { // // TODO typed array? // symbolEl.setShape('sizes', data.mapArray( // function (idx) { // var size = data.getItemVisual(idx, 'symbolSize'); // return (size instanceof Array) ? size : [size, size]; // } // )); // } // else { var size = data.getVisual('symbolSize'); symbolEl.setShape('size', (size instanceof Array) ? size : [size, size]); // } // Create symbolProxy to build path for each data symbolEl.symbolProxy = createSymbol( data.getVisual('symbol'), 0, 0, 0, 0 ); // Use symbolProxy setColor method symbolEl.setColor = symbolEl.symbolProxy.setColor; var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD; symbolEl.useStyle( // Draw shadow when doing fillRect is extremely slow. hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']) ); var visualColor = data.getVisual('color'); if (visualColor) { symbolEl.setColor(visualColor); } if (!isIncremental) { // Enable tooltip // PENDING May have performance issue when path is extremely large symbolEl.seriesIndex = hostModel.seriesIndex; symbolEl.on('mousemove', function (e) { symbolEl.dataIndex = null; var dataIndex = symbolEl.findDataIndex(e.offsetX, e.offsetY); if (dataIndex >= 0) { // Provide dataIndex for tooltip symbolEl.dataIndex = dataIndex + (symbolEl.startIndex || 0); } }); } }; largeSymbolProto.remove = function () { this._clearIncremental(); this._incremental = null; this.group.removeAll(); }; largeSymbolProto._clearIncremental = function () { var incremental = this._incremental; if (incremental) { incremental.clearDisplaybles(); } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ extendChartView({ type: 'scatter', render: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var symbolDraw = this._updateSymbolDraw(data, seriesModel); symbolDraw.updateData(data); this._finished = true; }, incrementalPrepareRender: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var symbolDraw = this._updateSymbolDraw(data, seriesModel); symbolDraw.incrementalPrepareUpdate(data); this._finished = false; }, incrementalRender: function (taskParams, seriesModel, ecModel) { this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData()); this._finished = taskParams.end === seriesModel.getData().count(); }, updateTransform: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); // Must mark group dirty and make sure the incremental layer will be cleared // PENDING this.group.dirty(); if (!this._finished || data.count() > 1e4 || !this._symbolDraw.isPersistent()) { return { update: true }; } else { var res = pointsLayout().reset(seriesModel); if (res.progress) { res.progress({ start: 0, end: data.count() }, data); } this._symbolDraw.updateLayout(data); } }, _updateSymbolDraw: function (data, seriesModel) { var symbolDraw = this._symbolDraw; var pipelineContext = seriesModel.pipelineContext; var isLargeDraw = pipelineContext.large; if (!symbolDraw || isLargeDraw !== this._isLargeDraw) { symbolDraw && symbolDraw.remove(); symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw() : new SymbolDraw(); this._isLargeDraw = isLargeDraw; this.group.removeAll(); } this.group.add(symbolDraw.group); return symbolDraw; }, remove: function (ecModel, api) { this._symbolDraw && this._symbolDraw.remove(true); this._symbolDraw = null; }, dispose: function () {} }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // import * as zrUtil from 'zrender/src/core/util'; // In case developer forget to include grid component registerVisual(visualSymbol('scatter', 'circle')); registerLayout(pointsLayout('scatter')); // echarts.registerProcessor(function (ecModel, api) { // ecModel.eachSeriesByType('scatter', function (seriesModel) { // var data = seriesModel.getData(); // var coordSys = seriesModel.coordinateSystem; // if (coordSys.type !== 'geo') { // return; // } // var startPt = coordSys.pointToData([0, 0]); // var endPt = coordSys.pointToData([api.getWidth(), api.getHeight()]); // var dims = zrUtil.map(coordSys.dimensions, function (dim) { // return data.mapDimension(dim); // }); // var range = {}; // range[dims[0]] = [Math.min(startPt[0], endPt[0]), Math.max(startPt[0], endPt[0])]; // range[dims[1]] = [Math.min(startPt[1], endPt[1]), Math.max(startPt[1], endPt[1])]; // data.selectRange(range); // }); // }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function IndicatorAxis(dim, scale, radiusExtent) { Axis.call(this, dim, scale, radiusExtent); /** * Axis type * - 'category' * - 'value' * - 'time' * - 'log' * @type {string} */ this.type = 'value'; this.angle = 0; /** * Indicator name * @type {string} */ this.name = ''; /** * @type {module:echarts/model/Model} */ this.model; } inherits(IndicatorAxis, Axis); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // TODO clockwise function Radar(radarModel, ecModel, api) { this._model = radarModel; /** * Radar dimensions * @type {Array.} */ this.dimensions = []; this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) { var dim = 'indicator_' + idx; var indicatorAxis = new IndicatorAxis(dim, new IntervalScale()); indicatorAxis.name = indicatorModel.get('name'); // Inject model and axis indicatorAxis.model = indicatorModel; indicatorModel.axis = indicatorAxis; this.dimensions.push(dim); return indicatorAxis; }, this); this.resize(radarModel, api); /** * @type {number} * @readOnly */ this.cx; /** * @type {number} * @readOnly */ this.cy; /** * @type {number} * @readOnly */ this.r; /** * @type {number} * @readOnly */ this.startAngle; } Radar.prototype.getIndicatorAxes = function () { return this._indicatorAxes; }; Radar.prototype.dataToPoint = function (value, indicatorIndex) { var indicatorAxis = this._indicatorAxes[indicatorIndex]; return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex); }; Radar.prototype.coordToPoint = function (coord, indicatorIndex) { var indicatorAxis = this._indicatorAxes[indicatorIndex]; var angle = indicatorAxis.angle; var x = this.cx + coord * Math.cos(angle); var y = this.cy - coord * Math.sin(angle); return [x, y]; }; Radar.prototype.pointToData = function (pt) { var dx = pt[0] - this.cx; var dy = pt[1] - this.cy; var radius = Math.sqrt(dx * dx + dy * dy); dx /= radius; dy /= radius; var radian = Math.atan2(-dy, dx); // Find the closest angle // FIXME index can calculated directly var minRadianDiff = Infinity; var closestAxis; var closestAxisIdx = -1; for (var i = 0; i < this._indicatorAxes.length; i++) { var indicatorAxis = this._indicatorAxes[i]; var diff = Math.abs(radian - indicatorAxis.angle); if (diff < minRadianDiff) { closestAxis = indicatorAxis; closestAxisIdx = i; minRadianDiff = diff; } } return [closestAxisIdx, +(closestAxis && closestAxis.coodToData(radius))]; }; Radar.prototype.resize = function (radarModel, api) { var center = radarModel.get('center'); var viewWidth = api.getWidth(); var viewHeight = api.getHeight(); var viewSize = Math.min(viewWidth, viewHeight) / 2; this.cx = parsePercent$1(center[0], viewWidth); this.cy = parsePercent$1(center[1], viewHeight); this.startAngle = radarModel.get('startAngle') * Math.PI / 180; this.r = parsePercent$1(radarModel.get('radius'), viewSize); each$1(this._indicatorAxes, function (indicatorAxis, idx) { indicatorAxis.setExtent(0, this.r); var angle = (this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length); // Normalize to [-PI, PI] angle = Math.atan2(Math.sin(angle), Math.cos(angle)); indicatorAxis.angle = angle; }, this); }; Radar.prototype.update = function (ecModel, api) { var indicatorAxes = this._indicatorAxes; var radarModel = this._model; each$1(indicatorAxes, function (indicatorAxis) { indicatorAxis.scale.setExtent(Infinity, -Infinity); }); ecModel.eachSeriesByType('radar', function (radarSeries, idx) { if (radarSeries.get('coordinateSystem') !== 'radar' || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel ) { return; } var data = radarSeries.getData(); each$1(indicatorAxes, function (indicatorAxis) { indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim)); }); }, this); var splitNumber = radarModel.get('splitNumber'); function increaseInterval(interval) { var exp10 = Math.pow(10, Math.floor(Math.log(interval) / Math.LN10)); // Increase interval var f = interval / exp10; if (f === 2) { f = 5; } else { // f is 2 or 5 f *= 2; } return f * exp10; } // Force all the axis fixing the maxSplitNumber. each$1(indicatorAxes, function (indicatorAxis, idx) { var rawExtent = getScaleExtent(indicatorAxis.scale, indicatorAxis.model); niceScaleExtent(indicatorAxis.scale, indicatorAxis.model); var axisModel = indicatorAxis.model; var scale = indicatorAxis.scale; var fixedMin = axisModel.getMin(); var fixedMax = axisModel.getMax(); var interval = scale.getInterval(); if (fixedMin != null && fixedMax != null) { // User set min, max, divide to get new interval scale.setExtent(+fixedMin, +fixedMax); scale.setInterval( (fixedMax - fixedMin) / splitNumber ); } else if (fixedMin != null) { var max; // User set min, expand extent on the other side do { max = fixedMin + interval * splitNumber; scale.setExtent(+fixedMin, max); // Interval must been set after extent // FIXME scale.setInterval(interval); interval = increaseInterval(interval); } while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1])); } else if (fixedMax != null) { var min; // User set min, expand extent on the other side do { min = fixedMax - interval * splitNumber; scale.setExtent(min, +fixedMax); scale.setInterval(interval); interval = increaseInterval(interval); } while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0])); } else { var nicedSplitNumber = scale.getTicks().length - 1; if (nicedSplitNumber > splitNumber) { interval = increaseInterval(interval); } // PENDING var center = Math.round((rawExtent[0] + rawExtent[1]) / 2 / interval) * interval; var halfSplitNumber = Math.round(splitNumber / 2); scale.setExtent( round$1(center - halfSplitNumber * interval), round$1(center + (splitNumber - halfSplitNumber) * interval) ); scale.setInterval(interval); } }); }; /** * Radar dimensions is based on the data * @type {Array} */ Radar.dimensions = []; Radar.create = function (ecModel, api) { var radarList = []; ecModel.eachComponent('radar', function (radarModel) { var radar = new Radar(radarModel, ecModel, api); radarList.push(radar); radarModel.coordinateSystem = radar; }); ecModel.eachSeriesByType('radar', function (radarSeries) { if (radarSeries.get('coordinateSystem') === 'radar') { // Inject coordinate system radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0]; } }); return radarList; }; CoordinateSystemManager.register('radar', Radar); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var valueAxisDefault = axisDefault.valueAxis; function defaultsShow(opt, show) { return defaults({ show: show }, opt); } var RadarModel = extendComponentModel({ type: 'radar', optionUpdated: function () { var boundaryGap = this.get('boundaryGap'); var splitNumber = this.get('splitNumber'); var scale = this.get('scale'); var axisLine = this.get('axisLine'); var axisTick = this.get('axisTick'); var axisLabel = this.get('axisLabel'); var nameTextStyle = this.get('name'); var showName = this.get('name.show'); var nameFormatter = this.get('name.formatter'); var nameGap = this.get('nameGap'); var triggerEvent = this.get('triggerEvent'); var indicatorModels = map(this.get('indicator') || [], function (indicatorOpt) { // PENDING if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) { indicatorOpt.min = 0; } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) { indicatorOpt.max = 0; } var iNameTextStyle = nameTextStyle; if(indicatorOpt.color != null) { iNameTextStyle = defaults({color: indicatorOpt.color}, nameTextStyle); } // Use same configuration indicatorOpt = merge(clone(indicatorOpt), { boundaryGap: boundaryGap, splitNumber: splitNumber, scale: scale, axisLine: axisLine, axisTick: axisTick, axisLabel: axisLabel, // Competitable with 2 and use text name: indicatorOpt.text, nameLocation: 'end', nameGap: nameGap, // min: 0, nameTextStyle: iNameTextStyle, triggerEvent: triggerEvent }, false); if (!showName) { indicatorOpt.name = ''; } if (typeof nameFormatter === 'string') { var indName = indicatorOpt.name; indicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : ''); } else if (typeof nameFormatter === 'function') { indicatorOpt.name = nameFormatter( indicatorOpt.name, indicatorOpt ); } var model = extend( new Model(indicatorOpt, null, this.ecModel), axisModelCommonMixin ); // For triggerEvent. model.mainType = 'radar'; model.componentIndex = this.componentIndex; return model; }, this); this.getIndicatorModels = function () { return indicatorModels; }; }, defaultOption: { zlevel: 0, z: 0, center: ['50%', '50%'], radius: '75%', startAngle: 90, name: { show: true // formatter: null // textStyle: {} }, boundaryGap: [0, 0], splitNumber: 5, nameGap: 15, scale: false, // Polygon or circle shape: 'polygon', axisLine: merge( { lineStyle: { color: '#bbb' } }, valueAxisDefault.axisLine ), axisLabel: defaultsShow(valueAxisDefault.axisLabel, false), axisTick: defaultsShow(valueAxisDefault.axisTick, false), splitLine: defaultsShow(valueAxisDefault.splitLine, true), splitArea: defaultsShow(valueAxisDefault.splitArea, true), // {text, min, max} indicator: [] } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var axisBuilderAttrs$1 = [ 'axisLine', 'axisTickLabel', 'axisName' ]; extendComponentView({ type: 'radar', render: function (radarModel, ecModel, api) { var group = this.group; group.removeAll(); this._buildAxes(radarModel); this._buildSplitLineAndArea(radarModel); }, _buildAxes: function (radarModel) { var radar = radarModel.coordinateSystem; var indicatorAxes = radar.getIndicatorAxes(); var axisBuilders = map(indicatorAxes, function (indicatorAxis) { var axisBuilder = new AxisBuilder(indicatorAxis.model, { position: [radar.cx, radar.cy], rotation: indicatorAxis.angle, labelDirection: -1, tickDirection: -1, nameDirection: 1 }); return axisBuilder; }); each$1(axisBuilders, function (axisBuilder) { each$1(axisBuilderAttrs$1, axisBuilder.add, axisBuilder); this.group.add(axisBuilder.getGroup()); }, this); }, _buildSplitLineAndArea: function (radarModel) { var radar = radarModel.coordinateSystem; var indicatorAxes = radar.getIndicatorAxes(); if (!indicatorAxes.length) { return; } var shape = radarModel.get('shape'); var splitLineModel = radarModel.getModel('splitLine'); var splitAreaModel = radarModel.getModel('splitArea'); var lineStyleModel = splitLineModel.getModel('lineStyle'); var areaStyleModel = splitAreaModel.getModel('areaStyle'); var showSplitLine = splitLineModel.get('show'); var showSplitArea = splitAreaModel.get('show'); var splitLineColors = lineStyleModel.get('color'); var splitAreaColors = areaStyleModel.get('color'); splitLineColors = isArray(splitLineColors) ? splitLineColors : [splitLineColors]; splitAreaColors = isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors]; var splitLines = []; var splitAreas = []; function getColorIndex(areaOrLine, areaOrLineColorList, idx) { var colorIndex = idx % areaOrLineColorList.length; areaOrLine[colorIndex] = areaOrLine[colorIndex] || []; return colorIndex; } if (shape === 'circle') { var ticksRadius = indicatorAxes[0].getTicksCoords(); var cx = radar.cx; var cy = radar.cy; for (var i = 0; i < ticksRadius.length; i++) { if (showSplitLine) { var colorIndex = getColorIndex(splitLines, splitLineColors, i); splitLines[colorIndex].push(new Circle({ shape: { cx: cx, cy: cy, r: ticksRadius[i].coord } })); } if (showSplitArea && i < ticksRadius.length - 1) { var colorIndex = getColorIndex(splitAreas, splitAreaColors, i); splitAreas[colorIndex].push(new Ring({ shape: { cx: cx, cy: cy, r0: ticksRadius[i].coord, r: ticksRadius[i + 1].coord } })); } } } // Polyyon else { var realSplitNumber; var axesTicksPoints = map(indicatorAxes, function (indicatorAxis, idx) { var ticksCoords = indicatorAxis.getTicksCoords(); realSplitNumber = realSplitNumber == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber); return map(ticksCoords, function (tickCoord) { return radar.coordToPoint(tickCoord.coord, idx); }); }); var prevPoints = []; for (var i = 0; i <= realSplitNumber; i++) { var points = []; for (var j = 0; j < indicatorAxes.length; j++) { points.push(axesTicksPoints[j][i]); } // Close if (points[0]) { points.push(points[0].slice()); } else { if (__DEV__) { console.error('Can\'t draw value axis ' + i); } } if (showSplitLine) { var colorIndex = getColorIndex(splitLines, splitLineColors, i); splitLines[colorIndex].push(new Polyline({ shape: { points: points } })); } if (showSplitArea && prevPoints) { var colorIndex = getColorIndex(splitAreas, splitAreaColors, i - 1); splitAreas[colorIndex].push(new Polygon({ shape: { points: points.concat(prevPoints) } })); } prevPoints = points.slice().reverse(); } } var lineStyle = lineStyleModel.getLineStyle(); var areaStyle = areaStyleModel.getAreaStyle(); // Add splitArea before splitLine each$1(splitAreas, function (splitAreas, idx) { this.group.add(mergePath( splitAreas, { style: defaults({ stroke: 'none', fill: splitAreaColors[idx % splitAreaColors.length] }, areaStyle), silent: true } )); }, this); each$1(splitLines, function (splitLines, idx) { this.group.add(mergePath( splitLines, { style: defaults({ fill: 'none', stroke: splitLineColors[idx % splitLineColors.length] }, lineStyle), silent: true } )); }, this); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var RadarSeries = SeriesModel.extend({ type: 'series.radar', dependencies: ['radar'], // Overwrite init: function (option) { RadarSeries.superApply(this, 'init', arguments); // Enable legend selection for each data item // Use a function instead of direct access because data reference may changed this.legendDataProvider = function () { return this.getRawData(); }; }, getInitialData: function (option, ecModel) { return createListSimply(this, { generateCoord: 'indicator_', generateCoordCount: Infinity }); }, formatTooltip: function (dataIndex) { var data = this.getData(); var coordSys = this.coordinateSystem; var indicatorAxes = coordSys.getIndicatorAxes(); var name = this.getData().getName(dataIndex); return encodeHTML(name === '' ? this.name : name) + '
          ' + map(indicatorAxes, function (axis, idx) { var val = data.get(data.mapDimension(axis.dim), dataIndex); return encodeHTML(axis.name + ' : ' + val); }).join('
          '); }, defaultOption: { zlevel: 0, z: 2, coordinateSystem: 'radar', legendHoverLink: true, radarIndex: 0, lineStyle: { width: 2, type: 'solid' }, label: { position: 'top' }, // areaStyle: { // }, // itemStyle: {} symbol: 'emptyCircle', symbolSize: 4 // symbolRotate: null } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function normalizeSymbolSize(symbolSize) { if (!isArray(symbolSize)) { symbolSize = [+symbolSize, +symbolSize]; } return symbolSize; } extendChartView({ type: 'radar', render: function (seriesModel, ecModel, api) { var polar = seriesModel.coordinateSystem; var group = this.group; var data = seriesModel.getData(); var oldData = this._data; function createSymbol$$1(data, idx) { var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; var color = data.getItemVisual(idx, 'color'); if (symbolType === 'none') { return; } var symbolSize = normalizeSymbolSize( data.getItemVisual(idx, 'symbolSize') ); var symbolPath = createSymbol( symbolType, -1, -1, 2, 2, color ); symbolPath.attr({ style: { strokeNoScale: true }, z2: 100, scale: [symbolSize[0] / 2, symbolSize[1] / 2] }); return symbolPath; } function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) { // Simply rerender all symbolGroup.removeAll(); for (var i = 0; i < newPoints.length - 1; i++) { var symbolPath = createSymbol$$1(data, idx); if (symbolPath) { symbolPath.__dimIdx = i; if (oldPoints[i]) { symbolPath.attr('position', oldPoints[i]); graphic[isInit ? 'initProps' : 'updateProps']( symbolPath, { position: newPoints[i] }, seriesModel, idx ); } else { symbolPath.attr('position', newPoints[i]); } symbolGroup.add(symbolPath); } } } function getInitialPoints(points) { return map(points, function (pt) { return [polar.cx, polar.cy]; }); } data.diff(oldData) .add(function (idx) { var points = data.getItemLayout(idx); if (!points) { return; } var polygon = new Polygon(); var polyline = new Polyline(); var target = { shape: { points: points } }; polygon.shape.points = getInitialPoints(points); polyline.shape.points = getInitialPoints(points); initProps(polygon, target, seriesModel, idx); initProps(polyline, target, seriesModel, idx); var itemGroup = new Group(); var symbolGroup = new Group(); itemGroup.add(polyline); itemGroup.add(polygon); itemGroup.add(symbolGroup); updateSymbols( polyline.shape.points, points, symbolGroup, data, idx, true ); data.setItemGraphicEl(idx, itemGroup); }) .update(function (newIdx, oldIdx) { var itemGroup = oldData.getItemGraphicEl(oldIdx); var polyline = itemGroup.childAt(0); var polygon = itemGroup.childAt(1); var symbolGroup = itemGroup.childAt(2); var target = { shape: { points: data.getItemLayout(newIdx) } }; if (!target.shape.points) { return; } updateSymbols( polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false ); updateProps(polyline, target, seriesModel); updateProps(polygon, target, seriesModel); data.setItemGraphicEl(newIdx, itemGroup); }) .remove(function (idx) { group.remove(oldData.getItemGraphicEl(idx)); }) .execute(); data.eachItemGraphicEl(function (itemGroup, idx) { var itemModel = data.getItemModel(idx); var polyline = itemGroup.childAt(0); var polygon = itemGroup.childAt(1); var symbolGroup = itemGroup.childAt(2); var color = data.getItemVisual(idx, 'color'); group.add(itemGroup); polyline.useStyle( defaults( itemModel.getModel('lineStyle').getLineStyle(), { fill: 'none', stroke: color } ) ); polyline.hoverStyle = itemModel.getModel('emphasis.lineStyle').getLineStyle(); var areaStyleModel = itemModel.getModel('areaStyle'); var hoverAreaStyleModel = itemModel.getModel('emphasis.areaStyle'); var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty(); var hoverPolygonIgnore = hoverAreaStyleModel.isEmpty() && hoverAreaStyleModel.parentModel.isEmpty(); hoverPolygonIgnore = hoverPolygonIgnore && polygonIgnore; polygon.ignore = polygonIgnore; polygon.useStyle( defaults( areaStyleModel.getAreaStyle(), { fill: color, opacity: 0.7 } ) ); polygon.hoverStyle = hoverAreaStyleModel.getAreaStyle(); var itemStyle = itemModel.getModel('itemStyle').getItemStyle(['color']); var itemHoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); var labelModel = itemModel.getModel('label'); var labelHoverModel = itemModel.getModel('emphasis.label'); symbolGroup.eachChild(function (symbolPath) { symbolPath.setStyle(itemStyle); symbolPath.hoverStyle = clone(itemHoverStyle); setLabelStyle( symbolPath.style, symbolPath.hoverStyle, labelModel, labelHoverModel, { labelFetcher: data.hostModel, labelDataIndex: idx, labelDimIndex: symbolPath.__dimIdx, defaultText: data.get(data.dimensions[symbolPath.__dimIdx], idx), autoColor: color, isRectText: true } ); }); function onEmphasis() { polygon.attr('ignore', hoverPolygonIgnore); } function onNormal() { polygon.attr('ignore', polygonIgnore); } itemGroup.off('mouseover').off('mouseout').off('normal').off('emphasis'); itemGroup.on('emphasis', onEmphasis) .on('mouseover', onEmphasis) .on('normal', onNormal) .on('mouseout', onNormal); setHoverStyle(itemGroup); }); this._data = data; }, remove: function () { this.group.removeAll(); this._data = null; }, dispose: function () {} }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var radarLayout = function (ecModel) { ecModel.eachSeriesByType('radar', function (seriesModel) { var data = seriesModel.getData(); var points = []; var coordSys = seriesModel.coordinateSystem; if (!coordSys) { return; } function pointsConverter(val, idx) { points[idx] = points[idx] || []; points[idx][i] = coordSys.dataToPoint(val, i); } var axes = coordSys.getIndicatorAxes(); for (var i = 0; i < axes.length; i++) { data.each(data.mapDimension(axes[i].dim), pointsConverter); } data.each(function (idx) { // Close polygon points[idx][0] && points[idx].push(points[idx][0].slice()); data.setItemLayout(idx, points[idx]); }); }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Backward compat for radar chart in 2 var backwardCompat$1 = function (option) { var polarOptArr = option.polar; if (polarOptArr) { if (!isArray(polarOptArr)) { polarOptArr = [polarOptArr]; } var polarNotRadar = []; each$1(polarOptArr, function (polarOpt, idx) { if (polarOpt.indicator) { if (polarOpt.type && !polarOpt.shape) { polarOpt.shape = polarOpt.type; } option.radar = option.radar || []; if (!isArray(option.radar)) { option.radar = [option.radar]; } option.radar.push(polarOpt); } else { polarNotRadar.push(polarOpt); } }); option.polar = polarNotRadar; } each$1(option.series, function (seriesOpt) { if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) { seriesOpt.radarIndex = seriesOpt.polarIndex; } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Must use radar component registerVisual(dataColor('radar')); registerVisual(visualSymbol('radar', 'circle')); registerLayout(radarLayout); registerProcessor(dataFilter('radar')); registerPreprocessor(backwardCompat$1); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Simple view coordinate system * Mapping given x, y to transformd view x, y */ var v2ApplyTransform$1 = applyTransform; // Dummy transform node function TransformDummy() { Transformable.call(this); } mixin(TransformDummy, Transformable); function View(name) { /** * @type {string} */ this.name = name; /** * @type {Object} */ this.zoomLimit; Transformable.call(this); this._roamTransformable = new TransformDummy(); this._rawTransformable = new TransformDummy(); this._center; this._zoom; } View.prototype = { constructor: View, type: 'view', /** * @param {Array.} * @readOnly */ dimensions: ['x', 'y'], /** * Set bounding rect * @param {number} x * @param {number} y * @param {number} width * @param {number} height */ // PENDING to getRect setBoundingRect: function (x, y, width, height) { this._rect = new BoundingRect(x, y, width, height); return this._rect; }, /** * @return {module:zrender/core/BoundingRect} */ // PENDING to getRect getBoundingRect: function () { return this._rect; }, /** * @param {number} x * @param {number} y * @param {number} width * @param {number} height */ setViewRect: function (x, y, width, height) { this.transformTo(x, y, width, height); this._viewRect = new BoundingRect(x, y, width, height); }, /** * Transformed to particular position and size * @param {number} x * @param {number} y * @param {number} width * @param {number} height */ transformTo: function (x, y, width, height) { var rect = this.getBoundingRect(); var rawTransform = this._rawTransformable; rawTransform.transform = rect.calculateTransform( new BoundingRect(x, y, width, height) ); rawTransform.decomposeTransform(); this._updateTransform(); }, /** * Set center of view * @param {Array.} [centerCoord] */ setCenter: function (centerCoord) { if (!centerCoord) { return; } this._center = centerCoord; this._updateCenterAndZoom(); }, /** * @param {number} zoom */ setZoom: function (zoom) { zoom = zoom || 1; var zoomLimit = this.zoomLimit; if (zoomLimit) { if (zoomLimit.max != null) { zoom = Math.min(zoomLimit.max, zoom); } if (zoomLimit.min != null) { zoom = Math.max(zoomLimit.min, zoom); } } this._zoom = zoom; this._updateCenterAndZoom(); }, /** * Get default center without roam */ getDefaultCenter: function () { // Rect before any transform var rawRect = this.getBoundingRect(); var cx = rawRect.x + rawRect.width / 2; var cy = rawRect.y + rawRect.height / 2; return [cx, cy]; }, getCenter: function () { return this._center || this.getDefaultCenter(); }, getZoom: function () { return this._zoom || 1; }, /** * @return {Array.} data * @param {boolean} noRoam * @param {Array.} [out] * @return {Array.} */ dataToPoint: function (data, noRoam, out) { var transform = noRoam ? this._rawTransform : this.transform; out = out || []; return transform ? v2ApplyTransform$1(out, data, transform) : copy(out, data); }, /** * Convert a (x, y) point to (lon, lat) data * @param {Array.} point * @return {Array.} */ pointToData: function (point) { var invTransform = this.invTransform; return invTransform ? v2ApplyTransform$1([], point, invTransform) : [point[0], point[1]]; }, /** * @implements * see {module:echarts/CoodinateSystem} */ convertToPixel: curry(doConvert$1, 'dataToPoint'), /** * @implements * see {module:echarts/CoodinateSystem} */ convertFromPixel: curry(doConvert$1, 'pointToData'), /** * @implements * see {module:echarts/CoodinateSystem} */ containPoint: function (point) { return this.getViewRectAfterRoam().contain(point[0], point[1]); } /** * @return {number} */ // getScalarScale: function () { // // Use determinant square root of transform to mutiply scalar // var m = this.transform; // var det = Math.sqrt(Math.abs(m[0] * m[3] - m[2] * m[1])); // return det; // } }; mixin(View, Transformable); function doConvert$1(methodName, ecModel, finder, value) { var seriesModel = finder.seriesModel; var coordSys = seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph. return coordSys === this ? coordSys[methodName](value) : null; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Fix for 南海诸岛 var geoCoord = [126, 25]; var points$1 = [ [[0,3.5],[7,11.2],[15,11.9],[30,7],[42,0.7],[52,0.7], [56,7.7],[59,0.7],[64,0.7],[64,0],[5,0],[0,3.5]], [[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]], [[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]], [[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]], [[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]], [[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]], [[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]], [[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]], [[51,35],[51,28.7],[53,28.7],[53,35],[51,35]], [[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]], [[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]], [[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4], [1,92.4],[1,3.5],[0,3.5]] ]; for (var i$1 = 0; i$1 < points$1.length; i$1++) { for (var k = 0; k < points$1[i$1].length; k++) { points$1[i$1][k][0] /= 10.5; points$1[i$1][k][1] /= -10.5 / 0.75; points$1[i$1][k][0] += geoCoord[0]; points$1[i$1][k][1] += geoCoord[1]; } } var fixNanhai = function (geo) { if (geo.map === 'china') { geo.regions.push(new Region( '南海诸岛', map(points$1, function (exterior) { return { type: 'polygon', exterior: exterior }; }), geoCoord )); } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var coordsOffsetMap = { '南海诸岛' : [32, 80], // 全国 '广东': [0, -10], '香港': [10, 5], '澳门': [-10, 10], //'北京': [-10, 0], '天津': [5, 5] }; var fixTextCoord = function (geo) { each$1(geo.regions, function (region) { var coordFix = coordsOffsetMap[region.name]; if (coordFix) { var cp = region.center; cp[0] += coordFix[0] / 10.5; cp[1] += -coordFix[1] / (10.5 / 0.75); } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var geoCoordMap = { 'Russia': [100, 60], 'United States': [-99, 38], 'United States of America': [-99, 38] }; var fixGeoCoord = function (geo) { each$1(geo.regions, function (region) { var geoCoord = geoCoordMap[region.name]; if (geoCoord) { var cp = region.center; cp[0] = geoCoord[0]; cp[1] = geoCoord[1]; } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Fix for 钓鱼岛 // var Region = require('../Region'); // var zrUtil = require('zrender/src/core/util'); // var geoCoord = [126, 25]; var points$2 = [ [ [123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261] ] ]; var fixDiaoyuIsland = function (geo) { if (geo.map === 'china') { for (var i = 0, len = geo.regions.length; i < len; ++i) { if (geo.regions[i].name === '台湾') { geo.regions[i].geometries.push({ type: 'polygon', exterior: points$2[0] }); } } } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Geo fix functions var geoFixFuncs = [ fixNanhai, fixTextCoord, fixGeoCoord, fixDiaoyuIsland ]; /** * [Geo description] * @param {string} name Geo name * @param {string} map Map type * @param {Object} geoJson * @param {Object} [specialAreas] * Specify the positioned areas by left, top, width, height * @param {Object.} [nameMap] * Specify name alias */ function Geo(name, map$$1, geoJson, specialAreas, nameMap) { View.call(this, name); /** * Map type * @type {string} */ this.map = map$$1; this._nameCoordMap = createHashMap(); this.loadGeoJson(geoJson, specialAreas, nameMap); } Geo.prototype = { constructor: Geo, type: 'geo', /** * @param {Array.} * @readOnly */ dimensions: ['lng', 'lat'], /** * If contain given lng,lat coord * @param {Array.} * @readOnly */ containCoord: function (coord) { var regions = this.regions; for (var i = 0; i < regions.length; i++) { if (regions[i].contain(coord)) { return true; } } return false; }, /** * @param {Object} geoJson * @param {Object} [specialAreas] * Specify the positioned areas by left, top, width, height * @param {Object.} [nameMap] * Specify name alias */ loadGeoJson: function (geoJson, specialAreas, nameMap) { // https://jsperf.com/try-catch-performance-overhead try { this.regions = geoJson ? parseGeoJson$1(geoJson) : []; } catch (e) { throw 'Invalid geoJson format\n' + e.message; } specialAreas = specialAreas || {}; nameMap = nameMap || {}; var regions = this.regions; var regionsMap = createHashMap(); for (var i = 0; i < regions.length; i++) { var regionName = regions[i].name; // Try use the alias in nameMap regionName = nameMap.hasOwnProperty(regionName) ? nameMap[regionName] : regionName; regions[i].name = regionName; regionsMap.set(regionName, regions[i]); // Add geoJson this.addGeoCoord(regionName, regions[i].center); // Some area like Alaska in USA map needs to be tansformed // to look better var specialArea = specialAreas[regionName]; if (specialArea) { regions[i].transformTo( specialArea.left, specialArea.top, specialArea.width, specialArea.height ); } } this._regionsMap = regionsMap; this._rect = null; each$1(geoFixFuncs, function (fixFunc) { fixFunc(this); }, this); }, // Overwrite transformTo: function (x, y, width, height) { var rect = this.getBoundingRect(); rect = rect.clone(); // Longitute is inverted rect.y = -rect.y - rect.height; var rawTransformable = this._rawTransformable; rawTransformable.transform = rect.calculateTransform( new BoundingRect(x, y, width, height) ); rawTransformable.decomposeTransform(); var scale = rawTransformable.scale; scale[1] = -scale[1]; rawTransformable.updateTransform(); this._updateTransform(); }, /** * @param {string} name * @return {module:echarts/coord/geo/Region} */ getRegion: function (name) { return this._regionsMap.get(name); }, getRegionByCoord: function (coord) { var regions = this.regions; for (var i = 0; i < regions.length; i++) { if (regions[i].contain(coord)) { return regions[i]; } } }, /** * Add geoCoord for indexing by name * @param {string} name * @param {Array.} geoCoord */ addGeoCoord: function (name, geoCoord) { this._nameCoordMap.set(name, geoCoord); }, /** * Get geoCoord by name * @param {string} name * @return {Array.} */ getGeoCoord: function (name) { return this._nameCoordMap.get(name); }, // Overwrite getBoundingRect: function () { if (this._rect) { return this._rect; } var rect; var regions = this.regions; for (var i = 0; i < regions.length; i++) { var regionRect = regions[i].getBoundingRect(); rect = rect || regionRect.clone(); rect.union(regionRect); } // FIXME Always return new ? return (this._rect = rect || new BoundingRect(0, 0, 0, 0)); }, /** * @param {string|Array.} data * @param {boolean} noRoam * @param {Array.} [out] * @return {Array.} */ dataToPoint: function (data, noRoam, out) { if (typeof data === 'string') { // Map area name to geoCoord data = this.getGeoCoord(data); } if (data) { return View.prototype.dataToPoint.call(this, data, noRoam, out); } }, /** * @inheritDoc */ convertToPixel: curry(doConvert, 'dataToPoint'), /** * @inheritDoc */ convertFromPixel: curry(doConvert, 'pointToData') }; mixin(Geo, View); function doConvert(methodName, ecModel, finder, value) { var geoModel = finder.geoModel; var seriesModel = finder.seriesModel; var coordSys = geoModel ? geoModel.coordinateSystem : seriesModel ? ( seriesModel.coordinateSystem // For map. || (seriesModel.getReferringComponents('geo')[0] || {}).coordinateSystem ) : null; return coordSys === this ? coordSys[methodName](value) : null; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Resize method bound to the geo * @param {module:echarts/coord/geo/GeoModel|module:echarts/chart/map/MapModel} geoModel * @param {module:echarts/ExtensionAPI} api */ function resizeGeo(geoModel, api) { var boundingCoords = geoModel.get('boundingCoords'); if (boundingCoords != null) { var leftTop = boundingCoords[0]; var rightBottom = boundingCoords[1]; if (isNaN(leftTop[0]) || isNaN(leftTop[1]) || isNaN(rightBottom[0]) || isNaN(rightBottom[1])) { if (__DEV__) { console.error('Invalid boundingCoords'); } } else { this.setBoundingRect(leftTop[0], leftTop[1], rightBottom[0] - leftTop[0], rightBottom[1] - leftTop[1]); } } var rect = this.getBoundingRect(); var boxLayoutOption; var center = geoModel.get('layoutCenter'); var size = geoModel.get('layoutSize'); var viewWidth = api.getWidth(); var viewHeight = api.getHeight(); var aspectScale = geoModel.get('aspectScale') || 0.75; var aspect = rect.width / rect.height * aspectScale; var useCenterAndSize = false; if (center && size) { center = [ parsePercent$1(center[0], viewWidth), parsePercent$1(center[1], viewHeight) ]; size = parsePercent$1(size, Math.min(viewWidth, viewHeight)); if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) { useCenterAndSize = true; } else { if (__DEV__) { console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.'); } } } var viewRect; if (useCenterAndSize) { var viewRect = {}; if (aspect > 1) { // Width is same with size viewRect.width = size; viewRect.height = size / aspect; } else { viewRect.height = size; viewRect.width = size * aspect; } viewRect.y = center[1] - viewRect.height / 2; viewRect.x = center[0] - viewRect.width / 2; } else { // Use left/top/width/height boxLayoutOption = geoModel.getBoxLayoutParams(); // 0.75 rate boxLayoutOption.aspect = aspect; viewRect = getLayoutRect(boxLayoutOption, { width: viewWidth, height: viewHeight }); } this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height); this.setCenter(geoModel.get('center')); this.setZoom(geoModel.get('zoom')); } /** * @param {module:echarts/coord/Geo} geo * @param {module:echarts/model/Model} model * @inner */ function setGeoCoords(geo, model) { each$1(model.get('geoCoord'), function (geoCoord, name) { geo.addGeoCoord(name, geoCoord); }); } if (__DEV__) { var mapNotExistsError = function (name) { console.error('Map ' + name + ' not exists. You can download map file on http://echarts.baidu.com/download-map.html'); }; } var geoCreator = { // For deciding which dimensions to use when creating list data dimensions: Geo.prototype.dimensions, create: function (ecModel, api) { var geoList = []; // FIXME Create each time may be slow ecModel.eachComponent('geo', function (geoModel, idx) { var name = geoModel.get('map'); var mapData = getMap(name); if (__DEV__) { if (!mapData) { mapNotExistsError(name); } } var geo = new Geo( name + idx, name, mapData && mapData.geoJson, mapData && mapData.specialAreas, geoModel.get('nameMap') ); geo.zoomLimit = geoModel.get('scaleLimit'); geoList.push(geo); setGeoCoords(geo, geoModel); geoModel.coordinateSystem = geo; geo.model = geoModel; // Inject resize method geo.resize = resizeGeo; geo.resize(geoModel, api); }); ecModel.eachSeries(function (seriesModel) { var coordSys = seriesModel.get('coordinateSystem'); if (coordSys === 'geo') { var geoIndex = seriesModel.get('geoIndex') || 0; seriesModel.coordinateSystem = geoList[geoIndex]; } }); // If has map series var mapModelGroupBySeries = {}; ecModel.eachSeriesByType('map', function (seriesModel) { if (!seriesModel.getHostGeoModel()) { var mapType = seriesModel.getMapType(); mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || []; mapModelGroupBySeries[mapType].push(seriesModel); } }); each$1(mapModelGroupBySeries, function (mapSeries, mapType) { var mapData = getMap(mapType); if (__DEV__) { if (!mapData) { mapNotExistsError(mapSeries[0].get('map')); } } var nameMapList = map(mapSeries, function (singleMapSeries) { return singleMapSeries.get('nameMap'); }); var geo = new Geo( mapType, mapType, mapData && mapData.geoJson, mapData && mapData.specialAreas, mergeAll(nameMapList) ); geo.zoomLimit = retrieve.apply(null, map(mapSeries, function (singleMapSeries) { return singleMapSeries.get('scaleLimit'); })); geoList.push(geo); // Inject resize method geo.resize = resizeGeo; geo.resize(mapSeries[0], api); each$1(mapSeries, function (singleMapSeries) { singleMapSeries.coordinateSystem = geo; setGeoCoords(geo, singleMapSeries); }); }); return geoList; }, /** * Fill given regions array * @param {Array.} originRegionArr * @param {string} mapName * @param {Object} [nameMap] * @return {Array} */ getFilledRegions: function (originRegionArr, mapName, nameMap) { // Not use the original var regionsArr = (originRegionArr || []).slice(); nameMap = nameMap || {}; var map$$1 = getMap(mapName); var geoJson = map$$1 && map$$1.geoJson; if (!geoJson) { if (__DEV__) { mapNotExistsError(mapName); } return originRegionArr; } var dataNameMap = createHashMap(); var features = geoJson.features; for (var i = 0; i < regionsArr.length; i++) { dataNameMap.set(regionsArr[i].name, regionsArr[i]); } for (var i = 0; i < features.length; i++) { var name = features[i].properties.name; if (!dataNameMap.get(name)) { if (nameMap.hasOwnProperty(name)) { name = nameMap[name]; } regionsArr.push({ name: name }); } } return regionsArr; } }; registerCoordinateSystem('geo', geoCreator); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var MapSeries = SeriesModel.extend({ type: 'series.map', dependencies: ['geo'], layoutMode: 'box', /** * Only first map series of same mapType will drawMap * @type {boolean} */ needsDrawMap: false, /** * Group of all map series with same mapType * @type {boolean} */ seriesGroup: [], init: function (option) { // this._fillOption(option, this.getMapType()); // this.option = option; MapSeries.superApply(this, 'init', arguments); this.updateSelectedMap(this._createSelectableList()); }, getInitialData: function (option) { return createListSimply(this, ['value']); }, mergeOption: function (newOption) { // this._fillOption(newOption, this.getMapType()); MapSeries.superApply(this, 'mergeOption', arguments); this.updateSelectedMap(this._createSelectableList()); }, _createSelectableList: function () { var data = this.getRawData(); var valueDim = data.mapDimension('value'); var targetList = []; for (var i = 0, len = data.count(); i < len; i++) { targetList.push({ name: data.getName(i), value: data.get(valueDim, i), selected: retrieveRawAttr(data, i, 'selected') }); } targetList = geoCreator.getFilledRegions(targetList, this.getMapType(), this.option.nameMap); return targetList; }, /** * If no host geo model, return null, which means using a * inner exclusive geo model. */ getHostGeoModel: function () { var geoIndex = this.option.geoIndex; return geoIndex != null ? this.dependentModels.geo[geoIndex] : null; }, getMapType: function () { return (this.getHostGeoModel() || this).option.map; }, _fillOption: function (option, mapName) { // Shallow clone // option = zrUtil.extend({}, option); // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap); // return option; }, getRawValue: function (dataIndex) { // Use value stored in data instead because it is calculated from multiple series // FIXME Provide all value of multiple series ? var data = this.getData(); return data.get(data.mapDimension('value'), dataIndex); }, /** * Get model of region * @param {string} name * @return {module:echarts/model/Model} */ getRegionModel: function (regionName) { var data = this.getData(); return data.getItemModel(data.indexOfName(regionName)); }, /** * Map tooltip formatter * * @param {number} dataIndex */ formatTooltip: function (dataIndex) { // FIXME orignalData and data is a bit confusing var data = this.getData(); var formattedValue = addCommas(this.getRawValue(dataIndex)); var name = data.getName(dataIndex); var seriesGroup = this.seriesGroup; var seriesNames = []; for (var i = 0; i < seriesGroup.length; i++) { var otherIndex = seriesGroup[i].originalData.indexOfName(name); var valueDim = data.mapDimension('value'); if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) { seriesNames.push( encodeHTML(seriesGroup[i].name) ); } } return seriesNames.join(', ') + '
          ' + encodeHTML(name + ' : ' + formattedValue); }, /** * @implement */ getTooltipPosition: function (dataIndex) { if (dataIndex != null) { var name = this.getData().getName(dataIndex); var geo = this.coordinateSystem; var region = geo.getRegion(name); return region && geo.dataToPoint(region.center); } }, setZoom: function (zoom) { this.option.zoom = zoom; }, setCenter: function (center) { this.option.center = center; }, defaultOption: { // 一级层叠 zlevel: 0, // 二级层叠 z: 2, coordinateSystem: 'geo', // map should be explicitly specified since ec3. map: '', // If `geoIndex` is not specified, a exclusive geo will be // created. Otherwise use the specified geo component, and // `map` and `mapType` are ignored. // geoIndex: 0, // 'center' | 'left' | 'right' | 'x%' | {number} left: 'center', // 'center' | 'top' | 'bottom' | 'x%' | {number} top: 'center', // right // bottom // width: // height // Aspect is width / height. Inited to be geoJson bbox aspect // This parameter is used for scale this aspect aspectScale: 0.75, ///// Layout with center and size // If you wan't to put map in a fixed size box with right aspect ratio // This two properties may more conveninet // layoutCenter: [50%, 50%] // layoutSize: 100 // 数值合并方式,默认加和,可选为: // 'sum' | 'average' | 'max' | 'min' // mapValueCalculation: 'sum', // 地图数值计算结果小数精度 // mapValuePrecision: 0, // 显示图例颜色标识(系列标识的小圆点),图例开启时有效 showLegendSymbol: true, // 选择模式,默认关闭,可选single,multiple // selectedMode: false, dataRangeHoverLink: true, // 是否开启缩放及漫游模式 // roam: false, // Define left-top, right-bottom coords to control view // For example, [ [180, 90], [-180, -90] ], // higher priority than center and zoom boundingCoords: null, // Default on center of map center: null, zoom: 1, scaleLimit: null, label: { show: false, color: '#000' }, // scaleLimit: null, itemStyle: { borderWidth: 0.5, borderColor: '#444', areaColor: '#eee' }, emphasis: { label: { show: true, color: 'rgb(100,0,0)' }, itemStyle: { areaColor: 'rgba(255,215,0,0.8)' } } } }); mixin(MapSeries, selectableMixin); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var ATTR = '\0_ec_interaction_mutex'; function take(zr, resourceKey, userKey) { var store = getStore(zr); store[resourceKey] = userKey; } function release(zr, resourceKey, userKey) { var store = getStore(zr); var uKey = store[resourceKey]; if (uKey === userKey) { store[resourceKey] = null; } } function isTaken(zr, resourceKey) { return !!getStore(zr)[resourceKey]; } function getStore(zr) { return zr[ATTR] || (zr[ATTR] = {}); } /** * payload: { * type: 'takeGlobalCursor', * key: 'dataZoomSelect', or 'brush', or ..., * If no userKey, release global cursor. * } */ registerAction( {type: 'takeGlobalCursor', event: 'globalCursorTaken', update: 'update'}, function () {} ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @alias module:echarts/component/helper/RoamController * @constructor * @mixin {module:zrender/mixin/Eventful} * * @param {module:zrender/zrender~ZRender} zr */ function RoamController(zr) { /** * @type {Function} */ this.pointerChecker; /** * @type {module:zrender} */ this._zr = zr; /** * @type {Object} */ this._opt = {}; // Avoid two roamController bind the same handler var bind$$1 = bind; var mousedownHandler = bind$$1(mousedown, this); var mousemoveHandler = bind$$1(mousemove, this); var mouseupHandler = bind$$1(mouseup, this); var mousewheelHandler = bind$$1(mousewheel, this); var pinchHandler = bind$$1(pinch, this); Eventful.call(this); /** * @param {Function} pointerChecker * input: x, y * output: boolean */ this.setPointerChecker = function (pointerChecker) { this.pointerChecker = pointerChecker; }; /** * Notice: only enable needed types. For example, if 'zoom' * is not needed, 'zoom' should not be enabled, otherwise * default mousewheel behaviour (scroll page) will be disabled. * * @param {boolean|string} [controlType=true] Specify the control type, * which can be null/undefined or true/false * or 'pan/move' or 'zoom'/'scale' * @param {Object} [opt] * @param {Object} [opt.zoomOnMouseWheel=true] * @param {Object} [opt.moveOnMouseMove=true] * @param {Object} [opt.preventDefaultMouseMove=true] When pan. */ this.enable = function (controlType, opt) { // Disable previous first this.disable(); this._opt = defaults(clone(opt) || {}, { zoomOnMouseWheel: true, moveOnMouseMove: true, preventDefaultMouseMove: true }); if (controlType == null) { controlType = true; } if (controlType === true || (controlType === 'move' || controlType === 'pan')) { zr.on('mousedown', mousedownHandler); zr.on('mousemove', mousemoveHandler); zr.on('mouseup', mouseupHandler); } if (controlType === true || (controlType === 'scale' || controlType === 'zoom')) { zr.on('mousewheel', mousewheelHandler); zr.on('pinch', pinchHandler); } }; this.disable = function () { zr.off('mousedown', mousedownHandler); zr.off('mousemove', mousemoveHandler); zr.off('mouseup', mouseupHandler); zr.off('mousewheel', mousewheelHandler); zr.off('pinch', pinchHandler); }; this.dispose = this.disable; this.isDragging = function () { return this._dragging; }; this.isPinching = function () { return this._pinching; }; } mixin(RoamController, Eventful); function mousedown(e) { if (notLeftMouse(e) || (e.target && e.target.draggable) ) { return; } var x = e.offsetX; var y = e.offsetY; // Only check on mosedown, but not mousemove. // Mouse can be out of target when mouse moving. if (this.pointerChecker && this.pointerChecker(e, x, y)) { this._x = x; this._y = y; this._dragging = true; } } function mousemove(e) { if (notLeftMouse(e) || !checkKeyBinding(this, 'moveOnMouseMove', e) || !this._dragging || e.gestureEvent === 'pinch' || isTaken(this._zr, 'globalPan') ) { return; } var x = e.offsetX; var y = e.offsetY; var oldX = this._x; var oldY = this._y; var dx = x - oldX; var dy = y - oldY; this._x = x; this._y = y; this._opt.preventDefaultMouseMove && stop(e.event); this.trigger('pan', dx, dy, oldX, oldY, x, y); } function mouseup(e) { if (!notLeftMouse(e)) { this._dragging = false; } } function mousewheel(e) { // wheelDelta maybe -0 in chrome mac. if (!checkKeyBinding(this, 'zoomOnMouseWheel', e) || e.wheelDelta === 0) { return; } // Convenience: // Mac and VM Windows on Mac: scroll up: zoom out. // Windows: scroll up: zoom in. var zoomDelta = e.wheelDelta > 0 ? 1.1 : 1 / 1.1; zoom.call(this, e, zoomDelta, e.offsetX, e.offsetY); } function pinch(e) { if (isTaken(this._zr, 'globalPan')) { return; } var zoomDelta = e.pinchScale > 1 ? 1.1 : 1 / 1.1; zoom.call(this, e, zoomDelta, e.pinchX, e.pinchY); } function zoom(e, zoomDelta, zoomX, zoomY) { if (this.pointerChecker && this.pointerChecker(e, zoomX, zoomY)) { // When mouse is out of roamController rect, // default befavoius should not be be disabled, otherwise // page sliding is disabled, contrary to expectation. stop(e.event); this.trigger('zoom', zoomDelta, zoomX, zoomY); } } function checkKeyBinding(roamController, prop, e) { var setting = roamController._opt[prop]; return setting && (!isString(setting) || e.event[setting + 'Key']); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * For geo and graph. * * @param {Object} controllerHost * @param {module:zrender/Element} controllerHost.target */ function updateViewOnPan(controllerHost, dx, dy) { var target = controllerHost.target; var pos = target.position; pos[0] += dx; pos[1] += dy; target.dirty(); } /** * For geo and graph. * * @param {Object} controllerHost * @param {module:zrender/Element} controllerHost.target * @param {number} controllerHost.zoom * @param {number} controllerHost.zoomLimit like: {min: 1, max: 2} */ function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) { var target = controllerHost.target; var zoomLimit = controllerHost.zoomLimit; var pos = target.position; var scale = target.scale; var newZoom = controllerHost.zoom = controllerHost.zoom || 1; newZoom *= zoomDelta; if (zoomLimit) { var zoomMin = zoomLimit.min || 0; var zoomMax = zoomLimit.max || Infinity; newZoom = Math.max( Math.min(zoomMax, newZoom), zoomMin ); } var zoomScale = newZoom / controllerHost.zoom; controllerHost.zoom = newZoom; // Keep the mouse center when scaling pos[0] -= (zoomX - pos[0]) * (zoomScale - 1); pos[1] -= (zoomY - pos[1]) * (zoomScale - 1); scale[0] *= zoomScale; scale[1] *= zoomScale; target.dirty(); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var IRRELEVANT_EXCLUDES = {'axisPointer': 1, 'tooltip': 1, 'brush': 1}; /** * Avoid that: mouse click on a elements that is over geo or graph, * but roam is triggered. */ function onIrrelevantElement(e, api, targetCoordSysModel) { var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem. var coordSys = model && model.coordinateSystem; return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES[model.mainType] && (coordSys && coordSys.model !== targetCoordSysModel); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function getFixedItemStyle(model, scale) { var itemStyle = model.getItemStyle(); var areaColor = model.get('areaColor'); // If user want the color not to be changed when hover, // they should both set areaColor and color to be null. if (areaColor != null) { itemStyle.fill = areaColor; } return itemStyle; } function updateMapSelectHandler(mapDraw, mapOrGeoModel, group, api, fromView) { group.off('click'); group.off('mousedown'); if (mapOrGeoModel.get('selectedMode')) { group.on('mousedown', function () { mapDraw._mouseDownFlag = true; }); group.on('click', function (e) { if (!mapDraw._mouseDownFlag) { return; } mapDraw._mouseDownFlag = false; var el = e.target; while (!el.__regions) { el = el.parent; } if (!el) { return; } var action = { type: (mapOrGeoModel.mainType === 'geo' ? 'geo' : 'map') + 'ToggleSelect', batch: map(el.__regions, function (region) { return { name: region.name, from: fromView.uid }; }) }; action[mapOrGeoModel.mainType + 'Id'] = mapOrGeoModel.id; api.dispatchAction(action); updateMapSelected(mapOrGeoModel, group); }); } } function updateMapSelected(mapOrGeoModel, group) { // FIXME group.eachChild(function (otherRegionEl) { each$1(otherRegionEl.__regions, function (region) { otherRegionEl.trigger(mapOrGeoModel.isSelected(region.name) ? 'emphasis' : 'normal'); }); }); } /** * @alias module:echarts/component/helper/MapDraw * @param {module:echarts/ExtensionAPI} api * @param {boolean} updateGroup */ function MapDraw(api, updateGroup) { var group = new Group(); /** * @type {module:echarts/component/helper/RoamController} * @private */ this._controller = new RoamController(api.getZr()); /** * @type {Object} {target, zoom, zoomLimit} * @private */ this._controllerHost = {target: updateGroup ? group : null}; /** * @type {module:zrender/container/Group} * @readOnly */ this.group = group; /** * @type {boolean} * @private */ this._updateGroup = updateGroup; /** * This flag is used to make sure that only one among * `pan`, `zoom`, `click` can occurs, otherwise 'selected' * action may be triggered when `pan`, which is unexpected. * @type {booelan} */ this._mouseDownFlag; } MapDraw.prototype = { constructor: MapDraw, draw: function (mapOrGeoModel, ecModel, api, fromView, payload) { var isGeo = mapOrGeoModel.mainType === 'geo'; // Map series has data. GEO model that controlled by map series // will be assigned with map data. Other GEO model has no data. var data = mapOrGeoModel.getData && mapOrGeoModel.getData(); isGeo && ecModel.eachComponent({mainType: 'series', subType: 'map'}, function (mapSeries) { if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) { data = mapSeries.getData(); } }); var geo = mapOrGeoModel.coordinateSystem; var group = this.group; var scale = geo.scale; var groupNewProp = { position: geo.position, scale: scale }; // No animation when first draw or in action if (!group.childAt(0) || payload) { group.attr(groupNewProp); } else { updateProps(group, groupNewProp, mapOrGeoModel); } group.removeAll(); var itemStyleAccessPath = ['itemStyle']; var hoverItemStyleAccessPath = ['emphasis', 'itemStyle']; var labelAccessPath = ['label']; var hoverLabelAccessPath = ['emphasis', 'label']; var nameMap = createHashMap(); each$1(geo.regions, function (region) { // Consider in GeoJson properties.name may be duplicated, for example, // there is multiple region named "United Kindom" or "France" (so many // colonies). And it is not appropriate to merge them in geo, which // will make them share the same label and bring trouble in label // location calculation. var regionGroup = nameMap.get(region.name) || nameMap.set(region.name, new Group()); var compoundPath = new CompoundPath({ shape: { paths: [] } }); regionGroup.add(compoundPath); var regionModel = mapOrGeoModel.getRegionModel(region.name) || mapOrGeoModel; var itemStyleModel = regionModel.getModel(itemStyleAccessPath); var hoverItemStyleModel = regionModel.getModel(hoverItemStyleAccessPath); var itemStyle = getFixedItemStyle(itemStyleModel, scale); var hoverItemStyle = getFixedItemStyle(hoverItemStyleModel, scale); var labelModel = regionModel.getModel(labelAccessPath); var hoverLabelModel = regionModel.getModel(hoverLabelAccessPath); var dataIdx; // Use the itemStyle in data if has data if (data) { dataIdx = data.indexOfName(region.name); // Only visual color of each item will be used. It can be encoded by dataRange // But visual color of series is used in symbol drawing // // Visual color for each series is for the symbol draw var visualColor = data.getItemVisual(dataIdx, 'color', true); if (visualColor) { itemStyle.fill = visualColor; } } each$1(region.geometries, function (geometry) { if (geometry.type !== 'polygon') { return; } compoundPath.shape.paths.push(new Polygon({ shape: { points: geometry.exterior } })); for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); i++) { compoundPath.shape.paths.push(new Polygon({ shape: { points: geometry.interiors[i] } })); } }); compoundPath.setStyle(itemStyle); compoundPath.style.strokeNoScale = true; compoundPath.culling = true; // Label var showLabel = labelModel.get('show'); var hoverShowLabel = hoverLabelModel.get('show'); var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx)); var itemLayout = data && data.getItemLayout(dataIdx); // In the following cases label will be drawn // 1. In map series and data value is NaN // 2. In geo component // 4. Region has no series legendSymbol, which will be add a showLabel flag in mapSymbolLayout if ( (isGeo || isDataNaN && (showLabel || hoverShowLabel)) || (itemLayout && itemLayout.showLabel) ) { var query = !isGeo ? dataIdx : region.name; var labelFetcher; // Consider dataIdx not found. if (!data || dataIdx >= 0) { labelFetcher = mapOrGeoModel; } var textEl = new Text({ position: region.center.slice(), scale: [1 / scale[0], 1 / scale[1]], z2: 10, silent: true }); setLabelStyle( textEl.style, textEl.hoverStyle = {}, labelModel, hoverLabelModel, { labelFetcher: labelFetcher, labelDataIndex: query, defaultText: region.name, useInsideStyle: false }, { textAlign: 'center', textVerticalAlign: 'middle' } ); regionGroup.add(textEl); } // setItemGraphicEl, setHoverStyle after all polygons and labels // are added to the rigionGroup if (data) { data.setItemGraphicEl(dataIdx, regionGroup); } else { var regionModel = mapOrGeoModel.getRegionModel(region.name); // Package custom mouse event for geo component compoundPath.eventData = { componentType: 'geo', geoIndex: mapOrGeoModel.componentIndex, name: region.name, region: (regionModel && regionModel.option) || {} }; } var groupRegions = regionGroup.__regions || (regionGroup.__regions = []); groupRegions.push(region); setHoverStyle( regionGroup, hoverItemStyle, {hoverSilentOnTouch: !!mapOrGeoModel.get('selectedMode')} ); group.add(regionGroup); }); this._updateController(mapOrGeoModel, ecModel, api); updateMapSelectHandler(this, mapOrGeoModel, group, api, fromView); updateMapSelected(mapOrGeoModel, group); }, remove: function () { this.group.removeAll(); this._controller.dispose(); this._controllerHost = {}; }, _updateController: function (mapOrGeoModel, ecModel, api) { var geo = mapOrGeoModel.coordinateSystem; var controller = this._controller; var controllerHost = this._controllerHost; controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit'); controllerHost.zoom = geo.getZoom(); // roamType is will be set default true if it is null controller.enable(mapOrGeoModel.get('roam') || false); var mainType = mapOrGeoModel.mainType; function makeActionBase() { var action = { type: 'geoRoam', componentType: mainType }; action[mainType + 'Id'] = mapOrGeoModel.id; return action; } controller.off('pan').on('pan', function (dx, dy) { this._mouseDownFlag = false; updateViewOnPan(controllerHost, dx, dy); api.dispatchAction(extend(makeActionBase(), { dx: dx, dy: dy })); }, this); controller.off('zoom').on('zoom', function (zoom, mouseX, mouseY) { this._mouseDownFlag = false; updateViewOnZoom(controllerHost, zoom, mouseX, mouseY); api.dispatchAction(extend(makeActionBase(), { zoom: zoom, originX: mouseX, originY: mouseY })); if (this._updateGroup) { var group = this.group; var scale = group.scale; group.traverse(function (el) { if (el.type === 'text') { el.attr('scale', [1 / scale[0], 1 / scale[1]]); } }); } }, this); controller.setPointerChecker(function (e, x, y) { return geo.getViewRectAfterRoam().contain(x, y) && !onIrrelevantElement(e, api, mapOrGeoModel); }); } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ extendChartView({ type: 'map', render: function (mapModel, ecModel, api, payload) { // Not render if it is an toggleSelect action from self if (payload && payload.type === 'mapToggleSelect' && payload.from === this.uid ) { return; } var group = this.group; group.removeAll(); if (mapModel.getHostGeoModel()) { return; } // Not update map if it is an roam action from self if (!(payload && payload.type === 'geoRoam' && payload.componentType === 'series' && payload.seriesId === mapModel.id ) ) { if (mapModel.needsDrawMap) { var mapDraw = this._mapDraw || new MapDraw(api, true); group.add(mapDraw.group); mapDraw.draw(mapModel, ecModel, api, this, payload); this._mapDraw = mapDraw; } else { // Remove drawed map this._mapDraw && this._mapDraw.remove(); this._mapDraw = null; } } else { var mapDraw = this._mapDraw; mapDraw && group.add(mapDraw.group); } mapModel.get('showLegendSymbol') && ecModel.getComponent('legend') && this._renderSymbols(mapModel, ecModel, api); }, remove: function () { this._mapDraw && this._mapDraw.remove(); this._mapDraw = null; this.group.removeAll(); }, dispose: function () { this._mapDraw && this._mapDraw.remove(); this._mapDraw = null; }, _renderSymbols: function (mapModel, ecModel, api) { var originalData = mapModel.originalData; var group = this.group; originalData.each(originalData.mapDimension('value'), function (value, idx) { if (isNaN(value)) { return; } var layout = originalData.getItemLayout(idx); if (!layout || !layout.point) { // Not exists in map return; } var point = layout.point; var offset = layout.offset; var circle = new Circle({ style: { // Because the special of map draw. // Which needs statistic of multiple series and draw on one map. // And each series also need a symbol with legend color // // Layout and visual are put one the different data fill: mapModel.getData().getVisual('color') }, shape: { cx: point[0] + offset * 9, cy: point[1], r: 3 }, silent: true, // Do not overlap the first series, on which labels are displayed. z2: !offset ? 10 : 8 }); // First data on the same region if (!offset) { var fullData = mapModel.mainSeries.getData(); var name = originalData.getName(idx); var fullIndex = fullData.indexOfName(name); var itemModel = originalData.getItemModel(idx); var labelModel = itemModel.getModel('label'); var hoverLabelModel = itemModel.getModel('emphasis.label'); var polygonGroups = fullData.getItemGraphicEl(fullIndex); var normalText = retrieve2( mapModel.getFormattedLabel(idx, 'normal'), name ); var emphasisText = retrieve2( mapModel.getFormattedLabel(idx, 'emphasis'), normalText ); var onEmphasis = function () { var hoverStyle = setTextStyle({}, hoverLabelModel, { text: hoverLabelModel.get('show') ? emphasisText : null }, {isRectText: true, useInsideStyle: false}, true); circle.style.extendFrom(hoverStyle); // Make label upper than others if overlaps. circle.__mapOriginalZ2 = circle.z2; circle.z2 += 1; }; var onNormal = function () { setTextStyle(circle.style, labelModel, { text: labelModel.get('show') ? normalText : null, textPosition: labelModel.getShallow('position') || 'bottom' }, {isRectText: true, useInsideStyle: false}); if (circle.__mapOriginalZ2 != null) { circle.z2 = circle.__mapOriginalZ2; circle.__mapOriginalZ2 = null; } }; polygonGroups.on('mouseover', onEmphasis) .on('mouseout', onNormal) .on('emphasis', onEmphasis) .on('normal', onNormal); onNormal(); } group.add(circle); }); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @param {module:echarts/coord/View} view * @param {Object} payload * @param {Object} [zoomLimit] */ function updateCenterAndZoom( view, payload, zoomLimit ) { var previousZoom = view.getZoom(); var center = view.getCenter(); var zoom = payload.zoom; var point = view.dataToPoint(center); if (payload.dx != null && payload.dy != null) { point[0] -= payload.dx; point[1] -= payload.dy; var center = view.pointToData(point); view.setCenter(center); } if (zoom != null) { if (zoomLimit) { var zoomMin = zoomLimit.min || 0; var zoomMax = zoomLimit.max || Infinity; zoom = Math.max( Math.min(previousZoom * zoom, zoomMax), zoomMin ) / previousZoom; } // Zoom on given point(originX, originY) view.scale[0] *= zoom; view.scale[1] *= zoom; var position = view.position; var fixX = (payload.originX - position[0]) * (zoom - 1); var fixY = (payload.originY - position[1]) * (zoom - 1); position[0] -= fixX; position[1] -= fixY; view.updateTransform(); // Get the new center var center = view.pointToData(point); view.setCenter(center); view.setZoom(zoom * previousZoom); } return { center: view.getCenter(), zoom: view.getZoom() }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @payload * @property {string} [componentType=series] * @property {number} [dx] * @property {number} [dy] * @property {number} [zoom] * @property {number} [originX] * @property {number} [originY] */ registerAction({ type: 'geoRoam', event: 'geoRoam', update: 'updateTransform' }, function (payload, ecModel) { var componentType = payload.componentType || 'series'; ecModel.eachComponent( { mainType: componentType, query: payload }, function (componentModel) { var geo = componentModel.coordinateSystem; if (geo.type !== 'geo') { return; } var res = updateCenterAndZoom( geo, payload, componentModel.get('scaleLimit') ); componentModel.setCenter && componentModel.setCenter(res.center); componentModel.setZoom && componentModel.setZoom(res.zoom); // All map series with same `map` use the same geo coordinate system // So the center and zoom must be in sync. Include the series not selected by legend if (componentType === 'series') { each$1(componentModel.seriesGroup, function (seriesModel) { seriesModel.setCenter(res.center); seriesModel.setZoom(res.zoom); }); } } ); }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var mapSymbolLayout = function (ecModel) { var processedMapType = {}; ecModel.eachSeriesByType('map', function (mapSeries) { var mapType = mapSeries.getMapType(); if (mapSeries.getHostGeoModel() || processedMapType[mapType]) { return; } var mapSymbolOffsets = {}; each$1(mapSeries.seriesGroup, function (subMapSeries) { var geo = subMapSeries.coordinateSystem; var data = subMapSeries.originalData; if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) { data.each(data.mapDimension('value'), function (value, idx) { var name = data.getName(idx); var region = geo.getRegion(name); // If input series.data is [11, 22, '-'/null/undefined, 44], // it will be filled with NaN: [11, 22, NaN, 44] and NaN will // not be drawn. So here must validate if value is NaN. if (!region || isNaN(value)) { return; } var offset = mapSymbolOffsets[name] || 0; var point = geo.dataToPoint(region.center); mapSymbolOffsets[name] = offset + 1; data.setItemLayout(idx, { point: point, offset: offset }); }); } }); // Show label of those region not has legendSymbol(which is offset 0) var data = mapSeries.getData(); data.each(function (idx) { var name = data.getName(idx); var layout = data.getItemLayout(idx) || {}; layout.showLabel = !mapSymbolOffsets[name]; data.setItemLayout(idx, layout); }); processedMapType[mapType] = true; }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var mapVisual = function (ecModel) { ecModel.eachSeriesByType('map', function (seriesModel) { var colorList = seriesModel.get('color'); var itemStyleModel = seriesModel.getModel('itemStyle'); var areaColor = itemStyleModel.get('areaColor'); var color = itemStyleModel.get('color') || colorList[seriesModel.seriesIndex % colorList.length]; seriesModel.getData().setVisual({ 'areaColor': areaColor, 'color': color }); }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // FIXME 公用? /** * @param {Array.} datas * @param {string} statisticType 'average' 'sum' * @inner */ function dataStatistics(datas, statisticType) { var dataNameMap = {}; each$1(datas, function (data) { data.each(data.mapDimension('value'), function (value, idx) { // Add prefix to avoid conflict with Object.prototype. var mapKey = 'ec-' + data.getName(idx); dataNameMap[mapKey] = dataNameMap[mapKey] || []; if (!isNaN(value)) { dataNameMap[mapKey].push(value); } }); }); return datas[0].map(datas[0].mapDimension('value'), function (value, idx) { var mapKey = 'ec-' + datas[0].getName(idx); var sum = 0; var min = Infinity; var max = -Infinity; var len = dataNameMap[mapKey].length; for (var i = 0; i < len; i++) { min = Math.min(min, dataNameMap[mapKey][i]); max = Math.max(max, dataNameMap[mapKey][i]); sum += dataNameMap[mapKey][i]; } var result; if (statisticType === 'min') { result = min; } else if (statisticType === 'max') { result = max; } else if (statisticType === 'average') { result = sum / len; } else { result = sum; } return len === 0 ? NaN : result; }); } var mapDataStatistic = function (ecModel) { var seriesGroups = {}; ecModel.eachSeriesByType('map', function (seriesModel) { var hostGeoModel = seriesModel.getHostGeoModel(); var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType(); (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel); }); each$1(seriesGroups, function (seriesList, key) { var data = dataStatistics( map(seriesList, function (seriesModel) { return seriesModel.getData(); }), seriesList[0].get('mapValueCalculation') ); for (var i = 0; i < seriesList.length; i++) { seriesList[i].originalData = seriesList[i].getData(); } // FIXME Put where? for (var i = 0; i < seriesList.length; i++) { seriesList[i].seriesGroup = seriesList; seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel(); seriesList[i].setData(data.cloneShallow()); seriesList[i].mainSeries = seriesList[0]; } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var backwardCompat$2 = function (option) { // Save geoCoord var mapSeries = []; each$1(option.series, function (seriesOpt) { if (seriesOpt && seriesOpt.type === 'map') { mapSeries.push(seriesOpt); seriesOpt.map = seriesOpt.map || seriesOpt.mapType; // Put x, y, width, height, x2, y2 in the top level defaults(seriesOpt, seriesOpt.mapLocation); } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerLayout(mapSymbolLayout); registerVisual(mapVisual); registerProcessor(PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic); registerPreprocessor(backwardCompat$2); createDataSelectAction('map', [{ type: 'mapToggleSelect', event: 'mapselectchanged', method: 'toggleSelected' }, { type: 'mapSelect', event: 'mapselected', method: 'select' }, { type: 'mapUnSelect', event: 'mapunselected', method: 'unSelect' }]); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Link lists and struct (graph or tree) */ var each$7 = each$1; var DATAS = '\0__link_datas'; var MAIN_DATA = '\0__link_mainData'; // Caution: // In most case, either list or its shallow clones (see list.cloneShallow) // is active in echarts process. So considering heap memory consumption, // we do not clone tree or graph, but share them among list and its shallow clones. // But in some rare case, we have to keep old list (like do animation in chart). So // please take care that both the old list and the new list share the same tree/graph. /** * @param {Object} opt * @param {module:echarts/data/List} opt.mainData * @param {Object} [opt.struct] For example, instance of Graph or Tree. * @param {string} [opt.structAttr] designation: list[structAttr] = struct; * @param {Object} [opt.datas] {dataType: data}, * like: {node: nodeList, edge: edgeList}. * Should contain mainData. * @param {Object} [opt.datasAttr] {dataType: attr}, * designation: struct[datasAttr[dataType]] = list; */ function linkList(opt) { var mainData = opt.mainData; var datas = opt.datas; if (!datas) { datas = {main: mainData}; opt.datasAttr = {main: 'data'}; } opt.datas = opt.mainData = null; linkAll(mainData, datas, opt); // Porxy data original methods. each$7(datas, function (data) { each$7(mainData.TRANSFERABLE_METHODS, function (methodName) { data.wrapMethod(methodName, curry(transferInjection, opt)); }); }); // Beyond transfer, additional features should be added to `cloneShallow`. mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); // Only mainData trigger change, because struct.update may trigger // another changable methods, which may bring about dead lock. each$7(mainData.CHANGABLE_METHODS, function (methodName) { mainData.wrapMethod(methodName, curry(changeInjection, opt)); }); // Make sure datas contains mainData. assert$1(datas[mainData.dataType] === mainData); } function transferInjection(opt, res) { if (isMainData(this)) { // Transfer datas to new main data. var datas = extend({}, this[DATAS]); datas[this.dataType] = res; linkAll(res, datas, opt); } else { // Modify the reference in main data to point newData. linkSingle(res, this.dataType, this[MAIN_DATA], opt); } return res; } function changeInjection(opt, res) { opt.struct && opt.struct.update(this); return res; } function cloneShallowInjection(opt, res) { // cloneShallow, which brings about some fragilities, may be inappropriate // to be exposed as an API. So for implementation simplicity we can make // the restriction that cloneShallow of not-mainData should not be invoked // outside, but only be invoked here. each$7(res[DATAS], function (data, dataType) { data !== res && linkSingle(data.cloneShallow(), dataType, res, opt); }); return res; } /** * Supplement method to List. * * @public * @param {string} [dataType] If not specified, return mainData. * @return {module:echarts/data/List} */ function getLinkedData(dataType) { var mainData = this[MAIN_DATA]; return (dataType == null || mainData == null) ? mainData : mainData[DATAS][dataType]; } function isMainData(data) { return data[MAIN_DATA] === data; } function linkAll(mainData, datas, opt) { mainData[DATAS] = {}; each$7(datas, function (data, dataType) { linkSingle(data, dataType, mainData, opt); }); } function linkSingle(data, dataType, mainData, opt) { mainData[DATAS][dataType] = data; data[MAIN_DATA] = mainData; data.dataType = dataType; if (opt.struct) { data[opt.structAttr] = opt.struct; opt.struct[opt.datasAttr[dataType]] = data; } // Supplement method. data.getLinkedData = getLinkedData; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Tree data structure * * @module echarts/data/Tree */ /** * @constructor module:echarts/data/Tree~TreeNode * @param {string} name * @param {module:echarts/data/Tree} hostTree */ var TreeNode = function (name, hostTree) { /** * @type {string} */ this.name = name || ''; /** * Depth of node * * @type {number} * @readOnly */ this.depth = 0; /** * Height of the subtree rooted at this node. * @type {number} * @readOnly */ this.height = 0; /** * @type {module:echarts/data/Tree~TreeNode} * @readOnly */ this.parentNode = null; /** * Reference to list item. * Do not persistent dataIndex outside, * besause it may be changed by list. * If dataIndex -1, * this node is logical deleted (filtered) in list. * * @type {Object} * @readOnly */ this.dataIndex = -1; /** * @type {Array.} * @readOnly */ this.children = []; /** * @type {Array.} * @pubilc */ this.viewChildren = []; /** * @type {moduel:echarts/data/Tree} * @readOnly */ this.hostTree = hostTree; }; TreeNode.prototype = { constructor: TreeNode, /** * The node is removed. * @return {boolean} is removed. */ isRemoved: function () { return this.dataIndex < 0; }, /** * Travel this subtree (include this node). * Usage: * node.eachNode(function () { ... }); // preorder * node.eachNode('preorder', function () { ... }); // preorder * node.eachNode('postorder', function () { ... }); // postorder * node.eachNode( * {order: 'postorder', attr: 'viewChildren'}, * function () { ... } * ); // postorder * * @param {(Object|string)} options If string, means order. * @param {string=} options.order 'preorder' or 'postorder' * @param {string=} options.attr 'children' or 'viewChildren' * @param {Function} cb If in preorder and return false, * its subtree will not be visited. * @param {Object} [context] */ eachNode: function (options, cb, context) { if (typeof options === 'function') { context = cb; cb = options; options = null; } options = options || {}; if (isString(options)) { options = {order: options}; } var order = options.order || 'preorder'; var children = this[options.attr || 'children']; var suppressVisitSub; order === 'preorder' && (suppressVisitSub = cb.call(context, this)); for (var i = 0; !suppressVisitSub && i < children.length; i++) { children[i].eachNode(options, cb, context); } order === 'postorder' && cb.call(context, this); }, /** * Update depth and height of this subtree. * * @param {number} depth */ updateDepthAndHeight: function (depth) { var height = 0; this.depth = depth; for (var i = 0; i < this.children.length; i++) { var child = this.children[i]; child.updateDepthAndHeight(depth + 1); if (child.height > height) { height = child.height; } } this.height = height + 1; }, /** * @param {string} id * @return {module:echarts/data/Tree~TreeNode} */ getNodeById: function (id) { if (this.getId() === id) { return this; } for (var i = 0, children = this.children, len = children.length; i < len; i++) { var res = children[i].getNodeById(id); if (res) { return res; } } }, /** * @param {module:echarts/data/Tree~TreeNode} node * @return {boolean} */ contains: function (node) { if (node === this) { return true; } for (var i = 0, children = this.children, len = children.length; i < len; i++) { var res = children[i].contains(node); if (res) { return res; } } }, /** * @param {boolean} includeSelf Default false. * @return {Array.} order: [root, child, grandchild, ...] */ getAncestors: function (includeSelf) { var ancestors = []; var node = includeSelf ? this : this.parentNode; while (node) { ancestors.push(node); node = node.parentNode; } ancestors.reverse(); return ancestors; }, /** * @param {string|Array=} [dimension='value'] Default 'value'. can be 0, 1, 2, 3 * @return {number} Value. */ getValue: function (dimension) { var data = this.hostTree.data; return data.get(data.getDimension(dimension || 'value'), this.dataIndex); }, /** * @param {Object} layout * @param {boolean=} [merge=false] */ setLayout: function (layout, merge$$1) { this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge$$1); }, /** * @return {Object} layout */ getLayout: function () { return this.hostTree.data.getItemLayout(this.dataIndex); }, /** * @param {string} [path] * @return {module:echarts/model/Model} */ getModel: function (path) { if (this.dataIndex < 0) { return; } var hostTree = this.hostTree; var itemModel = hostTree.data.getItemModel(this.dataIndex); var levelModel = this.getLevelModel(); var leavesModel; if (!levelModel && (this.children.length === 0 || (this.children.length !== 0 && this.isExpand === false))) { leavesModel = this.getLeavesModel(); } return itemModel.getModel(path, (levelModel || leavesModel || hostTree.hostModel).getModel(path)); }, /** * @return {module:echarts/model/Model} */ getLevelModel: function () { return (this.hostTree.levelModels || [])[this.depth]; }, /** * @return {module:echarts/model/Model} */ getLeavesModel: function () { return this.hostTree.leavesModel; }, /** * @example * setItemVisual('color', color); * setItemVisual({ * 'color': color * }); */ setVisual: function (key, value) { this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value); }, /** * Get item visual */ getVisual: function (key, ignoreParent) { return this.hostTree.data.getItemVisual(this.dataIndex, key, ignoreParent); }, /** * @public * @return {number} */ getRawIndex: function () { return this.hostTree.data.getRawIndex(this.dataIndex); }, /** * @public * @return {string} */ getId: function () { return this.hostTree.data.getId(this.dataIndex); }, /** * if this is an ancestor of another node * * @public * @param {TreeNode} node another node * @return {boolean} if is ancestor */ isAncestorOf: function (node) { var parent = node.parentNode; while (parent) { if (parent === this) { return true; } parent = parent.parentNode; } return false; }, /** * if this is an descendant of another node * * @public * @param {TreeNode} node another node * @return {boolean} if is descendant */ isDescendantOf: function (node) { return node !== this && node.isAncestorOf(this); } }; /** * @constructor * @alias module:echarts/data/Tree * @param {module:echarts/model/Model} hostModel * @param {Array.} levelOptions * @param {Object} leavesOption */ function Tree(hostModel, levelOptions, leavesOption) { /** * @type {module:echarts/data/Tree~TreeNode} * @readOnly */ this.root; /** * @type {module:echarts/data/List} * @readOnly */ this.data; /** * Index of each item is the same as the raw index of coresponding list item. * @private * @type {Array.} treeOptions.levels * @param {Array.} treeOptions.leaves * @return module:echarts/data/Tree */ Tree.createTree = function (dataRoot, hostModel, treeOptions) { var tree = new Tree(hostModel, treeOptions.levels, treeOptions.leaves); var listData = []; var dimMax = 1; buildHierarchy(dataRoot); function buildHierarchy(dataNode, parentNode) { var value = dataNode.value; dimMax = Math.max(dimMax, isArray(value) ? value.length : 1); listData.push(dataNode); var node = new TreeNode(dataNode.name, tree); parentNode ? addChild(node, parentNode) : (tree.root = node); tree._nodes.push(node); var children = dataNode.children; if (children) { for (var i = 0; i < children.length; i++) { buildHierarchy(children[i], node); } } } tree.root.updateDepthAndHeight(0); var dimensionsInfo = createDimensions(listData, { coordDimensions: ['value'], dimensionsCount: dimMax }); var list = new List(dimensionsInfo, hostModel); list.initData(listData); linkList({ mainData: list, struct: tree, structAttr: 'tree' }); tree.update(); return tree; }; /** * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote, * so this function is not ready and not necessary to be public. * * @param {(module:echarts/data/Tree~TreeNode|Object)} child */ function addChild(child, node) { var children = node.children; if (child.parentNode === node) { return; } children.push(child); child.parentNode = node; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file Create data struct and define tree view's series model */ SeriesModel.extend({ type: 'series.tree', layoutInfo: null, // can support the position parameters 'left', 'top','right','bottom', 'width', // 'height' in the setOption() with 'merge' mode normal. layoutMode: 'box', /** * Init a tree data structure from data in option series * @param {Object} option the object used to config echarts view * @return {module:echarts/data/List} storage initial data */ getInitialData: function (option) { //create an virtual root var root = {name: option.name, children: option.data}; var leaves = option.leaves || {}; var treeOption = {}; treeOption.leaves = leaves; var tree = Tree.createTree(root, this, treeOption); var treeDepth = 0; tree.eachNode('preorder', function (node) { if (node.depth > treeDepth) { treeDepth = node.depth; } }); var expandAndCollapse = option.expandAndCollapse; var expandTreeDepth = (expandAndCollapse && option.initialTreeDepth >= 0) ? option.initialTreeDepth : treeDepth; tree.root.eachNode('preorder', function (node) { var item = node.hostTree.data.getRawDataItem(node.dataIndex); // add item.collapsed != null, because users can collapse node original in the series.data. node.isExpand = (item && item.collapsed != null) ? !item.collapsed : node.depth <= expandTreeDepth; }); return tree.data; }, /** * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'. * @returns {string} orient */ getOrient: function () { var orient = this.get('orient'); if (orient === 'horizontal') { orient = 'LR'; } else if (orient === 'vertical') { orient = 'TB'; } return orient; }, /** * @override * @param {number} dataIndex */ formatTooltip: function (dataIndex) { var tree = this.getData().tree; var realRoot = tree.root.children[0]; var node = tree.getNodeByDataIndex(dataIndex); var value = node.getValue(); var name = node.name; while (node && (node !== realRoot)) { name = node.parentNode.name + '.' + name; node = node.parentNode; } return encodeHTML(name + ( (isNaN(value) || value == null) ? '' : ' : ' + value )); }, defaultOption: { zlevel: 0, z: 2, // the position of the whole view left: '12%', top: '12%', right: '12%', bottom: '12%', // the layout of the tree, two value can be selected, 'orthogonal' or 'radial' layout: 'orthogonal', // The orient of orthoginal layout, can be setted to 'LR', 'TB', 'RL', 'BT'. // and the backward compatibility configuration 'horizontal = LR', 'vertical = TB'. orient: 'LR', symbol: 'emptyCircle', symbolSize: 7, expandAndCollapse: true, initialTreeDepth: 2, lineStyle: { color: '#ccc', width: 1.5, curveness: 0.5 }, itemStyle: { color: 'lightsteelblue', borderColor: '#c23531', borderWidth: 1.5 }, label: { show: true, color: '#555' }, leaves: { label: { show: true } }, animationEasing: 'linear', animationDuration: 700, animationDurationUpdate: 1000 } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * The tree layout implementation references to d3.js * (https://github.com/d3/d3-hierarchy). The use of the source * code of this file is also subject to the terms and consitions * of its license (BSD-3Clause, see ). */ /** * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing * the tree. * @see https://github.com/d3/d3-hierarchy */ /** * Initialize all computational message for following algorithm * @param {module:echarts/data/Tree~TreeNode} root The virtual root of the tree */ function init$2(root) { root.hierNode = { defaultAncestor: null, ancestor: root, prelim: 0, modifier: 0, change: 0, shift: 0, i: 0, thread: null }; var nodes = [root]; var node; var children; while (node = nodes.pop()) { // jshint ignore:line children = node.children; if (node.isExpand && children.length) { var n = children.length; for (var i = n - 1; i >= 0; i--) { var child = children[i]; child.hierNode = { defaultAncestor: null, ancestor: child, prelim: 0, modifier: 0, change: 0, shift: 0, i: i, thread: null }; nodes.push(child); } } } } /** * Computes a preliminary x coordinate for node. Before that, this function is * applied recursively to the children of node, as well as the function * apportion(). After spacing out the children by calling executeShifts(), the * node is placed to the midpoint of its outermost children. * @param {module:echarts/data/Tree~TreeNode} node * @param {Function} separation */ function firstWalk(node, separation) { var children = node.isExpand ? node.children : []; var siblings = node.parentNode.children; var subtreeW = node.hierNode.i ? siblings[node.hierNode.i -1] : null; if (children.length) { executeShifts(node); var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2; if (subtreeW) { node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); node.hierNode.modifier = node.hierNode.prelim - midPoint; } else { node.hierNode.prelim = midPoint; } } else if (subtreeW) { node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); } node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation); } /** * Computes all real x-coordinates by summing up the modifiers recursively. * @param {module:echarts/data/Tree~TreeNode} node */ function secondWalk(node) { var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier; node.setLayout({x: nodeX}, true); node.hierNode.modifier += node.parentNode.hierNode.modifier; } function separation(cb) { return arguments.length ? cb : defaultSeparation; } /** * Transform the common coordinate to radial coordinate * @param {number} x * @param {number} y * @return {Object} */ function radialCoordinate(x, y) { var radialCoor = {}; x -= Math.PI / 2; radialCoor.x = y * Math.cos(x); radialCoor.y = y * Math.sin(x); return radialCoor; } /** * Get the layout position of the whole view * @param {module:echarts/model/Series} seriesModel the model object of sankey series * @param {module:echarts/ExtensionAPI} api provide the API list that the developer can call * @return {module:zrender/core/BoundingRect} size of rect to draw the sankey view */ function getViewRect(seriesModel, api) { return getLayoutRect( seriesModel.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() } ); } /** * All other shifts, applied to the smaller subtrees between w- and w+, are * performed by this function. * @param {module:echarts/data/Tree~TreeNode} node */ function executeShifts(node) { var children = node.children; var n = children.length; var shift = 0; var change = 0; while (--n >= 0) { var child = children[n]; child.hierNode.prelim += shift; child.hierNode.modifier += shift; change += child.hierNode.change; shift += child.hierNode.shift + change; } } /** * The core of the algorithm. Here, a new subtree is combined with the * previous subtrees. Threads are used to traverse the inside and outside * contours of the left and right subtree up to the highest common level. * Whenever two nodes of the inside contours conflict, we compute the left * one of the greatest uncommon ancestors using the function nextAncestor() * and call moveSubtree() to shift the subtree and prepare the shifts of * smaller subtrees. Finally, we add a new thread (if necessary). * @param {module:echarts/data/Tree~TreeNode} subtreeV * @param {module:echarts/data/Tree~TreeNode} subtreeW * @param {module:echarts/data/Tree~TreeNode} ancestor * @param {Function} separation * @return {module:echarts/data/Tree~TreeNode} */ function apportion(subtreeV, subtreeW, ancestor, separation) { if (subtreeW) { var nodeOutRight = subtreeV; var nodeInRight = subtreeV; var nodeOutLeft = nodeInRight.parentNode.children[0]; var nodeInLeft = subtreeW; var sumOutRight = nodeOutRight.hierNode.modifier; var sumInRight = nodeInRight.hierNode.modifier; var sumOutLeft = nodeOutLeft.hierNode.modifier; var sumInLeft = nodeInLeft.hierNode.modifier; while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) { nodeOutRight = nextRight(nodeOutRight); nodeOutLeft = nextLeft(nodeOutLeft); nodeOutRight.hierNode.ancestor = subtreeV; var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation(nodeInLeft, nodeInRight); if (shift > 0) { moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift); sumInRight += shift; sumOutRight += shift; } sumInLeft += nodeInLeft.hierNode.modifier; sumInRight += nodeInRight.hierNode.modifier; sumOutRight += nodeOutRight.hierNode.modifier; sumOutLeft += nodeOutLeft.hierNode.modifier; } if (nodeInLeft && !nextRight(nodeOutRight)) { nodeOutRight.hierNode.thread = nodeInLeft; nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight; } if (nodeInRight && !nextLeft(nodeOutLeft)) { nodeOutLeft.hierNode.thread = nodeInRight; nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft; ancestor = subtreeV; } } return ancestor; } /** * This function is used to traverse the right contour of a subtree. * It returns the rightmost child of node or the thread of node. The function * returns null if and only if node is on the highest depth of its subtree. * @param {module:echarts/data/Tree~TreeNode} node * @return {module:echarts/data/Tree~TreeNode} */ function nextRight(node) { var children = node.children; return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread; } /** * This function is used to traverse the left contour of a subtree (or a subforest). * It returns the leftmost child of node or the thread of node. The function * returns null if and only if node is on the highest depth of its subtree. * @param {module:echarts/data/Tree~TreeNode} node * @return {module:echarts/data/Tree~TreeNode} */ function nextLeft(node) { var children = node.children; return children.length && node.isExpand ? children[0] : node.hierNode.thread; } /** * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor. * Otherwise, returns the specified ancestor. * @param {module:echarts/data/Tree~TreeNode} nodeInLeft * @param {module:echarts/data/Tree~TreeNode} node * @param {module:echarts/data/Tree~TreeNode} ancestor * @return {module:echarts/data/Tree~TreeNode} */ function nextAncestor(nodeInLeft, node, ancestor) { return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor; } /** * Shifts the current subtree rooted at wr. This is done by increasing prelim(w+) and modifier(w+) by shift. * @param {module:echarts/data/Tree~TreeNode} wl * @param {module:echarts/data/Tree~TreeNode} wr * @param {number} shift [description] */ function moveSubtree(wl, wr,shift) { var change = shift / (wr.hierNode.i - wl.hierNode.i); wr.hierNode.change -= change; wr.hierNode.shift += shift; wr.hierNode.modifier += shift; wr.hierNode.prelim += shift; wl.hierNode.change += change; } function defaultSeparation(node1, node2) { return node1.parentNode === node2.parentNode ? 1 : 2; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file This file used to draw tree view */ extendChartView({ type: 'tree', /** * Init the chart * @override * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api */ init: function (ecModel, api) { /** * @private * @type {module:echarts/data/Tree} */ this._oldTree; /** * @private * @type {module:zrender/container/Group} */ this._mainGroup = new Group(); this.group.add(this._mainGroup); }, render: function (seriesModel, ecModel, api, payload) { var data = seriesModel.getData(); var layoutInfo = seriesModel.layoutInfo; var group = this._mainGroup; var layout = seriesModel.get('layout'); if (layout === 'radial') { group.attr('position', [layoutInfo.x + layoutInfo.width / 2, layoutInfo.y + layoutInfo.height / 2]); } else { group.attr('position', [layoutInfo.x, layoutInfo.y]); } var oldData = this._data; var seriesScope = { expandAndCollapse: seriesModel.get('expandAndCollapse'), layout: layout, orient: seriesModel.getOrient(), curvature: seriesModel.get('lineStyle.curveness'), symbolRotate: seriesModel.get('symbolRotate'), symbolOffset: seriesModel.get('symbolOffset'), hoverAnimation: seriesModel.get('hoverAnimation'), useNameLabel: true, fadeIn: true }; data.diff(oldData) .add(function (newIdx) { if (symbolNeedsDraw$1(data, newIdx)) { // create node and edge updateNode(data, newIdx, null, group, seriesModel, seriesScope); } }) .update(function (newIdx, oldIdx) { var symbolEl = oldData.getItemGraphicEl(oldIdx); if (!symbolNeedsDraw$1(data, newIdx)) { symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel, seriesScope); return; } // update node and edge updateNode(data, newIdx, symbolEl, group, seriesModel, seriesScope); }) .remove(function (oldIdx) { var symbolEl = oldData.getItemGraphicEl(oldIdx); // When remove a collapsed node of subtree, since the collapsed // node haven't been initialized with a symbol element, // you can't found it's symbol element through index. // so if we want to remove the symbol element we should insure // that the symbol element is not null. if (symbolEl) { removeNode(oldData, oldIdx, symbolEl, group, seriesModel, seriesScope); } }) .execute(); if (seriesScope.expandAndCollapse === true) { data.eachItemGraphicEl(function (el, dataIndex) { el.off('click').on('click', function () { api.dispatchAction({ type: 'treeExpandAndCollapse', seriesId: seriesModel.id, dataIndex: dataIndex }); }); }); } this._data = data; }, dispose: function () {}, remove: function () { this._mainGroup.removeAll(); this._data = null; } }); function symbolNeedsDraw$1(data, dataIndex) { var layout = data.getItemLayout(dataIndex); return layout && !isNaN(layout.x) && !isNaN(layout.y) && data.getItemVisual(dataIndex, 'symbol') !== 'none'; } function getTreeNodeStyle(node, itemModel, seriesScope) { seriesScope.itemModel = itemModel; seriesScope.itemStyle = itemModel.getModel('itemStyle').getItemStyle(); seriesScope.hoverItemStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); seriesScope.lineStyle = itemModel.getModel('lineStyle').getLineStyle(); seriesScope.labelModel = itemModel.getModel('label'); seriesScope.hoverLabelModel = itemModel.getModel('emphasis.label'); if (node.isExpand === false && node.children.length !== 0) { seriesScope.symbolInnerColor = seriesScope.itemStyle.fill; } else { seriesScope.symbolInnerColor = '#fff'; } return seriesScope; } function updateNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope) { var isInit = !symbolEl; var node = data.tree.getNodeByDataIndex(dataIndex); var itemModel = node.getModel(); var seriesScope = getTreeNodeStyle(node, itemModel, seriesScope); var virtualRoot = data.tree.root; var source = node.parentNode === virtualRoot ? node : node.parentNode || node; var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); var sourceLayout = source.getLayout(); var sourceOldLayout = sourceSymbolEl ? { x: sourceSymbolEl.position[0], y: sourceSymbolEl.position[1], rawX: sourceSymbolEl.__radialOldRawX, rawY: sourceSymbolEl.__radialOldRawY } : sourceLayout; var targetLayout = node.getLayout(); if (isInit) { symbolEl = new SymbolClz$1(data, dataIndex, seriesScope); symbolEl.attr('position', [sourceOldLayout.x, sourceOldLayout.y]); } else { symbolEl.updateData(data, dataIndex, seriesScope); } symbolEl.__radialOldRawX = symbolEl.__radialRawX; symbolEl.__radialOldRawY = symbolEl.__radialRawY; symbolEl.__radialRawX = targetLayout.rawX; symbolEl.__radialRawY = targetLayout.rawY; group.add(symbolEl); data.setItemGraphicEl(dataIndex, symbolEl); updateProps(symbolEl, { position: [targetLayout.x, targetLayout.y] }, seriesModel); var symbolPath = symbolEl.getSymbolPath(); if (seriesScope.layout === 'radial') { var realRoot = virtualRoot.children[0]; var rootLayout = realRoot.getLayout(); var length = realRoot.children.length; var rad; var isLeft; if (targetLayout.x === rootLayout.x && node.isExpand === true) { var center = {}; center.x = (realRoot.children[0].getLayout().x + realRoot.children[length - 1].getLayout().x) / 2; center.y = (realRoot.children[0].getLayout().y + realRoot.children[length - 1].getLayout().y) / 2; rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x); if (rad < 0) { rad = Math.PI * 2 + rad; } isLeft = center.x < rootLayout.x; if (isLeft) { rad = rad - Math.PI; } } else { rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x); if (rad < 0) { rad = Math.PI * 2 + rad; } if (node.children.length === 0 || (node.children.length !== 0 && node.isExpand === false)) { isLeft = targetLayout.x < rootLayout.x; if (isLeft) { rad = rad - Math.PI; } } else { isLeft = targetLayout.x > rootLayout.x; if (!isLeft) { rad = rad - Math.PI; } } } var textPosition = isLeft ? 'left' : 'right'; symbolPath.setStyle({ textPosition: textPosition, textRotation: -rad, textOrigin: 'center', verticalAlign: 'middle' }); } if (node.parentNode && node.parentNode !== virtualRoot) { var edge = symbolEl.__edge; if (!edge) { edge = symbolEl.__edge = new BezierCurve({ shape: getEdgeShape(seriesScope, sourceOldLayout, sourceOldLayout), style: defaults({opacity: 0}, seriesScope.lineStyle) }); } updateProps(edge, { shape: getEdgeShape(seriesScope, sourceLayout, targetLayout), style: {opacity: 1} }, seriesModel); group.add(edge); } } function removeNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope) { var node = data.tree.getNodeByDataIndex(dataIndex); var virtualRoot = data.tree.root; var itemModel = node.getModel(); var seriesScope = getTreeNodeStyle(node, itemModel, seriesScope); var source = node.parentNode === virtualRoot ? node : node.parentNode || node; var sourceLayout; while (sourceLayout = source.getLayout(), sourceLayout == null) { source = source.parentNode === virtualRoot ? source : source.parentNode || source; } updateProps(symbolEl, { position: [sourceLayout.x + 1, sourceLayout.y + 1] }, seriesModel, function () { group.remove(symbolEl); data.setItemGraphicEl(dataIndex, null); }); symbolEl.fadeOut(null, {keepLabel: true}); var edge = symbolEl.__edge; if (edge) { updateProps(edge, { shape: getEdgeShape(seriesScope, sourceLayout, sourceLayout), style: { opacity: 0 } }, seriesModel, function () { group.remove(edge); }); } } function getEdgeShape(seriesScope, sourceLayout, targetLayout) { var cpx1; var cpy1; var cpx2; var cpy2; var orient = seriesScope.orient; if (seriesScope.layout === 'radial') { var x1 = sourceLayout.rawX; var y1 = sourceLayout.rawY; var x2 = targetLayout.rawX; var y2 = targetLayout.rawY; var radialCoor1 = radialCoordinate(x1, y1); var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * seriesScope.curvature); var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * seriesScope.curvature); var radialCoor4 = radialCoordinate(x2, y2); return { x1: radialCoor1.x, y1: radialCoor1.y, x2: radialCoor4.x, y2: radialCoor4.y, cpx1: radialCoor2.x, cpy1: radialCoor2.y, cpx2: radialCoor3.x, cpy2: radialCoor3.y }; } else { var x1 = sourceLayout.x; var y1 = sourceLayout.y; var x2 = targetLayout.x; var y2 = targetLayout.y; if (orient === 'LR' || orient === 'RL') { cpx1 = x1 + (x2 - x1) * seriesScope.curvature; cpy1 = y1; cpx2 = x2 + (x1 - x2) * seriesScope.curvature; cpy2 = y2; } if (orient === 'TB' || orient === 'BT') { cpx1 = x1; cpy1 = y1 + (y2 - y1) * seriesScope.curvature; cpx2 = x2; cpy2 = y2 + (y1 - y2) * seriesScope.curvature; } return { x1: x1, y1: y1, x2: x2, y2: y2, cpx1: cpx1, cpy1: cpy1, cpx2: cpx2, cpy2: cpy2 }; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerAction({ type: 'treeExpandAndCollapse', event: 'treeExpandAndCollapse', update: 'update' }, function (payload, ecModel) { ecModel.eachComponent({mainType: 'series', subType: 'tree', query: payload}, function (seriesModel) { var dataIndex = payload.dataIndex; var tree = seriesModel.getData().tree; var node = tree.getNodeByDataIndex(dataIndex); node.isExpand = !node.isExpand; }); }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Traverse the tree from bottom to top and do something * @param {module:echarts/data/Tree~TreeNode} root The real root of the tree * @param {Function} callback */ function eachAfter (root, callback, separation) { var nodes = [root]; var next = []; var node; while (node = nodes.pop()) { // jshint ignore:line next.push(node); if (node.isExpand) { var children = node.children; if (children.length) { for (var i = 0; i < children.length; i++) { nodes.push(children[i]); } } } } while (node = next.pop()) { // jshint ignore:line callback(node, separation); } } /** * Traverse the tree from top to bottom and do something * @param {module:echarts/data/Tree~TreeNode} root The real root of the tree * @param {Function} callback */ function eachBefore (root, callback) { var nodes = [root]; var node; while (node = nodes.pop()) { // jshint ignore:line callback(node); if (node.isExpand) { var children = node.children; if (children.length) { for (var i = children.length - 1; i >= 0; i--) { nodes.push(children[i]); } } } } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var treeLayout = function (ecModel, api) { ecModel.eachSeriesByType('tree', function (seriesModel) { commonLayout(seriesModel, api); }); }; function commonLayout(seriesModel, api) { var layoutInfo = getViewRect(seriesModel, api); seriesModel.layoutInfo = layoutInfo; var layout = seriesModel.get('layout'); var width = 0; var height = 0; var separation$$1 = null; if (layout === 'radial') { width = 2 * Math.PI; height = Math.min(layoutInfo.height, layoutInfo.width) / 2; separation$$1 = separation(function (node1, node2) { return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth; }); } else { width = layoutInfo.width; height = layoutInfo.height; separation$$1 = separation(); } var virtualRoot = seriesModel.getData().tree.root; var realRoot = virtualRoot.children[0]; if (realRoot) { init$2(virtualRoot); eachAfter(realRoot, firstWalk, separation$$1); virtualRoot.hierNode.modifier = - realRoot.hierNode.prelim; eachBefore(realRoot, secondWalk); var left = realRoot; var right = realRoot; var bottom = realRoot; eachBefore(realRoot, function (node) { var x = node.getLayout().x; if (x < left.getLayout().x) { left = node; } if (x > right.getLayout().x) { right = node; } if (node.depth > bottom.depth) { bottom = node; } }); var delta = left === right ? 1 : separation$$1(left, right) / 2; var tx = delta - left.getLayout().x; var kx = 0; var ky = 0; var coorX = 0; var coorY = 0; if (layout === 'radial') { kx = width / (right.getLayout().x + delta + tx); // here we use (node.depth - 1), bucause the real root's depth is 1 ky = height / ((bottom.depth - 1) || 1); eachBefore(realRoot, function (node) { coorX = (node.getLayout().x + tx) * kx; coorY = (node.depth - 1) * ky; var finalCoor = radialCoordinate(coorX, coorY); node.setLayout({x: finalCoor.x, y: finalCoor.y, rawX: coorX, rawY: coorY}, true); }); } else { var orient = seriesModel.getOrient(); if (orient === 'RL' || orient === 'LR') { ky = height / (right.getLayout().x + delta + tx); kx = width / ((bottom.depth - 1) || 1); eachBefore(realRoot, function (node) { coorY = (node.getLayout().x + tx) * ky; coorX = orient === 'LR' ? (node.depth - 1) * kx : width - (node.depth - 1) * kx; node.setLayout({x: coorX, y: coorY}, true); }); } else if (orient === 'TB' || orient === 'BT') { kx = width / (right.getLayout().x + delta + tx); ky = height / ((bottom.depth - 1) || 1); eachBefore(realRoot, function (node) { coorX = (node.getLayout().x + tx) * kx; coorY = orient === 'TB' ? (node.depth - 1) * ky : height - (node.depth - 1) * ky; node.setLayout({x: coorX, y: coorY}, true); }); } } } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerVisual(visualSymbol('tree', 'circle')); registerLayout(treeLayout); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) { if (payload && indexOf(validPayloadTypes, payload.type) >= 0) { var root = seriesModel.getData().tree.root; var targetNode = payload.targetNode; if (targetNode && root.contains(targetNode)) { return {node: targetNode}; } var targetNodeId = payload.targetNodeId; if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) { return {node: targetNode}; } } } // Not includes the given node at the last item. function getPathToRoot(node) { var path = []; while (node) { node = node.parentNode; node && path.push(node); } return path.reverse(); } function aboveViewRoot(viewRoot, node) { var viewPath = getPathToRoot(viewRoot); return indexOf(viewPath, node) >= 0; } // From root to the input node (the input node will be included). function wrapTreePathInfo(node, seriesModel) { var treePathInfo = []; while (node) { var nodeDataIndex = node.dataIndex; treePathInfo.push({ name: node.name, dataIndex: nodeDataIndex, value: seriesModel.getRawValue(nodeDataIndex) }); node = node.parentNode; } treePathInfo.reverse(); return treePathInfo; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ SeriesModel.extend({ type: 'series.treemap', layoutMode: 'box', dependencies: ['grid', 'polar'], /** * @type {module:echarts/data/Tree~Node} */ _viewRoot: null, defaultOption: { // Disable progressive rendering progressive: 0, hoverLayerThreshold: Infinity, // center: ['50%', '50%'], // not supported in ec3. // size: ['80%', '80%'], // deprecated, compatible with ec2. left: 'center', top: 'middle', right: null, bottom: null, width: '80%', height: '80%', sort: true, // Can be null or false or true // (order by desc default, asc not supported yet (strange effect)) clipWindow: 'origin', // Size of clipped window when zooming. 'origin' or 'fullscreen' squareRatio: 0.5 * (1 + Math.sqrt(5)), // golden ratio leafDepth: null, // Nodes on depth from root are regarded as leaves. // Count from zero (zero represents only view root). drillDownIcon: '▶', // Use html character temporarily because it is complicated // to align specialized icon. ▷▶❒❐▼✚ zoomToNodeRatio: 0.32 * 0.32, // Be effective when using zoomToNode. Specify the proportion of the // target node area in the view area. roam: true, // true, false, 'scale' or 'zoom', 'move'. nodeClick: 'zoomToNode', // Leaf node click behaviour: 'zoomToNode', 'link', false. // If leafDepth is set and clicking a node which has children but // be on left depth, the behaviour would be changing root. Otherwise // use behavious defined above. animation: true, animationDurationUpdate: 900, animationEasing: 'quinticInOut', breadcrumb: { show: true, height: 22, left: 'center', top: 'bottom', // right // bottom emptyItemWidth: 25, // Width of empty node. itemStyle: { color: 'rgba(0,0,0,0.7)', //'#5793f3', borderColor: 'rgba(255,255,255,0.7)', borderWidth: 1, shadowColor: 'rgba(150,150,150,1)', shadowBlur: 3, shadowOffsetX: 0, shadowOffsetY: 0, textStyle: { color: '#fff' } }, emphasis: { textStyle: {} } }, label: { show: true, // Do not use textDistance, for ellipsis rect just the same as treemap node rect. distance: 0, padding: 5, position: 'inside', // Can be [5, '5%'] or position stirng like 'insideTopLeft', ... // formatter: null, color: '#fff', ellipsis: true // align // verticalAlign }, upperLabel: { // Label when node is parent. show: false, position: [0, '50%'], height: 20, // formatter: null, color: '#fff', ellipsis: true, // align: null, verticalAlign: 'middle' }, itemStyle: { color: null, // Can be 'none' if not necessary. colorAlpha: null, // Can be 'none' if not necessary. colorSaturation: null, // Can be 'none' if not necessary. borderWidth: 0, gapWidth: 0, borderColor: '#fff', borderColorSaturation: null // If specified, borderColor will be ineffective, and the // border color is evaluated by color of current node and // borderColorSaturation. }, emphasis: { upperLabel: { show: true, position: [0, '50%'], color: '#fff', ellipsis: true, verticalAlign: 'middle' } }, visualDimension: 0, // Can be 0, 1, 2, 3. visualMin: null, visualMax: null, color: [], // + treemapSeries.color should not be modified. Please only modified // level[n].color (if necessary). // + Specify color list of each level. level[0].color would be global // color list if not specified. (see method `setDefault`). // + But set as a empty array to forbid fetch color from global palette // when using nodeModel.get('color'), otherwise nodes on deep level // will always has color palette set and are not able to inherit color // from parent node. // + TreemapSeries.color can not be set as 'none', otherwise effect // legend color fetching (see seriesColor.js). colorAlpha: null, // Array. Specify color alpha range of each level, like [0.2, 0.8] colorSaturation: null, // Array. Specify color saturation of each level, like [0.2, 0.5] colorMappingBy: 'index', // 'value' or 'index' or 'id'. visibleMin: 10, // If area less than this threshold (unit: pixel^2), node will not // be rendered. Only works when sort is 'asc' or 'desc'. childrenVisibleMin: null, // If area of a node less than this threshold (unit: pixel^2), // grandchildren will not show. // Why grandchildren? If not grandchildren but children, // some siblings show children and some not, // the appearance may be mess and not consistent, levels: [] // Each item: { // visibleMin, itemStyle, visualDimension, label // } // data: { // value: [], // children: [], // link: 'http://xxx.xxx.xxx', // target: 'blank' or 'self' // } }, /** * @override */ getInitialData: function (option, ecModel) { // Create a virtual root. var root = {name: option.name, children: option.data}; completeTreeValue(root); var levels = option.levels || []; levels = option.levels = setDefault(levels, ecModel); var treeOption = {}; treeOption.levels = levels; // Make sure always a new tree is created when setOption, // in TreemapView, we check whether oldTree === newTree // to choose mappings approach among old shapes and new shapes. return Tree.createTree(root, this, treeOption).data; }, optionUpdated: function () { this.resetViewRoot(); }, /** * @override * @param {number} dataIndex * @param {boolean} [mutipleSeries=false] */ formatTooltip: function (dataIndex) { var data = this.getData(); var value = this.getRawValue(dataIndex); var formattedValue = isArray(value) ? addCommas(value[0]) : addCommas(value); var name = data.getName(dataIndex); return encodeHTML(name + ': ' + formattedValue); }, /** * Add tree path to tooltip param * * @override * @param {number} dataIndex * @return {Object} */ getDataParams: function (dataIndex) { var params = SeriesModel.prototype.getDataParams.apply(this, arguments); var node = this.getData().tree.getNodeByDataIndex(dataIndex); params.treePathInfo = wrapTreePathInfo(node, this); return params; }, /** * @public * @param {Object} layoutInfo { * x: containerGroup x * y: containerGroup y * width: containerGroup width * height: containerGroup height * } */ setLayoutInfo: function (layoutInfo) { /** * @readOnly * @type {Object} */ this.layoutInfo = this.layoutInfo || {}; extend(this.layoutInfo, layoutInfo); }, /** * @param {string} id * @return {number} index */ mapIdToIndex: function (id) { // A feature is implemented: // index is monotone increasing with the sequence of // input id at the first time. // This feature can make sure that each data item and its // mapped color have the same index between data list and // color list at the beginning, which is useful for user // to adjust data-color mapping. /** * @private * @type {Object} */ var idIndexMap = this._idIndexMap; if (!idIndexMap) { idIndexMap = this._idIndexMap = createHashMap(); /** * @private * @type {number} */ this._idIndexMapCount = 0; } var index = idIndexMap.get(id); if (index == null) { idIndexMap.set(id, index = this._idIndexMapCount++); } return index; }, getViewRoot: function () { return this._viewRoot; }, /** * @param {module:echarts/data/Tree~Node} [viewRoot] */ resetViewRoot: function (viewRoot) { viewRoot ? (this._viewRoot = viewRoot) : (viewRoot = this._viewRoot); var root = this.getRawData().tree.root; if (!viewRoot || (viewRoot !== root && !root.contains(viewRoot)) ) { this._viewRoot = root; } } }); /** * @param {Object} dataNode */ function completeTreeValue(dataNode) { // Postorder travel tree. // If value of none-leaf node is not set, // calculate it by suming up the value of all children. var sum = 0; each$1(dataNode.children, function (child) { completeTreeValue(child); var childValue = child.value; isArray(childValue) && (childValue = childValue[0]); sum += childValue; }); var thisValue = dataNode.value; if (isArray(thisValue)) { thisValue = thisValue[0]; } if (thisValue == null || isNaN(thisValue)) { thisValue = sum; } // Value should not less than 0. if (thisValue < 0) { thisValue = 0; } isArray(dataNode.value) ? (dataNode.value[0] = thisValue) : (dataNode.value = thisValue); } /** * set default to level configuration */ function setDefault(levels, ecModel) { var globalColorList = ecModel.get('color'); if (!globalColorList) { return; } levels = levels || []; var hasColorDefine; each$1(levels, function (levelDefine) { var model = new Model(levelDefine); var modelColor = model.get('color'); if (model.get('itemStyle.color') || (modelColor && modelColor !== 'none') ) { hasColorDefine = true; } }); if (!hasColorDefine) { var level0 = levels[0] || (levels[0] = {}); level0.color = globalColorList.slice(); } return levels; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var TEXT_PADDING = 8; var ITEM_GAP = 8; var ARRAY_LENGTH = 5; function Breadcrumb(containerGroup) { /** * @private * @type {module:zrender/container/Group} */ this.group = new Group(); containerGroup.add(this.group); } Breadcrumb.prototype = { constructor: Breadcrumb, render: function (seriesModel, api, targetNode, onSelect) { var model = seriesModel.getModel('breadcrumb'); var thisGroup = this.group; thisGroup.removeAll(); if (!model.get('show') || !targetNode) { return; } var normalStyleModel = model.getModel('itemStyle'); // var emphasisStyleModel = model.getModel('emphasis.itemStyle'); var textStyleModel = normalStyleModel.getModel('textStyle'); var layoutParam = { pos: { left: model.get('left'), right: model.get('right'), top: model.get('top'), bottom: model.get('bottom') }, box: { width: api.getWidth(), height: api.getHeight() }, emptyItemWidth: model.get('emptyItemWidth'), totalWidth: 0, renderList: [] }; this._prepare(targetNode, layoutParam, textStyleModel); this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect); positionElement(thisGroup, layoutParam.pos, layoutParam.box); }, /** * Prepare render list and total width * @private */ _prepare: function (targetNode, layoutParam, textStyleModel) { for (var node = targetNode; node; node = node.parentNode) { var text = node.getModel().get('name'); var textRect = textStyleModel.getTextRect(text); var itemWidth = Math.max( textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth ); layoutParam.totalWidth += itemWidth + ITEM_GAP; layoutParam.renderList.push({node: node, text: text, width: itemWidth}); } }, /** * @private */ _renderContent: function ( seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect ) { // Start rendering. var lastX = 0; var emptyItemWidth = layoutParam.emptyItemWidth; var height = seriesModel.get('breadcrumb.height'); var availableSize = getAvailableSize(layoutParam.pos, layoutParam.box); var totalWidth = layoutParam.totalWidth; var renderList = layoutParam.renderList; for (var i = renderList.length - 1; i >= 0; i--) { var item = renderList[i]; var itemNode = item.node; var itemWidth = item.width; var text = item.text; // Hdie text and shorten width if necessary. if (totalWidth > availableSize.width) { totalWidth -= itemWidth - emptyItemWidth; itemWidth = emptyItemWidth; text = null; } var el = new Polygon({ shape: { points: makeItemPoints( lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0 ) }, style: defaults( normalStyleModel.getItemStyle(), { lineJoin: 'bevel', text: text, textFill: textStyleModel.getTextColor(), textFont: textStyleModel.getFont() } ), z: 10, onclick: curry(onSelect, itemNode) }); this.group.add(el); packEventData(el, seriesModel, itemNode); lastX += itemWidth + ITEM_GAP; } }, /** * @override */ remove: function () { this.group.removeAll(); } }; function makeItemPoints(x, y, itemWidth, itemHeight, head, tail) { var points = [ [head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight] ]; !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]); !head && points.push([x, y + itemHeight / 2]); return points; } // Package custom mouse event. function packEventData(el, seriesModel, itemNode) { el.eventData = { componentType: 'series', componentSubType: 'treemap', seriesIndex: seriesModel.componentIndex, seriesName: seriesModel.name, seriesType: 'treemap', selfType: 'breadcrumb', // Distinguish with click event on treemap node. nodeData: { dataIndex: itemNode && itemNode.dataIndex, name: itemNode && itemNode.name }, treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel) }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @param {number} [time=500] Time in ms * @param {string} [easing='linear'] * @param {number} [delay=0] * @param {Function} [callback] * * @example * // Animate position * animation * .createWrap() * .add(el1, {position: [10, 10]}) * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400) * .done(function () { // done }) * .start('cubicOut'); */ function createWrap() { var storage = []; var elExistsMap = {}; var doneCallback; return { /** * Caution: a el can only be added once, otherwise 'done' * might not be called. This method checks this (by el.id), * suppresses adding and returns false when existing el found. * * @param {modele:zrender/Element} el * @param {Object} target * @param {number} [time=500] * @param {number} [delay=0] * @param {string} [easing='linear'] * @return {boolean} Whether adding succeeded. * * @example * add(el, target, time, delay, easing); * add(el, target, time, easing); * add(el, target, time); * add(el, target); */ add: function (el, target, time, delay, easing) { if (isString(delay)) { easing = delay; delay = 0; } if (elExistsMap[el.id]) { return false; } elExistsMap[el.id] = 1; storage.push( {el: el, target: target, time: time, delay: delay, easing: easing} ); return true; }, /** * Only execute when animation finished. Will not execute when any * of 'stop' or 'stopAnimation' called. * * @param {Function} callback */ done: function (callback) { doneCallback = callback; return this; }, /** * Will stop exist animation firstly. */ start: function () { var count = storage.length; for (var i = 0, len = storage.length; i < len; i++) { var item = storage[i]; item.el.animateTo(item.target, item.time, item.delay, item.easing, done); } return this; function done() { count--; if (!count) { storage.length = 0; elExistsMap = {}; doneCallback && doneCallback(); } } } }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var bind$1 = bind; var Group$2 = Group; var Rect$1 = Rect; var each$8 = each$1; var DRAG_THRESHOLD = 3; var PATH_LABEL_NOAMAL = ['label']; var PATH_LABEL_EMPHASIS = ['emphasis', 'label']; var PATH_UPPERLABEL_NORMAL = ['upperLabel']; var PATH_UPPERLABEL_EMPHASIS = ['emphasis', 'upperLabel']; var Z_BASE = 10; // Should bigger than every z. var Z_BG = 1; var Z_CONTENT = 2; var getItemStyleEmphasis = makeStyleMapper([ ['fill', 'color'], // `borderColor` and `borderWidth` has been occupied, // so use `stroke` to indicate the stroke of the rect. ['stroke', 'strokeColor'], ['lineWidth', 'strokeWidth'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'] ]); var getItemStyleNormal = function (model) { // Normal style props should include emphasis style props. var itemStyle = getItemStyleEmphasis(model); // Clear styles set by emphasis. itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null; return itemStyle; }; extendChartView({ type: 'treemap', /** * @override */ init: function (o, api) { /** * @private * @type {module:zrender/container/Group} */ this._containerGroup; /** * @private * @type {Object.>} */ this._storage = createStorage(); /** * @private * @type {module:echarts/data/Tree} */ this._oldTree; /** * @private * @type {module:echarts/chart/treemap/Breadcrumb} */ this._breadcrumb; /** * @private * @type {module:echarts/component/helper/RoamController} */ this._controller; /** * 'ready', 'animating' * @private */ this._state = 'ready'; }, /** * @override */ render: function (seriesModel, ecModel, api, payload) { var models = ecModel.findComponents({ mainType: 'series', subType: 'treemap', query: payload }); if (indexOf(models, seriesModel) < 0) { return; } this.seriesModel = seriesModel; this.api = api; this.ecModel = ecModel; var types = ['treemapZoomToNode', 'treemapRootToNode']; var targetInfo = retrieveTargetInfo(payload, types, seriesModel); var payloadType = payload && payload.type; var layoutInfo = seriesModel.layoutInfo; var isInit = !this._oldTree; var thisStorage = this._storage; // Mark new root when action is treemapRootToNode. var reRoot = (payloadType === 'treemapRootToNode' && targetInfo && thisStorage) ? { rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()], direction: payload.direction } : null; var containerGroup = this._giveContainerGroup(layoutInfo); var renderResult = this._doRender(containerGroup, seriesModel, reRoot); ( !isInit && ( !payloadType || payloadType === 'treemapZoomToNode' || payloadType === 'treemapRootToNode' ) ) ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally(); this._resetController(api); this._renderBreadcrumb(seriesModel, api, targetInfo); }, /** * @private */ _giveContainerGroup: function (layoutInfo) { var containerGroup = this._containerGroup; if (!containerGroup) { // FIXME // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。 containerGroup = this._containerGroup = new Group$2(); this._initEvents(containerGroup); this.group.add(containerGroup); } containerGroup.attr('position', [layoutInfo.x, layoutInfo.y]); return containerGroup; }, /** * @private */ _doRender: function (containerGroup, seriesModel, reRoot) { var thisTree = seriesModel.getData().tree; var oldTree = this._oldTree; // Clear last shape records. var lastsForAnimation = createStorage(); var thisStorage = createStorage(); var oldStorage = this._storage; var willInvisibleEls = []; var doRenderNode = curry( renderNode, seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls ); // Notice: when thisTree and oldTree are the same tree (see list.cloneShallow), // the oldTree is actually losted, so we can not find all of the old graphic // elements from tree. So we use this stragegy: make element storage, move // from old storage to new storage, clear old storage. dualTravel( thisTree.root ? [thisTree.root] : [], (oldTree && oldTree.root) ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0 ); // Process all removing. var willDeleteEls = clearStorage(oldStorage); this._oldTree = thisTree; this._storage = thisStorage; return { lastsForAnimation: lastsForAnimation, willDeleteEls: willDeleteEls, renderFinally: renderFinally }; function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) { // When 'render' is triggered by action, // 'this' and 'old' may be the same tree, // we use rawIndex in that case. if (sameTree) { oldViewChildren = thisViewChildren; each$8(thisViewChildren, function (child, index) { !child.isRemoved() && processNode(index, index); }); } // Diff hierarchically (diff only in each subtree, but not whole). // because, consistency of view is important. else { (new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey)) .add(processNode) .update(processNode) .remove(curry(processNode, null)) .execute(); } function getKey(node) { // Identify by name or raw index. return node.getId(); } function processNode(newIndex, oldIndex) { var thisNode = newIndex != null ? thisViewChildren[newIndex] : null; var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null; var group = doRenderNode(thisNode, oldNode, parentGroup, depth); group && dualTravel( thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1 ); } } function clearStorage(storage) { var willDeleteEls = createStorage(); storage && each$8(storage, function (store, storageName) { var delEls = willDeleteEls[storageName]; each$8(store, function (el) { el && (delEls.push(el), el.__tmWillDelete = 1); }); }); return willDeleteEls; } function renderFinally() { each$8(willDeleteEls, function (els) { each$8(els, function (el) { el.parent && el.parent.remove(el); }); }); each$8(willInvisibleEls, function (el) { el.invisible = true; // Setting invisible is for optimizing, so no need to set dirty, // just mark as invisible. el.dirty(); }); } }, /** * @private */ _doAnimation: function (containerGroup, renderResult, seriesModel, reRoot) { if (!seriesModel.get('animation')) { return; } var duration = seriesModel.get('animationDurationUpdate'); var easing = seriesModel.get('animationEasing'); var animationWrap = createWrap(); // Make delete animations. each$8(renderResult.willDeleteEls, function (store, storageName) { each$8(store, function (el, rawIndex) { if (el.invisible) { return; } var parent = el.parent; // Always has parent, and parent is nodeGroup. var target; if (reRoot && reRoot.direction === 'drillDown') { target = parent === reRoot.rootNodeGroup // This is the content element of view root. // Only `content` will enter this branch, because // `background` and `nodeGroup` will not be deleted. ? { shape: { x: 0, y: 0, width: parent.__tmNodeWidth, height: parent.__tmNodeHeight }, style: { opacity: 0 } } // Others. : {style: {opacity: 0}}; } else { var targetX = 0; var targetY = 0; if (!parent.__tmWillDelete) { // Let node animate to right-bottom corner, cooperating with fadeout, // which is appropriate for user understanding. // Divided by 2 for reRoot rolling up effect. targetX = parent.__tmNodeWidth / 2; targetY = parent.__tmNodeHeight / 2; } target = storageName === 'nodeGroup' ? {position: [targetX, targetY], style: {opacity: 0}} : { shape: {x: targetX, y: targetY, width: 0, height: 0}, style: {opacity: 0} }; } target && animationWrap.add(el, target, duration, easing); }); }); // Make other animations each$8(this._storage, function (store, storageName) { each$8(store, function (el, rawIndex) { var last = renderResult.lastsForAnimation[storageName][rawIndex]; var target = {}; if (!last) { return; } if (storageName === 'nodeGroup') { if (last.old) { target.position = el.position.slice(); el.attr('position', last.old); } } else { if (last.old) { target.shape = extend({}, el.shape); el.setShape(last.old); } if (last.fadein) { el.setStyle('opacity', 0); target.style = {opacity: 1}; } // When animation is stopped for succedent animation starting, // el.style.opacity might not be 1 else if (el.style.opacity !== 1) { target.style = {opacity: 1}; } } animationWrap.add(el, target, duration, easing); }); }, this); this._state = 'animating'; animationWrap .done(bind$1(function () { this._state = 'ready'; renderResult.renderFinally(); }, this)) .start(); }, /** * @private */ _resetController: function (api) { var controller = this._controller; // Init controller. if (!controller) { controller = this._controller = new RoamController(api.getZr()); controller.enable(this.seriesModel.get('roam')); controller.on('pan', bind$1(this._onPan, this)); controller.on('zoom', bind$1(this._onZoom, this)); } var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight()); controller.setPointerChecker(function (e, x, y) { return rect.contain(x, y); }); }, /** * @private */ _clearController: function () { var controller = this._controller; if (controller) { controller.dispose(); controller = null; } }, /** * @private */ _onPan: function (dx, dy) { if (this._state !== 'animating' && (Math.abs(dx) > DRAG_THRESHOLD || Math.abs(dy) > DRAG_THRESHOLD) ) { // These param must not be cached. var root = this.seriesModel.getData().tree.root; if (!root) { return; } var rootLayout = root.getLayout(); if (!rootLayout) { return; } this.api.dispatchAction({ type: 'treemapMove', from: this.uid, seriesId: this.seriesModel.id, rootRect: { x: rootLayout.x + dx, y: rootLayout.y + dy, width: rootLayout.width, height: rootLayout.height } }); } }, /** * @private */ _onZoom: function (scale, mouseX, mouseY) { if (this._state !== 'animating') { // These param must not be cached. var root = this.seriesModel.getData().tree.root; if (!root) { return; } var rootLayout = root.getLayout(); if (!rootLayout) { return; } var rect = new BoundingRect( rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height ); var layoutInfo = this.seriesModel.layoutInfo; // Transform mouse coord from global to containerGroup. mouseX -= layoutInfo.x; mouseY -= layoutInfo.y; // Scale root bounding rect. var m = create$1(); translate(m, m, [-mouseX, -mouseY]); scale$1(m, m, [scale, scale]); translate(m, m, [mouseX, mouseY]); rect.applyTransform(m); this.api.dispatchAction({ type: 'treemapRender', from: this.uid, seriesId: this.seriesModel.id, rootRect: { x: rect.x, y: rect.y, width: rect.width, height: rect.height } }); } }, /** * @private */ _initEvents: function (containerGroup) { containerGroup.on('click', function (e) { if (this._state !== 'ready') { return; } var nodeClick = this.seriesModel.get('nodeClick', true); if (!nodeClick) { return; } var targetInfo = this.findTarget(e.offsetX, e.offsetY); if (!targetInfo) { return; } var node = targetInfo.node; if (node.getLayout().isLeafRoot) { this._rootToNode(targetInfo); } else { if (nodeClick === 'zoomToNode') { this._zoomToNode(targetInfo); } else if (nodeClick === 'link') { var itemModel = node.hostTree.data.getItemModel(node.dataIndex); var link = itemModel.get('link', true); var linkTarget = itemModel.get('target', true) || 'blank'; link && window.open(link, linkTarget); } } }, this); }, /** * @private */ _renderBreadcrumb: function (seriesModel, api, targetInfo) { if (!targetInfo) { targetInfo = seriesModel.get('leafDepth', true) != null ? {node: seriesModel.getViewRoot()} // FIXME // better way? // Find breadcrumb tail on center of containerGroup. : this.findTarget(api.getWidth() / 2, api.getHeight() / 2); if (!targetInfo) { targetInfo = {node: seriesModel.getData().tree.root}; } } (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))) .render(seriesModel, api, targetInfo.node, bind$1(onSelect, this)); function onSelect(node) { if (this._state !== 'animating') { aboveViewRoot(seriesModel.getViewRoot(), node) ? this._rootToNode({node: node}) : this._zoomToNode({node: node}); } } }, /** * @override */ remove: function () { this._clearController(); this._containerGroup && this._containerGroup.removeAll(); this._storage = createStorage(); this._state = 'ready'; this._breadcrumb && this._breadcrumb.remove(); }, dispose: function () { this._clearController(); }, /** * @private */ _zoomToNode: function (targetInfo) { this.api.dispatchAction({ type: 'treemapZoomToNode', from: this.uid, seriesId: this.seriesModel.id, targetNode: targetInfo.node }); }, /** * @private */ _rootToNode: function (targetInfo) { this.api.dispatchAction({ type: 'treemapRootToNode', from: this.uid, seriesId: this.seriesModel.id, targetNode: targetInfo.node }); }, /** * @public * @param {number} x Global coord x. * @param {number} y Global coord y. * @return {Object} info If not found, return undefined; * @return {number} info.node Target node. * @return {number} info.offsetX x refer to target node. * @return {number} info.offsetY y refer to target node. */ findTarget: function (x, y) { var targetInfo; var viewRoot = this.seriesModel.getViewRoot(); viewRoot.eachNode({attr: 'viewChildren', order: 'preorder'}, function (node) { var bgEl = this._storage.background[node.getRawIndex()]; // If invisible, there might be no element. if (bgEl) { var point = bgEl.transformCoordToLocal(x, y); var shape = bgEl.shape; // For performance consideration, dont use 'getBoundingRect'. if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height ) { targetInfo = {node: node, offsetX: point[0], offsetY: point[1]}; } else { return false; // Suppress visit subtree. } } }, this); return targetInfo; } }); /** * @inner */ function createStorage() { return {nodeGroup: [], background: [], content: []}; } /** * @inner * @return Return undefined means do not travel further. */ function renderNode( seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth ) { // Whether under viewRoot. if (!thisNode) { // Deleting nodes will be performed finally. This method just find // element from old storage, or create new element, set them to new // storage, and set styles. return; } // ------------------------------------------------------------------- // Start of closure variables available in "Procedures in renderNode". var thisLayout = thisNode.getLayout(); if (!thisLayout || !thisLayout.isInView) { return; } var thisWidth = thisLayout.width; var thisHeight = thisLayout.height; var borderWidth = thisLayout.borderWidth; var thisInvisible = thisLayout.invisible; var thisRawIndex = thisNode.getRawIndex(); var oldRawIndex = oldNode && oldNode.getRawIndex(); var thisViewChildren = thisNode.viewChildren; var upperHeight = thisLayout.upperHeight; var isParent = thisViewChildren && thisViewChildren.length; var itemStyleNormalModel = thisNode.getModel('itemStyle'); var itemStyleEmphasisModel = thisNode.getModel('emphasis.itemStyle'); // End of closure ariables available in "Procedures in renderNode". // ----------------------------------------------------------------- // Node group var group = giveGraphic('nodeGroup', Group$2); if (!group) { return; } parentGroup.add(group); // x,y are not set when el is above view root. group.attr('position', [thisLayout.x || 0, thisLayout.y || 0]); group.__tmNodeWidth = thisWidth; group.__tmNodeHeight = thisHeight; if (thisLayout.isAboveViewRoot) { return group; } // Background var bg = giveGraphic('background', Rect$1, depth, Z_BG); bg && renderBackground(group, bg, isParent && thisLayout.upperHeight); // No children, render content. if (!isParent) { var content = giveGraphic('content', Rect$1, depth, Z_CONTENT); content && renderContent(group, content); } return group; // ---------------------------- // | Procedures in renderNode | // ---------------------------- function renderBackground(group, bg, useUpperLabel) { // For tooltip. bg.dataIndex = thisNode.dataIndex; bg.seriesIndex = seriesModel.seriesIndex; bg.setShape({x: 0, y: 0, width: thisWidth, height: thisHeight}); var visualBorderColor = thisNode.getVisual('borderColor', true); var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor'); updateStyle(bg, function () { var normalStyle = getItemStyleNormal(itemStyleNormalModel); normalStyle.fill = visualBorderColor; var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel); emphasisStyle.fill = emphasisBorderColor; if (useUpperLabel) { var upperLabelWidth = thisWidth - 2 * borderWidth; prepareText( normalStyle, emphasisStyle, visualBorderColor, upperLabelWidth, upperHeight, {x: borderWidth, y: 0, width: upperLabelWidth, height: upperHeight} ); } // For old bg. else { normalStyle.text = emphasisStyle.text = null; } bg.setStyle(normalStyle); setHoverStyle(bg, emphasisStyle); }); group.add(bg); } function renderContent(group, content) { // For tooltip. content.dataIndex = thisNode.dataIndex; content.seriesIndex = seriesModel.seriesIndex; var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0); var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0); content.culling = true; content.setShape({ x: borderWidth, y: borderWidth, width: contentWidth, height: contentHeight }); var visualColor = thisNode.getVisual('color', true); updateStyle(content, function () { var normalStyle = getItemStyleNormal(itemStyleNormalModel); normalStyle.fill = visualColor; var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel); prepareText(normalStyle, emphasisStyle, visualColor, contentWidth, contentHeight); content.setStyle(normalStyle); setHoverStyle(content, emphasisStyle); }); group.add(content); } function updateStyle(element, cb) { if (!thisInvisible) { // If invisible, do not set visual, otherwise the element will // change immediately before animation. We think it is OK to // remain its origin color when moving out of the view window. cb(); if (!element.__tmWillVisible) { element.invisible = false; } } else { // Delay invisible setting utill animation finished, // avoid element vanish suddenly before animation. !element.invisible && willInvisibleEls.push(element); } } function prepareText(normalStyle, emphasisStyle, visualColor, width, height, upperLabelRect) { var nodeModel = thisNode.getModel(); var text = retrieve( seriesModel.getFormattedLabel( thisNode.dataIndex, 'normal', null, null, upperLabelRect ? 'upperLabel' : 'label' ), nodeModel.get('name') ); if (!upperLabelRect && thisLayout.isLeafRoot) { var iconChar = seriesModel.get('drillDownIcon', true); text = iconChar ? iconChar + ' ' + text : text; } var normalLabelModel = nodeModel.getModel( upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL ); var emphasisLabelModel = nodeModel.getModel( upperLabelRect ? PATH_UPPERLABEL_EMPHASIS : PATH_LABEL_EMPHASIS ); var isShow = normalLabelModel.getShallow('show'); setLabelStyle( normalStyle, emphasisStyle, normalLabelModel, emphasisLabelModel, { defaultText: isShow ? text : null, autoColor: visualColor, isRectText: true } ); upperLabelRect && (normalStyle.textRect = clone(upperLabelRect)); normalStyle.truncate = (isShow && normalLabelModel.get('ellipsis')) ? { outerWidth: width, outerHeight: height, minChar: 2 } : null; } function giveGraphic(storageName, Ctor, depth, z) { var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex]; var lasts = lastsForAnimation[storageName]; if (element) { // Remove from oldStorage oldStorage[storageName][oldRawIndex] = null; prepareAnimationWhenHasOld(lasts, element, storageName); } // If invisible and no old element, do not create new element (for optimizing). else if (!thisInvisible) { element = new Ctor({z: calculateZ(depth, z)}); element.__tmDepth = depth; element.__tmStorageName = storageName; prepareAnimationWhenNoOld(lasts, element, storageName); } // Set to thisStorage return (thisStorage[storageName][thisRawIndex] = element); } function prepareAnimationWhenHasOld(lasts, element, storageName) { var lastCfg = lasts[thisRawIndex] = {}; lastCfg.old = storageName === 'nodeGroup' ? element.position.slice() : extend({}, element.shape); } // If a element is new, we need to find the animation start point carefully, // otherwise it will looks strange when 'zoomToNode'. function prepareAnimationWhenNoOld(lasts, element, storageName) { var lastCfg = lasts[thisRawIndex] = {}; var parentNode = thisNode.parentNode; if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) { var parentOldX = 0; var parentOldY = 0; // New nodes appear from right-bottom corner in 'zoomToNode' animation. // For convenience, get old bounding rect from background. var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()]; if (!reRoot && parentOldBg && parentOldBg.old) { parentOldX = parentOldBg.old.width; parentOldY = parentOldBg.old.height; } // When no parent old shape found, its parent is new too, // so we can just use {x:0, y:0}. lastCfg.old = storageName === 'nodeGroup' ? [0, parentOldY] : {x: parentOldX, y: parentOldY, width: 0, height: 0}; } // Fade in, user can be aware that these nodes are new. lastCfg.fadein = storageName !== 'nodeGroup'; } } // We can not set all backgroud with the same z, Because the behaviour of // drill down and roll up differ background creation sequence from tree // hierarchy sequence, which cause that lowser background element overlap // upper ones. So we calculate z based on depth. // Moreover, we try to shrink down z interval to [0, 1] to avoid that // treemap with large z overlaps other components. function calculateZ(depth, zInLevel) { var zb = depth * Z_BASE + zInLevel; return (zb - 1) / zb; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file Treemap action */ var noop$1 = function () {}; var actionTypes = [ 'treemapZoomToNode', 'treemapRender', 'treemapMove' ]; for (var i$2 = 0; i$2 < actionTypes.length; i$2++) { registerAction({type: actionTypes[i$2], update: 'updateView'}, noop$1); } registerAction( {type: 'treemapRootToNode', update: 'updateView'}, function (payload, ecModel) { ecModel.eachComponent( {mainType: 'series', subType: 'treemap', query: payload}, handleRootToNode ); function handleRootToNode(model, index) { var types = ['treemapZoomToNode', 'treemapRootToNode']; var targetInfo = retrieveTargetInfo(payload, types, model); if (targetInfo) { var originViewRoot = model.getViewRoot(); if (originViewRoot) { payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown'; } model.resetViewRoot(targetInfo.node); } } } ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$9 = each$1; var isObject$5 = isObject$1; var CATEGORY_DEFAULT_VISUAL_INDEX = -1; /** * @param {Object} option * @param {string} [option.type] See visualHandlers. * @param {string} [option.mappingMethod] 'linear' or 'piecewise' or 'category' or 'fixed' * @param {Array.=} [option.dataExtent] [minExtent, maxExtent], * required when mappingMethod is 'linear' * @param {Array.=} [option.pieceList] [ * {value: someValue}, * {interval: [min1, max1], visual: {...}}, * {interval: [min2, max2]} * ], * required when mappingMethod is 'piecewise'. * Visual for only each piece can be specified. * @param {Array.=} [option.categories] ['cate1', 'cate2'] * required when mappingMethod is 'category'. * If no option.categories, categories is set * as [0, 1, 2, ...]. * @param {boolean} [option.loop=false] Whether loop mapping when mappingMethod is 'category'. * @param {(Array|Object|*)} [option.visual] Visual data. * when mappingMethod is 'category', * visual data can be array or object * (like: {cate1: '#222', none: '#fff'}) * or primary types (which represents * defualt category visual), otherwise visual * can be array or primary (which will be * normalized to array). * */ var VisualMapping = function (option) { var mappingMethod = option.mappingMethod; var visualType = option.type; /** * @readOnly * @type {Object} */ var thisOption = this.option = clone(option); /** * @readOnly * @type {string} */ this.type = visualType; /** * @readOnly * @type {string} */ this.mappingMethod = mappingMethod; /** * @private * @type {Function} */ this._normalizeData = normalizers[mappingMethod]; var visualHandler = visualHandlers[visualType]; /** * @public * @type {Function} */ this.applyVisual = visualHandler.applyVisual; /** * @public * @type {Function} */ this.getColorMapper = visualHandler.getColorMapper; /** * @private * @type {Function} */ this._doMap = visualHandler._doMap[mappingMethod]; if (mappingMethod === 'piecewise') { normalizeVisualRange(thisOption); preprocessForPiecewise(thisOption); } else if (mappingMethod === 'category') { thisOption.categories ? preprocessForSpecifiedCategory(thisOption) // categories is ordinal when thisOption.categories not specified, // which need no more preprocess except normalize visual. : normalizeVisualRange(thisOption, true); } else { // mappingMethod === 'linear' or 'fixed' assert$1(mappingMethod !== 'linear' || thisOption.dataExtent); normalizeVisualRange(thisOption); } }; VisualMapping.prototype = { constructor: VisualMapping, mapValueToVisual: function (value) { var normalized = this._normalizeData(value); return this._doMap(normalized, value); }, getNormalizer: function () { return bind(this._normalizeData, this); } }; var visualHandlers = VisualMapping.visualHandlers = { color: { applyVisual: makeApplyVisual('color'), /** * Create a mapper function * @return {Function} */ getColorMapper: function () { var thisOption = this.option; return bind( thisOption.mappingMethod === 'category' ? function (value, isNormalized) { !isNormalized && (value = this._normalizeData(value)); return doMapCategory.call(this, value); } : function (value, isNormalized, out) { // If output rgb array // which will be much faster and useful in pixel manipulation var returnRGBArray = !!out; !isNormalized && (value = this._normalizeData(value)); out = fastLerp(value, thisOption.parsedVisual, out); return returnRGBArray ? out : stringify(out, 'rgba'); }, this ); }, _doMap: { linear: function (normalized) { return stringify( fastLerp(normalized, this.option.parsedVisual), 'rgba' ); }, category: doMapCategory, piecewise: function (normalized, value) { var result = getSpecifiedVisual.call(this, value); if (result == null) { result = stringify( fastLerp(normalized, this.option.parsedVisual), 'rgba' ); } return result; }, fixed: doMapFixed } }, colorHue: makePartialColorVisualHandler(function (color, value) { return modifyHSL(color, value); }), colorSaturation: makePartialColorVisualHandler(function (color, value) { return modifyHSL(color, null, value); }), colorLightness: makePartialColorVisualHandler(function (color, value) { return modifyHSL(color, null, null, value); }), colorAlpha: makePartialColorVisualHandler(function (color, value) { return modifyAlpha(color, value); }), opacity: { applyVisual: makeApplyVisual('opacity'), _doMap: makeDoMap([0, 1]) }, liftZ: { applyVisual: makeApplyVisual('liftZ'), _doMap: { linear: doMapFixed, category: doMapFixed, piecewise: doMapFixed, fixed: doMapFixed } }, symbol: { applyVisual: function (value, getter, setter) { var symbolCfg = this.mapValueToVisual(value); if (isString(symbolCfg)) { setter('symbol', symbolCfg); } else if (isObject$5(symbolCfg)) { for (var name in symbolCfg) { if (symbolCfg.hasOwnProperty(name)) { setter(name, symbolCfg[name]); } } } }, _doMap: { linear: doMapToArray, category: doMapCategory, piecewise: function (normalized, value) { var result = getSpecifiedVisual.call(this, value); if (result == null) { result = doMapToArray.call(this, normalized); } return result; }, fixed: doMapFixed } }, symbolSize: { applyVisual: makeApplyVisual('symbolSize'), _doMap: makeDoMap([0, 1]) } }; function preprocessForPiecewise(thisOption) { var pieceList = thisOption.pieceList; thisOption.hasSpecialVisual = false; each$1(pieceList, function (piece, index) { piece.originIndex = index; // piece.visual is "result visual value" but not // a visual range, so it does not need to be normalized. if (piece.visual != null) { thisOption.hasSpecialVisual = true; } }); } function preprocessForSpecifiedCategory(thisOption) { // Hash categories. var categories = thisOption.categories; var visual = thisOption.visual; var categoryMap = thisOption.categoryMap = {}; each$9(categories, function (cate, index) { categoryMap[cate] = index; }); // Process visual map input. if (!isArray(visual)) { var visualArr = []; if (isObject$1(visual)) { each$9(visual, function (v, cate) { var index = categoryMap[cate]; visualArr[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v; }); } else { // Is primary type, represents default visual. visualArr[CATEGORY_DEFAULT_VISUAL_INDEX] = visual; } visual = setVisualToOption(thisOption, visualArr); } // Remove categories that has no visual, // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX. for (var i = categories.length - 1; i >= 0; i--) { if (visual[i] == null) { delete categoryMap[categories[i]]; categories.pop(); } } } function normalizeVisualRange(thisOption, isCategory) { var visual = thisOption.visual; var visualArr = []; if (isObject$1(visual)) { each$9(visual, function (v) { visualArr.push(v); }); } else if (visual != null) { visualArr.push(visual); } var doNotNeedPair = {color: 1, symbol: 1}; if (!isCategory && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type) ) { // Do not care visualArr.length === 0, which is illegal. visualArr[1] = visualArr[0]; } setVisualToOption(thisOption, visualArr); } function makePartialColorVisualHandler(applyValue) { return { applyVisual: function (value, getter, setter) { value = this.mapValueToVisual(value); // Must not be array value setter('color', applyValue(getter('color'), value)); }, _doMap: makeDoMap([0, 1]) }; } function doMapToArray(normalized) { var visual = this.option.visual; return visual[ Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true)) ] || {}; } function makeApplyVisual(visualType) { return function (value, getter, setter) { setter(visualType, this.mapValueToVisual(value)); }; } function doMapCategory(normalized) { var visual = this.option.visual; return visual[ (this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX) ? normalized % visual.length : normalized ]; } function doMapFixed() { return this.option.visual[0]; } function makeDoMap(sourceExtent) { return { linear: function (normalized) { return linearMap(normalized, sourceExtent, this.option.visual, true); }, category: doMapCategory, piecewise: function (normalized, value) { var result = getSpecifiedVisual.call(this, value); if (result == null) { result = linearMap(normalized, sourceExtent, this.option.visual, true); } return result; }, fixed: doMapFixed }; } function getSpecifiedVisual(value) { var thisOption = this.option; var pieceList = thisOption.pieceList; if (thisOption.hasSpecialVisual) { var pieceIndex = VisualMapping.findPieceIndex(value, pieceList); var piece = pieceList[pieceIndex]; if (piece && piece.visual) { return piece.visual[this.type]; } } } function setVisualToOption(thisOption, visualArr) { thisOption.visual = visualArr; if (thisOption.type === 'color') { thisOption.parsedVisual = map(visualArr, function (item) { return parse(item); }); } return visualArr; } /** * Normalizers by mapping methods. */ var normalizers = { linear: function (value) { return linearMap(value, this.option.dataExtent, [0, 1], true); }, piecewise: function (value) { var pieceList = this.option.pieceList; var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true); if (pieceIndex != null) { return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true); } }, category: function (value) { var index = this.option.categories ? this.option.categoryMap[value] : value; // ordinal return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index; }, fixed: noop }; /** * List available visual types. * * @public * @return {Array.} */ VisualMapping.listVisualTypes = function () { var visualTypes = []; each$1(visualHandlers, function (handler, key) { visualTypes.push(key); }); return visualTypes; }; /** * @public */ VisualMapping.addVisualHandler = function (name, handler) { visualHandlers[name] = handler; }; /** * @public */ VisualMapping.isValidType = function (visualType) { return visualHandlers.hasOwnProperty(visualType); }; /** * Convinent method. * Visual can be Object or Array or primary type. * * @public */ VisualMapping.eachVisual = function (visual, callback, context) { if (isObject$1(visual)) { each$1(visual, callback, context); } else { callback.call(context, visual); } }; VisualMapping.mapVisual = function (visual, callback, context) { var isPrimary; var newVisual = isArray(visual) ? [] : isObject$1(visual) ? {} : (isPrimary = true, null); VisualMapping.eachVisual(visual, function (v, key) { var newVal = callback.call(context, v, key); isPrimary ? (newVisual = newVal) : (newVisual[key] = newVal); }); return newVisual; }; /** * @public * @param {Object} obj * @return {Object} new object containers visual values. * If no visuals, return null. */ VisualMapping.retrieveVisuals = function (obj) { var ret = {}; var hasVisual; obj && each$9(visualHandlers, function (h, visualType) { if (obj.hasOwnProperty(visualType)) { ret[visualType] = obj[visualType]; hasVisual = true; } }); return hasVisual ? ret : null; }; /** * Give order to visual types, considering colorSaturation, colorAlpha depends on color. * * @public * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...} * IF Array, like: ['color', 'symbol', 'colorSaturation'] * @return {Array.} Sorted visual types. */ VisualMapping.prepareVisualTypes = function (visualTypes) { if (isObject$5(visualTypes)) { var types = []; each$9(visualTypes, function (item, type) { types.push(type); }); visualTypes = types; } else if (isArray(visualTypes)) { visualTypes = visualTypes.slice(); } else { return []; } visualTypes.sort(function (type1, type2) { // color should be front of colorSaturation, colorAlpha, ... // symbol and symbolSize do not matter. return (type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0) ? 1 : -1; }); return visualTypes; }; /** * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'. * Other visuals are only depends on themself. * * @public * @param {string} visualType1 * @param {string} visualType2 * @return {boolean} */ VisualMapping.dependsOn = function (visualType1, visualType2) { return visualType2 === 'color' ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2; }; /** * @param {number} value * @param {Array.} pieceList [{value: ..., interval: [min, max]}, ...] * Always from small to big. * @param {boolean} [findClosestWhenOutside=false] * @return {number} index */ VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) { var possibleI; var abs = Infinity; // value has the higher priority. for (var i = 0, len = pieceList.length; i < len; i++) { var pieceValue = pieceList[i].value; if (pieceValue != null) { if (pieceValue === value // FIXME // It is supposed to compare value according to value type of dimension, // but currently value type can exactly be string or number. // Compromise for numeric-like string (like '12'), especially // in the case that visualMap.categories is ['22', '33']. || (typeof pieceValue === 'string' && pieceValue === value + '') ) { return i; } findClosestWhenOutside && updatePossible(pieceValue, i); } } for (var i = 0, len = pieceList.length; i < len; i++) { var piece = pieceList[i]; var interval = piece.interval; var close = piece.close; if (interval) { if (interval[0] === -Infinity) { if (littleThan(close[1], value, interval[1])) { return i; } } else if (interval[1] === Infinity) { if (littleThan(close[0], interval[0], value)) { return i; } } else if ( littleThan(close[0], interval[0], value) && littleThan(close[1], value, interval[1]) ) { return i; } findClosestWhenOutside && updatePossible(interval[0], i); findClosestWhenOutside && updatePossible(interval[1], i); } } if (findClosestWhenOutside) { return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI; } function updatePossible(val, index) { var newAbs = Math.abs(val - value); if (newAbs < abs) { abs = newAbs; possibleI = index; } } }; function littleThan(close, a, b) { return close ? a <= b : a < b; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var isArray$2 = isArray; var ITEM_STYLE_NORMAL = 'itemStyle'; var treemapVisual = { seriesType: 'treemap', reset: function (seriesModel, ecModel, api, payload) { var tree = seriesModel.getData().tree; var root = tree.root; var seriesItemStyleModel = seriesModel.getModel(ITEM_STYLE_NORMAL); if (root.isRemoved()) { return; } var levelItemStyles = map(tree.levelModels, function (levelModel) { return levelModel ? levelModel.get(ITEM_STYLE_NORMAL) : null; }); travelTree( root, // Visual should calculate from tree root but not view root. {}, levelItemStyles, seriesItemStyleModel, seriesModel.getViewRoot().getAncestors(), seriesModel ); } }; function travelTree( node, designatedVisual, levelItemStyles, seriesItemStyleModel, viewRootAncestors, seriesModel ) { var nodeModel = node.getModel(); var nodeLayout = node.getLayout(); // Optimize if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) { return; } var nodeItemStyleModel = node.getModel(ITEM_STYLE_NORMAL); var levelItemStyle = levelItemStyles[node.depth]; var visuals = buildVisuals( nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel ); // calculate border color var borderColor = nodeItemStyleModel.get('borderColor'); var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation'); var thisNodeColor; if (borderColorSaturation != null) { // For performance, do not always execute 'calculateColor'. thisNodeColor = calculateColor(visuals, node); borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor); } node.setVisual('borderColor', borderColor); var viewChildren = node.viewChildren; if (!viewChildren || !viewChildren.length) { thisNodeColor = calculateColor(visuals, node); // Apply visual to this node. node.setVisual('color', thisNodeColor); } else { var mapping = buildVisualMapping( node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren ); // Designate visual to children. each$1(viewChildren, function (child, index) { // If higher than viewRoot, only ancestors of viewRoot is needed to visit. if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth] ) { var childVisual = mapVisual$1( nodeModel, visuals, child, index, mapping, seriesModel ); travelTree( child, childVisual, levelItemStyles, seriesItemStyleModel, viewRootAncestors, seriesModel ); } }); } } function buildVisuals( nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel ) { var visuals = extend({}, designatedVisual); each$1(['color', 'colorAlpha', 'colorSaturation'], function (visualName) { // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel var val = nodeItemStyleModel.get(visualName, true); // Ignore parent val == null && levelItemStyle && (val = levelItemStyle[visualName]); val == null && (val = designatedVisual[visualName]); val == null && (val = seriesItemStyleModel.get(visualName)); val != null && (visuals[visualName] = val); }); return visuals; } function calculateColor(visuals) { var color = getValueVisualDefine(visuals, 'color'); if (color) { var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha'); var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation'); if (colorSaturation) { color = modifyHSL(color, null, null, colorSaturation); } if (colorAlpha) { color = modifyAlpha(color, colorAlpha); } return color; } } function calculateBorderColor(borderColorSaturation, thisNodeColor) { return thisNodeColor != null ? modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null; } function getValueVisualDefine(visuals, name) { var value = visuals[name]; if (value != null && value !== 'none') { return value; } } function buildVisualMapping( node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren ) { if (!viewChildren || !viewChildren.length) { return; } var rangeVisual = getRangeVisual(nodeModel, 'color') || ( visuals.color != null && visuals.color !== 'none' && ( getRangeVisual(nodeModel, 'colorAlpha') || getRangeVisual(nodeModel, 'colorSaturation') ) ); if (!rangeVisual) { return; } var visualMin = nodeModel.get('visualMin'); var visualMax = nodeModel.get('visualMax'); var dataExtent = nodeLayout.dataExtent.slice(); visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin); visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax); var colorMappingBy = nodeModel.get('colorMappingBy'); var opt = { type: rangeVisual.name, dataExtent: dataExtent, visual: rangeVisual.range }; if (opt.type === 'color' && (colorMappingBy === 'index' || colorMappingBy === 'id') ) { opt.mappingMethod = 'category'; opt.loop = true; // categories is ordinal, so do not set opt.categories. } else { opt.mappingMethod = 'linear'; } var mapping = new VisualMapping(opt); mapping.__drColorMappingBy = colorMappingBy; return mapping; } // Notice: If we dont have the attribute 'colorRange', but only use // attribute 'color' to represent both concepts of 'colorRange' and 'color', // (It means 'colorRange' when 'color' is Array, means 'color' when not array), // this problem will be encountered: // If a level-1 node dont have children, and its siblings has children, // and colorRange is set on level-1, then the node can not be colored. // So we separate 'colorRange' and 'color' to different attributes. function getRangeVisual(nodeModel, name) { // 'colorRange', 'colorARange', 'colorSRange'. // If not exsits on this node, fetch from levels and series. var range = nodeModel.get(name); return (isArray$2(range) && range.length) ? {name: name, range: range} : null; } function mapVisual$1(nodeModel, visuals, child, index, mapping, seriesModel) { var childVisuals = extend({}, visuals); if (mapping) { var mappingType = mapping.type; var colorMappingBy = mappingType === 'color' && mapping.__drColorMappingBy; var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get('visualDimension')); childVisuals[mappingType] = mapping.mapValueToVisual(value); } return childVisuals; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * The treemap layout implementation references to the treemap * layout of d3.js (d3/src/layout/treemap.js in v3). The use of * the source code of this file is also subject to the terms * and consitions of its license (BSD-3Clause, see * ). */ var mathMax$4 = Math.max; var mathMin$4 = Math.min; var retrieveValue = retrieve; var each$10 = each$1; var PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth']; var PATH_GAP_WIDTH = ['itemStyle', 'gapWidth']; var PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show']; var PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height']; /** * @public */ var treemapLayout = { seriesType: 'treemap', reset: function (seriesModel, ecModel, api, payload) { // Layout result in each node: // {x, y, width, height, area, borderWidth} var ecWidth = api.getWidth(); var ecHeight = api.getHeight(); var seriesOption = seriesModel.option; var layoutInfo = getLayoutRect( seriesModel.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() } ); var size = seriesOption.size || []; // Compatible with ec2. var containerWidth = parsePercent$1( retrieveValue(layoutInfo.width, size[0]), ecWidth ); var containerHeight = parsePercent$1( retrieveValue(layoutInfo.height, size[1]), ecHeight ); // Fetch payload info. var payloadType = payload && payload.type; var types = ['treemapZoomToNode', 'treemapRootToNode']; var targetInfo = retrieveTargetInfo(payload, types, seriesModel); var rootRect = (payloadType === 'treemapRender' || payloadType === 'treemapMove') ? payload.rootRect : null; var viewRoot = seriesModel.getViewRoot(); var viewAbovePath = getPathToRoot(viewRoot); if (payloadType !== 'treemapMove') { var rootSize = payloadType === 'treemapZoomToNode' ? estimateRootSize( seriesModel, targetInfo, viewRoot, containerWidth, containerHeight ) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight]; var sort = seriesOption.sort; if (sort && sort !== 'asc' && sort !== 'desc') { sort = 'desc'; } var options = { squareRatio: seriesOption.squareRatio, sort: sort, leafDepth: seriesOption.leafDepth }; // layout should be cleared because using updateView but not update. viewRoot.hostTree.clearLayouts(); // TODO // optimize: if out of view clip, do not layout. // But take care that if do not render node out of view clip, // how to calculate start po var viewRootLayout = { x: 0, y: 0, width: rootSize[0], height: rootSize[1], area: rootSize[0] * rootSize[1] }; viewRoot.setLayout(viewRootLayout); squarify(viewRoot, options, false, 0); // Supplement layout. var viewRootLayout = viewRoot.getLayout(); each$10(viewAbovePath, function (node, index) { var childValue = (viewAbovePath[index + 1] || viewRoot).getValue(); node.setLayout(extend( {dataExtent: [childValue, childValue], borderWidth: 0, upperHeight: 0}, viewRootLayout )); }); } var treeRoot = seriesModel.getData().tree.root; treeRoot.setLayout( calculateRootPosition(layoutInfo, rootRect, targetInfo), true ); seriesModel.setLayoutInfo(layoutInfo); // FIXME // 现在没有clip功能,暂时取ec高宽。 prunning( treeRoot, // Transform to base element coordinate system. new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0 ); } }; /** * Layout treemap with squarify algorithm. * @see https://graphics.ethz.ch/teaching/scivis_common/Literature/squarifiedTreeMaps.pdf * The implementation references to the treemap layout of d3.js. * See the license statement at the head of this file. * * @protected * @param {module:echarts/data/Tree~TreeNode} node * @param {Object} options * @param {string} options.sort 'asc' or 'desc' * @param {number} options.squareRatio * @param {boolean} hideChildren * @param {number} depth */ function squarify(node, options, hideChildren, depth) { var width; var height; if (node.isRemoved()) { return; } var thisLayout = node.getLayout(); width = thisLayout.width; height = thisLayout.height; // Considering border and gap var nodeModel = node.getModel(); var borderWidth = nodeModel.get(PATH_BORDER_WIDTH); var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2; var upperLabelHeight = getUpperLabelHeight(nodeModel); var upperHeight = Math.max(borderWidth, upperLabelHeight); var layoutOffset = borderWidth - halfGapWidth; var layoutOffsetUpper = upperHeight - halfGapWidth; var nodeModel = node.getModel(); node.setLayout({ borderWidth: borderWidth, upperHeight: upperHeight, upperLabelHeight: upperLabelHeight }, true); width = mathMax$4(width - 2 * layoutOffset, 0); height = mathMax$4(height - layoutOffset - layoutOffsetUpper, 0); var totalArea = width * height; var viewChildren = initChildren( node, nodeModel, totalArea, options, hideChildren, depth ); if (!viewChildren.length) { return; } var rect = {x: layoutOffset, y: layoutOffsetUpper, width: width, height: height}; var rowFixedLength = mathMin$4(width, height); var best = Infinity; // the best row score so far var row = []; row.area = 0; for (var i = 0, len = viewChildren.length; i < len;) { var child = viewChildren[i]; row.push(child); row.area += child.getLayout().area; var score = worst(row, rowFixedLength, options.squareRatio); // continue with this orientation if (score <= best) { i++; best = score; } // abort, and try a different orientation else { row.area -= row.pop().getLayout().area; position(row, rowFixedLength, rect, halfGapWidth, false); rowFixedLength = mathMin$4(rect.width, rect.height); row.length = row.area = 0; best = Infinity; } } if (row.length) { position(row, rowFixedLength, rect, halfGapWidth, true); } if (!hideChildren) { var childrenVisibleMin = nodeModel.get('childrenVisibleMin'); if (childrenVisibleMin != null && totalArea < childrenVisibleMin) { hideChildren = true; } } for (var i = 0, len = viewChildren.length; i < len; i++) { squarify(viewChildren[i], options, hideChildren, depth + 1); } } /** * Set area to each child, and calculate data extent for visual coding. */ function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) { var viewChildren = node.children || []; var orderBy = options.sort; orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null); var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; // leafDepth has higher priority. if (hideChildren && !overLeafDepth) { return (node.viewChildren = []); } // Sort children, order by desc. viewChildren = filter(viewChildren, function (child) { return !child.isRemoved(); }); sort$1(viewChildren, orderBy); var info = statistic(nodeModel, viewChildren, orderBy); if (info.sum === 0) { return (node.viewChildren = []); } info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren); if (info.sum === 0) { return (node.viewChildren = []); } // Set area to each child. for (var i = 0, len = viewChildren.length; i < len; i++) { var area = viewChildren[i].getValue() / info.sum * totalArea; // Do not use setLayout({...}, true), because it is needed to clear last layout. viewChildren[i].setLayout({area: area}); } if (overLeafDepth) { viewChildren.length && node.setLayout({isLeafRoot: true}, true); viewChildren.length = 0; } node.viewChildren = viewChildren; node.setLayout({dataExtent: info.dataExtent}, true); return viewChildren; } /** * Consider 'visibleMin'. Modify viewChildren and get new sum. */ function filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) { // visibleMin is not supported yet when no option.sort. if (!orderBy) { return sum; } var visibleMin = nodeModel.get('visibleMin'); var len = orderedChildren.length; var deletePoint = len; // Always travel from little value to big value. for (var i = len - 1; i >= 0; i--) { var value = orderedChildren[ orderBy === 'asc' ? len - i - 1 : i ].getValue(); if (value / sum * totalArea < visibleMin) { deletePoint = i; sum -= value; } } orderBy === 'asc' ? orderedChildren.splice(0, len - deletePoint) : orderedChildren.splice(deletePoint, len - deletePoint); return sum; } /** * Sort */ function sort$1(viewChildren, orderBy) { if (orderBy) { viewChildren.sort(function (a, b) { var diff = orderBy === 'asc' ? a.getValue() - b.getValue() : b.getValue() - a.getValue(); return diff === 0 ? (orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex ) : diff; }); } return viewChildren; } /** * Statistic */ function statistic(nodeModel, children, orderBy) { // Calculate sum. var sum = 0; for (var i = 0, len = children.length; i < len; i++) { sum += children[i].getValue(); } // Statistic data extent for latter visual coding. // Notice: data extent should be calculate based on raw children // but not filtered view children, otherwise visual mapping will not // be stable when zoom (where children is filtered by visibleMin). var dimension = nodeModel.get('visualDimension'); var dataExtent; // The same as area dimension. if (!children || !children.length) { dataExtent = [NaN, NaN]; } else if (dimension === 'value' && orderBy) { dataExtent = [ children[children.length - 1].getValue(), children[0].getValue() ]; orderBy === 'asc' && dataExtent.reverse(); } // Other dimension. else { var dataExtent = [Infinity, -Infinity]; each$10(children, function (child) { var value = child.getValue(dimension); value < dataExtent[0] && (dataExtent[0] = value); value > dataExtent[1] && (dataExtent[1] = value); }); } return {sum: sum, dataExtent: dataExtent}; } /** * Computes the score for the specified row, * as the worst aspect ratio. */ function worst(row, rowFixedLength, ratio) { var areaMax = 0; var areaMin = Infinity; for (var i = 0, area, len = row.length; i < len; i++) { area = row[i].getLayout().area; if (area) { area < areaMin && (areaMin = area); area > areaMax && (areaMax = area); } } var squareArea = row.area * row.area; var f = rowFixedLength * rowFixedLength * ratio; return squareArea ? mathMax$4( (f * areaMax) / squareArea, squareArea / (f * areaMin) ) : Infinity; } /** * Positions the specified row of nodes. Modifies `rect`. */ function position(row, rowFixedLength, rect, halfGapWidth, flush) { // When rowFixedLength === rect.width, // it is horizontal subdivision, // rowFixedLength is the width of the subdivision, // rowOtherLength is the height of the subdivision, // and nodes will be positioned from left to right. // wh[idx0WhenH] means: when horizontal, // wh[idx0WhenH] => wh[0] => 'width'. // xy[idx1WhenH] => xy[1] => 'y'. var idx0WhenH = rowFixedLength === rect.width ? 0 : 1; var idx1WhenH = 1 - idx0WhenH; var xy = ['x', 'y']; var wh = ['width', 'height']; var last = rect[xy[idx0WhenH]]; var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0; if (flush || rowOtherLength > rect[wh[idx1WhenH]]) { rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow } for (var i = 0, rowLen = row.length; i < rowLen; i++) { var node = row[i]; var nodeLayout = {}; var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0; var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax$4(rowOtherLength - 2 * halfGapWidth, 0); // We use Math.max/min to avoid negative width/height when considering gap width. var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last; var modWH = (i === rowLen - 1 || remain < step) ? remain : step; var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax$4(modWH - 2 * halfGapWidth, 0); nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$4(halfGapWidth, wh1 / 2); nodeLayout[xy[idx0WhenH]] = last + mathMin$4(halfGapWidth, wh0 / 2); last += modWH; node.setLayout(nodeLayout, true); } rect[xy[idx1WhenH]] += rowOtherLength; rect[wh[idx1WhenH]] -= rowOtherLength; } // Return [containerWidth, containerHeight] as defualt. function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) { // If targetInfo.node exists, we zoom to the node, // so estimate whold width and heigth by target node. var currNode = (targetInfo || {}).node; var defaultSize = [containerWidth, containerHeight]; if (!currNode || currNode === viewRoot) { return defaultSize; } var parent; var viewArea = containerWidth * containerHeight; var area = viewArea * seriesModel.option.zoomToNodeRatio; while (parent = currNode.parentNode) { // jshint ignore:line var sum = 0; var siblings = parent.children; for (var i = 0, len = siblings.length; i < len; i++) { sum += siblings[i].getValue(); } var currNodeValue = currNode.getValue(); if (currNodeValue === 0) { return defaultSize; } area *= sum / currNodeValue; // Considering border, suppose aspect ratio is 1. var parentModel = parent.getModel(); var borderWidth = parentModel.get(PATH_BORDER_WIDTH); var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel, borderWidth)); area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5); area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER); currNode = parent; } area < viewArea && (area = viewArea); var scale = Math.pow(area / viewArea, 0.5); return [containerWidth * scale, containerHeight * scale]; } // Root postion base on coord of containerGroup function calculateRootPosition(layoutInfo, rootRect, targetInfo) { if (rootRect) { return {x: rootRect.x, y: rootRect.y}; } var defaultPosition = {x: 0, y: 0}; if (!targetInfo) { return defaultPosition; } // If targetInfo is fetched by 'retrieveTargetInfo', // old tree and new tree are the same tree, // so the node still exists and we can visit it. var targetNode = targetInfo.node; var layout = targetNode.getLayout(); if (!layout) { return defaultPosition; } // Transform coord from local to container. var targetCenter = [layout.width / 2, layout.height / 2]; var node = targetNode; while (node) { var nodeLayout = node.getLayout(); targetCenter[0] += nodeLayout.x; targetCenter[1] += nodeLayout.y; node = node.parentNode; } return { x: layoutInfo.width / 2 - targetCenter[0], y: layoutInfo.height / 2 - targetCenter[1] }; } // Mark nodes visible for prunning when visual coding and rendering. // Prunning depends on layout and root position, so we have to do it after layout. function prunning(node, clipRect, viewAbovePath, viewRoot, depth) { var nodeLayout = node.getLayout(); var nodeInViewAbovePath = viewAbovePath[depth]; var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node; if ( (nodeInViewAbovePath && !isAboveViewRoot) || (depth === viewAbovePath.length && node !== viewRoot) ) { return; } node.setLayout({ // isInView means: viewRoot sub tree + viewAbovePath isInView: true, // invisible only means: outside view clip so that the node can not // see but still layout for animation preparation but not render. invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout), isAboveViewRoot: isAboveViewRoot }, true); // Transform to child coordinate. var childClipRect = new BoundingRect( clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height ); each$10(node.viewChildren || [], function (child) { prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1); }); } function getUpperLabelHeight(model) { return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerVisual(treemapVisual); registerLayout(treemapLayout); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Graph data structure * * @module echarts/data/Graph * @author Yi Shen(https://www.github.com/pissang) */ // id may be function name of Object, add a prefix to avoid this problem. function generateNodeKey (id) { return '_EC_' + id; } /** * @alias module:echarts/data/Graph * @constructor * @param {boolean} directed */ var Graph = function(directed) { /** * 是否是有向图 * @type {boolean} * @private */ this._directed = directed || false; /** * @type {Array.} * @readOnly */ this.nodes = []; /** * @type {Array.} * @readOnly */ this.edges = []; /** * @type {Object.} * @private */ this._nodesMap = {}; /** * @type {Object.} * @private */ this._edgesMap = {}; /** * @type {module:echarts/data/List} * @readOnly */ this.data; /** * @type {module:echarts/data/List} * @readOnly */ this.edgeData; }; var graphProto = Graph.prototype; /** * @type {string} */ graphProto.type = 'graph'; /** * If is directed graph * @return {boolean} */ graphProto.isDirected = function () { return this._directed; }; /** * Add a new node * @param {string} id * @param {number} [dataIndex] */ graphProto.addNode = function (id, dataIndex) { id = id || ('' + dataIndex); var nodesMap = this._nodesMap; if (nodesMap[generateNodeKey(id)]) { if (__DEV__) { console.error('Graph nodes have duplicate name or id'); } return; } var node = new Node(id, dataIndex); node.hostGraph = this; this.nodes.push(node); nodesMap[generateNodeKey(id)] = node; return node; }; /** * Get node by data index * @param {number} dataIndex * @return {module:echarts/data/Graph~Node} */ graphProto.getNodeByIndex = function (dataIndex) { var rawIdx = this.data.getRawIndex(dataIndex); return this.nodes[rawIdx]; }; /** * Get node by id * @param {string} id * @return {module:echarts/data/Graph.Node} */ graphProto.getNodeById = function (id) { return this._nodesMap[generateNodeKey(id)]; }; /** * Add a new edge * @param {number|string|module:echarts/data/Graph.Node} n1 * @param {number|string|module:echarts/data/Graph.Node} n2 * @param {number} [dataIndex=-1] * @return {module:echarts/data/Graph.Edge} */ graphProto.addEdge = function (n1, n2, dataIndex) { var nodesMap = this._nodesMap; var edgesMap = this._edgesMap; // PNEDING if (typeof n1 === 'number') { n1 = this.nodes[n1]; } if (typeof n2 === 'number') { n2 = this.nodes[n2]; } if (!Node.isInstance(n1)) { n1 = nodesMap[generateNodeKey(n1)]; } if (!Node.isInstance(n2)) { n2 = nodesMap[generateNodeKey(n2)]; } if (!n1 || !n2) { return; } var key = n1.id + '-' + n2.id; // PENDING if (edgesMap[key]) { return; } var edge = new Edge(n1, n2, dataIndex); edge.hostGraph = this; if (this._directed) { n1.outEdges.push(edge); n2.inEdges.push(edge); } n1.edges.push(edge); if (n1 !== n2) { n2.edges.push(edge); } this.edges.push(edge); edgesMap[key] = edge; return edge; }; /** * Get edge by data index * @param {number} dataIndex * @return {module:echarts/data/Graph~Node} */ graphProto.getEdgeByIndex = function (dataIndex) { var rawIdx = this.edgeData.getRawIndex(dataIndex); return this.edges[rawIdx]; }; /** * Get edge by two linked nodes * @param {module:echarts/data/Graph.Node|string} n1 * @param {module:echarts/data/Graph.Node|string} n2 * @return {module:echarts/data/Graph.Edge} */ graphProto.getEdge = function (n1, n2) { if (Node.isInstance(n1)) { n1 = n1.id; } if (Node.isInstance(n2)) { n2 = n2.id; } var edgesMap = this._edgesMap; if (this._directed) { return edgesMap[n1 + '-' + n2]; } else { return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1]; } }; /** * Iterate all nodes * @param {Function} cb * @param {*} [context] */ graphProto.eachNode = function (cb, context) { var nodes = this.nodes; var len = nodes.length; for (var i = 0; i < len; i++) { if (nodes[i].dataIndex >= 0) { cb.call(context, nodes[i], i); } } }; /** * Iterate all edges * @param {Function} cb * @param {*} [context] */ graphProto.eachEdge = function (cb, context) { var edges = this.edges; var len = edges.length; for (var i = 0; i < len; i++) { if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0 ) { cb.call(context, edges[i], i); } } }; /** * Breadth first traverse * @param {Function} cb * @param {module:echarts/data/Graph.Node} startNode * @param {string} [direction='none'] 'none'|'in'|'out' * @param {*} [context] */ graphProto.breadthFirstTraverse = function ( cb, startNode, direction, context ) { if (!Node.isInstance(startNode)) { startNode = this._nodesMap[generateNodeKey(startNode)]; } if (!startNode) { return; } var edgeType = direction === 'out' ? 'outEdges' : (direction === 'in' ? 'inEdges' : 'edges'); for (var i = 0; i < this.nodes.length; i++) { this.nodes[i].__visited = false; } if (cb.call(context, startNode, null)) { return; } var queue = [startNode]; while (queue.length) { var currentNode = queue.shift(); var edges = currentNode[edgeType]; for (var i = 0; i < edges.length; i++) { var e = edges[i]; var otherNode = e.node1 === currentNode ? e.node2 : e.node1; if (!otherNode.__visited) { if (cb.call(context, otherNode, currentNode)) { // Stop traversing return; } queue.push(otherNode); otherNode.__visited = true; } } } }; // TODO // graphProto.depthFirstTraverse = function ( // cb, startNode, direction, context // ) { // }; // Filter update graphProto.update = function () { var data = this.data; var edgeData = this.edgeData; var nodes = this.nodes; var edges = this.edges; for (var i = 0, len = nodes.length; i < len; i++) { nodes[i].dataIndex = -1; } for (var i = 0, len = data.count(); i < len; i++) { nodes[data.getRawIndex(i)].dataIndex = i; } edgeData.filterSelf(function (idx) { var edge = edges[edgeData.getRawIndex(idx)]; return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0; }); // Update edge for (var i = 0, len = edges.length; i < len; i++) { edges[i].dataIndex = -1; } for (var i = 0, len = edgeData.count(); i < len; i++) { edges[edgeData.getRawIndex(i)].dataIndex = i; } }; /** * @return {module:echarts/data/Graph} */ graphProto.clone = function () { var graph = new Graph(this._directed); var nodes = this.nodes; var edges = this.edges; for (var i = 0; i < nodes.length; i++) { graph.addNode(nodes[i].id, nodes[i].dataIndex); } for (var i = 0; i < edges.length; i++) { var e = edges[i]; graph.addEdge(e.node1.id, e.node2.id, e.dataIndex); } return graph; }; /** * @alias module:echarts/data/Graph.Node */ function Node(id, dataIndex) { /** * @type {string} */ this.id = id == null ? '' : id; /** * @type {Array.} */ this.inEdges = []; /** * @type {Array.} */ this.outEdges = []; /** * @type {Array.} */ this.edges = []; /** * @type {module:echarts/data/Graph} */ this.hostGraph; /** * @type {number} */ this.dataIndex = dataIndex == null ? -1 : dataIndex; } Node.prototype = { constructor: Node, /** * @return {number} */ degree: function () { return this.edges.length; }, /** * @return {number} */ inDegree: function () { return this.inEdges.length; }, /** * @return {number} */ outDegree: function () { return this.outEdges.length; }, /** * @param {string} [path] * @return {module:echarts/model/Model} */ getModel: function (path) { if (this.dataIndex < 0) { return; } var graph = this.hostGraph; var itemModel = graph.data.getItemModel(this.dataIndex); return itemModel.getModel(path); } }; /** * 图边 * @alias module:echarts/data/Graph.Edge * @param {module:echarts/data/Graph.Node} n1 * @param {module:echarts/data/Graph.Node} n2 * @param {number} [dataIndex=-1] */ function Edge(n1, n2, dataIndex) { /** * 节点1,如果是有向图则为源节点 * @type {module:echarts/data/Graph.Node} */ this.node1 = n1; /** * 节点2,如果是有向图则为目标节点 * @type {module:echarts/data/Graph.Node} */ this.node2 = n2; this.dataIndex = dataIndex == null ? -1 : dataIndex; } /** * @param {string} [path] * @return {module:echarts/model/Model} */ Edge.prototype.getModel = function (path) { if (this.dataIndex < 0) { return; } var graph = this.hostGraph; var itemModel = graph.edgeData.getItemModel(this.dataIndex); return itemModel.getModel(path); }; var createGraphDataProxyMixin = function (hostName, dataName) { return { /** * @param {string=} [dimension='value'] Default 'value'. can be 'a', 'b', 'c', 'd', 'e'. * @return {number} */ getValue: function (dimension) { var data = this[hostName][dataName]; return data.get(data.getDimension(dimension || 'value'), this.dataIndex); }, /** * @param {Object|string} key * @param {*} [value] */ setVisual: function (key, value) { this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value); }, /** * @param {string} key * @return {boolean} */ getVisual: function (key, ignoreParent) { return this[hostName][dataName].getItemVisual(this.dataIndex, key, ignoreParent); }, /** * @param {Object} layout * @return {boolean} [merge=false] */ setLayout: function (layout, merge$$1) { this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge$$1); }, /** * @return {Object} */ getLayout: function () { return this[hostName][dataName].getItemLayout(this.dataIndex); }, /** * @return {module:zrender/Element} */ getGraphicEl: function () { return this[hostName][dataName].getItemGraphicEl(this.dataIndex); }, /** * @return {number} */ getRawIndex: function () { return this[hostName][dataName].getRawIndex(this.dataIndex); } }; }; mixin(Node, createGraphDataProxyMixin('hostGraph', 'data')); mixin(Edge, createGraphDataProxyMixin('hostGraph', 'edgeData')); Graph.Node = Node; Graph.Edge = Edge; enableClassCheck(Node); enableClassCheck(Edge); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var createGraphFromNodeEdge = function (nodes, edges, seriesModel, directed, beforeLink) { // ??? TODO // support dataset? var graph = new Graph(directed); for (var i = 0; i < nodes.length; i++) { graph.addNode(retrieve( // Id, name, dataIndex nodes[i].id, nodes[i].name, i ), i); } var linkNameList = []; var validEdges = []; var linkCount = 0; for (var i = 0; i < edges.length; i++) { var link = edges[i]; var source = link.source; var target = link.target; // addEdge may fail when source or target not exists if (graph.addEdge(source, target, linkCount)) { validEdges.push(link); linkNameList.push(retrieve(link.id, source + ' > ' + target)); linkCount++; } } var coordSys = seriesModel.get('coordinateSystem'); var nodeData; if (coordSys === 'cartesian2d' || coordSys === 'polar') { nodeData = createListFromArray(nodes, seriesModel); } else { var coordSysCtor = CoordinateSystemManager.get(coordSys); var coordDimensions = (coordSysCtor && coordSysCtor.type !== 'view') ? (coordSysCtor.dimensions || []) : []; // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs // `value` dimension, but graph need `value` dimension. It's better to // uniform this behavior. if (indexOf(coordDimensions, 'value') < 0) { coordDimensions.concat(['value']); } var dimensionNames = createDimensions(nodes, { coordDimensions: coordDimensions }); nodeData = new List(dimensionNames, seriesModel); nodeData.initData(nodes); } var edgeData = new List(['value'], seriesModel); edgeData.initData(validEdges, linkNameList); beforeLink && beforeLink(nodeData, edgeData); linkList({ mainData: nodeData, struct: graph, structAttr: 'graph', datas: {node: nodeData, edge: edgeData}, datasAttr: {node: 'data', edge: 'edgeData'} }); // Update dataIndex of nodes and edges because invalid edge may be removed graph.update(); return graph; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var GraphSeries = extendSeriesModel({ type: 'series.graph', init: function (option) { GraphSeries.superApply(this, 'init', arguments); // Provide data for legend select this.legendDataProvider = function () { return this._categoriesData; }; this.fillDataTextStyle(option.edges || option.links); this._updateCategoriesData(); }, mergeOption: function (option) { GraphSeries.superApply(this, 'mergeOption', arguments); this.fillDataTextStyle(option.edges || option.links); this._updateCategoriesData(); }, mergeDefaultAndTheme: function (option) { GraphSeries.superApply(this, 'mergeDefaultAndTheme', arguments); defaultEmphasis(option, ['edgeLabel'], ['show']); }, getInitialData: function (option, ecModel) { var edges = option.edges || option.links || []; var nodes = option.data || option.nodes || []; var self = this; if (nodes && edges) { return createGraphFromNodeEdge(nodes, edges, this, true, beforeLink).data; } function beforeLink(nodeData, edgeData) { // Overwrite nodeData.getItemModel to nodeData.wrapMethod('getItemModel', function (model) { var categoriesModels = self._categoriesModels; var categoryIdx = model.getShallow('category'); var categoryModel = categoriesModels[categoryIdx]; if (categoryModel) { categoryModel.parentModel = model.parentModel; model.parentModel = categoryModel; } return model; }); var edgeLabelModel = self.getModel('edgeLabel'); // For option `edgeLabel` can be found by label.xxx.xxx on item mode. var fakeSeriesModel = new Model( {label: edgeLabelModel.option}, edgeLabelModel.parentModel, ecModel ); var emphasisEdgeLabelModel = self.getModel('emphasis.edgeLabel'); var emphasisFakeSeriesModel = new Model( {emphasis: {label: emphasisEdgeLabelModel.option}}, emphasisEdgeLabelModel.parentModel, ecModel ); edgeData.wrapMethod('getItemModel', function (model) { model.customizeGetParent(edgeGetParent); return model; }); function edgeGetParent(path) { path = this.parsePath(path); return (path && path[0] === 'label') ? fakeSeriesModel : (path && path[0] === 'emphasis' && path[1] === 'label') ? emphasisFakeSeriesModel : this.parentModel; } } }, /** * @return {module:echarts/data/Graph} */ getGraph: function () { return this.getData().graph; }, /** * @return {module:echarts/data/List} */ getEdgeData: function () { return this.getGraph().edgeData; }, /** * @return {module:echarts/data/List} */ getCategoriesData: function () { return this._categoriesData; }, /** * @override */ formatTooltip: function (dataIndex, multipleSeries, dataType) { if (dataType === 'edge') { var nodeData = this.getData(); var params = this.getDataParams(dataIndex, dataType); var edge = nodeData.graph.getEdgeByIndex(dataIndex); var sourceName = nodeData.getName(edge.node1.dataIndex); var targetName = nodeData.getName(edge.node2.dataIndex); var html = []; sourceName != null && html.push(sourceName); targetName != null && html.push(targetName); html = encodeHTML(html.join(' > ')); if (params.value) { html += ' : ' + encodeHTML(params.value); } return html; } else { // dataType === 'node' or empty return GraphSeries.superApply(this, 'formatTooltip', arguments); } }, _updateCategoriesData: function () { var categories = map(this.option.categories || [], function (category) { // Data must has value return category.value != null ? category : extend({ value: 0 }, category); }); var categoriesData = new List(['value'], this); categoriesData.initData(categories); this._categoriesData = categoriesData; this._categoriesModels = categoriesData.mapArray(function (idx) { return categoriesData.getItemModel(idx, true); }); }, setZoom: function (zoom) { this.option.zoom = zoom; }, setCenter: function (center) { this.option.center = center; }, isAnimationEnabled: function () { return GraphSeries.superCall(this, 'isAnimationEnabled') // Not enable animation when do force layout && !(this.get('layout') === 'force' && this.get('force.layoutAnimation')); }, defaultOption: { zlevel: 0, z: 2, coordinateSystem: 'view', // Default option for all coordinate systems // xAxisIndex: 0, // yAxisIndex: 0, // polarIndex: 0, // geoIndex: 0, legendHoverLink: true, hoverAnimation: true, layout: null, focusNodeAdjacency: false, // Configuration of circular layout circular: { rotateLabel: false }, // Configuration of force directed layout force: { initLayout: null, // Node repulsion. Can be an array to represent range. repulsion: [0, 50], gravity: 0.1, // Edge length. Can be an array to represent range. edgeLength: 30, layoutAnimation: true }, left: 'center', top: 'center', // right: null, // bottom: null, // width: '80%', // height: '80%', symbol: 'circle', symbolSize: 10, edgeSymbol: ['none', 'none'], edgeSymbolSize: 10, edgeLabel: { position: 'middle' }, draggable: false, roam: false, // Default on center of graph center: null, zoom: 1, // Symbol size scale ratio in roam nodeScaleRatio: 0.6, // cursor: null, // categories: [], // data: [] // Or // nodes: [] // // links: [] // Or // edges: [] label: { show: false, formatter: '{b}' }, itemStyle: {}, lineStyle: { color: '#aaa', width: 1, curveness: 0, opacity: 0.5 }, emphasis: { label: { show: true } } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Line path for bezier and straight line draw */ var straightLineProto = Line.prototype; var bezierCurveProto = BezierCurve.prototype; function isLine(shape) { return isNaN(+shape.cpx1) || isNaN(+shape.cpy1); } var LinePath = extendShape({ type: 'ec-line', style: { stroke: '#000', fill: null }, shape: { x1: 0, y1: 0, x2: 0, y2: 0, percent: 1, cpx1: null, cpy1: null }, buildPath: function (ctx, shape) { (isLine(shape) ? straightLineProto : bezierCurveProto).buildPath(ctx, shape); }, pointAt: function (t) { return isLine(this.shape) ? straightLineProto.pointAt.call(this, t) : bezierCurveProto.pointAt.call(this, t); }, tangentAt: function (t) { var shape = this.shape; var p = isLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t); return normalize(p, p); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @module echarts/chart/helper/Line */ var SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol']; function makeSymbolTypeKey(symbolCategory) { return '_' + symbolCategory + 'Type'; } /** * @inner */ function createSymbol$1(name, lineData, idx) { var color = lineData.getItemVisual(idx, 'color'); var symbolType = lineData.getItemVisual(idx, name); var symbolSize = lineData.getItemVisual(idx, name + 'Size'); if (!symbolType || symbolType === 'none') { return; } if (!isArray(symbolSize)) { symbolSize = [symbolSize, symbolSize]; } var symbolPath = createSymbol( symbolType, -symbolSize[0] / 2, -symbolSize[1] / 2, symbolSize[0], symbolSize[1], color ); symbolPath.name = name; return symbolPath; } function createLine(points) { var line = new LinePath({ name: 'line' }); setLinePoints(line.shape, points); return line; } function setLinePoints(targetShape, points) { var p1 = points[0]; var p2 = points[1]; var cp1 = points[2]; targetShape.x1 = p1[0]; targetShape.y1 = p1[1]; targetShape.x2 = p2[0]; targetShape.y2 = p2[1]; targetShape.percent = 1; if (cp1) { targetShape.cpx1 = cp1[0]; targetShape.cpy1 = cp1[1]; } else { targetShape.cpx1 = NaN; targetShape.cpy1 = NaN; } } function updateSymbolAndLabelBeforeLineUpdate () { var lineGroup = this; var symbolFrom = lineGroup.childOfName('fromSymbol'); var symbolTo = lineGroup.childOfName('toSymbol'); var label = lineGroup.childOfName('label'); // Quick reject if (!symbolFrom && !symbolTo && label.ignore) { return; } var invScale = 1; var parentNode = this.parent; while (parentNode) { if (parentNode.scale) { invScale /= parentNode.scale[0]; } parentNode = parentNode.parent; } var line = lineGroup.childOfName('line'); // If line not changed // FIXME Parent scale changed if (!this.__dirty && !line.__dirty) { return; } var percent = line.shape.percent; var fromPos = line.pointAt(0); var toPos = line.pointAt(percent); var d = sub([], toPos, fromPos); normalize(d, d); if (symbolFrom) { symbolFrom.attr('position', fromPos); var tangent = line.tangentAt(0); symbolFrom.attr('rotation', Math.PI / 2 - Math.atan2( tangent[1], tangent[0] )); symbolFrom.attr('scale', [invScale * percent, invScale * percent]); } if (symbolTo) { symbolTo.attr('position', toPos); var tangent = line.tangentAt(1); symbolTo.attr('rotation', -Math.PI / 2 - Math.atan2( tangent[1], tangent[0] )); symbolTo.attr('scale', [invScale * percent, invScale * percent]); } if (!label.ignore) { label.attr('position', toPos); var textPosition; var textAlign; var textVerticalAlign; var distance$$1 = 5 * invScale; // End if (label.__position === 'end') { textPosition = [d[0] * distance$$1 + toPos[0], d[1] * distance$$1 + toPos[1]]; textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center'); textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle'); } // Middle else if (label.__position === 'middle') { var halfPercent = percent / 2; var tangent = line.tangentAt(halfPercent); var n = [tangent[1], -tangent[0]]; var cp = line.pointAt(halfPercent); if (n[1] > 0) { n[0] = -n[0]; n[1] = -n[1]; } textPosition = [cp[0] + n[0] * distance$$1, cp[1] + n[1] * distance$$1]; textAlign = 'center'; textVerticalAlign = 'bottom'; var rotation = -Math.atan2(tangent[1], tangent[0]); if (toPos[0] < fromPos[0]) { rotation = Math.PI + rotation; } label.attr('rotation', rotation); } // Start else { textPosition = [-d[0] * distance$$1 + fromPos[0], -d[1] * distance$$1 + fromPos[1]]; textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center'); textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle'); } label.attr({ style: { // Use the user specified text align and baseline first textVerticalAlign: label.__verticalAlign || textVerticalAlign, textAlign: label.__textAlign || textAlign }, position: textPosition, scale: [invScale, invScale] }); } } /** * @constructor * @extends {module:zrender/graphic/Group} * @alias {module:echarts/chart/helper/Line} */ function Line$1(lineData, idx, seriesScope) { Group.call(this); this._createLine(lineData, idx, seriesScope); } var lineProto = Line$1.prototype; // Update symbol position and rotation lineProto.beforeUpdate = updateSymbolAndLabelBeforeLineUpdate; lineProto._createLine = function (lineData, idx, seriesScope) { var seriesModel = lineData.hostModel; var linePoints = lineData.getItemLayout(idx); var line = createLine(linePoints); line.shape.percent = 0; initProps(line, { shape: { percent: 1 } }, seriesModel, idx); this.add(line); var label = new Text({ name: 'label' }); this.add(label); each$1(SYMBOL_CATEGORIES, function (symbolCategory) { var symbol = createSymbol$1(symbolCategory, lineData, idx); // symbols must added after line to make sure // it will be updated after line#update. // Or symbol position and rotation update in line#beforeUpdate will be one frame slow this.add(symbol); this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory); }, this); this._updateCommonStl(lineData, idx, seriesScope); }; lineProto.updateData = function (lineData, idx, seriesScope) { var seriesModel = lineData.hostModel; var line = this.childOfName('line'); var linePoints = lineData.getItemLayout(idx); var target = { shape: {} }; setLinePoints(target.shape, linePoints); updateProps(line, target, seriesModel, idx); each$1(SYMBOL_CATEGORIES, function (symbolCategory) { var symbolType = lineData.getItemVisual(idx, symbolCategory); var key = makeSymbolTypeKey(symbolCategory); // Symbol changed if (this[key] !== symbolType) { this.remove(this.childOfName(symbolCategory)); var symbol = createSymbol$1(symbolCategory, lineData, idx); this.add(symbol); } this[key] = symbolType; }, this); this._updateCommonStl(lineData, idx, seriesScope); }; lineProto._updateCommonStl = function (lineData, idx, seriesScope) { var seriesModel = lineData.hostModel; var line = this.childOfName('line'); var lineStyle = seriesScope && seriesScope.lineStyle; var hoverLineStyle = seriesScope && seriesScope.hoverLineStyle; var labelModel = seriesScope && seriesScope.labelModel; var hoverLabelModel = seriesScope && seriesScope.hoverLabelModel; // Optimization for large dataset if (!seriesScope || lineData.hasItemOption) { var itemModel = lineData.getItemModel(idx); lineStyle = itemModel.getModel('lineStyle').getLineStyle(); hoverLineStyle = itemModel.getModel('emphasis.lineStyle').getLineStyle(); labelModel = itemModel.getModel('label'); hoverLabelModel = itemModel.getModel('emphasis.label'); } var visualColor = lineData.getItemVisual(idx, 'color'); var visualOpacity = retrieve3( lineData.getItemVisual(idx, 'opacity'), lineStyle.opacity, 1 ); line.useStyle(defaults( { strokeNoScale: true, fill: 'none', stroke: visualColor, opacity: visualOpacity }, lineStyle )); line.hoverStyle = hoverLineStyle; // Update symbol each$1(SYMBOL_CATEGORIES, function (symbolCategory) { var symbol = this.childOfName(symbolCategory); if (symbol) { symbol.setColor(visualColor); symbol.setStyle({ opacity: visualOpacity }); } }, this); var showLabel = labelModel.getShallow('show'); var hoverShowLabel = hoverLabelModel.getShallow('show'); var label = this.childOfName('label'); var defaultLabelColor; var baseText; // FIXME: the logic below probably should be merged to `graphic.setLabelStyle`. if (showLabel || hoverShowLabel) { defaultLabelColor = visualColor || '#000'; baseText = seriesModel.getFormattedLabel(idx, 'normal', lineData.dataType); if (baseText == null) { var rawVal = seriesModel.getRawValue(idx); baseText = rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round$1(rawVal) : rawVal; } } var normalText = showLabel ? baseText : null; var emphasisText = hoverShowLabel ? retrieve2( seriesModel.getFormattedLabel(idx, 'emphasis', lineData.dataType), baseText ) : null; var labelStyle = label.style; // Always set `textStyle` even if `normalStyle.text` is null, because default // values have to be set on `normalStyle`. if (normalText != null || emphasisText != null) { setTextStyle(label.style, labelModel, { text: normalText }, { autoColor: defaultLabelColor }); label.__textAlign = labelStyle.textAlign; label.__verticalAlign = labelStyle.textVerticalAlign; // 'start', 'middle', 'end' label.__position = labelModel.get('position') || 'middle'; } if (emphasisText != null) { // Only these properties supported in this emphasis style here. label.hoverStyle = { text: emphasisText, textFill: hoverLabelModel.getTextColor(true), // For merging hover style to normal style, do not use // `hoverLabelModel.getFont()` here. fontStyle: hoverLabelModel.getShallow('fontStyle'), fontWeight: hoverLabelModel.getShallow('fontWeight'), fontSize: hoverLabelModel.getShallow('fontSize'), fontFamily: hoverLabelModel.getShallow('fontFamily') }; } else { label.hoverStyle = { text: null }; } label.ignore = !showLabel && !hoverShowLabel; setHoverStyle(this); }; lineProto.highlight = function () { this.trigger('emphasis'); }; lineProto.downplay = function () { this.trigger('normal'); }; lineProto.updateLayout = function (lineData, idx) { this.setLinePoints(lineData.getItemLayout(idx)); }; lineProto.setLinePoints = function (points) { var linePath = this.childOfName('line'); setLinePoints(linePath.shape, points); linePath.dirty(); }; inherits(Line$1, Group); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @module echarts/chart/helper/LineDraw */ // import IncrementalDisplayable from 'zrender/src/graphic/IncrementalDisplayable'; /** * @alias module:echarts/component/marker/LineDraw * @constructor */ function LineDraw(ctor) { this._ctor = ctor || Line$1; this.group = new Group(); } var lineDrawProto = LineDraw.prototype; lineDrawProto.isPersistent = function () { return true; }; /** * @param {module:echarts/data/List} lineData */ lineDrawProto.updateData = function (lineData) { var lineDraw = this; var group = lineDraw.group; var oldLineData = lineDraw._lineData; lineDraw._lineData = lineData; // There is no oldLineData only when first rendering or switching from // stream mode to normal mode, where previous elements should be removed. if (!oldLineData) { group.removeAll(); } var seriesScope = makeSeriesScope$1(lineData); lineData.diff(oldLineData) .add(function (idx) { doAdd(lineDraw, lineData, idx, seriesScope); }) .update(function (newIdx, oldIdx) { doUpdate(lineDraw, oldLineData, lineData, oldIdx, newIdx, seriesScope); }) .remove(function (idx) { group.remove(oldLineData.getItemGraphicEl(idx)); }) .execute(); }; function doAdd(lineDraw, lineData, idx, seriesScope) { var itemLayout = lineData.getItemLayout(idx); if (!lineNeedsDraw(itemLayout)) { return; } var el = new lineDraw._ctor(lineData, idx, seriesScope); lineData.setItemGraphicEl(idx, el); lineDraw.group.add(el); } function doUpdate(lineDraw, oldLineData, newLineData, oldIdx, newIdx, seriesScope) { var itemEl = oldLineData.getItemGraphicEl(oldIdx); if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) { lineDraw.group.remove(itemEl); return; } if (!itemEl) { itemEl = new lineDraw._ctor(newLineData, newIdx, seriesScope); } else { itemEl.updateData(newLineData, newIdx, seriesScope); } newLineData.setItemGraphicEl(newIdx, itemEl); lineDraw.group.add(itemEl); } lineDrawProto.updateLayout = function () { var lineData = this._lineData; // Do not support update layout in incremental mode. if (!lineData) { return; } lineData.eachItemGraphicEl(function (el, idx) { el.updateLayout(lineData, idx); }, this); }; lineDrawProto.incrementalPrepareUpdate = function (lineData) { this._seriesScope = makeSeriesScope$1(lineData); this._lineData = null; this.group.removeAll(); }; lineDrawProto.incrementalUpdate = function (taskParams, lineData) { function updateIncrementalAndHover(el) { if (!el.isGroup) { el.incremental = el.useHoverLayer = true; } } for (var idx = taskParams.start; idx < taskParams.end; idx++) { var itemLayout = lineData.getItemLayout(idx); if (lineNeedsDraw(itemLayout)) { var el = new this._ctor(lineData, idx, this._seriesScope); el.traverse(updateIncrementalAndHover); this.group.add(el); lineData.setItemGraphicEl(idx, el); } } }; function makeSeriesScope$1(lineData) { var hostModel = lineData.hostModel; return { lineStyle: hostModel.getModel('lineStyle').getLineStyle(), hoverLineStyle: hostModel.getModel('emphasis.lineStyle').getLineStyle(), labelModel: hostModel.getModel('label'), hoverLabelModel: hostModel.getModel('emphasis.label') }; } lineDrawProto.remove = function () { this._clearIncremental(); this._incremental = null; this.group.removeAll(); }; lineDrawProto._clearIncremental = function () { var incremental = this._incremental; if (incremental) { incremental.clearDisplaybles(); } }; function isPointNaN(pt) { return isNaN(pt[0]) || isNaN(pt[1]); } function lineNeedsDraw(pts) { return !isPointNaN(pts[0]) && !isPointNaN(pts[1]); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var v1 = []; var v2 = []; var v3 = []; var quadraticAt$1 = quadraticAt; var v2DistSquare = distSquare; var mathAbs$1 = Math.abs; function intersectCurveCircle(curvePoints, center, radius) { var p0 = curvePoints[0]; var p1 = curvePoints[1]; var p2 = curvePoints[2]; var d = Infinity; var t; var radiusSquare = radius * radius; var interval = 0.1; for (var _t = 0.1; _t <= 0.9; _t += 0.1) { v1[0] = quadraticAt$1(p0[0], p1[0], p2[0], _t); v1[1] = quadraticAt$1(p0[1], p1[1], p2[1], _t); var diff = mathAbs$1(v2DistSquare(v1, center) - radiusSquare); if (diff < d) { d = diff; t = _t; } } // Assume the segment is monotone,Find root through Bisection method // At most 32 iteration for (var i = 0; i < 32; i++) { // var prev = t - interval; var next = t + interval; // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev); // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev); v2[0] = quadraticAt$1(p0[0], p1[0], p2[0], t); v2[1] = quadraticAt$1(p0[1], p1[1], p2[1], t); v3[0] = quadraticAt$1(p0[0], p1[0], p2[0], next); v3[1] = quadraticAt$1(p0[1], p1[1], p2[1], next); var diff = v2DistSquare(v2, center) - radiusSquare; if (mathAbs$1(diff) < 1e-2) { break; } // var prevDiff = v2DistSquare(v1, center) - radiusSquare; var nextDiff = v2DistSquare(v3, center) - radiusSquare; interval /= 2; if (diff < 0) { if (nextDiff >= 0) { t = t + interval; } else { t = t - interval; } } else { if (nextDiff >= 0) { t = t - interval; } else { t = t + interval; } } } return t; } // Adjust edge to avoid var adjustEdge = function (graph, scale$$1) { var tmp0 = []; var quadraticSubdivide$$1 = quadraticSubdivide; var pts = [[], [], []]; var pts2 = [[], []]; var v = []; scale$$1 /= 2; function getSymbolSize(node) { var symbolSize = node.getVisual('symbolSize'); if (symbolSize instanceof Array) { symbolSize = (symbolSize[0] + symbolSize[1]) / 2; } return symbolSize; } graph.eachEdge(function (edge, idx) { var linePoints = edge.getLayout(); var fromSymbol = edge.getVisual('fromSymbol'); var toSymbol = edge.getVisual('toSymbol'); if (!linePoints.__original) { linePoints.__original = [ clone$1(linePoints[0]), clone$1(linePoints[1]) ]; if (linePoints[2]) { linePoints.__original.push(clone$1(linePoints[2])); } } var originalPoints = linePoints.__original; // Quadratic curve if (linePoints[2] != null) { copy(pts[0], originalPoints[0]); copy(pts[1], originalPoints[2]); copy(pts[2], originalPoints[1]); if (fromSymbol && fromSymbol != 'none') { var symbolSize = getSymbolSize(edge.node1); var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale$$1); // Subdivide and get the second quadraticSubdivide$$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0); pts[0][0] = tmp0[3]; pts[1][0] = tmp0[4]; quadraticSubdivide$$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0); pts[0][1] = tmp0[3]; pts[1][1] = tmp0[4]; } if (toSymbol && toSymbol != 'none') { var symbolSize = getSymbolSize(edge.node2); var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale$$1); // Subdivide and get the first quadraticSubdivide$$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0); pts[1][0] = tmp0[1]; pts[2][0] = tmp0[2]; quadraticSubdivide$$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0); pts[1][1] = tmp0[1]; pts[2][1] = tmp0[2]; } // Copy back to layout copy(linePoints[0], pts[0]); copy(linePoints[1], pts[2]); copy(linePoints[2], pts[1]); } // Line else { copy(pts2[0], originalPoints[0]); copy(pts2[1], originalPoints[1]); sub(v, pts2[1], pts2[0]); normalize(v, v); if (fromSymbol && fromSymbol != 'none') { var symbolSize = getSymbolSize(edge.node1); scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale$$1); } if (toSymbol && toSymbol != 'none') { var symbolSize = getSymbolSize(edge.node2); scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale$$1); } copy(linePoints[0], pts2[0]); copy(linePoints[1], pts2[1]); } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var nodeOpacityPath = ['itemStyle', 'opacity']; var lineOpacityPath = ['lineStyle', 'opacity']; function getItemOpacity(item, opacityPath) { return item.getVisual('opacity') || item.getModel().get(opacityPath); } function fadeOutItem(item, opacityPath, opacityRatio) { var el = item.getGraphicEl(); var opacity = getItemOpacity(item, opacityPath); if (opacityRatio != null) { opacity == null && (opacity = 1); opacity *= opacityRatio; } el.downplay && el.downplay(); el.traverse(function (child) { if (child.type !== 'group') { child.setStyle('opacity', opacity); } }); } function fadeInItem(item, opacityPath) { var opacity = getItemOpacity(item, opacityPath); var el = item.getGraphicEl(); el.highlight && el.highlight(); el.traverse(function (child) { if (child.type !== 'group') { child.setStyle('opacity', opacity); } }); } extendChartView({ type: 'graph', init: function (ecModel, api) { var symbolDraw = new SymbolDraw(); var lineDraw = new LineDraw(); var group = this.group; this._controller = new RoamController(api.getZr()); this._controllerHost = {target: group}; group.add(symbolDraw.group); group.add(lineDraw.group); this._symbolDraw = symbolDraw; this._lineDraw = lineDraw; this._firstRender = true; }, render: function (seriesModel, ecModel, api) { var coordSys = seriesModel.coordinateSystem; this._model = seriesModel; this._nodeScaleRatio = seriesModel.get('nodeScaleRatio'); var symbolDraw = this._symbolDraw; var lineDraw = this._lineDraw; var group = this.group; if (coordSys.type === 'view') { var groupNewProp = { position: coordSys.position, scale: coordSys.scale }; if (this._firstRender) { group.attr(groupNewProp); } else { updateProps(group, groupNewProp, seriesModel); } } // Fix edge contact point with node adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel)); var data = seriesModel.getData(); symbolDraw.updateData(data); var edgeData = seriesModel.getEdgeData(); lineDraw.updateData(edgeData); this._updateNodeAndLinkScale(); this._updateController(seriesModel, ecModel, api); clearTimeout(this._layoutTimeout); var forceLayout = seriesModel.forceLayout; var layoutAnimation = seriesModel.get('force.layoutAnimation'); if (forceLayout) { this._startForceLayoutIteration(forceLayout, layoutAnimation); } data.eachItemGraphicEl(function (el, idx) { var itemModel = data.getItemModel(idx); // Update draggable el.off('drag').off('dragend'); var draggable = data.getItemModel(idx).get('draggable'); if (draggable) { el.on('drag', function () { if (forceLayout) { forceLayout.warmUp(); !this._layouting && this._startForceLayoutIteration(forceLayout, layoutAnimation); forceLayout.setFixed(idx); // Write position back to layout data.setItemLayout(idx, el.position); } }, this).on('dragend', function () { if (forceLayout) { forceLayout.setUnfixed(idx); } }, this); } el.setDraggable(draggable && forceLayout); el.off('mouseover', el.__focusNodeAdjacency); el.off('mouseout', el.__unfocusNodeAdjacency); if (itemModel.get('focusNodeAdjacency')) { el.on('mouseover', el.__focusNodeAdjacency = function () { api.dispatchAction({ type: 'focusNodeAdjacency', seriesId: seriesModel.id, dataIndex: el.dataIndex }); }); el.on('mouseout', el.__unfocusNodeAdjacency = function () { api.dispatchAction({ type: 'unfocusNodeAdjacency', seriesId: seriesModel.id }); }); } }, this); data.graph.eachEdge(function (edge) { var el = edge.getGraphicEl(); el.off('mouseover', el.__focusNodeAdjacency); el.off('mouseout', el.__unfocusNodeAdjacency); if (edge.getModel().get('focusNodeAdjacency')) { el.on('mouseover', el.__focusNodeAdjacency = function () { api.dispatchAction({ type: 'focusNodeAdjacency', seriesId: seriesModel.id, edgeDataIndex: edge.dataIndex }); }); el.on('mouseout', el.__unfocusNodeAdjacency = function () { api.dispatchAction({ type: 'unfocusNodeAdjacency', seriesId: seriesModel.id }); }); } }); var circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get('circular.rotateLabel'); var cx = data.getLayout('cx'); var cy = data.getLayout('cy'); data.eachItemGraphicEl(function (el, idx) { var symbolPath = el.getSymbolPath(); if (circularRotateLabel) { var pos = data.getItemLayout(idx); var rad = Math.atan2(pos[1] - cy, pos[0] - cx); if (rad < 0) { rad = Math.PI * 2 + rad; } var isLeft = pos[0] < cx; if (isLeft) { rad = rad - Math.PI; } var textPosition = isLeft ? 'left' : 'right'; symbolPath.setStyle({ textRotation: -rad, textPosition: textPosition, textOrigin: 'center' }); symbolPath.hoverStyle && (symbolPath.hoverStyle.textPosition = textPosition); } else { symbolPath.setStyle({ textRotation: 0 }); } }); this._firstRender = false; }, dispose: function () { this._controller && this._controller.dispose(); this._controllerHost = {}; }, focusNodeAdjacency: function (seriesModel, ecModel, api, payload) { var data = this._model.getData(); var graph = data.graph; var dataIndex = payload.dataIndex; var edgeDataIndex = payload.edgeDataIndex; var node = graph.getNodeByIndex(dataIndex); var edge = graph.getEdgeByIndex(edgeDataIndex); if (!node && !edge) { return; } graph.eachNode(function (node) { fadeOutItem(node, nodeOpacityPath, 0.1); }); graph.eachEdge(function (edge) { fadeOutItem(edge, lineOpacityPath, 0.1); }); if (node) { fadeInItem(node, nodeOpacityPath); each$1(node.edges, function (adjacentEdge) { if (adjacentEdge.dataIndex < 0) { return; } fadeInItem(adjacentEdge, lineOpacityPath); fadeInItem(adjacentEdge.node1, nodeOpacityPath); fadeInItem(adjacentEdge.node2, nodeOpacityPath); }); } if (edge) { fadeInItem(edge, lineOpacityPath); fadeInItem(edge.node1, nodeOpacityPath); fadeInItem(edge.node2, nodeOpacityPath); } }, unfocusNodeAdjacency: function (seriesModel, ecModel, api, payload) { var graph = this._model.getData().graph; graph.eachNode(function (node) { fadeOutItem(node, nodeOpacityPath); }); graph.eachEdge(function (edge) { fadeOutItem(edge, lineOpacityPath); }); }, _startForceLayoutIteration: function (forceLayout, layoutAnimation) { var self = this; (function step() { forceLayout.step(function (stopped) { self.updateLayout(self._model); (self._layouting = !stopped) && ( layoutAnimation ? (self._layoutTimeout = setTimeout(step, 16)) : step() ); }); })(); }, _updateController: function (seriesModel, ecModel, api) { var controller = this._controller; var controllerHost = this._controllerHost; var group = this.group; controller.setPointerChecker(function (e, x, y) { var rect = group.getBoundingRect(); rect.applyTransform(group.transform); return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel); }); if (seriesModel.coordinateSystem.type !== 'view') { controller.disable(); return; } controller.enable(seriesModel.get('roam')); controllerHost.zoomLimit = seriesModel.get('scaleLimit'); controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); controller .off('pan') .off('zoom') .on('pan', function (dx, dy) { updateViewOnPan(controllerHost, dx, dy); api.dispatchAction({ seriesId: seriesModel.id, type: 'graphRoam', dx: dx, dy: dy }); }) .on('zoom', function (zoom, mouseX, mouseY) { updateViewOnZoom(controllerHost, zoom, mouseX, mouseY); api.dispatchAction({ seriesId: seriesModel.id, type: 'graphRoam', zoom: zoom, originX: mouseX, originY: mouseY }); this._updateNodeAndLinkScale(); adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel)); this._lineDraw.updateLayout(); }, this); }, _updateNodeAndLinkScale: function () { var seriesModel = this._model; var data = seriesModel.getData(); var nodeScale = this._getNodeGlobalScale(seriesModel); var invScale = [nodeScale, nodeScale]; data.eachItemGraphicEl(function (el, idx) { el.attr('scale', invScale); }); }, _getNodeGlobalScale: function (seriesModel) { var coordSys = seriesModel.coordinateSystem; if (coordSys.type !== 'view') { return 1; } var nodeScaleRatio = this._nodeScaleRatio; var groupScale = coordSys.scale; var groupZoom = (groupScale && groupScale[0]) || 1; // Scale node when zoom changes var roamZoom = coordSys.getZoom(); var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; return nodeScale / groupZoom; }, updateLayout: function (seriesModel) { adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel)); this._symbolDraw.updateLayout(); this._lineDraw.updateLayout(); }, remove: function (ecModel, api) { this._symbolDraw && this._symbolDraw.remove(); this._lineDraw && this._lineDraw.remove(); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var actionInfo = { type: 'graphRoam', event: 'graphRoam', update: 'none' }; /** * @payload * @property {string} name Series name * @property {number} [dx] * @property {number} [dy] * @property {number} [zoom] * @property {number} [originX] * @property {number} [originY] */ registerAction(actionInfo, function (payload, ecModel) { ecModel.eachComponent({mainType: 'series', query: payload}, function (seriesModel) { var coordSys = seriesModel.coordinateSystem; var res = updateCenterAndZoom(coordSys, payload); seriesModel.setCenter && seriesModel.setCenter(res.center); seriesModel.setZoom && seriesModel.setZoom(res.zoom); }); }); /** * @payload * @property {number} [seriesIndex] * @property {string} [seriesId] * @property {string} [seriesName] * @property {number} [dataIndex] */ registerAction({ type: 'focusNodeAdjacency', event: 'focusNodeAdjacency', update: 'series.graph:focusNodeAdjacency' }, function () {}); /** * @payload * @property {number} [seriesIndex] * @property {string} [seriesId] * @property {string} [seriesName] */ registerAction({ type: 'unfocusNodeAdjacency', event: 'unfocusNodeAdjacency', update: 'series.graph:unfocusNodeAdjacency' }, function () {}); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var categoryFilter = function (ecModel) { var legendModels = ecModel.findComponents({ mainType: 'legend' }); if (!legendModels || !legendModels.length) { return; } ecModel.eachSeriesByType('graph', function (graphSeries) { var categoriesData = graphSeries.getCategoriesData(); var graph = graphSeries.getGraph(); var data = graph.data; var categoryNames = categoriesData.mapArray(categoriesData.getName); data.filterSelf(function (idx) { var model = data.getItemModel(idx); var category = model.getShallow('category'); if (category != null) { if (typeof category === 'number') { category = categoryNames[category]; } // If in any legend component the status is not selected. for (var i = 0; i < legendModels.length; i++) { if (!legendModels[i].isSelected(category)) { return false; } } } return true; }); }, this); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var categoryVisual = function (ecModel) { var paletteScope = {}; ecModel.eachSeriesByType('graph', function (seriesModel) { var categoriesData = seriesModel.getCategoriesData(); var data = seriesModel.getData(); var categoryNameIdxMap = {}; categoriesData.each(function (idx) { var name = categoriesData.getName(idx); // Add prefix to avoid conflict with Object.prototype. categoryNameIdxMap['ec-' + name] = idx; var itemModel = categoriesData.getItemModel(idx); var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(name, paletteScope); categoriesData.setItemVisual(idx, 'color', color); }); // Assign category color to visual if (categoriesData.count()) { data.each(function (idx) { var model = data.getItemModel(idx); var category = model.getShallow('category'); if (category != null) { if (typeof category === 'string') { category = categoryNameIdxMap['ec-' + category]; } if (!data.getItemVisual(idx, 'color', true)) { data.setItemVisual( idx, 'color', categoriesData.getItemVisual(category, 'color') ); } } }); } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function normalize$1(a) { if (!(a instanceof Array)) { a = [a, a]; } return a; } var edgeVisual = function (ecModel) { ecModel.eachSeriesByType('graph', function (seriesModel) { var graph = seriesModel.getGraph(); var edgeData = seriesModel.getEdgeData(); var symbolType = normalize$1(seriesModel.get('edgeSymbol')); var symbolSize = normalize$1(seriesModel.get('edgeSymbolSize')); var colorQuery = 'lineStyle.color'.split('.'); var opacityQuery = 'lineStyle.opacity'.split('.'); edgeData.setVisual('fromSymbol', symbolType && symbolType[0]); edgeData.setVisual('toSymbol', symbolType && symbolType[1]); edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]); edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]); edgeData.setVisual('color', seriesModel.get(colorQuery)); edgeData.setVisual('opacity', seriesModel.get(opacityQuery)); edgeData.each(function (idx) { var itemModel = edgeData.getItemModel(idx); var edge = graph.getEdgeByIndex(idx); var symbolType = normalize$1(itemModel.getShallow('symbol', true)); var symbolSize = normalize$1(itemModel.getShallow('symbolSize', true)); // Edge visual must after node visual var color = itemModel.get(colorQuery); var opacity = itemModel.get(opacityQuery); switch (color) { case 'source': color = edge.node1.getVisual('color'); break; case 'target': color = edge.node2.getVisual('color'); break; } symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]); symbolType[1] && edge.setVisual('toSymbol', symbolType[1]); symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]); symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]); edge.setVisual('color', color); edge.setVisual('opacity', opacity); }); }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function simpleLayout$1(seriesModel) { var coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type !== 'view') { return; } var graph = seriesModel.getGraph(); graph.eachNode(function (node) { var model = node.getModel(); node.setLayout([+model.get('x'), +model.get('y')]); }); simpleLayoutEdge(graph); } function simpleLayoutEdge(graph) { graph.eachEdge(function (edge) { var curveness = edge.getModel().get('lineStyle.curveness') || 0; var p1 = clone$1(edge.node1.getLayout()); var p2 = clone$1(edge.node2.getLayout()); var points = [p1, p2]; if (+curveness) { points.push([ (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness ]); } edge.setLayout(points); }); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var simpleLayout = function (ecModel, api) { ecModel.eachSeriesByType('graph', function (seriesModel) { var layout = seriesModel.get('layout'); var coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type !== 'view') { var data = seriesModel.getData(); var dimensions = []; each$1(coordSys.dimensions, function (coordDim) { dimensions = dimensions.concat(data.mapDimension(coordDim, true)); }); for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) { var value = []; var hasValue = false; for (var i = 0; i < dimensions.length; i++) { var val = data.get(dimensions[i], dataIndex); if (!isNaN(val)) { hasValue = true; } value.push(val); } if (hasValue) { data.setItemLayout(dataIndex, coordSys.dataToPoint(value)); } else { // Also {Array.}, not undefined to avoid if...else... statement data.setItemLayout(dataIndex, [NaN, NaN]); } } simpleLayoutEdge(data.graph); } else if (!layout || layout === 'none') { simpleLayout$1(seriesModel); } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function circularLayout$1(seriesModel) { var coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type !== 'view') { return; } var rect = coordSys.getBoundingRect(); var nodeData = seriesModel.getData(); var graph = nodeData.graph; var angle = 0; var sum = nodeData.getSum('value'); var unitAngle = Math.PI * 2 / (sum || nodeData.count()); var cx = rect.width / 2 + rect.x; var cy = rect.height / 2 + rect.y; var r = Math.min(rect.width, rect.height) / 2; graph.eachNode(function (node) { var value = node.getValue('value'); angle += unitAngle * (sum ? value : 1) / 2; node.setLayout([ r * Math.cos(angle) + cx, r * Math.sin(angle) + cy ]); angle += unitAngle * (sum ? value : 1) / 2; }); nodeData.setLayout({ cx: cx, cy: cy }); graph.eachEdge(function (edge) { var curveness = edge.getModel().get('lineStyle.curveness') || 0; var p1 = clone$1(edge.node1.getLayout()); var p2 = clone$1(edge.node2.getLayout()); var cp1; var x12 = (p1[0] + p2[0]) / 2; var y12 = (p1[1] + p2[1]) / 2; if (+curveness) { curveness *= 3; cp1 = [ cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness) ]; } edge.setLayout([p1, p2, cp1]); }); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var circularLayout = function (ecModel) { ecModel.eachSeriesByType('graph', function (seriesModel) { if (seriesModel.get('layout') === 'circular') { circularLayout$1(seriesModel); } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * The layout implementation references to d3.js. The use of * the source code of this file is also subject to the terms * and consitions of its license (BSD-3Clause, see * ). */ var scaleAndAdd$2 = scaleAndAdd; // function adjacentNode(n, e) { // return e.n1 === n ? e.n2 : e.n1; // } function forceLayout$1(nodes, edges, opts) { var rect = opts.rect; var width = rect.width; var height = rect.height; var center = [rect.x + width / 2, rect.y + height / 2]; // var scale = opts.scale || 1; var gravity = opts.gravity == null ? 0.1 : opts.gravity; // for (var i = 0; i < edges.length; i++) { // var e = edges[i]; // var n1 = e.n1; // var n2 = e.n2; // n1.edges = n1.edges || []; // n2.edges = n2.edges || []; // n1.edges.push(e); // n2.edges.push(e); // } // Init position for (var i = 0; i < nodes.length; i++) { var n = nodes[i]; if (!n.p) { // Use the position from first adjecent node with defined position // Or use a random position // From d3 // if (n.edges) { // var j = -1; // while (++j < n.edges.length) { // var e = n.edges[j]; // var other = adjacentNode(n, e); // if (other.p) { // n.p = vec2.clone(other.p); // break; // } // } // } // if (!n.p) { n.p = create( width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1] ); // } } n.pp = clone$1(n.p); n.edges = null; } // Formula in 'Graph Drawing by Force-directed Placement' // var k = scale * Math.sqrt(width * height / nodes.length); // var k2 = k * k; var friction = 0.6; return { warmUp: function () { friction = 0.5; }, setFixed: function (idx) { nodes[idx].fixed = true; }, setUnfixed: function (idx) { nodes[idx].fixed = false; }, step: function (cb) { var v12 = []; var nLen = nodes.length; for (var i = 0; i < edges.length; i++) { var e = edges[i]; var n1 = e.n1; var n2 = e.n2; sub(v12, n2.p, n1.p); var d = len(v12) - e.d; var w = n2.w / (n1.w + n2.w); if (isNaN(w)) { w = 0; } normalize(v12, v12); !n1.fixed && scaleAndAdd$2(n1.p, n1.p, v12, w * d * friction); !n2.fixed && scaleAndAdd$2(n2.p, n2.p, v12, -(1 - w) * d * friction); } // Gravity for (var i = 0; i < nLen; i++) { var n = nodes[i]; if (!n.fixed) { sub(v12, center, n.p); // var d = vec2.len(v12); // vec2.scale(v12, v12, 1 / d); // var gravityFactor = gravity; scaleAndAdd$2(n.p, n.p, v12, gravity * friction); } } // Repulsive // PENDING for (var i = 0; i < nLen; i++) { var n1 = nodes[i]; for (var j = i + 1; j < nLen; j++) { var n2 = nodes[j]; sub(v12, n2.p, n1.p); var d = len(v12); if (d === 0) { // Random repulse set(v12, Math.random() - 0.5, Math.random() - 0.5); d = 1; } var repFact = (n1.rep + n2.rep) / d / d; !n1.fixed && scaleAndAdd$2(n1.pp, n1.pp, v12, repFact); !n2.fixed && scaleAndAdd$2(n2.pp, n2.pp, v12, -repFact); } } var v = []; for (var i = 0; i < nLen; i++) { var n = nodes[i]; if (!n.fixed) { sub(v, n.p, n.pp); scaleAndAdd$2(n.p, n.p, v, friction); copy(n.pp, n.p); } } friction = friction * 0.992; cb && cb(nodes, edges, friction < 0.01); } }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var forceLayout = function (ecModel) { ecModel.eachSeriesByType('graph', function (graphSeries) { var coordSys = graphSeries.coordinateSystem; if (coordSys && coordSys.type !== 'view') { return; } if (graphSeries.get('layout') === 'force') { var preservedPoints = graphSeries.preservedPoints || {}; var graph = graphSeries.getGraph(); var nodeData = graph.data; var edgeData = graph.edgeData; var forceModel = graphSeries.getModel('force'); var initLayout = forceModel.get('initLayout'); if (graphSeries.preservedPoints) { nodeData.each(function (idx) { var id = nodeData.getId(idx); nodeData.setItemLayout(idx, preservedPoints[id] || [NaN, NaN]); }); } else if (!initLayout || initLayout === 'none') { simpleLayout$1(graphSeries); } else if (initLayout === 'circular') { circularLayout$1(graphSeries); } var nodeDataExtent = nodeData.getDataExtent('value'); var edgeDataExtent = edgeData.getDataExtent('value'); // var edgeDataExtent = edgeData.getDataExtent('value'); var repulsion = forceModel.get('repulsion'); var edgeLength = forceModel.get('edgeLength'); if (!isArray(repulsion)) { repulsion = [repulsion, repulsion]; } if (!isArray(edgeLength)) { edgeLength = [edgeLength, edgeLength]; } // Larger value has smaller length edgeLength = [edgeLength[1], edgeLength[0]]; var nodes = nodeData.mapArray('value', function (value, idx) { var point = nodeData.getItemLayout(idx); var rep = linearMap(value, nodeDataExtent, repulsion); if (isNaN(rep)) { rep = (repulsion[0] + repulsion[1]) / 2; } return { w: rep, rep: rep, fixed: nodeData.getItemModel(idx).get('fixed'), p: (!point || isNaN(point[0]) || isNaN(point[1])) ? null : point }; }); var edges = edgeData.mapArray('value', function (value, idx) { var edge = graph.getEdgeByIndex(idx); var d = linearMap(value, edgeDataExtent, edgeLength); if (isNaN(d)) { d = (edgeLength[0] + edgeLength[1]) / 2; } return { n1: nodes[edge.node1.dataIndex], n2: nodes[edge.node2.dataIndex], d: d, curveness: edge.getModel().get('lineStyle.curveness') || 0 }; }); var coordSys = graphSeries.coordinateSystem; var rect = coordSys.getBoundingRect(); var forceInstance = forceLayout$1(nodes, edges, { rect: rect, gravity: forceModel.get('gravity') }); var oldStep = forceInstance.step; forceInstance.step = function (cb) { for (var i = 0, l = nodes.length; i < l; i++) { if (nodes[i].fixed) { // Write back to layout instance copy(nodes[i].p, graph.getNodeByIndex(i).getLayout()); } } oldStep(function (nodes, edges, stopped) { for (var i = 0, l = nodes.length; i < l; i++) { if (!nodes[i].fixed) { graph.getNodeByIndex(i).setLayout(nodes[i].p); } preservedPoints[nodeData.getId(i)] = nodes[i].p; } for (var i = 0, l = edges.length; i < l; i++) { var e = edges[i]; var edge = graph.getEdgeByIndex(i); var p1 = e.n1.p; var p2 = e.n2.p; var points = edge.getLayout(); points = points ? points.slice() : []; points[0] = points[0] || []; points[1] = points[1] || []; copy(points[0], p1); copy(points[1], p2); if (+e.curveness) { points[2] = [ (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness ]; } edge.setLayout(points); } // Update layout cb && cb(stopped); }); }; graphSeries.forceLayout = forceInstance; graphSeries.preservedPoints = preservedPoints; // Step to get the layout forceInstance.step(); } else { // Remove prev injected forceLayout instance graphSeries.forceLayout = null; } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // FIXME Where to create the simple view coordinate system function getViewRect$1(seriesModel, api, aspect) { var option = seriesModel.getBoxLayoutParams(); option.aspect = aspect; return getLayoutRect(option, { width: api.getWidth(), height: api.getHeight() }); } var createView = function (ecModel, api) { var viewList = []; ecModel.eachSeriesByType('graph', function (seriesModel) { var coordSysType = seriesModel.get('coordinateSystem'); if (!coordSysType || coordSysType === 'view') { var data = seriesModel.getData(); var positions = data.mapArray(function (idx) { var itemModel = data.getItemModel(idx); return [+itemModel.get('x'), +itemModel.get('y')]; }); var min = []; var max = []; fromPoints(positions, min, max); // If width or height is 0 if (max[0] - min[0] === 0) { max[0] += 1; min[0] -= 1; } if (max[1] - min[1] === 0) { max[1] += 1; min[1] -= 1; } var aspect = (max[0] - min[0]) / (max[1] - min[1]); // FIXME If get view rect after data processed? var viewRect = getViewRect$1(seriesModel, api, aspect); // Position may be NaN, use view rect instead if (isNaN(aspect)) { min = [viewRect.x, viewRect.y]; max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height]; } var bbWidth = max[0] - min[0]; var bbHeight = max[1] - min[1]; var viewWidth = viewRect.width; var viewHeight = viewRect.height; var viewCoordSys = seriesModel.coordinateSystem = new View(); viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); viewCoordSys.setBoundingRect( min[0], min[1], bbWidth, bbHeight ); viewCoordSys.setViewRect( viewRect.x, viewRect.y, viewWidth, viewHeight ); // Update roam info viewCoordSys.setCenter(seriesModel.get('center')); viewCoordSys.setZoom(seriesModel.get('zoom')); viewList.push(viewCoordSys); } }); return viewList; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerProcessor(categoryFilter); registerVisual(visualSymbol('graph', 'circle', null)); registerVisual(categoryVisual); registerVisual(edgeVisual); registerLayout(simpleLayout); registerLayout(circularLayout); registerLayout(forceLayout); // Graph view coordinate system registerCoordinateSystem('graphView', { create: createView }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var GaugeSeries = SeriesModel.extend({ type: 'series.gauge', getInitialData: function (option, ecModel) { var dataOpt = option.data || []; if (!isArray(dataOpt)) { dataOpt = [dataOpt]; } option.data = dataOpt; return createListSimply(this, ['value']); }, defaultOption: { zlevel: 0, z: 2, // 默认全局居中 center: ['50%', '50%'], legendHoverLink: true, radius: '75%', startAngle: 225, endAngle: -45, clockwise: true, // 最小值 min: 0, // 最大值 max: 100, // 分割段数,默认为10 splitNumber: 10, // 坐标轴线 axisLine: { // 默认显示,属性show控制显示与否 show: true, lineStyle: { // 属性lineStyle控制线条样式 color: [[0.2, '#91c7ae'], [0.8, '#63869e'], [1, '#c23531']], width: 30 } }, // 分隔线 splitLine: { // 默认显示,属性show控制显示与否 show: true, // 属性length控制线长 length: 30, // 属性lineStyle(详见lineStyle)控制线条样式 lineStyle: { color: '#eee', width: 2, type: 'solid' } }, // 坐标轴小标记 axisTick: { // 属性show控制显示与否,默认不显示 show: true, // 每份split细分多少段 splitNumber: 5, // 属性length控制线长 length: 8, // 属性lineStyle控制线条样式 lineStyle: { color: '#eee', width: 1, type: 'solid' } }, axisLabel: { show: true, distance: 5, // formatter: null, color: 'auto' }, pointer: { show: true, length: '80%', width: 8 }, itemStyle: { color: 'auto' }, title: { show: true, // x, y,单位px offsetCenter: [0, '-40%'], // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: '#333', fontSize: 15 }, detail: { show: true, backgroundColor: 'rgba(0,0,0,0)', borderWidth: 0, borderColor: '#ccc', width: 100, height: null, // self-adaption padding: [5, 10], // x, y,单位px offsetCenter: [0, '40%'], // formatter: null, // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: 'auto', fontSize: 30 } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var PointerPath = Path.extend({ type: 'echartsGaugePointer', shape: { angle: 0, width: 10, r: 10, x: 0, y: 0 }, buildPath: function (ctx, shape) { var mathCos = Math.cos; var mathSin = Math.sin; var r = shape.r; var width = shape.width; var angle = shape.angle; var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2); var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2); angle = shape.angle - Math.PI / 2; ctx.moveTo(x, y); ctx.lineTo( shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width ); ctx.lineTo( shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r ); ctx.lineTo( shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width ); ctx.lineTo(x, y); return; } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function parsePosition(seriesModel, api) { var center = seriesModel.get('center'); var width = api.getWidth(); var height = api.getHeight(); var size = Math.min(width, height); var cx = parsePercent$1(center[0], api.getWidth()); var cy = parsePercent$1(center[1], api.getHeight()); var r = parsePercent$1(seriesModel.get('radius'), size / 2); return { cx: cx, cy: cy, r: r }; } function formatLabel(label, labelFormatter) { if (labelFormatter) { if (typeof labelFormatter === 'string') { label = labelFormatter.replace('{value}', label != null ? label : ''); } else if (typeof labelFormatter === 'function') { label = labelFormatter(label); } } return label; } var PI2$5 = Math.PI * 2; var GaugeView = Chart.extend({ type: 'gauge', render: function (seriesModel, ecModel, api) { this.group.removeAll(); var colorList = seriesModel.get('axisLine.lineStyle.color'); var posInfo = parsePosition(seriesModel, api); this._renderMain( seriesModel, ecModel, api, colorList, posInfo ); }, dispose: function () {}, _renderMain: function (seriesModel, ecModel, api, colorList, posInfo) { var group = this.group; var axisLineModel = seriesModel.getModel('axisLine'); var lineStyleModel = axisLineModel.getModel('lineStyle'); var clockwise = seriesModel.get('clockwise'); var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI; var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI; var angleRangeSpan = (endAngle - startAngle) % PI2$5; var prevEndAngle = startAngle; var axisLineWidth = lineStyleModel.get('width'); for (var i = 0; i < colorList.length; i++) { // Clamp var percent = Math.min(Math.max(colorList[i][0], 0), 1); var endAngle = startAngle + angleRangeSpan * percent; var sector = new Sector({ shape: { startAngle: prevEndAngle, endAngle: endAngle, cx: posInfo.cx, cy: posInfo.cy, clockwise: clockwise, r0: posInfo.r - axisLineWidth, r: posInfo.r }, silent: true }); sector.setStyle({ fill: colorList[i][1] }); sector.setStyle(lineStyleModel.getLineStyle( // Because we use sector to simulate arc // so the properties for stroking are useless ['color', 'borderWidth', 'borderColor'] )); group.add(sector); prevEndAngle = endAngle; } var getColor = function (percent) { // Less than 0 if (percent <= 0) { return colorList[0][1]; } for (var i = 0; i < colorList.length; i++) { if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent ) { return colorList[i][1]; } } // More than 1 return colorList[i - 1][1]; }; if (!clockwise) { var tmp = startAngle; startAngle = endAngle; endAngle = tmp; } this._renderTicks( seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise ); this._renderPointer( seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise ); this._renderTitle( seriesModel, ecModel, api, getColor, posInfo ); this._renderDetail( seriesModel, ecModel, api, getColor, posInfo ); }, _renderTicks: function ( seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise ) { var group = this.group; var cx = posInfo.cx; var cy = posInfo.cy; var r = posInfo.r; var minVal = +seriesModel.get('min'); var maxVal = +seriesModel.get('max'); var splitLineModel = seriesModel.getModel('splitLine'); var tickModel = seriesModel.getModel('axisTick'); var labelModel = seriesModel.getModel('axisLabel'); var splitNumber = seriesModel.get('splitNumber'); var subSplitNumber = tickModel.get('splitNumber'); var splitLineLen = parsePercent$1( splitLineModel.get('length'), r ); var tickLen = parsePercent$1( tickModel.get('length'), r ); var angle = startAngle; var step = (endAngle - startAngle) / splitNumber; var subStep = step / subSplitNumber; var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle(); var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle(); for (var i = 0; i <= splitNumber; i++) { var unitX = Math.cos(angle); var unitY = Math.sin(angle); // Split line if (splitLineModel.get('show')) { var splitLine = new Line({ shape: { x1: unitX * r + cx, y1: unitY * r + cy, x2: unitX * (r - splitLineLen) + cx, y2: unitY * (r - splitLineLen) + cy }, style: splitLineStyle, silent: true }); if (splitLineStyle.stroke === 'auto') { splitLine.setStyle({ stroke: getColor(i / splitNumber) }); } group.add(splitLine); } // Label if (labelModel.get('show')) { var label = formatLabel( round$1(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter') ); var distance = labelModel.get('distance'); var autoColor = getColor(i / splitNumber); group.add(new Text({ style: setTextStyle({}, labelModel, { text: label, x: unitX * (r - splitLineLen - distance) + cx, y: unitY * (r - splitLineLen - distance) + cy, textVerticalAlign: unitY < -0.4 ? 'top' : (unitY > 0.4 ? 'bottom' : 'middle'), textAlign: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center') }, {autoColor: autoColor}), silent: true })); } // Axis tick if (tickModel.get('show') && i !== splitNumber) { for (var j = 0; j <= subSplitNumber; j++) { var unitX = Math.cos(angle); var unitY = Math.sin(angle); var tickLine = new Line({ shape: { x1: unitX * r + cx, y1: unitY * r + cy, x2: unitX * (r - tickLen) + cx, y2: unitY * (r - tickLen) + cy }, silent: true, style: tickLineStyle }); if (tickLineStyle.stroke === 'auto') { tickLine.setStyle({ stroke: getColor((i + j / subSplitNumber) / splitNumber) }); } group.add(tickLine); angle += subStep; } angle -= subStep; } else { angle += step; } } }, _renderPointer: function ( seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise ) { var group = this.group; var oldData = this._data; if (!seriesModel.get('pointer.show')) { // Remove old element oldData && oldData.eachItemGraphicEl(function (el) { group.remove(el); }); return; } var valueExtent = [+seriesModel.get('min'), +seriesModel.get('max')]; var angleExtent = [startAngle, endAngle]; var data = seriesModel.getData(); var valueDim = data.mapDimension('value'); data.diff(oldData) .add(function (idx) { var pointer = new PointerPath({ shape: { angle: startAngle } }); initProps(pointer, { shape: { angle: linearMap(data.get(valueDim, idx), valueExtent, angleExtent, true) } }, seriesModel); group.add(pointer); data.setItemGraphicEl(idx, pointer); }) .update(function (newIdx, oldIdx) { var pointer = oldData.getItemGraphicEl(oldIdx); updateProps(pointer, { shape: { angle: linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, true) } }, seriesModel); group.add(pointer); data.setItemGraphicEl(newIdx, pointer); }) .remove(function (idx) { var pointer = oldData.getItemGraphicEl(idx); group.remove(pointer); }) .execute(); data.eachItemGraphicEl(function (pointer, idx) { var itemModel = data.getItemModel(idx); var pointerModel = itemModel.getModel('pointer'); pointer.setShape({ x: posInfo.cx, y: posInfo.cy, width: parsePercent$1( pointerModel.get('width'), posInfo.r ), r: parsePercent$1(pointerModel.get('length'), posInfo.r) }); pointer.useStyle(itemModel.getModel('itemStyle').getItemStyle()); if (pointer.style.fill === 'auto') { pointer.setStyle('fill', getColor( linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true) )); } setHoverStyle( pointer, itemModel.getModel('emphasis.itemStyle').getItemStyle() ); }); this._data = data; }, _renderTitle: function ( seriesModel, ecModel, api, getColor, posInfo ) { var data = seriesModel.getData(); var valueDim = data.mapDimension('value'); var titleModel = seriesModel.getModel('title'); if (titleModel.get('show')) { var offsetCenter = titleModel.get('offsetCenter'); var x = posInfo.cx + parsePercent$1(offsetCenter[0], posInfo.r); var y = posInfo.cy + parsePercent$1(offsetCenter[1], posInfo.r); var minVal = +seriesModel.get('min'); var maxVal = +seriesModel.get('max'); var value = seriesModel.getData().get(valueDim, 0); var autoColor = getColor( linearMap(value, [minVal, maxVal], [0, 1], true) ); this.group.add(new Text({ silent: true, style: setTextStyle({}, titleModel, { x: x, y: y, // FIXME First data name ? text: data.getName(0), textAlign: 'center', textVerticalAlign: 'middle' }, {autoColor: autoColor, forceRich: true}) })); } }, _renderDetail: function ( seriesModel, ecModel, api, getColor, posInfo ) { var detailModel = seriesModel.getModel('detail'); var minVal = +seriesModel.get('min'); var maxVal = +seriesModel.get('max'); if (detailModel.get('show')) { var offsetCenter = detailModel.get('offsetCenter'); var x = posInfo.cx + parsePercent$1(offsetCenter[0], posInfo.r); var y = posInfo.cy + parsePercent$1(offsetCenter[1], posInfo.r); var width = parsePercent$1(detailModel.get('width'), posInfo.r); var height = parsePercent$1(detailModel.get('height'), posInfo.r); var data = seriesModel.getData(); var value = data.get(data.mapDimension('value'), 0); var autoColor = getColor( linearMap(value, [minVal, maxVal], [0, 1], true) ); this.group.add(new Text({ silent: true, style: setTextStyle({}, detailModel, { x: x, y: y, text: formatLabel( // FIXME First data name ? value, detailModel.get('formatter') ), textWidth: isNaN(width) ? null : width, textHeight: isNaN(height) ? null : height, textAlign: 'center', textVerticalAlign: 'middle' }, {autoColor: autoColor, forceRich: true}) })); } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var FunnelSeries = extendSeriesModel({ type: 'series.funnel', init: function (option) { FunnelSeries.superApply(this, 'init', arguments); // Enable legend selection for each data item // Use a function instead of direct access because data reference may changed this.legendDataProvider = function () { return this.getRawData(); }; // Extend labelLine emphasis this._defaultLabelLine(option); }, getInitialData: function (option, ecModel) { return createListSimply(this, ['value']); }, _defaultLabelLine: function (option) { // Extend labelLine emphasis defaultEmphasis(option, 'labelLine', ['show']); var labelLineNormalOpt = option.labelLine; var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false` labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show; labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show; }, // Overwrite getDataParams: function (dataIndex) { var data = this.getData(); var params = FunnelSeries.superCall(this, 'getDataParams', dataIndex); var valueDim = data.mapDimension('value'); var sum = data.getSum(valueDim); // Percent is 0 if sum is 0 params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2); params.$vars.push('percent'); return params; }, defaultOption: { zlevel: 0, // 一级层叠 z: 2, // 二级层叠 legendHoverLink: true, left: 80, top: 60, right: 80, bottom: 60, // width: {totalWidth} - left - right, // height: {totalHeight} - top - bottom, // 默认取数据最小最大值 // min: 0, // max: 100, minSize: '0%', maxSize: '100%', sort: 'descending', // 'ascending', 'descending' gap: 0, funnelAlign: 'center', label: { show: true, position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 }, labelLine: { show: true, length: 20, lineStyle: { // color: 各异, width: 1, type: 'solid' } }, itemStyle: { // color: 各异, borderColor: '#fff', borderWidth: 1 }, emphasis: { label: { show: true } } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Piece of pie including Sector, Label, LabelLine * @constructor * @extends {module:zrender/graphic/Group} */ function FunnelPiece(data, idx) { Group.call(this); var polygon = new Polygon(); var labelLine = new Polyline(); var text = new Text(); this.add(polygon); this.add(labelLine); this.add(text); this.updateData(data, idx, true); // Hover to change label and labelLine function onEmphasis() { labelLine.ignore = labelLine.hoverIgnore; text.ignore = text.hoverIgnore; } function onNormal() { labelLine.ignore = labelLine.normalIgnore; text.ignore = text.normalIgnore; } this.on('emphasis', onEmphasis) .on('normal', onNormal) .on('mouseover', onEmphasis) .on('mouseout', onNormal); } var funnelPieceProto = FunnelPiece.prototype; var opacityAccessPath = ['itemStyle', 'opacity']; funnelPieceProto.updateData = function (data, idx, firstCreate) { var polygon = this.childAt(0); var seriesModel = data.hostModel; var itemModel = data.getItemModel(idx); var layout = data.getItemLayout(idx); var opacity = data.getItemModel(idx).get(opacityAccessPath); opacity = opacity == null ? 1 : opacity; // Reset style polygon.useStyle({}); if (firstCreate) { polygon.setShape({ points: layout.points }); polygon.setStyle({ opacity : 0 }); initProps(polygon, { style: { opacity: opacity } }, seriesModel, idx); } else { updateProps(polygon, { style: { opacity: opacity }, shape: { points: layout.points } }, seriesModel, idx); } // Update common style var itemStyleModel = itemModel.getModel('itemStyle'); var visualColor = data.getItemVisual(idx, 'color'); polygon.setStyle( defaults( { lineJoin: 'round', fill: visualColor }, itemStyleModel.getItemStyle(['opacity']) ) ); polygon.hoverStyle = itemStyleModel.getModel('emphasis').getItemStyle(); this._updateLabel(data, idx); setHoverStyle(this); }; funnelPieceProto._updateLabel = function (data, idx) { var labelLine = this.childAt(1); var labelText = this.childAt(2); var seriesModel = data.hostModel; var itemModel = data.getItemModel(idx); var layout = data.getItemLayout(idx); var labelLayout = layout.label; var visualColor = data.getItemVisual(idx, 'color'); updateProps(labelLine, { shape: { points: labelLayout.linePoints || labelLayout.linePoints } }, seriesModel, idx); updateProps(labelText, { style: { x: labelLayout.x, y: labelLayout.y } }, seriesModel, idx); labelText.attr({ rotation: labelLayout.rotation, origin: [labelLayout.x, labelLayout.y], z2: 10 }); var labelModel = itemModel.getModel('label'); var labelHoverModel = itemModel.getModel('emphasis.label'); var labelLineModel = itemModel.getModel('labelLine'); var labelLineHoverModel = itemModel.getModel('emphasis.labelLine'); var visualColor = data.getItemVisual(idx, 'color'); setLabelStyle( labelText.style, labelText.hoverStyle = {}, labelModel, labelHoverModel, { labelFetcher: data.hostModel, labelDataIndex: idx, defaultText: data.getName(idx), autoColor: visualColor, useInsideStyle: !!labelLayout.inside }, { textAlign: labelLayout.textAlign, textVerticalAlign: labelLayout.verticalAlign } ); labelText.ignore = labelText.normalIgnore = !labelModel.get('show'); labelText.hoverIgnore = !labelHoverModel.get('show'); labelLine.ignore = labelLine.normalIgnore = !labelLineModel.get('show'); labelLine.hoverIgnore = !labelLineHoverModel.get('show'); // Default use item visual color labelLine.setStyle({ stroke: visualColor }); labelLine.setStyle(labelLineModel.getModel('lineStyle').getLineStyle()); labelLine.hoverStyle = labelLineHoverModel.getModel('lineStyle').getLineStyle(); }; inherits(FunnelPiece, Group); var FunnelView = Chart.extend({ type: 'funnel', render: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var oldData = this._data; var group = this.group; data.diff(oldData) .add(function (idx) { var funnelPiece = new FunnelPiece(data, idx); data.setItemGraphicEl(idx, funnelPiece); group.add(funnelPiece); }) .update(function (newIdx, oldIdx) { var piePiece = oldData.getItemGraphicEl(oldIdx); piePiece.updateData(data, newIdx); group.add(piePiece); data.setItemGraphicEl(newIdx, piePiece); }) .remove(function (idx) { var piePiece = oldData.getItemGraphicEl(idx); group.remove(piePiece); }) .execute(); this._data = data; }, remove: function () { this.group.removeAll(); this._data = null; }, dispose: function () {} }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function getViewRect$2(seriesModel, api) { return getLayoutRect( seriesModel.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() } ); } function getSortedIndices(data, sort) { var valueDim = data.mapDimension('value'); var valueArr = data.mapArray(valueDim, function (val) { return val; }); var indices = []; var isAscending = sort === 'ascending'; for (var i = 0, len = data.count(); i < len; i++) { indices[i] = i; } // Add custom sortable function & none sortable opetion by "options.sort" if (typeof sort === 'function') { indices.sort(sort); } else if (sort !== 'none') { indices.sort(function (a, b) { return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a]; }); } return indices; } function labelLayout$1(data) { data.each(function (idx) { var itemModel = data.getItemModel(idx); var labelModel = itemModel.getModel('label'); var labelPosition = labelModel.get('position'); var labelLineModel = itemModel.getModel('labelLine'); var layout = data.getItemLayout(idx); var points = layout.points; var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center'; var textAlign; var textX; var textY; var linePoints; if (isLabelInside) { textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4; textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4; textAlign = 'center'; linePoints = [ [textX, textY], [textX, textY] ]; } else { var x1; var y1; var x2; var labelLineLen = labelLineModel.get('length'); if (labelPosition === 'left') { // Left side x1 = (points[3][0] + points[0][0]) / 2; y1 = (points[3][1] + points[0][1]) / 2; x2 = x1 - labelLineLen; textX = x2 - 5; textAlign = 'right'; } else { // Right side x1 = (points[1][0] + points[2][0]) / 2; y1 = (points[1][1] + points[2][1]) / 2; x2 = x1 + labelLineLen; textX = x2 + 5; textAlign = 'left'; } var y2 = y1; linePoints = [[x1, y1], [x2, y2]]; textY = y2; } layout.label = { linePoints: linePoints, x: textX, y: textY, verticalAlign: 'middle', textAlign: textAlign, inside: isLabelInside }; }); } var funnelLayout = function (ecModel, api, payload) { ecModel.eachSeriesByType('funnel', function (seriesModel) { var data = seriesModel.getData(); var valueDim = data.mapDimension('value'); var sort = seriesModel.get('sort'); var viewRect = getViewRect$2(seriesModel, api); var indices = getSortedIndices(data, sort); var sizeExtent = [ parsePercent$1(seriesModel.get('minSize'), viewRect.width), parsePercent$1(seriesModel.get('maxSize'), viewRect.width) ]; var dataExtent = data.getDataExtent(valueDim); var min = seriesModel.get('min'); var max = seriesModel.get('max'); if (min == null) { min = Math.min(dataExtent[0], 0); } if (max == null) { max = dataExtent[1]; } var funnelAlign = seriesModel.get('funnelAlign'); var gap = seriesModel.get('gap'); var itemHeight = (viewRect.height - gap * (data.count() - 1)) / data.count(); var y = viewRect.y; var getLinePoints = function (idx, offY) { // End point index is data.count() and we assign it 0 var val = data.get(valueDim, idx) || 0; var itemWidth = linearMap(val, [min, max], sizeExtent, true); var x0; switch (funnelAlign) { case 'left': x0 = viewRect.x; break; case 'center': x0 = viewRect.x + (viewRect.width - itemWidth) / 2; break; case 'right': x0 = viewRect.x + viewRect.width - itemWidth; break; } return [ [x0, offY], [x0 + itemWidth, offY] ]; }; if (sort === 'ascending') { // From bottom to top itemHeight = -itemHeight; gap = -gap; y += viewRect.height; indices = indices.reverse(); } for (var i = 0; i < indices.length; i++) { var idx = indices[i]; var nextIdx = indices[i + 1]; var itemModel = data.getItemModel(idx); var height = itemModel.get('itemStyle.height'); if (height == null) { height = itemHeight; } else { height = parsePercent$1(height, viewRect.height); if (sort === 'ascending') { height = -height; } } var start = getLinePoints(idx, y); var end = getLinePoints(nextIdx, y + height); y += height + gap; data.setItemLayout(idx, { points: start.concat(end.slice().reverse()) }); } labelLayout$1(data); }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerVisual(dataColor('funnel')); registerLayout(funnelLayout); registerProcessor(dataFilter('funnel')); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var parallelPreprocessor = function (option) { createParallelIfNeeded(option); mergeAxisOptionFromParallel(option); }; /** * Create a parallel coordinate if not exists. * @inner */ function createParallelIfNeeded(option) { if (option.parallel) { return; } var hasParallelSeries = false; each$1(option.series, function (seriesOpt) { if (seriesOpt && seriesOpt.type === 'parallel') { hasParallelSeries = true; } }); if (hasParallelSeries) { option.parallel = [{}]; } } /** * Merge aixs definition from parallel option (if exists) to axis option. * @inner */ function mergeAxisOptionFromParallel(option) { var axes = normalizeToArray(option.parallelAxis); each$1(axes, function (axisOption) { if (!isObject$1(axisOption)) { return; } var parallelIndex = axisOption.parallelIndex || 0; var parallelOption = normalizeToArray(option.parallel)[parallelIndex]; if (parallelOption && parallelOption.parallelAxisDefault) { merge(axisOption, parallelOption.parallelAxisDefault, false); } }); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @constructor module:echarts/coord/parallel/ParallelAxis * @extends {module:echarts/coord/Axis} * @param {string} dim * @param {*} scale * @param {Array.} coordExtent * @param {string} axisType */ var ParallelAxis = function (dim, scale, coordExtent, axisType, axisIndex) { Axis.call(this, dim, scale, coordExtent); /** * Axis type * - 'category' * - 'value' * - 'time' * - 'log' * @type {string} */ this.type = axisType || 'value'; /** * @type {number} * @readOnly */ this.axisIndex = axisIndex; }; ParallelAxis.prototype = { constructor: ParallelAxis, /** * Axis model * @param {module:echarts/coord/parallel/AxisModel} */ model: null, /** * @override */ isHorizontal: function () { return this.coordinateSystem.getModel().get('layout') !== 'horizontal'; } }; inherits(ParallelAxis, Axis); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Calculate slider move result. * Usage: * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`. * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`. * * @param {number} delta Move length. * @param {Array.} handleEnds handleEnds[0] can be bigger then handleEnds[1]. * handleEnds will be modified in this method. * @param {Array.} extent handleEnds is restricted by extent. * extent[0] should less or equals than extent[1]. * @param {number|string} handleIndex Can be 'all', means that both move the two handleEnds, * where the input minSpan and maxSpan will not work. * @param {number} [minSpan] The range of dataZoom can not be smaller than that. * If not set, handle0 and cross handle1. If set as a non-negative * number (including `0`), handles will push each other when reaching * the minSpan. * @param {number} [maxSpan] The range of dataZoom can not be larger than that. * @return {Array.} The input handleEnds. */ var sliderMove = function (delta, handleEnds, extent, handleIndex, minSpan, maxSpan) { // Normalize firstly. handleEnds[0] = restrict$1(handleEnds[0], extent); handleEnds[1] = restrict$1(handleEnds[1], extent); delta = delta || 0; var extentSpan = extent[1] - extent[0]; // Notice maxSpan and minSpan can be null/undefined. if (minSpan != null) { minSpan = restrict$1(minSpan, [0, extentSpan]); } if (maxSpan != null) { maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0); } if (handleIndex === 'all') { minSpan = maxSpan = Math.abs(handleEnds[1] - handleEnds[0]); handleIndex = 0; } var originalDistSign = getSpanSign(handleEnds, handleIndex); handleEnds[handleIndex] += delta; // Restrict in extent. var extentMinSpan = minSpan || 0; var realExtent = extent.slice(); originalDistSign.sign < 0 ? (realExtent[0] += extentMinSpan) : (realExtent[1] -= extentMinSpan); handleEnds[handleIndex] = restrict$1(handleEnds[handleIndex], realExtent); // Expand span. var currDistSign = getSpanSign(handleEnds, handleIndex); if (minSpan != null && ( currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan )) { // If minSpan exists, 'cross' is forbinden. handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan; } // Shrink span. var currDistSign = getSpanSign(handleEnds, handleIndex); if (maxSpan != null && currDistSign.span > maxSpan) { handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan; } return handleEnds; }; function getSpanSign(handleEnds, handleIndex) { var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex]; // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0] // is at left of handleEnds[1] for non-cross case. return {span: Math.abs(dist), sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1}; } function restrict$1(value, extend) { return Math.min(extend[1], Math.max(extend[0], value)); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Parallel Coordinates * */ var each$11 = each$1; var mathMin$5 = Math.min; var mathMax$5 = Math.max; var mathFloor$2 = Math.floor; var mathCeil$2 = Math.ceil; var round$2 = round$1; var PI$3 = Math.PI; function Parallel(parallelModel, ecModel, api) { /** * key: dimension * @type {Object.} * @private */ this._axesMap = createHashMap(); /** * key: dimension * value: {position: [], rotation, } * @type {Object.} * @private */ this._axesLayout = {}; /** * Always follow axis order. * @type {Array.} * @readOnly */ this.dimensions = parallelModel.dimensions; /** * @type {module:zrender/core/BoundingRect} */ this._rect; /** * @type {module:echarts/coord/parallel/ParallelModel} */ this._model = parallelModel; this._init(parallelModel, ecModel, api); } Parallel.prototype = { type: 'parallel', constructor: Parallel, /** * Initialize cartesian coordinate systems * @private */ _init: function (parallelModel, ecModel, api) { var dimensions = parallelModel.dimensions; var parallelAxisIndex = parallelModel.parallelAxisIndex; each$11(dimensions, function (dim, idx) { var axisIndex = parallelAxisIndex[idx]; var axisModel = ecModel.getComponent('parallelAxis', axisIndex); var axis = this._axesMap.set(dim, new ParallelAxis( dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex )); var isCategory = axis.type === 'category'; axis.onBand = isCategory && axisModel.get('boundaryGap'); axis.inverse = axisModel.get('inverse'); // Injection axisModel.axis = axis; axis.model = axisModel; axis.coordinateSystem = axisModel.coordinateSystem = this; }, this); }, /** * Update axis scale after data processed * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api */ update: function (ecModel, api) { this._updateAxesFromSeries(this._model, ecModel); }, /** * @override */ containPoint: function (point) { var layoutInfo = this._makeLayoutInfo(); var axisBase = layoutInfo.axisBase; var layoutBase = layoutInfo.layoutBase; var pixelDimIndex = layoutInfo.pixelDimIndex; var pAxis = point[1 - pixelDimIndex]; var pLayout = point[pixelDimIndex]; return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength; }, getModel: function () { return this._model; }, /** * Update properties from series * @private */ _updateAxesFromSeries: function (parallelModel, ecModel) { ecModel.eachSeries(function (seriesModel) { if (!parallelModel.contains(seriesModel, ecModel)) { return; } var data = seriesModel.getData(); each$11(this.dimensions, function (dim) { var axis = this._axesMap.get(dim); axis.scale.unionExtentFromData(data, data.mapDimension(dim)); niceScaleExtent(axis.scale, axis.model); }, this); }, this); }, /** * Resize the parallel coordinate system. * @param {module:echarts/coord/parallel/ParallelModel} parallelModel * @param {module:echarts/ExtensionAPI} api */ resize: function (parallelModel, api) { this._rect = getLayoutRect( parallelModel.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() } ); this._layoutAxes(); }, /** * @return {module:zrender/core/BoundingRect} */ getRect: function () { return this._rect; }, /** * @private */ _makeLayoutInfo: function () { var parallelModel = this._model; var rect = this._rect; var xy = ['x', 'y']; var wh = ['width', 'height']; var layout = parallelModel.get('layout'); var pixelDimIndex = layout === 'horizontal' ? 0 : 1; var layoutLength = rect[wh[pixelDimIndex]]; var layoutExtent = [0, layoutLength]; var axisCount = this.dimensions.length; var axisExpandWidth = restrict(parallelModel.get('axisExpandWidth'), layoutExtent); var axisExpandCount = restrict(parallelModel.get('axisExpandCount') || 0, [0, axisCount]); var axisExpandable = parallelModel.get('axisExpandable') && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0; // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength], // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow), // where collapsed axes should be overlapped. var axisExpandWindow = parallelModel.get('axisExpandWindow'); var winSize; if (!axisExpandWindow) { winSize = restrict(axisExpandWidth * (axisExpandCount - 1), layoutExtent); var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor$2(axisCount / 2); axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2]; axisExpandWindow[1] = axisExpandWindow[0] + winSize; } else { winSize = restrict(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent); axisExpandWindow[1] = axisExpandWindow[0] + winSize; } var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount); // Avoid axisCollapseWidth is too small. axisCollapseWidth < 3 && (axisCollapseWidth = 0); // Find the first and last indices > ewin[0] and < ewin[1]. var winInnerIndices = [ mathFloor$2(round$2(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil$2(round$2(axisExpandWindow[1] / axisExpandWidth, 1)) - 1 ]; // Pos in ec coordinates. var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0]; return { layout: layout, pixelDimIndex: pixelDimIndex, layoutBase: rect[xy[pixelDimIndex]], layoutLength: layoutLength, axisBase: rect[xy[1 - pixelDimIndex]], axisLength: rect[wh[1 - pixelDimIndex]], axisExpandable: axisExpandable, axisExpandWidth: axisExpandWidth, axisCollapseWidth: axisCollapseWidth, axisExpandWindow: axisExpandWindow, axisCount: axisCount, winInnerIndices: winInnerIndices, axisExpandWindow0Pos: axisExpandWindow0Pos }; }, /** * @private */ _layoutAxes: function () { var rect = this._rect; var axes = this._axesMap; var dimensions = this.dimensions; var layoutInfo = this._makeLayoutInfo(); var layout = layoutInfo.layout; axes.each(function (axis) { var axisExtent = [0, layoutInfo.axisLength]; var idx = axis.inverse ? 1 : 0; axis.setExtent(axisExtent[idx], axisExtent[1 - idx]); }); each$11(dimensions, function (dim, idx) { var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand )(idx, layoutInfo); var positionTable = { horizontal: { x: posInfo.position, y: layoutInfo.axisLength }, vertical: { x: 0, y: posInfo.position } }; var rotationTable = { horizontal: PI$3 / 2, vertical: 0 }; var position = [ positionTable[layout].x + rect.x, positionTable[layout].y + rect.y ]; var rotation = rotationTable[layout]; var transform = create$1(); rotate(transform, transform, rotation); translate(transform, transform, position); // TODO // tick等排布信息。 // TODO // 根据axis order 更新 dimensions顺序。 this._axesLayout[dim] = { position: position, rotation: rotation, transform: transform, axisNameAvailableWidth: posInfo.axisNameAvailableWidth, axisLabelShow: posInfo.axisLabelShow, nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth, tickDirection: 1, labelDirection: 1 }; }, this); }, /** * Get axis by dim. * @param {string} dim * @return {module:echarts/coord/parallel/ParallelAxis} [description] */ getAxis: function (dim) { return this._axesMap.get(dim); }, /** * Convert a dim value of a single item of series data to Point. * @param {*} value * @param {string} dim * @return {Array} */ dataToPoint: function (value, dim) { return this.axisCoordToPoint( this._axesMap.get(dim).dataToCoord(value), dim ); }, /** * Travel data for one time, get activeState of each data item. * @param {module:echarts/data/List} data * @param {Functio} cb param: {string} activeState 'active' or 'inactive' or 'normal' * {number} dataIndex * @param {number} [start=0] the start dataIndex that travel from. * @param {number} [end=data.count()] the next dataIndex of the last dataIndex will be travel. */ eachActiveState: function (data, callback, start, end) { start == null && (start = 0); end == null && (end = data.count()); var axesMap = this._axesMap; var dimensions = this.dimensions; var dataDimensions = []; var axisModels = []; each$1(dimensions, function (axisDim) { dataDimensions.push(data.mapDimension(axisDim)); axisModels.push(axesMap.get(axisDim).model); }); var hasActiveSet = this.hasAxisBrushed(); for (var dataIndex = start; dataIndex < end; dataIndex++) { var activeState; if (!hasActiveSet) { activeState = 'normal'; } else { activeState = 'active'; var values = data.getValues(dataDimensions, dataIndex); for (var j = 0, lenj = dimensions.length; j < lenj; j++) { var state = axisModels[j].getActiveState(values[j]); if (state === 'inactive') { activeState = 'inactive'; break; } } } callback(activeState, dataIndex); } }, /** * Whether has any activeSet. * @return {boolean} */ hasAxisBrushed: function () { var dimensions = this.dimensions; var axesMap = this._axesMap; var hasActiveSet = false; for (var j = 0, lenj = dimensions.length; j < lenj; j++) { if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') { hasActiveSet = true; } } return hasActiveSet; }, /** * Convert coords of each axis to Point. * Return point. For example: [10, 20] * @param {Array.} coords * @param {string} dim * @return {Array.} */ axisCoordToPoint: function (coord, dim) { var axisLayout = this._axesLayout[dim]; return applyTransform$1([coord, 0], axisLayout.transform); }, /** * Get axis layout. */ getAxisLayout: function (dim) { return clone(this._axesLayout[dim]); }, /** * @param {Array.} point * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}. */ getSlidedAxisExpandWindow: function (point) { var layoutInfo = this._makeLayoutInfo(); var pixelDimIndex = layoutInfo.pixelDimIndex; var axisExpandWindow = layoutInfo.axisExpandWindow.slice(); var winSize = axisExpandWindow[1] - axisExpandWindow[0]; var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)]; // Out of the area of coordinate system. if (!this.containPoint(point)) { return {behavior: 'none', axisExpandWindow: axisExpandWindow}; } // Conver the point from global to expand coordinates. var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos; // For dragging operation convenience, the window should not be // slided when mouse is the center area of the window. var delta; var behavior = 'slide'; var axisCollapseWidth = layoutInfo.axisCollapseWidth; var triggerArea = this._model.get('axisExpandSlideTriggerArea'); // But consider touch device, jump is necessary. var useJump = triggerArea[0] != null; if (axisCollapseWidth) { if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) { behavior = 'jump'; delta = pointCoord - winSize * triggerArea[2]; } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) { behavior = 'jump'; delta = pointCoord - winSize * (1 - triggerArea[2]); } else { (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0); } delta *= layoutInfo.axisExpandWidth / axisCollapseWidth; delta ? sliderMove(delta, axisExpandWindow, extent, 'all') // Avoid nonsense triger on mousemove. : (behavior = 'none'); } // When screen is too narrow, make it visible and slidable, although it is hard to interact. else { var winSize = axisExpandWindow[1] - axisExpandWindow[0]; var pos = extent[1] * pointCoord / winSize; axisExpandWindow = [mathMax$5(0, pos - winSize / 2)]; axisExpandWindow[1] = mathMin$5(extent[1], axisExpandWindow[0] + winSize); axisExpandWindow[0] = axisExpandWindow[1] - winSize; } return { axisExpandWindow: axisExpandWindow, behavior: behavior }; } }; function restrict(len, extent) { return mathMin$5(mathMax$5(len, extent[0]), extent[1]); } function layoutAxisWithoutExpand(axisIndex, layoutInfo) { var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1); return { position: step * axisIndex, axisNameAvailableWidth: step, axisLabelShow: true }; } function layoutAxisWithExpand(axisIndex, layoutInfo) { var layoutLength = layoutInfo.layoutLength; var axisExpandWidth = layoutInfo.axisExpandWidth; var axisCount = layoutInfo.axisCount; var axisCollapseWidth = layoutInfo.axisCollapseWidth; var winInnerIndices = layoutInfo.winInnerIndices; var position; var axisNameAvailableWidth = axisCollapseWidth; var axisLabelShow = false; var nameTruncateMaxWidth; if (axisIndex < winInnerIndices[0]) { position = axisIndex * axisCollapseWidth; nameTruncateMaxWidth = axisCollapseWidth; } else if (axisIndex <= winInnerIndices[1]) { position = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0]; axisNameAvailableWidth = axisExpandWidth; axisLabelShow = true; } else { position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth; nameTruncateMaxWidth = axisCollapseWidth; } return { position: position, axisNameAvailableWidth: axisNameAvailableWidth, axisLabelShow: axisLabelShow, nameTruncateMaxWidth: nameTruncateMaxWidth }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Parallel coordinate system creater. */ function create$2(ecModel, api) { var coordSysList = []; ecModel.eachComponent('parallel', function (parallelModel, idx) { var coordSys = new Parallel(parallelModel, ecModel, api); coordSys.name = 'parallel_' + idx; coordSys.resize(parallelModel, api); parallelModel.coordinateSystem = coordSys; coordSys.model = parallelModel; coordSysList.push(coordSys); }); // Inject the coordinateSystems into seriesModel ecModel.eachSeries(function (seriesModel) { if (seriesModel.get('coordinateSystem') === 'parallel') { var parallelModel = ecModel.queryComponents({ mainType: 'parallel', index: seriesModel.get('parallelIndex'), id: seriesModel.get('parallelId') })[0]; seriesModel.coordinateSystem = parallelModel.coordinateSystem; } }); return coordSysList; } CoordinateSystemManager.register('parallel', {create: create$2}); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var AxisModel$2 = ComponentModel.extend({ type: 'baseParallelAxis', /** * @type {module:echarts/coord/parallel/Axis} */ axis: null, /** * @type {Array.} * @readOnly */ activeIntervals: [], /** * @return {Object} */ getAreaSelectStyle: function () { return makeStyleMapper( [ ['fill', 'color'], ['lineWidth', 'borderWidth'], ['stroke', 'borderColor'], ['width', 'width'], ['opacity', 'opacity'] ] )(this.getModel('areaSelectStyle')); }, /** * The code of this feature is put on AxisModel but not ParallelAxis, * because axisModel can be alive after echarts updating but instance of * ParallelAxis having been disposed. this._activeInterval should be kept * when action dispatched (i.e. legend click). * * @param {Array.>} intervals interval.length === 0 * means set all active. * @public */ setActiveIntervals: function (intervals) { var activeIntervals = this.activeIntervals = clone(intervals); // Normalize if (activeIntervals) { for (var i = activeIntervals.length - 1; i >= 0; i--) { asc(activeIntervals[i]); } } }, /** * @param {number|string} [value] When attempting to detect 'no activeIntervals set', * value can not be input. * @return {string} 'normal': no activeIntervals set, * 'active', * 'inactive'. * @public */ getActiveState: function (value) { var activeIntervals = this.activeIntervals; if (!activeIntervals.length) { return 'normal'; } if (value == null || isNaN(value)) { return 'inactive'; } // Simple optimization if (activeIntervals.length === 1) { var interval = activeIntervals[0]; if (interval[0] <= value && value <= interval[1]) { return 'active'; } } else { for (var i = 0, len = activeIntervals.length; i < len; i++) { if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) { return 'active'; } } } return 'inactive'; } }); var defaultOption$1 = { type: 'value', /** * @type {Array.} */ dim: null, // 0, 1, 2, ... // parallelIndex: null, areaSelectStyle: { width: 20, borderWidth: 1, borderColor: 'rgba(160,197,232)', color: 'rgba(160,197,232)', opacity: 0.3 }, realtime: true, // Whether realtime update view when select. z: 10 }; merge(AxisModel$2.prototype, axisModelCommonMixin); function getAxisType$1(axisName, option) { return option.type || (option.data ? 'category' : 'value'); } axisModelCreator('parallel', AxisModel$2, getAxisType$1, defaultOption$1); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ ComponentModel.extend({ type: 'parallel', dependencies: ['parallelAxis'], /** * @type {module:echarts/coord/parallel/Parallel} */ coordinateSystem: null, /** * Each item like: 'dim0', 'dim1', 'dim2', ... * @type {Array.} * @readOnly */ dimensions: null, /** * Coresponding to dimensions. * @type {Array.} * @readOnly */ parallelAxisIndex: null, layoutMode: 'box', defaultOption: { zlevel: 0, z: 0, left: 80, top: 60, right: 80, bottom: 60, // width: {totalWidth} - left - right, // height: {totalHeight} - top - bottom, layout: 'horizontal', // 'horizontal' or 'vertical' // FIXME // naming? axisExpandable: false, axisExpandCenter: null, axisExpandCount: 0, axisExpandWidth: 50, // FIXME '10%' ? axisExpandRate: 17, axisExpandDebounce: 50, // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full. // Do not doc to user until necessary. axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4], axisExpandTriggerOn: 'click', // 'mousemove' or 'click' parallelAxisDefault: null }, /** * @override */ init: function () { ComponentModel.prototype.init.apply(this, arguments); this.mergeOption({}); }, /** * @override */ mergeOption: function (newOption) { var thisOption = this.option; newOption && merge(thisOption, newOption, true); this._initDimensions(); }, /** * Whether series or axis is in this coordinate system. * @param {module:echarts/model/Series|module:echarts/coord/parallel/AxisModel} model * @param {module:echarts/model/Global} ecModel */ contains: function (model, ecModel) { var parallelIndex = model.get('parallelIndex'); return parallelIndex != null && ecModel.getComponent('parallel', parallelIndex) === this; }, setAxisExpand: function (opt) { each$1( ['axisExpandable', 'axisExpandCenter', 'axisExpandCount', 'axisExpandWidth', 'axisExpandWindow'], function (name) { if (opt.hasOwnProperty(name)) { this.option[name] = opt[name]; } }, this ); }, /** * @private */ _initDimensions: function () { var dimensions = this.dimensions = []; var parallelAxisIndex = this.parallelAxisIndex = []; var axisModels = filter(this.dependentModels.parallelAxis, function (axisModel) { // Can not use this.contains here, because // initialization has not been completed yet. return (axisModel.get('parallelIndex') || 0) === this.componentIndex; }, this); each$1(axisModels, function (axisModel) { dimensions.push('dim' + axisModel.get('dim')); parallelAxisIndex.push(axisModel.componentIndex); }); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @payload * @property {string} parallelAxisId * @property {Array.>} intervals */ var actionInfo$1 = { type: 'axisAreaSelect', event: 'axisAreaSelected' // update: 'updateVisual' }; registerAction(actionInfo$1, function (payload, ecModel) { ecModel.eachComponent( {mainType: 'parallelAxis', query: payload}, function (parallelAxisModel) { parallelAxisModel.axis.model.setActiveIntervals(payload.intervals); } ); }); /** * @payload */ registerAction('parallelAxisExpand', function (payload, ecModel) { ecModel.eachComponent( {mainType: 'parallel', query: payload}, function (parallelModel) { parallelModel.setAxisExpand(payload); } ); }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var curry$2 = curry; var each$12 = each$1; var map$2 = map; var mathMin$6 = Math.min; var mathMax$6 = Math.max; var mathPow$2 = Math.pow; var COVER_Z = 10000; var UNSELECT_THRESHOLD = 6; var MIN_RESIZE_LINE_WIDTH = 6; var MUTEX_RESOURCE_KEY = 'globalPan'; var DIRECTION_MAP = { w: [0, 0], e: [0, 1], n: [1, 0], s: [1, 1] }; var CURSOR_MAP = { w: 'ew', e: 'ew', n: 'ns', s: 'ns', ne: 'nesw', sw: 'nesw', nw: 'nwse', se: 'nwse' }; var DEFAULT_BRUSH_OPT = { brushStyle: { lineWidth: 2, stroke: 'rgba(0,0,0,0.3)', fill: 'rgba(0,0,0,0.1)' }, transformable: true, brushMode: 'single', removeOnClick: false }; var baseUID = 0; /** * @alias module:echarts/component/helper/BrushController * @constructor * @mixin {module:zrender/mixin/Eventful} * @event module:echarts/component/helper/BrushController#brush * params: * areas: Array., coord relates to container group, * If no container specified, to global. * opt { * isEnd: boolean, * removeOnClick: boolean * } * * @param {module:zrender/zrender~ZRender} zr */ function BrushController(zr) { if (__DEV__) { assert$1(zr); } Eventful.call(this); /** * @type {module:zrender/zrender~ZRender} * @private */ this._zr = zr; /** * @type {module:zrender/container/Group} * @readOnly */ this.group = new Group(); /** * Only for drawing (after enabledBrush). * 'line', 'rect', 'polygon' or false * If passing false/null/undefined, disable brush. * If passing 'auto', determined by panel.defaultBrushType * @private * @type {string} */ this._brushType; /** * Only for drawing (after enabledBrush). * * @private * @type {Object} */ this._brushOption; /** * @private * @type {Object} */ this._panels; /** * @private * @type {Array.} */ this._track = []; /** * @private * @type {boolean} */ this._dragging; /** * @private * @type {Array} */ this._covers = []; /** * @private * @type {moudule:zrender/container/Group} */ this._creatingCover; /** * `true` means global panel * @private * @type {module:zrender/container/Group|boolean} */ this._creatingPanel; /** * @private * @type {boolean} */ this._enableGlobalPan; /** * @private * @type {boolean} */ if (__DEV__) { this._mounted; } /** * @private * @type {string} */ this._uid = 'brushController_' + baseUID++; /** * @private * @type {Object} */ this._handlers = {}; each$12(mouseHandlers, function (handler, eventName) { this._handlers[eventName] = bind(handler, this); }, this); } BrushController.prototype = { constructor: BrushController, /** * If set to null/undefined/false, select disabled. * @param {Object} brushOption * @param {string|boolean} brushOption.brushType 'line', 'rect', 'polygon' or false * If passing false/null/undefined, disable brush. * If passing 'auto', determined by panel.defaultBrushType. * ('auto' can not be used in global panel) * @param {number} [brushOption.brushMode='single'] 'single' or 'multiple' * @param {boolean} [brushOption.transformable=true] * @param {boolean} [brushOption.removeOnClick=false] * @param {Object} [brushOption.brushStyle] * @param {number} [brushOption.brushStyle.width] * @param {number} [brushOption.brushStyle.lineWidth] * @param {string} [brushOption.brushStyle.stroke] * @param {string} [brushOption.brushStyle.fill] * @param {number} [brushOption.z] */ enableBrush: function (brushOption) { if (__DEV__) { assert$1(this._mounted); } this._brushType && doDisableBrush(this); brushOption.brushType && doEnableBrush(this, brushOption); return this; }, /** * @param {Array.} panelOpts If not pass, it is global brush. * Each items: { * panelId, // mandatory. * clipPath, // mandatory. function. * isTargetByCursor, // mandatory. function. * defaultBrushType, // optional, only used when brushType is 'auto'. * getLinearBrushOtherExtent, // optional. function. * } */ setPanels: function (panelOpts) { if (panelOpts && panelOpts.length) { var panels = this._panels = {}; each$1(panelOpts, function (panelOpts) { panels[panelOpts.panelId] = clone(panelOpts); }); } else { this._panels = null; } return this; }, /** * @param {Object} [opt] * @return {boolean} [opt.enableGlobalPan=false] */ mount: function (opt) { opt = opt || {}; if (__DEV__) { this._mounted = true; // should be at first. } this._enableGlobalPan = opt.enableGlobalPan; var thisGroup = this.group; this._zr.add(thisGroup); thisGroup.attr({ position: opt.position || [0, 0], rotation: opt.rotation || 0, scale: opt.scale || [1, 1] }); this._transform = thisGroup.getLocalTransform(); return this; }, eachCover: function (cb, context) { each$12(this._covers, cb, context); }, /** * Update covers. * @param {Array.} brushOptionList Like: * [ * {id: 'xx', brushType: 'line', range: [23, 44], brushStyle, transformable}, * {id: 'yy', brushType: 'rect', range: [[23, 44], [23, 54]]}, * ... * ] * `brushType` is required in each cover info. (can not be 'auto') * `id` is not mandatory. * `brushStyle`, `transformable` is not mandatory, use DEFAULT_BRUSH_OPT by default. * If brushOptionList is null/undefined, all covers removed. */ updateCovers: function (brushOptionList) { if (__DEV__) { assert$1(this._mounted); } brushOptionList = map(brushOptionList, function (brushOption) { return merge(clone(DEFAULT_BRUSH_OPT), brushOption, true); }); var tmpIdPrefix = '\0-brush-index-'; var oldCovers = this._covers; var newCovers = this._covers = []; var controller = this; var creatingCover = this._creatingCover; (new DataDiffer(oldCovers, brushOptionList, oldGetKey, getKey)) .add(addOrUpdate) .update(addOrUpdate) .remove(remove) .execute(); return this; function getKey(brushOption, index) { return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + '-' + brushOption.brushType; } function oldGetKey(cover, index) { return getKey(cover.__brushOption, index); } function addOrUpdate(newIndex, oldIndex) { var newBrushOption = brushOptionList[newIndex]; // Consider setOption in event listener of brushSelect, // where updating cover when creating should be forbiden. if (oldIndex != null && oldCovers[oldIndex] === creatingCover) { newCovers[newIndex] = oldCovers[oldIndex]; } else { var cover = newCovers[newIndex] = oldIndex != null ? ( oldCovers[oldIndex].__brushOption = newBrushOption, oldCovers[oldIndex] ) : endCreating(controller, createCover(controller, newBrushOption)); updateCoverAfterCreation(controller, cover); } } function remove(oldIndex) { if (oldCovers[oldIndex] !== creatingCover) { controller.group.remove(oldCovers[oldIndex]); } } }, unmount: function () { if (__DEV__) { if (!this._mounted) { return; } } this.enableBrush(false); // container may 'removeAll' outside. clearCovers(this); this._zr.remove(this.group); if (__DEV__) { this._mounted = false; // should be at last. } return this; }, dispose: function () { this.unmount(); this.off(); } }; mixin(BrushController, Eventful); function doEnableBrush(controller, brushOption) { var zr = controller._zr; // Consider roam, which takes globalPan too. if (!controller._enableGlobalPan) { take(zr, MUTEX_RESOURCE_KEY, controller._uid); } each$12(controller._handlers, function (handler, eventName) { zr.on(eventName, handler); }); controller._brushType = brushOption.brushType; controller._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true); } function doDisableBrush(controller) { var zr = controller._zr; release(zr, MUTEX_RESOURCE_KEY, controller._uid); each$12(controller._handlers, function (handler, eventName) { zr.off(eventName, handler); }); controller._brushType = controller._brushOption = null; } function createCover(controller, brushOption) { var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption); cover.__brushOption = brushOption; updateZ$1(cover, brushOption); controller.group.add(cover); return cover; } function endCreating(controller, creatingCover) { var coverRenderer = getCoverRenderer(creatingCover); if (coverRenderer.endCreating) { coverRenderer.endCreating(controller, creatingCover); updateZ$1(creatingCover, creatingCover.__brushOption); } return creatingCover; } function updateCoverShape(controller, cover) { var brushOption = cover.__brushOption; getCoverRenderer(cover).updateCoverShape( controller, cover, brushOption.range, brushOption ); } function updateZ$1(cover, brushOption) { var z = brushOption.z; z == null && (z = COVER_Z); cover.traverse(function (el) { el.z = z; el.z2 = z; // Consider in given container. }); } function updateCoverAfterCreation(controller, cover) { getCoverRenderer(cover).updateCommon(controller, cover); updateCoverShape(controller, cover); } function getCoverRenderer(cover) { return coverRenderers[cover.__brushOption.brushType]; } // return target panel or `true` (means global panel) function getPanelByPoint(controller, e, localCursorPoint) { var panels = controller._panels; if (!panels) { return true; // Global panel } var panel; var transform = controller._transform; each$12(panels, function (pn) { pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn); }); return panel; } // Return a panel or true function getPanelByCover(controller, cover) { var panels = controller._panels; if (!panels) { return true; // Global panel } var panelId = cover.__brushOption.panelId; // User may give cover without coord sys info, // which is then treated as global panel. return panelId != null ? panels[panelId] : true; } function clearCovers(controller) { var covers = controller._covers; var originalLength = covers.length; each$12(covers, function (cover) { controller.group.remove(cover); }, controller); covers.length = 0; return !!originalLength; } function trigger(controller, opt) { var areas = map$2(controller._covers, function (cover) { var brushOption = cover.__brushOption; var range = clone(brushOption.range); return { brushType: brushOption.brushType, panelId: brushOption.panelId, range: range }; }); controller.trigger('brush', areas, { isEnd: !!opt.isEnd, removeOnClick: !!opt.removeOnClick }); } function shouldShowCover(controller) { var track = controller._track; if (!track.length) { return false; } var p2 = track[track.length - 1]; var p1 = track[0]; var dx = p2[0] - p1[0]; var dy = p2[1] - p1[1]; var dist = mathPow$2(dx * dx + dy * dy, 0.5); return dist > UNSELECT_THRESHOLD; } function getTrackEnds(track) { var tail = track.length - 1; tail < 0 && (tail = 0); return [track[0], track[tail]]; } function createBaseRectCover(doDrift, controller, brushOption, edgeNames) { var cover = new Group(); cover.add(new Rect({ name: 'main', style: makeStyle(brushOption), silent: true, draggable: true, cursor: 'move', drift: curry$2(doDrift, controller, cover, 'nswe'), ondragend: curry$2(trigger, controller, {isEnd: true}) })); each$12( edgeNames, function (name) { cover.add(new Rect({ name: name, style: {opacity: 0}, draggable: true, silent: true, invisible: true, drift: curry$2(doDrift, controller, cover, name), ondragend: curry$2(trigger, controller, {isEnd: true}) })); } ); return cover; } function updateBaseRect(controller, cover, localRange, brushOption) { var lineWidth = brushOption.brushStyle.lineWidth || 0; var handleSize = mathMax$6(lineWidth, MIN_RESIZE_LINE_WIDTH); var x = localRange[0][0]; var y = localRange[1][0]; var xa = x - lineWidth / 2; var ya = y - lineWidth / 2; var x2 = localRange[0][1]; var y2 = localRange[1][1]; var x2a = x2 - handleSize + lineWidth / 2; var y2a = y2 - handleSize + lineWidth / 2; var width = x2 - x; var height = y2 - y; var widtha = width + lineWidth; var heighta = height + lineWidth; updateRectShape(controller, cover, 'main', x, y, width, height); if (brushOption.transformable) { updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta); updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta); updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize); updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize); updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize); updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize); updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize); updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize); } } function updateCommon(controller, cover) { var brushOption = cover.__brushOption; var transformable = brushOption.transformable; var mainEl = cover.childAt(0); mainEl.useStyle(makeStyle(brushOption)); mainEl.attr({ silent: !transformable, cursor: transformable ? 'move' : 'default' }); each$12( ['w', 'e', 'n', 's', 'se', 'sw', 'ne', 'nw'], function (name) { var el = cover.childOfName(name); var globalDir = getGlobalDirection(controller, name); el && el.attr({ silent: !transformable, invisible: !transformable, cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null }); } ); } function updateRectShape(controller, cover, name, x, y, w, h) { var el = cover.childOfName(name); el && el.setShape(pointsToRect( clipByPanel(controller, cover, [[x, y], [x + w, y + h]]) )); } function makeStyle(brushOption) { return defaults({strokeNoScale: true}, brushOption.brushStyle); } function formatRectRange(x, y, x2, y2) { var min = [mathMin$6(x, x2), mathMin$6(y, y2)]; var max = [mathMax$6(x, x2), mathMax$6(y, y2)]; return [ [min[0], max[0]], // x range [min[1], max[1]] // y range ]; } function getTransform$1(controller) { return getTransform(controller.group); } function getGlobalDirection(controller, localDirection) { if (localDirection.length > 1) { localDirection = localDirection.split(''); var globalDir = [ getGlobalDirection(controller, localDirection[0]), getGlobalDirection(controller, localDirection[1]) ]; (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse(); return globalDir.join(''); } else { var map$$1 = {w: 'left', e: 'right', n: 'top', s: 'bottom'}; var inverseMap = {left: 'w', right: 'e', top: 'n', bottom: 's'}; var globalDir = transformDirection( map$$1[localDirection], getTransform$1(controller) ); return inverseMap[globalDir]; } } function driftRect(toRectRange, fromRectRange, controller, cover, name, dx, dy, e) { var brushOption = cover.__brushOption; var rectRange = toRectRange(brushOption.range); var localDelta = toLocalDelta(controller, dx, dy); each$12(name.split(''), function (namePart) { var ind = DIRECTION_MAP[namePart]; rectRange[ind[0]][ind[1]] += localDelta[ind[0]]; }); brushOption.range = fromRectRange(formatRectRange( rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1] )); updateCoverAfterCreation(controller, cover); trigger(controller, {isEnd: false}); } function driftPolygon(controller, cover, dx, dy, e) { var range = cover.__brushOption.range; var localDelta = toLocalDelta(controller, dx, dy); each$12(range, function (point) { point[0] += localDelta[0]; point[1] += localDelta[1]; }); updateCoverAfterCreation(controller, cover); trigger(controller, {isEnd: false}); } function toLocalDelta(controller, dx, dy) { var thisGroup = controller.group; var localD = thisGroup.transformCoordToLocal(dx, dy); var localZero = thisGroup.transformCoordToLocal(0, 0); return [localD[0] - localZero[0], localD[1] - localZero[1]]; } function clipByPanel(controller, cover, data) { var panel = getPanelByCover(controller, cover); return (panel && panel !== true) ? panel.clipPath(data, controller._transform) : clone(data); } function pointsToRect(points) { var xmin = mathMin$6(points[0][0], points[1][0]); var ymin = mathMin$6(points[0][1], points[1][1]); var xmax = mathMax$6(points[0][0], points[1][0]); var ymax = mathMax$6(points[0][1], points[1][1]); return { x: xmin, y: ymin, width: xmax - xmin, height: ymax - ymin }; } function resetCursor(controller, e, localCursorPoint) { // Check active if (!controller._brushType) { return; } var zr = controller._zr; var covers = controller._covers; var currPanel = getPanelByPoint(controller, e, localCursorPoint); // Check whether in covers. if (!controller._dragging) { for (var i = 0; i < covers.length; i++) { var brushOption = covers[i].__brushOption; if (currPanel && (currPanel === true || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain( covers[i], localCursorPoint[0], localCursorPoint[1] ) ) { // Use cursor style set on cover. return; } } } currPanel && zr.setCursorStyle('crosshair'); } function preventDefault(e) { var rawE = e.event; rawE.preventDefault && rawE.preventDefault(); } function mainShapeContain(cover, x, y) { return cover.childOfName('main').contain(x, y); } function updateCoverByMouse(controller, e, localCursorPoint, isEnd) { var creatingCover = controller._creatingCover; var panel = controller._creatingPanel; var thisBrushOption = controller._brushOption; var eventParams; controller._track.push(localCursorPoint.slice()); if (shouldShowCover(controller) || creatingCover) { if (panel && !creatingCover) { thisBrushOption.brushMode === 'single' && clearCovers(controller); var brushOption = clone(thisBrushOption); brushOption.brushType = determineBrushType(brushOption.brushType, panel); brushOption.panelId = panel === true ? null : panel.panelId; creatingCover = controller._creatingCover = createCover(controller, brushOption); controller._covers.push(creatingCover); } if (creatingCover) { var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)]; var coverBrushOption = creatingCover.__brushOption; coverBrushOption.range = coverRenderer.getCreatingRange( clipByPanel(controller, creatingCover, controller._track) ); if (isEnd) { endCreating(controller, creatingCover); coverRenderer.updateCommon(controller, creatingCover); } updateCoverShape(controller, creatingCover); eventParams = {isEnd: isEnd}; } } else if ( isEnd && thisBrushOption.brushMode === 'single' && thisBrushOption.removeOnClick ) { // Help user to remove covers easily, only by a tiny drag, in 'single' mode. // But a single click do not clear covers, because user may have casual // clicks (for example, click on other component and do not expect covers // disappear). // Only some cover removed, trigger action, but not every click trigger action. if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) { eventParams = {isEnd: isEnd, removeOnClick: true}; } } return eventParams; } function determineBrushType(brushType, panel) { if (brushType === 'auto') { if (__DEV__) { assert$1( panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is "atuo"' ); } return panel.defaultBrushType; } return brushType; } var mouseHandlers = { mousedown: function (e) { if (this._dragging) { // In case some browser do not support globalOut, // and release mose out side the browser. handleDragEnd.call(this, e); } else if (!e.target || !e.target.draggable) { preventDefault(e); var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY); this._creatingCover = null; var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint); if (panel) { this._dragging = true; this._track = [localCursorPoint.slice()]; } } }, mousemove: function (e) { var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY); resetCursor(this, e, localCursorPoint); if (this._dragging) { preventDefault(e); var eventParams = updateCoverByMouse(this, e, localCursorPoint, false); eventParams && trigger(this, eventParams); } }, mouseup: handleDragEnd //, // FIXME // in tooltip, globalout should not be triggered. // globalout: handleDragEnd }; function handleDragEnd(e) { if (this._dragging) { preventDefault(e); var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY); var eventParams = updateCoverByMouse(this, e, localCursorPoint, true); this._dragging = false; this._track = []; this._creatingCover = null; // trigger event shoule be at final, after procedure will be nested. eventParams && trigger(this, eventParams); } } /** * key: brushType * @type {Object} */ var coverRenderers = { lineX: getLineRenderer(0), lineY: getLineRenderer(1), rect: { createCover: function (controller, brushOption) { return createBaseRectCover( curry$2( driftRect, function (range) { return range; }, function (range) { return range; } ), controller, brushOption, ['w', 'e', 'n', 's', 'se', 'sw', 'ne', 'nw'] ); }, getCreatingRange: function (localTrack) { var ends = getTrackEnds(localTrack); return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]); }, updateCoverShape: function (controller, cover, localRange, brushOption) { updateBaseRect(controller, cover, localRange, brushOption); }, updateCommon: updateCommon, contain: mainShapeContain }, polygon: { createCover: function (controller, brushOption) { var cover = new Group(); // Do not use graphic.Polygon because graphic.Polyline do not close the // border of the shape when drawing, which is a better experience for user. cover.add(new Polyline({ name: 'main', style: makeStyle(brushOption), silent: true })); return cover; }, getCreatingRange: function (localTrack) { return localTrack; }, endCreating: function (controller, cover) { cover.remove(cover.childAt(0)); // Use graphic.Polygon close the shape. cover.add(new Polygon({ name: 'main', draggable: true, drift: curry$2(driftPolygon, controller, cover), ondragend: curry$2(trigger, controller, {isEnd: true}) })); }, updateCoverShape: function (controller, cover, localRange, brushOption) { cover.childAt(0).setShape({ points: clipByPanel(controller, cover, localRange) }); }, updateCommon: updateCommon, contain: mainShapeContain } }; function getLineRenderer(xyIndex) { return { createCover: function (controller, brushOption) { return createBaseRectCover( curry$2( driftRect, function (range) { var rectRange = [range, [0, 100]]; xyIndex && rectRange.reverse(); return rectRange; }, function (rectRange) { return rectRange[xyIndex]; } ), controller, brushOption, [['w', 'e'], ['n', 's']][xyIndex] ); }, getCreatingRange: function (localTrack) { var ends = getTrackEnds(localTrack); var min = mathMin$6(ends[0][xyIndex], ends[1][xyIndex]); var max = mathMax$6(ends[0][xyIndex], ends[1][xyIndex]); return [min, max]; }, updateCoverShape: function (controller, cover, localRange, brushOption) { var otherExtent; // If brushWidth not specified, fit the panel. var panel = getPanelByCover(controller, cover); if (panel !== true && panel.getLinearBrushOtherExtent) { otherExtent = panel.getLinearBrushOtherExtent( xyIndex, controller._transform ); } else { var zr = controller._zr; otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]]; } var rectRange = [localRange, otherExtent]; xyIndex && rectRange.reverse(); updateBaseRect(controller, cover, rectRange, brushOption); }, updateCommon: updateCommon, contain: mainShapeContain }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function makeRectPanelClipPath(rect) { rect = normalizeRect(rect); return function (localPoints, transform) { return clipPointsByRect(localPoints, rect); }; } function makeLinearBrushOtherExtent(rect, specifiedXYIndex) { rect = normalizeRect(rect); return function (xyIndex) { var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex; var brushWidth = idx ? rect.width : rect.height; var base = idx ? rect.x : rect.y; return [base, base + (brushWidth || 0)]; }; } function makeRectIsTargetByCursor(rect, api, targetModel) { rect = normalizeRect(rect); return function (e, localCursorPoint, transform) { return rect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel); }; } // Consider width/height is negative. function normalizeRect(rect) { return BoundingRect.create(rect); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var elementList = ['axisLine', 'axisTickLabel', 'axisName']; var AxisView$2 = extendComponentView({ type: 'parallelAxis', /** * @override */ init: function (ecModel, api) { AxisView$2.superApply(this, 'init', arguments); /** * @type {module:echarts/component/helper/BrushController} */ (this._brushController = new BrushController(api.getZr())) .on('brush', bind(this._onBrush, this)); }, /** * @override */ render: function (axisModel, ecModel, api, payload) { if (fromAxisAreaSelect(axisModel, ecModel, payload)) { return; } this.axisModel = axisModel; this.api = api; this.group.removeAll(); var oldAxisGroup = this._axisGroup; this._axisGroup = new Group(); this.group.add(this._axisGroup); if (!axisModel.get('show')) { return; } var coordSysModel = getCoordSysModel(axisModel, ecModel); var coordSys = coordSysModel.coordinateSystem; var areaSelectStyle = axisModel.getAreaSelectStyle(); var areaWidth = areaSelectStyle.width; var dim = axisModel.axis.dim; var axisLayout = coordSys.getAxisLayout(dim); var builderOpt = extend( {strokeContainThreshold: areaWidth}, axisLayout ); var axisBuilder = new AxisBuilder(axisModel, builderOpt); each$1(elementList, axisBuilder.add, axisBuilder); this._axisGroup.add(axisBuilder.getGroup()); this._refreshBrushController( builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api ); var animationModel = (payload && payload.animation === false) ? null : axisModel; groupTransition(oldAxisGroup, this._axisGroup, animationModel); }, // /** // * @override // */ // updateVisual: function (axisModel, ecModel, api, payload) { // this._brushController && this._brushController // .updateCovers(getCoverInfoList(axisModel)); // }, _refreshBrushController: function ( builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api ) { // After filtering, axis may change, select area needs to be update. var extent = axisModel.axis.getExtent(); var extentLen = extent[1] - extent[0]; var extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value. // width/height might be negative, which will be // normalized in BoundingRect. var rect = BoundingRect.create({ x: extent[0], y: -areaWidth / 2, width: extentLen, height: areaWidth }); rect.x -= extra; rect.width += 2 * extra; this._brushController .mount({ enableGlobalPan: true, rotation: builderOpt.rotation, position: builderOpt.position }) .setPanels([{ panelId: 'pl', clipPath: makeRectPanelClipPath(rect), isTargetByCursor: makeRectIsTargetByCursor(rect, api, coordSysModel), getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0) }]) .enableBrush({ brushType: 'lineX', brushStyle: areaSelectStyle, removeOnClick: true }) .updateCovers(getCoverInfoList(axisModel)); }, _onBrush: function (coverInfoList, opt) { // Do not cache these object, because the mey be changed. var axisModel = this.axisModel; var axis = axisModel.axis; var intervals = map(coverInfoList, function (coverInfo) { return [ axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true) ]; }); // If realtime is true, action is not dispatched on drag end, because // the drag end emits the same params with the last drag move event, // and may have some delay when using touch pad. if (!axisModel.option.realtime === opt.isEnd || opt.removeOnClick) { // jshint ignore:line this.api.dispatchAction({ type: 'axisAreaSelect', parallelAxisId: axisModel.id, intervals: intervals }); } }, /** * @override */ dispose: function () { this._brushController.dispose(); } }); function fromAxisAreaSelect(axisModel, ecModel, payload) { return payload && payload.type === 'axisAreaSelect' && ecModel.findComponents( {mainType: 'parallelAxis', query: payload} )[0] === axisModel; } function getCoverInfoList(axisModel) { var axis = axisModel.axis; return map(axisModel.activeIntervals, function (interval) { return { brushType: 'lineX', panelId: 'pl', range: [ axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true) ] }; }); } function getCoordSysModel(axisModel, ecModel) { return ecModel.getComponent( 'parallel', axisModel.get('parallelIndex') ); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var CLICK_THRESHOLD = 5; // > 4 // Parallel view extendComponentView({ type: 'parallel', render: function (parallelModel, ecModel, api) { this._model = parallelModel; this._api = api; if (!this._handlers) { this._handlers = {}; each$1(handlers, function (handler, eventName) { api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this)); }, this); } createOrUpdate( this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate' ); }, dispose: function (ecModel, api) { each$1(this._handlers, function (handler, eventName) { api.getZr().off(eventName, handler); }); this._handlers = null; }, /** * @param {Object} [opt] If null, cancle the last action triggering for debounce. */ _throttledDispatchExpand: function (opt) { this._dispatchExpand(opt); }, _dispatchExpand: function (opt) { opt && this._api.dispatchAction( extend({type: 'parallelAxisExpand'}, opt) ); } }); var handlers = { mousedown: function (e) { if (checkTrigger(this, 'click')) { this._mouseDownPoint = [e.offsetX, e.offsetY]; } }, mouseup: function (e) { var mouseDownPoint = this._mouseDownPoint; if (checkTrigger(this, 'click') && mouseDownPoint) { var point = [e.offsetX, e.offsetY]; var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2); if (dist > CLICK_THRESHOLD) { return; } var result = this._model.coordinateSystem.getSlidedAxisExpandWindow( [e.offsetX, e.offsetY] ); result.behavior !== 'none' && this._dispatchExpand({ axisExpandWindow: result.axisExpandWindow }); } this._mouseDownPoint = null; }, mousemove: function (e) { // Should do nothing when brushing. if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) { return; } var model = this._model; var result = model.coordinateSystem.getSlidedAxisExpandWindow( [e.offsetX, e.offsetY] ); var behavior = result.behavior; behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce')); this._throttledDispatchExpand( behavior === 'none' ? null // Cancle the last trigger, in case that mouse slide out of the area quickly. : { axisExpandWindow: result.axisExpandWindow, // Jumping uses animation, and sliding suppresses animation. animation: behavior === 'jump' ? null : false } ); } }; function checkTrigger(view, triggerOn) { var model = view._model; return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn; } registerPreprocessor(parallelPreprocessor); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ SeriesModel.extend({ type: 'series.parallel', dependencies: ['parallel'], visualColorAccessPath: 'lineStyle.color', getInitialData: function (option, ecModel) { var source = this.getSource(); setEncodeAndDimensions(source, this); return createListFromArray(source, this); }, /** * User can get data raw indices on 'axisAreaSelected' event received. * * @public * @param {string} activeState 'active' or 'inactive' or 'normal' * @return {Array.} Raw indices */ getRawIndicesByActiveState: function (activeState) { var coordSys = this.coordinateSystem; var data = this.getData(); var indices = []; coordSys.eachActiveState(data, function (theActiveState, dataIndex) { if (activeState === theActiveState) { indices.push(data.getRawIndex(dataIndex)); } }); return indices; }, defaultOption: { zlevel: 0, // 一级层叠 z: 2, // 二级层叠 coordinateSystem: 'parallel', parallelIndex: 0, label: { show: false }, inactiveOpacity: 0.05, activeOpacity: 1, lineStyle: { width: 1, opacity: 0.45, type: 'solid' }, emphasis: { label: { show: false } }, progressive: 500, smooth: false, // true | false | number animationEasing: 'linear' } }); function setEncodeAndDimensions(source, seriesModel) { // The mapping of parallelAxis dimension to data dimension can // be specified in parallelAxis.option.dim. For example, if // parallelAxis.option.dim is 'dim3', it mapping to the third // dimension of data. But `data.encode` has higher priority. // Moreover, parallelModel.dimension should not be regarded as data // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6']; if (source.encodeDefine) { return; } var parallelModel = seriesModel.ecModel.getComponent( 'parallel', seriesModel.get('parallelIndex') ); if (!parallelModel) { return; } var encodeDefine = source.encodeDefine = createHashMap(); each$1(parallelModel.dimensions, function (axisDim) { var dataDimIndex = convertDimNameToNumber(axisDim); encodeDefine.set(axisDim, dataDimIndex); }); } function convertDimNameToNumber(dimName) { return +dimName.replace('dim', ''); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var DEFAULT_SMOOTH = 0.3; var ParallelView = Chart.extend({ type: 'parallel', init: function () { /** * @type {module:zrender/container/Group} * @private */ this._dataGroup = new Group(); this.group.add(this._dataGroup); /** * @type {module:echarts/data/List} */ this._data; /** * @type {boolean} */ this._initialized; }, /** * @override */ render: function (seriesModel, ecModel, api, payload) { var dataGroup = this._dataGroup; var data = seriesModel.getData(); var oldData = this._data; var coordSys = seriesModel.coordinateSystem; var dimensions = coordSys.dimensions; var seriesScope = makeSeriesScope$2(seriesModel); data.diff(oldData) .add(add) .update(update) .remove(remove) .execute(); function add(newDataIndex) { var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys); updateElCommon(line, data, newDataIndex, seriesScope); } function update(newDataIndex, oldDataIndex) { var line = oldData.getItemGraphicEl(oldDataIndex); var points = createLinePoints(data, newDataIndex, dimensions, coordSys); data.setItemGraphicEl(newDataIndex, line); var animationModel = (payload && payload.animation === false) ? null : seriesModel; updateProps(line, {shape: {points: points}}, animationModel, newDataIndex); updateElCommon(line, data, newDataIndex, seriesScope); } function remove(oldDataIndex) { var line = oldData.getItemGraphicEl(oldDataIndex); dataGroup.remove(line); } // First create if (!this._initialized) { this._initialized = true; var clipPath = createGridClipShape$1( coordSys, seriesModel, function () { // Callback will be invoked immediately if there is no animation setTimeout(function () { dataGroup.removeClipPath(); }); } ); dataGroup.setClipPath(clipPath); } this._data = data; }, incrementalPrepareRender: function (seriesModel, ecModel, api) { this._initialized = true; this._data = null; this._dataGroup.removeAll(); }, incrementalRender: function (taskParams, seriesModel, ecModel) { var data = seriesModel.getData(); var coordSys = seriesModel.coordinateSystem; var dimensions = coordSys.dimensions; var seriesScope = makeSeriesScope$2(seriesModel); for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) { var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys); line.incremental = true; updateElCommon(line, data, dataIndex, seriesScope); } }, dispose: function () {}, // _renderForProgressive: function (seriesModel) { // var dataGroup = this._dataGroup; // var data = seriesModel.getData(); // var oldData = this._data; // var coordSys = seriesModel.coordinateSystem; // var dimensions = coordSys.dimensions; // var option = seriesModel.option; // var progressive = option.progressive; // var smooth = option.smooth ? SMOOTH : null; // // In progressive animation is disabled, so use simple data diff, // // which effects performance less. // // (Typically performance for data with length 7000+ like: // // simpleDiff: 60ms, addEl: 184ms, // // in RMBP 2.4GHz intel i7, OSX 10.9 chrome 50.0.2661.102 (64-bit)) // if (simpleDiff(oldData, data, dimensions)) { // dataGroup.removeAll(); // data.each(function (dataIndex) { // addEl(data, dataGroup, dataIndex, dimensions, coordSys); // }); // } // updateElCommon(data, progressive, smooth); // // Consider switch between progressive and not. // data.__plProgressive = true; // this._data = data; // }, /** * @override */ remove: function () { this._dataGroup && this._dataGroup.removeAll(); this._data = null; } }); function createGridClipShape$1(coordSys, seriesModel, cb) { var parallelModel = coordSys.model; var rect = coordSys.getRect(); var rectEl = new Rect({ shape: { x: rect.x, y: rect.y, width: rect.width, height: rect.height } }); var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height'; rectEl.setShape(dim, 0); initProps(rectEl, { shape: { width: rect.width, height: rect.height } }, seriesModel, cb); return rectEl; } function createLinePoints(data, dataIndex, dimensions, coordSys) { var points = []; for (var i = 0; i < dimensions.length; i++) { var dimName = dimensions[i]; var value = data.get(data.mapDimension(dimName), dataIndex); if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) { points.push(coordSys.dataToPoint(value, dimName)); } } return points; } function addEl(data, dataGroup, dataIndex, dimensions, coordSys) { var points = createLinePoints(data, dataIndex, dimensions, coordSys); var line = new Polyline({ shape: {points: points}, silent: true, z2: 10 }); dataGroup.add(line); data.setItemGraphicEl(dataIndex, line); return line; } function makeSeriesScope$2(seriesModel) { var smooth = seriesModel.get('smooth', true); smooth === true && (smooth = DEFAULT_SMOOTH); return { lineStyle: seriesModel.getModel('lineStyle').getLineStyle(), smooth: smooth != null ? smooth : DEFAULT_SMOOTH }; } function updateElCommon(el, data, dataIndex, seriesScope) { var lineStyle = seriesScope.lineStyle; if (data.hasItemOption) { var lineStyleModel = data.getItemModel(dataIndex).getModel('lineStyle'); lineStyle = lineStyleModel.getLineStyle(); } el.useStyle(lineStyle); var elStyle = el.style; elStyle.fill = null; // lineStyle.color have been set to itemVisual in module:echarts/visual/seriesColor. elStyle.stroke = data.getItemVisual(dataIndex, 'color'); // lineStyle.opacity have been set to itemVisual in parallelVisual. elStyle.opacity = data.getItemVisual(dataIndex, 'opacity'); seriesScope.smooth && (el.shape.smooth = seriesScope.smooth); } // function simpleDiff(oldData, newData, dimensions) { // var oldLen; // if (!oldData // || !oldData.__plProgressive // || (oldLen = oldData.count()) !== newData.count() // ) { // return true; // } // var dimLen = dimensions.length; // for (var i = 0; i < oldLen; i++) { // for (var j = 0; j < dimLen; j++) { // if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) { // return true; // } // } // } // return false; // } // FIXME // 公用方法? function isEmptyValue(val, axisType) { return axisType === 'category' ? val == null : (val == null || isNaN(val)); // axisType === 'value' } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var opacityAccessPath$1 = ['lineStyle', 'normal', 'opacity']; var parallelVisual = { seriesType: 'parallel', reset: function (seriesModel, ecModel, api) { var itemStyleModel = seriesModel.getModel('itemStyle'); var lineStyleModel = seriesModel.getModel('lineStyle'); var globalColors = ecModel.get('color'); var color = lineStyleModel.get('color') || itemStyleModel.get('color') || globalColors[seriesModel.seriesIndex % globalColors.length]; var inactiveOpacity = seriesModel.get('inactiveOpacity'); var activeOpacity = seriesModel.get('activeOpacity'); var lineStyle = seriesModel.getModel('lineStyle').getLineStyle(); var coordSys = seriesModel.coordinateSystem; var data = seriesModel.getData(); var opacityMap = { normal: lineStyle.opacity, active: activeOpacity, inactive: inactiveOpacity }; data.setVisual('color', color); function progress(params, data) { coordSys.eachActiveState(data, function (activeState, dataIndex) { var opacity = opacityMap[activeState]; if (activeState === 'normal' && data.hasItemOption) { var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath$1, true); itemOpacity != null && (opacity = itemOpacity); } data.setItemVisual(dataIndex, 'opacity', opacity); }, params.start, params.end); } return {progress: progress}; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerVisual(parallelVisual); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file Get initial data and define sankey view's series model * @author Deqing Li(annong035@gmail.com) */ var SankeySeries = SeriesModel.extend({ type: 'series.sankey', layoutInfo: null, /** * Init a graph data structure from data in option series * * @param {Object} option the object used to config echarts view * @return {module:echarts/data/List} storage initial data */ getInitialData: function (option) { var links = option.edges || option.links; var nodes = option.data || option.nodes; if (nodes && links) { var graph = createGraphFromNodeEdge(nodes, links, this, true); return graph.data; } }, setNodePosition: function (dataIndex, localPosition) { var dataItem = this.option.data[dataIndex]; dataItem.localX = localPosition[0]; dataItem.localY = localPosition[1]; }, /** * Return the graphic data structure * * @return {module:echarts/data/Graph} graphic data structure */ getGraph: function () { return this.getData().graph; }, /** * Get edge data of graphic data structure * * @return {module:echarts/data/List} data structure of list */ getEdgeData: function () { return this.getGraph().edgeData; }, /** * @override */ formatTooltip: function (dataIndex, multipleSeries, dataType) { // dataType === 'node' or empty do not show tooltip by default if (dataType === 'edge') { var params = this.getDataParams(dataIndex, dataType); var rawDataOpt = params.data; var html = rawDataOpt.source + ' -- ' + rawDataOpt.target; if (params.value) { html += ' : ' + params.value; } return encodeHTML(html); } return SankeySeries.superCall(this, 'formatTooltip', dataIndex, multipleSeries); }, defaultOption: { zlevel: 0, z: 2, coordinateSystem: 'view', layout: null, // the position of the whole view left: '5%', top: '5%', right: '20%', bottom: '5%', // the dx of the node nodeWidth: 20, // the vertical distance between two nodes nodeGap: 8, // control if the node can move or not draggable: true, // the number of iterations to change the position of the node layoutIterations: 32, label: { show: true, position: 'right', color: '#000', fontSize: 12 }, itemStyle: { borderWidth: 1, borderColor: '#333' }, lineStyle: { color: '#314656', opacity: 0.2, curveness: 0.5 }, emphasis: { label: { show: true }, lineStyle: { opacity: 0.6 } }, animationEasing: 'linear', animationDuration: 1000 } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file The file used to draw sankey view * @author Deqing Li(annong035@gmail.com) */ var SankeyShape = extendShape({ shape: { x1: 0, y1: 0, x2: 0, y2: 0, cpx1: 0, cpy1: 0, cpx2: 0, cpy2: 0, extent: 0 }, buildPath: function (ctx, shape) { var halfExtent = shape.extent / 2; ctx.moveTo(shape.x1, shape.y1 - halfExtent); ctx.bezierCurveTo( shape.cpx1, shape.cpy1 - halfExtent, shape.cpx2, shape.cpy2 - halfExtent, shape.x2, shape.y2 - halfExtent ); ctx.lineTo(shape.x2, shape.y2 + halfExtent); ctx.bezierCurveTo( shape.cpx2, shape.cpy2 + halfExtent, shape.cpx1, shape.cpy1 + halfExtent, shape.x1, shape.y1 + halfExtent ); ctx.closePath(); } }); extendChartView({ type: 'sankey', /** * @private * @type {module:echarts/chart/sankey/SankeySeries} */ _model: null, render: function (seriesModel, ecModel, api) { var graph = seriesModel.getGraph(); var group = this.group; var layoutInfo = seriesModel.layoutInfo; // view width var width = layoutInfo.width; // view height var height = layoutInfo.height; var nodeData = seriesModel.getData(); var edgeData = seriesModel.getData('edge'); this._model = seriesModel; group.removeAll(); group.attr('position', [layoutInfo.x, layoutInfo.y]); // generate a bezire Curve for each edge graph.eachEdge(function (edge) { var curve = new SankeyShape(); curve.dataIndex = edge.dataIndex; curve.seriesIndex = seriesModel.seriesIndex; curve.dataType = 'edge'; var lineStyleModel = edge.getModel('lineStyle'); var curvature = lineStyleModel.get('curveness'); var n1Layout = edge.node1.getLayout(); var node1Model =edge.node1.getModel(); var dragX1 = node1Model.get('localX'); var dragY1 = node1Model.get('localY'); var n2Layout = edge.node2.getLayout(); var node2Model = edge.node2.getModel(); var dragX2 = node2Model.get('localX'); var dragY2 = node2Model.get('localY'); var edgeLayout = edge.getLayout(); curve.shape.extent = Math.max(1, edgeLayout.dy); var x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx; var y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy + edgeLayout.dy / 2; var x2 = dragX2 != null ? dragX2 * width : n2Layout.x; var y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty + edgeLayout.dy / 2; var cpx1 = x1 * (1 - curvature) + x2 * curvature; var cpy1 = y1; var cpx2 = x1 * curvature + x2 * (1 - curvature); var cpy2 = y2; curve.setShape({ x1: x1, y1: y1, x2: x2, y2: y2, cpx1: cpx1, cpy1: cpy1, cpx2: cpx2, cpy2: cpy2 }); curve.setStyle(lineStyleModel.getItemStyle()); // Special color, use source node color or target node color switch (curve.style.fill) { case 'source': curve.style.fill = edge.node1.getVisual('color'); break; case 'target': curve.style.fill = edge.node2.getVisual('color'); break; } setHoverStyle(curve, edge.getModel('emphasis.lineStyle').getItemStyle()); group.add(curve); edgeData.setItemGraphicEl(edge.dataIndex, curve); }); // generate a rect for each node graph.eachNode(function (node) { var layout = node.getLayout(); var itemModel = node.getModel(); var dragX = itemModel.get('localX'); var dragY = itemModel.get('localY'); var labelModel = itemModel.getModel('label'); var labelHoverModel = itemModel.getModel('emphasis.label'); var rect = new Rect({ shape: { x: dragX != null ? dragX * width : layout.x, y: dragY != null ? dragY * height : layout.y, width: layout.dx, height: layout.dy }, style: itemModel.getModel('itemStyle').getItemStyle() }); var hoverStyle = node.getModel('emphasis.itemStyle').getItemStyle(); setLabelStyle( rect.style, hoverStyle, labelModel, labelHoverModel, { labelFetcher: seriesModel, labelDataIndex: node.dataIndex, defaultText: node.id, isRectText: true } ); rect.setStyle('fill', node.getVisual('color')); setHoverStyle(rect, hoverStyle); group.add(rect); nodeData.setItemGraphicEl(node.dataIndex, rect); rect.dataType = 'node'; }); var draggable = seriesModel.get('draggable'); if (draggable) { nodeData.eachItemGraphicEl(function (el, dataIndex) { el.drift = function (dx, dy) { this.shape.x += dx; this.shape.y += dy; this.dirty(); api.dispatchAction({ type: 'dragNode', seriesId: seriesModel.id, dataIndex: nodeData.getRawIndex(dataIndex), localX: this.shape.x / width, localY: this.shape.y / height }); }; el.draggable = true; el.cursor = 'move'; }); } if (!this._data && seriesModel.get('animation')) { group.setClipPath(createGridClipShape$2(group.getBoundingRect(), seriesModel, function () { group.removeClipPath(); })); } this._data = seriesModel.getData(); }, dispose: function () {} }); // add animation to the view function createGridClipShape$2(rect, seriesModel, cb) { var rectEl = new Rect({ shape: { x: rect.x - 10, y: rect.y - 10, width: 0, height: rect.height + 20 } }); initProps(rectEl, { shape: { width: rect.width + 20, height: rect.height + 20 } }, seriesModel, cb); return rectEl; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerAction({ type: 'dragNode', event: 'dragNode', // here can only use 'update' now, other value is not support in echarts. update: 'update' }, function (payload, ecModel) { ecModel.eachComponent({mainType: 'series', subType: 'sankey', query: payload}, function (seriesModel) { seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]); }); }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * The implementation references to d3.js. The use of the source * code of this file is also subject to the terms and consitions * of its license (BSD-3Clause, see ). */ /** * nest helper used to group by the array. * can specified the keys and sort the keys. */ function nest() { var keysFunction = []; var sortKeysFunction = []; /** * map an Array into the mapObject. * @param {Array} array * @param {number} depth */ function map$$1(array, depth) { if (depth >= keysFunction.length) { return array; } var i = -1; var n = array.length; var keyFunction = keysFunction[depth++]; var mapObject = {}; var valuesByKey = {}; while (++i < n) { var keyValue = keyFunction(array[i]); var values = valuesByKey[keyValue]; if (values) { values.push(array[i]); } else { valuesByKey[keyValue] = [array[i]]; } } each$1(valuesByKey, function (value, key) { mapObject[key] = map$$1(value, depth); }); return mapObject; } /** * transform the Map Object to multidimensional Array * @param {Object} map * @param {number} depth */ function entriesMap(mapObject, depth) { if (depth >= keysFunction.length) { return mapObject; } var array = []; var sortKeyFunction = sortKeysFunction[depth++]; each$1(mapObject, function (value, key) { array.push({ key: key, values: entriesMap(value, depth) }); }); if (sortKeyFunction) { return array.sort(function (a, b) { return sortKeyFunction(a.key, b.key); }); } else { return array; } } return { /** * specified the key to groupby the arrays. * users can specified one more keys. * @param {Function} d */ key: function (d) { keysFunction.push(d); return this; }, /** * specified the comparator to sort the keys * @param {Function} order */ sortKeys: function (order) { sortKeysFunction[keysFunction.length - 1] = order; return this; }, /** * the array to be grouped by. * @param {Array} array */ entries: function (array) { return entriesMap(map$$1(array, 0), 0); } }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file The layout algorithm of sankey view * @author Deqing Li(annong035@gmail.com) */ var sankeyLayout = function (ecModel, api, payload) { ecModel.eachSeriesByType('sankey', function (seriesModel) { var nodeWidth = seriesModel.get('nodeWidth'); var nodeGap = seriesModel.get('nodeGap'); var layoutInfo = getViewRect$3(seriesModel, api); seriesModel.layoutInfo = layoutInfo; var width = layoutInfo.width; var height = layoutInfo.height; var graph = seriesModel.getGraph(); var nodes = graph.nodes; var edges = graph.edges; computeNodeValues(nodes); var filteredNodes = filter(nodes, function (node) { return node.getLayout().value === 0; }); var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations'); layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations); }); }; /** * Get the layout position of the whole view * * @param {module:echarts/model/Series} seriesModel the model object of sankey series * @param {module:echarts/ExtensionAPI} api provide the API list that the developer can call * @return {module:zrender/core/BoundingRect} size of rect to draw the sankey view */ function getViewRect$3(seriesModel, api) { return getLayoutRect( seriesModel.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() } ); } function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations) { computeNodeBreadths(nodes, edges, nodeWidth, width); computeNodeDepths(nodes, edges, height, nodeGap, iterations); computeEdgeDepths(nodes); } /** * Compute the value of each node by summing the associated edge's value * * @param {module:echarts/data/Graph~Node} nodes node of sankey view */ function computeNodeValues(nodes) { each$1(nodes, function (node) { var value1 = sum(node.outEdges, getEdgeValue); var value2 = sum(node.inEdges, getEdgeValue); var value = Math.max(value1, value2); node.setLayout({value: value}, true); }); } /** * Compute the x-position for each node. * * Here we use Kahn algorithm to detect cycle when we traverse * the node to computer the initial x position. * * @param {module:echarts/data/Graph~Node} nodes node of sankey view * @param {number} nodeWidth the dx of the node * @param {number} width the whole width of the area to draw the view */ function computeNodeBreadths(nodes, edges, nodeWidth, width) { // Used to mark whether the edge is deleted. if it is deleted, // the value is 0, otherwise it is 1. var remainEdges = []; // Storage each node's indegree. var indegreeArr = []; //Used to storage the node with indegree is equal to 0. var zeroIndegrees = []; var nextNode = []; var x = 0; var kx = 0; for (var i = 0; i < edges.length; i++) { remainEdges[i] = 1; } for (var i = 0; i < nodes.length; i++) { indegreeArr[i] = nodes[i].inEdges.length; if (indegreeArr[i] === 0) { zeroIndegrees.push(nodes[i]); } } while (zeroIndegrees.length) { each$1(zeroIndegrees, function (node) { node.setLayout({x: x}, true); node.setLayout({dx: nodeWidth}, true); each$1(node.outEdges, function (edge) { var indexEdge = edges.indexOf(edge); remainEdges[indexEdge] = 0; var targetNode = edge.node2; var nodeIndex = nodes.indexOf(targetNode); if (--indegreeArr[nodeIndex] === 0) { nextNode.push(targetNode); } }); }); ++x; zeroIndegrees = nextNode; nextNode = []; } for (var i = 0; i < remainEdges.length; i++) { if (__DEV__) { if (remainEdges[i] === 1) { throw new Error('Sankey is a DAG, the original data has cycle!'); } } } moveSinksRight(nodes, x); kx = (width - nodeWidth) / (x - 1); scaleNodeBreadths(nodes, kx); } /** * All the node without outEgdes are assigned maximum x-position and * be aligned in the last column. * * @param {module:echarts/data/Graph~Node} nodes node of sankey view * @param {number} x value (x-1) use to assign to node without outEdges * as x-position */ function moveSinksRight(nodes, x) { each$1(nodes, function (node) { if (!node.outEdges.length) { node.setLayout({x: x - 1}, true); } }); } /** * Scale node x-position to the width * * @param {module:echarts/data/Graph~Node} nodes node of sankey view * @param {number} kx multiple used to scale nodes */ function scaleNodeBreadths(nodes, kx) { each$1(nodes, function (node) { var nodeX = node.getLayout().x * kx; node.setLayout({x: nodeX}, true); }); } /** * Using Gauss-Seidel iterations method to compute the node depth(y-position) * * @param {module:echarts/data/Graph~Node} nodes node of sankey view * @param {module:echarts/data/Graph~Edge} edges edge of sankey view * @param {number} height the whole height of the area to draw the view * @param {number} nodeGap the vertical distance between two nodes * in the same column. * @param {number} iterations the number of iterations for the algorithm */ function computeNodeDepths(nodes, edges, height, nodeGap, iterations) { var nodesByBreadth = nest() .key(function (d) { return d.getLayout().x; }) .sortKeys(ascending) .entries(nodes) .map(function (d) { return d.values; }); initializeNodeDepth(nodes, nodesByBreadth, edges, height, nodeGap); resolveCollisions(nodesByBreadth, nodeGap, height); for (var alpha = 1; iterations > 0; iterations--) { // 0.99 is a experience parameter, ensure that each iterations of // changes as small as possible. alpha *= 0.99; relaxRightToLeft(nodesByBreadth, alpha); resolveCollisions(nodesByBreadth, nodeGap, height); relaxLeftToRight(nodesByBreadth, alpha); resolveCollisions(nodesByBreadth, nodeGap, height); } } /** * Compute the original y-position for each node * * @param {module:echarts/data/Graph~Node} nodes node of sankey view * @param {Array.>} nodesByBreadth * group by the array of all sankey nodes based on the nodes x-position. * @param {module:echarts/data/Graph~Edge} edges edge of sankey view * @param {number} height the whole height of the area to draw the view * @param {number} nodeGap the vertical distance between two nodes */ function initializeNodeDepth(nodes, nodesByBreadth, edges, height, nodeGap) { var kyArray = []; each$1(nodesByBreadth, function (nodes) { var n = nodes.length; var sum = 0; each$1(nodes, function (node) { sum += node.getLayout().value; }); var ky = (height - (n - 1) * nodeGap) / sum; kyArray.push(ky); }); kyArray.sort(function (a, b) { return a - b; }); var ky0 = kyArray[0]; each$1(nodesByBreadth, function (nodes) { each$1(nodes, function (node, i) { node.setLayout({y: i}, true); var nodeDy = node.getLayout().value * ky0; node.setLayout({dy: nodeDy}, true); }); }); each$1(edges, function (edge) { var edgeDy = +edge.getValue() * ky0; edge.setLayout({dy: edgeDy}, true); }); } /** * Resolve the collision of initialized depth (y-position) * * @param {Array.>} nodesByBreadth * group by the array of all sankey nodes based on the nodes x-position. * @param {number} nodeGap the vertical distance between two nodes * @param {number} height the whole height of the area to draw the view */ function resolveCollisions(nodesByBreadth, nodeGap, height) { each$1(nodesByBreadth, function (nodes) { var node; var dy; var y0 = 0; var n = nodes.length; var i; nodes.sort(ascendingDepth); for (i = 0; i < n; i++) { node = nodes[i]; dy = y0 - node.getLayout().y; if (dy > 0) { var nodeY = node.getLayout().y + dy; node.setLayout({y: nodeY}, true); } y0 = node.getLayout().y + node.getLayout().dy + nodeGap; } // If the bottommost node goes outside the bounds, push it back up dy = y0 - nodeGap - height; if (dy > 0) { var nodeY = node.getLayout().y - dy; node.setLayout({y: nodeY}, true); y0 = node.getLayout().y; for (i = n - 2; i >= 0; --i) { node = nodes[i]; dy = node.getLayout().y + node.getLayout().dy + nodeGap - y0; if (dy > 0) { nodeY = node.getLayout().y - dy; node.setLayout({y: nodeY}, true); } y0 = node.getLayout().y; } } }); } /** * Change the y-position of the nodes, except most the right side nodes * * @param {Array.>} nodesByBreadth * group by the array of all sankey nodes based on the node x-position. * @param {number} alpha parameter used to adjust the nodes y-position */ function relaxRightToLeft(nodesByBreadth, alpha) { each$1(nodesByBreadth.slice().reverse(), function (nodes) { each$1(nodes, function (node) { if (node.outEdges.length) { var y = sum(node.outEdges, weightedTarget) / sum(node.outEdges, getEdgeValue); var nodeY = node.getLayout().y + (y - center$1(node)) * alpha; node.setLayout({y: nodeY}, true); } }); }); } function weightedTarget(edge) { return center$1(edge.node2) * edge.getValue(); } /** * Change the y-position of the nodes, except most the left side nodes * * @param {Array.>} nodesByBreadth * group by the array of all sankey nodes based on the node x-position. * @param {number} alpha parameter used to adjust the nodes y-position */ function relaxLeftToRight(nodesByBreadth, alpha) { each$1(nodesByBreadth, function (nodes) { each$1(nodes, function (node) { if (node.inEdges.length) { var y = sum(node.inEdges, weightedSource) / sum(node.inEdges, getEdgeValue); var nodeY = node.getLayout().y + (y - center$1(node)) * alpha; node.setLayout({y: nodeY}, true); } }); }); } function weightedSource(edge) { return center$1(edge.node1) * edge.getValue(); } /** * Compute the depth(y-position) of each edge * * @param {module:echarts/data/Graph~Node} nodes node of sankey view */ function computeEdgeDepths(nodes) { each$1(nodes, function (node) { node.outEdges.sort(ascendingTargetDepth); node.inEdges.sort(ascendingSourceDepth); }); each$1(nodes, function (node) { var sy = 0; var ty = 0; each$1(node.outEdges, function (edge) { edge.setLayout({sy: sy}, true); sy += edge.getLayout().dy; }); each$1(node.inEdges, function (edge) { edge.setLayout({ty: ty}, true); ty += edge.getLayout().dy; }); }); } function ascendingTargetDepth(a, b) { return a.node2.getLayout().y - b.node2.getLayout().y; } function ascendingSourceDepth(a, b) { return a.node1.getLayout().y - b.node1.getLayout().y; } function sum(array, f) { var sum = 0; var len = array.length; var i = -1; while (++i < len) { var value = +f.call(array, array[i], i); if (!isNaN(value)) { sum += value; } } return sum; } function center$1(node) { return node.getLayout().y + node.getLayout().dy / 2; } function ascendingDepth(a, b) { return a.getLayout().y - b.getLayout().y; } function ascending(a, b) { return a - b; } function getEdgeValue(edge) { return edge.getValue(); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file Visual encoding for sankey view * @author Deqing Li(annong035@gmail.com) */ var sankeyVisual = function (ecModel, payload) { ecModel.eachSeriesByType('sankey', function (seriesModel) { var graph = seriesModel.getGraph(); var nodes = graph.nodes; if (nodes.length) { var minValue = Infinity; var maxValue = -Infinity; each$1(nodes, function (node) { var nodeValue = node.getLayout().value; if (nodeValue < minValue) { minValue = nodeValue; } if (nodeValue > maxValue) { maxValue = nodeValue; } }); each$1(nodes, function (node) { var mapping = new VisualMapping({ type: 'color', mappingMethod: 'linear', dataExtent: [minValue, maxValue], visual: seriesModel.get('color') }); var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value); node.setVisual('color', mapValueToColor); // If set itemStyle.normal.color var itemModel = node.getModel(); var customColor = itemModel.get('itemStyle.color'); if (customColor != null) { node.setVisual('color', customColor); } }); } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerLayout(sankeyLayout); registerVisual(sankeyVisual); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var seriesModelMixin = { /** * @private * @type {string} */ _baseAxisDim: null, /** * @override */ getInitialData: function (option, ecModel) { // When both types of xAxis and yAxis are 'value', layout is // needed to be specified by user. Otherwise, layout can be // judged by which axis is category. var ordinalMeta; var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex')); var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex')); var xAxisType = xAxisModel.get('type'); var yAxisType = yAxisModel.get('type'); var addOrdinal; // FIXME // 考虑时间轴 if (xAxisType === 'category') { option.layout = 'horizontal'; ordinalMeta = xAxisModel.getOrdinalMeta(); addOrdinal = true; } else if (yAxisType === 'category') { option.layout = 'vertical'; ordinalMeta = yAxisModel.getOrdinalMeta(); addOrdinal = true; } else { option.layout = option.layout || 'horizontal'; } var coordDims = ['x', 'y']; var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1; var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex]; var otherAxisDim = coordDims[1 - baseAxisDimIndex]; var axisModels = [xAxisModel, yAxisModel]; var baseAxisType = axisModels[baseAxisDimIndex].get('type'); var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type'); var data = option.data; // ??? FIXME make a stage to perform data transfrom. // MUST create a new data, consider setOption({}) again. if (data && addOrdinal) { var newOptionData = []; each$1(data, function (item, index) { var newItem; if (item.value && isArray(item.value)) { newItem = item.value.slice(); item.value.unshift(index); } else if (isArray(item)) { newItem = item.slice(); item.unshift(index); } else { newItem = item; } newOptionData.push(newItem); }); option.data = newOptionData; } var defaultValueDimensions = this.defaultValueDimensions; return createListSimply( this, { coordDimensions: [{ name: baseAxisDim, type: getDimensionTypeByAxis(baseAxisType), ordinalMeta: ordinalMeta, otherDims: { tooltip: false, itemName: 0 }, dimsDef: ['base'] }, { name: otherAxisDim, type: getDimensionTypeByAxis(otherAxisType), dimsDef: defaultValueDimensions.slice() }], dimensionsCount: defaultValueDimensions.length + 1 } ); }, /** * If horizontal, base axis is x, otherwise y. * @override */ getBaseAxis: function () { var dim = this._baseAxisDim; return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var BoxplotSeries = SeriesModel.extend({ type: 'series.boxplot', dependencies: ['xAxis', 'yAxis', 'grid'], // TODO // box width represents group size, so dimension should have 'size'. /** * @see * The meanings of 'min' and 'max' depend on user, * and echarts do not need to know it. * @readOnly */ defaultValueDimensions: [ {name: 'min', defaultTooltip: true}, {name: 'Q1', defaultTooltip: true}, {name: 'median', defaultTooltip: true}, {name: 'Q3', defaultTooltip: true}, {name: 'max', defaultTooltip: true} ], /** * @type {Array.} * @readOnly */ dimensions: null, /** * @override */ defaultOption: { zlevel: 0, // 一级层叠 z: 2, // 二级层叠 coordinateSystem: 'cartesian2d', legendHoverLink: true, hoverAnimation: true, // xAxisIndex: 0, // yAxisIndex: 0, layout: null, // 'horizontal' or 'vertical' boxWidth: [7, 50], // [min, max] can be percent of band width. itemStyle: { color: '#fff', borderWidth: 1 }, emphasis: { itemStyle: { borderWidth: 2, shadowBlur: 5, shadowOffsetX: 2, shadowOffsetY: 2, shadowColor: 'rgba(0,0,0,0.4)' } }, animationEasing: 'elasticOut', animationDuration: 800 } }); mixin(BoxplotSeries, seriesModelMixin, true); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Update common properties var NORMAL_ITEM_STYLE_PATH = ['itemStyle']; var EMPHASIS_ITEM_STYLE_PATH = ['emphasis', 'itemStyle']; var BoxplotView = Chart.extend({ type: 'boxplot', render: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var group = this.group; var oldData = this._data; // There is no old data only when first rendering or switching from // stream mode to normal mode, where previous elements should be removed. if (!this._data) { group.removeAll(); } var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0; data.diff(oldData) .add(function (newIdx) { if (data.hasValue(newIdx)) { var itemLayout = data.getItemLayout(newIdx); var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true); data.setItemGraphicEl(newIdx, symbolEl); group.add(symbolEl); } }) .update(function (newIdx, oldIdx) { var symbolEl = oldData.getItemGraphicEl(oldIdx); // Empty data if (!data.hasValue(newIdx)) { group.remove(symbolEl); return; } var itemLayout = data.getItemLayout(newIdx); if (!symbolEl) { symbolEl = createNormalBox(itemLayout, data, newIdx, constDim); } else { updateNormalBoxData(itemLayout, symbolEl, data, newIdx); } group.add(symbolEl); data.setItemGraphicEl(newIdx, symbolEl); }) .remove(function (oldIdx) { var el = oldData.getItemGraphicEl(oldIdx); el && group.remove(el); }) .execute(); this._data = data; }, remove: function (ecModel) { var group = this.group; var data = this._data; this._data = null; data && data.eachItemGraphicEl(function (el) { el && group.remove(el); }); }, dispose: noop }); var BoxPath = Path.extend({ type: 'boxplotBoxPath', shape: {}, buildPath: function (ctx, shape) { var ends = shape.points; var i = 0; ctx.moveTo(ends[i][0], ends[i][1]); i++; for (; i < 4; i++) { ctx.lineTo(ends[i][0], ends[i][1]); } ctx.closePath(); for (; i < ends.length; i++) { ctx.moveTo(ends[i][0], ends[i][1]); i++; ctx.lineTo(ends[i][0], ends[i][1]); } } }); function createNormalBox(itemLayout, data, dataIndex, constDim, isInit) { var ends = itemLayout.ends; var el = new BoxPath({ shape: { points: isInit ? transInit(ends, constDim, itemLayout) : ends } }); updateNormalBoxData(itemLayout, el, data, dataIndex, isInit); return el; } function updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) { var seriesModel = data.hostModel; var updateMethod = graphic[isInit ? 'initProps' : 'updateProps']; updateMethod( el, {shape: {points: itemLayout.ends}}, seriesModel, dataIndex ); var itemModel = data.getItemModel(dataIndex); var normalItemStyleModel = itemModel.getModel(NORMAL_ITEM_STYLE_PATH); var borderColor = data.getItemVisual(dataIndex, 'color'); // Exclude borderColor. var itemStyle = normalItemStyleModel.getItemStyle(['borderColor']); itemStyle.stroke = borderColor; itemStyle.strokeNoScale = true; el.useStyle(itemStyle); el.z2 = 100; var hoverStyle = itemModel.getModel(EMPHASIS_ITEM_STYLE_PATH).getItemStyle(); setHoverStyle(el, hoverStyle); } function transInit(points, dim, itemLayout) { return map(points, function (point) { point = point.slice(); point[dim] = itemLayout.initBaseline; return point; }); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var borderColorQuery = ['itemStyle', 'borderColor']; var boxplotVisual = function (ecModel, api) { var globalColors = ecModel.get('color'); ecModel.eachRawSeriesByType('boxplot', function (seriesModel) { var defaulColor = globalColors[seriesModel.seriesIndex % globalColors.length]; var data = seriesModel.getData(); data.setVisual({ legendSymbol: 'roundRect', // Use name 'color' but not 'borderColor' for legend usage and // visual coding from other component like dataRange. color: seriesModel.get(borderColorQuery) || defaulColor }); // Only visible series has each data be visual encoded if (!ecModel.isSeriesFiltered(seriesModel)) { data.each(function (idx) { var itemModel = data.getItemModel(idx); data.setItemVisual( idx, {color: itemModel.get(borderColorQuery, true)} ); }); } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$13 = each$1; var boxplotLayout = function (ecModel) { var groupResult = groupSeriesByAxis(ecModel); each$13(groupResult, function (groupItem) { var seriesModels = groupItem.seriesModels; if (!seriesModels.length) { return; } calculateBase(groupItem); each$13(seriesModels, function (seriesModel, idx) { layoutSingleSeries( seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx] ); }); }); }; /** * Group series by axis. */ function groupSeriesByAxis(ecModel) { var result = []; var axisList = []; ecModel.eachSeriesByType('boxplot', function (seriesModel) { var baseAxis = seriesModel.getBaseAxis(); var idx = indexOf(axisList, baseAxis); if (idx < 0) { idx = axisList.length; axisList[idx] = baseAxis; result[idx] = {axis: baseAxis, seriesModels: []}; } result[idx].seriesModels.push(seriesModel); }); return result; } /** * Calculate offset and box width for each series. */ function calculateBase(groupItem) { var extent; var baseAxis = groupItem.axis; var seriesModels = groupItem.seriesModels; var seriesCount = seriesModels.length; var boxWidthList = groupItem.boxWidthList = []; var boxOffsetList = groupItem.boxOffsetList = []; var boundList = []; var bandWidth; if (baseAxis.type === 'category') { bandWidth = baseAxis.getBandWidth(); } else { var maxDataCount = 0; each$13(seriesModels, function (seriesModel) { maxDataCount = Math.max(maxDataCount, seriesModel.getData().count()); }); extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount; } each$13(seriesModels, function (seriesModel) { var boxWidthBound = seriesModel.get('boxWidth'); if (!isArray(boxWidthBound)) { boxWidthBound = [boxWidthBound, boxWidthBound]; } boundList.push([ parsePercent$1(boxWidthBound[0], bandWidth) || 0, parsePercent$1(boxWidthBound[1], bandWidth) || 0 ]); }); var availableWidth = bandWidth * 0.8 - 2; var boxGap = availableWidth / seriesCount * 0.3; var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount; var base = boxWidth / 2 - availableWidth / 2; each$13(seriesModels, function (seriesModel, idx) { boxOffsetList.push(base); base += boxGap + boxWidth; boxWidthList.push( Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]) ); }); } /** * Calculate points location for each series. */ function layoutSingleSeries(seriesModel, offset, boxWidth) { var coordSys = seriesModel.coordinateSystem; var data = seriesModel.getData(); var halfWidth = boxWidth / 2; var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1; var vDimIdx = 1 - cDimIdx; var coordDims = ['x', 'y']; var cDim = data.mapDimension(coordDims[cDimIdx]); var vDims = data.mapDimension(coordDims[vDimIdx], true); if (cDim == null || vDims.length < 5) { return; } for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) { var axisDimVal = data.get(cDim, dataIndex); var median = getPoint(axisDimVal, vDims[2], dataIndex); var end1 = getPoint(axisDimVal, vDims[0], dataIndex); var end2 = getPoint(axisDimVal, vDims[1], dataIndex); var end4 = getPoint(axisDimVal, vDims[3], dataIndex); var end5 = getPoint(axisDimVal, vDims[4], dataIndex); var ends = []; addBodyEnd(ends, end2, 0); addBodyEnd(ends, end4, 1); ends.push(end1, end2, end5, end4); layEndLine(ends, end1); layEndLine(ends, end5); layEndLine(ends, median); data.setItemLayout(dataIndex, { initBaseline: median[vDimIdx], ends: ends }); } function getPoint(axisDimVal, dimIdx, dataIndex) { var val = data.get(dimIdx, dataIndex); var p = []; p[cDimIdx] = axisDimVal; p[vDimIdx] = val; var point; if (isNaN(axisDimVal) || isNaN(val)) { point = [NaN, NaN]; } else { point = coordSys.dataToPoint(p); point[cDimIdx] += offset; } return point; } function addBodyEnd(ends, point, start) { var point1 = point.slice(); var point2 = point.slice(); point1[cDimIdx] += halfWidth; point2[cDimIdx] -= halfWidth; start ? ends.push(point1, point2) : ends.push(point2, point1); } function layEndLine(ends, endCenter) { var from = endCenter.slice(); var to = endCenter.slice(); from[cDimIdx] -= halfWidth; to[cDimIdx] += halfWidth; ends.push(from, to); } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerVisual(boxplotVisual); registerLayout(boxplotLayout); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var CandlestickSeries = SeriesModel.extend({ type: 'series.candlestick', dependencies: ['xAxis', 'yAxis', 'grid'], /** * @readOnly */ defaultValueDimensions: [ {name: 'open', defaultTooltip: true}, {name: 'close', defaultTooltip: true}, {name: 'lowest', defaultTooltip: true}, {name: 'highest', defaultTooltip: true} ], /** * @type {Array.} * @readOnly */ dimensions: null, /** * @override */ defaultOption: { zlevel: 0, z: 2, coordinateSystem: 'cartesian2d', legendHoverLink: true, hoverAnimation: true, // xAxisIndex: 0, // yAxisIndex: 0, layout: null, // 'horizontal' or 'vertical' itemStyle: { color: '#c23531', // 阳线 positive color0: '#314656', // 阴线 negative '#c23531', '#314656' borderWidth: 1, // FIXME // ec2中使用的是lineStyle.color 和 lineStyle.color0 borderColor: '#c23531', borderColor0: '#314656' }, emphasis: { itemStyle: { borderWidth: 2 } }, barMaxWidth: null, barMinWidth: null, barWidth: null, large: true, largeThreshold: 600, progressive: 3e3, progressiveThreshold: 1e4, progressiveChunkMode: 'mod', animationUpdate: false, animationEasing: 'linear', animationDuration: 300 }, /** * Get dimension for shadow in dataZoom * @return {string} dimension name */ getShadowDim: function () { return 'open'; }, brushSelector: function (dataIndex, data, selectors) { var itemLayout = data.getItemLayout(dataIndex); return itemLayout && selectors.rect(itemLayout.brushRect); } }); mixin(CandlestickSeries, seriesModelMixin, true); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var NORMAL_ITEM_STYLE_PATH$1 = ['itemStyle']; var EMPHASIS_ITEM_STYLE_PATH$1 = ['emphasis', 'itemStyle']; var SKIP_PROPS = ['color', 'color0', 'borderColor', 'borderColor0']; var CandlestickView = Chart.extend({ type: 'candlestick', render: function (seriesModel, ecModel, api) { this._updateDrawMode(seriesModel); this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel); }, incrementalPrepareRender: function (seriesModel, ecModel, api) { this._clear(); this._updateDrawMode(seriesModel); }, incrementalRender: function (params, seriesModel, ecModel, api) { this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel); }, _updateDrawMode: function (seriesModel) { var isLargeDraw = seriesModel.pipelineContext.large; if (this._isLargeDraw == null || isLargeDraw ^ this._isLargeDraw) { this._isLargeDraw = isLargeDraw; this._clear(); } }, _renderNormal: function (seriesModel) { var data = seriesModel.getData(); var oldData = this._data; var group = this.group; var isSimpleBox = data.getLayout('isSimpleBox'); // There is no old data only when first rendering or switching from // stream mode to normal mode, where previous elements should be removed. if (!this._data) { group.removeAll(); } data.diff(oldData) .add(function (newIdx) { if (data.hasValue(newIdx)) { var el; var itemLayout = data.getItemLayout(newIdx); el = createNormalBox$1(itemLayout, newIdx, true); initProps(el, {shape: {points: itemLayout.ends}}, seriesModel, newIdx); setBoxCommon(el, data, newIdx, isSimpleBox); group.add(el); data.setItemGraphicEl(newIdx, el); } }) .update(function (newIdx, oldIdx) { var el = oldData.getItemGraphicEl(oldIdx); // Empty data if (!data.hasValue(newIdx)) { group.remove(el); return; } var itemLayout = data.getItemLayout(newIdx); if (!el) { el = createNormalBox$1(itemLayout, newIdx); } else { updateProps(el, {shape: {points: itemLayout.ends}}, seriesModel, newIdx); } setBoxCommon(el, data, newIdx, isSimpleBox); group.add(el); data.setItemGraphicEl(newIdx, el); }) .remove(function (oldIdx) { var el = oldData.getItemGraphicEl(oldIdx); el && group.remove(el); }) .execute(); this._data = data; }, _renderLarge: function (seriesModel) { this._clear(); createLarge$1(seriesModel, this.group); }, _incrementalRenderNormal: function (params, seriesModel) { var data = seriesModel.getData(); var isSimpleBox = data.getLayout('isSimpleBox'); var dataIndex; while ((dataIndex = params.next()) != null) { var el; var itemLayout = data.getItemLayout(dataIndex); el = createNormalBox$1(itemLayout, dataIndex); setBoxCommon(el, data, dataIndex, isSimpleBox); el.incremental = true; this.group.add(el); } }, _incrementalRenderLarge: function (params, seriesModel) { createLarge$1(seriesModel, this.group, true); }, remove: function (ecModel) { this._clear(); }, _clear: function () { this.group.removeAll(); this._data = null; }, dispose: noop }); var NormalBoxPath = Path.extend({ type: 'normalCandlestickBox', shape: {}, buildPath: function (ctx, shape) { var ends = shape.points; if (this.__simpleBox) { ctx.moveTo(ends[4][0], ends[4][1]); ctx.lineTo(ends[6][0], ends[6][1]); } else { ctx.moveTo(ends[0][0], ends[0][1]); ctx.lineTo(ends[1][0], ends[1][1]); ctx.lineTo(ends[2][0], ends[2][1]); ctx.lineTo(ends[3][0], ends[3][1]); ctx.closePath(); ctx.moveTo(ends[4][0], ends[4][1]); ctx.lineTo(ends[5][0], ends[5][1]); ctx.moveTo(ends[6][0], ends[6][1]); ctx.lineTo(ends[7][0], ends[7][1]); } } }); function createNormalBox$1(itemLayout, dataIndex, isInit) { var ends = itemLayout.ends; return new NormalBoxPath({ shape: { points: isInit ? transInit$1(ends, itemLayout) : ends }, z2: 100 }); } function setBoxCommon(el, data, dataIndex, isSimpleBox) { var itemModel = data.getItemModel(dataIndex); var normalItemStyleModel = itemModel.getModel(NORMAL_ITEM_STYLE_PATH$1); var color = data.getItemVisual(dataIndex, 'color'); var borderColor = data.getItemVisual(dataIndex, 'borderColor') || color; // Color must be excluded. // Because symbol provide setColor individually to set fill and stroke var itemStyle = normalItemStyleModel.getItemStyle(SKIP_PROPS); el.useStyle(itemStyle); el.style.strokeNoScale = true; el.style.fill = color; el.style.stroke = borderColor; el.__simpleBox = isSimpleBox; var hoverStyle = itemModel.getModel(EMPHASIS_ITEM_STYLE_PATH$1).getItemStyle(); setHoverStyle(el, hoverStyle); } function transInit$1(points, itemLayout) { return map(points, function (point) { point = point.slice(); point[1] = itemLayout.initBaseline; return point; }); } var LargeBoxPath = Path.extend({ type: 'largeCandlestickBox', shape: {}, buildPath: function (ctx, shape) { // Drawing lines is more efficient than drawing // a whole line or drawing rects. var points = shape.points; for (var i = 0; i < points.length;) { if (this.__sign === points[i++]) { var x = points[i++]; ctx.moveTo(x, points[i++]); ctx.lineTo(x, points[i++]); } else { i += 3; } } } }); function createLarge$1(seriesModel, group, incremental) { var data = seriesModel.getData(); var largePoints = data.getLayout('largePoints'); var elP = new LargeBoxPath({ shape: {points: largePoints}, __sign: 1 }); group.add(elP); var elN = new LargeBoxPath({ shape: {points: largePoints}, __sign: -1 }); group.add(elN); setLargeStyle$1(1, elP, seriesModel, data); setLargeStyle$1(-1, elN, seriesModel, data); if (incremental) { elP.incremental = true; elN.incremental = true; } } function setLargeStyle$1(sign, el, seriesModel, data) { var suffix = sign > 0 ? 'P' : 'N'; var borderColor = data.getVisual('borderColor' + suffix) || data.getVisual('color' + suffix); // Color must be excluded. // Because symbol provide setColor individually to set fill and stroke var itemStyle = seriesModel.getModel(NORMAL_ITEM_STYLE_PATH$1).getItemStyle(SKIP_PROPS); el.useStyle(itemStyle); el.style.fill = null; el.style.stroke = borderColor; // No different // el.style.lineWidth = .5; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var preprocessor = function (option) { if (!option || !isArray(option.series)) { return; } // Translate 'k' to 'candlestick'. each$1(option.series, function (seriesItem) { if (isObject$1(seriesItem) && seriesItem.type === 'k') { seriesItem.type = 'candlestick'; } }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var positiveBorderColorQuery = ['itemStyle', 'borderColor']; var negativeBorderColorQuery = ['itemStyle', 'borderColor0']; var positiveColorQuery = ['itemStyle', 'color']; var negativeColorQuery = ['itemStyle', 'color0']; var candlestickVisual = { seriesType: 'candlestick', plan: createRenderPlanner(), // For legend. performRawSeries: true, reset: function (seriesModel, ecModel) { var data = seriesModel.getData(); var isLargeRender = seriesModel.pipelineContext.large; data.setVisual({ legendSymbol: 'roundRect', colorP: getColor(1, seriesModel), colorN: getColor(-1, seriesModel), borderColorP: getBorderColor(1, seriesModel), borderColorN: getBorderColor(-1, seriesModel) }); // Only visible series has each data be visual encoded if (ecModel.isSeriesFiltered(seriesModel)) { return; } return !isLargeRender && {progress: progress}; function progress(params, data) { var dataIndex; while ((dataIndex = params.next()) != null) { var itemModel = data.getItemModel(dataIndex); var sign = data.getItemLayout(dataIndex).sign; data.setItemVisual( dataIndex, { color: getColor(sign, itemModel), borderColor: getBorderColor(sign, itemModel) } ); } } function getColor(sign, model) { return model.get( sign > 0 ? positiveColorQuery : negativeColorQuery ); } function getBorderColor(sign, model) { return model.get( sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery ); } } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var LargeArr$1 = typeof Float32Array !== 'undefined' ? Float32Array : Array; var candlestickLayout = { seriesType: 'candlestick', plan: createRenderPlanner(), reset: function (seriesModel) { var coordSys = seriesModel.coordinateSystem; var data = seriesModel.getData(); var candleWidth = calculateCandleWidth(seriesModel, data); var cDimIdx = 0; var vDimIdx = 1; var coordDims = ['x', 'y']; var cDim = data.mapDimension(coordDims[cDimIdx]); var vDims = data.mapDimension(coordDims[vDimIdx], true); var openDim = vDims[0]; var closeDim = vDims[1]; var lowestDim = vDims[2]; var highestDim = vDims[3]; data.setLayout({ candleWidth: candleWidth, // The value is experimented visually. isSimpleBox: candleWidth <= 1.3 }); if (cDim == null || vDims.length < 4) { return; } return { progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress }; function normalProgress(params, data) { var dataIndex; while ((dataIndex = params.next()) != null) { var axisDimVal = data.get(cDim, dataIndex); var openVal = data.get(openDim, dataIndex); var closeVal = data.get(closeDim, dataIndex); var lowestVal = data.get(lowestDim, dataIndex); var highestVal = data.get(highestDim, dataIndex); var ocLow = Math.min(openVal, closeVal); var ocHigh = Math.max(openVal, closeVal); var ocLowPoint = getPoint(ocLow, axisDimVal); var ocHighPoint = getPoint(ocHigh, axisDimVal); var lowestPoint = getPoint(lowestVal, axisDimVal); var highestPoint = getPoint(highestVal, axisDimVal); var ends = []; addBodyEnd(ends, ocHighPoint, 0); addBodyEnd(ends, ocLowPoint, 1); ends.push( subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint) ); data.setItemLayout(dataIndex, { sign: getSign(data, dataIndex, openVal, closeVal, closeDim), initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx], // open point. ends: ends, brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal) }); } function getPoint(val, axisDimVal) { var p = []; p[cDimIdx] = axisDimVal; p[vDimIdx] = val; return (isNaN(axisDimVal) || isNaN(val)) ? [NaN, NaN] : coordSys.dataToPoint(p); } function addBodyEnd(ends, point, start) { var point1 = point.slice(); var point2 = point.slice(); point1[cDimIdx] = subPixelOptimize( point1[cDimIdx] + candleWidth / 2, 1, false ); point2[cDimIdx] = subPixelOptimize( point2[cDimIdx] - candleWidth / 2, 1, true ); start ? ends.push(point1, point2) : ends.push(point2, point1); } function makeBrushRect(lowestVal, highestVal, axisDimVal) { var pmin = getPoint(lowestVal, axisDimVal); var pmax = getPoint(highestVal, axisDimVal); pmin[cDimIdx] -= candleWidth / 2; pmax[cDimIdx] -= candleWidth / 2; return { x: pmin[0], y: pmin[1], width: vDimIdx ? candleWidth : pmax[0] - pmin[0], height: vDimIdx ? pmax[1] - pmin[1] : candleWidth }; } function subPixelOptimizePoint(point) { point[cDimIdx] = subPixelOptimize(point[cDimIdx], 1); return point; } } function largeProgress(params, data) { // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...] var points = new LargeArr$1(params.count * 5); var offset = 0; var point; var tmpIn = []; var tmpOut = []; var dataIndex; while ((dataIndex = params.next()) != null) { var axisDimVal = data.get(cDim, dataIndex); var openVal = data.get(openDim, dataIndex); var closeVal = data.get(closeDim, dataIndex); var lowestVal = data.get(lowestDim, dataIndex); var highestVal = data.get(highestDim, dataIndex); if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) { points[offset++] = NaN; offset += 4; continue; } points[offset++] = getSign(data, dataIndex, openVal, closeVal, closeDim); tmpIn[cDimIdx] = axisDimVal; tmpIn[vDimIdx] = lowestVal; point = coordSys.dataToPoint(tmpIn, null, tmpOut); points[offset++] = point ? point[0] : NaN; points[offset++] = point ? point[1] : NaN; tmpIn[vDimIdx] = highestVal; point = coordSys.dataToPoint(tmpIn, null, tmpOut); points[offset++] = point ? point[1] : NaN; } data.setLayout('largePoints', points); } } }; function getSign(data, dataIndex, openVal, closeVal, closeDim) { var sign; if (openVal > closeVal) { sign = -1; } else if (openVal < closeVal) { sign = 1; } else { sign = dataIndex > 0 // If close === open, compare with close of last record ? (data.get(closeDim, dataIndex - 1) <= closeVal ? 1 : -1) // No record of previous, set to be positive : 1; } return sign; } function calculateCandleWidth(seriesModel, data) { var baseAxis = seriesModel.getBaseAxis(); var extent; var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : ( extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / data.count() ); var barMaxWidth = parsePercent$1( retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth ); var barMinWidth = parsePercent$1( retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth ); var barWidth = seriesModel.get('barWidth'); return barWidth != null ? parsePercent$1(barWidth, bandWidth) // Put max outer to ensure bar visible in spite of overlap. : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerPreprocessor(preprocessor); registerVisual(candlestickVisual); registerLayout(candlestickLayout); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ SeriesModel.extend({ type: 'series.effectScatter', dependencies: ['grid', 'polar'], getInitialData: function (option, ecModel) { return createListFromArray(this.getSource(), this); }, brushSelector: 'point', defaultOption: { coordinateSystem: 'cartesian2d', zlevel: 0, z: 2, legendHoverLink: true, effectType: 'ripple', progressive: 0, // When to show the effect, option: 'render'|'emphasis' showEffectOn: 'render', // Ripple effect config rippleEffect: { period: 4, // Scale of ripple scale: 2.5, // Brush type can be fill or stroke brushType: 'fill' }, // Cartesian coordinate system // xAxisIndex: 0, // yAxisIndex: 0, // Polar coordinate system // polarIndex: 0, // Geo coordinate system // geoIndex: 0, // symbol: null, // 图形类型 symbolSize: 10 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 // symbolRotate: null, // 图形旋转控制 // large: false, // Available when large is true // largeThreshold: 2000, // itemStyle: { // opacity: 1 // } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Symbol with ripple effect * @module echarts/chart/helper/EffectSymbol */ var EFFECT_RIPPLE_NUMBER = 3; function normalizeSymbolSize$1(symbolSize) { if (!isArray(symbolSize)) { symbolSize = [+symbolSize, +symbolSize]; } return symbolSize; } function updateRipplePath(rippleGroup, effectCfg) { rippleGroup.eachChild(function (ripplePath) { ripplePath.attr({ z: effectCfg.z, zlevel: effectCfg.zlevel, style: { stroke: effectCfg.brushType === 'stroke' ? effectCfg.color : null, fill: effectCfg.brushType === 'fill' ? effectCfg.color : null } }); }); } /** * @constructor * @param {module:echarts/data/List} data * @param {number} idx * @extends {module:zrender/graphic/Group} */ function EffectSymbol(data, idx) { Group.call(this); var symbol = new SymbolClz$1(data, idx); var rippleGroup = new Group(); this.add(symbol); this.add(rippleGroup); rippleGroup.beforeUpdate = function () { this.attr(symbol.getScale()); }; this.updateData(data, idx); } var effectSymbolProto = EffectSymbol.prototype; effectSymbolProto.stopEffectAnimation = function () { this.childAt(1).removeAll(); }; effectSymbolProto.startEffectAnimation = function (effectCfg) { var symbolType = effectCfg.symbolType; var color = effectCfg.color; var rippleGroup = this.childAt(1); for (var i = 0; i < EFFECT_RIPPLE_NUMBER; i++) { // var ripplePath = createSymbol( // symbolType, -0.5, -0.5, 1, 1, color // ); // If width/height are set too small (e.g., set to 1) on ios10 // and macOS Sierra, a circle stroke become a rect, no matter what // the scale is set. So we set width/height as 2. See #4136. var ripplePath = createSymbol( symbolType, -1, -1, 2, 2, color ); ripplePath.attr({ style: { strokeNoScale: true }, z2: 99, silent: true, scale: [0.5, 0.5] }); var delay = -i / EFFECT_RIPPLE_NUMBER * effectCfg.period + effectCfg.effectOffset; // TODO Configurable effectCfg.period ripplePath.animate('', true) .when(effectCfg.period, { scale: [effectCfg.rippleScale / 2, effectCfg.rippleScale / 2] }) .delay(delay) .start(); ripplePath.animateStyle(true) .when(effectCfg.period, { opacity: 0 }) .delay(delay) .start(); rippleGroup.add(ripplePath); } updateRipplePath(rippleGroup, effectCfg); }; /** * Update effect symbol */ effectSymbolProto.updateEffectAnimation = function (effectCfg) { var oldEffectCfg = this._effectCfg; var rippleGroup = this.childAt(1); // Must reinitialize effect if following configuration changed var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale']; for (var i = 0; i < DIFFICULT_PROPS.length; i++) { var propName = DIFFICULT_PROPS[i]; if (oldEffectCfg[propName] !== effectCfg[propName]) { this.stopEffectAnimation(); this.startEffectAnimation(effectCfg); return; } } updateRipplePath(rippleGroup, effectCfg); }; /** * Highlight symbol */ effectSymbolProto.highlight = function () { this.trigger('emphasis'); }; /** * Downplay symbol */ effectSymbolProto.downplay = function () { this.trigger('normal'); }; /** * Update symbol properties * @param {module:echarts/data/List} data * @param {number} idx */ effectSymbolProto.updateData = function (data, idx) { var seriesModel = data.hostModel; this.childAt(0).updateData(data, idx); var rippleGroup = this.childAt(1); var itemModel = data.getItemModel(idx); var symbolType = data.getItemVisual(idx, 'symbol'); var symbolSize = normalizeSymbolSize$1(data.getItemVisual(idx, 'symbolSize')); var color = data.getItemVisual(idx, 'color'); rippleGroup.attr('scale', symbolSize); rippleGroup.traverse(function (ripplePath) { ripplePath.attr({ fill: color }); }); var symbolOffset = itemModel.getShallow('symbolOffset'); if (symbolOffset) { var pos = rippleGroup.position; pos[0] = parsePercent$1(symbolOffset[0], symbolSize[0]); pos[1] = parsePercent$1(symbolOffset[1], symbolSize[1]); } rippleGroup.rotation = (itemModel.getShallow('symbolRotate') || 0) * Math.PI / 180 || 0; var effectCfg = {}; effectCfg.showEffectOn = seriesModel.get('showEffectOn'); effectCfg.rippleScale = itemModel.get('rippleEffect.scale'); effectCfg.brushType = itemModel.get('rippleEffect.brushType'); effectCfg.period = itemModel.get('rippleEffect.period') * 1000; effectCfg.effectOffset = idx / data.count(); effectCfg.z = itemModel.getShallow('z') || 0; effectCfg.zlevel = itemModel.getShallow('zlevel') || 0; effectCfg.symbolType = symbolType; effectCfg.color = color; this.off('mouseover').off('mouseout').off('emphasis').off('normal'); if (effectCfg.showEffectOn === 'render') { this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg); this._effectCfg = effectCfg; } else { // Not keep old effect config this._effectCfg = null; this.stopEffectAnimation(); var symbol = this.childAt(0); var onEmphasis = function () { symbol.highlight(); if (effectCfg.showEffectOn !== 'render') { this.startEffectAnimation(effectCfg); } }; var onNormal = function () { symbol.downplay(); if (effectCfg.showEffectOn !== 'render') { this.stopEffectAnimation(); } }; this.on('mouseover', onEmphasis, this) .on('mouseout', onNormal, this) .on('emphasis', onEmphasis, this) .on('normal', onNormal, this); } this._effectCfg = effectCfg; }; effectSymbolProto.fadeOut = function (cb) { this.off('mouseover').off('mouseout').off('emphasis').off('normal'); cb && cb(); }; inherits(EffectSymbol, Group); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ extendChartView({ type: 'effectScatter', init: function () { this._symbolDraw = new SymbolDraw(EffectSymbol); }, render: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var effectSymbolDraw = this._symbolDraw; effectSymbolDraw.updateData(data); this.group.add(effectSymbolDraw.group); }, updateTransform: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); this.group.dirty(); var res = pointsLayout().reset(seriesModel); if (res.progress) { res.progress({ start: 0, end: data.count() }, data); } this._symbolDraw.updateLayout(data); }, _updateGroupTransform: function (seriesModel) { var coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.getRoamTransform) { this.group.transform = clone$2(coordSys.getRoamTransform()); this.group.decomposeTransform(); } }, remove: function (ecModel, api) { this._symbolDraw && this._symbolDraw.remove(api); }, dispose: function () {} }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerVisual(visualSymbol('effectScatter', 'circle')); registerLayout(pointsLayout('effectScatter')); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array; var Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array; function compatEc2(seriesOpt) { var data = seriesOpt.data; if (data && data[0] && data[0][0] && data[0][0].coord) { if (__DEV__) { console.warn('Lines data configuration has been changed to' + ' { coords:[[1,2],[2,3]] }'); } seriesOpt.data = map(data, function (itemOpt) { var coords = [ itemOpt[0].coord, itemOpt[1].coord ]; var target = { coords: coords }; if (itemOpt[0].name) { target.fromName = itemOpt[0].name; } if (itemOpt[1].name) { target.toName = itemOpt[1].name; } return mergeAll([target, itemOpt[0], itemOpt[1]]); }); } } var LinesSeries = SeriesModel.extend({ type: 'series.lines', dependencies: ['grid', 'polar'], visualColorAccessPath: 'lineStyle.color', init: function (option) { // The input data may be null/undefined. option.data = option.data || []; // Not using preprocessor because mergeOption may not have series.type compatEc2(option); var result = this._processFlatCoordsArray(option.data); this._flatCoords = result.flatCoords; this._flatCoordsOffset = result.flatCoordsOffset; if (result.flatCoords) { option.data = new Float32Array(result.count); } LinesSeries.superApply(this, 'init', arguments); }, mergeOption: function (option) { // The input data may be null/undefined. option.data = option.data || []; compatEc2(option); if (option.data) { // Only update when have option data to merge. var result = this._processFlatCoordsArray(option.data); this._flatCoords = result.flatCoords; this._flatCoordsOffset = result.flatCoordsOffset; if (result.flatCoords) { option.data = new Float32Array(result.count); } } LinesSeries.superApply(this, 'mergeOption', arguments); }, appendData: function (params) { var result = this._processFlatCoordsArray(params.data); if (result.flatCoords) { if (!this._flatCoords) { this._flatCoords = result.flatCoords; this._flatCoordsOffset = result.flatCoordsOffset; } else { this._flatCoords = concatArray(this._flatCoords, result.flatCoords); this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset); } params.data = new Float32Array(result.count); } this.getRawData().appendData(params.data); }, _getCoordsFromItemModel: function (idx) { var itemModel = this.getData().getItemModel(idx); var coords = (itemModel.option instanceof Array) ? itemModel.option : itemModel.getShallow('coords'); if (__DEV__) { if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) { throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.'); } } return coords; }, getLineCoordsCount: function (idx) { if (this._flatCoordsOffset) { return this._flatCoordsOffset[idx * 2 + 1]; } else { return this._getCoordsFromItemModel(idx).length; } }, getLineCoords: function (idx, out) { if (this._flatCoordsOffset) { var offset = this._flatCoordsOffset[idx * 2]; var len = this._flatCoordsOffset[idx * 2 + 1]; for (var i = 0; i < len; i++) { out[i] = out[i] || []; out[i][0] = this._flatCoords[offset + i * 2]; out[i][1] = this._flatCoords[offset + i * 2 + 1]; } return len; } else { var coords = this._getCoordsFromItemModel(idx); for (var i = 0; i < coords.length; i++) { out[i] = out[i] || []; out[i][0] = coords[i][0]; out[i][1] = coords[i][1]; } return coords.length; } }, _processFlatCoordsArray: function (data) { var startOffset = 0; if (this._flatCoords) { startOffset = this._flatCoords.length; } // Stored as a typed array. In format // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y | if (typeof data[0] === 'number') { var len = data.length; // Store offset and len of each segment var coordsOffsetAndLenStorage = new Uint32Arr(len); var coordsStorage = new Float64Arr(len); var coordsCursor = 0; var offsetCursor = 0; var dataCount = 0; for (var i = 0; i < len;) { dataCount++; var count = data[i++]; // Offset coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset; // Len coordsOffsetAndLenStorage[offsetCursor++] = count; for (var k = 0; k < count; k++) { var x = data[i++]; var y = data[i++]; coordsStorage[coordsCursor++] = x; coordsStorage[coordsCursor++] = y; if (i > len) { if (__DEV__) { throw new Error('Invalid data format.'); } } } } return { flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor), flatCoords: coordsStorage, count: dataCount }; } return { flatCoordsOffset: null, flatCoords: null, count: data.length }; }, getInitialData: function (option, ecModel) { if (__DEV__) { var CoordSys = CoordinateSystemManager.get(option.coordinateSystem); if (!CoordSys) { throw new Error('Unkown coordinate system ' + option.coordinateSystem); } } var lineData = new List(['value'], this); lineData.hasItemOption = false; lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) { // dataItem is simply coords if (dataItem instanceof Array) { return NaN; } else { lineData.hasItemOption = true; var value = dataItem.value; if (value != null) { return value instanceof Array ? value[dimIndex] : value; } } }); return lineData; }, formatTooltip: function (dataIndex) { var data = this.getData(); var itemModel = data.getItemModel(dataIndex); var name = itemModel.get('name'); if (name) { return name; } var fromName = itemModel.get('fromName'); var toName = itemModel.get('toName'); var html = []; fromName != null && html.push(fromName); toName != null && html.push(toName); return encodeHTML(html.join(' > ')); }, preventIncremental: function () { return !!this.get('effect.show'); }, getProgressive: function () { var progressive = this.option.progressive; if (progressive == null) { return this.option.large ? 1e4 : this.get('progressive'); } return progressive; }, getProgressiveThreshold: function () { var progressiveThreshold = this.option.progressiveThreshold; if (progressiveThreshold == null) { return this.option.large ? 2e4 : this.get('progressiveThreshold'); } return progressiveThreshold; }, defaultOption: { coordinateSystem: 'geo', zlevel: 0, z: 2, legendHoverLink: true, hoverAnimation: true, // Cartesian coordinate system xAxisIndex: 0, yAxisIndex: 0, symbol: ['none', 'none'], symbolSize: [10, 10], // Geo coordinate system geoIndex: 0, effect: { show: false, period: 4, // Animation delay. support callback // delay: 0, // If move with constant speed px/sec // period will be ignored if this property is > 0, constantSpeed: 0, symbol: 'circle', symbolSize: 3, loop: true, // Length of trail, 0 - 1 trailLength: 0.2 // Same with lineStyle.color // color }, large: false, // Available when large is true largeThreshold: 2000, // If lines are polyline // polyline not support curveness, label, animation polyline: false, label: { show: false, position: 'end' // distance: 5, // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 }, lineStyle: { opacity: 0.5 } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Provide effect for line * @module echarts/chart/helper/EffectLine */ /** * @constructor * @extends {module:zrender/graphic/Group} * @alias {module:echarts/chart/helper/Line} */ function EffectLine(lineData, idx, seriesScope) { Group.call(this); this.add(this.createLine(lineData, idx, seriesScope)); this._updateEffectSymbol(lineData, idx); } var effectLineProto = EffectLine.prototype; effectLineProto.createLine = function (lineData, idx, seriesScope) { return new Line$1(lineData, idx, seriesScope); }; effectLineProto._updateEffectSymbol = function (lineData, idx) { var itemModel = lineData.getItemModel(idx); var effectModel = itemModel.getModel('effect'); var size = effectModel.get('symbolSize'); var symbolType = effectModel.get('symbol'); if (!isArray(size)) { size = [size, size]; } var color = effectModel.get('color') || lineData.getItemVisual(idx, 'color'); var symbol = this.childAt(1); if (this._symbolType !== symbolType) { // Remove previous this.remove(symbol); symbol = createSymbol( symbolType, -0.5, -0.5, 1, 1, color ); symbol.z2 = 100; symbol.culling = true; this.add(symbol); } // Symbol may be removed if loop is false if (!symbol) { return; } // Shadow color is same with color in default symbol.setStyle('shadowColor', color); symbol.setStyle(effectModel.getItemStyle(['color'])); symbol.attr('scale', size); symbol.setColor(color); symbol.attr('scale', size); this._symbolType = symbolType; this._updateEffectAnimation(lineData, effectModel, idx); }; effectLineProto._updateEffectAnimation = function (lineData, effectModel, idx) { var symbol = this.childAt(1); if (!symbol) { return; } var self = this; var points = lineData.getItemLayout(idx); var period = effectModel.get('period') * 1000; var loop = effectModel.get('loop'); var constantSpeed = effectModel.get('constantSpeed'); var delayExpr = retrieve(effectModel.get('delay'), function (idx) { return idx / lineData.count() * period / 3; }); var isDelayFunc = typeof delayExpr === 'function'; // Ignore when updating symbol.ignore = true; this.updateAnimationPoints(symbol, points); if (constantSpeed > 0) { period = this.getLineLength(symbol) / constantSpeed * 1000; } if (period !== this._period || loop !== this._loop) { symbol.stopAnimation(); var delay = delayExpr; if (isDelayFunc) { delay = delayExpr(idx); } if (symbol.__t > 0) { delay = -period * symbol.__t; } symbol.__t = 0; var animator = symbol.animate('', loop) .when(period, { __t: 1 }) .delay(delay) .during(function () { self.updateSymbolPosition(symbol); }); if (!loop) { animator.done(function () { self.remove(symbol); }); } animator.start(); } this._period = period; this._loop = loop; }; effectLineProto.getLineLength = function (symbol) { // Not so accurate return (dist(symbol.__p1, symbol.__cp1) + dist(symbol.__cp1, symbol.__p2)); }; effectLineProto.updateAnimationPoints = function (symbol, points) { symbol.__p1 = points[0]; symbol.__p2 = points[1]; symbol.__cp1 = points[2] || [ (points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2 ]; }; effectLineProto.updateData = function (lineData, idx, seriesScope) { this.childAt(0).updateData(lineData, idx, seriesScope); this._updateEffectSymbol(lineData, idx); }; effectLineProto.updateSymbolPosition = function (symbol) { var p1 = symbol.__p1; var p2 = symbol.__p2; var cp1 = symbol.__cp1; var t = symbol.__t; var pos = symbol.position; var quadraticAt$$1 = quadraticAt; var quadraticDerivativeAt$$1 = quadraticDerivativeAt; pos[0] = quadraticAt$$1(p1[0], cp1[0], p2[0], t); pos[1] = quadraticAt$$1(p1[1], cp1[1], p2[1], t); // Tangent var tx = quadraticDerivativeAt$$1(p1[0], cp1[0], p2[0], t); var ty = quadraticDerivativeAt$$1(p1[1], cp1[1], p2[1], t); symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; symbol.ignore = false; }; effectLineProto.updateLayout = function (lineData, idx) { this.childAt(0).updateLayout(lineData, idx); var effectModel = lineData.getItemModel(idx).getModel('effect'); this._updateEffectAnimation(lineData, effectModel, idx); }; inherits(EffectLine, Group); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @module echarts/chart/helper/Line */ /** * @constructor * @extends {module:zrender/graphic/Group} * @alias {module:echarts/chart/helper/Polyline} */ function Polyline$2(lineData, idx, seriesScope) { Group.call(this); this._createPolyline(lineData, idx, seriesScope); } var polylineProto = Polyline$2.prototype; polylineProto._createPolyline = function (lineData, idx, seriesScope) { // var seriesModel = lineData.hostModel; var points = lineData.getItemLayout(idx); var line = new Polyline({ shape: { points: points } }); this.add(line); this._updateCommonStl(lineData, idx, seriesScope); }; polylineProto.updateData = function (lineData, idx, seriesScope) { var seriesModel = lineData.hostModel; var line = this.childAt(0); var target = { shape: { points: lineData.getItemLayout(idx) } }; updateProps(line, target, seriesModel, idx); this._updateCommonStl(lineData, idx, seriesScope); }; polylineProto._updateCommonStl = function (lineData, idx, seriesScope) { var line = this.childAt(0); var itemModel = lineData.getItemModel(idx); var visualColor = lineData.getItemVisual(idx, 'color'); var lineStyle = seriesScope && seriesScope.lineStyle; var hoverLineStyle = seriesScope && seriesScope.hoverLineStyle; if (!seriesScope || lineData.hasItemOption) { lineStyle = itemModel.getModel('lineStyle').getLineStyle(); hoverLineStyle = itemModel.getModel('emphasis.lineStyle').getLineStyle(); } line.useStyle(defaults( { strokeNoScale: true, fill: 'none', stroke: visualColor }, lineStyle )); line.hoverStyle = hoverLineStyle; setHoverStyle(this); }; polylineProto.updateLayout = function (lineData, idx) { var polyline = this.childAt(0); polyline.setShape('points', lineData.getItemLayout(idx)); }; inherits(Polyline$2, Group); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Provide effect for line * @module echarts/chart/helper/EffectLine */ /** * @constructor * @extends {module:echarts/chart/helper/EffectLine} * @alias {module:echarts/chart/helper/Polyline} */ function EffectPolyline(lineData, idx, seriesScope) { EffectLine.call(this, lineData, idx, seriesScope); this._lastFrame = 0; this._lastFramePercent = 0; } var effectPolylineProto = EffectPolyline.prototype; // Overwrite effectPolylineProto.createLine = function (lineData, idx, seriesScope) { return new Polyline$2(lineData, idx, seriesScope); }; // Overwrite effectPolylineProto.updateAnimationPoints = function (symbol, points) { this._points = points; var accLenArr = [0]; var len$$1 = 0; for (var i = 1; i < points.length; i++) { var p1 = points[i - 1]; var p2 = points[i]; len$$1 += dist(p1, p2); accLenArr.push(len$$1); } if (len$$1 === 0) { return; } for (var i = 0; i < accLenArr.length; i++) { accLenArr[i] /= len$$1; } this._offsets = accLenArr; this._length = len$$1; }; // Overwrite effectPolylineProto.getLineLength = function (symbol) { return this._length; }; // Overwrite effectPolylineProto.updateSymbolPosition = function (symbol) { var t = symbol.__t; var points = this._points; var offsets = this._offsets; var len$$1 = points.length; if (!offsets) { // Has length 0 return; } var lastFrame = this._lastFrame; var frame; if (t < this._lastFramePercent) { // Start from the next frame // PENDING start from lastFrame ? var start = Math.min(lastFrame + 1, len$$1 - 1); for (frame = start; frame >= 0; frame--) { if (offsets[frame] <= t) { break; } } // PENDING really need to do this ? frame = Math.min(frame, len$$1 - 2); } else { for (var frame = lastFrame; frame < len$$1; frame++) { if (offsets[frame] > t) { break; } } frame = Math.min(frame - 1, len$$1 - 2); } lerp( symbol.position, points[frame], points[frame + 1], (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]) ); var tx = points[frame + 1][0] - points[frame][0]; var ty = points[frame + 1][1] - points[frame][1]; symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; this._lastFrame = frame; this._lastFramePercent = t; symbol.ignore = false; }; inherits(EffectPolyline, EffectLine); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // TODO Batch by color var LargeLineShape = extendShape({ shape: { polyline: false, curveness: 0, segs: [] }, buildPath: function (path, shape) { var segs = shape.segs; var curveness = shape.curveness; if (shape.polyline) { for (var i = 0; i < segs.length;) { var count = segs[i++]; if (count > 0) { path.moveTo(segs[i++], segs[i++]); for (var k = 1; k < count; k++) { path.lineTo(segs[i++], segs[i++]); } } } } else { for (var i = 0; i < segs.length;) { var x0 = segs[i++]; var y0 = segs[i++]; var x1 = segs[i++]; var y1 = segs[i++]; path.moveTo(x0, y0); if (curveness > 0) { var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; path.quadraticCurveTo(x2, y2, x1, y1); } else { path.lineTo(x1, y1); } } } }, findDataIndex: function (x, y) { var shape = this.shape; var segs = shape.segs; var curveness = shape.curveness; if (shape.polyline) { var dataIndex = 0; for (var i = 0; i < segs.length;) { var count = segs[i++]; if (count > 0) { var x0 = segs[i++]; var y0 = segs[i++]; for (var k = 1; k < count; k++) { var x1 = segs[i++]; var y1 = segs[i++]; if (containStroke$1(x0, y0, x1, y1)) { return dataIndex; } } } dataIndex++; } } else { var dataIndex = 0; for (var i = 0; i < segs.length;) { var x0 = segs[i++]; var y0 = segs[i++]; var x1 = segs[i++]; var y1 = segs[i++]; if (curveness > 0) { var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; if (containStroke$3(x0, y0, x2, y2, x1, y1)) { return dataIndex; } } else { if (containStroke$1(x0, y0, x1, y1)) { return dataIndex; } } dataIndex++; } } return -1; } }); function LargeLineDraw() { this.group = new Group(); } var largeLineProto = LargeLineDraw.prototype; largeLineProto.isPersistent = function () { return !this._incremental; }; /** * Update symbols draw by new data * @param {module:echarts/data/List} data */ largeLineProto.updateData = function (data) { this.group.removeAll(); var lineEl = new LargeLineShape({ rectHover: true, cursor: 'default' }); lineEl.setShape({ segs: data.getLayout('linesPoints') }); this._setCommon(lineEl, data); // Add back this.group.add(lineEl); this._incremental = null; }; /** * @override */ largeLineProto.incrementalPrepareUpdate = function (data) { this.group.removeAll(); this._clearIncremental(); if (data.count() > 5e5) { if (!this._incremental) { this._incremental = new IncrementalDisplayble({ silent: true }); } this.group.add(this._incremental); } else { this._incremental = null; } }; /** * @override */ largeLineProto.incrementalUpdate = function (taskParams, data) { var lineEl = new LargeLineShape(); lineEl.setShape({ segs: data.getLayout('linesPoints') }); this._setCommon(lineEl, data, !!this._incremental); if (!this._incremental) { lineEl.rectHover = true; lineEl.cursor = 'default'; lineEl.__startIndex = taskParams.start; this.group.add(lineEl); } else { this._incremental.addDisplayable(lineEl, true); } }; /** * @override */ largeLineProto.remove = function () { this._clearIncremental(); this._incremental = null; this.group.removeAll(); }; largeLineProto._setCommon = function (lineEl, data, isIncremental) { var hostModel = data.hostModel; lineEl.setShape({ polyline: hostModel.get('polyline'), curveness: hostModel.get('lineStyle.curveness') }); lineEl.useStyle( hostModel.getModel('lineStyle').getLineStyle() ); lineEl.style.strokeNoScale = true; var visualColor = data.getVisual('color'); if (visualColor) { lineEl.setStyle('stroke', visualColor); } lineEl.setStyle('fill'); if (!isIncremental) { // Enable tooltip // PENDING May have performance issue when path is extremely large lineEl.seriesIndex = hostModel.seriesIndex; lineEl.on('mousemove', function (e) { lineEl.dataIndex = null; var dataIndex = lineEl.findDataIndex(e.offsetX, e.offsetY); if (dataIndex > 0) { // Provide dataIndex for tooltip lineEl.dataIndex = dataIndex + lineEl.__startIndex; } }); } }; largeLineProto._clearIncremental = function () { var incremental = this._incremental; if (incremental) { incremental.clearDisplaybles(); } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var linesLayout = { seriesType: 'lines', plan: createRenderPlanner(), reset: function (seriesModel) { var coordSys = seriesModel.coordinateSystem; var isPolyline = seriesModel.get('polyline'); var isLarge = seriesModel.pipelineContext.large; function progress(params, lineData) { var lineCoords = []; if (isLarge) { var points; var segCount = params.end - params.start; if (isPolyline) { var totalCoordsCount = 0; for (var i = params.start; i < params.end; i++) { totalCoordsCount += seriesModel.getLineCoordsCount(i); } points = new Float32Array(segCount + totalCoordsCount * 2); } else { points = new Float32Array(segCount * 4); } var offset = 0; var pt = []; for (var i = params.start; i < params.end; i++) { var len = seriesModel.getLineCoords(i, lineCoords); if (isPolyline) { points[offset++] = len; } for (var k = 0; k < len; k++) { pt = coordSys.dataToPoint(lineCoords[k], false, pt); points[offset++] = pt[0]; points[offset++] = pt[1]; } } lineData.setLayout('linesPoints', points); } else { for (var i = params.start; i < params.end; i++) { var itemModel = lineData.getItemModel(i); var len = seriesModel.getLineCoords(i, lineCoords); var pts = []; if (isPolyline) { for (var j = 0; j < len; j++) { pts.push(coordSys.dataToPoint(lineCoords[j])); } } else { pts[0] = coordSys.dataToPoint(lineCoords[0]); pts[1] = coordSys.dataToPoint(lineCoords[1]); var curveness = itemModel.get('lineStyle.curveness'); if (+curveness) { pts[2] = [ (pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness, (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness ]; } } lineData.setItemLayout(i, pts); } } } return { progress: progress }; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ extendChartView({ type: 'lines', init: function () {}, render: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var lineDraw = this._updateLineDraw(data, seriesModel); var zlevel = seriesModel.get('zlevel'); var trailLength = seriesModel.get('effect.trailLength'); var zr = api.getZr(); // Avoid the drag cause ghost shadow // FIXME Better way ? // SVG doesn't support var isSvg = zr.painter.getType() === 'svg'; if (!isSvg) { zr.painter.getLayer(zlevel).clear(true); } // Config layer with motion blur if (this._lastZlevel != null && !isSvg) { zr.configLayer(this._lastZlevel, { motionBlur: false }); } if (this._showEffect(seriesModel) && trailLength) { if (__DEV__) { var notInIndividual = false; ecModel.eachSeries(function (otherSeriesModel) { if (otherSeriesModel !== seriesModel && otherSeriesModel.get('zlevel') === zlevel) { notInIndividual = true; } }); notInIndividual && console.warn('Lines with trail effect should have an individual zlevel'); } if (!isSvg) { zr.configLayer(zlevel, { motionBlur: true, lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0) }); } } lineDraw.updateData(data); this._lastZlevel = zlevel; this._finished = true; }, incrementalPrepareRender: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var lineDraw = this._updateLineDraw(data, seriesModel); lineDraw.incrementalPrepareUpdate(data); this._clearLayer(api); this._finished = false; }, incrementalRender: function (taskParams, seriesModel, ecModel) { this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData()); this._finished = taskParams.end === seriesModel.getData().count(); }, updateTransform: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var pipelineContext = seriesModel.pipelineContext; if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) { // TODO Don't have to do update in large mode. Only do it when there are millions of data. return { update: true }; } else { // TODO Use same logic with ScatterView. // Manually update layout var res = linesLayout.reset(seriesModel); if (res.progress) { res.progress({ start: 0, end: data.count() }, data); } this._lineDraw.updateLayout(); this._clearLayer(api); } }, _updateLineDraw: function (data, seriesModel) { var lineDraw = this._lineDraw; var hasEffect = this._showEffect(seriesModel); var isPolyline = !!seriesModel.get('polyline'); var pipelineContext = seriesModel.pipelineContext; var isLargeDraw = pipelineContext.large; if (__DEV__) { if (hasEffect && isLargeDraw) { console.warn('Large lines not support effect'); } } if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw ) { if (lineDraw) { lineDraw.remove(); } lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw( isPolyline ? (hasEffect ? EffectPolyline : Polyline$2) : (hasEffect ? EffectLine : Line$1) ); this._hasEffet = hasEffect; this._isPolyline = isPolyline; this._isLargeDraw = isLargeDraw; this.group.removeAll(); } this.group.add(lineDraw.group); return lineDraw; }, _showEffect: function (seriesModel) { return !!seriesModel.get('effect.show'); }, _clearLayer: function (api) { // Not use motion when dragging or zooming var zr = api.getZr(); var isSvg = zr.painter.getType() === 'svg'; if (!isSvg && this._lastZlevel != null) { zr.painter.getLayer(this._lastZlevel).clear(true); } }, remove: function (ecModel, api) { this._lineDraw && this._lineDraw.remove(); this._lineDraw = null; // Clear motion when lineDraw is removed this._clearLayer(api); }, dispose: function () {} }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function normalize$2(a) { if (!(a instanceof Array)) { a = [a, a]; } return a; } var opacityQuery = 'lineStyle.opacity'.split('.'); var linesVisual = { seriesType: 'lines', reset: function (seriesModel, ecModel, api) { var symbolType = normalize$2(seriesModel.get('symbol')); var symbolSize = normalize$2(seriesModel.get('symbolSize')); var data = seriesModel.getData(); data.setVisual('fromSymbol', symbolType && symbolType[0]); data.setVisual('toSymbol', symbolType && symbolType[1]); data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]); data.setVisual('toSymbolSize', symbolSize && symbolSize[1]); data.setVisual('opacity', seriesModel.get(opacityQuery)); function dataEach(data, idx) { var itemModel = data.getItemModel(idx); var symbolType = normalize$2(itemModel.getShallow('symbol', true)); var symbolSize = normalize$2(itemModel.getShallow('symbolSize', true)); var opacity = itemModel.get(opacityQuery); symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]); symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]); symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]); symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]); data.setItemVisual(idx, 'opacity', opacity); } return {dataEach: data.hasItemOption ? dataEach : null}; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerLayout(linesLayout); registerVisual(linesVisual); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ SeriesModel.extend({ type: 'series.heatmap', getInitialData: function (option, ecModel) { return createListFromArray(this.getSource(), this, { generateCoord: 'value' }); }, preventIncremental: function () { var coordSysCreator = CoordinateSystemManager.get(this.get('coordinateSystem')); if (coordSysCreator && coordSysCreator.dimensions) { return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat'; } }, defaultOption: { // Cartesian2D or geo coordinateSystem: 'cartesian2d', zlevel: 0, z: 2, // Cartesian coordinate system // xAxisIndex: 0, // yAxisIndex: 0, // Geo coordinate system geoIndex: 0, blurSize: 30, pointSize: 20, maxOpacity: 1, minOpacity: 0 } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file defines echarts Heatmap Chart * @author Ovilia (me@zhangwenli.com) * Inspired by https://github.com/mourner/simpleheat * * @module */ var GRADIENT_LEVELS = 256; /** * Heatmap Chart * * @class */ function Heatmap() { var canvas = createCanvas(); this.canvas = canvas; this.blurSize = 30; this.pointSize = 20; this.maxOpacity = 1; this.minOpacity = 0; this._gradientPixels = {}; } Heatmap.prototype = { /** * Renders Heatmap and returns the rendered canvas * @param {Array} data array of data, each has x, y, value * @param {number} width canvas width * @param {number} height canvas height */ update: function(data, width, height, normalize, colorFunc, isInRange) { var brush = this._getBrush(); var gradientInRange = this._getGradient(data, colorFunc, 'inRange'); var gradientOutOfRange = this._getGradient(data, colorFunc, 'outOfRange'); var r = this.pointSize + this.blurSize; var canvas = this.canvas; var ctx = canvas.getContext('2d'); var len = data.length; canvas.width = width; canvas.height = height; for (var i = 0; i < len; ++i) { var p = data[i]; var x = p[0]; var y = p[1]; var value = p[2]; // calculate alpha using value var alpha = normalize(value); // draw with the circle brush with alpha ctx.globalAlpha = alpha; ctx.drawImage(brush, x - r, y - r); } if (!canvas.width || !canvas.height) { // Avoid "Uncaught DOMException: Failed to execute 'getImageData' on // 'CanvasRenderingContext2D': The source height is 0." return canvas; } // colorize the canvas using alpha value and set with gradient var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); var pixels = imageData.data; var offset = 0; var pixelLen = pixels.length; var minOpacity = this.minOpacity; var maxOpacity = this.maxOpacity; var diffOpacity = maxOpacity - minOpacity; while(offset < pixelLen) { var alpha = pixels[offset + 3] / 256; var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4; // Simple optimize to ignore the empty data if (alpha > 0) { var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange; // Any alpha > 0 will be mapped to [minOpacity, maxOpacity] alpha > 0 && (alpha = alpha * diffOpacity + minOpacity); pixels[offset++] = gradient[gradientOffset]; pixels[offset++] = gradient[gradientOffset + 1]; pixels[offset++] = gradient[gradientOffset + 2]; pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256; } else { offset += 4; } } ctx.putImageData(imageData, 0, 0); return canvas; }, /** * get canvas of a black circle brush used for canvas to draw later * @private * @returns {Object} circle brush canvas */ _getBrush: function() { var brushCanvas = this._brushCanvas || (this._brushCanvas = createCanvas()); // set brush size var r = this.pointSize + this.blurSize; var d = r * 2; brushCanvas.width = d; brushCanvas.height = d; var ctx = brushCanvas.getContext('2d'); ctx.clearRect(0, 0, d, d); // in order to render shadow without the distinct circle, // draw the distinct circle in an invisible place, // and use shadowOffset to draw shadow in the center of the canvas ctx.shadowOffsetX = d; ctx.shadowBlur = this.blurSize; // draw the shadow in black, and use alpha and shadow blur to generate // color in color map ctx.shadowColor = '#000'; // draw circle in the left to the canvas ctx.beginPath(); ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true); ctx.closePath(); ctx.fill(); return brushCanvas; }, /** * get gradient color map * @private */ _getGradient: function (data, colorFunc, state) { var gradientPixels = this._gradientPixels; var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4)); var color = [0, 0, 0, 0]; var off = 0; for (var i = 0; i < 256; i++) { colorFunc[state](i / 255, true, color); pixelsSingleState[off++] = color[0]; pixelsSingleState[off++] = color[1]; pixelsSingleState[off++] = color[2]; pixelsSingleState[off++] = color[3]; } return pixelsSingleState; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function getIsInPiecewiseRange(dataExtent, pieceList, selected) { var dataSpan = dataExtent[1] - dataExtent[0]; pieceList = map(pieceList, function (piece) { return { interval: [ (piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan ] }; }); var len = pieceList.length; var lastIndex = 0; return function (val) { // Try to find in the location of the last found for (var i = lastIndex; i < len; i++) { var interval = pieceList[i].interval; if (interval[0] <= val && val <= interval[1]) { lastIndex = i; break; } } if (i === len) { // Not found, back interation for (var i = lastIndex - 1; i >= 0; i--) { var interval = pieceList[i].interval; if (interval[0] <= val && val <= interval[1]) { lastIndex = i; break; } } } return i >= 0 && i < len && selected[i]; }; } function getIsInContinuousRange(dataExtent, range) { var dataSpan = dataExtent[1] - dataExtent[0]; range = [ (range[0] - dataExtent[0]) / dataSpan, (range[1] - dataExtent[0]) / dataSpan ]; return function (val) { return val >= range[0] && val <= range[1]; }; } function isGeoCoordSys(coordSys) { var dimensions = coordSys.dimensions; // Not use coorSys.type === 'geo' because coordSys maybe extended return dimensions[0] === 'lng' && dimensions[1] === 'lat'; } extendChartView({ type: 'heatmap', render: function (seriesModel, ecModel, api) { var visualMapOfThisSeries; ecModel.eachComponent('visualMap', function (visualMap) { visualMap.eachTargetSeries(function (targetSeries) { if (targetSeries === seriesModel) { visualMapOfThisSeries = visualMap; } }); }); if (__DEV__) { if (!visualMapOfThisSeries) { throw new Error('Heatmap must use with visualMap'); } } this.group.removeAll(); this._incrementalDisplayable = null; var coordSys = seriesModel.coordinateSystem; if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') { this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count()); } else if (isGeoCoordSys(coordSys)) { this._renderOnGeo( coordSys, seriesModel, visualMapOfThisSeries, api ); } }, incrementalPrepareRender: function (seriesModel, ecModel, api) { this.group.removeAll(); }, incrementalRender: function (params, seriesModel, ecModel, api) { var coordSys = seriesModel.coordinateSystem; if (coordSys) { this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true); } }, _renderOnCartesianAndCalendar: function (seriesModel, api, start, end, incremental) { var coordSys = seriesModel.coordinateSystem; var width; var height; if (coordSys.type === 'cartesian2d') { var xAxis = coordSys.getAxis('x'); var yAxis = coordSys.getAxis('y'); if (__DEV__) { if (!(xAxis.type === 'category' && yAxis.type === 'category')) { throw new Error('Heatmap on cartesian must have two category axes'); } if (!(xAxis.onBand && yAxis.onBand)) { throw new Error('Heatmap on cartesian must have two axes with boundaryGap true'); } } width = xAxis.getBandWidth(); height = yAxis.getBandWidth(); } var group = this.group; var data = seriesModel.getData(); var itemStyleQuery = 'itemStyle'; var hoverItemStyleQuery = 'emphasis.itemStyle'; var labelQuery = 'label'; var hoverLabelQuery = 'emphasis.label'; var style = seriesModel.getModel(itemStyleQuery).getItemStyle(['color']); var hoverStl = seriesModel.getModel(hoverItemStyleQuery).getItemStyle(); var labelModel = seriesModel.getModel(labelQuery); var hoverLabelModel = seriesModel.getModel(hoverLabelQuery); var coordSysType = coordSys.type; var dataDims = coordSysType === 'cartesian2d' ? [ data.mapDimension('x'), data.mapDimension('y'), data.mapDimension('value') ] : [ data.mapDimension('time'), data.mapDimension('value') ]; for (var idx = start; idx < end; idx++) { var rect; if (coordSysType === 'cartesian2d') { // Ignore empty data if (isNaN(data.get(dataDims[2], idx))) { continue; } var point = coordSys.dataToPoint([ data.get(dataDims[0], idx), data.get(dataDims[1], idx) ]); rect = new Rect({ shape: { x: point[0] - width / 2, y: point[1] - height / 2, width: width, height: height }, style: { fill: data.getItemVisual(idx, 'color'), opacity: data.getItemVisual(idx, 'opacity') } }); } else { // Ignore empty data if (isNaN(data.get(dataDims[1], idx))) { continue; } rect = new Rect({ z2: 1, shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape, style: { fill: data.getItemVisual(idx, 'color'), opacity: data.getItemVisual(idx, 'opacity') } }); } var itemModel = data.getItemModel(idx); // Optimization for large datset if (data.hasItemOption) { style = itemModel.getModel(itemStyleQuery).getItemStyle(['color']); hoverStl = itemModel.getModel(hoverItemStyleQuery).getItemStyle(); labelModel = itemModel.getModel(labelQuery); hoverLabelModel = itemModel.getModel(hoverLabelQuery); } var rawValue = seriesModel.getRawValue(idx); var defaultText = '-'; if (rawValue && rawValue[2] != null) { defaultText = rawValue[2]; } setLabelStyle( style, hoverStl, labelModel, hoverLabelModel, { labelFetcher: seriesModel, labelDataIndex: idx, defaultText: defaultText, isRectText: true } ); rect.setStyle(style); setHoverStyle(rect, data.hasItemOption ? hoverStl : extend({}, hoverStl)); rect.incremental = incremental; // PENDING if (incremental) { // Rect must use hover layer if it's incremental. rect.useHoverLayer = true; } group.add(rect); data.setItemGraphicEl(idx, rect); } }, _renderOnGeo: function (geo, seriesModel, visualMapModel, api) { var inRangeVisuals = visualMapModel.targetVisuals.inRange; var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange; // if (!visualMapping) { // throw new Error('Data range must have color visuals'); // } var data = seriesModel.getData(); var hmLayer = this._hmLayer || (this._hmLayer || new Heatmap()); hmLayer.blurSize = seriesModel.get('blurSize'); hmLayer.pointSize = seriesModel.get('pointSize'); hmLayer.minOpacity = seriesModel.get('minOpacity'); hmLayer.maxOpacity = seriesModel.get('maxOpacity'); var rect = geo.getViewRect().clone(); var roamTransform = geo.getRoamTransform(); rect.applyTransform(roamTransform); // Clamp on viewport var x = Math.max(rect.x, 0); var y = Math.max(rect.y, 0); var x2 = Math.min(rect.width + rect.x, api.getWidth()); var y2 = Math.min(rect.height + rect.y, api.getHeight()); var width = x2 - x; var height = y2 - y; var dims = [ data.mapDimension('lng'), data.mapDimension('lat'), data.mapDimension('value') ]; var points = data.mapArray(dims, function (lng, lat, value) { var pt = geo.dataToPoint([lng, lat]); pt[0] -= x; pt[1] -= y; pt.push(value); return pt; }); var dataExtent = visualMapModel.getExtent(); var isInRange = visualMapModel.type === 'visualMap.continuous' ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange( dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected ); hmLayer.update( points, width, height, inRangeVisuals.color.getNormalizer(), { inRange: inRangeVisuals.color.getColorMapper(), outOfRange: outOfRangeVisuals.color.getColorMapper() }, isInRange ); var img = new ZImage({ style: { width: width, height: height, x: x, y: y, image: hmLayer.canvas }, silent: true }); this.group.add(img); }, dispose: function () {} }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var PictorialBarSeries = BaseBarSeries.extend({ type: 'series.pictorialBar', dependencies: ['grid'], defaultOption: { symbol: 'circle', // Customized bar shape symbolSize: null, // Can be ['100%', '100%'], null means auto. symbolRotate: null, symbolPosition: null, // 'start' or 'end' or 'center', null means auto. symbolOffset: null, symbolMargin: null, // start margin and end margin. Can be a number or a percent string. // Auto margin by defualt. symbolRepeat: false, // false/null/undefined, means no repeat. // Can be true, means auto calculate repeat times and cut by data. // Can be a number, specifies repeat times, and do not cut by data. // Can be 'fixed', means auto calculate repeat times but do not cut by data. symbolRepeatDirection: 'end', // 'end' means from 'start' to 'end'. symbolClip: false, symbolBoundingData: null, // Can be 60 or -40 or [-40, 60] symbolPatternSize: 400, // 400 * 400 px barGap: '-100%', // In most case, overlap is needed. // z can be set in data item, which is z2 actually. // Disable progressive progressive: 0, hoverAnimation: false // Open only when needed. }, getInitialData: function (option) { // Disable stack. option.stack = null; return PictorialBarSeries.superApply(this, 'getInitialData', arguments); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var BAR_BORDER_WIDTH_QUERY$1 = ['itemStyle', 'borderWidth']; // index: +isHorizontal var LAYOUT_ATTRS = [ {xy: 'x', wh: 'width', index: 0, posDesc: ['left', 'right']}, {xy: 'y', wh: 'height', index: 1, posDesc: ['top', 'bottom']} ]; var pathForLineWidth = new Circle(); var BarView$1 = extendChartView({ type: 'pictorialBar', render: function (seriesModel, ecModel, api) { var group = this.group; var data = seriesModel.getData(); var oldData = this._data; var cartesian = seriesModel.coordinateSystem; var baseAxis = cartesian.getBaseAxis(); var isHorizontal = !!baseAxis.isHorizontal(); var coordSysRect = cartesian.grid.getRect(); var opt = { ecSize: {width: api.getWidth(), height: api.getHeight()}, seriesModel: seriesModel, coordSys: cartesian, coordSysExtent: [ [coordSysRect.x, coordSysRect.x + coordSysRect.width], [coordSysRect.y, coordSysRect.y + coordSysRect.height] ], isHorizontal: isHorizontal, valueDim: LAYOUT_ATTRS[+isHorizontal], categoryDim: LAYOUT_ATTRS[1 - isHorizontal] }; data.diff(oldData) .add(function (dataIndex) { if (!data.hasValue(dataIndex)) { return; } var itemModel = getItemModel(data, dataIndex); var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt); var bar = createBar(data, opt, symbolMeta); data.setItemGraphicEl(dataIndex, bar); group.add(bar); updateCommon$1(bar, opt, symbolMeta); }) .update(function (newIndex, oldIndex) { var bar = oldData.getItemGraphicEl(oldIndex); if (!data.hasValue(newIndex)) { group.remove(bar); return; } var itemModel = getItemModel(data, newIndex); var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt); var pictorialShapeStr = getShapeStr(data, symbolMeta); if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) { group.remove(bar); data.setItemGraphicEl(newIndex, null); bar = null; } if (bar) { updateBar(bar, opt, symbolMeta); } else { bar = createBar(data, opt, symbolMeta, true); } data.setItemGraphicEl(newIndex, bar); bar.__pictorialSymbolMeta = symbolMeta; // Add back group.add(bar); updateCommon$1(bar, opt, symbolMeta); }) .remove(function (dataIndex) { var bar = oldData.getItemGraphicEl(dataIndex); bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar); }) .execute(); this._data = data; return this.group; }, dispose: noop, remove: function (ecModel, api) { var group = this.group; var data = this._data; if (ecModel.get('animation')) { if (data) { data.eachItemGraphicEl(function (bar) { removeBar(data, bar.dataIndex, ecModel, bar); }); } } else { group.removeAll(); } } }); // Set or calculate default value about symbol, and calculate layout info. function getSymbolMeta(data, dataIndex, itemModel, opt) { var layout = data.getItemLayout(dataIndex); var symbolRepeat = itemModel.get('symbolRepeat'); var symbolClip = itemModel.get('symbolClip'); var symbolPosition = itemModel.get('symbolPosition') || 'start'; var symbolRotate = itemModel.get('symbolRotate'); var rotation = (symbolRotate || 0) * Math.PI / 180 || 0; var symbolPatternSize = itemModel.get('symbolPatternSize') || 2; var isAnimationEnabled = itemModel.isAnimationEnabled(); var symbolMeta = { dataIndex: dataIndex, layout: layout, itemModel: itemModel, symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle', color: data.getItemVisual(dataIndex, 'color'), symbolClip: symbolClip, symbolRepeat: symbolRepeat, symbolRepeatDirection: itemModel.get('symbolRepeatDirection'), symbolPatternSize: symbolPatternSize, rotation: rotation, animationModel: isAnimationEnabled ? itemModel : null, hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'), z2: itemModel.getShallow('z', true) || 0 }; prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta); prepareSymbolSize( data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta ); prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta); var symbolSize = symbolMeta.symbolSize; var symbolOffset = itemModel.get('symbolOffset'); if (isArray(symbolOffset)) { symbolOffset = [ parsePercent$1(symbolOffset[0], symbolSize[0]), parsePercent$1(symbolOffset[1], symbolSize[1]) ]; } prepareLayoutInfo( itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta ); return symbolMeta; } // bar length can be negative. function prepareBarLength(itemModel, symbolRepeat, layout, opt, output) { var valueDim = opt.valueDim; var symbolBoundingData = itemModel.get('symbolBoundingData'); var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis()); var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0)); var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0); var boundingLength; if (isArray(symbolBoundingData)) { var symbolBoundingExtent = [ convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx ]; symbolBoundingExtent[1] < symbolBoundingExtent[0] && (symbolBoundingExtent.reverse()); boundingLength = symbolBoundingExtent[pxSignIdx]; } else if (symbolBoundingData != null) { boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx; } else if (symbolRepeat) { boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx; } else { boundingLength = layout[valueDim.wh]; } output.boundingLength = boundingLength; if (symbolRepeat) { output.repeatCutLength = layout[valueDim.wh]; } output.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0; } function convertToCoordOnAxis(axis, value) { return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value))); } // Support ['100%', '100%'] function prepareSymbolSize( data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, output ) { var valueDim = opt.valueDim; var categoryDim = opt.categoryDim; var categorySize = Math.abs(layout[categoryDim.wh]); var symbolSize = data.getItemVisual(dataIndex, 'symbolSize'); if (isArray(symbolSize)) { symbolSize = symbolSize.slice(); } else { if (symbolSize == null) { symbolSize = '100%'; } symbolSize = [symbolSize, symbolSize]; } // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is // to complicated to calculate real percent value if considering scaled lineWidth. // So the actual size will bigger than layout size if lineWidth is bigger than zero, // which can be tolerated in pictorial chart. symbolSize[categoryDim.index] = parsePercent$1( symbolSize[categoryDim.index], categorySize ); symbolSize[valueDim.index] = parsePercent$1( symbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength) ); output.symbolSize = symbolSize; // If x or y is less than zero, show reversed shape. var symbolScale = output.symbolScale = [ symbolSize[0] / symbolPatternSize, symbolSize[1] / symbolPatternSize ]; // Follow convention, 'right' and 'top' is the normal scale. symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign; } function prepareLineWidth(itemModel, symbolScale, rotation, opt, output) { // In symbols are drawn with scale, so do not need to care about the case that width // or height are too small. But symbol use strokeNoScale, where acture lineWidth should // be calculated. var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY$1) || 0; if (valueLineWidth) { pathForLineWidth.attr({ scale: symbolScale.slice(), rotation: rotation }); pathForLineWidth.updateTransform(); valueLineWidth /= pathForLineWidth.getLineScale(); valueLineWidth *= symbolScale[opt.valueDim.index]; } output.valueLineWidth = valueLineWidth; } function prepareLayoutInfo( itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, output ) { var categoryDim = opt.categoryDim; var valueDim = opt.valueDim; var pxSign = output.pxSign; var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0); var pathLen = unitLength; // Note: rotation will not effect the layout of symbols, because user may // want symbols to rotate on its center, which should not be translated // when rotating. if (symbolRepeat) { var absBoundingLength = Math.abs(boundingLength); var symbolMargin = retrieve(itemModel.get('symbolMargin'), '15%') + ''; var hasEndGap = false; if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) { hasEndGap = true; symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1); } symbolMargin = parsePercent$1(symbolMargin, symbolSize[valueDim.index]); var uLenWithMargin = Math.max(unitLength + symbolMargin * 2, 0); // When symbol margin is less than 0, margin at both ends will be subtracted // to ensure that all of the symbols will not be overflow the given area. var endFix = hasEndGap ? 0 : symbolMargin * 2; // Both final repeatTimes and final symbolMargin area calculated based on // boundingLength. var repeatSpecified = isNumeric(symbolRepeat); var repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin); // Adjust calculate margin, to ensure each symbol is displayed // entirely in the given layout area. var mDiff = absBoundingLength - repeatTimes * unitLength; symbolMargin = mDiff / 2 / (hasEndGap ? repeatTimes : repeatTimes - 1); uLenWithMargin = unitLength + symbolMargin * 2; endFix = hasEndGap ? 0 : symbolMargin * 2; // Update repeatTimes when not all symbol will be shown. if (!repeatSpecified && symbolRepeat !== 'fixed') { repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0; } pathLen = repeatTimes * uLenWithMargin - endFix; output.repeatTimes = repeatTimes; output.symbolMargin = symbolMargin; } var sizeFix = pxSign * (pathLen / 2); var pathPosition = output.pathPosition = []; pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2; pathPosition[valueDim.index] = symbolPosition === 'start' ? sizeFix : symbolPosition === 'end' ? boundingLength - sizeFix : boundingLength / 2; // 'center' if (symbolOffset) { pathPosition[0] += symbolOffset[0]; pathPosition[1] += symbolOffset[1]; } var bundlePosition = output.bundlePosition = []; bundlePosition[categoryDim.index] = layout[categoryDim.xy]; bundlePosition[valueDim.index] = layout[valueDim.xy]; var barRectShape = output.barRectShape = extend({}, layout); barRectShape[valueDim.wh] = pxSign * Math.max( Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix) ); barRectShape[categoryDim.wh] = layout[categoryDim.wh]; var clipShape = output.clipShape = {}; // Consider that symbol may be overflow layout rect. clipShape[categoryDim.xy] = -layout[categoryDim.xy]; clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh]; clipShape[valueDim.xy] = 0; clipShape[valueDim.wh] = layout[valueDim.wh]; } function createPath(symbolMeta) { var symbolPatternSize = symbolMeta.symbolPatternSize; var path = createSymbol( // Consider texture img, make a big size. symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize, symbolMeta.color ); path.attr({ culling: true }); path.type !== 'image' && path.setStyle({ strokeNoScale: true }); return path; } function createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) { var bundle = bar.__pictorialBundle; var symbolSize = symbolMeta.symbolSize; var valueLineWidth = symbolMeta.valueLineWidth; var pathPosition = symbolMeta.pathPosition; var valueDim = opt.valueDim; var repeatTimes = symbolMeta.repeatTimes || 0; var index = 0; var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2; eachPath(bar, function (path) { path.__pictorialAnimationIndex = index; path.__pictorialRepeatTimes = repeatTimes; if (index < repeatTimes) { updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate); } else { updateAttr(path, null, {scale: [0, 0]}, symbolMeta, isUpdate, function () { bundle.remove(path); }); } updateHoverAnimation(path, symbolMeta); index++; }); for (; index < repeatTimes; index++) { var path = createPath(symbolMeta); path.__pictorialAnimationIndex = index; path.__pictorialRepeatTimes = repeatTimes; bundle.add(path); var target = makeTarget(index); updateAttr( path, { position: target.position, scale: [0, 0] }, { scale: target.scale, rotation: target.rotation }, symbolMeta, isUpdate ); // FIXME // If all emphasis/normal through action. path .on('mouseover', onMouseOver) .on('mouseout', onMouseOut); updateHoverAnimation(path, symbolMeta); } function makeTarget(index) { var position = pathPosition.slice(); // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index // Otherwise: i = index; var pxSign = symbolMeta.pxSign; var i = index; if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) { i = repeatTimes - 1 - index; } position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index]; return { position: position, scale: symbolMeta.symbolScale.slice(), rotation: symbolMeta.rotation }; } function onMouseOver() { eachPath(bar, function (path) { path.trigger('emphasis'); }); } function onMouseOut() { eachPath(bar, function (path) { path.trigger('normal'); }); } } function createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) { var bundle = bar.__pictorialBundle; var mainPath = bar.__pictorialMainPath; if (!mainPath) { mainPath = bar.__pictorialMainPath = createPath(symbolMeta); bundle.add(mainPath); updateAttr( mainPath, { position: symbolMeta.pathPosition.slice(), scale: [0, 0], rotation: symbolMeta.rotation }, { scale: symbolMeta.symbolScale.slice() }, symbolMeta, isUpdate ); mainPath .on('mouseover', onMouseOver) .on('mouseout', onMouseOut); } else { updateAttr( mainPath, null, { position: symbolMeta.pathPosition.slice(), scale: symbolMeta.symbolScale.slice(), rotation: symbolMeta.rotation }, symbolMeta, isUpdate ); } updateHoverAnimation(mainPath, symbolMeta); function onMouseOver() { this.trigger('emphasis'); } function onMouseOut() { this.trigger('normal'); } } // bar rect is used for label. function createOrUpdateBarRect(bar, symbolMeta, isUpdate) { var rectShape = extend({}, symbolMeta.barRectShape); var barRect = bar.__pictorialBarRect; if (!barRect) { barRect = bar.__pictorialBarRect = new Rect({ z2: 2, shape: rectShape, silent: true, style: { stroke: 'transparent', fill: 'transparent', lineWidth: 0 } }); bar.add(barRect); } else { updateAttr(barRect, null, {shape: rectShape}, symbolMeta, isUpdate); } } function createOrUpdateClip(bar, opt, symbolMeta, isUpdate) { // If not clip, symbol will be remove and rebuilt. if (symbolMeta.symbolClip) { var clipPath = bar.__pictorialClipPath; var clipShape = extend({}, symbolMeta.clipShape); var valueDim = opt.valueDim; var animationModel = symbolMeta.animationModel; var dataIndex = symbolMeta.dataIndex; if (clipPath) { updateProps( clipPath, {shape: clipShape}, animationModel, dataIndex ); } else { clipShape[valueDim.wh] = 0; clipPath = new Rect({shape: clipShape}); bar.__pictorialBundle.setClipPath(clipPath); bar.__pictorialClipPath = clipPath; var target = {}; target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh]; graphic[isUpdate ? 'updateProps' : 'initProps']( clipPath, {shape: target}, animationModel, dataIndex ); } } } function getItemModel(data, dataIndex) { var itemModel = data.getItemModel(dataIndex); itemModel.getAnimationDelayParams = getAnimationDelayParams; itemModel.isAnimationEnabled = isAnimationEnabled; return itemModel; } function getAnimationDelayParams(path) { // The order is the same as the z-order, see `symbolRepeatDiretion`. return { index: path.__pictorialAnimationIndex, count: path.__pictorialRepeatTimes }; } function isAnimationEnabled() { // `animation` prop can be set on itemModel in pictorial bar chart. return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation'); } function updateHoverAnimation(path, symbolMeta) { path.off('emphasis').off('normal'); var scale = symbolMeta.symbolScale.slice(); symbolMeta.hoverAnimation && path .on('emphasis', function() { this.animateTo({ scale: [scale[0] * 1.1, scale[1] * 1.1] }, 400, 'elasticOut'); }) .on('normal', function() { this.animateTo({ scale: scale.slice() }, 400, 'elasticOut'); }); } function createBar(data, opt, symbolMeta, isUpdate) { // bar is the main element for each data. var bar = new Group(); // bundle is used for location and clip. var bundle = new Group(); bar.add(bundle); bar.__pictorialBundle = bundle; bundle.attr('position', symbolMeta.bundlePosition.slice()); if (symbolMeta.symbolRepeat) { createOrUpdateRepeatSymbols(bar, opt, symbolMeta); } else { createOrUpdateSingleSymbol(bar, opt, symbolMeta); } createOrUpdateBarRect(bar, symbolMeta, isUpdate); createOrUpdateClip(bar, opt, symbolMeta, isUpdate); bar.__pictorialShapeStr = getShapeStr(data, symbolMeta); bar.__pictorialSymbolMeta = symbolMeta; return bar; } function updateBar(bar, opt, symbolMeta) { var animationModel = symbolMeta.animationModel; var dataIndex = symbolMeta.dataIndex; var bundle = bar.__pictorialBundle; updateProps( bundle, {position: symbolMeta.bundlePosition.slice()}, animationModel, dataIndex ); if (symbolMeta.symbolRepeat) { createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true); } else { createOrUpdateSingleSymbol(bar, opt, symbolMeta, true); } createOrUpdateBarRect(bar, symbolMeta, true); createOrUpdateClip(bar, opt, symbolMeta, true); } function removeBar(data, dataIndex, animationModel, bar) { // Not show text when animating var labelRect = bar.__pictorialBarRect; labelRect && (labelRect.style.text = null); var pathes = []; eachPath(bar, function (path) { pathes.push(path); }); bar.__pictorialMainPath && pathes.push(bar.__pictorialMainPath); // I do not find proper remove animation for clip yet. bar.__pictorialClipPath && (animationModel = null); each$1(pathes, function (path) { updateProps( path, {scale: [0, 0]}, animationModel, dataIndex, function () { bar.parent && bar.parent.remove(bar); } ); }); data.setItemGraphicEl(dataIndex, null); } function getShapeStr(data, symbolMeta) { return [ data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip ].join(':'); } function eachPath(bar, cb, context) { // Do not use Group#eachChild, because it do not support remove. each$1(bar.__pictorialBundle.children(), function (el) { el !== bar.__pictorialBarRect && cb.call(context, el); }); } function updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) { immediateAttrs && el.attr(immediateAttrs); // when symbolCip used, only clip path has init animation, otherwise it would be weird effect. if (symbolMeta.symbolClip && !isUpdate) { animationAttrs && el.attr(animationAttrs); } else { animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps']( el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb ); } } function updateCommon$1(bar, opt, symbolMeta) { var color = symbolMeta.color; var dataIndex = symbolMeta.dataIndex; var itemModel = symbolMeta.itemModel; // Color must be excluded. // Because symbol provide setColor individually to set fill and stroke var normalStyle = itemModel.getModel('itemStyle').getItemStyle(['color']); var hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); var cursorStyle = itemModel.getShallow('cursor'); eachPath(bar, function (path) { // PENDING setColor should be before setStyle!!! path.setColor(color); path.setStyle(defaults( { fill: color, opacity: symbolMeta.opacity }, normalStyle )); setHoverStyle(path, hoverStyle); cursorStyle && (path.cursor = cursorStyle); path.z2 = symbolMeta.z2; }); var barRectHoverStyle = {}; var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)]; var barRect = bar.__pictorialBarRect; setLabel( barRect.style, barRectHoverStyle, itemModel, color, opt.seriesModel, dataIndex, barPositionOutside ); setHoverStyle(barRect, barRectHoverStyle); } function toIntTimes(times) { var roundedTimes = Math.round(times); // Escapse accurate error return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // In case developer forget to include grid component registerLayout(curry( layout, 'pictorialBar' )); registerVisual(visualSymbol('pictorialBar', 'roundRect')); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @constructor module:echarts/coord/single/SingleAxis * @extends {module:echarts/coord/Axis} * @param {string} dim * @param {*} scale * @param {Array.} coordExtent * @param {string} axisType * @param {string} position */ var SingleAxis = function (dim, scale, coordExtent, axisType, position) { Axis.call(this, dim, scale, coordExtent); /** * Axis type * - 'category' * - 'value' * - 'time' * - 'log' * @type {string} */ this.type = axisType || 'value'; /** * Axis position * - 'top' * - 'bottom' * - 'left' * - 'right' * @type {string} */ this.position = position || 'bottom'; /** * Axis orient * - 'horizontal' * - 'vertical' * @type {[type]} */ this.orient = null; }; SingleAxis.prototype = { constructor: SingleAxis, /** * Axis model * @type {module:echarts/coord/single/AxisModel} */ model: null, /** * Judge the orient of the axis. * @return {boolean} */ isHorizontal: function () { var position = this.position; return position === 'top' || position === 'bottom'; }, /** * @override */ pointToData: function (point, clamp) { return this.coordinateSystem.pointToData(point, clamp)[0]; }, /** * Convert the local coord(processed by dataToCoord()) * to global coord(concrete pixel coord). * designated by module:echarts/coord/single/Single. * @type {Function} */ toGlobalCoord: null, /** * Convert the global coord to local coord. * designated by module:echarts/coord/single/Single. * @type {Function} */ toLocalCoord: null }; inherits(SingleAxis, Axis); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Single coordinates system. */ /** * Create a single coordinates system. * * @param {module:echarts/coord/single/AxisModel} axisModel * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api */ function Single(axisModel, ecModel, api) { /** * @type {string} * @readOnly */ this.dimension = 'single'; /** * Add it just for draw tooltip. * * @type {Array.} * @readOnly */ this.dimensions = ['single']; /** * @private * @type {module:echarts/coord/single/SingleAxis}. */ this._axis = null; /** * @private * @type {module:zrender/core/BoundingRect} */ this._rect; this._init(axisModel, ecModel, api); /** * @type {module:echarts/coord/single/AxisModel} */ this.model = axisModel; } Single.prototype = { type: 'singleAxis', axisPointerEnabled: true, constructor: Single, /** * Initialize single coordinate system. * * @param {module:echarts/coord/single/AxisModel} axisModel * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api * @private */ _init: function (axisModel, ecModel, api) { var dim = this.dimension; var axis = new SingleAxis( dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position') ); var isCategory = axis.type === 'category'; axis.onBand = isCategory && axisModel.get('boundaryGap'); axis.inverse = axisModel.get('inverse'); axis.orient = axisModel.get('orient'); axisModel.axis = axis; axis.model = axisModel; axis.coordinateSystem = this; this._axis = axis; }, /** * Update axis scale after data processed * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api */ update: function (ecModel, api) { ecModel.eachSeries(function (seriesModel) { if (seriesModel.coordinateSystem === this) { var data = seriesModel.getData(); each$1(data.mapDimension(this.dimension, true), function (dim) { this._axis.scale.unionExtentFromData(data, dim); }, this); niceScaleExtent(this._axis.scale, this._axis.model); } }, this); }, /** * Resize the single coordinate system. * * @param {module:echarts/coord/single/AxisModel} axisModel * @param {module:echarts/ExtensionAPI} api */ resize: function (axisModel, api) { this._rect = getLayoutRect( { left: axisModel.get('left'), top: axisModel.get('top'), right: axisModel.get('right'), bottom: axisModel.get('bottom'), width: axisModel.get('width'), height: axisModel.get('height') }, { width: api.getWidth(), height: api.getHeight() } ); this._adjustAxis(); }, /** * @return {module:zrender/core/BoundingRect} */ getRect: function () { return this._rect; }, /** * @private */ _adjustAxis: function () { var rect = this._rect; var axis = this._axis; var isHorizontal = axis.isHorizontal(); var extent = isHorizontal ? [0, rect.width] : [0, rect.height]; var idx = axis.reverse ? 1 : 0; axis.setExtent(extent[idx], extent[1 - idx]); this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y); }, /** * @param {module:echarts/coord/single/SingleAxis} axis * @param {number} coordBase */ _updateAxisTransform: function (axis, coordBase) { var axisExtent = axis.getExtent(); var extentSum = axisExtent[0] + axisExtent[1]; var isHorizontal = axis.isHorizontal(); axis.toGlobalCoord = isHorizontal ? function (coord) { return coord + coordBase; } : function (coord) { return extentSum - coord + coordBase; }; axis.toLocalCoord = isHorizontal ? function (coord) { return coord - coordBase; } : function (coord) { return extentSum - coord + coordBase; }; }, /** * Get axis. * * @return {module:echarts/coord/single/SingleAxis} */ getAxis: function () { return this._axis; }, /** * Get axis, add it just for draw tooltip. * * @return {[type]} [description] */ getBaseAxis: function () { return this._axis; }, /** * @return {Array.} */ getAxes: function () { return [this._axis]; }, /** * @return {Object} {baseAxes: [], otherAxes: []} */ getTooltipAxes: function () { return {baseAxes: [this.getAxis()]}; }, /** * If contain point. * * @param {Array.} point * @return {boolean} */ containPoint: function (point) { var rect = this.getRect(); var axis = this.getAxis(); var orient = axis.orient; if (orient === 'horizontal') { return axis.contain(axis.toLocalCoord(point[0])) && (point[1] >= rect.y && point[1] <= (rect.y + rect.height)); } else { return axis.contain(axis.toLocalCoord(point[1])) && (point[0] >= rect.y && point[0] <= (rect.y + rect.height)); } }, /** * @param {Array.} point * @return {Array.} */ pointToData: function (point) { var axis = this.getAxis(); return [axis.coordToData(axis.toLocalCoord( point[axis.orient === 'horizontal' ? 0 : 1] ))]; }, /** * Convert the series data to concrete point. * * @param {number|Array.} val * @return {Array.} */ dataToPoint: function (val) { var axis = this.getAxis(); var rect = this.getRect(); var pt = []; var idx = axis.orient === 'horizontal' ? 0 : 1; if (val instanceof Array) { val = val[0]; } pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val)); pt[1 - idx] = idx === 0 ? (rect.y + rect.height / 2) : (rect.x + rect.width / 2); return pt; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Single coordinate system creator. */ /** * Create single coordinate system and inject it into seriesModel. * * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api * @return {Array.} */ function create$3(ecModel, api) { var singles = []; ecModel.eachComponent('singleAxis', function(axisModel, idx) { var single = new Single(axisModel, ecModel, api); single.name = 'single_' + idx; single.resize(axisModel, api); axisModel.coordinateSystem = single; singles.push(single); }); ecModel.eachSeries(function (seriesModel) { if (seriesModel.get('coordinateSystem') === 'singleAxis') { var singleAxisModel = ecModel.queryComponents({ mainType: 'singleAxis', index: seriesModel.get('singleAxisIndex'), id: seriesModel.get('singleAxisId') })[0]; seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem; } }); return singles; } CoordinateSystemManager.register('single', { create: create$3, dimensions: Single.prototype.dimensions }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @param {Object} opt {labelInside} * @return {Object} { * position, rotation, labelDirection, labelOffset, * tickDirection, labelRotate, z2 * } */ function layout$2(axisModel, opt) { opt = opt || {}; var single = axisModel.coordinateSystem; var axis = axisModel.axis; var layout = {}; var axisPosition = axis.position; var orient = axis.orient; var rect = single.getRect(); var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; var positionMap = { horizontal: {top: rectBound[2], bottom: rectBound[3]}, vertical: {left: rectBound[0], right: rectBound[1]} }; layout.position = [ orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3] ]; var r = {horizontal: 0, vertical: 1}; layout.rotation = Math.PI / 2 * r[orient]; var directionMap = {top: -1, bottom: 1, right: 1, left: -1}; layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition]; if (axisModel.get('axisTick.inside')) { layout.tickDirection = -layout.tickDirection; } if (retrieve(opt.labelInside, axisModel.get('axisLabel.inside'))) { layout.labelDirection = -layout.labelDirection; } var labelRotation = opt.rotate; labelRotation == null && (labelRotation = axisModel.get('axisLabel.rotate')); layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation; layout.z2 = 1; return layout; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var axisBuilderAttrs$2 = [ 'axisLine', 'axisTickLabel', 'axisName' ]; var selfBuilderAttr = 'splitLine'; var SingleAxisView = AxisView.extend({ type: 'singleAxis', axisPointerClass: 'SingleAxisPointer', render: function (axisModel, ecModel, api, payload) { var group = this.group; group.removeAll(); var layout = layout$2(axisModel); var axisBuilder = new AxisBuilder(axisModel, layout); each$1(axisBuilderAttrs$2, axisBuilder.add, axisBuilder); group.add(axisBuilder.getGroup()); if (axisModel.get(selfBuilderAttr + '.show')) { this['_' + selfBuilderAttr](axisModel); } SingleAxisView.superCall(this, 'render', axisModel, ecModel, api, payload); }, _splitLine: function(axisModel) { var axis = axisModel.axis; if (axis.scale.isBlank()) { return; } var splitLineModel = axisModel.getModel('splitLine'); var lineStyleModel = splitLineModel.getModel('lineStyle'); var lineWidth = lineStyleModel.get('width'); var lineColors = lineStyleModel.get('color'); lineColors = lineColors instanceof Array ? lineColors : [lineColors]; var gridRect = axisModel.coordinateSystem.getRect(); var isHorizontal = axis.isHorizontal(); var splitLines = []; var lineCount = 0; var ticksCoords = axis.getTicksCoords({ tickModel: splitLineModel }); var p1 = []; var p2 = []; for (var i = 0; i < ticksCoords.length; ++i) { var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); if (isHorizontal) { p1[0] = tickCoord; p1[1] = gridRect.y; p2[0] = tickCoord; p2[1] = gridRect.y + gridRect.height; } else { p1[0] = gridRect.x; p1[1] = tickCoord; p2[0] = gridRect.x + gridRect.width; p2[1] = tickCoord; } var colorIndex = (lineCount++) % lineColors.length; splitLines[colorIndex] = splitLines[colorIndex] || []; splitLines[colorIndex].push(new Line( subPixelOptimizeLine({ shape: { x1: p1[0], y1: p1[1], x2: p2[0], y2: p2[1] }, style: { lineWidth: lineWidth }, silent: true }))); } for (var i = 0; i < splitLines.length; ++i) { this.group.add(mergePath(splitLines[i], { style: { stroke: lineColors[i % lineColors.length], lineDash: lineStyleModel.getLineDash(lineWidth), lineWidth: lineWidth }, silent: true })); } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var AxisModel$4 = ComponentModel.extend({ type: 'singleAxis', layoutMode: 'box', /** * @type {module:echarts/coord/single/SingleAxis} */ axis: null, /** * @type {module:echarts/coord/single/Single} */ coordinateSystem: null, /** * @override */ getCoordSysModel: function () { return this; } }); var defaultOption$2 = { left: '5%', top: '5%', right: '5%', bottom: '5%', type: 'value', position: 'bottom', orient: 'horizontal', axisLine: { show: true, lineStyle: { width: 2, type: 'solid' } }, // Single coordinate system and single axis is the, // which is used as the parent tooltip model. // same model, so we set default tooltip show as true. tooltip: { show: true }, axisTick: { show: true, length: 6, lineStyle: { width: 2 } }, axisLabel: { show: true, interval: 'auto' }, splitLine: { show: true, lineStyle: { type: 'dashed', opacity: 0.2 } } }; function getAxisType$2(axisName, option) { return option.type || (option.data ? 'category' : 'value'); } merge(AxisModel$4.prototype, axisModelCommonMixin); axisModelCreator('single', AxisModel$4, getAxisType$2, defaultOption$2); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @param {Object} finder contains {seriesIndex, dataIndex, dataIndexInside} * @param {module:echarts/model/Global} ecModel * @return {Object} {point: [x, y], el: ...} point Will not be null. */ var findPointFromSeries = function (finder, ecModel) { var point = []; var seriesIndex = finder.seriesIndex; var seriesModel; if (seriesIndex == null || !( seriesModel = ecModel.getSeriesByIndex(seriesIndex) )) { return {point: []}; } var data = seriesModel.getData(); var dataIndex = queryDataIndex(data, finder); if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) { return {point: []}; } var el = data.getItemGraphicEl(dataIndex); var coordSys = seriesModel.coordinateSystem; if (seriesModel.getTooltipPosition) { point = seriesModel.getTooltipPosition(dataIndex) || []; } else if (coordSys && coordSys.dataToPoint) { point = coordSys.dataToPoint( data.getValues( map(coordSys.dimensions, function (dim) { return data.mapDimension(dim); }), dataIndex, true ) ) || []; } else if (el) { // Use graphic bounding rect var rect = el.getBoundingRect().clone(); rect.applyTransform(el.transform); point = [ rect.x + rect.width / 2, rect.y + rect.height / 2 ]; } return {point: point, el: el}; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$14 = each$1; var curry$3 = curry; var inner$7 = makeInner(); /** * Basic logic: check all axis, if they do not demand show/highlight, * then hide/downplay them. * * @param {Object} coordSysAxesInfo * @param {Object} payload * @param {string} [payload.currTrigger] 'click' | 'mousemove' | 'leave' * @param {Array.} [payload.x] x and y, which are mandatory, specify a point to * trigger axisPointer and tooltip. * @param {Array.} [payload.y] x and y, which are mandatory, specify a point to * trigger axisPointer and tooltip. * @param {Object} [payload.seriesIndex] finder, optional, restrict target axes. * @param {Object} [payload.dataIndex] finder, restrict target axes. * @param {Object} [payload.axesInfo] finder, restrict target axes. * [{ * axisDim: 'x'|'y'|'angle'|..., * axisIndex: ..., * value: ... * }, ...] * @param {Function} [payload.dispatchAction] * @param {Object} [payload.tooltipOption] * @param {Object|Array.|Function} [payload.position] Tooltip position, * which can be specified in dispatchAction * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api * @return {Object} content of event obj for echarts.connect. */ var axisTrigger = function (payload, ecModel, api) { var currTrigger = payload.currTrigger; var point = [payload.x, payload.y]; var finder = payload; var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api); var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending // See #6121. But we are not able to reproduce it yet. if (!coordSysAxesInfo) { return; } if (illegalPoint(point)) { // Used in the default behavior of `connection`: use the sample seriesIndex // and dataIndex. And also used in the tooltipView trigger. point = findPointFromSeries({ seriesIndex: finder.seriesIndex, // Do not use dataIndexInside from other ec instance. // FIXME: auto detect it? dataIndex: finder.dataIndex }, ecModel).point; } var isIllegalPoint = illegalPoint(point); // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}). // Notice: In this case, it is difficult to get the `point` (which is necessary to show // tooltip, so if point is not given, we just use the point found by sample seriesIndex // and dataIndex. var inputAxesInfo = finder.axesInfo; var axesInfo = coordSysAxesInfo.axesInfo; var shouldHide = currTrigger === 'leave' || illegalPoint(point); var outputFinder = {}; var showValueMap = {}; var dataByCoordSys = {list: [], map: {}}; var updaters = { showPointer: curry$3(showPointer, showValueMap), showTooltip: curry$3(showTooltip, dataByCoordSys) }; // Process for triggered axes. each$14(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) { // If a point given, it must be contained by the coordinate system. var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point); each$14(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) { var axis = axisInfo.axis; var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted. if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) { var val = inputAxisInfo && inputAxisInfo.value; if (val == null && !isIllegalPoint) { val = axis.pointToData(point); } val != null && processOnAxis(axisInfo, val, updaters, false, outputFinder); } }); }); // Process for linked axes. var linkTriggers = {}; each$14(axesInfo, function (tarAxisInfo, tarKey) { var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link. if (linkGroup && !showValueMap[tarKey]) { each$14(linkGroup.axesInfo, function (srcAxisInfo, srcKey) { var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis. if (srcAxisInfo !== tarAxisInfo && srcValItem) { var val = srcValItem.value; linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper( val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo) ))); linkTriggers[tarAxisInfo.key] = val; } }); } }); each$14(linkTriggers, function (val, tarKey) { processOnAxis(axesInfo[tarKey], val, updaters, true, outputFinder); }); updateModelActually(showValueMap, axesInfo, outputFinder); dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction); dispatchHighDownActually(axesInfo, dispatchAction, api); return outputFinder; }; function processOnAxis(axisInfo, newValue, updaters, dontSnap, outputFinder) { var axis = axisInfo.axis; if (axis.scale.isBlank() || !axis.containData(newValue)) { return; } if (!axisInfo.involveSeries) { updaters.showPointer(axisInfo, newValue); return; } // Heavy calculation. So put it after axis.containData checking. var payloadInfo = buildPayloadsBySeries(newValue, axisInfo); var payloadBatch = payloadInfo.payloadBatch; var snapToValue = payloadInfo.snapToValue; // Fill content of event obj for echarts.connect. // By defualt use the first involved series data as a sample to connect. if (payloadBatch[0] && outputFinder.seriesIndex == null) { extend(outputFinder, payloadBatch[0]); } // If no linkSource input, this process is for collecting link // target, where snap should not be accepted. if (!dontSnap && axisInfo.snap) { if (axis.containData(snapToValue) && snapToValue != null) { newValue = snapToValue; } } updaters.showPointer(axisInfo, newValue, payloadBatch, outputFinder); // Tooltip should always be snapToValue, otherwise there will be // incorrect "axis value ~ series value" mapping displayed in tooltip. updaters.showTooltip(axisInfo, payloadInfo, snapToValue); } function buildPayloadsBySeries(value, axisInfo) { var axis = axisInfo.axis; var dim = axis.dim; var snapToValue = value; var payloadBatch = []; var minDist = Number.MAX_VALUE; var minDiff = -1; each$14(axisInfo.seriesModels, function (series, idx) { var dataDim = series.getData().mapDimension(dim, true); var seriesNestestValue; var dataIndices; if (series.getAxisTooltipData) { var result = series.getAxisTooltipData(dataDim, value, axis); dataIndices = result.dataIndices; seriesNestestValue = result.nestestValue; } else { dataIndices = series.getData().indicesOfNearest( dataDim[0], value, // Add a threshold to avoid find the wrong dataIndex // when data length is not same. // false, axis.type === 'category' ? 0.5 : null ); if (!dataIndices.length) { return; } seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]); } if (seriesNestestValue == null || !isFinite(seriesNestestValue)) { return; } var diff = value - seriesNestestValue; var dist = Math.abs(diff); // Consider category case if (dist <= minDist) { if (dist < minDist || (diff >= 0 && minDiff < 0)) { minDist = dist; minDiff = diff; snapToValue = seriesNestestValue; payloadBatch.length = 0; } each$14(dataIndices, function (dataIndex) { payloadBatch.push({ seriesIndex: series.seriesIndex, dataIndexInside: dataIndex, dataIndex: series.getData().getRawIndex(dataIndex) }); }); } }); return { payloadBatch: payloadBatch, snapToValue: snapToValue }; } function showPointer(showValueMap, axisInfo, value, payloadBatch) { showValueMap[axisInfo.key] = {value: value, payloadBatch: payloadBatch}; } function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) { var payloadBatch = payloadInfo.payloadBatch; var axis = axisInfo.axis; var axisModel = axis.model; var axisPointerModel = axisInfo.axisPointerModel; // If no data, do not create anything in dataByCoordSys, // whose length will be used to judge whether dispatch action. if (!axisInfo.triggerTooltip || !payloadBatch.length) { return; } var coordSysModel = axisInfo.coordSys.model; var coordSysKey = makeKey(coordSysModel); var coordSysItem = dataByCoordSys.map[coordSysKey]; if (!coordSysItem) { coordSysItem = dataByCoordSys.map[coordSysKey] = { coordSysId: coordSysModel.id, coordSysIndex: coordSysModel.componentIndex, coordSysType: coordSysModel.type, coordSysMainType: coordSysModel.mainType, dataByAxis: [] }; dataByCoordSys.list.push(coordSysItem); } coordSysItem.dataByAxis.push({ axisDim: axis.dim, axisIndex: axisModel.componentIndex, axisType: axisModel.type, axisId: axisModel.id, value: value, // Caustion: viewHelper.getValueLabel is actually on "view stage", which // depends that all models have been updated. So it should not be performed // here. Considering axisPointerModel used here is volatile, which is hard // to be retrieve in TooltipView, we prepare parameters here. valueLabelOpt: { precision: axisPointerModel.get('label.precision'), formatter: axisPointerModel.get('label.formatter') }, seriesDataIndices: payloadBatch.slice() }); } function updateModelActually(showValueMap, axesInfo, outputFinder) { var outputAxesInfo = outputFinder.axesInfo = []; // Basic logic: If no 'show' required, 'hide' this axisPointer. each$14(axesInfo, function (axisInfo, key) { var option = axisInfo.axisPointerModel.option; var valItem = showValueMap[key]; if (valItem) { !axisInfo.useHandle && (option.status = 'show'); option.value = valItem.value; // For label formatter param and highlight. option.seriesDataIndices = (valItem.payloadBatch || []).slice(); } // When always show (e.g., handle used), remain // original value and status. else { // If hide, value still need to be set, consider // click legend to toggle axis blank. !axisInfo.useHandle && (option.status = 'hide'); } // If status is 'hide', should be no info in payload. option.status === 'show' && outputAxesInfo.push({ axisDim: axisInfo.axis.dim, axisIndex: axisInfo.axis.model.componentIndex, value: option.value }); }); } function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) { // Basic logic: If no showTip required, hideTip will be dispatched. if (illegalPoint(point) || !dataByCoordSys.list.length) { dispatchAction({type: 'hideTip'}); return; } // In most case only one axis (or event one series is used). It is // convinient to fetch payload.seriesIndex and payload.dataIndex // dirtectly. So put the first seriesIndex and dataIndex of the first // axis on the payload. var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {}; dispatchAction({ type: 'showTip', escapeConnect: true, x: point[0], y: point[1], tooltipOption: payload.tooltipOption, position: payload.position, dataIndexInside: sampleItem.dataIndexInside, dataIndex: sampleItem.dataIndex, seriesIndex: sampleItem.seriesIndex, dataByCoordSys: dataByCoordSys.list }); } function dispatchHighDownActually(axesInfo, dispatchAction, api) { // FIXME // highlight status modification shoule be a stage of main process? // (Consider confilct (e.g., legend and axisPointer) and setOption) var zr = api.getZr(); var highDownKey = 'axisPointerLastHighlights'; var lastHighlights = inner$7(zr)[highDownKey] || {}; var newHighlights = inner$7(zr)[highDownKey] = {}; // Update highlight/downplay status according to axisPointer model. // Build hash map and remove duplicate incidentally. each$14(axesInfo, function (axisInfo, key) { var option = axisInfo.axisPointerModel.option; option.status === 'show' && each$14(option.seriesDataIndices, function (batchItem) { var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex; newHighlights[key] = batchItem; }); }); // Diff. var toHighlight = []; var toDownplay = []; each$1(lastHighlights, function (batchItem, key) { !newHighlights[key] && toDownplay.push(batchItem); }); each$1(newHighlights, function (batchItem, key) { !lastHighlights[key] && toHighlight.push(batchItem); }); toDownplay.length && api.dispatchAction({ type: 'downplay', escapeConnect: true, batch: toDownplay }); toHighlight.length && api.dispatchAction({ type: 'highlight', escapeConnect: true, batch: toHighlight }); } function findInputAxisInfo(inputAxesInfo, axisInfo) { for (var i = 0; i < (inputAxesInfo || []).length; i++) { var inputAxisInfo = inputAxesInfo[i]; if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex ) { return inputAxisInfo; } } } function makeMapperParam(axisInfo) { var axisModel = axisInfo.axis.model; var item = {}; var dim = item.axisDim = axisInfo.axis.dim; item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex; item.axisName = item[dim + 'AxisName'] = axisModel.name; item.axisId = item[dim + 'AxisId'] = axisModel.id; return item; } function illegalPoint(point) { return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var AxisPointerModel = extendComponentModel({ type: 'axisPointer', coordSysAxesInfo: null, defaultOption: { // 'auto' means that show when triggered by tooltip or handle. show: 'auto', // 'click' | 'mousemove' | 'none' triggerOn: null, // set default in AxisPonterView.js zlevel: 0, z: 50, type: 'line', // axispointer triggered by tootip determine snap automatically, // see `modelHelper`. snap: false, triggerTooltip: true, value: null, status: null, // Init value depends on whether handle is used. // [group0, group1, ...] // Each group can be: { // mapper: function () {}, // singleTooltip: 'multiple', // 'multiple' or 'single' // xAxisId: ..., // yAxisName: ..., // angleAxisIndex: ... // } // mapper: can be ignored. // input: {axisInfo, value} // output: {axisInfo, value} link: [], // Do not set 'auto' here, otherwise global animation: false // will not effect at this axispointer. animation: null, animationDurationUpdate: 200, lineStyle: { color: '#aaa', width: 1, type: 'solid' }, shadowStyle: { color: 'rgba(150,150,150,0.3)' }, label: { show: true, formatter: null, // string | Function precision: 'auto', // Or a number like 0, 1, 2 ... margin: 3, color: '#fff', padding: [5, 7, 5, 7], backgroundColor: 'auto', // default: axis line color borderColor: null, borderWidth: 0, shadowBlur: 3, shadowColor: '#aaa' // Considering applicability, common style should // better not have shadowOffset. // shadowOffsetX: 0, // shadowOffsetY: 2 }, handle: { show: false, icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z', // jshint ignore:line size: 45, // handle margin is from symbol center to axis, which is stable when circular move. margin: 50, // color: '#1b8bbd' // color: '#2f4554' color: '#333', shadowBlur: 3, shadowColor: '#aaa', shadowOffsetX: 0, shadowOffsetY: 2, // For mobile performance throttle: 40 } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var inner$8 = makeInner(); var each$15 = each$1; /** * @param {string} key * @param {module:echarts/ExtensionAPI} api * @param {Function} handler * param: {string} currTrigger * param: {Array.} point */ function register(key, api, handler) { if (env$1.node) { return; } var zr = api.getZr(); inner$8(zr).records || (inner$8(zr).records = {}); initGlobalListeners(zr, api); var record = inner$8(zr).records[key] || (inner$8(zr).records[key] = {}); record.handler = handler; } function initGlobalListeners(zr, api) { if (inner$8(zr).initialized) { return; } inner$8(zr).initialized = true; useHandler('click', curry(doEnter, 'click')); useHandler('mousemove', curry(doEnter, 'mousemove')); // useHandler('mouseout', onLeave); useHandler('globalout', onLeave); function useHandler(eventType, cb) { zr.on(eventType, function (e) { var dis = makeDispatchAction(api); each$15(inner$8(zr).records, function (record) { record && cb(record, e, dis.dispatchAction); }); dispatchTooltipFinally(dis.pendings, api); }); } } function dispatchTooltipFinally(pendings, api) { var showLen = pendings.showTip.length; var hideLen = pendings.hideTip.length; var actuallyPayload; if (showLen) { actuallyPayload = pendings.showTip[showLen - 1]; } else if (hideLen) { actuallyPayload = pendings.hideTip[hideLen - 1]; } if (actuallyPayload) { actuallyPayload.dispatchAction = null; api.dispatchAction(actuallyPayload); } } function onLeave(record, e, dispatchAction) { record.handler('leave', null, dispatchAction); } function doEnter(currTrigger, record, e, dispatchAction) { record.handler(currTrigger, e, dispatchAction); } function makeDispatchAction(api) { var pendings = { showTip: [], hideTip: [] }; // FIXME // better approach? // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip, // which may be conflict, (axisPointer call showTip but tooltip call hideTip); // So we have to add "final stage" to merge those dispatched actions. var dispatchAction = function (payload) { var pendingList = pendings[payload.type]; if (pendingList) { pendingList.push(payload); } else { payload.dispatchAction = dispatchAction; api.dispatchAction(payload); } }; return { dispatchAction: dispatchAction, pendings: pendings }; } /** * @param {string} key * @param {module:echarts/ExtensionAPI} api */ function unregister(key, api) { if (env$1.node) { return; } var zr = api.getZr(); var record = (inner$8(zr).records || {})[key]; if (record) { inner$8(zr).records[key] = null; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var AxisPointerView = extendComponentView({ type: 'axisPointer', render: function (globalAxisPointerModel, ecModel, api) { var globalTooltipModel = ecModel.getComponent('tooltip'); var triggerOn = globalAxisPointerModel.get('triggerOn') || (globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click'); // Register global listener in AxisPointerView to enable // AxisPointerView to be independent to Tooltip. register( 'axisPointer', api, function (currTrigger, e, dispatchAction) { // If 'none', it is not controlled by mouse totally. if (triggerOn !== 'none' && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0) ) { dispatchAction({ type: 'updateAxisPointer', currTrigger: currTrigger, x: e && e.offsetX, y: e && e.offsetY }); } } ); }, /** * @override */ remove: function (ecModel, api) { unregister(api.getZr(), 'axisPointer'); AxisPointerView.superApply(this._model, 'remove', arguments); }, /** * @override */ dispose: function (ecModel, api) { unregister('axisPointer', api); AxisPointerView.superApply(this._model, 'dispose', arguments); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var inner$9 = makeInner(); var clone$4 = clone; var bind$2 = bind; /** * Base axis pointer class in 2D. * Implemenents {module:echarts/component/axis/IAxisPointer}. */ function BaseAxisPointer () { } BaseAxisPointer.prototype = { /** * @private */ _group: null, /** * @private */ _lastGraphicKey: null, /** * @private */ _handle: null, /** * @private */ _dragging: false, /** * @private */ _lastValue: null, /** * @private */ _lastStatus: null, /** * @private */ _payloadInfo: null, /** * In px, arbitrary value. Do not set too small, * no animation is ok for most cases. * @protected */ animationThreshold: 15, /** * @implement */ render: function (axisModel, axisPointerModel, api, forceRender) { var value = axisPointerModel.get('value'); var status = axisPointerModel.get('status'); // Bind them to `this`, not in closure, otherwise they will not // be replaced when user calling setOption in not merge mode. this._axisModel = axisModel; this._axisPointerModel = axisPointerModel; this._api = api; // Optimize: `render` will be called repeatly during mouse move. // So it is power consuming if performing `render` each time, // especially on mobile device. if (!forceRender && this._lastValue === value && this._lastStatus === status ) { return; } this._lastValue = value; this._lastStatus = status; var group = this._group; var handle = this._handle; if (!status || status === 'hide') { // Do not clear here, for animation better. group && group.hide(); handle && handle.hide(); return; } group && group.show(); handle && handle.show(); // Otherwise status is 'show' var elOption = {}; this.makeElOption(elOption, value, axisModel, axisPointerModel, api); // Enable change axis pointer type. var graphicKey = elOption.graphicKey; if (graphicKey !== this._lastGraphicKey) { this.clear(api); } this._lastGraphicKey = graphicKey; var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel); if (!group) { group = this._group = new Group(); this.createPointerEl(group, elOption, axisModel, axisPointerModel); this.createLabelEl(group, elOption, axisModel, axisPointerModel); api.getZr().add(group); } else { var doUpdateProps = curry(updateProps$1, axisPointerModel, moveAnimation); this.updatePointerEl(group, elOption, doUpdateProps, axisPointerModel); this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel); } updateMandatoryProps(group, axisPointerModel, true); this._renderHandle(value); }, /** * @implement */ remove: function (api) { this.clear(api); }, /** * @implement */ dispose: function (api) { this.clear(api); }, /** * @protected */ determineAnimation: function (axisModel, axisPointerModel) { var animation = axisPointerModel.get('animation'); var axis = axisModel.axis; var isCategoryAxis = axis.type === 'category'; var useSnap = axisPointerModel.get('snap'); // Value axis without snap always do not snap. if (!useSnap && !isCategoryAxis) { return false; } if (animation === 'auto' || animation == null) { var animationThreshold = this.animationThreshold; if (isCategoryAxis && axis.getBandWidth() > animationThreshold) { return true; } // It is important to auto animation when snap used. Consider if there is // a dataZoom, animation will be disabled when too many points exist, while // it will be enabled for better visual effect when little points exist. if (useSnap) { var seriesDataCount = getAxisInfo(axisModel).seriesDataCount; var axisExtent = axis.getExtent(); // Approximate band width return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold; } return false; } return animation === true; }, /** * add {pointer, label, graphicKey} to elOption * @protected */ makeElOption: function (elOption, value, axisModel, axisPointerModel, api) { // Shoule be implemenented by sub-class. }, /** * @protected */ createPointerEl: function (group, elOption, axisModel, axisPointerModel) { var pointerOption = elOption.pointer; if (pointerOption) { var pointerEl = inner$9(group).pointerEl = new graphic[pointerOption.type]( clone$4(elOption.pointer) ); group.add(pointerEl); } }, /** * @protected */ createLabelEl: function (group, elOption, axisModel, axisPointerModel) { if (elOption.label) { var labelEl = inner$9(group).labelEl = new Rect( clone$4(elOption.label) ); group.add(labelEl); updateLabelShowHide(labelEl, axisPointerModel); } }, /** * @protected */ updatePointerEl: function (group, elOption, updateProps$$1) { var pointerEl = inner$9(group).pointerEl; if (pointerEl) { pointerEl.setStyle(elOption.pointer.style); updateProps$$1(pointerEl, {shape: elOption.pointer.shape}); } }, /** * @protected */ updateLabelEl: function (group, elOption, updateProps$$1, axisPointerModel) { var labelEl = inner$9(group).labelEl; if (labelEl) { labelEl.setStyle(elOption.label.style); updateProps$$1(labelEl, { // Consider text length change in vertical axis, animation should // be used on shape, otherwise the effect will be weird. shape: elOption.label.shape, position: elOption.label.position }); updateLabelShowHide(labelEl, axisPointerModel); } }, /** * @private */ _renderHandle: function (value) { if (this._dragging || !this.updateHandleTransform) { return; } var axisPointerModel = this._axisPointerModel; var zr = this._api.getZr(); var handle = this._handle; var handleModel = axisPointerModel.getModel('handle'); var status = axisPointerModel.get('status'); if (!handleModel.get('show') || !status || status === 'hide') { handle && zr.remove(handle); this._handle = null; return; } var isInit; if (!this._handle) { isInit = true; handle = this._handle = createIcon( handleModel.get('icon'), { cursor: 'move', draggable: true, onmousemove: function (e) { // Fot mobile devicem, prevent screen slider on the button. stop(e.event); }, onmousedown: bind$2(this._onHandleDragMove, this, 0, 0), drift: bind$2(this._onHandleDragMove, this), ondragend: bind$2(this._onHandleDragEnd, this) } ); zr.add(handle); } updateMandatoryProps(handle, axisPointerModel, false); // update style var includeStyles = [ 'color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY' ]; handle.setStyle(handleModel.getItemStyle(null, includeStyles)); // update position var handleSize = handleModel.get('size'); if (!isArray(handleSize)) { handleSize = [handleSize, handleSize]; } handle.attr('scale', [handleSize[0] / 2, handleSize[1] / 2]); createOrUpdate( this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate' ); this._moveHandleToValue(value, isInit); }, /** * @private */ _moveHandleToValue: function (value, isInit) { updateProps$1( this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform( value, this._axisModel, this._axisPointerModel )) ); }, /** * @private */ _onHandleDragMove: function (dx, dy) { var handle = this._handle; if (!handle) { return; } this._dragging = true; // Persistent for throttle. var trans = this.updateHandleTransform( getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel ); this._payloadInfo = trans; handle.stopAnimation(); handle.attr(getHandleTransProps(trans)); inner$9(handle).lastProp = null; this._doDispatchAxisPointer(); }, /** * Throttled method. * @private */ _doDispatchAxisPointer: function () { var handle = this._handle; if (!handle) { return; } var payloadInfo = this._payloadInfo; var axisModel = this._axisModel; this._api.dispatchAction({ type: 'updateAxisPointer', x: payloadInfo.cursorPoint[0], y: payloadInfo.cursorPoint[1], tooltipOption: payloadInfo.tooltipOption, axesInfo: [{ axisDim: axisModel.axis.dim, axisIndex: axisModel.componentIndex }] }); }, /** * @private */ _onHandleDragEnd: function (moveAnimation) { this._dragging = false; var handle = this._handle; if (!handle) { return; } var value = this._axisPointerModel.get('value'); // Consider snap or categroy axis, handle may be not consistent with // axisPointer. So move handle to align the exact value position when // drag ended. this._moveHandleToValue(value); // For the effect: tooltip will be shown when finger holding on handle // button, and will be hidden after finger left handle button. this._api.dispatchAction({ type: 'hideTip' }); }, /** * Should be implemenented by sub-class if support `handle`. * @protected * @param {number} value * @param {module:echarts/model/Model} axisModel * @param {module:echarts/model/Model} axisPointerModel * @return {Object} {position: [x, y], rotation: 0} */ getHandleTransform: null, /** * * Should be implemenented by sub-class if support `handle`. * @protected * @param {Object} transform {position, rotation} * @param {Array.} delta [dx, dy] * @param {module:echarts/model/Model} axisModel * @param {module:echarts/model/Model} axisPointerModel * @return {Object} {position: [x, y], rotation: 0, cursorPoint: [x, y]} */ updateHandleTransform: null, /** * @private */ clear: function (api) { this._lastValue = null; this._lastStatus = null; var zr = api.getZr(); var group = this._group; var handle = this._handle; if (zr && group) { this._lastGraphicKey = null; group && zr.remove(group); handle && zr.remove(handle); this._group = null; this._handle = null; this._payloadInfo = null; } }, /** * @protected */ doClear: function () { // Implemented by sub-class if necessary. }, /** * @protected * @param {Array.} xy * @param {Array.} wh * @param {number} [xDimIndex=0] or 1 */ buildLabel: function (xy, wh, xDimIndex) { xDimIndex = xDimIndex || 0; return { x: xy[xDimIndex], y: xy[1 - xDimIndex], width: wh[xDimIndex], height: wh[1 - xDimIndex] }; } }; BaseAxisPointer.prototype.constructor = BaseAxisPointer; function updateProps$1(animationModel, moveAnimation, el, props) { // Animation optimize. if (!propsEqual(inner$9(el).lastProp, props)) { inner$9(el).lastProp = props; moveAnimation ? updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props)); } } function propsEqual(lastProps, newProps) { if (isObject$1(lastProps) && isObject$1(newProps)) { var equals = true; each$1(newProps, function (item, key) { equals = equals && propsEqual(lastProps[key], item); }); return !!equals; } else { return lastProps === newProps; } } function updateLabelShowHide(labelEl, axisPointerModel) { labelEl[axisPointerModel.get('label.show') ? 'show' : 'hide'](); } function getHandleTransProps(trans) { return { position: trans.position.slice(), rotation: trans.rotation || 0 }; } function updateMandatoryProps(group, axisPointerModel, silent) { var z = axisPointerModel.get('z'); var zlevel = axisPointerModel.get('zlevel'); group && group.traverse(function (el) { if (el.type !== 'group') { z != null && (el.z = z); zlevel != null && (el.zlevel = zlevel); el.silent = silent; } }); } enableClassExtend(BaseAxisPointer); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @param {module:echarts/model/Model} axisPointerModel */ function buildElStyle(axisPointerModel) { var axisPointerType = axisPointerModel.get('type'); var styleModel = axisPointerModel.getModel(axisPointerType + 'Style'); var style; if (axisPointerType === 'line') { style = styleModel.getLineStyle(); style.fill = null; } else if (axisPointerType === 'shadow') { style = styleModel.getAreaStyle(); style.stroke = null; } return style; } /** * @param {Function} labelPos {align, verticalAlign, position} */ function buildLabelElOption( elOption, axisModel, axisPointerModel, api, labelPos ) { var value = axisPointerModel.get('value'); var text = getValueLabel( value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), { precision: axisPointerModel.get('label.precision'), formatter: axisPointerModel.get('label.formatter') } ); var labelModel = axisPointerModel.getModel('label'); var paddings = normalizeCssArray$1(labelModel.get('padding') || 0); var font = labelModel.getFont(); var textRect = getBoundingRect(text, font); var position = labelPos.position; var width = textRect.width + paddings[1] + paddings[3]; var height = textRect.height + paddings[0] + paddings[2]; // Adjust by align. var align = labelPos.align; align === 'right' && (position[0] -= width); align === 'center' && (position[0] -= width / 2); var verticalAlign = labelPos.verticalAlign; verticalAlign === 'bottom' && (position[1] -= height); verticalAlign === 'middle' && (position[1] -= height / 2); // Not overflow ec container confineInContainer(position, width, height, api); var bgColor = labelModel.get('backgroundColor'); if (!bgColor || bgColor === 'auto') { bgColor = axisModel.get('axisLine.lineStyle.color'); } elOption.label = { shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')}, position: position.slice(), // TODO: rich style: { text: text, textFont: font, textFill: labelModel.getTextColor(), textPosition: 'inside', fill: bgColor, stroke: labelModel.get('borderColor') || 'transparent', lineWidth: labelModel.get('borderWidth') || 0, shadowBlur: labelModel.get('shadowBlur'), shadowColor: labelModel.get('shadowColor'), shadowOffsetX: labelModel.get('shadowOffsetX'), shadowOffsetY: labelModel.get('shadowOffsetY') }, // Lable should be over axisPointer. z2: 10 }; } // Do not overflow ec container function confineInContainer(position, width, height, api) { var viewWidth = api.getWidth(); var viewHeight = api.getHeight(); position[0] = Math.min(position[0] + width, viewWidth) - width; position[1] = Math.min(position[1] + height, viewHeight) - height; position[0] = Math.max(position[0], 0); position[1] = Math.max(position[1], 0); } /** * @param {number} value * @param {module:echarts/coord/Axis} axis * @param {module:echarts/model/Global} ecModel * @param {Object} opt * @param {Array.} seriesDataIndices * @param {number|string} opt.precision 'auto' or a number * @param {string|Function} opt.formatter label formatter */ function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) { value = axis.scale.parse(value); var text = axis.scale.getLabel( // If `precision` is set, width can be fixed (like '12.00500'), which // helps to debounce when when moving label. value, {precision: opt.precision} ); var formatter = opt.formatter; if (formatter) { var params = { value: getAxisRawValue(axis, value), seriesData: [] }; each$1(seriesDataIndices, function (idxItem) { var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); var dataIndex = idxItem.dataIndexInside; var dataParams = series && series.getDataParams(dataIndex); dataParams && params.seriesData.push(dataParams); }); if (isString(formatter)) { text = formatter.replace('{value}', text); } else if (isFunction$1(formatter)) { text = formatter(params); } } return text; } /** * @param {module:echarts/coord/Axis} axis * @param {number} value * @param {Object} layoutInfo { * rotation, position, labelOffset, labelDirection, labelMargin * } */ function getTransformedPosition (axis, value, layoutInfo) { var transform = create$1(); rotate(transform, transform, layoutInfo.rotation); translate(transform, transform, layoutInfo.position); return applyTransform$1([ axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0) ], transform); } function buildCartesianSingleLabelElOption( value, elOption, layoutInfo, axisModel, axisPointerModel, api ) { var textLayout = AxisBuilder.innerTextLayout( layoutInfo.rotation, 0, layoutInfo.labelDirection ); layoutInfo.labelMargin = axisPointerModel.get('label.margin'); buildLabelElOption(elOption, axisModel, axisPointerModel, api, { position: getTransformedPosition(axisModel.axis, value, layoutInfo), align: textLayout.textAlign, verticalAlign: textLayout.textVerticalAlign }); } /** * @param {Array.} p1 * @param {Array.} p2 * @param {number} [xDimIndex=0] or 1 */ function makeLineShape(p1, p2, xDimIndex) { xDimIndex = xDimIndex || 0; return { x1: p1[xDimIndex], y1: p1[1 - xDimIndex], x2: p2[xDimIndex], y2: p2[1 - xDimIndex] }; } /** * @param {Array.} xy * @param {Array.} wh * @param {number} [xDimIndex=0] or 1 */ function makeRectShape(xy, wh, xDimIndex) { xDimIndex = xDimIndex || 0; return { x: xy[xDimIndex], y: xy[1 - xDimIndex], width: wh[xDimIndex], height: wh[1 - xDimIndex] }; } function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) { return { cx: cx, cy: cy, r0: r0, r: r, startAngle: startAngle, endAngle: endAngle, clockwise: true }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var CartesianAxisPointer = BaseAxisPointer.extend({ /** * @override */ makeElOption: function (elOption, value, axisModel, axisPointerModel, api) { var axis = axisModel.axis; var grid = axis.grid; var axisPointerType = axisPointerModel.get('type'); var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true)); if (axisPointerType && axisPointerType !== 'none') { var elStyle = buildElStyle(axisPointerModel); var pointerOption = pointerShapeBuilder[axisPointerType]( axis, pixelValue, otherExtent, elStyle ); pointerOption.style = elStyle; elOption.graphicKey = pointerOption.type; elOption.pointer = pointerOption; } var layoutInfo = layout$1(grid.model, axisModel); buildCartesianSingleLabelElOption( value, elOption, layoutInfo, axisModel, axisPointerModel, api ); }, /** * @override */ getHandleTransform: function (value, axisModel, axisPointerModel) { var layoutInfo = layout$1(axisModel.axis.grid.model, axisModel, { labelInside: false }); layoutInfo.labelMargin = axisPointerModel.get('handle.margin'); return { position: getTransformedPosition(axisModel.axis, value, layoutInfo), rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) }; }, /** * @override */ updateHandleTransform: function (transform, delta, axisModel, axisPointerModel) { var axis = axisModel.axis; var grid = axis.grid; var axisExtent = axis.getGlobalExtent(true); var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); var dimIndex = axis.dim === 'x' ? 0 : 1; var currPosition = transform.position; currPosition[dimIndex] += delta[dimIndex]; currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; var cursorPoint = [cursorOtherValue, cursorOtherValue]; cursorPoint[dimIndex] = currPosition[dimIndex]; // Make tooltip do not overlap axisPointer and in the middle of the grid. var tooltipOptions = [{verticalAlign: 'middle'}, {align: 'center'}]; return { position: currPosition, rotation: transform.rotation, cursorPoint: cursorPoint, tooltipOption: tooltipOptions[dimIndex] }; } }); function getCartesian(grid, axis) { var opt = {}; opt[axis.dim + 'AxisIndex'] = axis.index; return grid.getCartesian(opt); } var pointerShapeBuilder = { line: function (axis, pixelValue, otherExtent, elStyle) { var targetShape = makeLineShape( [pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis) ); subPixelOptimizeLine({ shape: targetShape, style: elStyle }); return { type: 'Line', shape: targetShape }; }, shadow: function (axis, pixelValue, otherExtent, elStyle) { var bandWidth = Math.max(1, axis.getBandWidth()); var span = otherExtent[1] - otherExtent[0]; return { type: 'Rect', shape: makeRectShape( [pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis) ) }; } }; function getAxisDimIndex(axis) { return axis.dim === 'x' ? 0 : 1; } AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // CartesianAxisPointer is not supposed to be required here. But consider // echarts.simple.js and online build tooltip, which only require gridSimple, // CartesianAxisPointer should be able to required somewhere. registerPreprocessor(function (option) { // Always has a global axisPointerModel for default setting. if (option) { (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {}); var link = option.axisPointer.link; // Normalize to array to avoid object mergin. But if link // is not set, remain null/undefined, otherwise it will // override existent link setting. if (link && !isArray(link)) { option.axisPointer.link = [link]; } } }); // This process should proformed after coordinate systems created // and series data processed. So put it on statistic processing stage. registerProcessor(PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) { // Build axisPointerModel, mergin tooltip.axisPointer model for each axis. // allAxesInfo should be updated when setOption performed. ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api); }); // Broadcast to all views. registerAction({ type: 'updateAxisPointer', event: 'updateAxisPointer', update: ':updateAxisPointer' }, axisTrigger); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var XY = ['x', 'y']; var WH = ['width', 'height']; var SingleAxisPointer = BaseAxisPointer.extend({ /** * @override */ makeElOption: function (elOption, value, axisModel, axisPointerModel, api) { var axis = axisModel.axis; var coordSys = axis.coordinateSystem; var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis)); var pixelValue = coordSys.dataToPoint(value)[0]; var axisPointerType = axisPointerModel.get('type'); if (axisPointerType && axisPointerType !== 'none') { var elStyle = buildElStyle(axisPointerModel); var pointerOption = pointerShapeBuilder$1[axisPointerType]( axis, pixelValue, otherExtent, elStyle ); pointerOption.style = elStyle; elOption.graphicKey = pointerOption.type; elOption.pointer = pointerOption; } var layoutInfo = layout$2(axisModel); buildCartesianSingleLabelElOption( value, elOption, layoutInfo, axisModel, axisPointerModel, api ); }, /** * @override */ getHandleTransform: function (value, axisModel, axisPointerModel) { var layoutInfo = layout$2(axisModel, {labelInside: false}); layoutInfo.labelMargin = axisPointerModel.get('handle.margin'); return { position: getTransformedPosition(axisModel.axis, value, layoutInfo), rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) }; }, /** * @override */ updateHandleTransform: function (transform, delta, axisModel, axisPointerModel) { var axis = axisModel.axis; var coordSys = axis.coordinateSystem; var dimIndex = getPointDimIndex(axis); var axisExtent = getGlobalExtent(coordSys, dimIndex); var currPosition = transform.position; currPosition[dimIndex] += delta[dimIndex]; currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex); var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; var cursorPoint = [cursorOtherValue, cursorOtherValue]; cursorPoint[dimIndex] = currPosition[dimIndex]; return { position: currPosition, rotation: transform.rotation, cursorPoint: cursorPoint, tooltipOption: { verticalAlign: 'middle' } }; } }); var pointerShapeBuilder$1 = { line: function (axis, pixelValue, otherExtent, elStyle) { var targetShape = makeLineShape( [pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis) ); subPixelOptimizeLine({ shape: targetShape, style: elStyle }); return { type: 'Line', shape: targetShape }; }, shadow: function (axis, pixelValue, otherExtent, elStyle) { var bandWidth = axis.getBandWidth(); var span = otherExtent[1] - otherExtent[0]; return { type: 'Rect', shape: makeRectShape( [pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis) ) }; } }; function getPointDimIndex(axis) { return axis.isHorizontal() ? 0 : 1; } function getGlobalExtent(coordSys, dimIndex) { var rect = coordSys.getRect(); return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]]; } AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ extendComponentView({ type: 'single' }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file Define the themeRiver view's series model * @author Deqing Li(annong035@gmail.com) */ var DATA_NAME_INDEX = 2; var ThemeRiverSeries = SeriesModel.extend({ type: 'series.themeRiver', dependencies: ['singleAxis'], /** * @readOnly * @type {module:zrender/core/util#HashMap} */ nameMap: null, /** * @override */ init: function (option) { ThemeRiverSeries.superApply(this, 'init', arguments); // Put this function here is for the sake of consistency of code style. // Enable legend selection for each data item // Use a function instead of direct access because data reference may changed this.legendDataProvider = function () { return this.getRawData(); }; }, /** * If there is no value of a certain point in the time for some event,set it value to 0. * * @param {Array} data initial data in the option * @return {Array} */ fixData: function (data) { var rawDataLength = data.length; // grouped data by name var dataByName = nest() .key(function (dataItem) { return dataItem[2]; }) .entries(data); // data group in each layer var layData = map(dataByName, function (d) { return { name: d.key, dataList: d.values }; }); var layerNum = layData.length; var largestLayer = -1; var index = -1; for (var i = 0; i < layerNum; ++i) { var len = layData[i].dataList.length; if (len > largestLayer) { largestLayer = len; index = i; } } for (var k = 0; k < layerNum; ++k) { if (k === index) { continue; } var name = layData[k].name; for (var j = 0; j < largestLayer; ++j) { var timeValue = layData[index].dataList[j][0]; var length = layData[k].dataList.length; var keyIndex = -1; for (var l = 0; l < length; ++l) { var value = layData[k].dataList[l][0]; if (value === timeValue) { keyIndex = l; break; } } if (keyIndex === -1) { data[rawDataLength] = []; data[rawDataLength][0] = timeValue; data[rawDataLength][1] = 0; data[rawDataLength][2] = name; rawDataLength++; } } } return data; }, /** * @override * @param {Object} option the initial option that user gived * @param {module:echarts/model/Model} ecModel the model object for themeRiver option * @return {module:echarts/data/List} */ getInitialData: function (option, ecModel) { var singleAxisModel = ecModel.queryComponents({ mainType: 'singleAxis', index: this.get('singleAxisIndex'), id: this.get('singleAxisId') })[0]; var axisType = singleAxisModel.get('type'); // filter the data item with the value of label is undefined var filterData = filter(option.data, function (dataItem) { return dataItem[2] !== undefined; }); // ??? TODO design a stage to transfer data for themeRiver and lines? var data = this.fixData(filterData || []); var nameList = []; var nameMap = this.nameMap = createHashMap(); var count = 0; for (var i = 0; i < data.length; ++i) { nameList.push(data[i][DATA_NAME_INDEX]); if (!nameMap.get(data[i][DATA_NAME_INDEX])) { nameMap.set(data[i][DATA_NAME_INDEX], count); count++; } } var dimensionsInfo = createDimensions(data, { coordDimensions: ['single'], dimensionsDefine: [ { name: 'time', type: getDimensionTypeByAxis(axisType) }, { name: 'value', type: 'float' }, { name: 'name', type: 'ordinal' } ], encodeDefine: { single: 0, value: 1, itemName: 2 } }); var list = new List(dimensionsInfo, this); list.initData(data); return list; }, /** * The raw data is divided into multiple layers and each layer * has same name. * * @return {Array.>} */ getLayerSeries: function () { var data = this.getData(); var lenCount = data.count(); var indexArr = []; for (var i = 0; i < lenCount; ++i) { indexArr[i] = i; } // data group by name var dataByName = nest() .key(function (index) { return data.get('name', index); }) .entries(indexArr); var layerSeries = map(dataByName, function (d) { return { name: d.key, indices: d.values }; }); var timeDim = data.mapDimension('single'); for (var j = 0; j < layerSeries.length; ++j) { layerSeries[j].indices.sort(comparer); } function comparer(index1, index2) { return data.get(timeDim, index1) - data.get(timeDim, index2); } return layerSeries; }, /** * Get data indices for show tooltip content * * @param {Array.|string} dim single coordinate dimension * @param {number} value axis value * @param {module:echarts/coord/single/SingleAxis} baseAxis single Axis used * the themeRiver. * @return {Object} {dataIndices, nestestValue} */ getAxisTooltipData: function (dim, value, baseAxis) { if (!isArray(dim)) { dim = dim ? [dim] : []; } var data = this.getData(); var layerSeries = this.getLayerSeries(); var indices = []; var layerNum = layerSeries.length; var nestestValue; for (var i = 0; i < layerNum; ++i) { var minDist = Number.MAX_VALUE; var nearestIdx = -1; var pointNum = layerSeries[i].indices.length; for (var j = 0; j < pointNum; ++j) { var theValue = data.get(dim[0], layerSeries[i].indices[j]); var dist = Math.abs(theValue - value); if (dist <= minDist) { nestestValue = theValue; minDist = dist; nearestIdx = layerSeries[i].indices[j]; } } indices.push(nearestIdx); } return {dataIndices: indices, nestestValue: nestestValue}; }, /** * @override * @param {number} dataIndex index of data */ formatTooltip: function (dataIndex) { var data = this.getData(); var htmlName = data.getName(dataIndex); var htmlValue = data.get(data.mapDimension('value'), dataIndex); if (isNaN(htmlValue) || htmlValue == null) { htmlValue = '-'; } return encodeHTML(htmlName + ' : ' + htmlValue); }, defaultOption: { zlevel: 0, z: 2, coordinateSystem: 'singleAxis', // gap in axis's orthogonal orientation boundaryGap: ['10%', '10%'], // legendHoverLink: true, singleAxisIndex: 0, animationEasing: 'linear', label: { margin: 4, show: true, position: 'left', color: '#000', fontSize: 11 }, emphasis: { label: { show: true } } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file The file used to draw themeRiver view * @author Deqing Li(annong035@gmail.com) */ extendChartView({ type: 'themeRiver', init: function () { this._layers = []; }, render: function (seriesModel, ecModel, api) { var data = seriesModel.getData(); var group = this.group; var layerSeries = seriesModel.getLayerSeries(); var layoutInfo = data.getLayout('layoutInfo'); var rect = layoutInfo.rect; var boundaryGap = layoutInfo.boundaryGap; group.attr('position', [0, rect.y + boundaryGap[0]]); function keyGetter(item) { return item.name; } var dataDiffer = new DataDiffer( this._layersSeries || [], layerSeries, keyGetter, keyGetter ); var newLayersGroups = {}; dataDiffer .add(bind(process, this, 'add')) .update(bind(process, this, 'update')) .remove(bind(process, this, 'remove')) .execute(); function process(status, idx, oldIdx) { var oldLayersGroups = this._layers; if (status === 'remove') { group.remove(oldLayersGroups[idx]); return; } var points0 = []; var points1 = []; var color; var indices = layerSeries[idx].indices; for (var j = 0; j < indices.length; j++) { var layout = data.getItemLayout(indices[j]); var x = layout.x; var y0 = layout.y0; var y = layout.y; points0.push([x, y0]); points1.push([x, y0 + y]); color = data.getItemVisual(indices[j], 'color'); } var polygon; var text; var textLayout = data.getItemLayout(indices[0]); var itemModel = data.getItemModel(indices[j - 1]); var labelModel = itemModel.getModel('label'); var margin = labelModel.get('margin'); if (status === 'add') { var layerGroup = newLayersGroups[idx] = new Group(); polygon = new Polygon$1({ shape: { points: points0, stackedOnPoints: points1, smooth: 0.4, stackedOnSmooth: 0.4, smoothConstraint: false }, z2: 0 }); text = new Text({ style: { x: textLayout.x - margin, y: textLayout.y0 + textLayout.y / 2 } }); layerGroup.add(polygon); layerGroup.add(text); group.add(layerGroup); polygon.setClipPath(createGridClipShape$3(polygon.getBoundingRect(), seriesModel, function () { polygon.removeClipPath(); })); } else { var layerGroup = oldLayersGroups[oldIdx]; polygon = layerGroup.childAt(0); text = layerGroup.childAt(1); group.add(layerGroup); newLayersGroups[idx] = layerGroup; updateProps(polygon, { shape: { points: points0, stackedOnPoints: points1 } }, seriesModel); updateProps(text, { style: { x: textLayout.x - margin, y: textLayout.y0 + textLayout.y / 2 } }, seriesModel); } var hoverItemStyleModel = itemModel.getModel('emphasis.itemStyle'); var itemStyleModel = itemModel.getModel('itemStyle'); setTextStyle(text.style, labelModel, { text: labelModel.get('show') ? seriesModel.getFormattedLabel(indices[j - 1], 'normal') || data.getName(indices[j - 1]) : null, textVerticalAlign: 'middle' }); polygon.setStyle(extend({ fill: color }, itemStyleModel.getItemStyle(['color']))); setHoverStyle(polygon, hoverItemStyleModel.getItemStyle()); } this._layersSeries = layerSeries; this._layers = newLayersGroups; }, dispose: function () {} }); // add animation to the view function createGridClipShape$3(rect, seriesModel, cb) { var rectEl = new Rect({ shape: { x: rect.x - 10, y: rect.y - 10, width: 0, height: rect.height + 20 } }); initProps(rectEl, { shape: { width: rect.width + 20, height: rect.height + 20 } }, seriesModel, cb); return rectEl; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file Using layout algorithm transform the raw data to layout information. * @author Deqing Li(annong035@gmail.com) */ var themeRiverLayout = function (ecModel, api) { ecModel.eachSeriesByType('themeRiver', function (seriesModel) { var data = seriesModel.getData(); var single = seriesModel.coordinateSystem; var layoutInfo = {}; // use the axis boundingRect for view var rect = single.getRect(); layoutInfo.rect = rect; var boundaryGap = seriesModel.get('boundaryGap'); var axis = single.getAxis(); layoutInfo.boundaryGap = boundaryGap; if (axis.orient === 'horizontal') { boundaryGap[0] = parsePercent$1(boundaryGap[0], rect.height); boundaryGap[1] = parsePercent$1(boundaryGap[1], rect.height); var height = rect.height - boundaryGap[0] - boundaryGap[1]; themeRiverLayout$1(data, seriesModel, height); } else { boundaryGap[0] = parsePercent$1(boundaryGap[0], rect.width); boundaryGap[1] = parsePercent$1(boundaryGap[1], rect.width); var width = rect.width - boundaryGap[0] - boundaryGap[1]; themeRiverLayout$1(data, seriesModel, width); } data.setLayout('layoutInfo', layoutInfo); }); }; /** * The layout information about themeriver * * @param {module:echarts/data/List} data data in the series * @param {module:echarts/model/Series} seriesModel the model object of themeRiver series * @param {number} height value used to compute every series height */ function themeRiverLayout$1(data, seriesModel, height) { if (!data.count()) { return; } var coordSys = seriesModel.coordinateSystem; // the data in each layer are organized into a series. var layerSeries = seriesModel.getLayerSeries(); // the points in each layer. var timeDim = data.mapDimension('single'); var valueDim = data.mapDimension('value'); var layerPoints = map(layerSeries, function (singleLayer) { return map(singleLayer.indices, function (idx) { var pt = coordSys.dataToPoint(data.get(timeDim, idx)); pt[1] = data.get(valueDim, idx); return pt; }); }); var base = computeBaseline(layerPoints); var baseLine = base.y0; var ky = height / base.max; // set layout information for each item. var n = layerSeries.length; var m = layerSeries[0].indices.length; var baseY0; for (var j = 0; j < m; ++j) { baseY0 = baseLine[j] * ky; data.setItemLayout(layerSeries[0].indices[j], { layerIndex: 0, x: layerPoints[0][j][0], y0: baseY0, y: layerPoints[0][j][1] * ky }); for (var i = 1; i < n; ++i) { baseY0 += layerPoints[i - 1][j][1] * ky; data.setItemLayout(layerSeries[i].indices[j], { layerIndex: i, x: layerPoints[i][j][0], y0: baseY0, y: layerPoints[i][j][1] * ky }); } } } /** * Compute the baseLine of the rawdata * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics * * @param {Array.} data the points in each layer * @return {Object} */ function computeBaseline(data) { var layerNum = data.length; var pointNum = data[0].length; var sums = []; var y0 = []; var max = 0; var temp; var base = {}; for (var i = 0; i < pointNum; ++i) { for (var j = 0, temp = 0; j < layerNum; ++j) { temp += data[j][i][1]; } if (temp > max) { max = temp; } sums.push(temp); } for (var k = 0; k < pointNum; ++k) { y0[k] = (max - sums[k]) / 2; } max = 0; for (var l = 0; l < pointNum; ++l) { var sum = sums[l] + y0[l]; if (sum > max) { max = sum; } } base.y0 = y0; base.max = max; return base; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file Visual encoding for themeRiver view * @author Deqing Li(annong035@gmail.com) */ var themeRiverVisual = function (ecModel) { ecModel.eachSeriesByType('themeRiver', function (seriesModel) { var data = seriesModel.getData(); var rawData = seriesModel.getRawData(); var colorList = seriesModel.get('color'); var idxMap = createHashMap(); data.each(function (idx) { idxMap.set(data.getRawIndex(idx), idx); }); rawData.each(function (rawIndex) { var name = rawData.getName(rawIndex); var color = colorList[(seriesModel.nameMap.get(name) - 1) % colorList.length]; rawData.setItemVisual(rawIndex, 'color', color); var idx = idxMap.get(rawIndex); if (idx != null) { data.setItemVisual(idx, 'color', color); } }); }); }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerLayout(themeRiverLayout); registerVisual(themeRiverVisual); registerProcessor(dataFilter('themeRiver')); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ SeriesModel.extend({ type: 'series.sunburst', /** * @type {module:echarts/data/Tree~Node} */ _viewRoot: null, getInitialData: function (option, ecModel) { // Create a virtual root. var root = { name: option.name, children: option.data }; completeTreeValue$1(root); var levels = option.levels || []; // levels = option.levels = setDefault(levels, ecModel); var treeOption = {}; treeOption.levels = levels; // Make sure always a new tree is created when setOption, // in TreemapView, we check whether oldTree === newTree // to choose mappings approach among old shapes and new shapes. return Tree.createTree(root, this, treeOption).data; }, optionUpdated: function () { this.resetViewRoot(); }, /* * @override */ getDataParams: function (dataIndex) { var params = SeriesModel.prototype.getDataParams.apply(this, arguments); var node = this.getData().tree.getNodeByDataIndex(dataIndex); params.treePathInfo = wrapTreePathInfo(node, this); return params; }, defaultOption: { zlevel: 0, z: 2, // 默认全局居中 center: ['50%', '50%'], radius: [0, '75%'], // 默认顺时针 clockwise: true, startAngle: 90, // 最小角度改为0 minAngle: 0, percentPrecision: 2, // If still show when all data zero. stillShowZeroSum: true, // Policy of highlighting pieces when hover on one // Valid values: 'none' (for not downplay others), 'descendant', // 'ancestor', 'self' highlightPolicy: 'descendant', // 'rootToNode', 'link', or false nodeClick: 'rootToNode', renderLabelForZeroData: false, label: { // could be: 'radial', 'tangential', or 'none' rotate: 'radial', show: true, opacity: 1, // 'left' is for inner side of inside, and 'right' is for outter // side for inside align: 'center', position: 'inside', distance: 5, silent: true, emphasis: {} }, itemStyle: { borderWidth: 1, borderColor: 'white', opacity: 1, emphasis: {}, highlight: { opacity: 1 }, downplay: { opacity: 0.9 } }, // Animation type canbe expansion, scale animationType: 'expansion', animationDuration: 1000, animationDurationUpdate: 500, animationEasing: 'cubicOut', data: [], levels: [], /** * Sort order. * * Valid values: 'desc', 'asc', null, or callback function. * 'desc' and 'asc' for descend and ascendant order; * null for not sorting; * example of callback function: * function(nodeA, nodeB) { * return nodeA.getValue() - nodeB.getValue(); * } */ sort: 'desc' }, getViewRoot: function () { return this._viewRoot; }, /** * @param {module:echarts/data/Tree~Node} [viewRoot] */ resetViewRoot: function (viewRoot) { viewRoot ? (this._viewRoot = viewRoot) : (viewRoot = this._viewRoot); var root = this.getRawData().tree.root; if (!viewRoot || (viewRoot !== root && !root.contains(viewRoot)) ) { this._viewRoot = root; } } }); /** * @param {Object} dataNode */ function completeTreeValue$1(dataNode) { // Postorder travel tree. // If value of none-leaf node is not set, // calculate it by suming up the value of all children. var sum = 0; each$1(dataNode.children, function (child) { completeTreeValue$1(child); var childValue = child.value; isArray(childValue) && (childValue = childValue[0]); sum += childValue; }); var thisValue = dataNode.value; if (isArray(thisValue)) { thisValue = thisValue[0]; } if (thisValue == null || isNaN(thisValue)) { thisValue = sum; } // Value should not less than 0. if (thisValue < 0) { thisValue = 0; } isArray(dataNode.value) ? (dataNode.value[0] = thisValue) : (dataNode.value = thisValue); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var NodeHighlightPolicy = { NONE: 'none', // not downplay others DESCENDANT: 'descendant', ANCESTOR: 'ancestor', SELF: 'self' }; var DEFAULT_SECTOR_Z = 2; var DEFAULT_TEXT_Z = 4; /** * Sunburstce of Sunburst including Sector, Label, LabelLine * @constructor * @extends {module:zrender/graphic/Group} */ function SunburstPiece(node, seriesModel, ecModel) { Group.call(this); var sector = new Sector({ z2: DEFAULT_SECTOR_Z }); sector.seriesIndex = seriesModel.seriesIndex; var text = new Text({ z2: DEFAULT_TEXT_Z, silent: node.getModel('label').get('silent') }); this.add(sector); this.add(text); this.updateData(true, node, 'normal', seriesModel, ecModel); // Hover to change label and labelLine function onEmphasis() { text.ignore = text.hoverIgnore; } function onNormal() { text.ignore = text.normalIgnore; } this.on('emphasis', onEmphasis) .on('normal', onNormal) .on('mouseover', onEmphasis) .on('mouseout', onNormal); } var SunburstPieceProto = SunburstPiece.prototype; SunburstPieceProto.updateData = function ( firstCreate, node, state, seriesModel, ecModel ) { this.node = node; node.piece = this; seriesModel = seriesModel || this._seriesModel; ecModel = ecModel || this._ecModel; var sector = this.childAt(0); sector.dataIndex = node.dataIndex; var itemModel = node.getModel(); var layout = node.getLayout(); if (!layout) { console.log(node.getLayout()); } var sectorShape = extend({}, layout); sectorShape.label = null; var visualColor = getNodeColor(node, seriesModel, ecModel); var normalStyle = itemModel.getModel('itemStyle').getItemStyle(); var style; if (state === 'normal') { style = normalStyle; } else { var stateStyle = itemModel.getModel(state + '.itemStyle') .getItemStyle(); style = merge(stateStyle, normalStyle); } style = defaults( { lineJoin: 'bevel', fill: style.fill || visualColor }, style ); if (firstCreate) { sector.setShape(sectorShape); sector.shape.r = layout.r0; updateProps( sector, { shape: { r: layout.r } }, seriesModel, node.dataIndex ); sector.useStyle(style); } else if (typeof style.fill === 'object' && style.fill.type || typeof sector.style.fill === 'object' && sector.style.fill.type ) { // Disable animation for gradient since no interpolation method // is supported for gradient updateProps(sector, { shape: sectorShape }, seriesModel); sector.useStyle(style); } else { updateProps(sector, { shape: sectorShape, style: style }, seriesModel); } this._updateLabel(seriesModel, visualColor, state); var cursorStyle = itemModel.getShallow('cursor'); cursorStyle && sector.attr('cursor', cursorStyle); if (firstCreate) { var highlightPolicy = seriesModel.getShallow('highlightPolicy'); this._initEvents(sector, node, seriesModel, highlightPolicy); } this._seriesModel = seriesModel || this._seriesModel; this._ecModel = ecModel || this._ecModel; }; SunburstPieceProto.onEmphasis = function (highlightPolicy) { var that = this; this.node.hostTree.root.eachNode(function (n) { if (n.piece) { if (that.node === n) { n.piece.updateData(false, n, 'emphasis'); } else if (isNodeHighlighted(n, that.node, highlightPolicy)) { n.piece.childAt(0).trigger('highlight'); } else if (highlightPolicy !== NodeHighlightPolicy.NONE) { n.piece.childAt(0).trigger('downplay'); } } }); }; SunburstPieceProto.onNormal = function () { this.node.hostTree.root.eachNode(function (n) { if (n.piece) { n.piece.updateData(false, n, 'normal'); } }); }; SunburstPieceProto.onHighlight = function () { this.updateData(false, this.node, 'highlight'); }; SunburstPieceProto.onDownplay = function () { this.updateData(false, this.node, 'downplay'); }; SunburstPieceProto._updateLabel = function (seriesModel, visualColor, state) { var itemModel = this.node.getModel(); var normalModel = itemModel.getModel('label'); var labelModel = state === 'normal' || state === 'emphasis' ? normalModel : itemModel.getModel(state + '.label'); var labelHoverModel = itemModel.getModel('emphasis.label'); var text = retrieve( seriesModel.getFormattedLabel( this.node.dataIndex, 'normal', null, null, 'label' ), this.node.name ); if (getLabelAttr('show') === false) { text = ''; } var layout = this.node.getLayout(); var labelMinAngle = labelModel.get('minAngle'); if (labelMinAngle == null) { labelMinAngle = normalModel.get('minAngle'); } labelMinAngle = labelMinAngle / 180 * Math.PI; var angle = layout.endAngle - layout.startAngle; if (labelMinAngle != null && Math.abs(angle) < labelMinAngle) { // Not displaying text when angle is too small text = ''; } var label = this.childAt(1); setLabelStyle( label.style, label.hoverStyle || {}, normalModel, labelHoverModel, { defaultText: labelModel.getShallow('show') ? text : null, autoColor: visualColor, useInsideStyle: true } ); var midAngle = (layout.startAngle + layout.endAngle) / 2; var dx = Math.cos(midAngle); var dy = Math.sin(midAngle); var r; var labelPosition = getLabelAttr('position'); var labelPadding = getLabelAttr('distance') || 0; var textAlign = getLabelAttr('align'); if (labelPosition === 'outside') { r = layout.r + labelPadding; textAlign = midAngle > Math.PI / 2 ? 'right' : 'left'; } else { if (!textAlign || textAlign === 'center') { r = (layout.r + layout.r0) / 2; textAlign = 'center'; } else if (textAlign === 'left') { r = layout.r0 + labelPadding; if (midAngle > Math.PI / 2) { textAlign = 'right'; } } else if (textAlign === 'right') { r = layout.r - labelPadding; if (midAngle > Math.PI / 2) { textAlign = 'left'; } } } label.attr('style', { text: text, textAlign: textAlign, textVerticalAlign: getLabelAttr('verticalAlign') || 'middle', opacity: getLabelAttr('opacity') }); var textX = r * dx + layout.cx; var textY = r * dy + layout.cy; label.attr('position', [textX, textY]); var rotateType = getLabelAttr('rotate'); var rotate = 0; if (rotateType === 'radial') { rotate = -midAngle; if (rotate < -Math.PI / 2) { rotate += Math.PI; } } else if (rotateType === 'tangential') { rotate = Math.PI / 2 - midAngle; if (rotate > Math.PI / 2) { rotate -= Math.PI; } else if (rotate < -Math.PI / 2) { rotate += Math.PI; } } else if (typeof rotateType === 'number') { rotate = rotateType * Math.PI / 180; } label.attr('rotation', rotate); function getLabelAttr(name) { var stateAttr = labelModel.get(name); if (stateAttr == null) { return normalModel.get(name); } else { return stateAttr; } } }; SunburstPieceProto._initEvents = function ( sector, node, seriesModel, highlightPolicy ) { sector.off('mouseover').off('mouseout').off('emphasis').off('normal'); var that = this; var onEmphasis = function () { that.onEmphasis(highlightPolicy); }; var onNormal = function () { that.onNormal(); }; var onDownplay = function () { that.onDownplay(); }; var onHighlight = function () { that.onHighlight(); }; if (seriesModel.isAnimationEnabled()) { sector .on('mouseover', onEmphasis) .on('mouseout', onNormal) .on('emphasis', onEmphasis) .on('normal', onNormal) .on('downplay', onDownplay) .on('highlight', onHighlight); } }; inherits(SunburstPiece, Group); /** * Get node color * * @param {TreeNode} node the node to get color * @param {module:echarts/model/Series} seriesModel series * @param {module:echarts/model/Global} ecModel echarts defaults */ function getNodeColor(node, seriesModel, ecModel) { // Color from visualMap var visualColor = node.getVisual('color'); var visualMetaList = node.getVisual('visualMeta'); if (!visualMetaList || visualMetaList.length === 0) { // Use first-generation color if has no visualMap visualColor = null; } // Self color or level color var color = node.getModel('itemStyle').get('color'); if (color) { return color; } else if (visualColor) { // Color mapping return visualColor; } else if (node.depth === 0) { // Virtual root node return ecModel.option.color[0]; } else { // First-generation color var length = ecModel.option.color.length; color = ecModel.option.color[getRootId(node) % length]; } return color; } /** * Get index of root in sorted order * * @param {TreeNode} node current node * @return {number} index in root */ function getRootId(node) { var ancestor = node; while (ancestor.depth > 1) { ancestor = ancestor.parentNode; } var virtualRoot = node.getAncestors()[0]; return indexOf(virtualRoot.children, ancestor); } function isNodeHighlighted(node, activeNode, policy) { if (policy === NodeHighlightPolicy.NONE) { return false; } else if (policy === NodeHighlightPolicy.SELF) { return node === activeNode; } else if (policy === NodeHighlightPolicy.ANCESTOR) { return node === activeNode || node.isAncestorOf(activeNode); } else { return node === activeNode || node.isDescendantOf(activeNode); } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var ROOT_TO_NODE_ACTION = 'sunburstRootToNode'; var SunburstView = Chart.extend({ type: 'sunburst', init: function () { }, render: function (seriesModel, ecModel, api, payload) { var that = this; this.seriesModel = seriesModel; this.api = api; this.ecModel = ecModel; var data = seriesModel.getData(); var virtualRoot = data.tree.root; var newRoot = seriesModel.getViewRoot(); var group = this.group; var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData'); var newChildren = []; newRoot.eachNode(function (node) { newChildren.push(node); }); var oldChildren = this._oldChildren || []; dualTravel(newChildren, oldChildren); renderRollUp(virtualRoot, newRoot); if (payload && payload.highlight && payload.highlight.piece) { var highlightPolicy = seriesModel.getShallow('highlightPolicy'); payload.highlight.piece.onEmphasis(highlightPolicy); } else if (payload && payload.unhighlight) { var piece = this.virtualPiece; if (!piece && virtualRoot.children.length) { piece = virtualRoot.children[0].piece; } if (piece) { piece.onNormal(); } } this._initEvents(); this._oldChildren = newChildren; function dualTravel(newChildren, oldChildren) { if (newChildren.length === 0 && oldChildren.length === 0) { return; } new DataDiffer(oldChildren, newChildren, getKey, getKey) .add(processNode) .update(processNode) .remove(curry(processNode, null)) .execute(); function getKey(node) { return node.getId(); } function processNode(newId, oldId) { var newNode = newId == null ? null : newChildren[newId]; var oldNode = oldId == null ? null : oldChildren[oldId]; doRenderNode(newNode, oldNode); } } function doRenderNode(newNode, oldNode) { if (!renderLabelForZeroData && newNode && !newNode.getValue()) { // Not render data with value 0 newNode = null; } if (newNode !== virtualRoot && oldNode !== virtualRoot) { if (oldNode && oldNode.piece) { if (newNode) { // Update oldNode.piece.updateData( false, newNode, 'normal', seriesModel, ecModel); // For tooltip data.setItemGraphicEl(newNode.dataIndex, oldNode.piece); } else { // Remove removeNode(oldNode); } } else if (newNode) { // Add var piece = new SunburstPiece( newNode, seriesModel, ecModel ); group.add(piece); // For tooltip data.setItemGraphicEl(newNode.dataIndex, piece); } } } function removeNode(node) { if (!node) { return; } if (node.piece) { group.remove(node.piece); node.piece = null; } } function renderRollUp(virtualRoot, viewRoot) { if (viewRoot.depth > 0) { // Render if (that.virtualPiece) { // Update that.virtualPiece.updateData( false, virtualRoot, 'normal', seriesModel, ecModel); } else { // Add that.virtualPiece = new SunburstPiece( virtualRoot, seriesModel, ecModel ); group.add(that.virtualPiece); } if (viewRoot.piece._onclickEvent) { viewRoot.piece.off('click', viewRoot.piece._onclickEvent); } var event = function (e) { that._rootToNode(viewRoot.parentNode); }; viewRoot.piece._onclickEvent = event; that.virtualPiece.on('click', event); } else if (that.virtualPiece) { // Remove group.remove(that.virtualPiece); that.virtualPiece = null; } } }, dispose: function () { }, /** * @private */ _initEvents: function () { var that = this; var event = function (e) { var targetFound = false; var viewRoot = that.seriesModel.getViewRoot(); viewRoot.eachNode(function (node) { if (!targetFound && node.piece && node.piece.childAt(0) === e.target ) { var nodeClick = node.getModel().get('nodeClick'); if (nodeClick === 'rootToNode') { that._rootToNode(node); } else if (nodeClick === 'link') { var itemModel = node.getModel(); var link = itemModel.get('link'); if (link) { var linkTarget = itemModel.get('target', true) || '_blank'; window.open(link, linkTarget); } } targetFound = true; } }); }; if (this.group._onclickEvent) { this.group.off('click', this.group._onclickEvent); } this.group.on('click', event); this.group._onclickEvent = event; }, /** * @private */ _rootToNode: function (node) { if (node !== this.seriesModel.getViewRoot()) { this.api.dispatchAction({ type: ROOT_TO_NODE_ACTION, from: this.uid, seriesId: this.seriesModel.id, targetNode: node }); } }, /** * @implement */ containPoint: function (point, seriesModel) { var treeRoot = seriesModel.getData(); var itemLayout = treeRoot.getItemLayout(0); if (itemLayout) { var dx = point[0] - itemLayout.cx; var dy = point[1] - itemLayout.cy; var radius = Math.sqrt(dx * dx + dy * dy); return radius <= itemLayout.r && radius >= itemLayout.r0; } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file Sunburst action */ var ROOT_TO_NODE_ACTION$1 = 'sunburstRootToNode'; registerAction( {type: ROOT_TO_NODE_ACTION$1, update: 'updateView'}, function (payload, ecModel) { ecModel.eachComponent( {mainType: 'series', subType: 'sunburst', query: payload}, handleRootToNode ); function handleRootToNode(model, index) { var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION$1], model); if (targetInfo) { var originViewRoot = model.getViewRoot(); if (originViewRoot) { payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown'; } model.resetViewRoot(targetInfo.node); } } } ); var HIGHLIGHT_ACTION = 'sunburstHighlight'; registerAction( {type: HIGHLIGHT_ACTION, update: 'updateView'}, function (payload, ecModel) { ecModel.eachComponent( {mainType: 'series', subType: 'sunburst', query: payload}, handleHighlight ); function handleHighlight(model, index) { var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model); if (targetInfo) { payload.highlight = targetInfo.node; } } } ); var UNHIGHLIGHT_ACTION = 'sunburstUnhighlight'; registerAction( {type: UNHIGHLIGHT_ACTION, update: 'updateView'}, function (payload, ecModel) { ecModel.eachComponent( {mainType: 'series', subType: 'sunburst', query: payload}, handleUnhighlight ); function handleUnhighlight(model, index) { payload.unhighlight = true; } } ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var RADIAN$1 = Math.PI / 180; var sunburstLayout = function (seriesType, ecModel, api, payload) { ecModel.eachSeriesByType(seriesType, function (seriesModel) { var center = seriesModel.get('center'); var radius = seriesModel.get('radius'); if (!isArray(radius)) { radius = [0, radius]; } if (!isArray(center)) { center = [center, center]; } var width = api.getWidth(); var height = api.getHeight(); var size = Math.min(width, height); var cx = parsePercent$1(center[0], width); var cy = parsePercent$1(center[1], height); var r0 = parsePercent$1(radius[0], size / 2); var r = parsePercent$1(radius[1], size / 2); var startAngle = -seriesModel.get('startAngle') * RADIAN$1; var minAngle = seriesModel.get('minAngle') * RADIAN$1; var virtualRoot = seriesModel.getData().tree.root; var treeRoot = seriesModel.getViewRoot(); var rootDepth = treeRoot.depth; var sort = seriesModel.get('sort'); if (sort != null) { initChildren$1(treeRoot, sort); } var validDataCount = 0; each$1(treeRoot.children, function (child) { !isNaN(child.getValue()) && validDataCount++; }); var sum = treeRoot.getValue(); // Sum may be 0 var unitRadian = Math.PI / (sum || validDataCount) * 2; var renderRollupNode = treeRoot.depth > 0; var levels = treeRoot.height - (renderRollupNode ? -1 : 1); var rPerLevel = (r - r0) / (levels || 1); var clockwise = seriesModel.get('clockwise'); var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // In the case some sector angle is smaller than minAngle var dir = clockwise ? 1 : -1; /** * Render a tree * @return increased angle */ var renderNode = function (node, startAngle) { if (!node) { return; } var endAngle = startAngle; // Render self if (node !== virtualRoot) { // Tree node is virtual, so it doesn't need to be drawn var value = node.getValue(); var angle = (sum === 0 && stillShowZeroSum) ? unitRadian : (value * unitRadian); if (angle < minAngle) { angle = minAngle; } else { } endAngle = startAngle + dir * angle; var depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1); var rStart = r0 + rPerLevel * depth; var rEnd = r0 + rPerLevel * (depth + 1); var itemModel = node.getModel(); if (itemModel.get('r0') != null) { rStart = parsePercent$1(itemModel.get('r0'), size / 2); } if (itemModel.get('r') != null) { rEnd = parsePercent$1(itemModel.get('r'), size / 2); } node.setLayout({ angle: angle, startAngle: startAngle, endAngle: endAngle, clockwise: clockwise, cx: cx, cy: cy, r0: rStart, r: rEnd }); } // Render children if (node.children && node.children.length) { // currentAngle = startAngle; var siblingAngle = 0; each$1(node.children, function (node) { siblingAngle += renderNode(node, startAngle + siblingAngle); }); } return endAngle - startAngle; }; // Virtual root node for roll up if (renderRollupNode) { var rStart = r0; var rEnd = r0 + rPerLevel; var angle = Math.PI * 2; virtualRoot.setLayout({ angle: angle, startAngle: startAngle, endAngle: startAngle + angle, clockwise: clockwise, cx: cx, cy: cy, r0: rStart, r: rEnd }); } renderNode(treeRoot, startAngle); }); }; /** * Init node children by order and update visual * * @param {TreeNode} node root node * @param {boolean} isAsc if is in ascendant order */ function initChildren$1(node, isAsc) { var children = node.children || []; node.children = sort$2(children, isAsc); // Init children recursively if (children.length) { each$1(node.children, function (child) { initChildren$1(child, isAsc); }); } } /** * Sort children nodes * * @param {TreeNode[]} children children of node to be sorted * @param {string | function | null} sort sort method * See SunburstSeries.js for details. */ function sort$2(children, sortOrder) { if (typeof sortOrder === 'function') { return children.sort(sortOrder); } else { var isAsc = sortOrder === 'asc'; return children.sort(function (a, b) { var diff = (a.getValue() - b.getValue()) * (isAsc ? 1 : -1); return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc ? -1 : 1) : diff; }); } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerVisual(curry(dataColor, 'sunburst')); registerLayout(curry(sunburstLayout, 'sunburst')); registerProcessor(curry(dataFilter, 'sunburst')); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function dataToCoordSize(dataSize, dataItem) { // dataItem is necessary in log axis. dataItem = dataItem || [0, 0]; return map(['x', 'y'], function (dim, dimIdx) { var axis = this.getAxis(dim); var val = dataItem[dimIdx]; var halfSize = dataSize[dimIdx] / 2; return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); }, this); } var prepareCartesian2d = function (coordSys) { var rect = coordSys.grid.getRect(); return { coordSys: { // The name exposed to user is always 'cartesian2d' but not 'grid'. type: 'cartesian2d', x: rect.x, y: rect.y, width: rect.width, height: rect.height }, api: { coord: function (data) { // do not provide "out" param return coordSys.dataToPoint(data); }, size: bind(dataToCoordSize, coordSys) } }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function dataToCoordSize$1(dataSize, dataItem) { dataItem = dataItem || [0, 0]; return map([0, 1], function (dimIdx) { var val = dataItem[dimIdx]; var halfSize = dataSize[dimIdx] / 2; var p1 = []; var p2 = []; p1[dimIdx] = val - halfSize; p2[dimIdx] = val + halfSize; p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]; return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]); }, this); } var prepareGeo = function (coordSys) { var rect = coordSys.getBoundingRect(); return { coordSys: { type: 'geo', x: rect.x, y: rect.y, width: rect.width, height: rect.height }, api: { coord: function (data) { // do not provide "out" and noRoam param, // Compatible with this usage: // echarts.util.map(item.points, api.coord) return coordSys.dataToPoint(data); }, size: bind(dataToCoordSize$1, coordSys) } }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function dataToCoordSize$2(dataSize, dataItem) { // dataItem is necessary in log axis. var axis = this.getAxis(); var val = dataItem instanceof Array ? dataItem[0] : dataItem; var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2; return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); } var prepareSingleAxis = function (coordSys) { var rect = coordSys.getRect(); return { coordSys: { type: 'singleAxis', x: rect.x, y: rect.y, width: rect.width, height: rect.height }, api: { coord: function (val) { // do not provide "out" param return coordSys.dataToPoint(val); }, size: bind(dataToCoordSize$2, coordSys) } }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function dataToCoordSize$3(dataSize, dataItem) { // dataItem is necessary in log axis. return map(['Radius', 'Angle'], function (dim, dimIdx) { var axis = this['get' + dim + 'Axis'](); var val = dataItem[dimIdx]; var halfSize = dataSize[dimIdx] / 2; var method = 'dataTo' + dim; var result = axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis[method](val - halfSize) - axis[method](val + halfSize)); if (dim === 'Angle') { result = result * Math.PI / 180; } return result; }, this); } var preparePolar = function (coordSys) { var radiusAxis = coordSys.getRadiusAxis(); var angleAxis = coordSys.getAngleAxis(); var radius = radiusAxis.getExtent(); radius[0] > radius[1] && radius.reverse(); return { coordSys: { type: 'polar', cx: coordSys.cx, cy: coordSys.cy, r: radius[1], r0: radius[0] }, api: { coord: bind(function (data) { var radius = radiusAxis.dataToRadius(data[0]); var angle = angleAxis.dataToAngle(data[1]); var coord = coordSys.coordToPoint([radius, angle]); coord.push(radius, angle * Math.PI / 180); return coord; }), size: bind(dataToCoordSize$3, coordSys) } }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var prepareCalendar = function (coordSys) { var rect = coordSys.getRect(); var rangeInfo = coordSys.getRangeInfo(); return { coordSys: { type: 'calendar', x: rect.x, y: rect.y, width: rect.width, height: rect.height, cellWidth: coordSys.getCellWidth(), cellHeight: coordSys.getCellHeight(), rangeInfo: { start: rangeInfo.start, end: rangeInfo.end, weeks: rangeInfo.weeks, dayCount: rangeInfo.allDay } }, api: { coord: function (data, clamp) { return coordSys.dataToPoint(data, clamp); } } }; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var ITEM_STYLE_NORMAL_PATH = ['itemStyle']; var ITEM_STYLE_EMPHASIS_PATH = ['emphasis', 'itemStyle']; var LABEL_NORMAL = ['label']; var LABEL_EMPHASIS = ['emphasis', 'label']; // Use prefix to avoid index to be the same as el.name, // which will cause weird udpate animation. var GROUP_DIFF_PREFIX = 'e\0\0'; /** * To reduce total package size of each coordinate systems, the modules `prepareCustom` * of each coordinate systems are not required by each coordinate systems directly, but * required by the module `custom`. * * prepareInfoForCustomSeries {Function}: optional * @return {Object} {coordSys: {...}, api: { * coord: function (data, clamp) {}, // return point in global. * size: function (dataSize, dataItem) {} // return size of each axis in coordSys. * }} */ var prepareCustoms = { cartesian2d: prepareCartesian2d, geo: prepareGeo, singleAxis: prepareSingleAxis, polar: preparePolar, calendar: prepareCalendar }; // ------ // Model // ------ extendSeriesModel({ type: 'series.custom', dependencies: ['grid', 'polar', 'geo', 'singleAxis', 'calendar'], defaultOption: { coordinateSystem: 'cartesian2d', // Can be set as 'none' zlevel: 0, z: 2, legendHoverLink: true // Cartesian coordinate system // xAxisIndex: 0, // yAxisIndex: 0, // Polar coordinate system // polarIndex: 0, // Geo coordinate system // geoIndex: 0, // label: {} // itemStyle: {} }, getInitialData: function (option, ecModel) { return createListFromArray(this.getSource(), this); } }); // ----- // View // ----- extendChartView({ type: 'custom', /** * @private * @type {module:echarts/data/List} */ _data: null, /** * @override */ render: function (customSeries, ecModel, api) { var oldData = this._data; var data = customSeries.getData(); var group = this.group; var renderItem = makeRenderItem(customSeries, data, ecModel, api); this.group.removeAll(); data.diff(oldData) .add(function (newIdx) { createOrUpdate$1( null, newIdx, renderItem(newIdx), customSeries, group, data ); }) .update(function (newIdx, oldIdx) { var el = oldData.getItemGraphicEl(oldIdx); createOrUpdate$1( el, newIdx, renderItem(newIdx), customSeries, group, data ); }) .remove(function (oldIdx) { var el = oldData.getItemGraphicEl(oldIdx); el && group.remove(el); }) .execute(); this._data = data; }, incrementalPrepareRender: function (customSeries, ecModel, api) { this.group.removeAll(); this._data = null; }, incrementalRender: function (params, customSeries, ecModel, api) { var data = customSeries.getData(); var renderItem = makeRenderItem(customSeries, data, ecModel, api); function setIncrementalAndHoverLayer(el) { if (!el.isGroup) { el.incremental = true; el.useHoverLayer = true; } } for (var idx = params.start; idx < params.end; idx++) { var el = createOrUpdate$1(null, idx, renderItem(idx), customSeries, this.group, data); el.traverse(setIncrementalAndHoverLayer); } }, /** * @override */ dispose: noop }); function createEl(elOption) { var graphicType = elOption.type; var el; if (graphicType === 'path') { var shape = elOption.shape; el = makePath( shape.pathData, null, { x: shape.x || 0, y: shape.y || 0, width: shape.width || 0, height: shape.height || 0 }, 'center' ); el.__customPathData = elOption.pathData; } else if (graphicType === 'image') { el = new ZImage({ }); el.__customImagePath = elOption.style.image; } else if (graphicType === 'text') { el = new Text({ }); el.__customText = elOption.style.text; } else { var Clz = graphic[graphicType.charAt(0).toUpperCase() + graphicType.slice(1)]; if (__DEV__) { assert$1(Clz, 'graphic type "' + graphicType + '" can not be found.'); } el = new Clz(); } el.__customGraphicType = graphicType; el.name = elOption.name; return el; } function updateEl(el, dataIndex, elOption, animatableModel, data, isInit) { var targetProps = {}; var elOptionStyle = elOption.style || {}; elOption.shape && (targetProps.shape = clone(elOption.shape)); elOption.position && (targetProps.position = elOption.position.slice()); elOption.scale && (targetProps.scale = elOption.scale.slice()); elOption.origin && (targetProps.origin = elOption.origin.slice()); elOption.rotation && (targetProps.rotation = elOption.rotation); if (el.type === 'image' && elOption.style) { var targetStyle = targetProps.style = {}; each$1(['x', 'y', 'width', 'height'], function (prop) { prepareStyleTransition(prop, targetStyle, elOptionStyle, el.style, isInit); }); } if (el.type === 'text' && elOption.style) { var targetStyle = targetProps.style = {}; each$1(['x', 'y'], function (prop) { prepareStyleTransition(prop, targetStyle, elOptionStyle, el.style, isInit); }); // Compatible with previous: both support // textFill and fill, textStroke and stroke in 'text' element. !elOptionStyle.hasOwnProperty('textFill') && elOptionStyle.fill && ( elOptionStyle.textFill = elOptionStyle.fill ); !elOptionStyle.hasOwnProperty('textStroke') && elOptionStyle.stroke && ( elOptionStyle.textStroke = elOptionStyle.stroke ); } if (el.type !== 'group') { el.useStyle(elOptionStyle); // Init animation. if (isInit) { el.style.opacity = 0; var targetOpacity = elOptionStyle.opacity; targetOpacity == null && (targetOpacity = 1); initProps(el, {style: {opacity: targetOpacity}}, animatableModel, dataIndex); } } if (isInit) { el.attr(targetProps); } else { updateProps(el, targetProps, animatableModel, dataIndex); } // z2 must not be null/undefined, otherwise sort error may occur. el.attr({z2: elOption.z2 || 0, silent: elOption.silent}); elOption.styleEmphasis !== false && setHoverStyle(el, elOption.styleEmphasis); } function prepareStyleTransition(prop, targetStyle, elOptionStyle, oldElStyle, isInit) { if (elOptionStyle[prop] != null && !isInit) { targetStyle[prop] = elOptionStyle[prop]; elOptionStyle[prop] = oldElStyle[prop]; } } function makeRenderItem(customSeries, data, ecModel, api) { var renderItem = customSeries.get('renderItem'); var coordSys = customSeries.coordinateSystem; var prepareResult = {}; if (coordSys) { if (__DEV__) { assert$1(renderItem, 'series.render is required.'); assert$1( coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.' ); } prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms() : prepareCustoms[coordSys.type](coordSys); } var userAPI = defaults({ getWidth: api.getWidth, getHeight: api.getHeight, getZr: api.getZr, getDevicePixelRatio: api.getDevicePixelRatio, value: value, style: style, styleEmphasis: styleEmphasis, visual: visual, barLayout: barLayout, currentSeriesIndices: currentSeriesIndices, font: font }, prepareResult.api || {}); var userParams = { context: {}, seriesId: customSeries.id, seriesName: customSeries.name, seriesIndex: customSeries.seriesIndex, coordSys: prepareResult.coordSys, dataInsideLength: data.count(), encode: wrapEncodeDef(customSeries.getData()) }; // Do not support call `api` asynchronously without dataIndexInside input. var currDataIndexInside; var currDirty = true; var currItemModel; var currLabelNormalModel; var currLabelEmphasisModel; var currVisualColor; return function (dataIndexInside) { currDataIndexInside = dataIndexInside; currDirty = true; return renderItem && renderItem( defaults({ dataIndexInside: dataIndexInside, dataIndex: data.getRawIndex(dataIndexInside) }, userParams), userAPI ) || {}; }; // Do not update cache until api called. function updateCache(dataIndexInside) { dataIndexInside == null && (dataIndexInside = currDataIndexInside); if (currDirty) { currItemModel = data.getItemModel(dataIndexInside); currLabelNormalModel = currItemModel.getModel(LABEL_NORMAL); currLabelEmphasisModel = currItemModel.getModel(LABEL_EMPHASIS); currVisualColor = data.getItemVisual(dataIndexInside, 'color'); currDirty = false; } } /** * @public * @param {number|string} dim * @param {number} [dataIndexInside=currDataIndexInside] * @return {number|string} value */ function value(dim, dataIndexInside) { dataIndexInside == null && (dataIndexInside = currDataIndexInside); return data.get(data.getDimension(dim || 0), dataIndexInside); } /** * By default, `visual` is applied to style (to support visualMap). * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`, * it can be implemented as: * `api.style({stroke: api.visual('color'), fill: null})`; * @public * @param {Object} [extra] * @param {number} [dataIndexInside=currDataIndexInside] */ function style(extra, dataIndexInside) { dataIndexInside == null && (dataIndexInside = currDataIndexInside); updateCache(dataIndexInside); var itemStyle = currItemModel.getModel(ITEM_STYLE_NORMAL_PATH).getItemStyle(); currVisualColor != null && (itemStyle.fill = currVisualColor); var opacity = data.getItemVisual(dataIndexInside, 'opacity'); opacity != null && (itemStyle.opacity = opacity); setTextStyle(itemStyle, currLabelNormalModel, null, { autoColor: currVisualColor, isRectText: true }); itemStyle.text = currLabelNormalModel.getShallow('show') ? retrieve2( customSeries.getFormattedLabel(dataIndexInside, 'normal'), getDefaultLabel(data, dataIndexInside) ) : null; extra && extend(itemStyle, extra); return itemStyle; } /** * @public * @param {Object} [extra] * @param {number} [dataIndexInside=currDataIndexInside] */ function styleEmphasis(extra, dataIndexInside) { dataIndexInside == null && (dataIndexInside = currDataIndexInside); updateCache(dataIndexInside); var itemStyle = currItemModel.getModel(ITEM_STYLE_EMPHASIS_PATH).getItemStyle(); setTextStyle(itemStyle, currLabelEmphasisModel, null, { isRectText: true }, true); itemStyle.text = currLabelEmphasisModel.getShallow('show') ? retrieve3( customSeries.getFormattedLabel(dataIndexInside, 'emphasis'), customSeries.getFormattedLabel(dataIndexInside, 'normal'), getDefaultLabel(data, dataIndexInside) ) : null; extra && extend(itemStyle, extra); return itemStyle; } /** * @public * @param {string} visualType * @param {number} [dataIndexInside=currDataIndexInside] */ function visual(visualType, dataIndexInside) { dataIndexInside == null && (dataIndexInside = currDataIndexInside); return data.getItemVisual(dataIndexInside, visualType); } /** * @public * @param {number} opt.count Positive interger. * @param {number} [opt.barWidth] * @param {number} [opt.barMaxWidth] * @param {number} [opt.barGap] * @param {number} [opt.barCategoryGap] * @return {Object} {width, offset, offsetCenter} is not support, return undefined. */ function barLayout(opt) { if (coordSys.getBaseAxis) { var baseAxis = coordSys.getBaseAxis(); return getLayoutOnAxis(defaults({axis: baseAxis}, opt), api); } } /** * @public * @return {Array.} */ function currentSeriesIndices() { return ecModel.getCurrentSeriesIndices(); } /** * @public * @param {Object} opt * @param {string} [opt.fontStyle] * @param {number} [opt.fontWeight] * @param {number} [opt.fontSize] * @param {string} [opt.fontFamily] * @return {string} font string */ function font(opt) { return getFont(opt, ecModel); } } function wrapEncodeDef(data) { var encodeDef = {}; each$1(data.dimensions, function (dimName, dataDimIndex) { var dimInfo = data.getDimensionInfo(dimName); if (!dimInfo.isExtraCoord) { var coordDim = dimInfo.coordDim; var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || []; dataDims[dimInfo.coordDimIndex] = dataDimIndex; } }); return encodeDef; } function createOrUpdate$1(el, dataIndex, elOption, animatableModel, group, data) { el = doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data); el && data.setItemGraphicEl(dataIndex, el); return el; } function doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data) { var elOptionType = elOption.type; if (el && elOptionType !== el.__customGraphicType && (elOptionType !== 'path' || elOption.pathData !== el.__customPathData) && (elOptionType !== 'image' || elOption.style.image !== el.__customImagePath) && (elOptionType !== 'text' || elOption.style.text !== el.__customText) ) { group.remove(el); el = null; } // `elOption.type` is undefined when `renderItem` returns nothing. if (elOptionType == null) { return; } var isInit = !el; !el && (el = createEl(elOption)); updateEl(el, dataIndex, elOption, animatableModel, data, isInit); if (elOptionType === 'group') { var oldChildren = el.children() || []; var newChildren = elOption.children || []; if (elOption.diffChildrenByName) { // lower performance. diffGroupChildren({ oldChildren: oldChildren, newChildren: newChildren, dataIndex: dataIndex, animatableModel: animatableModel, group: el, data: data }); } else { // better performance. var index = 0; for (; index < newChildren.length; index++) { doCreateOrUpdate( el.childAt(index), dataIndex, newChildren[index], animatableModel, el, data ); } for (; index < oldChildren.length; index++) { oldChildren[index] && el.remove(oldChildren[index]); } } } group.add(el); return el; } function diffGroupChildren(context) { (new DataDiffer( context.oldChildren, context.newChildren, getKey, getKey, context )) .add(processAddUpdate) .update(processAddUpdate) .remove(processRemove) .execute(); } function getKey(item, idx) { var name = item && item.name; return name != null ? name : GROUP_DIFF_PREFIX + idx; } function processAddUpdate(newIndex, oldIndex) { var context = this.context; var childOption = newIndex != null ? context.newChildren[newIndex] : null; var child = oldIndex != null ? context.oldChildren[oldIndex] : null; doCreateOrUpdate( child, context.dataIndex, childOption, context.animatableModel, context.group, context.data ); } function processRemove(oldIndex) { var context = this.context; var child = context.oldChildren[oldIndex]; child && context.group.remove(child); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // ------------- // Preprocessor // ------------- registerPreprocessor(function (option) { var graphicOption = option.graphic; // Convert // {graphic: [{left: 10, type: 'circle'}, ...]} // or // {graphic: {left: 10, type: 'circle'}} // to // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]} if (isArray(graphicOption)) { if (!graphicOption[0] || !graphicOption[0].elements) { option.graphic = [{elements: graphicOption}]; } else { // Only one graphic instance can be instantiated. (We dont // want that too many views are created in echarts._viewMap) option.graphic = [option.graphic[0]]; } } else if (graphicOption && !graphicOption.elements) { option.graphic = [{elements: [graphicOption]}]; } }); // ------ // Model // ------ var GraphicModel = extendComponentModel({ type: 'graphic', defaultOption: { // Extra properties for each elements: // // left/right/top/bottom: (like 12, '22%', 'center', default undefined) // If left/rigth is set, shape.x/shape.cx/position will not be used. // If top/bottom is set, shape.y/shape.cy/position will not be used. // This mechanism is useful when you want to position a group/element // against the right side or the center of this container. // // width/height: (can only be pixel value, default 0) // Only be used to specify contianer(group) size, if needed. And // can not be percentage value (like '33%'). See the reason in the // layout algorithm below. // // bounding: (enum: 'all' (default) | 'raw') // Specify how to calculate boundingRect when locating. // 'all': Get uioned and transformed boundingRect // from both itself and its descendants. // This mode simplies confining a group of elements in the bounding // of their ancester container (e.g., using 'right: 0'). // 'raw': Only use the boundingRect of itself and before transformed. // This mode is similar to css behavior, which is useful when you // want an element to be able to overflow its container. (Consider // a rotated circle needs to be located in a corner.) // Note: elements is always behind its ancestors in this elements array. elements: [], parentId: null }, /** * Save el options for the sake of the performance (only update modified graphics). * The order is the same as those in option. (ancesters -> descendants) * * @private * @type {Array.} */ _elOptionsToUpdate: null, /** * @override */ mergeOption: function (option) { // Prevent default merge to elements var elements = this.option.elements; this.option.elements = null; GraphicModel.superApply(this, 'mergeOption', arguments); this.option.elements = elements; }, /** * @override */ optionUpdated: function (newOption, isInit) { var thisOption = this.option; var newList = (isInit ? thisOption : newOption).elements; var existList = thisOption.elements = isInit ? [] : thisOption.elements; var flattenedList = []; this._flatten(newList, flattenedList); var mappingResult = mappingToExists(existList, flattenedList); makeIdAndName(mappingResult); // Clear elOptionsToUpdate var elOptionsToUpdate = this._elOptionsToUpdate = []; each$1(mappingResult, function (resultItem, index) { var newElOption = resultItem.option; if (__DEV__) { assert$1( isObject$1(newElOption) || resultItem.exist, 'Empty graphic option definition' ); } if (!newElOption) { return; } elOptionsToUpdate.push(newElOption); setKeyInfoToNewElOption(resultItem, newElOption); mergeNewElOptionToExist(existList, index, newElOption); setLayoutInfoToExist(existList[index], newElOption); }, this); // Clean for (var i = existList.length - 1; i >= 0; i--) { if (existList[i] == null) { existList.splice(i, 1); } else { // $action should be volatile, otherwise option gotten from // `getOption` will contain unexpected $action. delete existList[i].$action; } } }, /** * Convert * [{ * type: 'group', * id: 'xx', * children: [{type: 'circle'}, {type: 'polygon'}] * }] * to * [ * {type: 'group', id: 'xx'}, * {type: 'circle', parentId: 'xx'}, * {type: 'polygon', parentId: 'xx'} * ] * * @private * @param {Array.} optionList option list * @param {Array.} result result of flatten * @param {Object} parentOption parent option */ _flatten: function (optionList, result, parentOption) { each$1(optionList, function (option) { if (!option) { return; } if (parentOption) { option.parentOption = parentOption; } result.push(option); var children = option.children; if (option.type === 'group' && children) { this._flatten(children, result, option); } // Deleting for JSON output, and for not affecting group creation. delete option.children; }, this); }, // FIXME // Pass to view using payload? setOption has a payload? useElOptionsToUpdate: function () { var els = this._elOptionsToUpdate; // Clear to avoid render duplicately when zooming. this._elOptionsToUpdate = null; return els; } }); // ----- // View // ----- extendComponentView({ type: 'graphic', /** * @override */ init: function (ecModel, api) { /** * @private * @type {module:zrender/core/util.HashMap} */ this._elMap = createHashMap(); /** * @private * @type {module:echarts/graphic/GraphicModel} */ this._lastGraphicModel; }, /** * @override */ render: function (graphicModel, ecModel, api) { // Having leveraged between use cases and algorithm complexity, a very // simple layout mechanism is used: // The size(width/height) can be determined by itself or its parent (not // implemented yet), but can not by its children. (Top-down travel) // The location(x/y) can be determined by the bounding rect of itself // (can including its descendants or not) and the size of its parent. // (Bottom-up travel) // When `chart.clear()` or `chart.setOption({...}, true)` with the same id, // view will be reused. if (graphicModel !== this._lastGraphicModel) { this._clear(); } this._lastGraphicModel = graphicModel; this._updateElements(graphicModel, api); this._relocate(graphicModel, api); }, /** * Update graphic elements. * * @private * @param {Object} graphicModel graphic model * @param {module:echarts/ExtensionAPI} api extension API */ _updateElements: function (graphicModel, api) { var elOptionsToUpdate = graphicModel.useElOptionsToUpdate(); if (!elOptionsToUpdate) { return; } var elMap = this._elMap; var rootGroup = this.group; // Top-down tranverse to assign graphic settings to each elements. each$1(elOptionsToUpdate, function (elOption) { var $action = elOption.$action; var id = elOption.id; var existEl = elMap.get(id); var parentId = elOption.parentId; var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup; if (elOption.type === 'text') { var elOptionStyle = elOption.style; // In top/bottom mode, textVerticalAlign should not be used, which cause // inaccurately locating. if (elOption.hv && elOption.hv[1]) { elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = null; } // Compatible with previous setting: both support fill and textFill, // stroke and textStroke. !elOptionStyle.hasOwnProperty('textFill') && elOptionStyle.fill && ( elOptionStyle.textFill = elOptionStyle.fill ); !elOptionStyle.hasOwnProperty('textStroke') && elOptionStyle.stroke && ( elOptionStyle.textStroke = elOptionStyle.stroke ); } // Remove unnecessary props to avoid potential problems. var elOptionCleaned = getCleanedElOption(elOption); // For simple, do not support parent change, otherwise reorder is needed. if (__DEV__) { existEl && assert$1( targetElParent === existEl.parent, 'Changing parent is not supported.' ); } if (!$action || $action === 'merge') { existEl ? existEl.attr(elOptionCleaned) : createEl$1(id, targetElParent, elOptionCleaned, elMap); } else if ($action === 'replace') { removeEl(existEl, elMap); createEl$1(id, targetElParent, elOptionCleaned, elMap); } else if ($action === 'remove') { removeEl(existEl, elMap); } var el = elMap.get(id); if (el) { el.__ecGraphicWidth = elOption.width; el.__ecGraphicHeight = elOption.height; } }); }, /** * Locate graphic elements. * * @private * @param {Object} graphicModel graphic model * @param {module:echarts/ExtensionAPI} api extension API */ _relocate: function (graphicModel, api) { var elOptions = graphicModel.option.elements; var rootGroup = this.group; var elMap = this._elMap; // Bottom-up tranvese all elements (consider ec resize) to locate elements. for (var i = elOptions.length - 1; i >= 0; i--) { var elOption = elOptions[i]; var el = elMap.get(elOption.id); if (!el) { continue; } var parentEl = el.parent; var containerInfo = parentEl === rootGroup ? { width: api.getWidth(), height: api.getHeight() } : { // Like 'position:absolut' in css, default 0. width: parentEl.__ecGraphicWidth || 0, height: parentEl.__ecGraphicHeight || 0 }; positionElement( el, elOption, containerInfo, null, {hv: elOption.hv, boundingMode: elOption.bounding} ); } }, /** * Clear all elements. * * @private */ _clear: function () { var elMap = this._elMap; elMap.each(function (el) { removeEl(el, elMap); }); this._elMap = createHashMap(); }, /** * @override */ dispose: function () { this._clear(); } }); function createEl$1(id, targetElParent, elOption, elMap) { var graphicType = elOption.type; if (__DEV__) { assert$1(graphicType, 'graphic type MUST be set'); } var Clz = graphic[graphicType.charAt(0).toUpperCase() + graphicType.slice(1)]; if (__DEV__) { assert$1(Clz, 'graphic type can not be found'); } var el = new Clz(elOption); targetElParent.add(el); elMap.set(id, el); el.__ecGraphicId = id; } function removeEl(existEl, elMap) { var existElParent = existEl && existEl.parent; if (existElParent) { existEl.type === 'group' && existEl.traverse(function (el) { removeEl(el, elMap); }); elMap.removeKey(existEl.__ecGraphicId); existElParent.remove(existEl); } } // Remove unnecessary props to avoid potential problems. function getCleanedElOption(elOption) { elOption = extend({}, elOption); each$1( ['id', 'parentId', '$action', 'hv', 'bounding'].concat(LOCATION_PARAMS), function (name) { delete elOption[name]; } ); return elOption; } function isSetLoc(obj, props) { var isSet; each$1(props, function (prop) { obj[prop] != null && obj[prop] !== 'auto' && (isSet = true); }); return isSet; } function setKeyInfoToNewElOption(resultItem, newElOption) { var existElOption = resultItem.exist; // Set id and type after id assigned. newElOption.id = resultItem.keyInfo.id; !newElOption.type && existElOption && (newElOption.type = existElOption.type); // Set parent id if not specified if (newElOption.parentId == null) { var newElParentOption = newElOption.parentOption; if (newElParentOption) { newElOption.parentId = newElParentOption.id; } else if (existElOption) { newElOption.parentId = existElOption.parentId; } } // Clear newElOption.parentOption = null; } function mergeNewElOptionToExist(existList, index, newElOption) { // Update existing options, for `getOption` feature. var newElOptCopy = extend({}, newElOption); var existElOption = existList[index]; var $action = newElOption.$action || 'merge'; if ($action === 'merge') { if (existElOption) { if (__DEV__) { var newType = newElOption.type; assert$1( !newType || existElOption.type === newType, 'Please set $action: "replace" to change `type`' ); } // We can ensure that newElOptCopy and existElOption are not // the same object, so `merge` will not change newElOptCopy. merge(existElOption, newElOptCopy, true); // Rigid body, use ignoreSize. mergeLayoutParam(existElOption, newElOptCopy, {ignoreSize: true}); // Will be used in render. copyLayoutParams(newElOption, existElOption); } else { existList[index] = newElOptCopy; } } else if ($action === 'replace') { existList[index] = newElOptCopy; } else if ($action === 'remove') { // null will be cleaned later. existElOption && (existList[index] = null); } } function setLayoutInfoToExist(existItem, newElOption) { if (!existItem) { return; } existItem.hv = newElOption.hv = [ // Rigid body, dont care `width`. isSetLoc(newElOption, ['left', 'right']), // Rigid body, dont care `height`. isSetLoc(newElOption, ['top', 'bottom']) ]; // Give default group size. Otherwise layout error may occur. if (existItem.type === 'group') { existItem.width == null && (existItem.width = newElOption.width = 0); existItem.height == null && (existItem.height = newElOption.height = 0); } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var LegendModel = extendComponentModel({ type: 'legend.plain', dependencies: ['series'], layoutMode: { type: 'box', // legend.width/height are maxWidth/maxHeight actually, // whereas realy width/height is calculated by its content. // (Setting {left: 10, right: 10} does not make sense). // So consider the case: // `setOption({legend: {left: 10});` // then `setOption({legend: {right: 10});` // The previous `left` should be cleared by setting `ignoreSize`. ignoreSize: true }, init: function (option, parentModel, ecModel) { this.mergeDefaultAndTheme(option, ecModel); option.selected = option.selected || {}; }, mergeOption: function (option) { LegendModel.superCall(this, 'mergeOption', option); }, optionUpdated: function () { this._updateData(this.ecModel); var legendData = this._data; // If selectedMode is single, try to select one if (legendData[0] && this.get('selectedMode') === 'single') { var hasSelected = false; // If has any selected in option.selected for (var i = 0; i < legendData.length; i++) { var name = legendData[i].get('name'); if (this.isSelected(name)) { // Force to unselect others this.select(name); hasSelected = true; break; } } // Try select the first if selectedMode is single !hasSelected && this.select(legendData[0].get('name')); } }, _updateData: function (ecModel) { var potentialData = []; var availableNames = []; ecModel.eachRawSeries(function (seriesModel) { var seriesName = seriesModel.name; availableNames.push(seriesName); var isPotential; if (seriesModel.legendDataProvider) { var data = seriesModel.legendDataProvider(); var names = data.mapArray(data.getName); if (!ecModel.isSeriesFiltered(seriesModel)) { availableNames = availableNames.concat(names); } if (names.length) { potentialData = potentialData.concat(names); } else { isPotential = true; } } else { isPotential = true; } if (isPotential && isNameSpecified(seriesModel)) { potentialData.push(seriesModel.name); } }); /** * @type {Array.} * @private */ this._availableNames = availableNames; // If legend.data not specified in option, use availableNames as data, // which is convinient for user preparing option. var rawData = this.get('data') || potentialData; var legendData = map(rawData, function (dataItem) { // Can be string or number if (typeof dataItem === 'string' || typeof dataItem === 'number') { dataItem = { name: dataItem }; } return new Model(dataItem, this, this.ecModel); }, this); /** * @type {Array.} * @private */ this._data = legendData; }, /** * @return {Array.} */ getData: function () { return this._data; }, /** * @param {string} name */ select: function (name) { var selected = this.option.selected; var selectedMode = this.get('selectedMode'); if (selectedMode === 'single') { var data = this._data; each$1(data, function (dataItem) { selected[dataItem.get('name')] = false; }); } selected[name] = true; }, /** * @param {string} name */ unSelect: function (name) { if (this.get('selectedMode') !== 'single') { this.option.selected[name] = false; } }, /** * @param {string} name */ toggleSelected: function (name) { var selected = this.option.selected; // Default is true if (!selected.hasOwnProperty(name)) { selected[name] = true; } this[selected[name] ? 'unSelect' : 'select'](name); }, /** * @param {string} name */ isSelected: function (name) { var selected = this.option.selected; return !(selected.hasOwnProperty(name) && !selected[name]) && indexOf(this._availableNames, name) >= 0; }, defaultOption: { // 一级层叠 zlevel: 0, // 二级层叠 z: 4, show: true, // 布局方式,默认为水平布局,可选为: // 'horizontal' | 'vertical' orient: 'horizontal', left: 'center', // right: 'center', top: 0, // bottom: null, // 水平对齐 // 'auto' | 'left' | 'right' // 默认为 'auto', 根据 x 的位置判断是左对齐还是右对齐 align: 'auto', backgroundColor: 'rgba(0,0,0,0)', // 图例边框颜色 borderColor: '#ccc', borderRadius: 0, // 图例边框线宽,单位px,默认为0(无边框) borderWidth: 0, // 图例内边距,单位px,默认各方向内边距为5, // 接受数组分别设定上右下左边距,同css padding: 5, // 各个item之间的间隔,单位px,默认为10, // 横向布局时为水平间隔,纵向布局时为纵向间隔 itemGap: 10, // 图例图形宽度 itemWidth: 25, // 图例图形高度 itemHeight: 14, // 图例关闭时候的颜色 inactiveColor: '#ccc', textStyle: { // 图例文字颜色 color: '#333' }, // formatter: '', // 选择模式,默认开启图例开关 selectedMode: true, // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 // selected: null, // 图例内容(详见legend.data,数组中每一项代表一个item // data: [], // Tooltip 相关配置 tooltip: { show: false } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function legendSelectActionHandler(methodName, payload, ecModel) { var selectedMap = {}; var isToggleSelect = methodName === 'toggleSelected'; var isSelected; // Update all legend components ecModel.eachComponent('legend', function (legendModel) { if (isToggleSelect && isSelected != null) { // Force other legend has same selected status // Or the first is toggled to true and other are toggled to false // In the case one legend has some item unSelected in option. And if other legend // doesn't has the item, they will assume it is selected. legendModel[isSelected ? 'select' : 'unSelect'](payload.name); } else { legendModel[methodName](payload.name); isSelected = legendModel.isSelected(payload.name); } var legendData = legendModel.getData(); each$1(legendData, function (model) { var name = model.get('name'); // Wrap element if (name === '\n' || name === '') { return; } var isItemSelected = legendModel.isSelected(name); if (selectedMap.hasOwnProperty(name)) { // Unselected if any legend is unselected selectedMap[name] = selectedMap[name] && isItemSelected; } else { selectedMap[name] = isItemSelected; } }); }); // Return the event explicitly return { name: payload.name, selected: selectedMap }; } /** * @event legendToggleSelect * @type {Object} * @property {string} type 'legendToggleSelect' * @property {string} [from] * @property {string} name Series name or data item name */ registerAction( 'legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected') ); /** * @event legendSelect * @type {Object} * @property {string} type 'legendSelect' * @property {string} name Series name or data item name */ registerAction( 'legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select') ); /** * @event legendUnSelect * @type {Object} * @property {string} type 'legendUnSelect' * @property {string} name Series name or data item name */ registerAction( 'legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect') ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Layout list like component. * It will box layout each items in group of component and then position the whole group in the viewport * @param {module:zrender/group/Group} group * @param {module:echarts/model/Component} componentModel * @param {module:echarts/ExtensionAPI} */ function layout$3(group, componentModel, api) { var boxLayoutParams = componentModel.getBoxLayoutParams(); var padding = componentModel.get('padding'); var viewportSize = {width: api.getWidth(), height: api.getHeight()}; var rect = getLayoutRect( boxLayoutParams, viewportSize, padding ); box( componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height ); positionElement( group, boxLayoutParams, viewportSize, padding ); } function makeBackground(rect, componentModel) { var padding = normalizeCssArray$1( componentModel.get('padding') ); var style = componentModel.getItemStyle(['color', 'opacity']); style.fill = componentModel.get('backgroundColor'); var rect = new Rect({ shape: { x: rect.x - padding[3], y: rect.y - padding[0], width: rect.width + padding[1] + padding[3], height: rect.height + padding[0] + padding[2], r: componentModel.get('borderRadius') }, style: style, silent: true, z2: -1 }); // FIXME // `subPixelOptimizeRect` may bring some gap between edge of viewpart // and background rect when setting like `left: 0`, `top: 0`. // graphic.subPixelOptimizeRect(rect); return rect; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var curry$4 = curry; var each$16 = each$1; var Group$3 = Group; var LegendView = extendComponentView({ type: 'legend.plain', newlineDisabled: false, /** * @override */ init: function () { /** * @private * @type {module:zrender/container/Group} */ this.group.add(this._contentGroup = new Group$3()); /** * @private * @type {module:zrender/Element} */ this._backgroundEl; }, /** * @protected */ getContentGroup: function () { return this._contentGroup; }, /** * @override */ render: function (legendModel, ecModel, api) { this.resetInner(); if (!legendModel.get('show', true)) { return; } var itemAlign = legendModel.get('align'); if (!itemAlign || itemAlign === 'auto') { itemAlign = ( legendModel.get('left') === 'right' && legendModel.get('orient') === 'vertical' ) ? 'right' : 'left'; } this.renderInner(itemAlign, legendModel, ecModel, api); // Perform layout. var positionInfo = legendModel.getBoxLayoutParams(); var viewportSize = {width: api.getWidth(), height: api.getHeight()}; var padding = legendModel.get('padding'); var maxSize = getLayoutRect(positionInfo, viewportSize, padding); var mainRect = this.layoutInner(legendModel, itemAlign, maxSize); // Place mainGroup, based on the calculated `mainRect`. var layoutRect = getLayoutRect( defaults({width: mainRect.width, height: mainRect.height}, positionInfo), viewportSize, padding ); this.group.attr('position', [layoutRect.x - mainRect.x, layoutRect.y - mainRect.y]); // Render background after group is layout. this.group.add( this._backgroundEl = makeBackground(mainRect, legendModel) ); }, /** * @protected */ resetInner: function () { this.getContentGroup().removeAll(); this._backgroundEl && this.group.remove(this._backgroundEl); }, /** * @protected */ renderInner: function (itemAlign, legendModel, ecModel, api) { var contentGroup = this.getContentGroup(); var legendDrawnMap = createHashMap(); var selectMode = legendModel.get('selectedMode'); var excludeSeriesId = []; ecModel.eachRawSeries(function (seriesModel) { !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id); }); each$16(legendModel.getData(), function (itemModel, dataIndex) { var name = itemModel.get('name'); // Use empty string or \n as a newline string if (!this.newlineDisabled && (name === '' || name === '\n')) { contentGroup.add(new Group$3({ newline: true })); return; } // Representitive series. var seriesModel = ecModel.getSeriesByName(name)[0]; if (legendDrawnMap.get(name)) { // Have been drawed return; } // Series legend if (seriesModel) { var data = seriesModel.getData(); var color = data.getVisual('color'); // If color is a callback function if (typeof color === 'function') { // Use the first data color = color(seriesModel.getDataParams(0)); } // Using rect symbol defaultly var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect'; var symbolType = data.getVisual('symbol'); var itemGroup = this._createItem( name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, selectMode ); itemGroup.on('click', curry$4(dispatchSelectAction, name, api)) .on('mouseover', curry$4(dispatchHighlightAction, seriesModel, null, api, excludeSeriesId)) .on('mouseout', curry$4(dispatchDownplayAction, seriesModel, null, api, excludeSeriesId)); legendDrawnMap.set(name, true); } else { // Data legend of pie, funnel ecModel.eachRawSeries(function (seriesModel) { // In case multiple series has same data name if (legendDrawnMap.get(name)) { return; } if (seriesModel.legendDataProvider) { var data = seriesModel.legendDataProvider(); var idx = data.indexOfName(name); if (idx < 0) { return; } var color = data.getItemVisual(idx, 'color'); var legendSymbolType = 'roundRect'; var itemGroup = this._createItem( name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, selectMode ); // FIXME: consider different series has items with the same name. itemGroup.on('click', curry$4(dispatchSelectAction, name, api)) // FIXME Should not specify the series name .on('mouseover', curry$4(dispatchHighlightAction, seriesModel, name, api, excludeSeriesId)) .on('mouseout', curry$4(dispatchDownplayAction, seriesModel, name, api, excludeSeriesId)); legendDrawnMap.set(name, true); } }, this); } if (__DEV__) { if (!legendDrawnMap.get(name)) { console.warn(name + ' series not exists. Legend data should be same with series name or data name.'); } } }, this); }, _createItem: function ( name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, selectMode ) { var itemWidth = legendModel.get('itemWidth'); var itemHeight = legendModel.get('itemHeight'); var inactiveColor = legendModel.get('inactiveColor'); var symbolKeepAspect = legendModel.get('symbolKeepAspect'); var isSelected = legendModel.isSelected(name); var itemGroup = new Group$3(); var textStyleModel = itemModel.getModel('textStyle'); var itemIcon = itemModel.get('icon'); var tooltipModel = itemModel.getModel('tooltip'); var legendGlobalTooltipModel = tooltipModel.parentModel; // Use user given icon first legendSymbolType = itemIcon || legendSymbolType; itemGroup.add(createSymbol( legendSymbolType, 0, 0, itemWidth, itemHeight, isSelected ? color : inactiveColor, // symbolKeepAspect default true for legend symbolKeepAspect == null ? true : symbolKeepAspect )); // Compose symbols // PENDING if (!itemIcon && symbolType // At least show one symbol, can't be all none && ((symbolType !== legendSymbolType) || symbolType == 'none') ) { var size = itemHeight * 0.8; if (symbolType === 'none') { symbolType = 'circle'; } // Put symbol in the center itemGroup.add(createSymbol( symbolType, (itemWidth - size) / 2, (itemHeight - size) / 2, size, size, isSelected ? color : inactiveColor, // symbolKeepAspect default true for legend symbolKeepAspect == null ? true : symbolKeepAspect )); } var textX = itemAlign === 'left' ? itemWidth + 5 : -5; var textAlign = itemAlign; var formatter = legendModel.get('formatter'); var content = name; if (typeof formatter === 'string' && formatter) { content = formatter.replace('{name}', name != null ? name : ''); } else if (typeof formatter === 'function') { content = formatter(name); } itemGroup.add(new Text({ style: setTextStyle({}, textStyleModel, { text: content, x: textX, y: itemHeight / 2, textFill: isSelected ? textStyleModel.getTextColor() : inactiveColor, textAlign: textAlign, textVerticalAlign: 'middle' }) })); // Add a invisible rect to increase the area of mouse hover var hitRect = new Rect({ shape: itemGroup.getBoundingRect(), invisible: true, tooltip: tooltipModel.get('show') ? extend({ content: name, // Defaul formatter formatter: legendGlobalTooltipModel.get('formatter', true) || function () { return name; }, formatterParams: { componentType: 'legend', legendIndex: legendModel.componentIndex, name: name, $vars: ['name'] } }, tooltipModel.option) : null }); itemGroup.add(hitRect); itemGroup.eachChild(function (child) { child.silent = true; }); hitRect.silent = !selectMode; this.getContentGroup().add(itemGroup); setHoverStyle(itemGroup); itemGroup.__legendDataIndex = dataIndex; return itemGroup; }, /** * @protected */ layoutInner: function (legendModel, itemAlign, maxSize) { var contentGroup = this.getContentGroup(); // Place items in contentGroup. box( legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height ); var contentRect = contentGroup.getBoundingRect(); contentGroup.attr('position', [-contentRect.x, -contentRect.y]); return this.group.getBoundingRect(); } }); function dispatchSelectAction(name, api) { api.dispatchAction({ type: 'legendToggleSelect', name: name }); } function dispatchHighlightAction(seriesModel, dataName, api, excludeSeriesId) { // If element hover will move to a hoverLayer. var el = api.getZr().storage.getDisplayList()[0]; if (!(el && el.useHoverLayer)) { api.dispatchAction({ type: 'highlight', seriesName: seriesModel.name, name: dataName, excludeSeriesId: excludeSeriesId }); } } function dispatchDownplayAction(seriesModel, dataName, api, excludeSeriesId) { // If element hover will move to a hoverLayer. var el = api.getZr().storage.getDisplayList()[0]; if (!(el && el.useHoverLayer)) { api.dispatchAction({ type: 'downplay', seriesName: seriesModel.name, name: dataName, excludeSeriesId: excludeSeriesId }); } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var legendFilter = function (ecModel) { var legendModels = ecModel.findComponents({ mainType: 'legend' }); if (legendModels && legendModels.length) { ecModel.filterSeries(function (series) { // If in any legend component the status is not selected. // Because in legend series is assumed selected when it is not in the legend data. for (var i = 0; i < legendModels.length; i++) { if (!legendModels[i].isSelected(series.name)) { return false; } } return true; }); } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Do not contain scrollable legend, for sake of file size. // Series Filter registerProcessor(legendFilter); ComponentModel.registerSubTypeDefaulter('legend', function () { // Default 'plain' when no type specified. return 'plain'; }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var ScrollableLegendModel = LegendModel.extend({ type: 'legend.scroll', /** * @param {number} scrollDataIndex */ setScrollDataIndex: function (scrollDataIndex) { this.option.scrollDataIndex = scrollDataIndex; }, defaultOption: { scrollDataIndex: 0, pageButtonItemGap: 5, pageButtonGap: null, pageButtonPosition: 'end', // 'start' or 'end' pageFormatter: '{current}/{total}', // If null/undefined, do not show page. pageIcons: { horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'], vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z'] }, pageIconColor: '#2f4554', pageIconInactiveColor: '#aaa', pageIconSize: 15, // Can be [10, 3], which represents [width, height] pageTextStyle: { color: '#333' }, animationDurationUpdate: 800 }, /** * @override */ init: function (option, parentModel, ecModel, extraOpt) { var inputPositionParams = getLayoutParams(option); ScrollableLegendModel.superCall(this, 'init', option, parentModel, ecModel, extraOpt); mergeAndNormalizeLayoutParams(this, option, inputPositionParams); }, /** * @override */ mergeOption: function (option, extraOpt) { ScrollableLegendModel.superCall(this, 'mergeOption', option, extraOpt); mergeAndNormalizeLayoutParams(this, this.option, option); }, getOrient: function () { return this.get('orient') === 'vertical' ? {index: 1, name: 'vertical'} : {index: 0, name: 'horizontal'}; } }); // Do not `ignoreSize` to enable setting {left: 10, right: 10}. function mergeAndNormalizeLayoutParams(legendModel, target, raw) { var orient = legendModel.getOrient(); var ignoreSize = [1, 1]; ignoreSize[orient.index] = 0; mergeLayoutParam(target, raw, { type: 'box', ignoreSize: ignoreSize }); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Separate legend and scrollable legend to reduce package size. */ var Group$4 = Group; var WH$1 = ['width', 'height']; var XY$1 = ['x', 'y']; var ScrollableLegendView = LegendView.extend({ type: 'legend.scroll', newlineDisabled: true, init: function () { ScrollableLegendView.superCall(this, 'init'); /** * @private * @type {number} For `scroll`. */ this._currentIndex = 0; /** * @private * @type {module:zrender/container/Group} */ this.group.add(this._containerGroup = new Group$4()); this._containerGroup.add(this.getContentGroup()); /** * @private * @type {module:zrender/container/Group} */ this.group.add(this._controllerGroup = new Group$4()); /** * * @private */ this._showController; }, /** * @override */ resetInner: function () { ScrollableLegendView.superCall(this, 'resetInner'); this._controllerGroup.removeAll(); this._containerGroup.removeClipPath(); this._containerGroup.__rectSize = null; }, /** * @override */ renderInner: function (itemAlign, legendModel, ecModel, api) { var me = this; // Render content items. ScrollableLegendView.superCall(this, 'renderInner', itemAlign, legendModel, ecModel, api); var controllerGroup = this._controllerGroup; var pageIconSize = legendModel.get('pageIconSize', true); if (!isArray(pageIconSize)) { pageIconSize = [pageIconSize, pageIconSize]; } createPageButton('pagePrev', 0); var pageTextStyleModel = legendModel.getModel('pageTextStyle'); controllerGroup.add(new Text({ name: 'pageText', style: { textFill: pageTextStyleModel.getTextColor(), font: pageTextStyleModel.getFont(), textVerticalAlign: 'middle', textAlign: 'center' }, silent: true })); createPageButton('pageNext', 1); function createPageButton(name, iconIdx) { var pageDataIndexName = name + 'DataIndex'; var icon = createIcon( legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], { // Buttons will be created in each render, so we do not need // to worry about avoiding using legendModel kept in scope. onclick: bind( me._pageGo, me, pageDataIndexName, legendModel, api ) }, { x: -pageIconSize[0] / 2, y: -pageIconSize[1] / 2, width: pageIconSize[0], height: pageIconSize[1] } ); icon.name = name; controllerGroup.add(icon); } }, /** * @override */ layoutInner: function (legendModel, itemAlign, maxSize) { var contentGroup = this.getContentGroup(); var containerGroup = this._containerGroup; var controllerGroup = this._controllerGroup; var orientIdx = legendModel.getOrient().index; var wh = WH$1[orientIdx]; var hw = WH$1[1 - orientIdx]; var yx = XY$1[1 - orientIdx]; // Place items in contentGroup. box( legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height ); box( // Buttons in controller are layout always horizontally. 'horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true) ); var contentRect = contentGroup.getBoundingRect(); var controllerRect = controllerGroup.getBoundingRect(); var showController = this._showController = contentRect[wh] > maxSize[wh]; var contentPos = [-contentRect.x, -contentRect.y]; // Remain contentPos when scroll animation perfroming. contentPos[orientIdx] = contentGroup.position[orientIdx]; // Layout container group based on 0. var containerPos = [0, 0]; var controllerPos = [-controllerRect.x, -controllerRect.y]; var pageButtonGap = retrieve2( legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true) ); // Place containerGroup and controllerGroup and contentGroup. if (showController) { var pageButtonPosition = legendModel.get('pageButtonPosition', true); // controller is on the right / bottom. if (pageButtonPosition === 'end') { controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh]; } // controller is on the left / top. else { containerPos[orientIdx] += controllerRect[wh] + pageButtonGap; } } // Always align controller to content as 'middle'. controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2; contentGroup.attr('position', contentPos); containerGroup.attr('position', containerPos); controllerGroup.attr('position', controllerPos); // Calculate `mainRect` and set `clipPath`. // mainRect should not be calculated by `this.group.getBoundingRect()` // for sake of the overflow. var mainRect = this.group.getBoundingRect(); var mainRect = {x: 0, y: 0}; // Consider content may be overflow (should be clipped). mainRect[wh] = showController ? maxSize[wh] : contentRect[wh]; mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]); // `containerRect[yx] + containerPos[1 - orientIdx]` is 0. mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]); containerGroup.__rectSize = maxSize[wh]; if (showController) { var clipShape = {x: 0, y: 0}; clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0); clipShape[hw] = mainRect[hw]; containerGroup.setClipPath(new Rect({shape: clipShape})); // Consider content may be larger than container, container rect // can not be obtained from `containerGroup.getBoundingRect()`. containerGroup.__rectSize = clipShape[wh]; } else { // Do not remove or ignore controller. Keep them set as place holders. controllerGroup.eachChild(function (child) { child.attr({invisible: true, silent: true}); }); } // Content translate animation. var pageInfo = this._getPageInfo(legendModel); pageInfo.pageIndex != null && updateProps( contentGroup, {position: pageInfo.contentPosition}, // When switch from "show controller" to "not show controller", view should be // updated immediately without animation, otherwise causes weird efffect. showController ? legendModel : false ); this._updatePageInfoView(legendModel, pageInfo); return mainRect; }, _pageGo: function (to, legendModel, api) { var scrollDataIndex = this._getPageInfo(legendModel)[to]; scrollDataIndex != null && api.dispatchAction({ type: 'legendScroll', scrollDataIndex: scrollDataIndex, legendId: legendModel.id }); }, _updatePageInfoView: function (legendModel, pageInfo) { var controllerGroup = this._controllerGroup; each$1(['pagePrev', 'pageNext'], function (name) { var canJump = pageInfo[name + 'DataIndex'] != null; var icon = controllerGroup.childOfName(name); if (icon) { icon.setStyle( 'fill', canJump ? legendModel.get('pageIconColor', true) : legendModel.get('pageIconInactiveColor', true) ); icon.cursor = canJump ? 'pointer' : 'default'; } }); var pageText = controllerGroup.childOfName('pageText'); var pageFormatter = legendModel.get('pageFormatter'); var pageIndex = pageInfo.pageIndex; var current = pageIndex != null ? pageIndex + 1 : 0; var total = pageInfo.pageCount; pageText && pageFormatter && pageText.setStyle( 'text', isString(pageFormatter) ? pageFormatter.replace('{current}', current).replace('{total}', total) : pageFormatter({current: current, total: total}) ); }, /** * @param {module:echarts/model/Model} legendModel * @return {Object} { * contentPosition: Array., null when data item not found. * pageIndex: number, null when data item not found. * pageCount: number, always be a number, can be 0. * pagePrevDataIndex: number, null when no next page. * pageNextDataIndex: number, null when no previous page. * } */ _getPageInfo: function (legendModel) { // Align left or top by the current dataIndex. var currDataIndex = legendModel.get('scrollDataIndex', true); var contentGroup = this.getContentGroup(); var contentRect = contentGroup.getBoundingRect(); var containerRectSize = this._containerGroup.__rectSize; var orientIdx = legendModel.getOrient().index; var wh = WH$1[orientIdx]; var hw = WH$1[1 - orientIdx]; var xy = XY$1[orientIdx]; var contentPos = contentGroup.position.slice(); var pageIndex; var pagePrevDataIndex; var pageNextDataIndex; var targetItemGroup; if (this._showController) { contentGroup.eachChild(function (child) { if (child.__legendDataIndex === currDataIndex) { targetItemGroup = child; } }); } else { targetItemGroup = contentGroup.childAt(0); } var pageCount = containerRectSize ? Math.ceil(contentRect[wh] / containerRectSize) : 0; if (targetItemGroup) { var itemRect = targetItemGroup.getBoundingRect(); var itemLoc = targetItemGroup.position[orientIdx] + itemRect[xy]; contentPos[orientIdx] = -itemLoc - contentRect[xy]; pageIndex = Math.floor( pageCount * (itemLoc + itemRect[xy] + containerRectSize / 2) / contentRect[wh] ); pageIndex = (contentRect[wh] && pageCount) ? Math.max(0, Math.min(pageCount - 1, pageIndex)) : -1; var winRect = {x: 0, y: 0}; winRect[wh] = containerRectSize; winRect[hw] = contentRect[hw]; winRect[xy] = -contentPos[orientIdx] - contentRect[xy]; var startIdx; var children = contentGroup.children(); contentGroup.eachChild(function (child, index) { var itemRect = getItemRect(child); if (itemRect.intersect(winRect)) { startIdx == null && (startIdx = index); // It is user-friendly that the last item shown in the // current window is shown at the begining of next window. pageNextDataIndex = child.__legendDataIndex; } // If the last item is shown entirely, no next page. if (index === children.length - 1 && itemRect[xy] + itemRect[wh] <= winRect[xy] + winRect[wh] ) { pageNextDataIndex = null; } }); // Always align based on the left/top most item, so the left/top most // item in the previous window is needed to be found here. if (startIdx != null) { var startItem = children[startIdx]; var startRect = getItemRect(startItem); winRect[xy] = startRect[xy] + startRect[wh] - winRect[wh]; // If the first item is shown entirely, no previous page. if (startIdx <= 0 && startRect[xy] >= winRect[xy]) { pagePrevDataIndex = null; } else { while (startIdx > 0 && getItemRect(children[startIdx - 1]).intersect(winRect)) { startIdx--; } pagePrevDataIndex = children[startIdx].__legendDataIndex; } } } return { contentPosition: contentPos, pageIndex: pageIndex, pageCount: pageCount, pagePrevDataIndex: pagePrevDataIndex, pageNextDataIndex: pageNextDataIndex }; function getItemRect(el) { var itemRect = el.getBoundingRect().clone(); itemRect[xy] += el.position[orientIdx]; return itemRect; } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @event legendScroll * @type {Object} * @property {string} type 'legendScroll' * @property {string} scrollDataIndex */ registerAction( 'legendScroll', 'legendscroll', function (payload, ecModel) { var scrollDataIndex = payload.scrollDataIndex; scrollDataIndex != null && ecModel.eachComponent( {mainType: 'legend', subType: 'scroll', query: payload}, function (legendModel) { legendModel.setScrollDataIndex(scrollDataIndex); } ); } ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Legend component entry file8 */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ extendComponentModel({ type: 'tooltip', dependencies: ['axisPointer'], defaultOption: { zlevel: 0, z: 8, show: true, // tooltip主体内容 showContent: true, // 'trigger' only works on coordinate system. // 'item' | 'axis' | 'none' trigger: 'item', // 'click' | 'mousemove' | 'none' triggerOn: 'mousemove|click', alwaysShowContent: false, displayMode: 'single', // 'single' | 'multipleByCoordSys' // 位置 {Array} | {Function} // position: null // Consider triggered from axisPointer handle, verticalAlign should be 'middle' // align: null, // verticalAlign: null, // 是否约束 content 在 viewRect 中。默认 false 是为了兼容以前版本。 confine: false, // 内容格式器:{string}(Template) ¦ {Function} // formatter: null showDelay: 0, // 隐藏延迟,单位ms hideDelay: 100, // 动画变换时间,单位s transitionDuration: 0.4, enterable: false, // 提示背景颜色,默认为透明度为0.7的黑色 backgroundColor: 'rgba(50,50,50,0.7)', // 提示边框颜色 borderColor: '#333', // 提示边框圆角,单位px,默认为4 borderRadius: 4, // 提示边框线宽,单位px,默认为0(无边框) borderWidth: 0, // 提示内边距,单位px,默认各方向内边距为5, // 接受数组分别设定上右下左边距,同css padding: 5, // Extra css text extraCssText: '', // 坐标轴指示器,坐标轴触发有效 axisPointer: { // 默认为直线 // 可选为:'line' | 'shadow' | 'cross' type: 'line', // type 为 line 的时候有效,指定 tooltip line 所在的轴,可选 // 可选 'x' | 'y' | 'angle' | 'radius' | 'auto' // 默认 'auto',会选择类型为 category 的轴,对于双数值轴,笛卡尔坐标系会默认选择 x 轴 // 极坐标系会默认选择 angle 轴 axis: 'auto', animation: 'auto', animationDurationUpdate: 200, animationEasingUpdate: 'exponentialOut', crossStyle: { color: '#999', width: 1, type: 'dashed', // TODO formatter textStyle: {} } // lineStyle and shadowStyle should not be specified here, // otherwise it will always override those styles on option.axisPointer. }, textStyle: { color: '#fff', fontSize: 14 } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$18 = each$1; var toCamelCase$1 = toCamelCase; var vendors = ['', '-webkit-', '-moz-', '-o-']; var gCssText = 'position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;'; /** * @param {number} duration * @return {string} * @inner */ function assembleTransition(duration) { var transitionCurve = 'cubic-bezier(0.23, 1, 0.32, 1)'; var transitionText = 'left ' + duration + 's ' + transitionCurve + ',' + 'top ' + duration + 's ' + transitionCurve; return map(vendors, function (vendorPrefix) { return vendorPrefix + 'transition:' + transitionText; }).join(';'); } /** * @param {Object} textStyle * @return {string} * @inner */ function assembleFont(textStyleModel) { var cssText = []; var fontSize = textStyleModel.get('fontSize'); var color = textStyleModel.getTextColor(); color && cssText.push('color:' + color); cssText.push('font:' + textStyleModel.getFont()); fontSize && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px'); each$18(['decoration', 'align'], function (name) { var val = textStyleModel.get(name); val && cssText.push('text-' + name + ':' + val); }); return cssText.join(';'); } /** * @param {Object} tooltipModel * @return {string} * @inner */ function assembleCssText(tooltipModel) { var cssText = []; var transitionDuration = tooltipModel.get('transitionDuration'); var backgroundColor = tooltipModel.get('backgroundColor'); var textStyleModel = tooltipModel.getModel('textStyle'); var padding = tooltipModel.get('padding'); // Animation transition. Do not animate when transitionDuration is 0. transitionDuration && cssText.push(assembleTransition(transitionDuration)); if (backgroundColor) { if (env$1.canvasSupported) { cssText.push('background-Color:' + backgroundColor); } else { // for ie cssText.push( 'background-Color:#' + toHex(backgroundColor) ); cssText.push('filter:alpha(opacity=70)'); } } // Border style each$18(['width', 'color', 'radius'], function (name) { var borderName = 'border-' + name; var camelCase = toCamelCase$1(borderName); var val = tooltipModel.get(camelCase); val != null && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px')); }); // Text style cssText.push(assembleFont(textStyleModel)); // Padding if (padding != null) { cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px'); } return cssText.join(';') + ';'; } /** * @alias module:echarts/component/tooltip/TooltipContent * @constructor */ function TooltipContent(container, api) { if (env$1.wxa) { return null; } var el = document.createElement('div'); var zr = this._zr = api.getZr(); this.el = el; this._x = api.getWidth() / 2; this._y = api.getHeight() / 2; container.appendChild(el); this._container = container; this._show = false; /** * @private */ this._hideTimeout; var self = this; el.onmouseenter = function () { // clear the timeout in hideLater and keep showing tooltip if (self._enterable) { clearTimeout(self._hideTimeout); self._show = true; } self._inContent = true; }; el.onmousemove = function (e) { e = e || window.event; if (!self._enterable) { // Try trigger zrender event to avoid mouse // in and out shape too frequently var handler = zr.handler; normalizeEvent(container, e, true); handler.dispatch('mousemove', e); } }; el.onmouseleave = function () { if (self._enterable) { if (self._show) { self.hideLater(self._hideDelay); } } self._inContent = false; }; } TooltipContent.prototype = { constructor: TooltipContent, /** * @private * @type {boolean} */ _enterable: true, /** * Update when tooltip is rendered */ update: function () { // FIXME // Move this logic to ec main? var container = this._container; var stl = container.currentStyle || document.defaultView.getComputedStyle(container); var domStyle = container.style; if (domStyle.position !== 'absolute' && stl.position !== 'absolute') { domStyle.position = 'relative'; } // Hide the tooltip // PENDING // this.hide(); }, show: function (tooltipModel) { clearTimeout(this._hideTimeout); var el = this.el; el.style.cssText = gCssText + assembleCssText(tooltipModel) // http://stackoverflow.com/questions/21125587/css3-transition-not-working-in-chrome-anymore + ';left:' + this._x + 'px;top:' + this._y + 'px;' + (tooltipModel.get('extraCssText') || ''); el.style.display = el.innerHTML ? 'block' : 'none'; this._show = true; }, setContent: function (content) { this.el.innerHTML = content == null ? '' : content; }, setEnterable: function (enterable) { this._enterable = enterable; }, getSize: function () { var el = this.el; return [el.clientWidth, el.clientHeight]; }, moveTo: function (x, y) { // xy should be based on canvas root. But tooltipContent is // the sibling of canvas root. So padding of ec container // should be considered here. var zr = this._zr; var viewportRootOffset; if (zr && zr.painter && (viewportRootOffset = zr.painter.getViewportRootOffset())) { x += viewportRootOffset.offsetLeft; y += viewportRootOffset.offsetTop; } var style = this.el.style; style.left = x + 'px'; style.top = y + 'px'; this._x = x; this._y = y; }, hide: function () { this.el.style.display = 'none'; this._show = false; }, hideLater: function (time) { if (this._show && !(this._inContent && this._enterable)) { if (time) { this._hideDelay = time; // Set show false to avoid invoke hideLater mutiple times this._show = false; this._hideTimeout = setTimeout(bind(this.hide, this), time); } else { this.hide(); } } }, isShow: function () { return this._show; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var bind$3 = bind; var each$17 = each$1; var parsePercent$2 = parsePercent$1; var proxyRect = new Rect({ shape: {x: -1, y: -1, width: 2, height: 2} }); extendComponentView({ type: 'tooltip', init: function (ecModel, api) { if (env$1.node) { return; } var tooltipContent = new TooltipContent(api.getDom(), api); this._tooltipContent = tooltipContent; }, render: function (tooltipModel, ecModel, api) { if (env$1.node || env$1.wxa) { return; } // Reset this.group.removeAll(); /** * @private * @type {module:echarts/component/tooltip/TooltipModel} */ this._tooltipModel = tooltipModel; /** * @private * @type {module:echarts/model/Global} */ this._ecModel = ecModel; /** * @private * @type {module:echarts/ExtensionAPI} */ this._api = api; /** * Should be cleaned when render. * @private * @type {Array.>} */ this._lastDataByCoordSys = null; /** * @private * @type {boolean} */ this._alwaysShowContent = tooltipModel.get('alwaysShowContent'); var tooltipContent = this._tooltipContent; tooltipContent.update(); tooltipContent.setEnterable(tooltipModel.get('enterable')); this._initGlobalListener(); this._keepShow(); }, _initGlobalListener: function () { var tooltipModel = this._tooltipModel; var triggerOn = tooltipModel.get('triggerOn'); register( 'itemTooltip', this._api, bind$3(function (currTrigger, e, dispatchAction) { // If 'none', it is not controlled by mouse totally. if (triggerOn !== 'none') { if (triggerOn.indexOf(currTrigger) >= 0) { this._tryShow(e, dispatchAction); } else if (currTrigger === 'leave') { this._hide(dispatchAction); } } }, this) ); }, _keepShow: function () { var tooltipModel = this._tooltipModel; var ecModel = this._ecModel; var api = this._api; // Try to keep the tooltip show when refreshing if (this._lastX != null && this._lastY != null // When user is willing to control tooltip totally using API, // self.manuallyShowTip({x, y}) might cause tooltip hide, // which is not expected. && tooltipModel.get('triggerOn') !== 'none' ) { var self = this; clearTimeout(this._refreshUpdateTimeout); this._refreshUpdateTimeout = setTimeout(function () { // Show tip next tick after other charts are rendered // In case highlight action has wrong result // FIXME self.manuallyShowTip(tooltipModel, ecModel, api, { x: self._lastX, y: self._lastY }); }); } }, /** * Show tip manually by * dispatchAction({ * type: 'showTip', * x: 10, * y: 10 * }); * Or * dispatchAction({ * type: 'showTip', * seriesIndex: 0, * dataIndex or dataIndexInside or name * }); * * TODO Batch */ manuallyShowTip: function (tooltipModel, ecModel, api, payload) { if (payload.from === this.uid || env$1.node) { return; } var dispatchAction = makeDispatchAction$1(payload, api); // Reset ticket this._ticket = ''; // When triggered from axisPointer. var dataByCoordSys = payload.dataByCoordSys; if (payload.tooltip && payload.x != null && payload.y != null) { var el = proxyRect; el.position = [payload.x, payload.y]; el.update(); el.tooltip = payload.tooltip; // Manually show tooltip while view is not using zrender elements. this._tryShow({ offsetX: payload.x, offsetY: payload.y, target: el }, dispatchAction); } else if (dataByCoordSys) { this._tryShow({ offsetX: payload.x, offsetY: payload.y, position: payload.position, event: {}, dataByCoordSys: payload.dataByCoordSys, tooltipOption: payload.tooltipOption }, dispatchAction); } else if (payload.seriesIndex != null) { if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) { return; } var pointInfo = findPointFromSeries(payload, ecModel); var cx = pointInfo.point[0]; var cy = pointInfo.point[1]; if (cx != null && cy != null) { this._tryShow({ offsetX: cx, offsetY: cy, position: payload.position, target: pointInfo.el, event: {} }, dispatchAction); } } else if (payload.x != null && payload.y != null) { // FIXME // should wrap dispatchAction like `axisPointer/globalListener` ? api.dispatchAction({ type: 'updateAxisPointer', x: payload.x, y: payload.y }); this._tryShow({ offsetX: payload.x, offsetY: payload.y, position: payload.position, target: api.getZr().findHover(payload.x, payload.y).target, event: {} }, dispatchAction); } }, manuallyHideTip: function (tooltipModel, ecModel, api, payload) { var tooltipContent = this._tooltipContent; if (!this._alwaysShowContent && this._tooltipModel) { tooltipContent.hideLater(this._tooltipModel.get('hideDelay')); } this._lastX = this._lastY = null; if (payload.from !== this.uid) { this._hide(makeDispatchAction$1(payload, api)); } }, // Be compatible with previous design, that is, when tooltip.type is 'axis' and // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer // and tooltip. _manuallyAxisShowTip: function (tooltipModel, ecModel, api, payload) { var seriesIndex = payload.seriesIndex; var dataIndex = payload.dataIndex; var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) { return; } var seriesModel = ecModel.getSeriesByIndex(seriesIndex); if (!seriesModel) { return; } var data = seriesModel.getData(); var tooltipModel = buildTooltipModel([ data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model, tooltipModel ]); if (tooltipModel.get('trigger') !== 'axis') { return; } api.dispatchAction({ type: 'updateAxisPointer', seriesIndex: seriesIndex, dataIndex: dataIndex, position: payload.position }); return true; }, _tryShow: function (e, dispatchAction) { var el = e.target; var tooltipModel = this._tooltipModel; if (!tooltipModel) { return; } // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed this._lastX = e.offsetX; this._lastY = e.offsetY; var dataByCoordSys = e.dataByCoordSys; if (dataByCoordSys && dataByCoordSys.length) { this._showAxisTooltip(dataByCoordSys, e); } // Always show item tooltip if mouse is on the element with dataIndex else if (el && el.dataIndex != null) { this._lastDataByCoordSys = null; this._showSeriesItemTooltip(e, el, dispatchAction); } // Tooltip provided directly. Like legend. else if (el && el.tooltip) { this._lastDataByCoordSys = null; this._showComponentItemTooltip(e, el, dispatchAction); } else { this._lastDataByCoordSys = null; this._hide(dispatchAction); } }, _showOrMove: function (tooltipModel, cb) { // showDelay is used in this case: tooltip.enterable is set // as true. User intent to move mouse into tooltip and click // something. `showDelay` makes it easyer to enter the content // but tooltip do not move immediately. var delay = tooltipModel.get('showDelay'); cb = bind(cb, this); clearTimeout(this._showTimout); delay > 0 ? (this._showTimout = setTimeout(cb, delay)) : cb(); }, _showAxisTooltip: function (dataByCoordSys, e) { var ecModel = this._ecModel; var globalTooltipModel = this._tooltipModel; var point = [e.offsetX, e.offsetY]; var singleDefaultHTML = []; var singleParamsList = []; var singleTooltipModel = buildTooltipModel([ e.tooltipOption, globalTooltipModel ]); each$17(dataByCoordSys, function (itemCoordSys) { // var coordParamList = []; // var coordDefaultHTML = []; // var coordTooltipModel = buildTooltipModel([ // e.tooltipOption, // itemCoordSys.tooltipOption, // ecModel.getComponent(itemCoordSys.coordSysMainType, itemCoordSys.coordSysIndex), // globalTooltipModel // ]); // var displayMode = coordTooltipModel.get('displayMode'); // var paramsList = displayMode === 'single' ? singleParamsList : []; each$17(itemCoordSys.dataByAxis, function (item) { var axisModel = ecModel.getComponent(item.axisDim + 'Axis', item.axisIndex); var axisValue = item.value; var seriesDefaultHTML = []; if (!axisModel || axisValue == null) { return; } var valueLabel = getValueLabel( axisValue, axisModel.axis, ecModel, item.seriesDataIndices, item.valueLabelOpt ); each$1(item.seriesDataIndices, function (idxItem) { var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); var dataIndex = idxItem.dataIndexInside; var dataParams = series && series.getDataParams(dataIndex); dataParams.axisDim = item.axisDim; dataParams.axisIndex = item.axisIndex; dataParams.axisType = item.axisType; dataParams.axisId = item.axisId; dataParams.axisValue = getAxisRawValue(axisModel.axis, axisValue); dataParams.axisValueLabel = valueLabel; if (dataParams) { singleParamsList.push(dataParams); seriesDefaultHTML.push(series.formatTooltip(dataIndex, true)); } }); // Default tooltip content // FIXME // (1) shold be the first data which has name? // (2) themeRiver, firstDataIndex is array, and first line is unnecessary. var firstLine = valueLabel; singleDefaultHTML.push( (firstLine ? encodeHTML(firstLine) + '
          ' : '') + seriesDefaultHTML.join('
          ') ); }); }, this); // In most case, the second axis is shown upper than the first one. singleDefaultHTML.reverse(); singleDefaultHTML = singleDefaultHTML.join('

          '); var positionExpr = e.position; this._showOrMove(singleTooltipModel, function () { if (this._updateContentNotChangedOnAxis(dataByCoordSys)) { this._updatePosition( singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, singleParamsList ); } else { this._showTooltipContent( singleTooltipModel, singleDefaultHTML, singleParamsList, Math.random(), point[0], point[1], positionExpr ); } }); // Do not trigger events here, because this branch only be entered // from dispatchAction. }, _showSeriesItemTooltip: function (e, el, dispatchAction) { var ecModel = this._ecModel; // Use dataModel in element if possible // Used when mouseover on a element like markPoint or edge // In which case, the data is not main data in series. var seriesIndex = el.seriesIndex; var seriesModel = ecModel.getSeriesByIndex(seriesIndex); // For example, graph link. var dataModel = el.dataModel || seriesModel; var dataIndex = el.dataIndex; var dataType = el.dataType; var data = dataModel.getData(); var tooltipModel = buildTooltipModel([ data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model, this._tooltipModel ]); var tooltipTrigger = tooltipModel.get('trigger'); if (tooltipTrigger != null && tooltipTrigger !== 'item') { return; } var params = dataModel.getDataParams(dataIndex, dataType); var defaultHtml = dataModel.formatTooltip(dataIndex, false, dataType); var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex; this._showOrMove(tooltipModel, function () { this._showTooltipContent( tooltipModel, defaultHtml, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target ); }); // FIXME // duplicated showtip if manuallyShowTip is called from dispatchAction. dispatchAction({ type: 'showTip', dataIndexInside: dataIndex, dataIndex: data.getRawIndex(dataIndex), seriesIndex: seriesIndex, from: this.uid }); }, _showComponentItemTooltip: function (e, el, dispatchAction) { var tooltipOpt = el.tooltip; if (typeof tooltipOpt === 'string') { var content = tooltipOpt; tooltipOpt = { content: content, // Fixed formatter formatter: content }; } var subTooltipModel = new Model(tooltipOpt, this._tooltipModel, this._ecModel); var defaultHtml = subTooltipModel.get('content'); var asyncTicket = Math.random(); // Do not check whether `trigger` is 'none' here, because `trigger` // only works on cooridinate system. In fact, we have not found case // that requires setting `trigger` nothing on component yet. this._showOrMove(subTooltipModel, function () { this._showTooltipContent( subTooltipModel, defaultHtml, subTooltipModel.get('formatterParams') || {}, asyncTicket, e.offsetX, e.offsetY, e.position, el ); }); // If not dispatch showTip, tip may be hide triggered by axis. dispatchAction({ type: 'showTip', from: this.uid }); }, _showTooltipContent: function ( tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el ) { // Reset ticket this._ticket = ''; if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) { return; } var tooltipContent = this._tooltipContent; var formatter = tooltipModel.get('formatter'); positionExpr = positionExpr || tooltipModel.get('position'); var html = defaultHtml; if (formatter && typeof formatter === 'string') { html = formatTpl(formatter, params, true); } else if (typeof formatter === 'function') { var callback = bind$3(function (cbTicket, html) { if (cbTicket === this._ticket) { tooltipContent.setContent(html); this._updatePosition( tooltipModel, positionExpr, x, y, tooltipContent, params, el ); } }, this); this._ticket = asyncTicket; html = formatter(params, asyncTicket, callback); } tooltipContent.setContent(html); tooltipContent.show(tooltipModel); this._updatePosition( tooltipModel, positionExpr, x, y, tooltipContent, params, el ); }, /** * @param {string|Function|Array.|Object} positionExpr * @param {number} x Mouse x * @param {number} y Mouse y * @param {boolean} confine Whether confine tooltip content in view rect. * @param {Object|} params * @param {module:zrender/Element} el target element * @param {module:echarts/ExtensionAPI} api * @return {Array.} */ _updatePosition: function (tooltipModel, positionExpr, x, y, content, params, el) { var viewWidth = this._api.getWidth(); var viewHeight = this._api.getHeight(); positionExpr = positionExpr || tooltipModel.get('position'); var contentSize = content.getSize(); var align = tooltipModel.get('align'); var vAlign = tooltipModel.get('verticalAlign'); var rect = el && el.getBoundingRect().clone(); el && rect.applyTransform(el.transform); if (typeof positionExpr === 'function') { // Callback of position can be an array or a string specify the position positionExpr = positionExpr([x, y], params, content.el, rect, { viewSize: [viewWidth, viewHeight], contentSize: contentSize.slice() }); } if (isArray(positionExpr)) { x = parsePercent$2(positionExpr[0], viewWidth); y = parsePercent$2(positionExpr[1], viewHeight); } else if (isObject$1(positionExpr)) { positionExpr.width = contentSize[0]; positionExpr.height = contentSize[1]; var layoutRect = getLayoutRect( positionExpr, {width: viewWidth, height: viewHeight} ); x = layoutRect.x; y = layoutRect.y; align = null; // When positionExpr is left/top/right/bottom, // align and verticalAlign will not work. vAlign = null; } // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element else if (typeof positionExpr === 'string' && el) { var pos = calcTooltipPosition( positionExpr, rect, contentSize ); x = pos[0]; y = pos[1]; } else { var pos = refixTooltipPosition( x, y, content.el, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20 ); x = pos[0]; y = pos[1]; } align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0); vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0); if (tooltipModel.get('confine')) { var pos = confineTooltipPosition( x, y, content.el, viewWidth, viewHeight ); x = pos[0]; y = pos[1]; } content.moveTo(x, y); }, // FIXME // Should we remove this but leave this to user? _updateContentNotChangedOnAxis: function (dataByCoordSys) { var lastCoordSys = this._lastDataByCoordSys; var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length; contentNotChanged && each$17(lastCoordSys, function (lastItemCoordSys, indexCoordSys) { var lastDataByAxis = lastItemCoordSys.dataByAxis || {}; var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {}; var thisDataByAxis = thisItemCoordSys.dataByAxis || []; contentNotChanged &= lastDataByAxis.length === thisDataByAxis.length; contentNotChanged && each$17(lastDataByAxis, function (lastItem, indexAxis) { var thisItem = thisDataByAxis[indexAxis] || {}; var lastIndices = lastItem.seriesDataIndices || []; var newIndices = thisItem.seriesDataIndices || []; contentNotChanged &= lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length; contentNotChanged && each$17(lastIndices, function (lastIdxItem, j) { var newIdxItem = newIndices[j]; contentNotChanged &= lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex; }); }); }); this._lastDataByCoordSys = dataByCoordSys; return !!contentNotChanged; }, _hide: function (dispatchAction) { // Do not directly hideLater here, because this behavior may be prevented // in dispatchAction when showTip is dispatched. // FIXME // duplicated hideTip if manuallyHideTip is called from dispatchAction. this._lastDataByCoordSys = null; dispatchAction({ type: 'hideTip', from: this.uid }); }, dispose: function (ecModel, api) { if (env$1.node || env$1.wxa) { return; } this._tooltipContent.hide(); unregister('itemTooltip', api); } }); /** * @param {Array.} modelCascade * From top to bottom. (the last one should be globalTooltipModel); */ function buildTooltipModel(modelCascade) { var resultModel = modelCascade.pop(); while (modelCascade.length) { var tooltipOpt = modelCascade.pop(); if (tooltipOpt) { if (Model.isInstance(tooltipOpt)) { tooltipOpt = tooltipOpt.get('tooltip', true); } // In each data item tooltip can be simply write: // { // value: 10, // tooltip: 'Something you need to know' // } if (typeof tooltipOpt === 'string') { tooltipOpt = {formatter: tooltipOpt}; } resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel); } } return resultModel; } function makeDispatchAction$1(payload, api) { return payload.dispatchAction || bind(api.dispatchAction, api); } function refixTooltipPosition(x, y, el, viewWidth, viewHeight, gapH, gapV) { var size = getOuterSize(el); var width = size.width; var height = size.height; if (gapH != null) { if (x + width + gapH > viewWidth) { x -= width + gapH; } else { x += gapH; } } if (gapV != null) { if (y + height + gapV > viewHeight) { y -= height + gapV; } else { y += gapV; } } return [x, y]; } function confineTooltipPosition(x, y, el, viewWidth, viewHeight) { var size = getOuterSize(el); var width = size.width; var height = size.height; x = Math.min(x + width, viewWidth) - width; y = Math.min(y + height, viewHeight) - height; x = Math.max(x, 0); y = Math.max(y, 0); return [x, y]; } function getOuterSize(el) { var width = el.clientWidth; var height = el.clientHeight; // Consider browser compatibility. // IE8 does not support getComputedStyle. if (document.defaultView && document.defaultView.getComputedStyle) { var stl = document.defaultView.getComputedStyle(el); if (stl) { width += parseInt(stl.paddingLeft, 10) + parseInt(stl.paddingRight, 10) + parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10); height += parseInt(stl.paddingTop, 10) + parseInt(stl.paddingBottom, 10) + parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10); } } return {width: width, height: height}; } function calcTooltipPosition(position, rect, contentSize) { var domWidth = contentSize[0]; var domHeight = contentSize[1]; var gap = 5; var x = 0; var y = 0; var rectWidth = rect.width; var rectHeight = rect.height; switch (position) { case 'inside': x = rect.x + rectWidth / 2 - domWidth / 2; y = rect.y + rectHeight / 2 - domHeight / 2; break; case 'top': x = rect.x + rectWidth / 2 - domWidth / 2; y = rect.y - domHeight - gap; break; case 'bottom': x = rect.x + rectWidth / 2 - domWidth / 2; y = rect.y + rectHeight + gap; break; case 'left': x = rect.x - domWidth - gap; y = rect.y + rectHeight / 2 - domHeight / 2; break; case 'right': x = rect.x + rectWidth + gap; y = rect.y + rectHeight / 2 - domHeight / 2; } return [x, y]; } function isCenterAlign(align) { return align === 'center' || align === 'middle'; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // FIXME Better way to pack data in graphic element /** * @action * @property {string} type * @property {number} seriesIndex * @property {number} dataIndex * @property {number} [x] * @property {number} [y] */ registerAction( { type: 'showTip', event: 'showTip', update: 'tooltip:manuallyShowTip' }, // noop function () {} ); registerAction( { type: 'hideTip', event: 'hideTip', update: 'tooltip:manuallyHideTip' }, // noop function () {} ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function getSeriesStackId$1(seriesModel) { return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex; } function getAxisKey$1(axis) { return axis.dim; } /** * @param {string} seriesType * @param {module:echarts/model/Global} ecModel * @param {module:echarts/ExtensionAPI} api */ function barLayoutPolar(seriesType, ecModel, api) { var width = api.getWidth(); var height = api.getHeight(); var lastStackCoords = {}; var barWidthAndOffset = calRadialBar( filter( ecModel.getSeriesByType(seriesType), function (seriesModel) { return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'polar'; } ) ); ecModel.eachSeriesByType(seriesType, function (seriesModel) { // Check series coordinate, do layout for polar only if (seriesModel.coordinateSystem.type !== 'polar') { return; } var data = seriesModel.getData(); var polar = seriesModel.coordinateSystem; var baseAxis = polar.getBaseAxis(); var stackId = getSeriesStackId$1(seriesModel); var columnLayoutInfo = barWidthAndOffset[getAxisKey$1(baseAxis)][stackId]; var columnOffset = columnLayoutInfo.offset; var columnWidth = columnLayoutInfo.width; var valueAxis = polar.getOtherAxis(baseAxis); var center = seriesModel.get('center') || ['50%', '50%']; var cx = parsePercent$1(center[0], width); var cy = parsePercent$1(center[1], height); var barMinHeight = seriesModel.get('barMinHeight') || 0; var barMinAngle = seriesModel.get('barMinAngle') || 0; lastStackCoords[stackId] = lastStackCoords[stackId] || []; var valueDim = data.mapDimension(valueAxis.dim); var baseDim = data.mapDimension(baseAxis.dim); var stacked = isDimensionStacked(data, valueDim /*, baseDim*/); var valueAxisStart = valueAxis.getExtent()[0]; for (var idx = 0, len = data.count(); idx < len; idx++) { var value = data.get(valueDim, idx); var baseValue = data.get(baseDim, idx); if (isNaN(value)) { continue; } var sign = value >= 0 ? 'p' : 'n'; var baseCoord = valueAxisStart; // Because of the barMinHeight, we can not use the value in // stackResultDimension directly. // Only ordinal axis can be stacked. if (stacked) { if (!lastStackCoords[stackId][baseValue]) { lastStackCoords[stackId][baseValue] = { p: valueAxisStart, // Positive stack n: valueAxisStart // Negative stack }; } // Should also consider #4243 baseCoord = lastStackCoords[stackId][baseValue][sign]; } var r0; var r; var startAngle; var endAngle; // radial sector if (valueAxis.dim === 'radius') { var radiusSpan = valueAxis.dataToRadius(value) - valueAxisStart; var angle = baseAxis.dataToAngle(baseValue); if (Math.abs(radiusSpan) < barMinHeight) { radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight; } r0 = baseCoord; r = baseCoord + radiusSpan; startAngle = angle - columnOffset; endAngle = startAngle - columnWidth; stacked && (lastStackCoords[stackId][baseValue][sign] = r); } // tangential sector else { // angleAxis must be clamped. var angleSpan = valueAxis.dataToAngle(value, true) - valueAxisStart; var radius = baseAxis.dataToRadius(baseValue); if (Math.abs(angleSpan) < barMinAngle) { angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle; } r0 = radius + columnOffset; r = r0 + columnWidth; startAngle = baseCoord; endAngle = baseCoord + angleSpan; // if the previous stack is at the end of the ring, // add a round to differentiate it from origin // var extent = angleAxis.getExtent(); // var stackCoord = angle; // if (stackCoord === extent[0] && value > 0) { // stackCoord = extent[1]; // } // else if (stackCoord === extent[1] && value < 0) { // stackCoord = extent[0]; // } stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle); } data.setItemLayout(idx, { cx: cx, cy: cy, r0: r0, r: r, // Consider that positive angle is anti-clockwise, // while positive radian of sector is clockwise startAngle: -startAngle * Math.PI / 180, endAngle: -endAngle * Math.PI / 180 }); } }, this); } /** * Calculate bar width and offset for radial bar charts */ function calRadialBar(barSeries, api) { // Columns info on each category axis. Key is polar name var columnsMap = {}; each$1(barSeries, function (seriesModel, idx) { var data = seriesModel.getData(); var polar = seriesModel.coordinateSystem; var baseAxis = polar.getBaseAxis(); var axisExtent = baseAxis.getExtent(); var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count()); var columnsOnAxis = columnsMap[getAxisKey$1(baseAxis)] || { bandWidth: bandWidth, remainedWidth: bandWidth, autoWidthCount: 0, categoryGap: '20%', gap: '30%', stacks: {} }; var stacks = columnsOnAxis.stacks; columnsMap[getAxisKey$1(baseAxis)] = columnsOnAxis; var stackId = getSeriesStackId$1(seriesModel); if (!stacks[stackId]) { columnsOnAxis.autoWidthCount++; } stacks[stackId] = stacks[stackId] || { width: 0, maxWidth: 0 }; var barWidth = parsePercent$1( seriesModel.get('barWidth'), bandWidth ); var barMaxWidth = parsePercent$1( seriesModel.get('barMaxWidth'), bandWidth ); var barGap = seriesModel.get('barGap'); var barCategoryGap = seriesModel.get('barCategoryGap'); if (barWidth && !stacks[stackId].width) { barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); stacks[stackId].width = barWidth; columnsOnAxis.remainedWidth -= barWidth; } barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); (barGap != null) && (columnsOnAxis.gap = barGap); (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap); }); var result = {}; each$1(columnsMap, function (columnsOnAxis, coordSysName) { result[coordSysName] = {}; var stacks = columnsOnAxis.stacks; var bandWidth = columnsOnAxis.bandWidth; var categoryGap = parsePercent$1(columnsOnAxis.categoryGap, bandWidth); var barGapPercent = parsePercent$1(columnsOnAxis.gap, 1); var remainedWidth = columnsOnAxis.remainedWidth; var autoWidthCount = columnsOnAxis.autoWidthCount; var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth each$1(stacks, function (column, stack) { var maxWidth = column.maxWidth; if (maxWidth && maxWidth < autoWidth) { maxWidth = Math.min(maxWidth, remainedWidth); if (column.width) { maxWidth = Math.min(maxWidth, column.width); } remainedWidth -= maxWidth; column.width = maxWidth; autoWidthCount--; } }); // Recalculate width again autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); autoWidth = Math.max(autoWidth, 0); var widthSum = 0; var lastColumn; each$1(stacks, function (column, idx) { if (!column.width) { column.width = autoWidth; } lastColumn = column; widthSum += column.width * (1 + barGapPercent); }); if (lastColumn) { widthSum -= lastColumn.width * barGapPercent; } var offset = -widthSum / 2; each$1(stacks, function (column, stackId) { result[coordSysName][stackId] = result[coordSysName][stackId] || { offset: offset, width: column.width }; offset += column.width * (1 + barGapPercent); }); }); return result; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function RadiusAxis(scale, radiusExtent) { Axis.call(this, 'radius', scale, radiusExtent); /** * Axis type * - 'category' * - 'value' * - 'time' * - 'log' * @type {string} */ this.type = 'category'; } RadiusAxis.prototype = { constructor: RadiusAxis, /** * @override */ pointToData: function (point, clamp) { return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; }, dataToRadius: Axis.prototype.dataToCoord, radiusToData: Axis.prototype.coordToData }; inherits(RadiusAxis, Axis); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function AngleAxis(scale, angleExtent) { angleExtent = angleExtent || [0, 360]; Axis.call(this, 'angle', scale, angleExtent); /** * Axis type * - 'category' * - 'value' * - 'time' * - 'log' * @type {string} */ this.type = 'category'; } AngleAxis.prototype = { constructor: AngleAxis, /** * @override */ pointToData: function (point, clamp) { return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; }, dataToAngle: Axis.prototype.dataToCoord, angleToData: Axis.prototype.coordToData }; inherits(AngleAxis, Axis); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @module echarts/coord/polar/Polar */ /** * @alias {module:echarts/coord/polar/Polar} * @constructor * @param {string} name */ var Polar = function (name) { /** * @type {string} */ this.name = name || ''; /** * x of polar center * @type {number} */ this.cx = 0; /** * y of polar center * @type {number} */ this.cy = 0; /** * @type {module:echarts/coord/polar/RadiusAxis} * @private */ this._radiusAxis = new RadiusAxis(); /** * @type {module:echarts/coord/polar/AngleAxis} * @private */ this._angleAxis = new AngleAxis(); this._radiusAxis.polar = this._angleAxis.polar = this; }; Polar.prototype = { type: 'polar', axisPointerEnabled: true, constructor: Polar, /** * @param {Array.} * @readOnly */ dimensions: ['radius', 'angle'], /** * @type {module:echarts/coord/PolarModel} */ model: null, /** * If contain coord * @param {Array.} point * @return {boolean} */ containPoint: function (point) { var coord = this.pointToCoord(point); return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]); }, /** * If contain data * @param {Array.} data * @return {boolean} */ containData: function (data) { return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]); }, /** * @param {string} dim * @return {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} */ getAxis: function (dim) { return this['_' + dim + 'Axis']; }, /** * @return {Array.} */ getAxes: function () { return [this._radiusAxis, this._angleAxis]; }, /** * Get axes by type of scale * @param {string} scaleType * @return {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} */ getAxesByScale: function (scaleType) { var axes = []; var angleAxis = this._angleAxis; var radiusAxis = this._radiusAxis; angleAxis.scale.type === scaleType && axes.push(angleAxis); radiusAxis.scale.type === scaleType && axes.push(radiusAxis); return axes; }, /** * @return {module:echarts/coord/polar/AngleAxis} */ getAngleAxis: function () { return this._angleAxis; }, /** * @return {module:echarts/coord/polar/RadiusAxis} */ getRadiusAxis: function () { return this._radiusAxis; }, /** * @param {module:echarts/coord/polar/Axis} * @return {module:echarts/coord/polar/Axis} */ getOtherAxis: function (axis) { var angleAxis = this._angleAxis; return axis === angleAxis ? this._radiusAxis : angleAxis; }, /** * Base axis will be used on stacking. * * @return {module:echarts/coord/polar/Axis} */ getBaseAxis: function () { return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAngleAxis(); }, /** * @param {string} [dim] 'radius' or 'angle' or 'auto' or null/undefined * @return {Object} {baseAxes: [], otherAxes: []} */ getTooltipAxes: function (dim) { var baseAxis = (dim != null && dim !== 'auto') ? this.getAxis(dim) : this.getBaseAxis(); return { baseAxes: [baseAxis], otherAxes: [this.getOtherAxis(baseAxis)] }; }, /** * Convert a single data item to (x, y) point. * Parameter data is an array which the first element is radius and the second is angle * @param {Array.} data * @param {boolean} [clamp=false] * @return {Array.} */ dataToPoint: function (data, clamp) { return this.coordToPoint([ this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp) ]); }, /** * Convert a (x, y) point to data * @param {Array.} point * @param {boolean} [clamp=false] * @return {Array.} */ pointToData: function (point, clamp) { var coord = this.pointToCoord(point); return [ this._radiusAxis.radiusToData(coord[0], clamp), this._angleAxis.angleToData(coord[1], clamp) ]; }, /** * Convert a (x, y) point to (radius, angle) coord * @param {Array.} point * @return {Array.} */ pointToCoord: function (point) { var dx = point[0] - this.cx; var dy = point[1] - this.cy; var angleAxis = this.getAngleAxis(); var extent = angleAxis.getExtent(); var minAngle = Math.min(extent[0], extent[1]); var maxAngle = Math.max(extent[0], extent[1]); // Fix fixed extent in polarCreator // FIXME angleAxis.inverse ? (minAngle = maxAngle - 360) : (maxAngle = minAngle + 360); var radius = Math.sqrt(dx * dx + dy * dy); dx /= radius; dy /= radius; var radian = Math.atan2(-dy, dx) / Math.PI * 180; // move to angleExtent var dir = radian < minAngle ? 1 : -1; while (radian < minAngle || radian > maxAngle) { radian += dir * 360; } return [radius, radian]; }, /** * Convert a (radius, angle) coord to (x, y) point * @param {Array.} coord * @return {Array.} */ coordToPoint: function (coord) { var radius = coord[0]; var radian = coord[1] / 180 * Math.PI; var x = Math.cos(radian) * radius + this.cx; // Inverse the y var y = -Math.sin(radian) * radius + this.cy; return [x, y]; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var PolarAxisModel = ComponentModel.extend({ type: 'polarAxis', /** * @type {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} */ axis: null, /** * @override */ getCoordSysModel: function () { return this.ecModel.queryComponents({ mainType: 'polar', index: this.option.polarIndex, id: this.option.polarId })[0]; } }); merge(PolarAxisModel.prototype, axisModelCommonMixin); var polarAxisDefaultExtendedOption = { angle: { // polarIndex: 0, // polarId: '', startAngle: 90, clockwise: true, splitNumber: 12, axisLabel: { rotate: false } }, radius: { // polarIndex: 0, // polarId: '', splitNumber: 5 } }; function getAxisType$3(axisDim, option) { // Default axis with data is category axis return option.type || (option.data ? 'category' : 'value'); } axisModelCreator('angle', PolarAxisModel, getAxisType$3, polarAxisDefaultExtendedOption.angle); axisModelCreator('radius', PolarAxisModel, getAxisType$3, polarAxisDefaultExtendedOption.radius); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ extendComponentModel({ type: 'polar', dependencies: ['polarAxis', 'angleAxis'], /** * @type {module:echarts/coord/polar/Polar} */ coordinateSystem: null, /** * @param {string} axisType * @return {module:echarts/coord/polar/AxisModel} */ findAxisModel: function (axisType) { var foundAxisModel; var ecModel = this.ecModel; ecModel.eachComponent(axisType, function (axisModel) { if (axisModel.getCoordSysModel() === this) { foundAxisModel = axisModel; } }, this); return foundAxisModel; }, defaultOption: { zlevel: 0, z: 0, center: ['50%', '50%'], radius: '80%' } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // TODO Axis scale /** * Resize method bound to the polar * @param {module:echarts/coord/polar/PolarModel} polarModel * @param {module:echarts/ExtensionAPI} api */ function resizePolar(polar, polarModel, api) { var center = polarModel.get('center'); var width = api.getWidth(); var height = api.getHeight(); polar.cx = parsePercent$1(center[0], width); polar.cy = parsePercent$1(center[1], height); var radiusAxis = polar.getRadiusAxis(); var size = Math.min(width, height) / 2; var radius = parsePercent$1(polarModel.get('radius'), size); radiusAxis.inverse ? radiusAxis.setExtent(radius, 0) : radiusAxis.setExtent(0, radius); } /** * Update polar */ function updatePolarScale(ecModel, api) { var polar = this; var angleAxis = polar.getAngleAxis(); var radiusAxis = polar.getRadiusAxis(); // Reset scale angleAxis.scale.setExtent(Infinity, -Infinity); radiusAxis.scale.setExtent(Infinity, -Infinity); ecModel.eachSeries(function (seriesModel) { if (seriesModel.coordinateSystem === polar) { var data = seriesModel.getData(); each$1(data.mapDimension('radius', true), function (dim) { radiusAxis.scale.unionExtentFromData( data, getStackedDimension(data, dim) ); }); each$1(data.mapDimension('angle', true), function (dim) { angleAxis.scale.unionExtentFromData( data, getStackedDimension(data, dim) ); }); } }); niceScaleExtent(angleAxis.scale, angleAxis.model); niceScaleExtent(radiusAxis.scale, radiusAxis.model); // Fix extent of category angle axis if (angleAxis.type === 'category' && !angleAxis.onBand) { var extent = angleAxis.getExtent(); var diff = 360 / angleAxis.scale.count(); angleAxis.inverse ? (extent[1] += diff) : (extent[1] -= diff); angleAxis.setExtent(extent[0], extent[1]); } } /** * Set common axis properties * @param {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} * @param {module:echarts/coord/polar/AxisModel} * @inner */ function setAxis(axis, axisModel) { axis.type = axisModel.get('type'); axis.scale = createScaleByModel(axisModel); axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category'; axis.inverse = axisModel.get('inverse'); if (axisModel.mainType === 'angleAxis') { axis.inverse ^= axisModel.get('clockwise'); var startAngle = axisModel.get('startAngle'); axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360)); } // Inject axis instance axisModel.axis = axis; axis.model = axisModel; } var polarCreator = { dimensions: Polar.prototype.dimensions, create: function (ecModel, api) { var polarList = []; ecModel.eachComponent('polar', function (polarModel, idx) { var polar = new Polar(idx); // Inject resize and update method polar.update = updatePolarScale; var radiusAxis = polar.getRadiusAxis(); var angleAxis = polar.getAngleAxis(); var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); var angleAxisModel = polarModel.findAxisModel('angleAxis'); setAxis(radiusAxis, radiusAxisModel); setAxis(angleAxis, angleAxisModel); resizePolar(polar, polarModel, api); polarList.push(polar); polarModel.coordinateSystem = polar; polar.model = polarModel; }); // Inject coordinateSystem to series ecModel.eachSeries(function (seriesModel) { if (seriesModel.get('coordinateSystem') === 'polar') { var polarModel = ecModel.queryComponents({ mainType: 'polar', index: seriesModel.get('polarIndex'), id: seriesModel.get('polarId') })[0]; if (__DEV__) { if (!polarModel) { throw new Error( 'Polar "' + retrieve( seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0 ) + '" not found' ); } } seriesModel.coordinateSystem = polarModel.coordinateSystem; } }); return polarList; } }; CoordinateSystemManager.register('polar', polarCreator); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var elementList$1 = ['axisLine', 'axisLabel', 'axisTick', 'splitLine', 'splitArea']; function getAxisLineShape(polar, rExtent, angle) { rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse()); var start = polar.coordToPoint([rExtent[0], angle]); var end = polar.coordToPoint([rExtent[1], angle]); return { x1: start[0], y1: start[1], x2: end[0], y2: end[1] }; } function getRadiusIdx(polar) { var radiusAxis = polar.getRadiusAxis(); return radiusAxis.inverse ? 0 : 1; } // Remove the last tick which will overlap the first tick function fixAngleOverlap(list) { var firstItem = list[0]; var lastItem = list[list.length - 1]; if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4 ) { list.pop(); } } AxisView.extend({ type: 'angleAxis', axisPointerClass: 'PolarAxisPointer', render: function (angleAxisModel, ecModel) { this.group.removeAll(); if (!angleAxisModel.get('show')) { return; } var angleAxis = angleAxisModel.axis; var polar = angleAxis.polar; var radiusExtent = polar.getRadiusAxis().getExtent(); var ticksAngles = angleAxis.getTicksCoords(); var labels = map(angleAxis.getViewLabels(), function (labelItem) { var labelItem = clone(labelItem); labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue); return labelItem; }); fixAngleOverlap(labels); fixAngleOverlap(ticksAngles); each$1(elementList$1, function (name) { if (angleAxisModel.get(name +'.show') && (!angleAxis.scale.isBlank() || name === 'axisLine') ) { this['_' + name](angleAxisModel, polar, ticksAngles, radiusExtent, labels); } }, this); }, /** * @private */ _axisLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) { var lineStyleModel = angleAxisModel.getModel('axisLine.lineStyle'); var circle = new Circle({ shape: { cx: polar.cx, cy: polar.cy, r: radiusExtent[getRadiusIdx(polar)] }, style: lineStyleModel.getLineStyle(), z2: 1, silent: true }); circle.style.fill = null; this.group.add(circle); }, /** * @private */ _axisTick: function (angleAxisModel, polar, ticksAngles, radiusExtent) { var tickModel = angleAxisModel.getModel('axisTick'); var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length'); var radius = radiusExtent[getRadiusIdx(polar)]; var lines = map(ticksAngles, function (tickAngleItem) { return new Line({ shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord) }); }); this.group.add(mergePath( lines, { style: defaults( tickModel.getModel('lineStyle').getLineStyle(), { stroke: angleAxisModel.get('axisLine.lineStyle.color') } ) } )); }, /** * @private */ _axisLabel: function (angleAxisModel, polar, ticksAngles, radiusExtent, labels) { var rawCategoryData = angleAxisModel.getCategories(true); var commonLabelModel = angleAxisModel.getModel('axisLabel'); var labelMargin = commonLabelModel.get('margin'); // Use length of ticksAngles because it may remove the last tick to avoid overlapping each$1(labels, function (labelItem, idx) { var labelModel = commonLabelModel; var tickValue = labelItem.tickValue; var r = radiusExtent[getRadiusIdx(polar)]; var p = polar.coordToPoint([r + labelMargin, labelItem.coord]); var cx = polar.cx; var cy = polar.cy; var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? 'center' : (p[0] > cx ? 'left' : 'right'); var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? 'middle' : (p[1] > cy ? 'top' : 'bottom'); if (rawCategoryData && rawCategoryData[tickValue] && rawCategoryData[tickValue].textStyle) { labelModel = new Model(rawCategoryData[tickValue].textStyle, commonLabelModel, commonLabelModel.ecModel); } var textEl = new Text({silent: true}); this.group.add(textEl); setTextStyle(textEl.style, labelModel, { x: p[0], y: p[1], textFill: labelModel.getTextColor() || angleAxisModel.get('axisLine.lineStyle.color'), text: labelItem.formattedLabel, textAlign: labelTextAlign, textVerticalAlign: labelTextVerticalAlign }); }, this); }, /** * @private */ _splitLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) { var splitLineModel = angleAxisModel.getModel('splitLine'); var lineStyleModel = splitLineModel.getModel('lineStyle'); var lineColors = lineStyleModel.get('color'); var lineCount = 0; lineColors = lineColors instanceof Array ? lineColors : [lineColors]; var splitLines = []; for (var i = 0; i < ticksAngles.length; i++) { var colorIndex = (lineCount++) % lineColors.length; splitLines[colorIndex] = splitLines[colorIndex] || []; splitLines[colorIndex].push(new Line({ shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord) })); } // Simple optimization // Batching the lines if color are the same for (var i = 0; i < splitLines.length; i++) { this.group.add(mergePath(splitLines[i], { style: defaults({ stroke: lineColors[i % lineColors.length] }, lineStyleModel.getLineStyle()), silent: true, z: angleAxisModel.get('z') })); } }, /** * @private */ _splitArea: function (angleAxisModel, polar, ticksAngles, radiusExtent) { if (!ticksAngles.length) { return; } var splitAreaModel = angleAxisModel.getModel('splitArea'); var areaStyleModel = splitAreaModel.getModel('areaStyle'); var areaColors = areaStyleModel.get('color'); var lineCount = 0; areaColors = areaColors instanceof Array ? areaColors : [areaColors]; var splitAreas = []; var RADIAN = Math.PI / 180; var prevAngle = -ticksAngles[0].coord * RADIAN; var r0 = Math.min(radiusExtent[0], radiusExtent[1]); var r1 = Math.max(radiusExtent[0], radiusExtent[1]); var clockwise = angleAxisModel.get('clockwise'); for (var i = 1; i < ticksAngles.length; i++) { var colorIndex = (lineCount++) % areaColors.length; splitAreas[colorIndex] = splitAreas[colorIndex] || []; splitAreas[colorIndex].push(new Sector({ shape: { cx: polar.cx, cy: polar.cy, r0: r0, r: r1, startAngle: prevAngle, endAngle: -ticksAngles[i].coord * RADIAN, clockwise: clockwise }, silent: true })); prevAngle = -ticksAngles[i].coord * RADIAN; } // Simple optimization // Batching the lines if color are the same for (var i = 0; i < splitAreas.length; i++) { this.group.add(mergePath(splitAreas[i], { style: defaults({ fill: areaColors[i % areaColors.length] }, areaStyleModel.getAreaStyle()), silent: true })); } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var axisBuilderAttrs$3 = [ 'axisLine', 'axisTickLabel', 'axisName' ]; var selfBuilderAttrs$1 = [ 'splitLine', 'splitArea' ]; AxisView.extend({ type: 'radiusAxis', axisPointerClass: 'PolarAxisPointer', render: function (radiusAxisModel, ecModel) { this.group.removeAll(); if (!radiusAxisModel.get('show')) { return; } var radiusAxis = radiusAxisModel.axis; var polar = radiusAxis.polar; var angleAxis = polar.getAngleAxis(); var ticksCoords = radiusAxis.getTicksCoords(); var axisAngle = angleAxis.getExtent()[0]; var radiusExtent = radiusAxis.getExtent(); var layout = layoutAxis(polar, radiusAxisModel, axisAngle); var axisBuilder = new AxisBuilder(radiusAxisModel, layout); each$1(axisBuilderAttrs$3, axisBuilder.add, axisBuilder); this.group.add(axisBuilder.getGroup()); each$1(selfBuilderAttrs$1, function (name) { if (radiusAxisModel.get(name +'.show') && !radiusAxis.scale.isBlank()) { this['_' + name](radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords); } }, this); }, /** * @private */ _splitLine: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { var splitLineModel = radiusAxisModel.getModel('splitLine'); var lineStyleModel = splitLineModel.getModel('lineStyle'); var lineColors = lineStyleModel.get('color'); var lineCount = 0; lineColors = lineColors instanceof Array ? lineColors : [lineColors]; var splitLines = []; for (var i = 0; i < ticksCoords.length; i++) { var colorIndex = (lineCount++) % lineColors.length; splitLines[colorIndex] = splitLines[colorIndex] || []; splitLines[colorIndex].push(new Circle({ shape: { cx: polar.cx, cy: polar.cy, r: ticksCoords[i].coord }, silent: true })); } // Simple optimization // Batching the lines if color are the same for (var i = 0; i < splitLines.length; i++) { this.group.add(mergePath(splitLines[i], { style: defaults({ stroke: lineColors[i % lineColors.length], fill: null }, lineStyleModel.getLineStyle()), silent: true })); } }, /** * @private */ _splitArea: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { if (!ticksCoords.length) { return; } var splitAreaModel = radiusAxisModel.getModel('splitArea'); var areaStyleModel = splitAreaModel.getModel('areaStyle'); var areaColors = areaStyleModel.get('color'); var lineCount = 0; areaColors = areaColors instanceof Array ? areaColors : [areaColors]; var splitAreas = []; var prevRadius = ticksCoords[0].coord; for (var i = 1; i < ticksCoords.length; i++) { var colorIndex = (lineCount++) % areaColors.length; splitAreas[colorIndex] = splitAreas[colorIndex] || []; splitAreas[colorIndex].push(new Sector({ shape: { cx: polar.cx, cy: polar.cy, r0: prevRadius, r: ticksCoords[i].coord, startAngle: 0, endAngle: Math.PI * 2 }, silent: true })); prevRadius = ticksCoords[i].coord; } // Simple optimization // Batching the lines if color are the same for (var i = 0; i < splitAreas.length; i++) { this.group.add(mergePath(splitAreas[i], { style: defaults({ fill: areaColors[i % areaColors.length] }, areaStyleModel.getAreaStyle()), silent: true })); } } }); /** * @inner */ function layoutAxis(polar, radiusAxisModel, axisAngle) { return { position: [polar.cx, polar.cy], rotation: axisAngle / 180 * Math.PI, labelDirection: -1, tickDirection: -1, nameDirection: 1, labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'), // Over splitLine and splitArea z2: 1 }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var PolarAxisPointer = BaseAxisPointer.extend({ /** * @override */ makeElOption: function (elOption, value, axisModel, axisPointerModel, api) { var axis = axisModel.axis; if (axis.dim === 'angle') { this.animationThreshold = Math.PI / 18; } var polar = axis.polar; var otherAxis = polar.getOtherAxis(axis); var otherExtent = otherAxis.getExtent(); var coordValue; coordValue = axis['dataTo' + capitalFirst(axis.dim)](value); var axisPointerType = axisPointerModel.get('type'); if (axisPointerType && axisPointerType !== 'none') { var elStyle = buildElStyle(axisPointerModel); var pointerOption = pointerShapeBuilder$2[axisPointerType]( axis, polar, coordValue, otherExtent, elStyle ); pointerOption.style = elStyle; elOption.graphicKey = pointerOption.type; elOption.pointer = pointerOption; } var labelMargin = axisPointerModel.get('label.margin'); var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin); buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos); } // Do not support handle, utill any user requires it. }); function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) { var axis = axisModel.axis; var coord = axis.dataToCoord(value); var axisAngle = polar.getAngleAxis().getExtent()[0]; axisAngle = axisAngle / 180 * Math.PI; var radiusExtent = polar.getRadiusAxis().getExtent(); var position; var align; var verticalAlign; if (axis.dim === 'radius') { var transform = create$1(); rotate(transform, transform, axisAngle); translate(transform, transform, [polar.cx, polar.cy]); position = applyTransform$1([coord, -labelMargin], transform); var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0; var labelLayout = AxisBuilder.innerTextLayout( axisAngle, labelRotation * Math.PI / 180, -1 ); align = labelLayout.textAlign; verticalAlign = labelLayout.textVerticalAlign; } else { // angle axis var r = radiusExtent[1]; position = polar.coordToPoint([r + labelMargin, coord]); var cx = polar.cx; var cy = polar.cy; align = Math.abs(position[0] - cx) / r < 0.3 ? 'center' : (position[0] > cx ? 'left' : 'right'); verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? 'middle' : (position[1] > cy ? 'top' : 'bottom'); } return { position: position, align: align, verticalAlign: verticalAlign }; } var pointerShapeBuilder$2 = { line: function (axis, polar, coordValue, otherExtent, elStyle) { return axis.dim === 'angle' ? { type: 'Line', shape: makeLineShape( polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]) ) } : { type: 'Circle', shape: { cx: polar.cx, cy: polar.cy, r: coordValue } }; }, shadow: function (axis, polar, coordValue, otherExtent, elStyle) { var bandWidth = Math.max(1, axis.getBandWidth()); var radian = Math.PI / 180; return axis.dim === 'angle' ? { type: 'Sector', shape: makeSectorShape( polar.cx, polar.cy, otherExtent[0], otherExtent[1], // In ECharts y is negative if angle is positive (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian ) } : { type: 'Sector', shape: makeSectorShape( polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2 ) }; } }; AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // For reducing size of echarts.min, barLayoutPolar is required by polar. registerLayout(curry(barLayoutPolar, 'bar')); // Polar view extendComponentView({ type: 'polar' }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var GeoModel = ComponentModel.extend({ type: 'geo', /** * @type {module:echarts/coord/geo/Geo} */ coordinateSystem: null, layoutMode: 'box', init: function (option) { ComponentModel.prototype.init.apply(this, arguments); // Default label emphasis `show` defaultEmphasis(option, 'label', ['show']); }, optionUpdated: function () { var option = this.option; var self = this; option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap); this._optionModelMap = reduce(option.regions || [], function (optionModelMap, regionOpt) { if (regionOpt.name) { optionModelMap.set(regionOpt.name, new Model(regionOpt, self)); } return optionModelMap; }, createHashMap()); this.updateSelectedMap(option.regions); }, defaultOption: { zlevel: 0, z: 0, show: true, left: 'center', top: 'center', // width:, // height:, // right // bottom // Aspect is width / height. Inited to be geoJson bbox aspect // This parameter is used for scale this aspect aspectScale: 0.75, ///// Layout with center and size // If you wan't to put map in a fixed size box with right aspect ratio // This two properties may more conveninet // layoutCenter: [50%, 50%] // layoutSize: 100 silent: false, // Map type map: '', // Define left-top, right-bottom coords to control view // For example, [ [180, 90], [-180, -90] ] boundingCoords: null, // Default on center of map center: null, zoom: 1, scaleLimit: null, // selectedMode: false label: { show: false, color: '#000' }, itemStyle: { // color: 各异, borderWidth: 0.5, borderColor: '#444', color: '#eee' }, emphasis: { label: { show: true, color: 'rgb(100,0,0)' }, itemStyle: { color: 'rgba(255,215,0,0.8)' } }, regions: [] }, /** * Get model of region * @param {string} name * @return {module:echarts/model/Model} */ getRegionModel: function (name) { return this._optionModelMap.get(name) || new Model(null, this, this.ecModel); }, /** * Format label * @param {string} name Region name * @param {string} [status='normal'] 'normal' or 'emphasis' * @return {string} */ getFormattedLabel: function (name, status) { var regionModel = this.getRegionModel(name); var formatter = regionModel.get('label.' + status + '.formatter'); var params = { name: name }; if (typeof formatter === 'function') { params.status = status; return formatter(params); } else if (typeof formatter === 'string') { return formatter.replace('{a}', name != null ? name : ''); } }, setZoom: function (zoom) { this.option.zoom = zoom; }, setCenter: function (center) { this.option.center = center; } }); mixin(GeoModel, selectableMixin); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ extendComponentView({ type: 'geo', init: function (ecModel, api) { var mapDraw = new MapDraw(api, true); this._mapDraw = mapDraw; this.group.add(mapDraw.group); }, render: function (geoModel, ecModel, api, payload) { // Not render if it is an toggleSelect action from self if (payload && payload.type === 'geoToggleSelect' && payload.from === this.uid ) { return; } var mapDraw = this._mapDraw; if (geoModel.get('show')) { mapDraw.draw(geoModel, ecModel, api, this, payload); } else { this._mapDraw.group.removeAll(); } this.group.silent = geoModel.get('silent'); }, dispose: function () { this._mapDraw && this._mapDraw.remove(); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function makeAction(method, actionInfo) { actionInfo.update = 'updateView'; registerAction(actionInfo, function (payload, ecModel) { var selected = {}; ecModel.eachComponent( { mainType: 'geo', query: payload}, function (geoModel) { geoModel[method](payload.name); var geo = geoModel.coordinateSystem; each$1(geo.regions, function (region) { selected[region.name] = geoModel.isSelected(region.name) || false; }); } ); return { selected: selected, name: payload.name }; }); } makeAction('toggleSelected', { type: 'geoToggleSelect', event: 'geoselectchanged' }); makeAction('select', { type: 'geoSelect', event: 'geoselected' }); makeAction('unSelect', { type: 'geoUnSelect', event: 'geounselected' }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear']; var preprocessor$1 = function (option, isNew) { var brushComponents = option && option.brush; if (!isArray(brushComponents)) { brushComponents = brushComponents ? [brushComponents] : []; } if (!brushComponents.length) { return; } var brushComponentSpecifiedBtns = []; each$1(brushComponents, function (brushOpt) { var tbs = brushOpt.hasOwnProperty('toolbox') ? brushOpt.toolbox : []; if (tbs instanceof Array) { brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs); } }); var toolbox = option && option.toolbox; if (isArray(toolbox)) { toolbox = toolbox[0]; } if (!toolbox) { toolbox = {feature: {}}; option.toolbox = [toolbox]; } var toolboxFeature = (toolbox.feature || (toolbox.feature = {})); var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {}); var brushTypes = toolboxBrush.type || (toolboxBrush.type = []); brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns); removeDuplicate(brushTypes); if (isNew && !brushTypes.length) { brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS); } }; function removeDuplicate(arr) { var map$$1 = {}; each$1(arr, function (val) { map$$1[val] = 1; }); arr.length = 0; each$1(map$$1, function (flag, val) { arr.push(val); }); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file Visual solution, for consistent option specification. */ var each$19 = each$1; function hasKeys(obj) { if (obj) { for (var name in obj){ if (obj.hasOwnProperty(name)) { return true; } } } } /** * @param {Object} option * @param {Array.} stateList * @param {Function} [supplementVisualOption] * @return {Object} visualMappings > */ function createVisualMappings(option, stateList, supplementVisualOption) { var visualMappings = {}; each$19(stateList, function (state) { var mappings = visualMappings[state] = createMappings(); each$19(option[state], function (visualData, visualType) { if (!VisualMapping.isValidType(visualType)) { return; } var mappingOption = { type: visualType, visual: visualData }; supplementVisualOption && supplementVisualOption(mappingOption, state); mappings[visualType] = new VisualMapping(mappingOption); // Prepare a alpha for opacity, for some case that opacity // is not supported, such as rendering using gradient color. if (visualType === 'opacity') { mappingOption = clone(mappingOption); mappingOption.type = 'colorAlpha'; mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption); } }); }); return visualMappings; function createMappings() { var Creater = function () {}; // Make sure hidden fields will not be visited by // object iteration (with hasOwnProperty checking). Creater.prototype.__hidden = Creater.prototype; var obj = new Creater(); return obj; } } /** * @param {Object} thisOption * @param {Object} newOption * @param {Array.} keys */ function replaceVisualOption(thisOption, newOption, keys) { // Visual attributes merge is not supported, otherwise it // brings overcomplicated merge logic. See #2853. So if // newOption has anyone of these keys, all of these keys // will be reset. Otherwise, all keys remain. var has; each$1(keys, function (key) { if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { has = true; } }); has && each$1(keys, function (key) { if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { thisOption[key] = clone(newOption[key]); } else { delete thisOption[key]; } }); } /** * @param {Array.} stateList * @param {Object} visualMappings > * @param {module:echarts/data/List} list * @param {Function} getValueState param: valueOrIndex, return: state. * @param {object} [scope] Scope for getValueState * @param {string} [dimension] Concrete dimension, if used. */ // ???! handle brush? function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) { var visualTypesMap = {}; each$1(stateList, function (state) { var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); visualTypesMap[state] = visualTypes; }); var dataIndex; function getVisual(key) { return data.getItemVisual(dataIndex, key); } function setVisual(key, value) { data.setItemVisual(dataIndex, key, value); } if (dimension == null) { data.each(eachItem); } else { data.each([dimension], eachItem); } function eachItem(valueOrIndex, index) { dataIndex = dimension == null ? valueOrIndex : index; var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance if (rawDataItem && rawDataItem.visualMap === false) { return; } var valueState = getValueState.call(scope, valueOrIndex); var mappings = visualMappings[valueState]; var visualTypes = visualTypesMap[valueState]; for (var i = 0, len = visualTypes.length; i < len; i++) { var type = visualTypes[i]; mappings[type] && mappings[type].applyVisual( valueOrIndex, getVisual, setVisual ); } } } /** * @param {module:echarts/data/List} data * @param {Array.} stateList * @param {Object} visualMappings > * @param {Function} getValueState param: valueOrIndex, return: state. * @param {number} [dim] dimension or dimension index. */ function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) { var visualTypesMap = {}; each$1(stateList, function (state) { var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); visualTypesMap[state] = visualTypes; }); function progress(params, data) { if (dim != null) { dim = data.getDimension(dim); } function getVisual(key) { return data.getItemVisual(dataIndex, key); } function setVisual(key, value) { data.setItemVisual(dataIndex, key, value); } var dataIndex; while ((dataIndex = params.next()) != null) { var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance if (rawDataItem && rawDataItem.visualMap === false) { return; } var value = dim != null ? data.get(dim, dataIndex, true) : dataIndex; var valueState = getValueState(value); var mappings = visualMappings[valueState]; var visualTypes = visualTypesMap[valueState]; for (var i = 0, len = visualTypes.length; i < len; i++) { var type = visualTypes[i]; mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual); } } } return {progress: progress}; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Key of the first level is brushType: `line`, `rect`, `polygon`. // Key of the second level is chart element type: `point`, `rect`. // See moudule:echarts/component/helper/BrushController // function param: // {Object} itemLayout fetch from data.getItemLayout(dataIndex) // {Object} selectors {point: selector, rect: selector, ...} // {Object} area {range: [[], [], ..], boudingRect} // function return: // {boolean} Whether in the given brush. var selector = { lineX: getLineSelectors(0), lineY: getLineSelectors(1), rect: { point: function (itemLayout, selectors, area) { return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]); }, rect: function (itemLayout, selectors, area) { return itemLayout && area.boundingRect.intersect(itemLayout); } }, polygon: { point: function (itemLayout, selectors, area) { return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && contain$1(area.range, itemLayout[0], itemLayout[1]); }, rect: function (itemLayout, selectors, area) { var points = area.range; if (!itemLayout || points.length <= 1) { return false; } var x = itemLayout.x; var y = itemLayout.y; var width = itemLayout.width; var height = itemLayout.height; var p = points[0]; if (contain$1(points, x, y) || contain$1(points, x + width, y) || contain$1(points, x, y + height) || contain$1(points, x + width, y + height) || BoundingRect.create(itemLayout).contain(p[0], p[1]) || lineIntersectPolygon(x, y, x + width, y, points) || lineIntersectPolygon(x, y, x, y + height, points) || lineIntersectPolygon(x + width, y, x + width, y + height, points) || lineIntersectPolygon(x, y + height, x + width, y + height, points) ) { return true; } } } }; function getLineSelectors(xyIndex) { var xy = ['x', 'y']; var wh = ['width', 'height']; return { point: function (itemLayout, selectors, area) { if (itemLayout) { var range = area.range; var p = itemLayout[xyIndex]; return inLineRange(p, range); } }, rect: function (itemLayout, selectors, area) { if (itemLayout) { var range = area.range; var layoutRange = [ itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]] ]; layoutRange[1] < layoutRange[0] && layoutRange.reverse(); return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange); } } }; } function inLineRange(p, range) { return range[0] <= p && p <= range[1]; } function lineIntersectPolygon(lx, ly, l2x, l2y, points) { for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) { var p = points[i]; if (lineIntersect(lx, ly, l2x, l2y, p[0], p[1], p2[0], p2[1])) { return true; } p2 = p; } } // Code from with some fix. // See function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) { var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y); if (nearZero(delta)) { // parallel return false; } var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta; if (namenda < 0 || namenda > 1) { return false; } var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta; if (miu < 0 || miu > 1) { return false; } return true; } function nearZero(val) { return val <= (1e-6) && val >= -(1e-6); } function determinant(v1, v2, v3, v4) { return v1 * v4 - v2 * v3; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$20 = each$1; var indexOf$1 = indexOf; var curry$5 = curry; var COORD_CONVERTS = ['dataToPoint', 'pointToData']; // FIXME // how to genarialize to more coordinate systems. var INCLUDE_FINDER_MAIN_TYPES = [ 'grid', 'xAxis', 'yAxis', 'geo', 'graph', 'polar', 'radiusAxis', 'angleAxis', 'bmap' ]; /** * [option in constructor]: * { * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder. * } * * * [targetInfo]: * * There can be multiple axes in a single targetInfo. Consider the case * of `grid` component, a targetInfo represents a grid which contains one or more * cartesian and one or more axes. And consider the case of parallel system, * which has multiple axes in a coordinate system. * Can be { * panelId: ..., * coordSys: , * coordSyses: all cartesians. * gridModel: * xAxes: correspond to coordSyses on index * yAxes: correspond to coordSyses on index * } * or { * panelId: ..., * coordSys: * coordSyses: [] * geoModel: * } * * * [panelOpt]: * * Make from targetInfo. Input to BrushController. * { * panelId: ..., * rect: ... * } * * * [area]: * * Generated by BrushController or user input. * { * panelId: Used to locate coordInfo directly. If user inpput, no panelId. * brushType: determine how to convert to/from coord('rect' or 'polygon' or 'lineX/Y'). * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder. * range: pixel range. * coordRange: representitive coord range (the first one of coordRanges). * coordRanges: coord ranges, used in multiple cartesian in one grid. * } */ /** * @param {Object} option contains Index/Id/Name of xAxis/yAxis/geo/grid * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]} * @param {module:echarts/model/Global} ecModel * @param {Object} [opt] * @param {Array.} [opt.include] include coordinate system types. */ function BrushTargetManager(option, ecModel, opt) { /** * @private * @type {Array.} */ var targetInfoList = this._targetInfoList = []; var info = {}; var foundCpts = parseFinder$1(ecModel, option); each$20(targetInfoBuilders, function (builder, type) { if (!opt || !opt.include || indexOf$1(opt.include, type) >= 0) { builder(foundCpts, targetInfoList, info); } }); } var proto$2 = BrushTargetManager.prototype; proto$2.setOutputRanges = function (areas, ecModel) { this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { (area.coordRanges || (area.coordRanges = [])).push(coordRange); // area.coordRange is the first of area.coordRanges if (!area.coordRange) { area.coordRange = coordRange; // In 'category' axis, coord to pixel is not reversible, so we can not // rebuild range by coordRange accrately, which may bring trouble when // brushing only one item. So we use __rangeOffset to rebuilding range // by coordRange. And this it only used in brush component so it is no // need to be adapted to coordRanges. var result = coordConvert[area.brushType](0, coordSys, coordRange); area.__rangeOffset = { offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]), xyMinMax: result.xyMinMax }; } }); }; proto$2.matchOutputRanges = function (areas, ecModel, cb) { each$20(areas, function (area) { var targetInfo = this.findTargetInfo(area, ecModel); if (targetInfo && targetInfo !== true) { each$1( targetInfo.coordSyses, function (coordSys) { var result = coordConvert[area.brushType](1, coordSys, area.range); cb(area, result.values, coordSys, ecModel); } ); } }, this); }; proto$2.setInputRanges = function (areas, ecModel) { each$20(areas, function (area) { var targetInfo = this.findTargetInfo(area, ecModel); if (__DEV__) { assert$1( !targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.' ); assert$1( !targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.' ); } area.range = area.range || []; // convert coordRange to global range and set panelId. if (targetInfo && targetInfo !== true) { area.panelId = targetInfo.panelId; // (1) area.range shoule always be calculate from coordRange but does // not keep its original value, for the sake of the dataZoom scenario, // where area.coordRange remains unchanged but area.range may be changed. // (2) Only support converting one coordRange to pixel range in brush // component. So do not consider `coordRanges`. // (3) About __rangeOffset, see comment above. var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange); var rangeOffset = area.__rangeOffset; area.range = rangeOffset ? diffProcessor[area.brushType]( result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax) ) : result.values; } }, this); }; proto$2.makePanelOpts = function (api, getDefaultBrushType) { return map(this._targetInfoList, function (targetInfo) { var rect = targetInfo.getPanelRect(); return { panelId: targetInfo.panelId, defaultBrushType: getDefaultBrushType && getDefaultBrushType(targetInfo), clipPath: makeRectPanelClipPath(rect), isTargetByCursor: makeRectIsTargetByCursor( rect, api, targetInfo.coordSysModel ), getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect) }; }); }; proto$2.controlSeries = function (area, seriesModel, ecModel) { // Check whether area is bound in coord, and series do not belong to that coord. // If do not do this check, some brush (like lineX) will controll all axes. var targetInfo = this.findTargetInfo(area, ecModel); return targetInfo === true || ( targetInfo && indexOf$1(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0 ); }; /** * If return Object, a coord found. * If reutrn true, global found. * Otherwise nothing found. * * @param {Object} area * @param {Array} targetInfoList * @return {Object|boolean} */ proto$2.findTargetInfo = function (area, ecModel) { var targetInfoList = this._targetInfoList; var foundCpts = parseFinder$1(ecModel, area); for (var i = 0; i < targetInfoList.length; i++) { var targetInfo = targetInfoList[i]; var areaPanelId = area.panelId; if (areaPanelId) { if (targetInfo.panelId === areaPanelId) { return targetInfo; } } else { for (var i = 0; i < targetInfoMatchers.length; i++) { if (targetInfoMatchers[i](foundCpts, targetInfo)) { return targetInfo; } } } } return true; }; function formatMinMax(minMax) { minMax[0] > minMax[1] && minMax.reverse(); return minMax; } function parseFinder$1(ecModel, option) { return parseFinder( ecModel, option, {includeMainTypes: INCLUDE_FINDER_MAIN_TYPES} ); } var targetInfoBuilders = { grid: function (foundCpts, targetInfoList) { var xAxisModels = foundCpts.xAxisModels; var yAxisModels = foundCpts.yAxisModels; var gridModels = foundCpts.gridModels; // Remove duplicated. var gridModelMap = createHashMap(); var xAxesHas = {}; var yAxesHas = {}; if (!xAxisModels && !yAxisModels && !gridModels) { return; } each$20(xAxisModels, function (axisModel) { var gridModel = axisModel.axis.grid.model; gridModelMap.set(gridModel.id, gridModel); xAxesHas[gridModel.id] = true; }); each$20(yAxisModels, function (axisModel) { var gridModel = axisModel.axis.grid.model; gridModelMap.set(gridModel.id, gridModel); yAxesHas[gridModel.id] = true; }); each$20(gridModels, function (gridModel) { gridModelMap.set(gridModel.id, gridModel); xAxesHas[gridModel.id] = true; yAxesHas[gridModel.id] = true; }); gridModelMap.each(function (gridModel) { var grid = gridModel.coordinateSystem; var cartesians = []; each$20(grid.getCartesians(), function (cartesian, index) { if (indexOf$1(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf$1(yAxisModels, cartesian.getAxis('y').model) >= 0 ) { cartesians.push(cartesian); } }); targetInfoList.push({ panelId: 'grid--' + gridModel.id, gridModel: gridModel, coordSysModel: gridModel, // Use the first one as the representitive coordSys. coordSys: cartesians[0], coordSyses: cartesians, getPanelRect: panelRectBuilder.grid, xAxisDeclared: xAxesHas[gridModel.id], yAxisDeclared: yAxesHas[gridModel.id] }); }); }, geo: function (foundCpts, targetInfoList) { each$20(foundCpts.geoModels, function (geoModel) { var coordSys = geoModel.coordinateSystem; targetInfoList.push({ panelId: 'geo--' + geoModel.id, geoModel: geoModel, coordSysModel: geoModel, coordSys: coordSys, coordSyses: [coordSys], getPanelRect: panelRectBuilder.geo }); }); } }; var targetInfoMatchers = [ // grid function (foundCpts, targetInfo) { var xAxisModel = foundCpts.xAxisModel; var yAxisModel = foundCpts.yAxisModel; var gridModel = foundCpts.gridModel; !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model); !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model); return gridModel && gridModel === targetInfo.gridModel; }, // geo function (foundCpts, targetInfo) { var geoModel = foundCpts.geoModel; return geoModel && geoModel === targetInfo.geoModel; } ]; var panelRectBuilder = { grid: function () { // grid is not Transformable. return this.coordSys.grid.getRect().clone(); }, geo: function () { var coordSys = this.coordSys; var rect = coordSys.getBoundingRect().clone(); // geo roam and zoom transform rect.applyTransform(getTransform(coordSys)); return rect; } }; var coordConvert = { lineX: curry$5(axisConvert, 0), lineY: curry$5(axisConvert, 1), rect: function (to, coordSys, rangeOrCoordRange) { var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]); var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]); var values = [ formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]]) ]; return {values: values, xyMinMax: values}; }, polygon: function (to, coordSys, rangeOrCoordRange) { var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]]; var values = map(rangeOrCoordRange, function (item) { var p = coordSys[COORD_CONVERTS[to]](item); xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]); xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]); xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]); xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]); return p; }); return {values: values, xyMinMax: xyMinMax}; } }; function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) { if (__DEV__) { assert$1( coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.' ); } var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]); var values = formatMinMax(map([0, 1], function (i) { return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i])) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i])); })); var xyMinMax = []; xyMinMax[axisNameIndex] = values; xyMinMax[1 - axisNameIndex] = [NaN, NaN]; return {values: values, xyMinMax: xyMinMax}; } var diffProcessor = { lineX: curry$5(axisDiffProcessor, 0), lineY: curry$5(axisDiffProcessor, 1), rect: function (values, refer, scales) { return [ [values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]] ]; }, polygon: function (values, refer, scales) { return map(values, function (item, idx) { return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]]; }); } }; function axisDiffProcessor(axisNameIndex, values, refer, scales) { return [ values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1] ]; } // We have to process scale caused by dataZoom manually, // although it might be not accurate. function getScales(xyMinMaxCurr, xyMinMaxOrigin) { var sizeCurr = getSize(xyMinMaxCurr); var sizeOrigin = getSize(xyMinMaxOrigin); var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]]; isNaN(scales[0]) && (scales[0] = 1); isNaN(scales[1]) && (scales[1] = 1); return scales; } function getSize(xyMinMax) { return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN]; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var STATE_LIST = ['inBrush', 'outOfBrush']; var DISPATCH_METHOD = '__ecBrushSelect'; var DISPATCH_FLAG = '__ecInBrushSelectEvent'; var PRIORITY_BRUSH = PRIORITY.VISUAL.BRUSH; /** * Layout for visual, the priority higher than other layout, and before brush visual. */ registerLayout(PRIORITY_BRUSH, function (ecModel, api, payload) { ecModel.eachComponent({mainType: 'brush'}, function (brushModel) { payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption( payload.key === 'brush' ? payload.brushOption : {brushType: false} ); var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel); brushTargetManager.setInputRanges(brushModel.areas, ecModel); }); }); /** * Register the visual encoding if this modules required. */ registerVisual(PRIORITY_BRUSH, function (ecModel, api, payload) { var brushSelected = []; var throttleType; var throttleDelay; ecModel.eachComponent({mainType: 'brush'}, function (brushModel, brushIndex) { var thisBrushSelected = { brushId: brushModel.id, brushIndex: brushIndex, brushName: brushModel.name, areas: clone(brushModel.areas), selected: [] }; // Every brush component exists in event params, convenient // for user to find by index. brushSelected.push(thisBrushSelected); var brushOption = brushModel.option; var brushLink = brushOption.brushLink; var linkedSeriesMap = []; var selectedDataIndexForLink = []; var rangeInfoBySeries = []; var hasBrushExists = 0; if (!brushIndex) { // Only the first throttle setting works. throttleType = brushOption.throttleType; throttleDelay = brushOption.throttleDelay; } // Add boundingRect and selectors to range. var areas = map(brushModel.areas, function (area) { return bindSelector( defaults( {boundingRect: boundingRectBuilders[area.brushType](area)}, area ) ); }); var visualMappings = createVisualMappings( brushModel.option, STATE_LIST, function (mappingOption) { mappingOption.mappingMethod = 'fixed'; } ); isArray(brushLink) && each$1(brushLink, function (seriesIndex) { linkedSeriesMap[seriesIndex] = 1; }); function linkOthers(seriesIndex) { return brushLink === 'all' || linkedSeriesMap[seriesIndex]; } // If no supported brush or no brush on the series, // all visuals should be in original state. function brushed(rangeInfoList) { return !!rangeInfoList.length; } /** * Logic for each series: (If the logic has to be modified one day, do it carefully!) * * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord. * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord. * └!hasBrushExist┘ └nothing. * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord. * └!hasBrushExist┘ └nothing. * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck. * !brushed┘ └nothing. * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing. */ // Step A ecModel.eachSeries(function (seriesModel, seriesIndex) { var rangeInfoList = rangeInfoBySeries[seriesIndex] = []; seriesModel.subType === 'parallel' ? stepAParallel(seriesModel, seriesIndex, rangeInfoList) : stepAOthers(seriesModel, seriesIndex, rangeInfoList); }); function stepAParallel(seriesModel, seriesIndex) { var coordSys = seriesModel.coordinateSystem; hasBrushExists |= coordSys.hasAxisBrushed(); linkOthers(seriesIndex) && coordSys.eachActiveState( seriesModel.getData(), function (activeState, dataIndex) { activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1); } ); } function stepAOthers(seriesModel, seriesIndex, rangeInfoList) { var selectorsByBrushType = getSelectorsByBrushType(seriesModel); if (!selectorsByBrushType || brushModelNotControll(brushModel, seriesIndex)) { return; } each$1(areas, function (area) { selectorsByBrushType[area.brushType] && brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel) && rangeInfoList.push(area); hasBrushExists |= brushed(rangeInfoList); }); if (linkOthers(seriesIndex) && brushed(rangeInfoList)) { var data = seriesModel.getData(); data.each(function (dataIndex) { if (checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex)) { selectedDataIndexForLink[dataIndex] = 1; } }); } } // Step B ecModel.eachSeries(function (seriesModel, seriesIndex) { var seriesBrushSelected = { seriesId: seriesModel.id, seriesIndex: seriesIndex, seriesName: seriesModel.name, dataIndex: [] }; // Every series exists in event params, convenient // for user to find series by seriesIndex. thisBrushSelected.selected.push(seriesBrushSelected); var selectorsByBrushType = getSelectorsByBrushType(seriesModel); var rangeInfoList = rangeInfoBySeries[seriesIndex]; var data = seriesModel.getData(); var getValueState = linkOthers(seriesIndex) ? function (dataIndex) { return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush'; } : function (dataIndex) { return checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush'; }; // If no supported brush or no brush, all visuals are in original state. (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && applyVisual( STATE_LIST, visualMappings, data, getValueState ); }); }); dispatchAction(api, throttleType, throttleDelay, brushSelected, payload); }); function dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) { // This event will not be triggered when `setOpion`, otherwise dead lock may // triggered when do `setOption` in event listener, which we do not find // satisfactory way to solve yet. Some considered resolutions: // (a) Diff with prevoius selected data ant only trigger event when changed. // But store previous data and diff precisely (i.e., not only by dataIndex, but // also detect value changes in selected data) might bring complexity or fragility. // (b) Use spectial param like `silent` to suppress event triggering. // But such kind of volatile param may be weird in `setOption`. if (!payload) { return; } var zr = api.getZr(); if (zr[DISPATCH_FLAG]) { return; } if (!zr[DISPATCH_METHOD]) { zr[DISPATCH_METHOD] = doDispatch; } var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType); fn(api, brushSelected); } function doDispatch(api, brushSelected) { if (!api.isDisposed()) { var zr = api.getZr(); zr[DISPATCH_FLAG] = true; api.dispatchAction({ type: 'brushSelect', batch: brushSelected }); zr[DISPATCH_FLAG] = false; } } function checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex) { for (var i = 0, len = rangeInfoList.length; i < len; i++) { var area = rangeInfoList[i]; if (selectorsByBrushType[area.brushType]( dataIndex, data, area.selectors, area )) { return true; } } } function getSelectorsByBrushType(seriesModel) { var brushSelector = seriesModel.brushSelector; if (isString(brushSelector)) { var sels = []; each$1(selector, function (selectorsByElementType, brushType) { sels[brushType] = function (dataIndex, data, selectors, area) { var itemLayout = data.getItemLayout(dataIndex); return selectorsByElementType[brushSelector](itemLayout, selectors, area); }; }); return sels; } else if (isFunction$1(brushSelector)) { var bSelector = {}; each$1(selector, function (sel, brushType) { bSelector[brushType] = brushSelector; }); return bSelector; } return brushSelector; } function brushModelNotControll(brushModel, seriesIndex) { var seriesIndices = brushModel.option.seriesIndex; return seriesIndices != null && seriesIndices !== 'all' && ( isArray(seriesIndices) ? indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices ); } function bindSelector(area) { var selectors = area.selectors = {}; each$1(selector[area.brushType], function (selFn, elType) { // Do not use function binding or curry for performance. selectors[elType] = function (itemLayout) { return selFn(itemLayout, selectors, area); }; }); return area; } var boundingRectBuilders = { lineX: noop, lineY: noop, rect: function (area) { return getBoundingRectFromMinMax(area.range); }, polygon: function (area) { var minMax; var range = area.range; for (var i = 0, len = range.length; i < len; i++) { minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]]; var rg = range[i]; rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]); rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]); rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]); rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]); } return minMax && getBoundingRectFromMinMax(minMax); } }; function getBoundingRectFromMinMax(minMax) { return new BoundingRect( minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0] ); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var DEFAULT_OUT_OF_BRUSH_COLOR = ['#ddd']; var BrushModel = extendComponentModel({ type: 'brush', dependencies: ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'], /** * @protected */ defaultOption: { // inBrush: null, // outOfBrush: null, toolbox: null, // Default value see preprocessor. brushLink: null, // Series indices array, broadcast using dataIndex. // or 'all', which means all series. 'none' or null means no series. seriesIndex: 'all', // seriesIndex array, specify series controlled by this brush component. geoIndex: null, // xAxisIndex: null, yAxisIndex: null, brushType: 'rect', // Default brushType, see BrushController. brushMode: 'single', // Default brushMode, 'single' or 'multiple' transformable: true, // Default transformable. brushStyle: { // Default brushStyle borderWidth: 1, color: 'rgba(120,140,180,0.3)', borderColor: 'rgba(120,140,180,0.8)' }, throttleType: 'fixRate',// Throttle in brushSelected event. 'fixRate' or 'debounce'. // If null, no throttle. Valid only in the first brush component throttleDelay: 0, // Unit: ms, 0 means every event will be triggered. // FIXME // 试验效果 removeOnClick: true, z: 10000 }, /** * @readOnly * @type {Array.} */ areas: [], /** * Current activated brush type. * If null, brush is inactived. * see module:echarts/component/helper/BrushController * @readOnly * @type {string} */ brushType: null, /** * Current brush opt. * see module:echarts/component/helper/BrushController * @readOnly * @type {Object} */ brushOption: {}, /** * @readOnly * @type {Array.} */ coordInfoList: [], optionUpdated: function (newOption, isInit) { var thisOption = this.option; !isInit && replaceVisualOption( thisOption, newOption, ['inBrush', 'outOfBrush'] ); var inBrush = thisOption.inBrush = thisOption.inBrush || {}; // Always give default visual, consider setOption at the second time. thisOption.outOfBrush = thisOption.outOfBrush || {color: DEFAULT_OUT_OF_BRUSH_COLOR}; if (!inBrush.hasOwnProperty('liftZ')) { // Bigger than the highlight z lift, otherwise it will // be effected by the highlight z when brush. inBrush.liftZ = 5; } }, /** * If ranges is null/undefined, range state remain. * * @param {Array.} [ranges] */ setAreas: function (areas) { if (__DEV__) { assert$1(isArray(areas)); each$1(areas, function (area) { assert$1(area.brushType, 'Illegal areas'); }); } // If ranges is null/undefined, range state remain. // This helps user to dispatchAction({type: 'brush'}) with no areas // set but just want to get the current brush select info from a `brush` event. if (!areas) { return; } this.areas = map(areas, function (area) { return generateBrushOption(this.option, area); }, this); }, /** * see module:echarts/component/helper/BrushController * @param {Object} brushOption */ setBrushOption: function (brushOption) { this.brushOption = generateBrushOption(this.option, brushOption); this.brushType = this.brushOption.brushType; } }); function generateBrushOption(option, brushOption) { return merge( { brushType: option.brushType, brushMode: option.brushMode, transformable: option.transformable, brushStyle: new Model(option.brushStyle).getItemStyle(), removeOnClick: option.removeOnClick, z: option.z }, brushOption, true ); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ extendComponentView({ type: 'brush', init: function (ecModel, api) { /** * @readOnly * @type {module:echarts/model/Global} */ this.ecModel = ecModel; /** * @readOnly * @type {module:echarts/ExtensionAPI} */ this.api = api; /** * @readOnly * @type {module:echarts/component/brush/BrushModel} */ this.model; /** * @private * @type {module:echarts/component/helper/BrushController} */ (this._brushController = new BrushController(api.getZr())) .on('brush', bind(this._onBrush, this)) .mount(); }, /** * @override */ render: function (brushModel) { this.model = brushModel; return updateController.apply(this, arguments); }, /** * @override */ updateTransform: updateController, /** * @override */ updateView: updateController, // /** // * @override // */ // updateLayout: updateController, // /** // * @override // */ // updateVisual: updateController, /** * @override */ dispose: function () { this._brushController.dispose(); }, /** * @private */ _onBrush: function (areas, opt) { var modelId = this.model.id; this.model.brushTargetManager.setOutputRanges(areas, this.ecModel); // Action is not dispatched on drag end, because the drag end // emits the same params with the last drag move event, and // may have some delay when using touch pad, which makes // animation not smooth (when using debounce). (!opt.isEnd || opt.removeOnClick) && this.api.dispatchAction({ type: 'brush', brushId: modelId, areas: clone(areas), $from: modelId }); } }); function updateController(brushModel, ecModel, api, payload) { // Do not update controller when drawing. (!payload || payload.$from !== brushModel.id) && this._brushController .setPanels(brushModel.brushTargetManager.makePanelOpts(api)) .enableBrush(brushModel.brushOption) .updateCovers(brushModel.areas.slice()); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * payload: { * brushIndex: number, or, * brushId: string, or, * brushName: string, * globalRanges: Array * } */ registerAction( {type: 'brush', event: 'brush' /*, update: 'updateView' */}, function (payload, ecModel) { ecModel.eachComponent({mainType: 'brush', query: payload}, function (brushModel) { brushModel.setAreas(payload.areas); }); } ); /** * payload: { * brushComponents: [ * { * brushId, * brushIndex, * brushName, * series: [ * { * seriesId, * seriesIndex, * seriesName, * rawIndices: [21, 34, ...] * }, * ... * ] * }, * ... * ] * } */ registerAction( {type: 'brushSelect', event: 'brushSelected', update: 'none'}, function () {} ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var features = {}; function register$1(name, ctor) { features[name] = ctor; } function get$1(name) { return features[name]; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var brushLang = lang.toolbox.brush; function Brush(model, ecModel, api) { this.model = model; this.ecModel = ecModel; this.api = api; /** * @private * @type {string} */ this._brushType; /** * @private * @type {string} */ this._brushMode; } Brush.defaultOption = { show: true, type: ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'], icon: { rect: 'M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13', // jshint ignore:line polygon: 'M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2', // jshint ignore:line lineX: 'M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4', // jshint ignore:line lineY: 'M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4', // jshint ignore:line keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z', // jshint ignore:line clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2' // jshint ignore:line }, // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear` title: clone(brushLang.title) }; var proto$3 = Brush.prototype; // proto.updateLayout = function (featureModel, ecModel, api) { proto$3.render = proto$3.updateView = function (featureModel, ecModel, api) { var brushType; var brushMode; var isBrushed; ecModel.eachComponent({mainType: 'brush'}, function (brushModel) { brushType = brushModel.brushType; brushMode = brushModel.brushOption.brushMode || 'single'; isBrushed |= brushModel.areas.length; }); this._brushType = brushType; this._brushMode = brushMode; each$1(featureModel.get('type', true), function (type) { featureModel.setIconStatus( type, ( type === 'keep' ? brushMode === 'multiple' : type === 'clear' ? isBrushed : type === brushType ) ? 'emphasis' : 'normal' ); }); }; proto$3.getIcons = function () { var model = this.model; var availableIcons = model.get('icon', true); var icons = {}; each$1(model.get('type', true), function (type) { if (availableIcons[type]) { icons[type] = availableIcons[type]; } }); return icons; }; proto$3.onclick = function (ecModel, api, type) { var brushType = this._brushType; var brushMode = this._brushMode; if (type === 'clear') { // Trigger parallel action firstly api.dispatchAction({ type: 'axisAreaSelect', intervals: [] }); api.dispatchAction({ type: 'brush', command: 'clear', // Clear all areas of all brush components. areas: [] }); } else { api.dispatchAction({ type: 'takeGlobalCursor', key: 'brush', brushOption: { brushType: type === 'keep' ? brushType : (brushType === type ? false : type), brushMode: type === 'keep' ? (brushMode === 'multiple' ? 'single' : 'multiple') : brushMode } }); } }; register$1('brush', Brush); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Brush component entry */ registerPreprocessor(preprocessor$1); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // (24*60*60*1000) var PROXIMATE_ONE_DAY = 86400000; /** * Calendar * * @constructor * * @param {Object} calendarModel calendarModel * @param {Object} ecModel ecModel * @param {Object} api api */ function Calendar(calendarModel, ecModel, api) { this._model = calendarModel; } Calendar.prototype = { constructor: Calendar, type: 'calendar', dimensions: ['time', 'value'], // Required in createListFromData getDimensionsInfo: function () { return [{name: 'time', type: 'time'}, 'value']; }, getRangeInfo: function () { return this._rangeInfo; }, getModel: function () { return this._model; }, getRect: function () { return this._rect; }, getCellWidth: function () { return this._sw; }, getCellHeight: function () { return this._sh; }, getOrient: function () { return this._orient; }, /** * getFirstDayOfWeek * * @example * 0 : start at Sunday * 1 : start at Monday * * @return {number} */ getFirstDayOfWeek: function () { return this._firstDayOfWeek; }, /** * get date info * * @param {string|number} date date * @return {Object} * { * y: string, local full year, eg., '1940', * m: string, local month, from '01' ot '12', * d: string, local date, from '01' to '31' (if exists), * day: It is not date.getDay(). It is the location of the cell in a week, from 0 to 6, * time: timestamp, * formatedDate: string, yyyy-MM-dd, * date: original date object. * } */ getDateInfo: function (date) { date = parseDate(date); var y = date.getFullYear(); var m = date.getMonth() + 1; m = m < 10 ? '0' + m : m; var d = date.getDate(); d = d < 10 ? '0' + d : d; var day = date.getDay(); day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7); return { y: y, m: m, d: d, day: day, time: date.getTime(), formatedDate: y + '-' + m + '-' + d, date: date }; }, getNextNDay: function (date, n) { n = n || 0; if (n === 0) { return this.getDateInfo(date); } date = new Date(this.getDateInfo(date).time); date.setDate(date.getDate() + n); return this.getDateInfo(date); }, update: function (ecModel, api) { this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay'); this._orient = this._model.get('orient'); this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0; this._rangeInfo = this._getRangeInfo(this._initRangeOption()); var weeks = this._rangeInfo.weeks || 1; var whNames = ['width', 'height']; var cellSize = this._model.get('cellSize').slice(); var layoutParams = this._model.getBoxLayoutParams(); var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks]; each$1([0, 1], function (idx) { if (cellSizeSpecified(cellSize, idx)) { layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx]; } }); var whGlobal = { width: api.getWidth(), height: api.getHeight() }; var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal); each$1([0, 1], function (idx) { if (!cellSizeSpecified(cellSize, idx)) { cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx]; } }); function cellSizeSpecified(cellSize, idx) { return cellSize[idx] != null && cellSize[idx] !== 'auto'; } this._sw = cellSize[0]; this._sh = cellSize[1]; }, /** * Convert a time data(time, value) item to (x, y) point. * * @override * @param {Array|number} data data * @param {boolean} [clamp=true] out of range * @return {Array} point */ dataToPoint: function (data, clamp) { isArray(data) && (data = data[0]); clamp == null && (clamp = true); var dayInfo = this.getDateInfo(data); var range = this._rangeInfo; var date = dayInfo.formatedDate; // if not in range return [NaN, NaN] if (clamp && !( dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY )) { return [NaN, NaN]; } var week = dayInfo.day; var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek; if (this._orient === 'vertical') { return [ this._rect.x + week * this._sw + this._sw / 2, this._rect.y + nthWeek * this._sh + this._sh / 2 ]; } return [ this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2 ]; }, /** * Convert a (x, y) point to time data * * @override * @param {string} point point * @return {string} data */ pointToData: function (point) { var date = this.pointToDate(point); return date && date.time; }, /** * Convert a time date item to (x, y) four point. * * @param {Array} data date[0] is date * @param {boolean} [clamp=true] out of range * @return {Object} point */ dataToRect: function (data, clamp) { var point = this.dataToPoint(data, clamp); return { contentShape: { x: point[0] - (this._sw - this._lineWidth) / 2, y: point[1] - (this._sh - this._lineWidth) / 2, width: this._sw - this._lineWidth, height: this._sh - this._lineWidth }, center: point, tl: [ point[0] - this._sw / 2, point[1] - this._sh / 2 ], tr: [ point[0] + this._sw / 2, point[1] - this._sh / 2 ], br: [ point[0] + this._sw / 2, point[1] + this._sh / 2 ], bl: [ point[0] - this._sw / 2, point[1] + this._sh / 2 ] }; }, /** * Convert a (x, y) point to time date * * @param {Array} point point * @return {Object} date */ pointToDate: function (point) { var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1; var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1; var range = this._rangeInfo.range; if (this._orient === 'vertical') { return this._getDateByWeeksAndDay(nthY, nthX - 1, range); } return this._getDateByWeeksAndDay(nthX, nthY - 1, range); }, /** * @inheritDoc */ convertToPixel: curry(doConvert$2, 'dataToPoint'), /** * @inheritDoc */ convertFromPixel: curry(doConvert$2, 'pointToData'), /** * initRange * * @private * @return {Array} [start, end] */ _initRangeOption: function () { var range = this._model.get('range'); var rg = range; if (isArray(rg) && rg.length === 1) { rg = rg[0]; } if (/^\d{4}$/.test(rg)) { range = [rg + '-01-01', rg + '-12-31']; } if (/^\d{4}[\/|-]\d{1,2}$/.test(rg)) { var start = this.getDateInfo(rg); var firstDay = start.date; firstDay.setMonth(firstDay.getMonth() + 1); var end = this.getNextNDay(firstDay, -1); range = [start.formatedDate, end.formatedDate]; } if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rg)) { range = [rg, rg]; } var tmp = this._getRangeInfo(range); if (tmp.start.time > tmp.end.time) { range.reverse(); } return range; }, /** * range info * * @private * @param {Array} range range ['2017-01-01', '2017-07-08'] * If range[0] > range[1], they will not be reversed. * @return {Object} obj */ _getRangeInfo: function (range) { range = [ this.getDateInfo(range[0]), this.getDateInfo(range[1]) ]; var reversed; if (range[0].time > range[1].time) { reversed = true; range.reverse(); } var allDay = Math.floor(range[1].time / PROXIMATE_ONE_DAY) - Math.floor(range[0].time / PROXIMATE_ONE_DAY) + 1; // Consider case: // Firstly set system timezone as "Time Zone: America/Toronto", // ``` // var first = new Date(1478412000000 - 3600 * 1000 * 2.5); // var second = new Date(1478412000000); // var allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1; // ``` // will get wrong result because of DST. So we should fix it. var date = new Date(range[0].time); var startDateNum = date.getDate(); var endDateNum = range[1].date.getDate(); date.setDate(startDateNum + allDay - 1); // The bias can not over a month, so just compare date. if (date.getDate() !== endDateNum) { var sign = date.getTime() - range[1].time > 0 ? 1 : -1; while (date.getDate() !== endDateNum && (date.getTime() - range[1].time) * sign > 0) { allDay -= sign; date.setDate(startDateNum + allDay - 1); } } var weeks = Math.floor((allDay + range[0].day + 6) / 7); var nthWeek = reversed ? -weeks + 1: weeks - 1; reversed && range.reverse(); return { range: [range[0].formatedDate, range[1].formatedDate], start: range[0], end: range[1], allDay: allDay, weeks: weeks, // From 0. nthWeek: nthWeek, fweek: range[0].day, lweek: range[1].day }; }, /** * get date by nthWeeks and week day in range * * @private * @param {number} nthWeek the week * @param {number} day the week day * @param {Array} range [d1, d2] * @return {Object} */ _getDateByWeeksAndDay: function (nthWeek, day, range) { var rangeInfo = this._getRangeInfo(range); if (nthWeek > rangeInfo.weeks || (nthWeek === 0 && day < rangeInfo.fweek) || (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) ) { return false; } var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day; var date = new Date(rangeInfo.start.time); date.setDate(rangeInfo.start.d + nthDay); return this.getDateInfo(date); } }; Calendar.dimensions = Calendar.prototype.dimensions; Calendar.getDimensionsInfo = Calendar.prototype.getDimensionsInfo; Calendar.create = function (ecModel, api) { var calendarList = []; ecModel.eachComponent('calendar', function (calendarModel) { var calendar = new Calendar(calendarModel, ecModel, api); calendarList.push(calendar); calendarModel.coordinateSystem = calendar; }); ecModel.eachSeries(function (calendarSeries) { if (calendarSeries.get('coordinateSystem') === 'calendar') { // Inject coordinate system calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0]; } }); return calendarList; }; function doConvert$2(methodName, ecModel, finder, value) { var calendarModel = finder.calendarModel; var seriesModel = finder.seriesModel; var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null; return coordSys === this ? coordSys[methodName](value) : null; } CoordinateSystemManager.register('calendar', Calendar); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var CalendarModel = ComponentModel.extend({ type: 'calendar', /** * @type {module:echarts/coord/calendar/Calendar} */ coordinateSystem: null, defaultOption: { zlevel: 0, z: 2, left: 80, top: 60, cellSize: 20, // horizontal vertical orient: 'horizontal', // month separate line style splitLine: { show: true, lineStyle: { color: '#000', width: 1, type: 'solid' } }, // rect style temporarily unused emphasis itemStyle: { color: '#fff', borderWidth: 1, borderColor: '#ccc' }, // week text style dayLabel: { show: true, // a week first day firstDay: 0, // start end position: 'start', margin: '50%', // 50% of cellSize nameMap: 'en', color: '#000' }, // month text style monthLabel: { show: true, // start end position: 'start', margin: 5, // center or left align: 'center', // cn en [] nameMap: 'en', formatter: null, color: '#000' }, // year text style yearLabel: { show: true, // top bottom left right position: null, margin: 30, formatter: null, color: '#ccc', fontFamily: 'sans-serif', fontWeight: 'bolder', fontSize: 20 } }, /** * @override */ init: function (option, parentModel, ecModel, extraOpt) { var inputPositionParams = getLayoutParams(option); CalendarModel.superApply(this, 'init', arguments); mergeAndNormalizeLayoutParams$1(option, inputPositionParams); }, /** * @override */ mergeOption: function (option, extraOpt) { CalendarModel.superApply(this, 'mergeOption', arguments); mergeAndNormalizeLayoutParams$1(this.option, option); } }); function mergeAndNormalizeLayoutParams$1(target, raw) { // Normalize cellSize var cellSize = target.cellSize; if (!isArray(cellSize)) { cellSize = target.cellSize = [cellSize, cellSize]; } else if (cellSize.length === 1) { cellSize[1] = cellSize[0]; } var ignoreSize = map([0, 1], function (hvIdx) { // If user have set `width` or both `left` and `right`, cellSize // will be automatically set to 'auto', otherwise the default // setting of cellSize will make `width` setting not work. if (sizeCalculable(raw, hvIdx)) { cellSize[hvIdx] = 'auto'; } return cellSize[hvIdx] != null && cellSize[hvIdx] !== 'auto'; }); mergeLayoutParam(target, raw, { type: 'box', ignoreSize: ignoreSize }); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var MONTH_TEXT = { EN: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ], CN: [ '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月' ] }; var WEEK_TEXT = { EN: ['S', 'M', 'T', 'W', 'T', 'F', 'S'], CN: ['日', '一', '二', '三', '四', '五', '六'] }; extendComponentView({ type: 'calendar', /** * top/left line points * @private */ _tlpoints: null, /** * bottom/right line points * @private */ _blpoints: null, /** * first day of month * @private */ _firstDayOfMonth: null, /** * first day point of month * @private */ _firstDayPoints: null, render: function (calendarModel, ecModel, api) { var group = this.group; group.removeAll(); var coordSys = calendarModel.coordinateSystem; // range info var rangeData = coordSys.getRangeInfo(); var orient = coordSys.getOrient(); this._renderDayRect(calendarModel, rangeData, group); // _renderLines must be called prior to following function this._renderLines(calendarModel, rangeData, orient, group); this._renderYearText(calendarModel, rangeData, orient, group); this._renderMonthText(calendarModel, orient, group); this._renderWeekText(calendarModel, rangeData, orient, group); }, // render day rect _renderDayRect: function (calendarModel, rangeData, group) { var coordSys = calendarModel.coordinateSystem; var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle(); var sw = coordSys.getCellWidth(); var sh = coordSys.getCellHeight(); for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time ) { var point = coordSys.dataToRect([i], false).tl; // every rect var rect = new Rect({ shape: { x: point[0], y: point[1], width: sw, height: sh }, cursor: 'default', style: itemRectStyleModel }); group.add(rect); } }, // render separate line _renderLines: function (calendarModel, rangeData, orient, group) { var self = this; var coordSys = calendarModel.coordinateSystem; var lineStyleModel = calendarModel.getModel('splitLine.lineStyle').getLineStyle(); var show = calendarModel.get('splitLine.show'); var lineWidth = lineStyleModel.lineWidth; this._tlpoints = []; this._blpoints = []; this._firstDayOfMonth = []; this._firstDayPoints = []; var firstDay = rangeData.start; for (var i = 0; firstDay.time <= rangeData.end.time; i++) { addPoints(firstDay.formatedDate); if (i === 0) { firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m); } var date = firstDay.date; date.setMonth(date.getMonth() + 1); firstDay = coordSys.getDateInfo(date); } addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate); function addPoints(date) { self._firstDayOfMonth.push(coordSys.getDateInfo(date)); self._firstDayPoints.push(coordSys.dataToRect([date], false).tl); var points = self._getLinePointsOfOneWeek(calendarModel, date, orient); self._tlpoints.push(points[0]); self._blpoints.push(points[points.length - 1]); show && self._drawSplitline(points, lineStyleModel, group); } // render top/left line show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group); // render bottom/right line show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group); }, // get points at both ends _getEdgesPoints: function (points, lineWidth, orient) { var rs = [points[0].slice(), points[points.length - 1].slice()]; var idx = orient === 'horizontal' ? 0 : 1; // both ends of the line are extend half lineWidth rs[0][idx] = rs[0][idx] - lineWidth / 2; rs[1][idx] = rs[1][idx] + lineWidth / 2; return rs; }, // render split line _drawSplitline: function (points, lineStyleModel, group) { var poyline = new Polyline({ z2: 20, shape: { points: points }, style: lineStyleModel }); group.add(poyline); }, // render month line of one week points _getLinePointsOfOneWeek: function (calendarModel, date, orient) { var coordSys = calendarModel.coordinateSystem; date = coordSys.getDateInfo(date); var points = []; for (var i = 0; i < 7; i++) { var tmpD = coordSys.getNextNDay(date.time, i); var point = coordSys.dataToRect([tmpD.time], false); points[2 * tmpD.day] = point.tl; points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr']; } return points; }, _formatterLabel: function (formatter, params) { if (typeof formatter === 'string' && formatter) { return formatTplSimple(formatter, params); } if (typeof formatter === 'function') { return formatter(params); } return params.nameMap; }, _yearTextPositionControl: function (textEl, point, orient, position, margin) { point = point.slice(); var aligns = ['center', 'bottom']; if (position === 'bottom') { point[1] += margin; aligns = ['center', 'top']; } else if (position === 'left') { point[0] -= margin; } else if (position === 'right') { point[0] += margin; aligns = ['center', 'top']; } else { // top point[1] -= margin; } var rotate = 0; if (position === 'left' || position === 'right') { rotate = Math.PI / 2; } return { rotation: rotate, position: point, style: { textAlign: aligns[0], textVerticalAlign: aligns[1] } }; }, // render year _renderYearText: function (calendarModel, rangeData, orient, group) { var yearLabel = calendarModel.getModel('yearLabel'); if (!yearLabel.get('show')) { return; } var margin = yearLabel.get('margin'); var pos = yearLabel.get('position'); if (!pos) { pos = orient !== 'horizontal' ? 'top' : 'left'; } var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]]; var xc = (points[0][0] + points[1][0]) / 2; var yc = (points[0][1] + points[1][1]) / 2; var idx = orient === 'horizontal' ? 0 : 1; var posPoints = { top: [xc, points[idx][1]], bottom: [xc, points[1 - idx][1]], left: [points[1 - idx][0], yc], right: [points[idx][0], yc] }; var name = rangeData.start.y; if (+rangeData.end.y > +rangeData.start.y) { name = name + '-' + rangeData.end.y; } var formatter = yearLabel.get('formatter'); var params = { start: rangeData.start.y, end: rangeData.end.y, nameMap: name }; var content = this._formatterLabel(formatter, params); var yearText = new Text({z2: 30}); setTextStyle(yearText.style, yearLabel, {text: content}), yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin)); group.add(yearText); }, _monthTextPositionControl: function (point, isCenter, orient, position, margin) { var align = 'left'; var vAlign = 'top'; var x = point[0]; var y = point[1]; if (orient === 'horizontal') { y = y + margin; if (isCenter) { align = 'center'; } if (position === 'start') { vAlign = 'bottom'; } } else { x = x + margin; if (isCenter) { vAlign = 'middle'; } if (position === 'start') { align = 'right'; } } return { x: x, y: y, textAlign: align, textVerticalAlign: vAlign }; }, // render month and year text _renderMonthText: function (calendarModel, orient, group) { var monthLabel = calendarModel.getModel('monthLabel'); if (!monthLabel.get('show')) { return; } var nameMap = monthLabel.get('nameMap'); var margin = monthLabel.get('margin'); var pos = monthLabel.get('position'); var align = monthLabel.get('align'); var termPoints = [this._tlpoints, this._blpoints]; if (isString(nameMap)) { nameMap = MONTH_TEXT[nameMap.toUpperCase()] || []; } var idx = pos === 'start' ? 0 : 1; var axis = orient === 'horizontal' ? 0 : 1; margin = pos === 'start' ? -margin : margin; var isCenter = (align === 'center'); for (var i = 0; i < termPoints[idx].length - 1; i++) { var tmp = termPoints[idx][i].slice(); var firstDay = this._firstDayOfMonth[i]; if (isCenter) { var firstDayPoints = this._firstDayPoints[i]; tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2; } var formatter = monthLabel.get('formatter'); var name = nameMap[+firstDay.m - 1]; var params = { yyyy: firstDay.y, yy: (firstDay.y + '').slice(2), MM: firstDay.m, M: +firstDay.m, nameMap: name }; var content = this._formatterLabel(formatter, params); var monthText = new Text({z2: 30}); extend( setTextStyle(monthText.style, monthLabel, {text: content}), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin) ); group.add(monthText); } }, _weekTextPositionControl: function (point, orient, position, margin, cellSize) { var align = 'center'; var vAlign = 'middle'; var x = point[0]; var y = point[1]; var isStart = position === 'start'; if (orient === 'horizontal') { x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2; align = isStart ? 'right' : 'left'; } else { y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2; vAlign = isStart ? 'bottom' : 'top'; } return { x: x, y: y, textAlign: align, textVerticalAlign: vAlign }; }, // render weeks _renderWeekText: function (calendarModel, rangeData, orient, group) { var dayLabel = calendarModel.getModel('dayLabel'); if (!dayLabel.get('show')) { return; } var coordSys = calendarModel.coordinateSystem; var pos = dayLabel.get('position'); var nameMap = dayLabel.get('nameMap'); var margin = dayLabel.get('margin'); var firstDayOfWeek = coordSys.getFirstDayOfWeek(); if (isString(nameMap)) { nameMap = WEEK_TEXT[nameMap.toUpperCase()] || []; } var start = coordSys.getNextNDay( rangeData.end.time, (7 - rangeData.lweek) ).time; var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()]; margin = parsePercent$1(margin, cellSize[orient === 'horizontal' ? 0 : 1]); if (pos === 'start') { start = coordSys.getNextNDay( rangeData.start.time, -(7 + rangeData.fweek) ).time; margin = -margin; } for (var i = 0; i < 7; i++) { var tmpD = coordSys.getNextNDay(start, i); var point = coordSys.dataToRect([tmpD.time], false).center; var day = i; day = Math.abs((i + firstDayOfWeek) % 7); var weekText = new Text({z2: 30}); extend( setTextStyle(weekText.style, dayLabel, {text: nameMap[day]}), this._weekTextPositionControl(point, orient, pos, margin, cellSize) ); group.add(weekText); } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file calendar.js * @author dxh */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Model extendComponentModel({ type: 'title', layoutMode: {type: 'box', ignoreSize: true}, defaultOption: { // 一级层叠 zlevel: 0, // 二级层叠 z: 6, show: true, text: '', // 超链接跳转 // link: null, // 仅支持self | blank target: 'blank', subtext: '', // 超链接跳转 // sublink: null, // 仅支持self | blank subtarget: 'blank', // 'center' ¦ 'left' ¦ 'right' // ¦ {number}(x坐标,单位px) left: 0, // 'top' ¦ 'bottom' ¦ 'center' // ¦ {number}(y坐标,单位px) top: 0, // 水平对齐 // 'auto' | 'left' | 'right' | 'center' // 默认根据 left 的位置判断是左对齐还是右对齐 // textAlign: null // // 垂直对齐 // 'auto' | 'top' | 'bottom' | 'middle' // 默认根据 top 位置判断是上对齐还是下对齐 // textBaseline: null backgroundColor: 'rgba(0,0,0,0)', // 标题边框颜色 borderColor: '#ccc', // 标题边框线宽,单位px,默认为0(无边框) borderWidth: 0, // 标题内边距,单位px,默认各方向内边距为5, // 接受数组分别设定上右下左边距,同css padding: 5, // 主副标题纵向间隔,单位px,默认为10, itemGap: 10, textStyle: { fontSize: 18, fontWeight: 'bolder', color: '#333' }, subtextStyle: { color: '#aaa' } } }); // View extendComponentView({ type: 'title', render: function (titleModel, ecModel, api) { this.group.removeAll(); if (!titleModel.get('show')) { return; } var group = this.group; var textStyleModel = titleModel.getModel('textStyle'); var subtextStyleModel = titleModel.getModel('subtextStyle'); var textAlign = titleModel.get('textAlign'); var textBaseline = titleModel.get('textBaseline'); var textEl = new Text({ style: setTextStyle({}, textStyleModel, { text: titleModel.get('text'), textFill: textStyleModel.getTextColor() }, {disableBox: true}), z2: 10 }); var textRect = textEl.getBoundingRect(); var subText = titleModel.get('subtext'); var subTextEl = new Text({ style: setTextStyle({}, subtextStyleModel, { text: subText, textFill: subtextStyleModel.getTextColor(), y: textRect.height + titleModel.get('itemGap'), textVerticalAlign: 'top' }, {disableBox: true}), z2: 10 }); var link = titleModel.get('link'); var sublink = titleModel.get('sublink'); textEl.silent = !link; subTextEl.silent = !sublink; if (link) { textEl.on('click', function () { window.open(link, '_' + titleModel.get('target')); }); } if (sublink) { subTextEl.on('click', function () { window.open(sublink, '_' + titleModel.get('subtarget')); }); } group.add(textEl); subText && group.add(subTextEl); // If no subText, but add subTextEl, there will be an empty line. var groupRect = group.getBoundingRect(); var layoutOption = titleModel.getBoxLayoutParams(); layoutOption.width = groupRect.width; layoutOption.height = groupRect.height; var layoutRect = getLayoutRect( layoutOption, { width: api.getWidth(), height: api.getHeight() }, titleModel.get('padding') ); // Adjust text align based on position if (!textAlign) { // Align left if title is on the left. center and right is same textAlign = titleModel.get('left') || titleModel.get('right'); if (textAlign === 'middle') { textAlign = 'center'; } // Adjust layout by text align if (textAlign === 'right') { layoutRect.x += layoutRect.width; } else if (textAlign === 'center') { layoutRect.x += layoutRect.width / 2; } } if (!textBaseline) { textBaseline = titleModel.get('top') || titleModel.get('bottom'); if (textBaseline === 'center') { textBaseline = 'middle'; } if (textBaseline === 'bottom') { layoutRect.y += layoutRect.height; } else if (textBaseline === 'middle') { layoutRect.y += layoutRect.height / 2; } textBaseline = textBaseline || 'top'; } group.attr('position', [layoutRect.x, layoutRect.y]); var alignStyle = { textAlign: textAlign, textVerticalAlign: textBaseline }; textEl.setStyle(alignStyle); subTextEl.setStyle(alignStyle); // Render background // Get groupRect again because textAlign has been changed groupRect = group.getBoundingRect(); var padding = layoutRect.margin; var style = titleModel.getItemStyle(['color', 'opacity']); style.fill = titleModel.get('backgroundColor'); var rect = new Rect({ shape: { x: groupRect.x - padding[3], y: groupRect.y - padding[0], width: groupRect.width + padding[1] + padding[3], height: groupRect.height + padding[0] + padding[2], r: titleModel.get('borderRadius') }, style: style, silent: true }); subPixelOptimizeRect(rect); group.add(rect); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ ComponentModel.registerSubTypeDefaulter('dataZoom', function () { // Default 'slider' when no type specified. return 'slider'; }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var AXIS_DIMS = ['x', 'y', 'z', 'radius', 'angle', 'single']; // Supported coords. var COORDS = ['cartesian2d', 'polar', 'singleAxis']; /** * @param {string} coordType * @return {boolean} */ function isCoordSupported(coordType) { return indexOf(COORDS, coordType) >= 0; } /** * Create "each" method to iterate names. * * @pubilc * @param {Array.} names * @param {Array.=} attrs * @return {Function} */ function createNameEach(names, attrs) { names = names.slice(); var capitalNames = map(names, capitalFirst); attrs = (attrs || []).slice(); var capitalAttrs = map(attrs, capitalFirst); return function (callback, context) { each$1(names, function (name, index) { var nameObj = {name: name, capital: capitalNames[index]}; for (var j = 0; j < attrs.length; j++) { nameObj[attrs[j]] = name + capitalAttrs[j]; } callback.call(context, nameObj); }); }; } /** * Iterate each dimension name. * * @public * @param {Function} callback The parameter is like: * { * name: 'angle', * capital: 'Angle', * axis: 'angleAxis', * axisIndex: 'angleAixs', * index: 'angleIndex' * } * @param {Object} context */ var eachAxisDim$1 = createNameEach(AXIS_DIMS, ['axisIndex', 'axis', 'index', 'id']); /** * If tow dataZoomModels has the same axis controlled, we say that they are 'linked'. * dataZoomModels and 'links' make up one or more graphics. * This function finds the graphic where the source dataZoomModel is in. * * @public * @param {Function} forEachNode Node iterator. * @param {Function} forEachEdgeType edgeType iterator * @param {Function} edgeIdGetter Giving node and edgeType, return an array of edge id. * @return {Function} Input: sourceNode, Output: Like {nodes: [], dims: {}} */ function createLinkedNodesFinder(forEachNode, forEachEdgeType, edgeIdGetter) { return function (sourceNode) { var result = { nodes: [], records: {} // key: edgeType.name, value: Object (key: edge id, value: boolean). }; forEachEdgeType(function (edgeType) { result.records[edgeType.name] = {}; }); if (!sourceNode) { return result; } absorb(sourceNode, result); var existsLink; do { existsLink = false; forEachNode(processSingleNode); } while (existsLink); function processSingleNode(node) { if (!isNodeAbsorded(node, result) && isLinked(node, result)) { absorb(node, result); existsLink = true; } } return result; }; function isNodeAbsorded(node, result) { return indexOf(result.nodes, node) >= 0; } function isLinked(node, result) { var hasLink = false; forEachEdgeType(function (edgeType) { each$1(edgeIdGetter(node, edgeType) || [], function (edgeId) { result.records[edgeType.name][edgeId] && (hasLink = true); }); }); return hasLink; } function absorb(node, result) { result.nodes.push(node); forEachEdgeType(function (edgeType) { each$1(edgeIdGetter(node, edgeType) || [], function (edgeId) { result.records[edgeType.name][edgeId] = true; }); }); } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$22 = each$1; var asc$1 = asc; /** * Operate single axis. * One axis can only operated by one axis operator. * Different dataZoomModels may be defined to operate the same axis. * (i.e. 'inside' data zoom and 'slider' data zoom components) * So dataZoomModels share one axisProxy in that case. * * @class */ var AxisProxy = function (dimName, axisIndex, dataZoomModel, ecModel) { /** * @private * @type {string} */ this._dimName = dimName; /** * @private */ this._axisIndex = axisIndex; /** * @private * @type {Array.} */ this._valueWindow; /** * @private * @type {Array.} */ this._percentWindow; /** * @private * @type {Array.} */ this._dataExtent; /** * {minSpan, maxSpan, minValueSpan, maxValueSpan} * @private * @type {Object} */ this._minMaxSpan; /** * @readOnly * @type {module: echarts/model/Global} */ this.ecModel = ecModel; /** * @private * @type {module: echarts/component/dataZoom/DataZoomModel} */ this._dataZoomModel = dataZoomModel; // /** // * @readOnly // * @private // */ // this.hasSeriesStacked; }; AxisProxy.prototype = { constructor: AxisProxy, /** * Whether the axisProxy is hosted by dataZoomModel. * * @public * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel * @return {boolean} */ hostedBy: function (dataZoomModel) { return this._dataZoomModel === dataZoomModel; }, /** * @return {Array.} Value can only be NaN or finite value. */ getDataValueWindow: function () { return this._valueWindow.slice(); }, /** * @return {Array.} */ getDataPercentWindow: function () { return this._percentWindow.slice(); }, /** * @public * @param {number} axisIndex * @return {Array} seriesModels */ getTargetSeriesModels: function () { var seriesModels = []; var ecModel = this.ecModel; ecModel.eachSeries(function (seriesModel) { if (isCoordSupported(seriesModel.get('coordinateSystem'))) { var dimName = this._dimName; var axisModel = ecModel.queryComponents({ mainType: dimName + 'Axis', index: seriesModel.get(dimName + 'AxisIndex'), id: seriesModel.get(dimName + 'AxisId') })[0]; if (this._axisIndex === (axisModel && axisModel.componentIndex)) { seriesModels.push(seriesModel); } } }, this); return seriesModels; }, getAxisModel: function () { return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex); }, getOtherAxisModel: function () { var axisDim = this._dimName; var ecModel = this.ecModel; var axisModel = this.getAxisModel(); var isCartesian = axisDim === 'x' || axisDim === 'y'; var otherAxisDim; var coordSysIndexName; if (isCartesian) { coordSysIndexName = 'gridIndex'; otherAxisDim = axisDim === 'x' ? 'y' : 'x'; } else { coordSysIndexName = 'polarIndex'; otherAxisDim = axisDim === 'angle' ? 'radius' : 'angle'; } var foundOtherAxisModel; ecModel.eachComponent(otherAxisDim + 'Axis', function (otherAxisModel) { if ((otherAxisModel.get(coordSysIndexName) || 0) === (axisModel.get(coordSysIndexName) || 0) ) { foundOtherAxisModel = otherAxisModel; } }); return foundOtherAxisModel; }, getMinMaxSpan: function () { return clone(this._minMaxSpan); }, /** * Only calculate by given range and this._dataExtent, do not change anything. * * @param {Object} opt * @param {number} [opt.start] * @param {number} [opt.end] * @param {number} [opt.startValue] * @param {number} [opt.endValue] */ calculateDataWindow: function (opt) { var dataExtent = this._dataExtent; var axisModel = this.getAxisModel(); var scale = axisModel.axis.scale; var rangePropMode = this._dataZoomModel.getRangePropMode(); var percentExtent = [0, 100]; var percentWindow = [ opt.start, opt.end ]; var valueWindow = []; each$22(['startValue', 'endValue'], function (prop) { valueWindow.push(opt[prop] != null ? scale.parse(opt[prop]) : null); }); // Normalize bound. each$22([0, 1], function (idx) { var boundValue = valueWindow[idx]; var boundPercent = percentWindow[idx]; // Notice: dataZoom is based either on `percentProp` ('start', 'end') or // on `valueProp` ('startValue', 'endValue'). The former one is suitable // for cases that a dataZoom component controls multiple axes with different // unit or extent, and the latter one is suitable for accurate zoom by pixel // (e.g., in dataZoomSelect). `valueProp` can be calculated from `percentProp`, // but it is awkward that `percentProp` can not be obtained from `valueProp` // accurately (because all of values that are overflow the `dataExtent` will // be calculated to percent '100%'). So we have to use // `dataZoom.getRangePropMode()` to mark which prop is used. // `rangePropMode` is updated only when setOption or dispatchAction, otherwise // it remains its original value. if (rangePropMode[idx] === 'percent') { if (boundPercent == null) { boundPercent = percentExtent[idx]; } // Use scale.parse to math round for category or time axis. boundValue = scale.parse(linearMap( boundPercent, percentExtent, dataExtent, true )); } else { // Calculating `percent` from `value` may be not accurate, because // This calculation can not be inversed, because all of values that // are overflow the `dataExtent` will be calculated to percent '100%' boundPercent = linearMap( boundValue, dataExtent, percentExtent, true ); } // valueWindow[idx] = round(boundValue); // percentWindow[idx] = round(boundPercent); valueWindow[idx] = boundValue; percentWindow[idx] = boundPercent; }); return { valueWindow: asc$1(valueWindow), percentWindow: asc$1(percentWindow) }; }, /** * Notice: reset should not be called before series.restoreData() called, * so it is recommanded to be called in "process stage" but not "model init * stage". * * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel */ reset: function (dataZoomModel) { if (dataZoomModel !== this._dataZoomModel) { return; } var targetSeries = this.getTargetSeriesModels(); // Culculate data window and data extent, and record them. this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries); // this.hasSeriesStacked = false; // each(targetSeries, function (series) { // var data = series.getData(); // var dataDim = data.mapDimension(this._dimName); // var stackedDimension = data.getCalculationInfo('stackedDimension'); // if (stackedDimension && stackedDimension === dataDim) { // this.hasSeriesStacked = true; // } // }, this); var dataWindow = this.calculateDataWindow(dataZoomModel.option); this._valueWindow = dataWindow.valueWindow; this._percentWindow = dataWindow.percentWindow; setMinMaxSpan(this); // Update axis setting then. setAxisModel(this); }, /** * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel */ restore: function (dataZoomModel) { if (dataZoomModel !== this._dataZoomModel) { return; } this._valueWindow = this._percentWindow = null; setAxisModel(this, true); }, /** * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel */ filterData: function (dataZoomModel, api) { if (dataZoomModel !== this._dataZoomModel) { return; } var axisDim = this._dimName; var seriesModels = this.getTargetSeriesModels(); var filterMode = dataZoomModel.get('filterMode'); var valueWindow = this._valueWindow; if (filterMode === 'none') { return; } // FIXME // Toolbox may has dataZoom injected. And if there are stacked bar chart // with NaN data, NaN will be filtered and stack will be wrong. // So we need to force the mode to be set empty. // In fect, it is not a big deal that do not support filterMode-'filter' // when using toolbox#dataZoom, utill tooltip#dataZoom support "single axis // selection" some day, which might need "adapt to data extent on the // otherAxis", which is disabled by filterMode-'empty'. // But currently, stack has been fixed to based on value but not index, // so this is not an issue any more. // var otherAxisModel = this.getOtherAxisModel(); // if (dataZoomModel.get('$fromToolbox') // && otherAxisModel // && otherAxisModel.hasSeriesStacked // ) { // filterMode = 'empty'; // } // TODO // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet. // Process series data each$22(seriesModels, function (seriesModel) { var seriesData = seriesModel.getData(); var dataDims = seriesData.mapDimension(axisDim, true); if (filterMode === 'weakFilter') { seriesData.filterSelf(function (dataIndex) { var leftOut; var rightOut; var hasValue; for (var i = 0; i < dataDims.length; i++) { var value = seriesData.get(dataDims[i], dataIndex); var thisHasValue = !isNaN(value); var thisLeftOut = value < valueWindow[0]; var thisRightOut = value > valueWindow[1]; if (thisHasValue && !thisLeftOut && !thisRightOut) { return true; } thisHasValue && (hasValue = true); thisLeftOut && (leftOut = true); thisRightOut && (rightOut = true); } // If both left out and right out, do not filter. return hasValue && leftOut && rightOut; }); } else { each$22(dataDims, function (dim) { if (filterMode === 'empty') { seriesModel.setData( seriesData.map(dim, function (value) { return !isInWindow(value) ? NaN : value; }) ); } else { var range = {}; range[dim] = valueWindow; // console.time('select'); seriesData.selectRange(range); // console.timeEnd('select'); } }); } each$22(dataDims, function (dim) { seriesData.setApproximateExtent(valueWindow, dim); }); }); function isInWindow(value) { return value >= valueWindow[0] && value <= valueWindow[1]; } } }; function calculateDataExtent(axisProxy, axisDim, seriesModels) { var dataExtent = [Infinity, -Infinity]; each$22(seriesModels, function (seriesModel) { var seriesData = seriesModel.getData(); if (seriesData) { each$22(seriesData.mapDimension(axisDim, true), function (dim) { var seriesExtent = seriesData.getApproximateExtent(dim); seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]); seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]); }); } }); if (dataExtent[1] < dataExtent[0]) { dataExtent = [NaN, NaN]; } // It is important to get "consistent" extent when more then one axes is // controlled by a `dataZoom`, otherwise those axes will not be synchronized // when zooming. But it is difficult to know what is "consistent", considering // axes have different type or even different meanings (For example, two // time axes are used to compare data of the same date in different years). // So basically dataZoom just obtains extent by series.data (in category axis // extent can be obtained from axis.data). // Nevertheless, user can set min/max/scale on axes to make extent of axes // consistent. fixExtentByAxis(axisProxy, dataExtent); return dataExtent; } function fixExtentByAxis(axisProxy, dataExtent) { var axisModel = axisProxy.getAxisModel(); var min = axisModel.getMin(true); // For category axis, if min/max/scale are not set, extent is determined // by axis.data by default. var isCategoryAxis = axisModel.get('type') === 'category'; var axisDataLen = isCategoryAxis && axisModel.getCategories().length; if (min != null && min !== 'dataMin' && typeof min !== 'function') { dataExtent[0] = min; } else if (isCategoryAxis) { dataExtent[0] = axisDataLen > 0 ? 0 : NaN; } var max = axisModel.getMax(true); if (max != null && max !== 'dataMax' && typeof max !== 'function') { dataExtent[1] = max; } else if (isCategoryAxis) { dataExtent[1] = axisDataLen > 0 ? axisDataLen - 1 : NaN; } if (!axisModel.get('scale', true)) { dataExtent[0] > 0 && (dataExtent[0] = 0); dataExtent[1] < 0 && (dataExtent[1] = 0); } // For value axis, if min/max/scale are not set, we just use the extent obtained // by series data, which may be a little different from the extent calculated by // `axisHelper.getScaleExtent`. But the different just affects the experience a // little when zooming. So it will not be fixed until some users require it strongly. return dataExtent; } function setAxisModel(axisProxy, isRestore) { var axisModel = axisProxy.getAxisModel(); var percentWindow = axisProxy._percentWindow; var valueWindow = axisProxy._valueWindow; if (!percentWindow) { return; } // [0, 500]: arbitrary value, guess axis extent. var precision = getPixelPrecision(valueWindow, [0, 500]); precision = Math.min(precision, 20); // isRestore or isFull var useOrigin = isRestore || (percentWindow[0] === 0 && percentWindow[1] === 100); axisModel.setRange( useOrigin ? null : +valueWindow[0].toFixed(precision), useOrigin ? null : +valueWindow[1].toFixed(precision) ); } function setMinMaxSpan(axisProxy) { var minMaxSpan = axisProxy._minMaxSpan = {}; var dataZoomModel = axisProxy._dataZoomModel; each$22(['min', 'max'], function (minMax) { minMaxSpan[minMax + 'Span'] = dataZoomModel.get(minMax + 'Span'); // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan var valueSpan = dataZoomModel.get(minMax + 'ValueSpan'); if (valueSpan != null) { minMaxSpan[minMax + 'ValueSpan'] = valueSpan; valueSpan = axisProxy.getAxisModel().axis.scale.parse(valueSpan); if (valueSpan != null) { var dataExtent = axisProxy._dataExtent; minMaxSpan[minMax + 'Span'] = linearMap( dataExtent[0] + valueSpan, dataExtent, [0, 100], true ); } } }); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$21 = each$1; var eachAxisDim = eachAxisDim$1; var DataZoomModel = extendComponentModel({ type: 'dataZoom', dependencies: [ 'xAxis', 'yAxis', 'zAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series' ], /** * @protected */ defaultOption: { zlevel: 0, z: 4, // Higher than normal component (z: 2). orient: null, // Default auto by axisIndex. Possible value: 'horizontal', 'vertical'. xAxisIndex: null, // Default the first horizontal category axis. yAxisIndex: null, // Default the first vertical category axis. filterMode: 'filter', // Possible values: 'filter' or 'empty' or 'weakFilter'. // 'filter': data items which are out of window will be removed. This option is // applicable when filtering outliers. For each data item, it will be // filtered if one of the relevant dimensions is out of the window. // 'weakFilter': data items which are out of window will be removed. This option // is applicable when filtering outliers. For each data item, it will be // filtered only if all of the relevant dimensions are out of the same // side of the window. // 'empty': data items which are out of window will be set to empty. // This option is applicable when user should not neglect // that there are some data items out of window. // 'none': Do not filter. // Taking line chart as an example, line will be broken in // the filtered points when filterModel is set to 'empty', but // be connected when set to 'filter'. throttle: null, // Dispatch action by the fixed rate, avoid frequency. // default 100. Do not throttle when use null/undefined. // If animation === true and animationDurationUpdate > 0, // default value is 100, otherwise 20. start: 0, // Start percent. 0 ~ 100 end: 100, // End percent. 0 ~ 100 startValue: null, // Start value. If startValue specified, start is ignored. endValue: null, // End value. If endValue specified, end is ignored. minSpan: null, // 0 ~ 100 maxSpan: null, // 0 ~ 100 minValueSpan: null, // The range of dataZoom can not be smaller than that. maxValueSpan: null, // The range of dataZoom can not be larger than that. rangeMode: null // Array, can be 'value' or 'percent'. }, /** * @override */ init: function (option, parentModel, ecModel) { /** * key like x_0, y_1 * @private * @type {Object} */ this._dataIntervalByAxis = {}; /** * @private */ this._dataInfo = {}; /** * key like x_0, y_1 * @private */ this._axisProxies = {}; /** * @readOnly */ this.textStyleModel; /** * @private */ this._autoThrottle = true; /** * 'percent' or 'value' * @private */ this._rangePropMode = ['percent', 'percent']; var rawOption = retrieveRaw(option); this.mergeDefaultAndTheme(option, ecModel); this.doInit(rawOption); }, /** * @override */ mergeOption: function (newOption) { var rawOption = retrieveRaw(newOption); //FIX #2591 merge(this.option, newOption, true); this.doInit(rawOption); }, /** * @protected */ doInit: function (rawOption) { var thisOption = this.option; // Disable realtime view update if canvas is not supported. if (!env$1.canvasSupported) { thisOption.realtime = false; } this._setDefaultThrottle(rawOption); updateRangeUse(this, rawOption); each$21([['start', 'startValue'], ['end', 'endValue']], function (names, index) { // start/end has higher priority over startValue/endValue if they // both set, but we should make chart.setOption({endValue: 1000}) // effective, rather than chart.setOption({endValue: 1000, end: null}). if (this._rangePropMode[index] === 'value') { thisOption[names[0]] = null; } // Otherwise do nothing and use the merge result. }, this); this.textStyleModel = this.getModel('textStyle'); this._resetTarget(); this._giveAxisProxies(); }, /** * @private */ _giveAxisProxies: function () { var axisProxies = this._axisProxies; this.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel, ecModel) { var axisModel = this.dependentModels[dimNames.axis][axisIndex]; // If exists, share axisProxy with other dataZoomModels. var axisProxy = axisModel.__dzAxisProxy || ( // Use the first dataZoomModel as the main model of axisProxy. axisModel.__dzAxisProxy = new AxisProxy( dimNames.name, axisIndex, this, ecModel ) ); // FIXME // dispose __dzAxisProxy axisProxies[dimNames.name + '_' + axisIndex] = axisProxy; }, this); }, /** * @private */ _resetTarget: function () { var thisOption = this.option; var autoMode = this._judgeAutoMode(); eachAxisDim(function (dimNames) { var axisIndexName = dimNames.axisIndex; thisOption[axisIndexName] = normalizeToArray( thisOption[axisIndexName] ); }, this); if (autoMode === 'axisIndex') { this._autoSetAxisIndex(); } else if (autoMode === 'orient') { this._autoSetOrient(); } }, /** * @private */ _judgeAutoMode: function () { // Auto set only works for setOption at the first time. // The following is user's reponsibility. So using merged // option is OK. var thisOption = this.option; var hasIndexSpecified = false; eachAxisDim(function (dimNames) { // When user set axisIndex as a empty array, we think that user specify axisIndex // but do not want use auto mode. Because empty array may be encountered when // some error occured. if (thisOption[dimNames.axisIndex] != null) { hasIndexSpecified = true; } }, this); var orient = thisOption.orient; if (orient == null && hasIndexSpecified) { return 'orient'; } else if (!hasIndexSpecified) { if (orient == null) { thisOption.orient = 'horizontal'; } return 'axisIndex'; } }, /** * @private */ _autoSetAxisIndex: function () { var autoAxisIndex = true; var orient = this.get('orient', true); var thisOption = this.option; var dependentModels = this.dependentModels; if (autoAxisIndex) { // Find axis that parallel to dataZoom as default. var dimName = orient === 'vertical' ? 'y' : 'x'; if (dependentModels[dimName + 'Axis'].length) { thisOption[dimName + 'AxisIndex'] = [0]; autoAxisIndex = false; } else { each$21(dependentModels.singleAxis, function (singleAxisModel) { if (autoAxisIndex && singleAxisModel.get('orient', true) === orient) { thisOption.singleAxisIndex = [singleAxisModel.componentIndex]; autoAxisIndex = false; } }); } } if (autoAxisIndex) { // Find the first category axis as default. (consider polar) eachAxisDim(function (dimNames) { if (!autoAxisIndex) { return; } var axisIndices = []; var axisModels = this.dependentModels[dimNames.axis]; if (axisModels.length && !axisIndices.length) { for (var i = 0, len = axisModels.length; i < len; i++) { if (axisModels[i].get('type') === 'category') { axisIndices.push(i); } } } thisOption[dimNames.axisIndex] = axisIndices; if (axisIndices.length) { autoAxisIndex = false; } }, this); } if (autoAxisIndex) { // FIXME // 这里是兼容ec2的写法(没指定xAxisIndex和yAxisIndex时把scatter和双数值轴折柱纳入dataZoom控制), // 但是实际是否需要Grid.js#getScaleByOption来判断(考虑time,log等axis type)? // If both dataZoom.xAxisIndex and dataZoom.yAxisIndex is not specified, // dataZoom component auto adopts series that reference to // both xAxis and yAxis which type is 'value'. this.ecModel.eachSeries(function (seriesModel) { if (this._isSeriesHasAllAxesTypeOf(seriesModel, 'value')) { eachAxisDim(function (dimNames) { var axisIndices = thisOption[dimNames.axisIndex]; var axisIndex = seriesModel.get(dimNames.axisIndex); var axisId = seriesModel.get(dimNames.axisId); var axisModel = seriesModel.ecModel.queryComponents({ mainType: dimNames.axis, index: axisIndex, id: axisId })[0]; if (__DEV__) { if (!axisModel) { throw new Error( dimNames.axis + ' "' + retrieve( axisIndex, axisId, 0 ) + '" not found' ); } } axisIndex = axisModel.componentIndex; if (indexOf(axisIndices, axisIndex) < 0) { axisIndices.push(axisIndex); } }); } }, this); } }, /** * @private */ _autoSetOrient: function () { var dim; // Find the first axis this.eachTargetAxis(function (dimNames) { !dim && (dim = dimNames.name); }, this); this.option.orient = dim === 'y' ? 'vertical' : 'horizontal'; }, /** * @private */ _isSeriesHasAllAxesTypeOf: function (seriesModel, axisType) { // FIXME // 需要series的xAxisIndex和yAxisIndex都首先自动设置上。 // 例如series.type === scatter时。 var is = true; eachAxisDim(function (dimNames) { var seriesAxisIndex = seriesModel.get(dimNames.axisIndex); var axisModel = this.dependentModels[dimNames.axis][seriesAxisIndex]; if (!axisModel || axisModel.get('type') !== axisType) { is = false; } }, this); return is; }, /** * @private */ _setDefaultThrottle: function (rawOption) { // When first time user set throttle, auto throttle ends. if (rawOption.hasOwnProperty('throttle')) { this._autoThrottle = false; } if (this._autoThrottle) { var globalOption = this.ecModel.option; this.option.throttle = (globalOption.animation && globalOption.animationDurationUpdate > 0) ? 100 : 20; } }, /** * @public */ getFirstTargetAxisModel: function () { var firstAxisModel; eachAxisDim(function (dimNames) { if (firstAxisModel == null) { var indices = this.get(dimNames.axisIndex); if (indices.length) { firstAxisModel = this.dependentModels[dimNames.axis][indices[0]]; } } }, this); return firstAxisModel; }, /** * @public * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel */ eachTargetAxis: function (callback, context) { var ecModel = this.ecModel; eachAxisDim(function (dimNames) { each$21( this.get(dimNames.axisIndex), function (axisIndex) { callback.call(context, dimNames, axisIndex, this, ecModel); }, this ); }, this); }, /** * @param {string} dimName * @param {number} axisIndex * @return {module:echarts/component/dataZoom/AxisProxy} If not found, return null/undefined. */ getAxisProxy: function (dimName, axisIndex) { return this._axisProxies[dimName + '_' + axisIndex]; }, /** * @param {string} dimName * @param {number} axisIndex * @return {module:echarts/model/Model} If not found, return null/undefined. */ getAxisModel: function (dimName, axisIndex) { var axisProxy = this.getAxisProxy(dimName, axisIndex); return axisProxy && axisProxy.getAxisModel(); }, /** * If not specified, set to undefined. * * @public * @param {Object} opt * @param {number} [opt.start] * @param {number} [opt.end] * @param {number} [opt.startValue] * @param {number} [opt.endValue] * @param {boolean} [ignoreUpdateRangeUsg=false] */ setRawRange: function (opt, ignoreUpdateRangeUsg) { var option = this.option; each$21([['start', 'startValue'], ['end', 'endValue']], function (names) { // If only one of 'start' and 'startValue' is not null/undefined, the other // should be cleared, which enable clear the option. // If both of them are not set, keep option with the original value, which // enable use only set start but not set end when calling `dispatchAction`. // The same as 'end' and 'endValue'. if (opt[names[0]] != null || opt[names[1]] != null) { option[names[0]] = opt[names[0]]; option[names[1]] = opt[names[1]]; } }, this); !ignoreUpdateRangeUsg && updateRangeUse(this, opt); }, /** * @public * @return {Array.} [startPercent, endPercent] */ getPercentRange: function () { var axisProxy = this.findRepresentativeAxisProxy(); if (axisProxy) { return axisProxy.getDataPercentWindow(); } }, /** * @public * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0); * * @param {string} [axisDimName] * @param {number} [axisIndex] * @return {Array.} [startValue, endValue] value can only be '-' or finite number. */ getValueRange: function (axisDimName, axisIndex) { if (axisDimName == null && axisIndex == null) { var axisProxy = this.findRepresentativeAxisProxy(); if (axisProxy) { return axisProxy.getDataValueWindow(); } } else { return this.getAxisProxy(axisDimName, axisIndex).getDataValueWindow(); } }, /** * @public * @param {module:echarts/model/Model} [axisModel] If axisModel given, find axisProxy * corresponding to the axisModel * @return {module:echarts/component/dataZoom/AxisProxy} */ findRepresentativeAxisProxy: function (axisModel) { if (axisModel) { return axisModel.__dzAxisProxy; } // Find the first hosted axisProxy var axisProxies = this._axisProxies; for (var key in axisProxies) { if (axisProxies.hasOwnProperty(key) && axisProxies[key].hostedBy(this)) { return axisProxies[key]; } } // If no hosted axis find not hosted axisProxy. // Consider this case: dataZoomModel1 and dataZoomModel2 control the same axis, // and the option.start or option.end settings are different. The percentRange // should follow axisProxy. // (We encounter this problem in toolbox data zoom.) for (var key in axisProxies) { if (axisProxies.hasOwnProperty(key) && !axisProxies[key].hostedBy(this)) { return axisProxies[key]; } } }, /** * @return {Array.} */ getRangePropMode: function () { return this._rangePropMode.slice(); } }); function retrieveRaw(option) { var ret = {}; each$21( ['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) { option.hasOwnProperty(name) && (ret[name] = option[name]); } ); return ret; } function updateRangeUse(dataZoomModel, rawOption) { var rangePropMode = dataZoomModel._rangePropMode; var rangeModeInOption = dataZoomModel.get('rangeMode'); each$21([['start', 'startValue'], ['end', 'endValue']], function (names, index) { var percentSpecified = rawOption[names[0]] != null; var valueSpecified = rawOption[names[1]] != null; if (percentSpecified && !valueSpecified) { rangePropMode[index] = 'percent'; } else if (!percentSpecified && valueSpecified) { rangePropMode[index] = 'value'; } else if (rangeModeInOption) { rangePropMode[index] = rangeModeInOption[index]; } else if (percentSpecified) { // percentSpecified && valueSpecified rangePropMode[index] = 'percent'; } // else remain its original setting. }); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var DataZoomView = Component.extend({ type: 'dataZoom', render: function (dataZoomModel, ecModel, api, payload) { this.dataZoomModel = dataZoomModel; this.ecModel = ecModel; this.api = api; }, /** * Find the first target coordinate system. * * @protected * @return {Object} { * grid: [ * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1}, * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0}, * ... * ], // cartesians must not be null/undefined. * polar: [ * {model: coord0, axisModels: [axis4], coordIndex: 0}, * ... * ], // polars must not be null/undefined. * singleAxis: [ * {model: coord0, axisModels: [], coordIndex: 0} * ] */ getTargetCoordInfo: function () { var dataZoomModel = this.dataZoomModel; var ecModel = this.ecModel; var coordSysLists = {}; dataZoomModel.eachTargetAxis(function (dimNames, axisIndex) { var axisModel = ecModel.getComponent(dimNames.axis, axisIndex); if (axisModel) { var coordModel = axisModel.getCoordSysModel(); coordModel && save( coordModel, axisModel, coordSysLists[coordModel.mainType] || (coordSysLists[coordModel.mainType] = []), coordModel.componentIndex ); } }, this); function save(coordModel, axisModel, store, coordIndex) { var item; for (var i = 0; i < store.length; i++) { if (store[i].model === coordModel) { item = store[i]; break; } } if (!item) { store.push(item = { model: coordModel, axisModels: [], coordIndex: coordIndex }); } item.axisModels.push(axisModel); } return coordSysLists; } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var SliderZoomModel = DataZoomModel.extend({ type: 'dataZoom.slider', layoutMode: 'box', /** * @protected */ defaultOption: { show: true, // ph => placeholder. Using placehoder here because // deault value can only be drived in view stage. right: 'ph', // Default align to grid rect. top: 'ph', // Default align to grid rect. width: 'ph', // Default align to grid rect. height: 'ph', // Default align to grid rect. left: null, // Default align to grid rect. bottom: null, // Default align to grid rect. backgroundColor: 'rgba(47,69,84,0)', // Background of slider zoom component. // dataBackgroundColor: '#ddd', // Background coor of data shadow and border of box, // highest priority, remain for compatibility of // previous version, but not recommended any more. dataBackground: { lineStyle: { color: '#2f4554', width: 0.5, opacity: 0.3 }, areaStyle: { color: 'rgba(47,69,84,0.3)', opacity: 0.3 } }, borderColor: '#ddd', // border color of the box. For compatibility, // if dataBackgroundColor is set, borderColor // is ignored. fillerColor: 'rgba(167,183,204,0.4)', // Color of selected area. // handleColor: 'rgba(89,170,216,0.95)', // Color of handle. // handleIcon: 'path://M4.9,17.8c0-1.4,4.5-10.5,5.5-12.4c0-0.1,0.6-1.1,0.9-1.1c0.4,0,0.9,1,0.9,1.1c1.1,2.2,5.4,11,5.4,12.4v17.8c0,1.5-0.6,2.1-1.3,2.1H6.1c-0.7,0-1.3-0.6-1.3-2.1V17.8z', handleIcon: 'M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z', // Percent of the slider height handleSize: '100%', handleStyle: { color: '#a7b7cc' }, labelPrecision: null, labelFormatter: null, showDetail: true, showDataShadow: 'auto', // Default auto decision. realtime: true, zoomLock: false, // Whether disable zoom. textStyle: { color: '#333' } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var Rect$2 = Rect; var linearMap$1 = linearMap; var asc$2 = asc; var bind$4 = bind; var each$23 = each$1; // Constants var DEFAULT_LOCATION_EDGE_GAP = 7; var DEFAULT_FRAME_BORDER_WIDTH = 1; var DEFAULT_FILLER_SIZE = 30; var HORIZONTAL = 'horizontal'; var VERTICAL = 'vertical'; var LABEL_GAP = 5; var SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter']; var SliderZoomView = DataZoomView.extend({ type: 'dataZoom.slider', init: function (ecModel, api) { /** * @private * @type {Object} */ this._displayables = {}; /** * @private * @type {string} */ this._orient; /** * [0, 100] * @private */ this._range; /** * [coord of the first handle, coord of the second handle] * @private */ this._handleEnds; /** * [length, thick] * @private * @type {Array.} */ this._size; /** * @private * @type {number} */ this._handleWidth; /** * @private * @type {number} */ this._handleHeight; /** * @private */ this._location; /** * @private */ this._dragging; /** * @private */ this._dataShadowInfo; this.api = api; }, /** * @override */ render: function (dataZoomModel, ecModel, api, payload) { SliderZoomView.superApply(this, 'render', arguments); createOrUpdate( this, '_dispatchZoomAction', this.dataZoomModel.get('throttle'), 'fixRate' ); this._orient = dataZoomModel.get('orient'); if (this.dataZoomModel.get('show') === false) { this.group.removeAll(); return; } // Notice: this._resetInterval() should not be executed when payload.type // is 'dataZoom', origin this._range should be maintained, otherwise 'pan' // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction, if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) { this._buildView(); } this._updateView(); }, /** * @override */ remove: function () { SliderZoomView.superApply(this, 'remove', arguments); clear(this, '_dispatchZoomAction'); }, /** * @override */ dispose: function () { SliderZoomView.superApply(this, 'dispose', arguments); clear(this, '_dispatchZoomAction'); }, _buildView: function () { var thisGroup = this.group; thisGroup.removeAll(); this._resetLocation(); this._resetInterval(); var barGroup = this._displayables.barGroup = new Group(); this._renderBackground(); this._renderHandle(); this._renderDataShadow(); thisGroup.add(barGroup); this._positionGroup(); }, /** * @private */ _resetLocation: function () { var dataZoomModel = this.dataZoomModel; var api = this.api; // If some of x/y/width/height are not specified, // auto-adapt according to target grid. var coordRect = this._findCoordRect(); var ecSize = {width: api.getWidth(), height: api.getHeight()}; // Default align by coordinate system rect. var positionInfo = this._orient === HORIZONTAL ? { // Why using 'right', because right should be used in vertical, // and it is better to be consistent for dealing with position param merge. right: ecSize.width - coordRect.x - coordRect.width, top: (ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP), width: coordRect.width, height: DEFAULT_FILLER_SIZE } : { // vertical right: DEFAULT_LOCATION_EDGE_GAP, top: coordRect.y, width: DEFAULT_FILLER_SIZE, height: coordRect.height }; // Do not write back to option and replace value 'ph', because // the 'ph' value should be recalculated when resize. var layoutParams = getLayoutParams(dataZoomModel.option); // Replace the placeholder value. each$1(['right', 'top', 'width', 'height'], function (name) { if (layoutParams[name] === 'ph') { layoutParams[name] = positionInfo[name]; } }); var layoutRect = getLayoutRect( layoutParams, ecSize, dataZoomModel.padding ); this._location = {x: layoutRect.x, y: layoutRect.y}; this._size = [layoutRect.width, layoutRect.height]; this._orient === VERTICAL && this._size.reverse(); }, /** * @private */ _positionGroup: function () { var thisGroup = this.group; var location = this._location; var orient = this._orient; // Just use the first axis to determine mapping. var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel(); var inverse = targetAxisModel && targetAxisModel.get('inverse'); var barGroup = this._displayables.barGroup; var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse; // Transform barGroup. barGroup.attr( (orient === HORIZONTAL && !inverse) ? {scale: otherAxisInverse ? [1, 1] : [1, -1]} : (orient === HORIZONTAL && inverse) ? {scale: otherAxisInverse ? [-1, 1] : [-1, -1]} : (orient === VERTICAL && !inverse) ? {scale: otherAxisInverse ? [1, -1] : [1, 1], rotation: Math.PI / 2} // Dont use Math.PI, considering shadow direction. : {scale: otherAxisInverse ? [-1, -1] : [-1, 1], rotation: Math.PI / 2} ); // Position barGroup var rect = thisGroup.getBoundingRect([barGroup]); thisGroup.attr('position', [location.x - rect.x, location.y - rect.y]); }, /** * @private */ _getViewExtent: function () { return [0, this._size[0]]; }, _renderBackground: function () { var dataZoomModel = this.dataZoomModel; var size = this._size; var barGroup = this._displayables.barGroup; barGroup.add(new Rect$2({ silent: true, shape: { x: 0, y: 0, width: size[0], height: size[1] }, style: { fill: dataZoomModel.get('backgroundColor') }, z2: -40 })); // Click panel, over shadow, below handles. barGroup.add(new Rect$2({ shape: { x: 0, y: 0, width: size[0], height: size[1] }, style: { fill: 'transparent' }, z2: 0, onclick: bind(this._onClickPanelClick, this) })); }, _renderDataShadow: function () { var info = this._dataShadowInfo = this._prepareDataShadowInfo(); if (!info) { return; } var size = this._size; var seriesModel = info.series; var data = seriesModel.getRawData(); var otherDim = seriesModel.getShadowDim ? seriesModel.getShadowDim() // @see candlestick : info.otherDim; if (otherDim == null) { return; } var otherDataExtent = data.getDataExtent(otherDim); // Nice extent. var otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3; otherDataExtent = [ otherDataExtent[0] - otherOffset, otherDataExtent[1] + otherOffset ]; var otherShadowExtent = [0, size[1]]; var thisShadowExtent = [0, size[0]]; var areaPoints = [[size[0], 0], [0, 0]]; var linePoints = []; var step = thisShadowExtent[1] / (data.count() - 1); var thisCoord = 0; // Optimize for large data shadow var stride = Math.round(data.count() / size[0]); var lastIsEmpty; data.each([otherDim], function (value, index) { if (stride > 0 && (index % stride)) { thisCoord += step; return; } // FIXME // Should consider axis.min/axis.max when drawing dataShadow. // FIXME // 应该使用统一的空判断?还是在list里进行空判断? var isEmpty = value == null || isNaN(value) || value === ''; // See #4235. var otherCoord = isEmpty ? 0 : linearMap$1(value, otherDataExtent, otherShadowExtent, true); // Attempt to draw data shadow precisely when there are empty value. if (isEmpty && !lastIsEmpty && index) { areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]); linePoints.push([linePoints[linePoints.length - 1][0], 0]); } else if (!isEmpty && lastIsEmpty) { areaPoints.push([thisCoord, 0]); linePoints.push([thisCoord, 0]); } areaPoints.push([thisCoord, otherCoord]); linePoints.push([thisCoord, otherCoord]); thisCoord += step; lastIsEmpty = isEmpty; }); var dataZoomModel = this.dataZoomModel; // var dataBackgroundModel = dataZoomModel.getModel('dataBackground'); this._displayables.barGroup.add(new Polygon({ shape: {points: areaPoints}, style: defaults( {fill: dataZoomModel.get('dataBackgroundColor')}, dataZoomModel.getModel('dataBackground.areaStyle').getAreaStyle() ), silent: true, z2: -20 })); this._displayables.barGroup.add(new Polyline({ shape: {points: linePoints}, style: dataZoomModel.getModel('dataBackground.lineStyle').getLineStyle(), silent: true, z2: -19 })); }, _prepareDataShadowInfo: function () { var dataZoomModel = this.dataZoomModel; var showDataShadow = dataZoomModel.get('showDataShadow'); if (showDataShadow === false) { return; } // Find a representative series. var result; var ecModel = this.ecModel; dataZoomModel.eachTargetAxis(function (dimNames, axisIndex) { var seriesModels = dataZoomModel .getAxisProxy(dimNames.name, axisIndex) .getTargetSeriesModels(); each$1(seriesModels, function (seriesModel) { if (result) { return; } if (showDataShadow !== true && indexOf( SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type') ) < 0 ) { return; } var thisAxis = ecModel.getComponent(dimNames.axis, axisIndex).axis; var otherDim = getOtherDim(dimNames.name); var otherAxisInverse; var coordSys = seriesModel.coordinateSystem; if (otherDim != null && coordSys.getOtherAxis) { otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse; } otherDim = seriesModel.getData().mapDimension(otherDim); result = { thisAxis: thisAxis, series: seriesModel, thisDim: dimNames.name, otherDim: otherDim, otherAxisInverse: otherAxisInverse }; }, this); }, this); return result; }, _renderHandle: function () { var displaybles = this._displayables; var handles = displaybles.handles = []; var handleLabels = displaybles.handleLabels = []; var barGroup = this._displayables.barGroup; var size = this._size; var dataZoomModel = this.dataZoomModel; barGroup.add(displaybles.filler = new Rect$2({ draggable: true, cursor: getCursor(this._orient), drift: bind$4(this._onDragMove, this, 'all'), onmousemove: function (e) { // Fot mobile devicem, prevent screen slider on the button. stop(e.event); }, ondragstart: bind$4(this._showDataInfo, this, true), ondragend: bind$4(this._onDragEnd, this), onmouseover: bind$4(this._showDataInfo, this, true), onmouseout: bind$4(this._showDataInfo, this, false), style: { fill: dataZoomModel.get('fillerColor'), textPosition : 'inside' } })); // Frame border. barGroup.add(new Rect$2(subPixelOptimizeRect({ silent: true, shape: { x: 0, y: 0, width: size[0], height: size[1] }, style: { stroke: dataZoomModel.get('dataBackgroundColor') || dataZoomModel.get('borderColor'), lineWidth: DEFAULT_FRAME_BORDER_WIDTH, fill: 'rgba(0,0,0,0)' } }))); each$23([0, 1], function (handleIndex) { var path = createIcon( dataZoomModel.get('handleIcon'), { cursor: getCursor(this._orient), draggable: true, drift: bind$4(this._onDragMove, this, handleIndex), onmousemove: function (e) { // Fot mobile devicem, prevent screen slider on the button. stop(e.event); }, ondragend: bind$4(this._onDragEnd, this), onmouseover: bind$4(this._showDataInfo, this, true), onmouseout: bind$4(this._showDataInfo, this, false) }, {x: -1, y: 0, width: 2, height: 2} ); var bRect = path.getBoundingRect(); this._handleHeight = parsePercent$1(dataZoomModel.get('handleSize'), this._size[1]); this._handleWidth = bRect.width / bRect.height * this._handleHeight; path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle()); var handleColor = dataZoomModel.get('handleColor'); // Compatitable with previous version if (handleColor != null) { path.style.fill = handleColor; } barGroup.add(handles[handleIndex] = path); var textStyleModel = dataZoomModel.textStyleModel; this.group.add( handleLabels[handleIndex] = new Text({ silent: true, invisible: true, style: { x: 0, y: 0, text: '', textVerticalAlign: 'middle', textAlign: 'center', textFill: textStyleModel.getTextColor(), textFont: textStyleModel.getFont() }, z2: 10 })); }, this); }, /** * @private */ _resetInterval: function () { var range = this._range = this.dataZoomModel.getPercentRange(); var viewExtent = this._getViewExtent(); this._handleEnds = [ linearMap$1(range[0], [0, 100], viewExtent, true), linearMap$1(range[1], [0, 100], viewExtent, true) ]; }, /** * @private * @param {(number|string)} handleIndex 0 or 1 or 'all' * @param {number} delta * @return {boolean} changed */ _updateInterval: function (handleIndex, delta) { var dataZoomModel = this.dataZoomModel; var handleEnds = this._handleEnds; var viewExtend = this._getViewExtent(); var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); var percentExtent = [0, 100]; sliderMove( delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null ? linearMap$1(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap$1(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null ); var lastRange = this._range; var range = this._range = asc$2([ linearMap$1(handleEnds[0], viewExtend, percentExtent, true), linearMap$1(handleEnds[1], viewExtend, percentExtent, true) ]); return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1]; }, /** * @private */ _updateView: function (nonRealtime) { var displaybles = this._displayables; var handleEnds = this._handleEnds; var handleInterval = asc$2(handleEnds.slice()); var size = this._size; each$23([0, 1], function (handleIndex) { // Handles var handle = displaybles.handles[handleIndex]; var handleHeight = this._handleHeight; handle.attr({ scale: [handleHeight / 2, handleHeight / 2], position: [handleEnds[handleIndex], size[1] / 2 - handleHeight / 2] }); }, this); // Filler displaybles.filler.setShape({ x: handleInterval[0], y: 0, width: handleInterval[1] - handleInterval[0], height: size[1] }); this._updateDataInfo(nonRealtime); }, /** * @private */ _updateDataInfo: function (nonRealtime) { var dataZoomModel = this.dataZoomModel; var displaybles = this._displayables; var handleLabels = displaybles.handleLabels; var orient = this._orient; var labelTexts = ['', '']; // FIXME // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter) if (dataZoomModel.get('showDetail')) { var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); if (axisProxy) { var axis = axisProxy.getAxisModel().axis; var range = this._range; var dataInterval = nonRealtime // See #4434, data and axis are not processed and reset yet in non-realtime mode. ? axisProxy.calculateDataWindow({ start: range[0], end: range[1] }).valueWindow : axisProxy.getDataValueWindow(); labelTexts = [ this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis) ]; } } var orderedHandleEnds = asc$2(this._handleEnds.slice()); setLabel.call(this, 0); setLabel.call(this, 1); function setLabel(handleIndex) { // Label // Text should not transform by barGroup. // Ignore handlers transform var barTransform = getTransform( displaybles.handles[handleIndex].parent, this.group ); var direction = transformDirection( handleIndex === 0 ? 'right' : 'left', barTransform ); var offset = this._handleWidth / 2 + LABEL_GAP; var textPoint = applyTransform$1( [ orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), this._size[1] / 2 ], barTransform ); handleLabels[handleIndex].setStyle({ x: textPoint[0], y: textPoint[1], textVerticalAlign: orient === HORIZONTAL ? 'middle' : direction, textAlign: orient === HORIZONTAL ? direction : 'center', text: labelTexts[handleIndex] }); } }, /** * @private */ _formatLabel: function (value, axis) { var dataZoomModel = this.dataZoomModel; var labelFormatter = dataZoomModel.get('labelFormatter'); var labelPrecision = dataZoomModel.get('labelPrecision'); if (labelPrecision == null || labelPrecision === 'auto') { labelPrecision = axis.getPixelPrecision(); } var valueStr = (value == null || isNaN(value)) ? '' // FIXME Glue code : (axis.type === 'category' || axis.type === 'time') ? axis.scale.getLabel(Math.round(value)) // param of toFixed should less then 20. : value.toFixed(Math.min(labelPrecision, 20)); return isFunction$1(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace('{value}', valueStr) : valueStr; }, /** * @private * @param {boolean} showOrHide true: show, false: hide */ _showDataInfo: function (showOrHide) { // Always show when drgging. showOrHide = this._dragging || showOrHide; var handleLabels = this._displayables.handleLabels; handleLabels[0].attr('invisible', !showOrHide); handleLabels[1].attr('invisible', !showOrHide); }, _onDragMove: function (handleIndex, dx, dy) { this._dragging = true; // Transform dx, dy to bar coordination. var barTransform = this._displayables.barGroup.getLocalTransform(); var vertex = applyTransform$1([dx, dy], barTransform, true); var changed = this._updateInterval(handleIndex, vertex[0]); var realtime = this.dataZoomModel.get('realtime'); this._updateView(!realtime); // Avoid dispatch dataZoom repeatly but range not changed, // which cause bad visual effect when progressive enabled. changed && realtime && this._dispatchZoomAction(); }, _onDragEnd: function () { this._dragging = false; this._showDataInfo(false); // While in realtime mode and stream mode, dispatch action when // drag end will cause the whole view rerender, which is unnecessary. var realtime = this.dataZoomModel.get('realtime'); !realtime && this._dispatchZoomAction(); }, _onClickPanelClick: function (e) { var size = this._size; var localPoint = this._displayables.barGroup.transformCoordToLocal(e.offsetX, e.offsetY); if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1] ) { return; } var handleEnds = this._handleEnds; var center = (handleEnds[0] + handleEnds[1]) / 2; var changed = this._updateInterval('all', localPoint[0] - center); this._updateView(); changed && this._dispatchZoomAction(); }, /** * This action will be throttled. * @private */ _dispatchZoomAction: function () { var range = this._range; this.api.dispatchAction({ type: 'dataZoom', from: this.uid, dataZoomId: this.dataZoomModel.id, start: range[0], end: range[1] }); }, /** * @private */ _findCoordRect: function () { // Find the grid coresponding to the first axis referred by dataZoom. var rect; each$23(this.getTargetCoordInfo(), function (coordInfoList) { if (!rect && coordInfoList.length) { var coordSys = coordInfoList[0].model.coordinateSystem; rect = coordSys.getRect && coordSys.getRect(); } }); if (!rect) { var width = this.api.getWidth(); var height = this.api.getHeight(); rect = { x: width * 0.2, y: height * 0.2, width: width * 0.6, height: height * 0.6 }; } return rect; } }); function getOtherDim(thisDim) { // FIXME // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好 var map$$1 = {x: 'y', y: 'x', radius: 'angle', angle: 'radius'}; return map$$1[thisDim]; } function getCursor(orient) { return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ DataZoomModel.extend({ type: 'dataZoom.inside', /** * @protected */ defaultOption: { disabled: false, // Whether disable this inside zoom. zoomLock: false, // Whether disable zoom but only pan. zoomOnMouseWheel: true, // Can be: true / false / 'shift' / 'ctrl' / 'alt'. moveOnMouseMove: true, // Can be: true / false / 'shift' / 'ctrl' / 'alt'. preventDefaultMouseMove: true } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Only create one roam controller for each coordinate system. // one roam controller might be refered by two inside data zoom // components (for example, one for x and one for y). When user // pan or zoom, only dispatch one action for those data zoom // components. var curry$6 = curry; var ATTR$1 = '\0_ec_dataZoom_roams'; /** * @public * @param {module:echarts/ExtensionAPI} api * @param {Object} dataZoomInfo * @param {string} dataZoomInfo.coordId * @param {Function} dataZoomInfo.containsPoint * @param {Array.} dataZoomInfo.allCoordIds * @param {string} dataZoomInfo.dataZoomId * @param {number} dataZoomInfo.throttleRate * @param {Function} dataZoomInfo.panGetRange * @param {Function} dataZoomInfo.zoomGetRange * @param {boolean} [dataZoomInfo.zoomLock] * @param {boolean} [dataZoomInfo.disabled] */ function register$2(api, dataZoomInfo) { var store = giveStore(api); var theDataZoomId = dataZoomInfo.dataZoomId; var theCoordId = dataZoomInfo.coordId; // Do clean when a dataZoom changes its target coordnate system. // Avoid memory leak, dispose all not-used-registered. each$1(store, function (record, coordId) { var dataZoomInfos = record.dataZoomInfos; if (dataZoomInfos[theDataZoomId] && indexOf(dataZoomInfo.allCoordIds, theCoordId) < 0 ) { delete dataZoomInfos[theDataZoomId]; record.count--; } }); cleanStore(store); var record = store[theCoordId]; // Create if needed. if (!record) { record = store[theCoordId] = { coordId: theCoordId, dataZoomInfos: {}, count: 0 }; record.controller = createController(api, record); record.dispatchAction = curry(dispatchAction$1, api); } // Update reference of dataZoom. !(record.dataZoomInfos[theDataZoomId]) && record.count++; record.dataZoomInfos[theDataZoomId] = dataZoomInfo; var controllerParams = mergeControllerParams(record.dataZoomInfos); record.controller.enable(controllerParams.controlType, controllerParams.opt); // Consider resize, area should be always updated. record.controller.setPointerChecker(dataZoomInfo.containsPoint); // Update throttle. createOrUpdate( record, 'dispatchAction', dataZoomInfo.throttleRate, 'fixRate' ); } /** * @public * @param {module:echarts/ExtensionAPI} api * @param {string} dataZoomId */ function unregister$1(api, dataZoomId) { var store = giveStore(api); each$1(store, function (record) { record.controller.dispose(); var dataZoomInfos = record.dataZoomInfos; if (dataZoomInfos[dataZoomId]) { delete dataZoomInfos[dataZoomId]; record.count--; } }); cleanStore(store); } /** * @public */ function generateCoordId(coordModel) { return coordModel.type + '\0_' + coordModel.id; } /** * Key: coordId, value: {dataZoomInfos: [], count, controller} * @type {Array.} */ function giveStore(api) { // Mount store on zrender instance, so that we do not // need to worry about dispose. var zr = api.getZr(); return zr[ATTR$1] || (zr[ATTR$1] = {}); } function createController(api, newRecord) { var controller = new RoamController(api.getZr()); controller.on('pan', curry$6(onPan, newRecord)); controller.on('zoom', curry$6(onZoom, newRecord)); return controller; } function cleanStore(store) { each$1(store, function (record, coordId) { if (!record.count) { record.controller.dispose(); delete store[coordId]; } }); } function onPan(record, dx, dy, oldX, oldY, newX, newY) { wrapAndDispatch(record, function (info) { return info.panGetRange(record.controller, dx, dy, oldX, oldY, newX, newY); }); } function onZoom(record, scale, mouseX, mouseY) { wrapAndDispatch(record, function (info) { return info.zoomGetRange(record.controller, scale, mouseX, mouseY); }); } function wrapAndDispatch(record, getRange) { var batch = []; each$1(record.dataZoomInfos, function (info) { var range = getRange(info); !info.disabled && range && batch.push({ dataZoomId: info.dataZoomId, start: range[0], end: range[1] }); }); batch.length && record.dispatchAction(batch); } /** * This action will be throttled. */ function dispatchAction$1(api, batch) { api.dispatchAction({ type: 'dataZoom', batch: batch }); } /** * Merge roamController settings when multiple dataZooms share one roamController. */ function mergeControllerParams(dataZoomInfos) { var controlType; var opt = {}; // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated // as string, it is probably revert to reserved word by compress tool. See #7411. var prefix = 'type_'; var typePriority = { 'type_true': 2, 'type_move': 1, 'type_false': 0, 'type_undefined': -1 }; each$1(dataZoomInfos, function (dataZoomInfo) { var oneType = dataZoomInfo.disabled ? false : dataZoomInfo.zoomLock ? 'move' : true; if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) { controlType = oneType; } // Do not support that different 'shift'/'ctrl'/'alt' setting used in one coord sys. extend(opt, dataZoomInfo.roamControllerOpt); }); return { controlType: controlType, opt: opt }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var bind$5 = bind; var InsideZoomView = DataZoomView.extend({ type: 'dataZoom.inside', /** * @override */ init: function (ecModel, api) { /** * 'throttle' is used in this.dispatchAction, so we save range * to avoid missing some 'pan' info. * @private * @type {Array.} */ this._range; }, /** * @override */ render: function (dataZoomModel, ecModel, api, payload) { InsideZoomView.superApply(this, 'render', arguments); // Hance the `throttle` util ensures to preserve command order, // here simply updating range all the time will not cause missing // any of the the roam change. this._range = dataZoomModel.getPercentRange(); // Reset controllers. each$1(this.getTargetCoordInfo(), function (coordInfoList, coordSysName) { var allCoordIds = map(coordInfoList, function (coordInfo) { return generateCoordId(coordInfo.model); }); each$1(coordInfoList, function (coordInfo) { var coordModel = coordInfo.model; var dataZoomOption = dataZoomModel.option; register$2( api, { coordId: generateCoordId(coordModel), allCoordIds: allCoordIds, containsPoint: function (e, x, y) { return coordModel.coordinateSystem.containPoint([x, y]); }, dataZoomId: dataZoomModel.id, throttleRate: dataZoomModel.get('throttle', true), panGetRange: bind$5(this._onPan, this, coordInfo, coordSysName), zoomGetRange: bind$5(this._onZoom, this, coordInfo, coordSysName), zoomLock: dataZoomOption.zoomLock, disabled: dataZoomOption.disabled, roamControllerOpt: { zoomOnMouseWheel: dataZoomOption.zoomOnMouseWheel, moveOnMouseMove: dataZoomOption.moveOnMouseMove, preventDefaultMouseMove: dataZoomOption.preventDefaultMouseMove } } ); }, this); }, this); }, /** * @override */ dispose: function () { unregister$1(this.api, this.dataZoomModel.id); InsideZoomView.superApply(this, 'dispose', arguments); this._range = null; }, /** * @private */ _onPan: function (coordInfo, coordSysName, controller, dx, dy, oldX, oldY, newX, newY) { var lastRange = this._range; var range = lastRange.slice(); // Calculate transform by the first axis. var axisModel = coordInfo.axisModels[0]; if (!axisModel) { return; } var directionInfo = getDirectionInfo[coordSysName]( [oldX, oldY], [newX, newY], axisModel, controller, coordInfo ); var percentDelta = directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength; sliderMove(percentDelta, range, [0, 100], 'all'); this._range = range; if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { return range; } }, /** * @private */ _onZoom: function (coordInfo, coordSysName, controller, scale, mouseX, mouseY) { var lastRange = this._range; var range = lastRange.slice(); // Calculate transform by the first axis. var axisModel = coordInfo.axisModels[0]; if (!axisModel) { return; } var directionInfo = getDirectionInfo[coordSysName]( null, [mouseX, mouseY], axisModel, controller, coordInfo ); var percentPoint = ( directionInfo.signal > 0 ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel) : (directionInfo.pixel - directionInfo.pixelStart) ) / directionInfo.pixelLength * (range[1] - range[0]) + range[0]; scale = Math.max(1 / scale, 0); range[0] = (range[0] - percentPoint) * scale + percentPoint; range[1] = (range[1] - percentPoint) * scale + percentPoint; // Restrict range. var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan); this._range = range; if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { return range; } } }); var getDirectionInfo = { grid: function (oldPoint, newPoint, axisModel, controller, coordInfo) { var axis = axisModel.axis; var ret = {}; var rect = coordInfo.model.coordinateSystem.getRect(); oldPoint = oldPoint || [0, 0]; if (axis.dim === 'x') { ret.pixel = newPoint[0] - oldPoint[0]; ret.pixelLength = rect.width; ret.pixelStart = rect.x; ret.signal = axis.inverse ? 1 : -1; } else { // axis.dim === 'y' ret.pixel = newPoint[1] - oldPoint[1]; ret.pixelLength = rect.height; ret.pixelStart = rect.y; ret.signal = axis.inverse ? -1 : 1; } return ret; }, polar: function (oldPoint, newPoint, axisModel, controller, coordInfo) { var axis = axisModel.axis; var ret = {}; var polar = coordInfo.model.coordinateSystem; var radiusExtent = polar.getRadiusAxis().getExtent(); var angleExtent = polar.getAngleAxis().getExtent(); oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0]; newPoint = polar.pointToCoord(newPoint); if (axisModel.mainType === 'radiusAxis') { ret.pixel = newPoint[0] - oldPoint[0]; // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]); // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]); ret.pixelLength = radiusExtent[1] - radiusExtent[0]; ret.pixelStart = radiusExtent[0]; ret.signal = axis.inverse ? 1 : -1; } else { // 'angleAxis' ret.pixel = newPoint[1] - oldPoint[1]; // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]); // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]); ret.pixelLength = angleExtent[1] - angleExtent[0]; ret.pixelStart = angleExtent[0]; ret.signal = axis.inverse ? -1 : 1; } return ret; }, singleAxis: function (oldPoint, newPoint, axisModel, controller, coordInfo) { var axis = axisModel.axis; var rect = coordInfo.model.coordinateSystem.getRect(); var ret = {}; oldPoint = oldPoint || [0, 0]; if (axis.orient === 'horizontal') { ret.pixel = newPoint[0] - oldPoint[0]; ret.pixelLength = rect.width; ret.pixelStart = rect.x; ret.signal = axis.inverse ? 1 : -1; } else { // 'vertical' ret.pixel = newPoint[1] - oldPoint[1]; ret.pixelLength = rect.height; ret.pixelStart = rect.y; ret.signal = axis.inverse ? -1 : 1; } return ret; } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerProcessor({ // `dataZoomProcessor` will only be performed in needed series. Consider if // there is a line series and a pie series, it is better not to update the // line series if only pie series is needed to be updated. getTargetSeries: function (ecModel) { var seriesModelMap = createHashMap(); ecModel.eachComponent('dataZoom', function (dataZoomModel) { dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) { var axisProxy = dataZoomModel.getAxisProxy(dimNames.name, axisIndex); each$1(axisProxy.getTargetSeriesModels(), function (seriesModel) { seriesModelMap.set(seriesModel.uid, seriesModel); }); }); }); return seriesModelMap; }, modifyOutputEnd: true, // Consider appendData, where filter should be performed. Because data process is // in block mode currently, it is not need to worry about that the overallProgress // execute every frame. overallReset: function (ecModel, api) { ecModel.eachComponent('dataZoom', function (dataZoomModel) { // We calculate window and reset axis here but not in model // init stage and not after action dispatch handler, because // reset should be called after seriesData.restoreData. dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) { dataZoomModel.getAxisProxy(dimNames.name, axisIndex).reset(dataZoomModel, api); }); // Caution: data zoom filtering is order sensitive when using // percent range and no min/max/scale set on axis. // For example, we have dataZoom definition: // [ // {xAxisIndex: 0, start: 30, end: 70}, // {yAxisIndex: 0, start: 20, end: 80} // ] // In this case, [20, 80] of y-dataZoom should be based on data // that have filtered by x-dataZoom using range of [30, 70], // but should not be based on full raw data. Thus sliding // x-dataZoom will change both ranges of xAxis and yAxis, // while sliding y-dataZoom will only change the range of yAxis. // So we should filter x-axis after reset x-axis immediately, // and then reset y-axis and filter y-axis. dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) { dataZoomModel.getAxisProxy(dimNames.name, axisIndex).filterData(dataZoomModel, api); }); }); ecModel.eachComponent('dataZoom', function (dataZoomModel) { // Fullfill all of the range props so that user // is able to get them from chart.getOption(). var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); var percentRange = axisProxy.getDataPercentWindow(); var valueRange = axisProxy.getDataValueWindow(); dataZoomModel.setRawRange({ start: percentRange[0], end: percentRange[1], startValue: valueRange[0], endValue: valueRange[1] }, true); }); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerAction('dataZoom', function (payload, ecModel) { var linkedNodesFinder = createLinkedNodesFinder( bind(ecModel.eachComponent, ecModel, 'dataZoom'), eachAxisDim$1, function (model, dimNames) { return model.get(dimNames.axisIndex); } ); var effectedModels = []; ecModel.eachComponent( {mainType: 'dataZoom', query: payload}, function (model, index) { effectedModels.push.apply( effectedModels, linkedNodesFinder(model).nodes ); } ); each$1(effectedModels, function (dataZoomModel, index) { dataZoomModel.setRawRange({ start: payload.start, end: payload.end, startValue: payload.startValue, endValue: payload.endValue }); }); }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * DataZoom component entry */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$24 = each$1; var preprocessor$2 = function (option) { var visualMap = option && option.visualMap; if (!isArray(visualMap)) { visualMap = visualMap ? [visualMap] : []; } each$24(visualMap, function (opt) { if (!opt) { return; } // rename splitList to pieces if (has$1(opt, 'splitList') && !has$1(opt, 'pieces')) { opt.pieces = opt.splitList; delete opt.splitList; } var pieces = opt.pieces; if (pieces && isArray(pieces)) { each$24(pieces, function (piece) { if (isObject$1(piece)) { if (has$1(piece, 'start') && !has$1(piece, 'min')) { piece.min = piece.start; } if (has$1(piece, 'end') && !has$1(piece, 'max')) { piece.max = piece.end; } } }); } }); }; function has$1(obj, name) { return obj && obj.hasOwnProperty && obj.hasOwnProperty(name); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ ComponentModel.registerSubTypeDefaulter('visualMap', function (option) { // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used. return ( !option.categories && ( !( option.pieces ? option.pieces.length > 0 : option.splitNumber > 0 ) || option.calculable ) ) ? 'continuous' : 'piecewise'; }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var VISUAL_PRIORITY = PRIORITY.VISUAL.COMPONENT; registerVisual(VISUAL_PRIORITY, { createOnAllSeries: true, reset: function (seriesModel, ecModel) { var resetDefines = []; ecModel.eachComponent('visualMap', function (visualMapModel) { var pipelineContext = seriesModel.pipelineContext; if (!visualMapModel.isTargetSeries(seriesModel) || (pipelineContext && pipelineContext.large) ) { return; } resetDefines.push(incrementalApplyVisual( visualMapModel.stateList, visualMapModel.targetVisuals, bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimension(seriesModel.getData()) )); }); return resetDefines; } }); // Only support color. registerVisual(VISUAL_PRIORITY, { createOnAllSeries: true, reset: function (seriesModel, ecModel) { var data = seriesModel.getData(); var visualMetaList = []; ecModel.eachComponent('visualMap', function (visualMapModel) { if (visualMapModel.isTargetSeries(seriesModel)) { var visualMeta = visualMapModel.getVisualMeta( bind(getColorVisual, null, seriesModel, visualMapModel) ) || {stops: [], outerColors: []}; var concreteDim = visualMapModel.getDataDimension(data); var dimInfo = data.getDimensionInfo(concreteDim); if (dimInfo != null) { // visualMeta.dimension should be dimension index, but not concrete dimension. visualMeta.dimension = dimInfo.index; visualMetaList.push(visualMeta); } } }); // console.log(JSON.stringify(visualMetaList.map(a => a.stops))); seriesModel.getData().setVisual('visualMeta', visualMetaList); } }); // FIXME // performance and export for heatmap? // value can be Infinity or -Infinity function getColorVisual(seriesModel, visualMapModel, value, valueState) { var mappings = visualMapModel.targetVisuals[valueState]; var visualTypes = VisualMapping.prepareVisualTypes(mappings); var resultVisual = { color: seriesModel.getData().getVisual('color') // default color. }; for (var i = 0, len = visualTypes.length; i < len; i++) { var type = visualTypes[i]; var mapping = mappings[ type === 'opacity' ? '__alphaForOpacity' : type ]; mapping && mapping.applyVisual(value, getVisual, setVisual); } return resultVisual.color; function getVisual(key) { return resultVisual[key]; } function setVisual(key, value) { resultVisual[key] = value; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @file Visual mapping. */ var visualDefault = { /** * @public */ get: function (visualType, key, isCategory) { var value = clone( (defaultOption$3[visualType] || {})[key] ); return isCategory ? (isArray(value) ? value[value.length - 1] : value) : value; } }; var defaultOption$3 = { color: { active: ['#006edd', '#e0ffff'], inactive: ['rgba(0,0,0,0)'] }, colorHue: { active: [0, 360], inactive: [0, 0] }, colorSaturation: { active: [0.3, 1], inactive: [0, 0] }, colorLightness: { active: [0.9, 0.5], inactive: [0, 0] }, colorAlpha: { active: [0.3, 1], inactive: [0, 0] }, opacity: { active: [0.3, 1], inactive: [0, 0] }, symbol: { active: ['circle', 'roundRect', 'diamond'], inactive: ['none'] }, symbolSize: { active: [10, 50], inactive: [0, 0] } }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var mapVisual$2 = VisualMapping.mapVisual; var eachVisual = VisualMapping.eachVisual; var isArray$3 = isArray; var each$25 = each$1; var asc$3 = asc; var linearMap$2 = linearMap; var noop$2 = noop; var VisualMapModel = extendComponentModel({ type: 'visualMap', dependencies: ['series'], /** * @readOnly * @type {Array.} */ stateList: ['inRange', 'outOfRange'], /** * @readOnly * @type {Array.} */ replacableOptionKeys: [ 'inRange', 'outOfRange', 'target', 'controller', 'color' ], /** * [lowerBound, upperBound] * * @readOnly * @type {Array.} */ dataBound: [-Infinity, Infinity], /** * @readOnly * @type {string|Object} */ layoutMode: {type: 'box', ignoreSize: true}, /** * @protected */ defaultOption: { show: true, zlevel: 0, z: 4, seriesIndex: 'all', // 'all' or null/undefined: all series. // A number or an array of number: the specified series. // set min: 0, max: 200, only for campatible with ec2. // In fact min max should not have default value. min: 0, // min value, must specified if pieces is not specified. max: 200, // max value, must specified if pieces is not specified. dimension: null, inRange: null, // 'color', 'colorHue', 'colorSaturation', 'colorLightness', 'colorAlpha', // 'symbol', 'symbolSize' outOfRange: null, // 'color', 'colorHue', 'colorSaturation', // 'colorLightness', 'colorAlpha', // 'symbol', 'symbolSize' left: 0, // 'center' ¦ 'left' ¦ 'right' ¦ {number} (px) right: null, // The same as left. top: null, // 'top' ¦ 'bottom' ¦ 'center' ¦ {number} (px) bottom: 0, // The same as top. itemWidth: null, itemHeight: null, inverse: false, orient: 'vertical', // 'horizontal' ¦ 'vertical' backgroundColor: 'rgba(0,0,0,0)', borderColor: '#ccc', // 值域边框颜色 contentColor: '#5793f3', inactiveColor: '#aaa', borderWidth: 0, // 值域边框线宽,单位px,默认为0(无边框) padding: 5, // 值域内边距,单位px,默认各方向内边距为5, // 接受数组分别设定上右下左边距,同css textGap: 10, // precision: 0, // 小数精度,默认为0,无小数点 color: null, //颜色(deprecated,兼容ec2,顺序同pieces,不同于inRange/outOfRange) formatter: null, text: null, // 文本,如['高', '低'],兼容ec2,text[0]对应高值,text[1]对应低值 textStyle: { color: '#333' // 值域文字颜色 } }, /** * @protected */ init: function (option, parentModel, ecModel) { /** * @private * @type {Array.} */ this._dataExtent; /** * @readOnly */ this.targetVisuals = {}; /** * @readOnly */ this.controllerVisuals = {}; /** * @readOnly */ this.textStyleModel; /** * [width, height] * @readOnly * @type {Array.} */ this.itemSize; this.mergeDefaultAndTheme(option, ecModel); }, /** * @protected */ optionUpdated: function (newOption, isInit) { var thisOption = this.option; // FIXME // necessary? // Disable realtime view update if canvas is not supported. if (!env$1.canvasSupported) { thisOption.realtime = false; } !isInit && replaceVisualOption( thisOption, newOption, this.replacableOptionKeys ); this.textStyleModel = this.getModel('textStyle'); this.resetItemSize(); this.completeVisualOption(); }, /** * @protected */ resetVisual: function (supplementVisualOption) { var stateList = this.stateList; supplementVisualOption = bind(supplementVisualOption, this); this.controllerVisuals = createVisualMappings( this.option.controller, stateList, supplementVisualOption ); this.targetVisuals = createVisualMappings( this.option.target, stateList, supplementVisualOption ); }, /** * @protected * @return {Array.} An array of series indices. */ getTargetSeriesIndices: function () { var optionSeriesIndex = this.option.seriesIndex; var seriesIndices = []; if (optionSeriesIndex == null || optionSeriesIndex === 'all') { this.ecModel.eachSeries(function (seriesModel, index) { seriesIndices.push(index); }); } else { seriesIndices = normalizeToArray(optionSeriesIndex); } return seriesIndices; }, /** * @public */ eachTargetSeries: function (callback, context) { each$1(this.getTargetSeriesIndices(), function (seriesIndex) { callback.call(context, this.ecModel.getSeriesByIndex(seriesIndex)); }, this); }, /** * @pubilc */ isTargetSeries: function (seriesModel) { var is = false; this.eachTargetSeries(function (model) { model === seriesModel && (is = true); }); return is; }, /** * @example * this.formatValueText(someVal); // format single numeric value to text. * this.formatValueText(someVal, true); // format single category value to text. * this.formatValueText([min, max]); // format numeric min-max to text. * this.formatValueText([this.dataBound[0], max]); // using data lower bound. * this.formatValueText([min, this.dataBound[1]]); // using data upper bound. * * @param {number|Array.} value Real value, or this.dataBound[0 or 1]. * @param {boolean} [isCategory=false] Only available when value is number. * @param {Array.} edgeSymbols Open-close symbol when value is interval. * @return {string} * @protected */ formatValueText: function(value, isCategory, edgeSymbols) { var option = this.option; var precision = option.precision; var dataBound = this.dataBound; var formatter = option.formatter; var isMinMax; var textValue; edgeSymbols = edgeSymbols || ['<', '>']; if (isArray(value)) { value = value.slice(); isMinMax = true; } textValue = isCategory ? value : (isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value) ); if (isString(formatter)) { return formatter .replace('{value}', isMinMax ? textValue[0] : textValue) .replace('{value2}', isMinMax ? textValue[1] : textValue); } else if (isFunction$1(formatter)) { return isMinMax ? formatter(value[0], value[1]) : formatter(value); } if (isMinMax) { if (value[0] === dataBound[0]) { return edgeSymbols[0] + ' ' + textValue[1]; } else if (value[1] === dataBound[1]) { return edgeSymbols[1] + ' ' + textValue[0]; } else { return textValue[0] + ' - ' + textValue[1]; } } else { // Format single value (includes category case). return textValue; } function toFixed(val) { return val === dataBound[0] ? 'min' : val === dataBound[1] ? 'max' : (+val).toFixed(Math.min(precision, 20)); } }, /** * @protected */ resetExtent: function () { var thisOption = this.option; // Can not calculate data extent by data here. // Because series and data may be modified in processing stage. // So we do not support the feature "auto min/max". var extent = asc$3([thisOption.min, thisOption.max]); this._dataExtent = extent; }, /** * @public * @param {module:echarts/data/List} list * @return {string} Concrete dimention. If return null/undefined, * no dimension used. */ getDataDimension: function (list) { var optDim = this.option.dimension; var listDimensions = list.dimensions; if (optDim == null && !listDimensions.length) { return; } if (optDim != null) { return list.getDimension(optDim); } var dimNames = list.dimensions; for (var i = dimNames.length - 1; i >= 0; i--) { var dimName = dimNames[i]; var dimInfo = list.getDimensionInfo(dimName); if (!dimInfo.isCalculationCoord) { return dimName; } } }, /** * @public * @override */ getExtent: function () { return this._dataExtent.slice(); }, /** * @protected */ completeVisualOption: function () { var ecModel = this.ecModel; var thisOption = this.option; var base = {inRange: thisOption.inRange, outOfRange: thisOption.outOfRange}; var target = thisOption.target || (thisOption.target = {}); var controller = thisOption.controller || (thisOption.controller = {}); merge(target, base); // Do not override merge(controller, base); // Do not override var isCategory = this.isCategory(); completeSingle.call(this, target); completeSingle.call(this, controller); completeInactive.call(this, target, 'inRange', 'outOfRange'); // completeInactive.call(this, target, 'outOfRange', 'inRange'); completeController.call(this, controller); function completeSingle(base) { // Compatible with ec2 dataRange.color. // The mapping order of dataRange.color is: [high value, ..., low value] // whereas inRange.color and outOfRange.color is [low value, ..., high value] // Notice: ec2 has no inverse. if (isArray$3(thisOption.color) // If there has been inRange: {symbol: ...}, adding color is a mistake. // So adding color only when no inRange defined. && !base.inRange ) { base.inRange = {color: thisOption.color.slice().reverse()}; } // Compatible with previous logic, always give a defautl color, otherwise // simple config with no inRange and outOfRange will not work. // Originally we use visualMap.color as the default color, but setOption at // the second time the default color will be erased. So we change to use // constant DEFAULT_COLOR. // If user do not want the defualt color, set inRange: {color: null}. base.inRange = base.inRange || {color: ecModel.get('gradientColor')}; // If using shortcut like: {inRange: 'symbol'}, complete default value. each$25(this.stateList, function (state) { var visualType = base[state]; if (isString(visualType)) { var defa = visualDefault.get(visualType, 'active', isCategory); if (defa) { base[state] = {}; base[state][visualType] = defa; } else { // Mark as not specified. delete base[state]; } } }, this); } function completeInactive(base, stateExist, stateAbsent) { var optExist = base[stateExist]; var optAbsent = base[stateAbsent]; if (optExist && !optAbsent) { optAbsent = base[stateAbsent] = {}; each$25(optExist, function (visualData, visualType) { if (!VisualMapping.isValidType(visualType)) { return; } var defa = visualDefault.get(visualType, 'inactive', isCategory); if (defa != null) { optAbsent[visualType] = defa; // Compatibable with ec2: // Only inactive color to rgba(0,0,0,0) can not // make label transparent, so use opacity also. if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha') ) { optAbsent.opacity = [0, 0]; } } }); } } function completeController(controller) { var symbolExists = (controller.inRange || {}).symbol || (controller.outOfRange || {}).symbol; var symbolSizeExists = (controller.inRange || {}).symbolSize || (controller.outOfRange || {}).symbolSize; var inactiveColor = this.get('inactiveColor'); each$25(this.stateList, function (state) { var itemSize = this.itemSize; var visuals = controller[state]; // Set inactive color for controller if no other color // attr (like colorAlpha) specified. if (!visuals) { visuals = controller[state] = { color: isCategory ? inactiveColor : [inactiveColor] }; } // Consistent symbol and symbolSize if not specified. if (visuals.symbol == null) { visuals.symbol = symbolExists && clone(symbolExists) || (isCategory ? 'roundRect' : ['roundRect']); } if (visuals.symbolSize == null) { visuals.symbolSize = symbolSizeExists && clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]); } // Filter square and none. visuals.symbol = mapVisual$2(visuals.symbol, function (symbol) { return (symbol === 'none' || symbol === 'square') ? 'roundRect' : symbol; }); // Normalize symbolSize var symbolSize = visuals.symbolSize; if (symbolSize != null) { var max = -Infinity; // symbolSize can be object when categories defined. eachVisual(symbolSize, function (value) { value > max && (max = value); }); visuals.symbolSize = mapVisual$2(symbolSize, function (value) { return linearMap$2(value, [0, max], [0, itemSize[0]], true); }); } }, this); } }, /** * @protected */ resetItemSize: function () { this.itemSize = [ parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight')) ]; }, /** * @public */ isCategory: function () { return !!this.option.categories; }, /** * @public * @abstract */ setSelected: noop$2, /** * @public * @abstract * @param {*|module:echarts/data/List} valueOrData * @param {number} dataIndex * @return {string} state See this.stateList */ getValueState: noop$2, /** * FIXME * Do not publish to thirt-part-dev temporarily * util the interface is stable. (Should it return * a function but not visual meta?) * * @pubilc * @abstract * @param {Function} getColorVisual * params: value, valueState * return: color * @return {Object} visualMeta * should includes {stops, outerColors} * outerColor means [colorBeyondMinValue, colorBeyondMaxValue] */ getVisualMeta: noop$2 }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Constant var DEFAULT_BAR_BOUND = [20, 140]; var ContinuousModel = VisualMapModel.extend({ type: 'visualMap.continuous', /** * @protected */ defaultOption: { align: 'auto', // 'auto', 'left', 'right', 'top', 'bottom' calculable: false, // This prop effect default component type determine, // See echarts/component/visualMap/typeDefaulter. range: null, // selected range. In default case `range` is [min, max] // and can auto change along with modification of min max, // util use specifid a range. realtime: true, // Whether realtime update. itemHeight: null, // The length of the range control edge. itemWidth: null, // The length of the other side. hoverLink: true, // Enable hover highlight. hoverLinkDataSize: null,// The size of hovered data. hoverLinkOnHandle: null // Whether trigger hoverLink when hover handle. // If not specified, follow the value of `realtime`. }, /** * @override */ optionUpdated: function (newOption, isInit) { ContinuousModel.superApply(this, 'optionUpdated', arguments); this.resetExtent(); this.resetVisual(function (mappingOption) { mappingOption.mappingMethod = 'linear'; mappingOption.dataExtent = this.getExtent(); }); this._resetRange(); }, /** * @protected * @override */ resetItemSize: function () { ContinuousModel.superApply(this, 'resetItemSize', arguments); var itemSize = this.itemSize; this._orient === 'horizontal' && itemSize.reverse(); (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]); (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]); }, /** * @private */ _resetRange: function () { var dataExtent = this.getExtent(); var range = this.option.range; if (!range || range.auto) { // `range` should always be array (so we dont use other // value like 'auto') for user-friend. (consider getOption). dataExtent.auto = 1; this.option.range = dataExtent; } else if (isArray(range)) { if (range[0] > range[1]) { range.reverse(); } range[0] = Math.max(range[0], dataExtent[0]); range[1] = Math.min(range[1], dataExtent[1]); } }, /** * @protected * @override */ completeVisualOption: function () { VisualMapModel.prototype.completeVisualOption.apply(this, arguments); each$1(this.stateList, function (state) { var symbolSize = this.option.controller[state].symbolSize; if (symbolSize && symbolSize[0] !== symbolSize[1]) { symbolSize[0] = 0; // For good looking. } }, this); }, /** * @override */ setSelected: function (selected) { this.option.range = selected.slice(); this._resetRange(); }, /** * @public */ getSelected: function () { var dataExtent = this.getExtent(); var dataInterval = asc( (this.get('range') || []).slice() ); // Clamp dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]); dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]); dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]); dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]); return dataInterval; }, /** * @override */ getValueState: function (value) { var range = this.option.range; var dataExtent = this.getExtent(); // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'. // range[1] is processed likewise. return ( (range[0] <= dataExtent[0] || range[0] <= value) && (range[1] >= dataExtent[1] || value <= range[1]) ) ? 'inRange' : 'outOfRange'; }, /** * @params {Array.} range target value: range[0] <= value && value <= range[1] * @return {Array.} [{seriesId, dataIndices: >}, ...] */ findTargetDataIndices: function (range) { var result = []; this.eachTargetSeries(function (seriesModel) { var dataIndices = []; var data = seriesModel.getData(); data.each(this.getDataDimension(data), function (value, dataIndex) { range[0] <= value && value <= range[1] && dataIndices.push(dataIndex); }, this); result.push({seriesId: seriesModel.id, dataIndex: dataIndices}); }, this); return result; }, /** * @implement */ getVisualMeta: function (getColorVisual) { var oVals = getColorStopValues(this, 'outOfRange', this.getExtent()); var iVals = getColorStopValues(this, 'inRange', this.option.range.slice()); var stops = []; function setStop(value, valueState) { stops.push({ value: value, color: getColorVisual(value, valueState) }); } // Format to: outOfRange -- inRange -- outOfRange. var iIdx = 0; var oIdx = 0; var iLen = iVals.length; var oLen = oVals.length; for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) { // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored. if (oVals[oIdx] < iVals[iIdx]) { setStop(oVals[oIdx], 'outOfRange'); } } for (var first = 1; iIdx < iLen; iIdx++, first = 0) { // If range is full, value beyond min, max will be clamped. // make a singularity first && stops.length && setStop(iVals[iIdx], 'outOfRange'); setStop(iVals[iIdx], 'inRange'); } for (var first = 1; oIdx < oLen; oIdx++) { if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) { // make a singularity if (first) { stops.length && setStop(stops[stops.length - 1].value, 'outOfRange'); first = 0; } setStop(oVals[oIdx], 'outOfRange'); } } var stopsLen = stops.length; return { stops: stops, outerColors: [ stopsLen ? stops[0].color : 'transparent', stopsLen ? stops[stopsLen - 1].color : 'transparent' ] }; } }); function getColorStopValues(visualMapModel, valueState, dataExtent) { if (dataExtent[0] === dataExtent[1]) { return dataExtent.slice(); } // When using colorHue mapping, it is not linear color any more. // Moreover, canvas gradient seems not to be accurate linear. // FIXME // Should be arbitrary value 100? or based on pixel size? var count = 200; var step = (dataExtent[1] - dataExtent[0]) / count; var value = dataExtent[0]; var stopValues = []; for (var i = 0; i <= count && value < dataExtent[1]; i++) { stopValues.push(value); value += step; } stopValues.push(dataExtent[1]); return stopValues; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var VisualMapView = extendComponentView({ type: 'visualMap', /** * @readOnly * @type {Object} */ autoPositionValues: {left: 1, right: 1, top: 1, bottom: 1}, init: function (ecModel, api) { /** * @readOnly * @type {module:echarts/model/Global} */ this.ecModel = ecModel; /** * @readOnly * @type {module:echarts/ExtensionAPI} */ this.api = api; /** * @readOnly * @type {module:echarts/component/visualMap/visualMapModel} */ this.visualMapModel; }, /** * @protected */ render: function (visualMapModel, ecModel, api, payload) { this.visualMapModel = visualMapModel; if (visualMapModel.get('show') === false) { this.group.removeAll(); return; } this.doRender.apply(this, arguments); }, /** * @protected */ renderBackground: function (group) { var visualMapModel = this.visualMapModel; var padding = normalizeCssArray$1(visualMapModel.get('padding') || 0); var rect = group.getBoundingRect(); group.add(new Rect({ z2: -1, // Lay background rect on the lowest layer. silent: true, shape: { x: rect.x - padding[3], y: rect.y - padding[0], width: rect.width + padding[3] + padding[1], height: rect.height + padding[0] + padding[2] }, style: { fill: visualMapModel.get('backgroundColor'), stroke: visualMapModel.get('borderColor'), lineWidth: visualMapModel.get('borderWidth') } })); }, /** * @protected * @param {number} targetValue can be Infinity or -Infinity * @param {string=} visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize' * @param {Object} [opts] * @param {string=} [opts.forceState] Specify state, instead of using getValueState method. * @param {string=} [opts.convertOpacityToAlpha=false] For color gradient in controller widget. * @return {*} Visual value. */ getControllerVisual: function (targetValue, visualCluster, opts) { opts = opts || {}; var forceState = opts.forceState; var visualMapModel = this.visualMapModel; var visualObj = {}; // Default values. if (visualCluster === 'symbol') { visualObj.symbol = visualMapModel.get('itemSymbol'); } if (visualCluster === 'color') { var defaultColor = visualMapModel.get('contentColor'); visualObj.color = defaultColor; } function getter(key) { return visualObj[key]; } function setter(key, value) { visualObj[key] = value; } var mappings = visualMapModel.controllerVisuals[ forceState || visualMapModel.getValueState(targetValue) ]; var visualTypes = VisualMapping.prepareVisualTypes(mappings); each$1(visualTypes, function (type) { var visualMapping = mappings[type]; if (opts.convertOpacityToAlpha && type === 'opacity') { type = 'colorAlpha'; visualMapping = mappings.__alphaForOpacity; } if (VisualMapping.dependsOn(type, visualCluster)) { visualMapping && visualMapping.applyVisual( targetValue, getter, setter ); } }); return visualObj[visualCluster]; }, /** * @protected */ positionGroup: function (group) { var model = this.visualMapModel; var api = this.api; positionElement( group, model.getBoxLayoutParams(), {width: api.getWidth(), height: api.getHeight()} ); }, /** * @protected * @abstract */ doRender: noop }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * @param {module:echarts/component/visualMap/VisualMapModel} visualMapModel\ * @param {module:echarts/ExtensionAPI} api * @param {Array.} itemSize always [short, long] * @return {string} 'left' or 'right' or 'top' or 'bottom' */ function getItemAlign(visualMapModel, api, itemSize) { var modelOption = visualMapModel.option; var itemAlign = modelOption.align; if (itemAlign != null && itemAlign !== 'auto') { return itemAlign; } // Auto decision align. var ecSize = {width: api.getWidth(), height: api.getHeight()}; var realIndex = modelOption.orient === 'horizontal' ? 1 : 0; var paramsSet = [ ['left', 'right', 'width'], ['top', 'bottom', 'height'] ]; var reals = paramsSet[realIndex]; var fakeValue = [0, null, 10]; var layoutInput = {}; for (var i = 0; i < 3; i++) { layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i]; layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]]; } var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex]; var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding); return reals[ (rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1 ]; } /** * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and * dataIndexInside means filtered index. */ function convertDataIndex(batch) { each$1(batch || [], function (batchItem) { if (batch.dataIndex != null) { batch.dataIndexInside = batch.dataIndex; batch.dataIndex = null; } }); return batch; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var linearMap$3 = linearMap; var each$26 = each$1; var mathMin$7 = Math.min; var mathMax$7 = Math.max; // Arbitrary value var HOVER_LINK_SIZE = 12; var HOVER_LINK_OUT = 6; // Notice: // Any "interval" should be by the order of [low, high]. // "handle0" (handleIndex === 0) maps to // low data value: this._dataInterval[0] and has low coord. // "handle1" (handleIndex === 1) maps to // high data value: this._dataInterval[1] and has high coord. // The logic of transform is implemented in this._createBarGroup. var ContinuousView = VisualMapView.extend({ type: 'visualMap.continuous', /** * @override */ init: function () { ContinuousView.superApply(this, 'init', arguments); /** * @private */ this._shapes = {}; /** * @private */ this._dataInterval = []; /** * @private */ this._handleEnds = []; /** * @private */ this._orient; /** * @private */ this._useHandle; /** * @private */ this._hoverLinkDataIndices = []; /** * @private */ this._dragging; /** * @private */ this._hovering; }, /** * @protected * @override */ doRender: function (visualMapModel, ecModel, api, payload) { if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) { this._buildView(); } }, /** * @private */ _buildView: function () { this.group.removeAll(); var visualMapModel = this.visualMapModel; var thisGroup = this.group; this._orient = visualMapModel.get('orient'); this._useHandle = visualMapModel.get('calculable'); this._resetInterval(); this._renderBar(thisGroup); var dataRangeText = visualMapModel.get('text'); this._renderEndsText(thisGroup, dataRangeText, 0); this._renderEndsText(thisGroup, dataRangeText, 1); // Do this for background size calculation. this._updateView(true); // After updating view, inner shapes is built completely, // and then background can be rendered. this.renderBackground(thisGroup); // Real update view this._updateView(); this._enableHoverLinkToSeries(); this._enableHoverLinkFromSeries(); this.positionGroup(thisGroup); }, /** * @private */ _renderEndsText: function (group, dataRangeText, endsIndex) { if (!dataRangeText) { return; } // Compatible with ec2, text[0] map to high value, text[1] map low value. var text = dataRangeText[1 - endsIndex]; text = text != null ? text + '' : ''; var visualMapModel = this.visualMapModel; var textGap = visualMapModel.get('textGap'); var itemSize = visualMapModel.itemSize; var barGroup = this._shapes.barGroup; var position = this._applyTransform( [ itemSize[0] / 2, endsIndex === 0 ? -textGap : itemSize[1] + textGap ], barGroup ); var align = this._applyTransform( endsIndex === 0 ? 'bottom' : 'top', barGroup ); var orient = this._orient; var textStyleModel = this.visualMapModel.textStyleModel; this.group.add(new Text({ style: { x: position[0], y: position[1], textVerticalAlign: orient === 'horizontal' ? 'middle' : align, textAlign: orient === 'horizontal' ? align : 'center', text: text, textFont: textStyleModel.getFont(), textFill: textStyleModel.getTextColor() } })); }, /** * @private */ _renderBar: function (targetGroup) { var visualMapModel = this.visualMapModel; var shapes = this._shapes; var itemSize = visualMapModel.itemSize; var orient = this._orient; var useHandle = this._useHandle; var itemAlign = getItemAlign(visualMapModel, this.api, itemSize); var barGroup = shapes.barGroup = this._createBarGroup(itemAlign); // Bar barGroup.add(shapes.outOfRange = createPolygon()); barGroup.add(shapes.inRange = createPolygon( null, useHandle ? getCursor$1(this._orient) : null, bind(this._dragHandle, this, 'all', false), bind(this._dragHandle, this, 'all', true) )); var textRect = visualMapModel.textStyleModel.getTextRect('国'); var textSize = mathMax$7(textRect.width, textRect.height); // Handle if (useHandle) { shapes.handleThumbs = []; shapes.handleLabels = []; shapes.handleLabelPoints = []; this._createHandle(barGroup, 0, itemSize, textSize, orient, itemAlign); this._createHandle(barGroup, 1, itemSize, textSize, orient, itemAlign); } this._createIndicator(barGroup, itemSize, textSize, orient); targetGroup.add(barGroup); }, /** * @private */ _createHandle: function (barGroup, handleIndex, itemSize, textSize, orient) { var onDrift = bind(this._dragHandle, this, handleIndex, false); var onDragEnd = bind(this._dragHandle, this, handleIndex, true); var handleThumb = createPolygon( createHandlePoints(handleIndex, textSize), getCursor$1(this._orient), onDrift, onDragEnd ); handleThumb.position[0] = itemSize[0]; barGroup.add(handleThumb); // Text is always horizontal layout but should not be effected by // transform (orient/inverse). So label is built separately but not // use zrender/graphic/helper/RectText, and is located based on view // group (according to handleLabelPoint) but not barGroup. var textStyleModel = this.visualMapModel.textStyleModel; var handleLabel = new Text({ draggable: true, drift: onDrift, onmousemove: function (e) { // Fot mobile devicem, prevent screen slider on the button. stop(e.event); }, ondragend: onDragEnd, style: { x: 0, y: 0, text: '', textFont: textStyleModel.getFont(), textFill: textStyleModel.getTextColor() } }); this.group.add(handleLabel); var handleLabelPoint = [ orient === 'horizontal' ? textSize / 2 : textSize * 1.5, orient === 'horizontal' ? (handleIndex === 0 ? -(textSize * 1.5) : (textSize * 1.5)) : (handleIndex === 0 ? -textSize / 2 : textSize / 2) ]; var shapes = this._shapes; shapes.handleThumbs[handleIndex] = handleThumb; shapes.handleLabelPoints[handleIndex] = handleLabelPoint; shapes.handleLabels[handleIndex] = handleLabel; }, /** * @private */ _createIndicator: function (barGroup, itemSize, textSize, orient) { var indicator = createPolygon([[0, 0]], 'move'); indicator.position[0] = itemSize[0]; indicator.attr({invisible: true, silent: true}); barGroup.add(indicator); var textStyleModel = this.visualMapModel.textStyleModel; var indicatorLabel = new Text({ silent: true, invisible: true, style: { x: 0, y: 0, text: '', textFont: textStyleModel.getFont(), textFill: textStyleModel.getTextColor() } }); this.group.add(indicatorLabel); var indicatorLabelPoint = [ orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT + 3, 0 ]; var shapes = this._shapes; shapes.indicator = indicator; shapes.indicatorLabel = indicatorLabel; shapes.indicatorLabelPoint = indicatorLabelPoint; }, /** * @private */ _dragHandle: function (handleIndex, isEnd, dx, dy) { if (!this._useHandle) { return; } this._dragging = !isEnd; if (!isEnd) { // Transform dx, dy to bar coordination. var vertex = this._applyTransform([dx, dy], this._shapes.barGroup, true); this._updateInterval(handleIndex, vertex[1]); // Considering realtime, update view should be executed // before dispatch action. this._updateView(); } // dragEnd do not dispatch action when realtime. if (isEnd === !this.visualMapModel.get('realtime')) { // jshint ignore:line this.api.dispatchAction({ type: 'selectDataRange', from: this.uid, visualMapId: this.visualMapModel.id, selected: this._dataInterval.slice() }); } if (isEnd) { !this._hovering && this._clearHoverLinkToSeries(); } else if (useHoverLinkOnHandle(this.visualMapModel)) { this._doHoverLinkToSeries(this._handleEnds[handleIndex], false); } }, /** * @private */ _resetInterval: function () { var visualMapModel = this.visualMapModel; var dataInterval = this._dataInterval = visualMapModel.getSelected(); var dataExtent = visualMapModel.getExtent(); var sizeExtent = [0, visualMapModel.itemSize[1]]; this._handleEnds = [ linearMap$3(dataInterval[0], dataExtent, sizeExtent, true), linearMap$3(dataInterval[1], dataExtent, sizeExtent, true) ]; }, /** * @private * @param {(number|string)} handleIndex 0 or 1 or 'all' * @param {number} dx * @param {number} dy */ _updateInterval: function (handleIndex, delta) { delta = delta || 0; var visualMapModel = this.visualMapModel; var handleEnds = this._handleEnds; var sizeExtent = [0, visualMapModel.itemSize[1]]; sliderMove( delta, handleEnds, sizeExtent, handleIndex, // cross is forbiden 0 ); var dataExtent = visualMapModel.getExtent(); // Update data interval. this._dataInterval = [ linearMap$3(handleEnds[0], sizeExtent, dataExtent, true), linearMap$3(handleEnds[1], sizeExtent, dataExtent, true) ]; }, /** * @private */ _updateView: function (forSketch) { var visualMapModel = this.visualMapModel; var dataExtent = visualMapModel.getExtent(); var shapes = this._shapes; var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]]; var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds; var visualInRange = this._createBarVisual( this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange' ); var visualOutOfRange = this._createBarVisual( dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange' ); shapes.inRange .setStyle({ fill: visualInRange.barColor, opacity: visualInRange.opacity }) .setShape('points', visualInRange.barPoints); shapes.outOfRange .setStyle({ fill: visualOutOfRange.barColor, opacity: visualOutOfRange.opacity }) .setShape('points', visualOutOfRange.barPoints); this._updateHandle(inRangeHandleEnds, visualInRange); }, /** * @private */ _createBarVisual: function (dataInterval, dataExtent, handleEnds, forceState) { var opts = { forceState: forceState, convertOpacityToAlpha: true }; var colorStops = this._makeColorGradient(dataInterval, opts); var symbolSizes = [ this.getControllerVisual(dataInterval[0], 'symbolSize', opts), this.getControllerVisual(dataInterval[1], 'symbolSize', opts) ]; var barPoints = this._createBarPoints(handleEnds, symbolSizes); return { barColor: new LinearGradient(0, 0, 0, 1, colorStops), barPoints: barPoints, handlesColor: [ colorStops[0].color, colorStops[colorStops.length - 1].color ] }; }, /** * @private */ _makeColorGradient: function (dataInterval, opts) { // Considering colorHue, which is not linear, so we have to sample // to calculate gradient color stops, but not only caculate head // and tail. var sampleNumber = 100; // Arbitrary value. var colorStops = []; var step = (dataInterval[1] - dataInterval[0]) / sampleNumber; colorStops.push({ color: this.getControllerVisual(dataInterval[0], 'color', opts), offset: 0 }); for (var i = 1; i < sampleNumber; i++) { var currValue = dataInterval[0] + step * i; if (currValue > dataInterval[1]) { break; } colorStops.push({ color: this.getControllerVisual(currValue, 'color', opts), offset: i / sampleNumber }); } colorStops.push({ color: this.getControllerVisual(dataInterval[1], 'color', opts), offset: 1 }); return colorStops; }, /** * @private */ _createBarPoints: function (handleEnds, symbolSizes) { var itemSize = this.visualMapModel.itemSize; return [ [itemSize[0] - symbolSizes[0], handleEnds[0]], [itemSize[0], handleEnds[0]], [itemSize[0], handleEnds[1]], [itemSize[0] - symbolSizes[1], handleEnds[1]] ]; }, /** * @private */ _createBarGroup: function (itemAlign) { var orient = this._orient; var inverse = this.visualMapModel.get('inverse'); return new Group( (orient === 'horizontal' && !inverse) ? {scale: itemAlign === 'bottom' ? [1, 1] : [-1, 1], rotation: Math.PI / 2} : (orient === 'horizontal' && inverse) ? {scale: itemAlign === 'bottom' ? [-1, 1] : [1, 1], rotation: -Math.PI / 2} : (orient === 'vertical' && !inverse) ? {scale: itemAlign === 'left' ? [1, -1] : [-1, -1]} : {scale: itemAlign === 'left' ? [1, 1] : [-1, 1]} ); }, /** * @private */ _updateHandle: function (handleEnds, visualInRange) { if (!this._useHandle) { return; } var shapes = this._shapes; var visualMapModel = this.visualMapModel; var handleThumbs = shapes.handleThumbs; var handleLabels = shapes.handleLabels; each$26([0, 1], function (handleIndex) { var handleThumb = handleThumbs[handleIndex]; handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]); handleThumb.position[1] = handleEnds[handleIndex]; // Update handle label position. var textPoint = applyTransform$1( shapes.handleLabelPoints[handleIndex], getTransform(handleThumb, this.group) ); handleLabels[handleIndex].setStyle({ x: textPoint[0], y: textPoint[1], text: visualMapModel.formatValueText(this._dataInterval[handleIndex]), textVerticalAlign: 'middle', textAlign: this._applyTransform( this._orient === 'horizontal' ? (handleIndex === 0 ? 'bottom' : 'top') : 'left', shapes.barGroup ) }); }, this); }, /** * @private * @param {number} cursorValue * @param {number} textValue * @param {string} [rangeSymbol] * @param {number} [halfHoverLinkSize] */ _showIndicator: function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) { var visualMapModel = this.visualMapModel; var dataExtent = visualMapModel.getExtent(); var itemSize = visualMapModel.itemSize; var sizeExtent = [0, itemSize[1]]; var pos = linearMap$3(cursorValue, dataExtent, sizeExtent, true); var shapes = this._shapes; var indicator = shapes.indicator; if (!indicator) { return; } indicator.position[1] = pos; indicator.attr('invisible', false); indicator.setShape('points', createIndicatorPoints( !!rangeSymbol, halfHoverLinkSize, pos, itemSize[1] )); var opts = {convertOpacityToAlpha: true}; var color = this.getControllerVisual(cursorValue, 'color', opts); indicator.setStyle('fill', color); // Update handle label position. var textPoint = applyTransform$1( shapes.indicatorLabelPoint, getTransform(indicator, this.group) ); var indicatorLabel = shapes.indicatorLabel; indicatorLabel.attr('invisible', false); var align = this._applyTransform('left', shapes.barGroup); var orient = this._orient; indicatorLabel.setStyle({ text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue), textVerticalAlign: orient === 'horizontal' ? align : 'middle', textAlign: orient === 'horizontal' ? 'center' : align, x: textPoint[0], y: textPoint[1] }); }, /** * @private */ _enableHoverLinkToSeries: function () { var self = this; this._shapes.barGroup .on('mousemove', function (e) { self._hovering = true; if (!self._dragging) { var itemSize = self.visualMapModel.itemSize; var pos = self._applyTransform( [e.offsetX, e.offsetY], self._shapes.barGroup, true, true ); // For hover link show when hover handle, which might be // below or upper than sizeExtent. pos[1] = mathMin$7(mathMax$7(0, pos[1]), itemSize[1]); self._doHoverLinkToSeries( pos[1], 0 <= pos[0] && pos[0] <= itemSize[0] ); } }) .on('mouseout', function () { // When mouse is out of handle, hoverLink still need // to be displayed when realtime is set as false. self._hovering = false; !self._dragging && self._clearHoverLinkToSeries(); }); }, /** * @private */ _enableHoverLinkFromSeries: function () { var zr = this.api.getZr(); if (this.visualMapModel.option.hoverLink) { zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this); zr.on('mouseout', this._hideIndicator, this); } else { this._clearHoverLinkFromSeries(); } }, /** * @private */ _doHoverLinkToSeries: function (cursorPos, hoverOnBar) { var visualMapModel = this.visualMapModel; var itemSize = visualMapModel.itemSize; if (!visualMapModel.option.hoverLink) { return; } var sizeExtent = [0, itemSize[1]]; var dataExtent = visualMapModel.getExtent(); // For hover link show when hover handle, which might be below or upper than sizeExtent. cursorPos = mathMin$7(mathMax$7(sizeExtent[0], cursorPos), sizeExtent[1]); var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent); var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize]; var cursorValue = linearMap$3(cursorPos, sizeExtent, dataExtent, true); var valueRange = [ linearMap$3(hoverRange[0], sizeExtent, dataExtent, true), linearMap$3(hoverRange[1], sizeExtent, dataExtent, true) ]; // Consider data range is out of visualMap range, see test/visualMap-continuous.html, // where china and india has very large population. hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity); hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity); // Do not show indicator when mouse is over handle, // otherwise labels overlap, especially when dragging. if (hoverOnBar) { if (valueRange[0] === -Infinity) { this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize); } else if (valueRange[1] === Infinity) { this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize); } else { this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize); } } // When realtime is set as false, handles, which are in barGroup, // also trigger hoverLink, which help user to realize where they // focus on when dragging. (see test/heatmap-large.html) // When realtime is set as true, highlight will not show when hover // handle, because the label on handle, which displays a exact value // but not range, might mislead users. var oldBatch = this._hoverLinkDataIndices; var newBatch = []; if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) { newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange); } var resultBatches = compressBatches(oldBatch, newBatch); this._dispatchHighDown('downplay', convertDataIndex(resultBatches[0])); this._dispatchHighDown('highlight', convertDataIndex(resultBatches[1])); }, /** * @private */ _hoverLinkFromSeriesMouseOver: function (e) { var el = e.target; var visualMapModel = this.visualMapModel; if (!el || el.dataIndex == null) { return; } var dataModel = this.ecModel.getSeriesByIndex(el.seriesIndex); if (!visualMapModel.isTargetSeries(dataModel)) { return; } var data = dataModel.getData(el.dataType); var value = data.get(visualMapModel.getDataDimension(data), el.dataIndex, true); if (!isNaN(value)) { this._showIndicator(value, value); } }, /** * @private */ _hideIndicator: function () { var shapes = this._shapes; shapes.indicator && shapes.indicator.attr('invisible', true); shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true); }, /** * @private */ _clearHoverLinkToSeries: function () { this._hideIndicator(); var indices = this._hoverLinkDataIndices; this._dispatchHighDown('downplay', convertDataIndex(indices)); indices.length = 0; }, /** * @private */ _clearHoverLinkFromSeries: function () { this._hideIndicator(); var zr = this.api.getZr(); zr.off('mouseover', this._hoverLinkFromSeriesMouseOver); zr.off('mouseout', this._hideIndicator); }, /** * @private */ _applyTransform: function (vertex, element, inverse, global) { var transform = getTransform(element, global ? null : this.group); return graphic[ isArray(vertex) ? 'applyTransform' : 'transformDirection' ](vertex, transform, inverse); }, /** * @private */ _dispatchHighDown: function (type, batch) { batch && batch.length && this.api.dispatchAction({ type: type, batch: batch }); }, /** * @override */ dispose: function () { this._clearHoverLinkFromSeries(); this._clearHoverLinkToSeries(); }, /** * @override */ remove: function () { this._clearHoverLinkFromSeries(); this._clearHoverLinkToSeries(); } }); function createPolygon(points, cursor, onDrift, onDragEnd) { return new Polygon({ shape: {points: points}, draggable: !!onDrift, cursor: cursor, drift: onDrift, onmousemove: function (e) { // Fot mobile devicem, prevent screen slider on the button. stop(e.event); }, ondragend: onDragEnd }); } function createHandlePoints(handleIndex, textSize) { return handleIndex === 0 ? [[0, 0], [textSize, 0], [textSize, -textSize]] : [[0, 0], [textSize, 0], [textSize, textSize]]; } function createIndicatorPoints(isRange, halfHoverLinkSize, pos, extentMax) { return isRange ? [ // indicate range [0, -mathMin$7(halfHoverLinkSize, mathMax$7(pos, 0))], [HOVER_LINK_OUT, 0], [0, mathMin$7(halfHoverLinkSize, mathMax$7(extentMax - pos, 0))] ] : [ // indicate single value [0, 0], [5, -5], [5, 5] ]; } function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) { var halfHoverLinkSize = HOVER_LINK_SIZE / 2; var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize'); if (hoverLinkDataSize) { halfHoverLinkSize = linearMap$3(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2; } return halfHoverLinkSize; } function useHoverLinkOnHandle(visualMapModel) { var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle'); return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle); } function getCursor$1(orient) { return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var actionInfo$2 = { type: 'selectDataRange', event: 'dataRangeSelected', // FIXME use updateView appears wrong update: 'update' }; registerAction(actionInfo$2, function (payload, ecModel) { ecModel.eachComponent({mainType: 'visualMap', query: payload}, function (model) { model.setSelected(payload.selected); }); }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * DataZoom component entry */ registerPreprocessor(preprocessor$2); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var PiecewiseModel = VisualMapModel.extend({ type: 'visualMap.piecewise', /** * Order Rule: * * option.categories / option.pieces / option.text / option.selected: * If !option.inverse, * Order when vertical: ['top', ..., 'bottom']. * Order when horizontal: ['left', ..., 'right']. * If option.inverse, the meaning of * the order should be reversed. * * this._pieceList: * The order is always [low, ..., high]. * * Mapping from location to low-high: * If !option.inverse * When vertical, top is high. * When horizontal, right is high. * If option.inverse, reverse. */ /** * @protected */ defaultOption: { selected: null, // Object. If not specified, means selected. // When pieces and splitNumber: {'0': true, '5': true} // When categories: {'cate1': false, 'cate3': true} // When selected === false, means all unselected. minOpen: false, // Whether include values that smaller than `min`. maxOpen: false, // Whether include values that bigger than `max`. align: 'auto', // 'auto', 'left', 'right' itemWidth: 20, // When put the controller vertically, it is the length of // horizontal side of each item. Otherwise, vertical side. itemHeight: 14, // When put the controller vertically, it is the length of // vertical side of each item. Otherwise, horizontal side. itemSymbol: 'roundRect', pieceList: null, // Each item is Object, with some of those attrs: // {min, max, lt, gt, lte, gte, value, // color, colorSaturation, colorAlpha, opacity, // symbol, symbolSize}, which customize the range or visual // coding of the certain piece. Besides, see "Order Rule". categories: null, // category names, like: ['some1', 'some2', 'some3']. // Attr min/max are ignored when categories set. See "Order Rule" splitNumber: 5, // If set to 5, auto split five pieces equally. // If set to 0 and component type not set, component type will be // determined as "continuous". (It is less reasonable but for ec2 // compatibility, see echarts/component/visualMap/typeDefaulter) selectedMode: 'multiple', // Can be 'multiple' or 'single'. itemGap: 10, // The gap between two items, in px. hoverLink: true, // Enable hover highlight. showLabel: null // By default, when text is used, label will hide (the logic // is remained for compatibility reason) }, /** * @override */ optionUpdated: function (newOption, isInit) { PiecewiseModel.superApply(this, 'optionUpdated', arguments); /** * The order is always [low, ..., high]. * [{text: string, interval: Array.}, ...] * @private * @type {Array.} */ this._pieceList = []; this.resetExtent(); /** * 'pieces', 'categories', 'splitNumber' * @type {string} */ var mode = this._mode = this._determineMode(); resetMethods[this._mode].call(this); this._resetSelected(newOption, isInit); var categories = this.option.categories; this.resetVisual(function (mappingOption, state) { if (mode === 'categories') { mappingOption.mappingMethod = 'category'; mappingOption.categories = clone(categories); } else { mappingOption.dataExtent = this.getExtent(); mappingOption.mappingMethod = 'piecewise'; mappingOption.pieceList = map(this._pieceList, function (piece) { var piece = clone(piece); if (state !== 'inRange') { // FIXME // outOfRange do not support special visual in pieces. piece.visual = null; } return piece; }); } }); }, /** * @protected * @override */ completeVisualOption: function () { // Consider this case: // visualMap: { // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}] // } // where no inRange/outOfRange set but only pieces. So we should make // default inRange/outOfRange for this case, otherwise visuals that only // appear in `pieces` will not be taken into account in visual encoding. var option = this.option; var visualTypesInPieces = {}; var visualTypes = VisualMapping.listVisualTypes(); var isCategory = this.isCategory(); each$1(option.pieces, function (piece) { each$1(visualTypes, function (visualType) { if (piece.hasOwnProperty(visualType)) { visualTypesInPieces[visualType] = 1; } }); }); each$1(visualTypesInPieces, function (v, visualType) { var exists = 0; each$1(this.stateList, function (state) { exists |= has(option, state, visualType) || has(option.target, state, visualType); }, this); !exists && each$1(this.stateList, function (state) { (option[state] || (option[state] = {}))[visualType] = visualDefault.get( visualType, state === 'inRange' ? 'active' : 'inactive', isCategory ); }); }, this); function has(obj, state, visualType) { return obj && obj[state] && ( isObject$1(obj[state]) ? obj[state].hasOwnProperty(visualType) : obj[state] === visualType // e.g., inRange: 'symbol' ); } VisualMapModel.prototype.completeVisualOption.apply(this, arguments); }, _resetSelected: function (newOption, isInit) { var thisOption = this.option; var pieceList = this._pieceList; // Selected do not merge but all override. var selected = (isInit ? thisOption : newOption).selected || {}; thisOption.selected = selected; // Consider 'not specified' means true. each$1(pieceList, function (piece, index) { var key = this.getSelectedMapKey(piece); if (!selected.hasOwnProperty(key)) { selected[key] = true; } }, this); if (thisOption.selectedMode === 'single') { // Ensure there is only one selected. var hasSel = false; each$1(pieceList, function (piece, index) { var key = this.getSelectedMapKey(piece); if (selected[key]) { hasSel ? (selected[key] = false) : (hasSel = true); } }, this); } // thisOption.selectedMode === 'multiple', default: all selected. }, /** * @public */ getSelectedMapKey: function (piece) { return this._mode === 'categories' ? piece.value + '' : piece.index + ''; }, /** * @public */ getPieceList: function () { return this._pieceList; }, /** * @private * @return {string} */ _determineMode: function () { var option = this.option; return option.pieces && option.pieces.length > 0 ? 'pieces' : this.option.categories ? 'categories' : 'splitNumber'; }, /** * @public * @override */ setSelected: function (selected) { this.option.selected = clone(selected); }, /** * @public * @override */ getValueState: function (value) { var index = VisualMapping.findPieceIndex(value, this._pieceList); return index != null ? (this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? 'inRange' : 'outOfRange' ) : 'outOfRange'; }, /** * @public * @params {number} pieceIndex piece index in visualMapModel.getPieceList() * @return {Array.} [{seriesId, dataIndices: >}, ...] */ findTargetDataIndices: function (pieceIndex) { var result = []; this.eachTargetSeries(function (seriesModel) { var dataIndices = []; var data = seriesModel.getData(); data.each(this.getDataDimension(data), function (value, dataIndex) { // Should always base on model pieceList, because it is order sensitive. var pIdx = VisualMapping.findPieceIndex(value, this._pieceList); pIdx === pieceIndex && dataIndices.push(dataIndex); }, this); result.push({seriesId: seriesModel.id, dataIndex: dataIndices}); }, this); return result; }, /** * @private * @param {Object} piece piece.value or piece.interval is required. * @return {number} Can be Infinity or -Infinity */ getRepresentValue: function (piece) { var representValue; if (this.isCategory()) { representValue = piece.value; } else { if (piece.value != null) { representValue = piece.value; } else { var pieceInterval = piece.interval || []; representValue = (pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity) ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2; } } return representValue; }, getVisualMeta: function (getColorVisual) { // Do not support category. (category axis is ordinal, numerical) if (this.isCategory()) { return; } var stops = []; var outerColors = []; var visualMapModel = this; function setStop(interval, valueState) { var representValue = visualMapModel.getRepresentValue({interval: interval}); if (!valueState) { valueState = visualMapModel.getValueState(representValue); } var color = getColorVisual(representValue, valueState); if (interval[0] === -Infinity) { outerColors[0] = color; } else if (interval[1] === Infinity) { outerColors[1] = color; } else { stops.push( {value: interval[0], color: color}, {value: interval[1], color: color} ); } } // Suplement var pieceList = this._pieceList.slice(); if (!pieceList.length) { pieceList.push({interval: [-Infinity, Infinity]}); } else { var edge = pieceList[0].interval[0]; edge !== -Infinity && pieceList.unshift({interval: [-Infinity, edge]}); edge = pieceList[pieceList.length - 1].interval[1]; edge !== Infinity && pieceList.push({interval: [edge, Infinity]}); } var curr = -Infinity; each$1(pieceList, function (piece) { var interval = piece.interval; if (interval) { // Fulfill gap. interval[0] > curr && setStop([curr, interval[0]], 'outOfRange'); setStop(interval.slice()); curr = interval[1]; } }, this); return {stops: stops, outerColors: outerColors}; } }); /** * Key is this._mode * @type {Object} * @this {module:echarts/component/viusalMap/PiecewiseMode} */ var resetMethods = { splitNumber: function () { var thisOption = this.option; var pieceList = this._pieceList; var precision = Math.min(thisOption.precision, 20); var dataExtent = this.getExtent(); var splitNumber = thisOption.splitNumber; splitNumber = Math.max(parseInt(splitNumber, 10), 1); thisOption.splitNumber = splitNumber; var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber; // Precision auto-adaption while (+splitStep.toFixed(precision) !== splitStep && precision < 5) { precision++; } thisOption.precision = precision; splitStep = +splitStep.toFixed(precision); var index = 0; if (thisOption.minOpen) { pieceList.push({ index: index++, interval: [-Infinity, dataExtent[0]], close: [0, 0] }); } for ( var curr = dataExtent[0], len = index + splitNumber; index < len; curr += splitStep ) { var max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep); pieceList.push({ index: index++, interval: [curr, max], close: [1, 1] }); } if (thisOption.maxOpen) { pieceList.push({ index: index++, interval: [dataExtent[1], Infinity], close: [0, 0] }); } reformIntervals(pieceList); each$1(pieceList, function (piece) { piece.text = this.formatValueText(piece.interval); }, this); }, categories: function () { var thisOption = this.option; each$1(thisOption.categories, function (cate) { // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。 // 是否改一致。 this._pieceList.push({ text: this.formatValueText(cate, true), value: cate }); }, this); // See "Order Rule". normalizeReverse(thisOption, this._pieceList); }, pieces: function () { var thisOption = this.option; var pieceList = this._pieceList; each$1(thisOption.pieces, function (pieceListItem, index) { if (!isObject$1(pieceListItem)) { pieceListItem = {value: pieceListItem}; } var item = {text: '', index: index}; if (pieceListItem.label != null) { item.text = pieceListItem.label; } if (pieceListItem.hasOwnProperty('value')) { var value = item.value = pieceListItem.value; item.interval = [value, value]; item.close = [1, 1]; } else { // `min` `max` is legacy option. // `lt` `gt` `lte` `gte` is recommanded. var interval = item.interval = []; var close = item.close = [0, 0]; var closeList = [1, 0, 1]; var infinityList = [-Infinity, Infinity]; var useMinMax = []; for (var lg = 0; lg < 2; lg++) { var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg]; for (var i = 0; i < 3 && interval[lg] == null; i++) { interval[lg] = pieceListItem[names[i]]; close[lg] = closeList[i]; useMinMax[lg] = i === 2; } interval[lg] == null && (interval[lg] = infinityList[lg]); } useMinMax[0] && interval[1] === Infinity && (close[0] = 0); useMinMax[1] && interval[0] === -Infinity && (close[1] = 0); if (__DEV__) { if (interval[0] > interval[1]) { console.warn( 'Piece ' + index + 'is illegal: ' + interval + ' lower bound should not greater then uppper bound.' ); } } if (interval[0] === interval[1] && close[0] && close[1]) { // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}], // we use value to lift the priority when min === max item.value = interval[0]; } } item.visual = VisualMapping.retrieveVisuals(pieceListItem); pieceList.push(item); }, this); // See "Order Rule". normalizeReverse(thisOption, pieceList); // Only pieces reformIntervals(pieceList); each$1(pieceList, function (piece) { var close = piece.close; var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]]; piece.text = piece.text || this.formatValueText( piece.value != null ? piece.value : piece.interval, false, edgeSymbols ); }, this); } }; function normalizeReverse(thisOption, pieceList) { var inverse = thisOption.inverse; if (thisOption.orient === 'vertical' ? !inverse : inverse) { pieceList.reverse(); } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var PiecewiseVisualMapView = VisualMapView.extend({ type: 'visualMap.piecewise', /** * @protected * @override */ doRender: function () { var thisGroup = this.group; thisGroup.removeAll(); var visualMapModel = this.visualMapModel; var textGap = visualMapModel.get('textGap'); var textStyleModel = visualMapModel.textStyleModel; var textFont = textStyleModel.getFont(); var textFill = textStyleModel.getTextColor(); var itemAlign = this._getItemAlign(); var itemSize = visualMapModel.itemSize; var viewData = this._getViewData(); var endsText = viewData.endsText; var showLabel = retrieve(visualMapModel.get('showLabel', true), !endsText); endsText && this._renderEndsText( thisGroup, endsText[0], itemSize, showLabel, itemAlign ); each$1(viewData.viewPieceList, renderItem, this); endsText && this._renderEndsText( thisGroup, endsText[1], itemSize, showLabel, itemAlign ); box( visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap') ); this.renderBackground(thisGroup); this.positionGroup(thisGroup); function renderItem(item) { var piece = item.piece; var itemGroup = new Group(); itemGroup.onclick = bind(this._onItemClick, this, piece); this._enableHoverLink(itemGroup, item.indexInModelPieceList); var representValue = visualMapModel.getRepresentValue(piece); this._createItemSymbol( itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]] ); if (showLabel) { var visualState = this.visualMapModel.getValueState(representValue); itemGroup.add(new Text({ style: { x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap, y: itemSize[1] / 2, text: piece.text, textVerticalAlign: 'middle', textAlign: itemAlign, textFont: textFont, textFill: textFill, opacity: visualState === 'outOfRange' ? 0.5 : 1 } })); } thisGroup.add(itemGroup); } }, /** * @private */ _enableHoverLink: function (itemGroup, pieceIndex) { itemGroup .on('mouseover', bind(onHoverLink, this, 'highlight')) .on('mouseout', bind(onHoverLink, this, 'downplay')); function onHoverLink(method) { var visualMapModel = this.visualMapModel; visualMapModel.option.hoverLink && this.api.dispatchAction({ type: method, batch: convertDataIndex( visualMapModel.findTargetDataIndices(pieceIndex) ) }); } }, /** * @private */ _getItemAlign: function () { var visualMapModel = this.visualMapModel; var modelOption = visualMapModel.option; if (modelOption.orient === 'vertical') { return getItemAlign( visualMapModel, this.api, visualMapModel.itemSize ); } else { // horizontal, most case left unless specifying right. var align = modelOption.align; if (!align || align === 'auto') { align = 'left'; } return align; } }, /** * @private */ _renderEndsText: function (group, text, itemSize, showLabel, itemAlign) { if (!text) { return; } var itemGroup = new Group(); var textStyleModel = this.visualMapModel.textStyleModel; itemGroup.add(new Text({ style: { x: showLabel ? (itemAlign === 'right' ? itemSize[0] : 0) : itemSize[0] / 2, y: itemSize[1] / 2, textVerticalAlign: 'middle', textAlign: showLabel ? itemAlign : 'center', text: text, textFont: textStyleModel.getFont(), textFill: textStyleModel.getTextColor() } })); group.add(itemGroup); }, /** * @private * @return {Object} {peiceList, endsText} The order is the same as screen pixel order. */ _getViewData: function () { var visualMapModel = this.visualMapModel; var viewPieceList = map(visualMapModel.getPieceList(), function (piece, index) { return {piece: piece, indexInModelPieceList: index}; }); var endsText = visualMapModel.get('text'); // Consider orient and inverse. var orient = visualMapModel.get('orient'); var inverse = visualMapModel.get('inverse'); // Order of model pieceList is always [low, ..., high] if (orient === 'horizontal' ? inverse : !inverse) { viewPieceList.reverse(); } // Origin order of endsText is [high, low] else if (endsText) { endsText = endsText.slice().reverse(); } return {viewPieceList: viewPieceList, endsText: endsText}; }, /** * @private */ _createItemSymbol: function (group, representValue, shapeParam) { group.add(createSymbol( this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], this.getControllerVisual(representValue, 'color') )); }, /** * @private */ _onItemClick: function (piece) { var visualMapModel = this.visualMapModel; var option = visualMapModel.option; var selected = clone(option.selected); var newKey = visualMapModel.getSelectedMapKey(piece); if (option.selectedMode === 'single') { selected[newKey] = true; each$1(selected, function (o, key) { selected[key] = key === newKey; }); } else { selected[newKey] = !selected[newKey]; } this.api.dispatchAction({ type: 'selectDataRange', from: this.uid, visualMapId: this.visualMapModel.id, selected: selected }); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * DataZoom component entry */ registerPreprocessor(preprocessor$2); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * visualMap component entry */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var addCommas$1 = addCommas; var encodeHTML$1 = encodeHTML; function fillLabel(opt) { defaultEmphasis(opt, 'label', ['show']); } var MarkerModel = extendComponentModel({ type: 'marker', dependencies: ['series', 'grid', 'polar', 'geo'], /** * @overrite */ init: function (option, parentModel, ecModel, extraOpt) { if (__DEV__) { if (this.type === 'marker') { throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.'); } } this.mergeDefaultAndTheme(option, ecModel); this.mergeOption(option, ecModel, extraOpt.createdBySelf, true); }, /** * @return {boolean} */ isAnimationEnabled: function () { if (env$1.node) { return false; } var hostSeries = this.__hostSeries; return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled(); }, mergeOption: function (newOpt, ecModel, createdBySelf, isInit) { var MarkerModel = this.constructor; var modelPropName = this.mainType + 'Model'; if (!createdBySelf) { ecModel.eachSeries(function (seriesModel) { var markerOpt = seriesModel.get(this.mainType, true); var markerModel = seriesModel[modelPropName]; if (!markerOpt || !markerOpt.data) { seriesModel[modelPropName] = null; return; } if (!markerModel) { if (isInit) { // Default label emphasis `position` and `show` fillLabel(markerOpt); } each$1(markerOpt.data, function (item) { // FIXME Overwrite fillLabel method ? if (item instanceof Array) { fillLabel(item[0]); fillLabel(item[1]); } else { fillLabel(item); } }); markerModel = new MarkerModel( markerOpt, this, ecModel ); extend(markerModel, { mainType: this.mainType, // Use the same series index and name seriesIndex: seriesModel.seriesIndex, name: seriesModel.name, createdBySelf: true }); markerModel.__hostSeries = seriesModel; } else { markerModel.mergeOption(markerOpt, ecModel, true); } seriesModel[modelPropName] = markerModel; }, this); } }, formatTooltip: function (dataIndex) { var data = this.getData(); var value = this.getRawValue(dataIndex); var formattedValue = isArray(value) ? map(value, addCommas$1).join(', ') : addCommas$1(value); var name = data.getName(dataIndex); var html = encodeHTML$1(this.name); if (value != null || name) { html += '
          '; } if (name) { html += encodeHTML$1(name); if (value != null) { html += ' : '; } } if (value != null) { html += encodeHTML$1(formattedValue); } return html; }, getData: function () { return this._data; }, setData: function (data) { this._data = data; } }); mixin(MarkerModel, dataFormatMixin); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ MarkerModel.extend({ type: 'markPoint', defaultOption: { zlevel: 0, z: 5, symbol: 'pin', symbolSize: 50, //symbolRotate: 0, //symbolOffset: [0, 0] tooltip: { trigger: 'item' }, label: { show: true, position: 'inside' }, itemStyle: { borderWidth: 2 }, emphasis: { label: { show: true } } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var indexOf$2 = indexOf; function hasXOrY(item) { return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y))); } function hasXAndY(item) { return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y)); } // Make it simple, do not visit all stacked value to count precision. // function getPrecision(data, valueAxisDim, dataIndex) { // var precision = -1; // var stackedDim = data.mapDimension(valueAxisDim); // do { // precision = Math.max( // numberUtil.getPrecision(data.get(stackedDim, dataIndex)), // precision // ); // var stackedOnSeries = data.getCalculationInfo('stackedOnSeries'); // if (stackedOnSeries) { // var byValue = data.get(data.getCalculationInfo('stackedByDimension'), dataIndex); // data = stackedOnSeries.getData(); // dataIndex = data.indexOf(data.getCalculationInfo('stackedByDimension'), byValue); // stackedDim = data.getCalculationInfo('stackedDimension'); // } // else { // data = null; // } // } while (data); // return precision; // } function markerTypeCalculatorWithExtent( mlType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex ) { var coordArr = []; var stacked = isDimensionStacked(data, targetDataDim /*, otherDataDim*/); var calcDataDim = stacked ? data.getCalculationInfo('stackResultDimension') : targetDataDim; var value = numCalculate(data, calcDataDim, mlType); var dataIndex = data.indicesOfNearest(calcDataDim, value)[0]; coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex); coordArr[targetCoordIndex] = data.get(targetDataDim, dataIndex); // Make it simple, do not visit all stacked value to count precision. var precision = getPrecision(data.get(targetDataDim, dataIndex)); precision = Math.min(precision, 20); if (precision >= 0) { coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision); } return coordArr; } var curry$7 = curry; // TODO Specified percent var markerTypeCalculator = { /** * @method * @param {module:echarts/data/List} data * @param {string} baseAxisDim * @param {string} valueAxisDim */ min: curry$7(markerTypeCalculatorWithExtent, 'min'), /** * @method * @param {module:echarts/data/List} data * @param {string} baseAxisDim * @param {string} valueAxisDim */ max: curry$7(markerTypeCalculatorWithExtent, 'max'), /** * @method * @param {module:echarts/data/List} data * @param {string} baseAxisDim * @param {string} valueAxisDim */ average: curry$7(markerTypeCalculatorWithExtent, 'average') }; /** * Transform markPoint data item to format used in List by do the following * 1. Calculate statistic like `max`, `min`, `average` * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array * @param {module:echarts/model/Series} seriesModel * @param {module:echarts/coord/*} [coordSys] * @param {Object} item * @return {Object} */ function dataTransform(seriesModel, item) { var data = seriesModel.getData(); var coordSys = seriesModel.coordinateSystem; // 1. If not specify the position with pixel directly // 2. If `coord` is not a data array. Which uses `xAxis`, // `yAxis` to specify the coord on each dimension // parseFloat first because item.x and item.y can be percent string like '20%' if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) { var dims = coordSys.dimensions; var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); // Clone the option // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value item = clone(item); if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis ) { var otherCoordIndex = indexOf$2(dims, axisInfo.baseAxis.dim); var targetCoordIndex = indexOf$2(dims, axisInfo.valueAxis.dim); item.coord = markerTypeCalculator[item.type]( data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex ); // Force to use the value of calculated value. item.value = item.coord[targetCoordIndex]; } else { // FIXME Only has one of xAxis and yAxis. var coord = [ item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis ]; // Each coord support max, min, average for (var i = 0; i < 2; i++) { if (markerTypeCalculator[coord[i]]) { coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]); } } item.coord = coord; } } return item; } function getAxisInfo$1(item, data, coordSys, seriesModel) { var ret = {}; if (item.valueIndex != null || item.valueDim != null) { ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim; ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim)); ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis); ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); } else { ret.baseAxis = seriesModel.getBaseAxis(); ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis); ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); ret.valueDataDim = data.mapDimension(ret.valueAxis.dim); } return ret; } function dataDimToCoordDim(seriesModel, dataDim) { var data = seriesModel.getData(); var dimensions = data.dimensions; dataDim = data.getDimension(dataDim); for (var i = 0; i < dimensions.length; i++) { var dimItem = data.getDimensionInfo(dimensions[i]); if (dimItem.name === dataDim) { return dimItem.coordDim; } } } /** * Filter data which is out of coordinateSystem range * [dataFilter description] * @param {module:echarts/coord/*} [coordSys] * @param {Object} item * @return {boolean} */ function dataFilter$1(coordSys, item) { // Alwalys return true if there is no coordSys return (coordSys && coordSys.containData && item.coord && !hasXOrY(item)) ? coordSys.containData(item.coord) : true; } function dimValueGetter(item, dimName, dataIndex, dimIndex) { // x, y, radius, angle if (dimIndex < 2) { return item.coord && item.coord[dimIndex]; } return item.value; } function numCalculate(data, valueDataDim, type) { if (type === 'average') { var sum = 0; var count = 0; data.each(valueDataDim, function (val, idx) { if (!isNaN(val)) { sum += val; count++; } }); return sum / count; } else if (type === 'median') { return data.getMedian(valueDataDim); } else { // max & min return data.getDataExtent(valueDataDim, true)[type === 'max' ? 1 : 0]; } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var MarkerView = extendComponentView({ type: 'marker', init: function () { /** * Markline grouped by series * @private * @type {module:zrender/core/util.HashMap} */ this.markerGroupMap = createHashMap(); }, render: function (markerModel, ecModel, api) { var markerGroupMap = this.markerGroupMap; markerGroupMap.each(function (item) { item.__keep = false; }); var markerModelKey = this.type + 'Model'; ecModel.eachSeries(function (seriesModel) { var markerModel = seriesModel[markerModelKey]; markerModel && this.renderSeries(seriesModel, markerModel, ecModel, api); }, this); markerGroupMap.each(function (item) { !item.__keep && this.group.remove(item.group); }, this); }, renderSeries: function () {} }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function updateMarkerLayout(mpData, seriesModel, api) { var coordSys = seriesModel.coordinateSystem; mpData.each(function (idx) { var itemModel = mpData.getItemModel(idx); var point; var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); if (!isNaN(xPx) && !isNaN(yPx)) { point = [xPx, yPx]; } // Chart like bar may have there own marker positioning logic else if (seriesModel.getMarkerPosition) { // Use the getMarkerPoisition point = seriesModel.getMarkerPosition( mpData.getValues(mpData.dimensions, idx) ); } else if (coordSys) { var x = mpData.get(coordSys.dimensions[0], idx); var y = mpData.get(coordSys.dimensions[1], idx); point = coordSys.dataToPoint([x, y]); } // Use x, y if has any if (!isNaN(xPx)) { point[0] = xPx; } if (!isNaN(yPx)) { point[1] = yPx; } mpData.setItemLayout(idx, point); }); } MarkerView.extend({ type: 'markPoint', // updateLayout: function (markPointModel, ecModel, api) { // ecModel.eachSeries(function (seriesModel) { // var mpModel = seriesModel.markPointModel; // if (mpModel) { // updateMarkerLayout(mpModel.getData(), seriesModel, api); // this.markerGroupMap.get(seriesModel.id).updateLayout(mpModel); // } // }, this); // }, updateTransform: function (markPointModel, ecModel, api) { ecModel.eachSeries(function (seriesModel) { var mpModel = seriesModel.markPointModel; if (mpModel) { updateMarkerLayout(mpModel.getData(), seriesModel, api); this.markerGroupMap.get(seriesModel.id).updateLayout(mpModel); } }, this); }, renderSeries: function (seriesModel, mpModel, ecModel, api) { var coordSys = seriesModel.coordinateSystem; var seriesId = seriesModel.id; var seriesData = seriesModel.getData(); var symbolDrawMap = this.markerGroupMap; var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw()); var mpData = createList$1(coordSys, seriesModel, mpModel); // FIXME mpModel.setData(mpData); updateMarkerLayout(mpModel.getData(), seriesModel, api); mpData.each(function (idx) { var itemModel = mpData.getItemModel(idx); var symbolSize = itemModel.getShallow('symbolSize'); if (typeof symbolSize === 'function') { // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据? symbolSize = symbolSize( mpModel.getRawValue(idx), mpModel.getDataParams(idx) ); } mpData.setItemVisual(idx, { symbolSize: symbolSize, color: itemModel.get('itemStyle.color') || seriesData.getVisual('color'), symbol: itemModel.getShallow('symbol') }); }); // TODO Text are wrong symbolDraw.updateData(mpData); this.group.add(symbolDraw.group); // Set host model for tooltip // FIXME mpData.eachItemGraphicEl(function (el) { el.traverse(function (child) { child.dataModel = mpModel; }); }); symbolDraw.__keep = true; symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent'); } }); /** * @inner * @param {module:echarts/coord/*} [coordSys] * @param {module:echarts/model/Series} seriesModel * @param {module:echarts/model/Model} mpModel */ function createList$1(coordSys, seriesModel, mpModel) { var coordDimsInfos; if (coordSys) { coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { var info = seriesModel.getData().getDimensionInfo( seriesModel.getData().mapDimension(coordDim) ) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys return defaults({name: coordDim}, info); }); } else { coordDimsInfos =[{ name: 'value', type: 'float' }]; } var mpData = new List(coordDimsInfos, mpModel); var dataOpt = map(mpModel.get('data'), curry( dataTransform, seriesModel )); if (coordSys) { dataOpt = filter( dataOpt, curry(dataFilter$1, coordSys) ); } mpData.initData(dataOpt, null, coordSys ? dimValueGetter : function (item) { return item.value; } ); return mpData; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // HINT Markpoint can't be used too much registerPreprocessor(function (opt) { // Make sure markPoint component is enabled opt.markPoint = opt.markPoint || {}; }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ MarkerModel.extend({ type: 'markLine', defaultOption: { zlevel: 0, z: 5, symbol: ['circle', 'arrow'], symbolSize: [8, 16], //symbolRotate: 0, precision: 2, tooltip: { trigger: 'item' }, label: { show: true, position: 'end' }, lineStyle: { type: 'dashed' }, emphasis: { label: { show: true }, lineStyle: { width: 3 } }, animationEasing: 'linear' } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var markLineTransform = function (seriesModel, coordSys, mlModel, item) { var data = seriesModel.getData(); // Special type markLine like 'min', 'max', 'average', 'median' var mlType = item.type; if (!isArray(item) && ( mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median' // In case // data: [{ // yAxis: 10 // }] || (item.xAxis != null || item.yAxis != null) ) ) { var valueAxis; var valueDataDim; var value; if (item.yAxis != null || item.xAxis != null) { valueDataDim = item.yAxis != null ? 'y' : 'x'; valueAxis = coordSys.getAxis(valueDataDim); value = retrieve(item.yAxis, item.xAxis); } else { var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); valueDataDim = axisInfo.valueDataDim; valueAxis = axisInfo.valueAxis; value = numCalculate(data, valueDataDim, mlType); } var valueIndex = valueDataDim === 'x' ? 0 : 1; var baseIndex = 1 - valueIndex; var mlFrom = clone(item); var mlTo = {}; mlFrom.type = null; mlFrom.coord = []; mlTo.coord = []; mlFrom.coord[baseIndex] = -Infinity; mlTo.coord[baseIndex] = Infinity; var precision = mlModel.get('precision'); if (precision >= 0 && typeof value === 'number') { value = +value.toFixed(Math.min(precision, 20)); } mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value; item = [mlFrom, mlTo, { // Extra option for tooltip and label type: mlType, valueIndex: item.valueIndex, // Force to use the value of calculated value. value: value }]; } item = [ dataTransform(seriesModel, item[0]), dataTransform(seriesModel, item[1]), extend({}, item[2]) ]; // Avoid line data type is extended by from(to) data type item[2].type = item[2].type || ''; // Merge from option and to option into line option merge(item[2], item[0]); merge(item[2], item[1]); return item; }; function isInifinity(val) { return !isNaN(val) && !isFinite(val); } // If a markLine has one dim function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { var otherDimIndex = 1 - dimIndex; var dimName = coordSys.dimensions[dimIndex]; return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]); } function markLineFilter(coordSys, item) { if (coordSys.type === 'cartesian2d') { var fromCoord = item[0].coord; var toCoord = item[1].coord; // In case // { // markLine: { // data: [{ yAxis: 2 }] // } // } if ( fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys)) ) { return true; } } return dataFilter$1(coordSys, item[0]) && dataFilter$1(coordSys, item[1]); } function updateSingleMarkerEndLayout( data, idx, isFrom, seriesModel, api ) { var coordSys = seriesModel.coordinateSystem; var itemModel = data.getItemModel(idx); var point; var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); if (!isNaN(xPx) && !isNaN(yPx)) { point = [xPx, yPx]; } else { // Chart like bar may have there own marker positioning logic if (seriesModel.getMarkerPosition) { // Use the getMarkerPoisition point = seriesModel.getMarkerPosition( data.getValues(data.dimensions, idx) ); } else { var dims = coordSys.dimensions; var x = data.get(dims[0], idx); var y = data.get(dims[1], idx); point = coordSys.dataToPoint([x, y]); } // Expand line to the edge of grid if value on one axis is Inifnity // In case // markLine: { // data: [{ // yAxis: 2 // // or // type: 'average' // }] // } if (coordSys.type === 'cartesian2d') { var xAxis = coordSys.getAxis('x'); var yAxis = coordSys.getAxis('y'); var dims = coordSys.dimensions; if (isInifinity(data.get(dims[0], idx))) { point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]); } else if (isInifinity(data.get(dims[1], idx))) { point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]); } } // Use x, y if has any if (!isNaN(xPx)) { point[0] = xPx; } if (!isNaN(yPx)) { point[1] = yPx; } } data.setItemLayout(idx, point); } MarkerView.extend({ type: 'markLine', // updateLayout: function (markLineModel, ecModel, api) { // ecModel.eachSeries(function (seriesModel) { // var mlModel = seriesModel.markLineModel; // if (mlModel) { // var mlData = mlModel.getData(); // var fromData = mlModel.__from; // var toData = mlModel.__to; // // Update visual and layout of from symbol and to symbol // fromData.each(function (idx) { // updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api); // updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api); // }); // // Update layout of line // mlData.each(function (idx) { // mlData.setItemLayout(idx, [ // fromData.getItemLayout(idx), // toData.getItemLayout(idx) // ]); // }); // this.markerGroupMap.get(seriesModel.id).updateLayout(); // } // }, this); // }, updateTransform: function (markLineModel, ecModel, api) { ecModel.eachSeries(function (seriesModel) { var mlModel = seriesModel.markLineModel; if (mlModel) { var mlData = mlModel.getData(); var fromData = mlModel.__from; var toData = mlModel.__to; // Update visual and layout of from symbol and to symbol fromData.each(function (idx) { updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api); updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api); }); // Update layout of line mlData.each(function (idx) { mlData.setItemLayout(idx, [ fromData.getItemLayout(idx), toData.getItemLayout(idx) ]); }); this.markerGroupMap.get(seriesModel.id).updateLayout(); } }, this); }, renderSeries: function (seriesModel, mlModel, ecModel, api) { var coordSys = seriesModel.coordinateSystem; var seriesId = seriesModel.id; var seriesData = seriesModel.getData(); var lineDrawMap = this.markerGroupMap; var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw()); this.group.add(lineDraw.group); var mlData = createList$2(coordSys, seriesModel, mlModel); var fromData = mlData.from; var toData = mlData.to; var lineData = mlData.line; mlModel.__from = fromData; mlModel.__to = toData; // Line data for tooltip and formatter mlModel.setData(lineData); var symbolType = mlModel.get('symbol'); var symbolSize = mlModel.get('symbolSize'); if (!isArray(symbolType)) { symbolType = [symbolType, symbolType]; } if (typeof symbolSize === 'number') { symbolSize = [symbolSize, symbolSize]; } // Update visual and layout of from symbol and to symbol mlData.from.each(function (idx) { updateDataVisualAndLayout(fromData, idx, true); updateDataVisualAndLayout(toData, idx, false); }); // Update visual and layout of line lineData.each(function (idx) { var lineColor = lineData.getItemModel(idx).get('lineStyle.color'); lineData.setItemVisual(idx, { color: lineColor || fromData.getItemVisual(idx, 'color') }); lineData.setItemLayout(idx, [ fromData.getItemLayout(idx), toData.getItemLayout(idx) ]); lineData.setItemVisual(idx, { 'fromSymbolSize': fromData.getItemVisual(idx, 'symbolSize'), 'fromSymbol': fromData.getItemVisual(idx, 'symbol'), 'toSymbolSize': toData.getItemVisual(idx, 'symbolSize'), 'toSymbol': toData.getItemVisual(idx, 'symbol') }); }); lineDraw.updateData(lineData); // Set host model for tooltip // FIXME mlData.line.eachItemGraphicEl(function (el, idx) { el.traverse(function (child) { child.dataModel = mlModel; }); }); function updateDataVisualAndLayout(data, idx, isFrom) { var itemModel = data.getItemModel(idx); updateSingleMarkerEndLayout( data, idx, isFrom, seriesModel, api ); data.setItemVisual(idx, { symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1], symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1], color: itemModel.get('itemStyle.color') || seriesData.getVisual('color') }); } lineDraw.__keep = true; lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent'); } }); /** * @inner * @param {module:echarts/coord/*} coordSys * @param {module:echarts/model/Series} seriesModel * @param {module:echarts/model/Model} mpModel */ function createList$2(coordSys, seriesModel, mlModel) { var coordDimsInfos; if (coordSys) { coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { var info = seriesModel.getData().getDimensionInfo( seriesModel.getData().mapDimension(coordDim) ) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys return defaults({name: coordDim}, info); }); } else { coordDimsInfos =[{ name: 'value', type: 'float' }]; } var fromData = new List(coordDimsInfos, mlModel); var toData = new List(coordDimsInfos, mlModel); // No dimensions var lineData = new List([], mlModel); var optData = map(mlModel.get('data'), curry( markLineTransform, seriesModel, coordSys, mlModel )); if (coordSys) { optData = filter( optData, curry(markLineFilter, coordSys) ); } var dimValueGetter$$1 = coordSys ? dimValueGetter : function (item) { return item.value; }; fromData.initData( map(optData, function (item) { return item[0]; }), null, dimValueGetter$$1 ); toData.initData( map(optData, function (item) { return item[1]; }), null, dimValueGetter$$1 ); lineData.initData( map(optData, function (item) { return item[2]; }) ); lineData.hasItemOption = true; return { from: fromData, to: toData, line: lineData }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerPreprocessor(function (opt) { // Make sure markLine component is enabled opt.markLine = opt.markLine || {}; }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ MarkerModel.extend({ type: 'markArea', defaultOption: { zlevel: 0, // PENDING z: 1, tooltip: { trigger: 'item' }, // markArea should fixed on the coordinate system animation: false, label: { show: true, position: 'top' }, itemStyle: { // color and borderColor default to use color from series // color: 'auto' // borderColor: 'auto' borderWidth: 0 }, emphasis: { label: { show: true, position: 'top' } } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // TODO Better on polar var markAreaTransform = function (seriesModel, coordSys, maModel, item) { var lt = dataTransform(seriesModel, item[0]); var rb = dataTransform(seriesModel, item[1]); var retrieve$$1 = retrieve; // FIXME make sure lt is less than rb var ltCoord = lt.coord; var rbCoord = rb.coord; ltCoord[0] = retrieve$$1(ltCoord[0], -Infinity); ltCoord[1] = retrieve$$1(ltCoord[1], -Infinity); rbCoord[0] = retrieve$$1(rbCoord[0], Infinity); rbCoord[1] = retrieve$$1(rbCoord[1], Infinity); // Merge option into one var result = mergeAll([{}, lt, rb]); result.coord = [ lt.coord, rb.coord ]; result.x0 = lt.x; result.y0 = lt.y; result.x1 = rb.x; result.y1 = rb.y; return result; }; function isInifinity$1(val) { return !isNaN(val) && !isFinite(val); } // If a markArea has one dim function ifMarkLineHasOnlyDim$1(dimIndex, fromCoord, toCoord, coordSys) { var otherDimIndex = 1 - dimIndex; return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]); } function markAreaFilter(coordSys, item) { var fromCoord = item.coord[0]; var toCoord = item.coord[1]; if (coordSys.type === 'cartesian2d') { // In case // { // markArea: { // data: [{ yAxis: 2 }] // } // } if ( fromCoord && toCoord && (ifMarkLineHasOnlyDim$1(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim$1(0, fromCoord, toCoord, coordSys)) ) { return true; } } return dataFilter$1(coordSys, { coord: fromCoord, x: item.x0, y: item.y0 }) || dataFilter$1(coordSys, { coord: toCoord, x: item.x1, y: item.y1 }); } // dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0'] function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) { var coordSys = seriesModel.coordinateSystem; var itemModel = data.getItemModel(idx); var point; var xPx = parsePercent$1(itemModel.get(dims[0]), api.getWidth()); var yPx = parsePercent$1(itemModel.get(dims[1]), api.getHeight()); if (!isNaN(xPx) && !isNaN(yPx)) { point = [xPx, yPx]; } else { // Chart like bar may have there own marker positioning logic if (seriesModel.getMarkerPosition) { // Use the getMarkerPoisition point = seriesModel.getMarkerPosition( data.getValues(dims, idx) ); } else { var x = data.get(dims[0], idx); var y = data.get(dims[1], idx); var pt = [x, y]; coordSys.clampData && coordSys.clampData(pt, pt); point = coordSys.dataToPoint(pt, true); } if (coordSys.type === 'cartesian2d') { var xAxis = coordSys.getAxis('x'); var yAxis = coordSys.getAxis('y'); var x = data.get(dims[0], idx); var y = data.get(dims[1], idx); if (isInifinity$1(x)) { point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]); } else if (isInifinity$1(y)) { point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]); } } // Use x, y if has any if (!isNaN(xPx)) { point[0] = xPx; } if (!isNaN(yPx)) { point[1] = yPx; } } return point; } var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']]; MarkerView.extend({ type: 'markArea', // updateLayout: function (markAreaModel, ecModel, api) { // ecModel.eachSeries(function (seriesModel) { // var maModel = seriesModel.markAreaModel; // if (maModel) { // var areaData = maModel.getData(); // areaData.each(function (idx) { // var points = zrUtil.map(dimPermutations, function (dim) { // return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); // }); // // Layout // areaData.setItemLayout(idx, points); // var el = areaData.getItemGraphicEl(idx); // el.setShape('points', points); // }); // } // }, this); // }, updateTransform: function (markAreaModel, ecModel, api) { ecModel.eachSeries(function (seriesModel) { var maModel = seriesModel.markAreaModel; if (maModel) { var areaData = maModel.getData(); areaData.each(function (idx) { var points = map(dimPermutations, function (dim) { return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); }); // Layout areaData.setItemLayout(idx, points); var el = areaData.getItemGraphicEl(idx); el.setShape('points', points); }); } }, this); }, renderSeries: function (seriesModel, maModel, ecModel, api) { var coordSys = seriesModel.coordinateSystem; var seriesId = seriesModel.id; var seriesData = seriesModel.getData(); var areaGroupMap = this.markerGroupMap; var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, {group: new Group()}); this.group.add(polygonGroup.group); polygonGroup.__keep = true; var areaData = createList$3(coordSys, seriesModel, maModel); // Line data for tooltip and formatter maModel.setData(areaData); // Update visual and layout of line areaData.each(function (idx) { // Layout areaData.setItemLayout(idx, map(dimPermutations, function (dim) { return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); })); // Visual areaData.setItemVisual(idx, { color: seriesData.getVisual('color') }); }); areaData.diff(polygonGroup.__data) .add(function (idx) { var polygon = new Polygon({ shape: { points: areaData.getItemLayout(idx) } }); areaData.setItemGraphicEl(idx, polygon); polygonGroup.group.add(polygon); }) .update(function (newIdx, oldIdx) { var polygon = polygonGroup.__data.getItemGraphicEl(oldIdx); updateProps(polygon, { shape: { points: areaData.getItemLayout(newIdx) } }, maModel, newIdx); polygonGroup.group.add(polygon); areaData.setItemGraphicEl(newIdx, polygon); }) .remove(function (idx) { var polygon = polygonGroup.__data.getItemGraphicEl(idx); polygonGroup.group.remove(polygon); }) .execute(); areaData.eachItemGraphicEl(function (polygon, idx) { var itemModel = areaData.getItemModel(idx); var labelModel = itemModel.getModel('label'); var labelHoverModel = itemModel.getModel('emphasis.label'); var color = areaData.getItemVisual(idx, 'color'); polygon.useStyle( defaults( itemModel.getModel('itemStyle').getItemStyle(), { fill: modifyAlpha(color, 0.4), stroke: color } ) ); polygon.hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); setLabelStyle( polygon.style, polygon.hoverStyle, labelModel, labelHoverModel, { labelFetcher: maModel, labelDataIndex: idx, defaultText: areaData.getName(idx) || '', isRectText: true, autoColor: color } ); setHoverStyle(polygon, {}); polygon.dataModel = maModel; }); polygonGroup.__data = areaData; polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent'); } }); /** * @inner * @param {module:echarts/coord/*} coordSys * @param {module:echarts/model/Series} seriesModel * @param {module:echarts/model/Model} mpModel */ function createList$3(coordSys, seriesModel, maModel) { var coordDimsInfos; var areaData; var dims = ['x0', 'y0', 'x1', 'y1']; if (coordSys) { coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { var data = seriesModel.getData(); var info = data.getDimensionInfo( data.mapDimension(coordDim) ) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys return defaults({name: coordDim}, info); }); areaData = new List(map(dims, function (dim, idx) { return { name: dim, type: coordDimsInfos[idx % 2].type }; }), maModel); } else { coordDimsInfos =[{ name: 'value', type: 'float' }]; areaData = new List(coordDimsInfos, maModel); } var optData = map(maModel.get('data'), curry( markAreaTransform, seriesModel, coordSys, maModel )); if (coordSys) { optData = filter( optData, curry(markAreaFilter, coordSys) ); } var dimValueGetter$$1 = coordSys ? function (item, dimName, dataIndex, dimIndex) { return item.coord[Math.floor(dimIndex / 2)][dimIndex % 2]; } : function (item) { return item.value; }; areaData.initData(optData, null, dimValueGetter$$1); areaData.hasItemOption = true; return areaData; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerPreprocessor(function (opt) { // Make sure markArea component is enabled opt.markArea = opt.markArea || {}; }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var preprocessor$3 = function (option) { var timelineOpt = option && option.timeline; if (!isArray(timelineOpt)) { timelineOpt = timelineOpt ? [timelineOpt] : []; } each$1(timelineOpt, function (opt) { if (!opt) { return; } compatibleEC2(opt); }); }; function compatibleEC2(opt) { var type = opt.type; var ec2Types = {'number': 'value', 'time': 'time'}; // Compatible with ec2 if (ec2Types[type]) { opt.axisType = ec2Types[type]; delete opt.type; } transferItem(opt); if (has$2(opt, 'controlPosition')) { var controlStyle = opt.controlStyle || (opt.controlStyle = {}); if (!has$2(controlStyle, 'position')) { controlStyle.position = opt.controlPosition; } if (controlStyle.position === 'none' && !has$2(controlStyle, 'show')) { controlStyle.show = false; delete controlStyle.position; } delete opt.controlPosition; } each$1(opt.data || [], function (dataItem) { if (isObject$1(dataItem) && !isArray(dataItem)) { if (!has$2(dataItem, 'value') && has$2(dataItem, 'name')) { // In ec2, using name as value. dataItem.value = dataItem.name; } transferItem(dataItem); } }); } function transferItem(opt) { var itemStyle = opt.itemStyle || (opt.itemStyle = {}); var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {}); // Transfer label out var label = opt.label || (opt.label || {}); var labelNormal = label.normal || (label.normal = {}); var excludeLabelAttr = {normal: 1, emphasis: 1}; each$1(label, function (value, name) { if (!excludeLabelAttr[name] && !has$2(labelNormal, name)) { labelNormal[name] = value; } }); if (itemStyleEmphasis.label && !has$2(label, 'emphasis')) { label.emphasis = itemStyleEmphasis.label; delete itemStyleEmphasis.label; } } function has$2(obj, attr) { return obj.hasOwnProperty(attr); } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ ComponentModel.registerSubTypeDefaulter('timeline', function () { // Only slider now. return 'slider'; }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ registerAction( {type: 'timelineChange', event: 'timelineChanged', update: 'prepareAndUpdate'}, function (payload, ecModel) { var timelineModel = ecModel.getComponent('timeline'); if (timelineModel && payload.currentIndex != null) { timelineModel.setCurrentIndex(payload.currentIndex); if (!timelineModel.get('loop', true) && timelineModel.isIndexMax()) { timelineModel.setPlayState(false); } } // Set normalized currentIndex to payload. ecModel.resetOption('timeline'); return defaults({ currentIndex: timelineModel.option.currentIndex }, payload); } ); registerAction( {type: 'timelinePlayChange', event: 'timelinePlayChanged', update: 'update'}, function (payload, ecModel) { var timelineModel = ecModel.getComponent('timeline'); if (timelineModel && payload.playState != null) { timelineModel.setPlayState(payload.playState); } } ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var TimelineModel = ComponentModel.extend({ type: 'timeline', layoutMode: 'box', /** * @protected */ defaultOption: { zlevel: 0, // 一级层叠 z: 4, // 二级层叠 show: true, axisType: 'time', // 模式是时间类型,支持 value, category realtime: true, left: '20%', top: null, right: '20%', bottom: 0, width: null, height: 40, padding: 5, controlPosition: 'left', // 'left' 'right' 'top' 'bottom' 'none' autoPlay: false, rewind: false, // 反向播放 loop: true, playInterval: 2000, // 播放时间间隔,单位ms currentIndex: 0, itemStyle: {}, label: { color: '#000' }, data: [] }, /** * @override */ init: function (option, parentModel, ecModel) { /** * @private * @type {module:echarts/data/List} */ this._data; /** * @private * @type {Array.} */ this._names; this.mergeDefaultAndTheme(option, ecModel); this._initData(); }, /** * @override */ mergeOption: function (option) { TimelineModel.superApply(this, 'mergeOption', arguments); this._initData(); }, /** * @param {number} [currentIndex] */ setCurrentIndex: function (currentIndex) { if (currentIndex == null) { currentIndex = this.option.currentIndex; } var count = this._data.count(); if (this.option.loop) { currentIndex = (currentIndex % count + count) % count; } else { currentIndex >= count && (currentIndex = count - 1); currentIndex < 0 && (currentIndex = 0); } this.option.currentIndex = currentIndex; }, /** * @return {number} currentIndex */ getCurrentIndex: function () { return this.option.currentIndex; }, /** * @return {boolean} */ isIndexMax: function () { return this.getCurrentIndex() >= this._data.count() - 1; }, /** * @param {boolean} state true: play, false: stop */ setPlayState: function (state) { this.option.autoPlay = !!state; }, /** * @return {boolean} true: play, false: stop */ getPlayState: function () { return !!this.option.autoPlay; }, /** * @private */ _initData: function () { var thisOption = this.option; var dataArr = thisOption.data || []; var axisType = thisOption.axisType; var names = this._names = []; if (axisType === 'category') { var idxArr = []; each$1(dataArr, function (item, index) { var value = getDataItemValue(item); var newItem; if (isObject$1(item)) { newItem = clone(item); newItem.value = index; } else { newItem = index; } idxArr.push(newItem); if (!isString(value) && (value == null || isNaN(value))) { value = ''; } names.push(value + ''); }); dataArr = idxArr; } var dimType = ({category: 'ordinal', time: 'time'})[axisType] || 'number'; var data = this._data = new List([{name: 'value', type: dimType}], this); data.initData(dataArr, names); }, getData: function () { return this._data; }, /** * @public * @return {Array.} categoreis */ getCategories: function () { if (this.get('axisType') === 'category') { return this._names.slice(); } } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var SliderTimelineModel = TimelineModel.extend({ type: 'timeline.slider', /** * @protected */ defaultOption: { backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色 borderColor: '#ccc', // 时间轴边框颜色 borderWidth: 0, // 时间轴边框线宽,单位px,默认为0(无边框) orient: 'horizontal', // 'vertical' inverse: false, tooltip: { // boolean or Object trigger: 'item' // data item may also have tootip attr. }, symbol: 'emptyCircle', symbolSize: 10, lineStyle: { show: true, width: 2, color: '#304654' }, label: { // 文本标签 position: 'auto', // auto left right top bottom // When using number, label position is not // restricted by viewRect. // positive: right/bottom, negative: left/top show: true, interval: 'auto', rotate: 0, // formatter: null, // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: '#304654' }, itemStyle: { color: '#304654', borderWidth: 1 }, checkpointStyle: { symbol: 'circle', symbolSize: 13, color: '#c23531', borderWidth: 5, borderColor: 'rgba(194,53,49, 0.5)', animation: true, animationDuration: 300, animationEasing: 'quinticInOut' }, controlStyle: { show: true, showPlayBtn: true, showPrevBtn: true, showNextBtn: true, itemSize: 22, itemGap: 12, position: 'left', // 'left' 'right' 'top' 'bottom' playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z', // jshint ignore:line stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z', // jshint ignore:line nextIcon: 'path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z', // jshint ignore:line prevIcon: 'path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z', // jshint ignore:line color: '#304654', borderColor: '#304654', borderWidth: 1 }, emphasis: { label: { show: true, // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: '#c23531' }, itemStyle: { color: '#c23531' }, controlStyle: { color: '#c23531', borderColor: '#c23531', borderWidth: 2 } }, data: [] } }); mixin(SliderTimelineModel, dataFormatMixin); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var TimelineView = Component.extend({ type: 'timeline' }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Extend axis 2d * @constructor module:echarts/coord/cartesian/Axis2D * @extends {module:echarts/coord/cartesian/Axis} * @param {string} dim * @param {*} scale * @param {Array.} coordExtent * @param {string} axisType * @param {string} position */ var TimelineAxis = function (dim, scale, coordExtent, axisType) { Axis.call(this, dim, scale, coordExtent); /** * Axis type * - 'category' * - 'value' * - 'time' * - 'log' * @type {string} */ this.type = axisType || 'value'; /** * Axis model * @param {module:echarts/component/TimelineModel} */ this.model = null; }; TimelineAxis.prototype = { constructor: TimelineAxis, /** * @override */ getLabelModel: function () { return this.model.getModel('label'); }, /** * @override */ isHorizontal: function () { return this.model.get('orient') === 'horizontal'; } }; inherits(TimelineAxis, Axis); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var bind$6 = bind; var each$27 = each$1; var PI$4 = Math.PI; TimelineView.extend({ type: 'timeline.slider', init: function (ecModel, api) { this.api = api; /** * @private * @type {module:echarts/component/timeline/TimelineAxis} */ this._axis; /** * @private * @type {module:zrender/core/BoundingRect} */ this._viewRect; /** * @type {number} */ this._timer; /** * @type {module:zrender/Element} */ this._currentPointer; /** * @type {module:zrender/container/Group} */ this._mainGroup; /** * @type {module:zrender/container/Group} */ this._labelGroup; }, /** * @override */ render: function (timelineModel, ecModel, api, payload) { this.model = timelineModel; this.api = api; this.ecModel = ecModel; this.group.removeAll(); if (timelineModel.get('show', true)) { var layoutInfo = this._layout(timelineModel, api); var mainGroup = this._createGroup('mainGroup'); var labelGroup = this._createGroup('labelGroup'); /** * @private * @type {module:echarts/component/timeline/TimelineAxis} */ var axis = this._axis = this._createAxis(layoutInfo, timelineModel); timelineModel.formatTooltip = function (dataIndex) { return encodeHTML(axis.scale.getLabel(dataIndex)); }; each$27( ['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) { this['_render' + name](layoutInfo, mainGroup, axis, timelineModel); }, this ); this._renderAxisLabel(layoutInfo, labelGroup, axis, timelineModel); this._position(layoutInfo, timelineModel); } this._doPlayStop(); }, /** * @override */ remove: function () { this._clearTimer(); this.group.removeAll(); }, /** * @override */ dispose: function () { this._clearTimer(); }, _layout: function (timelineModel, api) { var labelPosOpt = timelineModel.get('label.position'); var orient = timelineModel.get('orient'); var viewRect = getViewRect$4(timelineModel, api); // Auto label offset. if (labelPosOpt == null || labelPosOpt === 'auto') { labelPosOpt = orient === 'horizontal' ? ((viewRect.y + viewRect.height / 2) < api.getHeight() / 2 ? '-' : '+') : ((viewRect.x + viewRect.width / 2) < api.getWidth() / 2 ? '+' : '-'); } else if (isNaN(labelPosOpt)) { labelPosOpt = ({ horizontal: {top: '-', bottom: '+'}, vertical: {left: '-', right: '+'} })[orient][labelPosOpt]; } var labelAlignMap = { horizontal: 'center', vertical: (labelPosOpt >= 0 || labelPosOpt === '+') ? 'left' : 'right' }; var labelBaselineMap = { horizontal: (labelPosOpt >= 0 || labelPosOpt === '+') ? 'top' : 'bottom', vertical: 'middle' }; var rotationMap = { horizontal: 0, vertical: PI$4 / 2 }; // Position var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width; var controlModel = timelineModel.getModel('controlStyle'); var showControl = controlModel.get('show', true); var controlSize = showControl ? controlModel.get('itemSize') : 0; var controlGap = showControl ? controlModel.get('itemGap') : 0; var sizePlusGap = controlSize + controlGap; // Special label rotate. var labelRotation = timelineModel.get('label.rotate') || 0; labelRotation = labelRotation * PI$4 / 180; // To radian. var playPosition; var prevBtnPosition; var nextBtnPosition; var axisExtent; var controlPosition = controlModel.get('position', true); var showPlayBtn = showControl && controlModel.get('showPlayBtn', true); var showPrevBtn = showControl && controlModel.get('showPrevBtn', true); var showNextBtn = showControl && controlModel.get('showNextBtn', true); var xLeft = 0; var xRight = mainLength; // position[0] means left, position[1] means middle. if (controlPosition === 'left' || controlPosition === 'bottom') { showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap); showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap); showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); } else { // 'top' 'right' showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap); showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); } axisExtent = [xLeft, xRight]; if (timelineModel.get('inverse')) { axisExtent.reverse(); } return { viewRect: viewRect, mainLength: mainLength, orient: orient, rotation: rotationMap[orient], labelRotation: labelRotation, labelPosOpt: labelPosOpt, labelAlign: timelineModel.get('label.align') || labelAlignMap[orient], labelBaseline: timelineModel.get('label.verticalAlign') || timelineModel.get('label.baseline') || labelBaselineMap[orient], // Based on mainGroup. playPosition: playPosition, prevBtnPosition: prevBtnPosition, nextBtnPosition: nextBtnPosition, axisExtent: axisExtent, controlSize: controlSize, controlGap: controlGap }; }, _position: function (layoutInfo, timelineModel) { // Position is be called finally, because bounding rect is needed for // adapt content to fill viewRect (auto adapt offset). // Timeline may be not all in the viewRect when 'offset' is specified // as a number, because it is more appropriate that label aligns at // 'offset' but not the other edge defined by viewRect. var mainGroup = this._mainGroup; var labelGroup = this._labelGroup; var viewRect = layoutInfo.viewRect; if (layoutInfo.orient === 'vertical') { // transform to horizontal, inverse rotate by left-top point. var m = create$1(); var rotateOriginX = viewRect.x; var rotateOriginY = viewRect.y + viewRect.height; translate(m, m, [-rotateOriginX, -rotateOriginY]); rotate(m, m, -PI$4 / 2); translate(m, m, [rotateOriginX, rotateOriginY]); viewRect = viewRect.clone(); viewRect.applyTransform(m); } var viewBound = getBound(viewRect); var mainBound = getBound(mainGroup.getBoundingRect()); var labelBound = getBound(labelGroup.getBoundingRect()); var mainPosition = mainGroup.position; var labelsPosition = labelGroup.position; labelsPosition[0] = mainPosition[0] = viewBound[0][0]; var labelPosOpt = layoutInfo.labelPosOpt; if (isNaN(labelPosOpt)) { // '+' or '-' var mainBoundIdx = labelPosOpt === '+' ? 0 : 1; toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx); } else { var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1; toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); labelsPosition[1] = mainPosition[1] + labelPosOpt; } mainGroup.attr('position', mainPosition); labelGroup.attr('position', labelsPosition); mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation; setOrigin(mainGroup); setOrigin(labelGroup); function setOrigin(targetGroup) { var pos = targetGroup.position; targetGroup.origin = [ viewBound[0][0] - pos[0], viewBound[1][0] - pos[1] ]; } function getBound(rect) { // [[xmin, xmax], [ymin, ymax]] return [ [rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height] ]; } function toBound(fromPos, from, to, dimIdx, boundIdx) { fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx]; } }, _createAxis: function (layoutInfo, timelineModel) { var data = timelineModel.getData(); var axisType = timelineModel.get('axisType'); var scale = createScaleByModel(timelineModel, axisType); // Customize scale. The `tickValue` is `dataIndex`. scale.getTicks = function () { return data.mapArray(['value'], function (value) { return value; }); }; var dataExtent = data.getDataExtent('value'); scale.setExtent(dataExtent[0], dataExtent[1]); scale.niceTicks(); var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType); axis.model = timelineModel; return axis; }, _createGroup: function (name) { var newGroup = this['_' + name] = new Group(); this.group.add(newGroup); return newGroup; }, _renderAxisLine: function (layoutInfo, group, axis, timelineModel) { var axisExtent = axis.getExtent(); if (!timelineModel.get('lineStyle.show')) { return; } group.add(new Line({ shape: { x1: axisExtent[0], y1: 0, x2: axisExtent[1], y2: 0 }, style: extend( {lineCap: 'round'}, timelineModel.getModel('lineStyle').getLineStyle() ), silent: true, z2: 1 })); }, /** * @private */ _renderAxisTick: function (layoutInfo, group, axis, timelineModel) { var data = timelineModel.getData(); // Show all ticks, despite ignoring strategy. var ticks = axis.scale.getTicks(); // The value is dataIndex, see the costomized scale. each$27(ticks, function (value) { var tickCoord = axis.dataToCoord(value); var itemModel = data.getItemModel(value); var itemStyleModel = itemModel.getModel('itemStyle'); var hoverStyleModel = itemModel.getModel('emphasis.itemStyle'); var symbolOpt = { position: [tickCoord, 0], onclick: bind$6(this._changeTimeline, this, value) }; var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt); setHoverStyle(el, hoverStyleModel.getItemStyle()); if (itemModel.get('tooltip')) { el.dataIndex = value; el.dataModel = timelineModel; } else { el.dataIndex = el.dataModel = null; } }, this); }, /** * @private */ _renderAxisLabel: function (layoutInfo, group, axis, timelineModel) { var labelModel = axis.getLabelModel(); if (!labelModel.get('show')) { return; } var data = timelineModel.getData(); var labels = axis.getViewLabels(); each$27(labels, function (labelItem) { // The tickValue is dataIndex, see the costomized scale. var dataIndex = labelItem.tickValue; var itemModel = data.getItemModel(dataIndex); var normalLabelModel = itemModel.getModel('label'); var hoverLabelModel = itemModel.getModel('emphasis.label'); var tickCoord = axis.dataToCoord(labelItem.tickValue); var textEl = new Text({ position: [tickCoord, 0], rotation: layoutInfo.labelRotation - layoutInfo.rotation, onclick: bind$6(this._changeTimeline, this, dataIndex), silent: false }); setTextStyle(textEl.style, normalLabelModel, { text: labelItem.formattedLabel, textAlign: layoutInfo.labelAlign, textVerticalAlign: layoutInfo.labelBaseline }); group.add(textEl); setHoverStyle( textEl, setTextStyle({}, hoverLabelModel) ); }, this); }, /** * @private */ _renderControl: function (layoutInfo, group, axis, timelineModel) { var controlSize = layoutInfo.controlSize; var rotation = layoutInfo.rotation; var itemStyle = timelineModel.getModel('controlStyle').getItemStyle(); var hoverStyle = timelineModel.getModel('emphasis.controlStyle').getItemStyle(); var rect = [0, -controlSize / 2, controlSize, controlSize]; var playState = timelineModel.getPlayState(); var inverse = timelineModel.get('inverse', true); makeBtn( layoutInfo.nextBtnPosition, 'controlStyle.nextIcon', bind$6(this._changeTimeline, this, inverse ? '-' : '+') ); makeBtn( layoutInfo.prevBtnPosition, 'controlStyle.prevIcon', bind$6(this._changeTimeline, this, inverse ? '+' : '-') ); makeBtn( layoutInfo.playPosition, 'controlStyle.' + (playState ? 'stopIcon' : 'playIcon'), bind$6(this._handlePlayClick, this, !playState), true ); function makeBtn(position, iconPath, onclick, willRotate) { if (!position) { return; } var opt = { position: position, origin: [controlSize / 2, 0], rotation: willRotate ? -rotation : 0, rectHover: true, style: itemStyle, onclick: onclick }; var btn = makeIcon(timelineModel, iconPath, rect, opt); group.add(btn); setHoverStyle(btn, hoverStyle); } }, _renderCurrentPointer: function (layoutInfo, group, axis, timelineModel) { var data = timelineModel.getData(); var currentIndex = timelineModel.getCurrentIndex(); var pointerModel = data.getItemModel(currentIndex).getModel('checkpointStyle'); var me = this; var callback = { onCreate: function (pointer) { pointer.draggable = true; pointer.drift = bind$6(me._handlePointerDrag, me); pointer.ondragend = bind$6(me._handlePointerDragend, me); pointerMoveTo(pointer, currentIndex, axis, timelineModel, true); }, onUpdate: function (pointer) { pointerMoveTo(pointer, currentIndex, axis, timelineModel); } }; // Reuse when exists, for animation and drag. this._currentPointer = giveSymbol( pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback ); }, _handlePlayClick: function (nextState) { this._clearTimer(); this.api.dispatchAction({ type: 'timelinePlayChange', playState: nextState, from: this.uid }); }, _handlePointerDrag: function (dx, dy, e) { this._clearTimer(); this._pointerChangeTimeline([e.offsetX, e.offsetY]); }, _handlePointerDragend: function (e) { this._pointerChangeTimeline([e.offsetX, e.offsetY], true); }, _pointerChangeTimeline: function (mousePos, trigger) { var toCoord = this._toAxisCoord(mousePos)[0]; var axis = this._axis; var axisExtent = asc(axis.getExtent().slice()); toCoord > axisExtent[1] && (toCoord = axisExtent[1]); toCoord < axisExtent[0] && (toCoord = axisExtent[0]); this._currentPointer.position[0] = toCoord; this._currentPointer.dirty(); var targetDataIndex = this._findNearestTick(toCoord); var timelineModel = this.model; if (trigger || ( targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get('realtime') )) { this._changeTimeline(targetDataIndex); } }, _doPlayStop: function () { this._clearTimer(); if (this.model.getPlayState()) { this._timer = setTimeout( bind$6(handleFrame, this), this.model.get('playInterval') ); } function handleFrame() { // Do not cache var timelineModel = this.model; this._changeTimeline( timelineModel.getCurrentIndex() + (timelineModel.get('rewind', true) ? -1 : 1) ); } }, _toAxisCoord: function (vertex) { var trans = this._mainGroup.getLocalTransform(); return applyTransform$1(vertex, trans, true); }, _findNearestTick: function (axisCoord) { var data = this.model.getData(); var dist = Infinity; var targetDataIndex; var axis = this._axis; data.each(['value'], function (value, dataIndex) { var coord = axis.dataToCoord(value); var d = Math.abs(coord - axisCoord); if (d < dist) { dist = d; targetDataIndex = dataIndex; } }); return targetDataIndex; }, _clearTimer: function () { if (this._timer) { clearTimeout(this._timer); this._timer = null; } }, _changeTimeline: function (nextIndex) { var currentIndex = this.model.getCurrentIndex(); if (nextIndex === '+') { nextIndex = currentIndex + 1; } else if (nextIndex === '-') { nextIndex = currentIndex - 1; } this.api.dispatchAction({ type: 'timelineChange', currentIndex: nextIndex, from: this.uid }); } }); function getViewRect$4(model, api) { return getLayoutRect( model.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() }, model.get('padding') ); } function makeIcon(timelineModel, objPath, rect, opts) { var icon = makePath( timelineModel.get(objPath).replace(/^path:\/\//, ''), clone(opts || {}), new BoundingRect(rect[0], rect[1], rect[2], rect[3]), 'center' ); return icon; } /** * Create symbol or update symbol * opt: basic position and event handlers */ function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) { var color = itemStyleModel.get('color'); if (!symbol) { var symbolType = hostModel.get('symbol'); symbol = createSymbol(symbolType, -1, -1, 2, 2, color); symbol.setStyle('strokeNoScale', true); group.add(symbol); callback && callback.onCreate(symbol); } else { symbol.setColor(color); group.add(symbol); // Group may be new, also need to add. callback && callback.onUpdate(symbol); } // Style var itemStyle = itemStyleModel.getItemStyle(['color', 'symbol', 'symbolSize']); symbol.setStyle(itemStyle); // Transform and events. opt = merge({ rectHover: true, z2: 100 }, opt, true); var symbolSize = hostModel.get('symbolSize'); symbolSize = symbolSize instanceof Array ? symbolSize.slice() : [+symbolSize, +symbolSize]; symbolSize[0] /= 2; symbolSize[1] /= 2; opt.scale = symbolSize; var symbolOffset = hostModel.get('symbolOffset'); if (symbolOffset) { var pos = opt.position = opt.position || [0, 0]; pos[0] += parsePercent$1(symbolOffset[0], symbolSize[0]); pos[1] += parsePercent$1(symbolOffset[1], symbolSize[1]); } var symbolRotate = hostModel.get('symbolRotate'); opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; symbol.attr(opt); // FIXME // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed, // getBoundingRect will return wrong result. // (This is supposed to be resolved in zrender, but it is a little difficult to // leverage performance and auto updateTransform) // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol. symbol.updateTransform(); return symbol; } function pointerMoveTo(pointer, dataIndex, axis, timelineModel, noAnimation) { if (pointer.dragging) { return; } var pointerModel = timelineModel.getModel('checkpointStyle'); var toCoord = axis.dataToCoord(timelineModel.getData().get(['value'], dataIndex)); if (noAnimation || !pointerModel.get('animation', true)) { pointer.attr({position: [toCoord, 0]}); } else { pointer.stopAnimation(true); pointer.animateTo( {position: [toCoord, 0]}, pointerModel.get('animationDuration', true), pointerModel.get('animationEasing', true) ); } } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * DataZoom component entry */ registerPreprocessor(preprocessor$3); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var ToolboxModel = extendComponentModel({ type: 'toolbox', layoutMode: { type: 'box', ignoreSize: true }, optionUpdated: function () { ToolboxModel.superApply(this, 'optionUpdated', arguments); each$1(this.option.feature, function (featureOpt, featureName) { var Feature = get$1(featureName); Feature && merge(featureOpt, Feature.defaultOption); }); }, defaultOption: { show: true, z: 6, zlevel: 0, orient: 'horizontal', left: 'right', top: 'top', // right // bottom backgroundColor: 'transparent', borderColor: '#ccc', borderRadius: 0, borderWidth: 0, padding: 5, itemSize: 15, itemGap: 8, showTitle: true, iconStyle: { borderColor: '#666', color: 'none' }, emphasis: { iconStyle: { borderColor: '#3E98C5' } } // textStyle: {}, // feature } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ extendComponentView({ type: 'toolbox', render: function (toolboxModel, ecModel, api, payload) { var group = this.group; group.removeAll(); if (!toolboxModel.get('show')) { return; } var itemSize = +toolboxModel.get('itemSize'); var featureOpts = toolboxModel.get('feature') || {}; var features = this._features || (this._features = {}); var featureNames = []; each$1(featureOpts, function (opt, name) { featureNames.push(name); }); (new DataDiffer(this._featureNames || [], featureNames)) .add(processFeature) .update(processFeature) .remove(curry(processFeature, null)) .execute(); // Keep for diff. this._featureNames = featureNames; function processFeature(newIndex, oldIndex) { var featureName = featureNames[newIndex]; var oldName = featureNames[oldIndex]; var featureOpt = featureOpts[featureName]; var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel); var feature; if (featureName && !oldName) { // Create if (isUserFeatureName(featureName)) { feature = { model: featureModel, onclick: featureModel.option.onclick, featureName: featureName }; } else { var Feature = get$1(featureName); if (!Feature) { return; } feature = new Feature(featureModel, ecModel, api); } features[featureName] = feature; } else { feature = features[oldName]; // If feature does not exsit. if (!feature) { return; } feature.model = featureModel; feature.ecModel = ecModel; feature.api = api; } if (!featureName && oldName) { feature.dispose && feature.dispose(ecModel, api); return; } if (!featureModel.get('show') || feature.unusable) { feature.remove && feature.remove(ecModel, api); return; } createIconPaths(featureModel, feature, featureName); featureModel.setIconStatus = function (iconName, status) { var option = this.option; var iconPaths = this.iconPaths; option.iconStatus = option.iconStatus || {}; option.iconStatus[iconName] = status; // FIXME iconPaths[iconName] && iconPaths[iconName].trigger(status); }; if (feature.render) { feature.render(featureModel, ecModel, api, payload); } } function createIconPaths(featureModel, feature, featureName) { var iconStyleModel = featureModel.getModel('iconStyle'); var iconStyleEmphasisModel = featureModel.getModel('emphasis.iconStyle'); // If one feature has mutiple icon. they are orginaized as // { // icon: { // foo: '', // bar: '' // }, // title: { // foo: '', // bar: '' // } // } var icons = feature.getIcons ? feature.getIcons() : featureModel.get('icon'); var titles = featureModel.get('title') || {}; if (typeof icons === 'string') { var icon = icons; var title = titles; icons = {}; titles = {}; icons[featureName] = icon; titles[featureName] = title; } var iconPaths = featureModel.iconPaths = {}; each$1(icons, function (iconStr, iconName) { var path = createIcon( iconStr, {}, { x: -itemSize / 2, y: -itemSize / 2, width: itemSize, height: itemSize } ); path.setStyle(iconStyleModel.getItemStyle()); path.hoverStyle = iconStyleEmphasisModel.getItemStyle(); setHoverStyle(path); if (toolboxModel.get('showTitle')) { path.__title = titles[iconName]; path.on('mouseover', function () { // Should not reuse above hoverStyle, which might be modified. var hoverStyle = iconStyleEmphasisModel.getItemStyle(); path.setStyle({ text: titles[iconName], textPosition: hoverStyle.textPosition || 'bottom', textFill: hoverStyle.fill || hoverStyle.stroke || '#000', textAlign: hoverStyle.textAlign || 'center' }); }) .on('mouseout', function () { path.setStyle({ textFill: null }); }); } path.trigger(featureModel.get('iconStatus.' + iconName) || 'normal'); group.add(path); path.on('click', bind( feature.onclick, feature, ecModel, api, iconName )); iconPaths[iconName] = path; }); } layout$3(group, toolboxModel, api); // Render background after group is layout // FIXME group.add(makeBackground(group.getBoundingRect(), toolboxModel)); // Adjust icon title positions to avoid them out of screen group.eachChild(function (icon) { var titleText = icon.__title; var hoverStyle = icon.hoverStyle; // May be background element if (hoverStyle && titleText) { var rect = getBoundingRect( titleText, makeFont(hoverStyle) ); var offsetX = icon.position[0] + group.position[0]; var offsetY = icon.position[1] + group.position[1] + itemSize; var needPutOnTop = false; if (offsetY + rect.height > api.getHeight()) { hoverStyle.textPosition = 'top'; needPutOnTop = true; } var topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8); if (offsetX + rect.width / 2 > api.getWidth()) { hoverStyle.textPosition = ['100%', topOffset]; hoverStyle.textAlign = 'right'; } else if (offsetX - rect.width / 2 < 0) { hoverStyle.textPosition = [0, topOffset]; hoverStyle.textAlign = 'left'; } } }); }, updateView: function (toolboxModel, ecModel, api, payload) { each$1(this._features, function (feature) { feature.updateView && feature.updateView(feature.model, ecModel, api, payload); }); }, // updateLayout: function (toolboxModel, ecModel, api, payload) { // zrUtil.each(this._features, function (feature) { // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload); // }); // }, remove: function (ecModel, api) { each$1(this._features, function (feature) { feature.remove && feature.remove(ecModel, api); }); this.group.removeAll(); }, dispose: function (ecModel, api) { each$1(this._features, function (feature) { feature.dispose && feature.dispose(ecModel, api); }); } }); function isUserFeatureName(featureName) { return featureName.indexOf('my') === 0; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var saveAsImageLang = lang.toolbox.saveAsImage; function SaveAsImage(model) { this.model = model; } SaveAsImage.defaultOption = { show: true, icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0', title: saveAsImageLang.title, type: 'png', // Default use option.backgroundColor // backgroundColor: '#fff', name: '', excludeComponents: ['toolbox'], pixelRatio: 1, lang: saveAsImageLang.lang.slice() }; SaveAsImage.prototype.unusable = !env$1.canvasSupported; var proto$4 = SaveAsImage.prototype; proto$4.onclick = function (ecModel, api) { var model = this.model; var title = model.get('name') || ecModel.get('title.0.text') || 'echarts'; var $a = document.createElement('a'); var type = model.get('type', true) || 'png'; $a.download = title + '.' + type; $a.target = '_blank'; var url = api.getConnectedDataURL({ type: type, backgroundColor: model.get('backgroundColor', true) || ecModel.get('backgroundColor') || '#fff', excludeComponents: model.get('excludeComponents'), pixelRatio: model.get('pixelRatio') }); $a.href = url; // Chrome and Firefox if (typeof MouseEvent === 'function' && !env$1.browser.ie && !env$1.browser.edge) { var evt = new MouseEvent('click', { view: window, bubbles: true, cancelable: false }); $a.dispatchEvent(evt); } // IE else { if (window.navigator.msSaveOrOpenBlob) { var bstr = atob(url.split(',')[1]); var n = bstr.length; var u8arr = new Uint8Array(n); while(n--) { u8arr[n] = bstr.charCodeAt(n); } var blob = new Blob([u8arr]); window.navigator.msSaveOrOpenBlob(blob, title + '.' + type); } else { var lang$$1 = model.get('lang'); var html = '' + '' + '' + ''; var tab = window.open(); tab.document.write(html); } } }; register$1( 'saveAsImage', SaveAsImage ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var magicTypeLang = lang.toolbox.magicType; function MagicType(model) { this.model = model; } MagicType.defaultOption = { show: true, type: [], // Icon group icon: { line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4', bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7', stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z', // jshint ignore:line tiled: 'M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z' }, // `line`, `bar`, `stack`, `tiled` title: clone(magicTypeLang.title), option: {}, seriesIndex: {} }; var proto$5 = MagicType.prototype; proto$5.getIcons = function () { var model = this.model; var availableIcons = model.get('icon'); var icons = {}; each$1(model.get('type'), function (type) { if (availableIcons[type]) { icons[type] = availableIcons[type]; } }); return icons; }; var seriesOptGenreator = { 'line': function (seriesType, seriesId, seriesModel, model) { if (seriesType === 'bar') { return merge({ id: seriesId, type: 'line', // Preserve data related option data: seriesModel.get('data'), stack: seriesModel.get('stack'), markPoint: seriesModel.get('markPoint'), markLine: seriesModel.get('markLine') }, model.get('option.line') || {}, true); } }, 'bar': function (seriesType, seriesId, seriesModel, model) { if (seriesType === 'line') { return merge({ id: seriesId, type: 'bar', // Preserve data related option data: seriesModel.get('data'), stack: seriesModel.get('stack'), markPoint: seriesModel.get('markPoint'), markLine: seriesModel.get('markLine') }, model.get('option.bar') || {}, true); } }, 'stack': function (seriesType, seriesId, seriesModel, model) { if (seriesType === 'line' || seriesType === 'bar') { return merge({ id: seriesId, stack: '__ec_magicType_stack__' }, model.get('option.stack') || {}, true); } }, 'tiled': function (seriesType, seriesId, seriesModel, model) { if (seriesType === 'line' || seriesType === 'bar') { return merge({ id: seriesId, stack: '' }, model.get('option.tiled') || {}, true); } } }; var radioTypes = [ ['line', 'bar'], ['stack', 'tiled'] ]; proto$5.onclick = function (ecModel, api, type) { var model = this.model; var seriesIndex = model.get('seriesIndex.' + type); // Not supported magicType if (!seriesOptGenreator[type]) { return; } var newOption = { series: [] }; var generateNewSeriesTypes = function (seriesModel) { var seriesType = seriesModel.subType; var seriesId = seriesModel.id; var newSeriesOpt = seriesOptGenreator[type]( seriesType, seriesId, seriesModel, model ); if (newSeriesOpt) { // PENDING If merge original option? defaults(newSeriesOpt, seriesModel.option); newOption.series.push(newSeriesOpt); } // Modify boundaryGap var coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) { var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; if (categoryAxis) { var axisDim = categoryAxis.dim; var axisType = axisDim + 'Axis'; var axisModel = ecModel.queryComponents({ mainType: axisType, index: seriesModel.get(name + 'Index'), id: seriesModel.get(name + 'Id') })[0]; var axisIndex = axisModel.componentIndex; newOption[axisType] = newOption[axisType] || []; for (var i = 0; i <= axisIndex; i++) { newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {}; } newOption[axisType][axisIndex].boundaryGap = type === 'bar' ? true : false; } } }; each$1(radioTypes, function (radio) { if (indexOf(radio, type) >= 0) { each$1(radio, function (item) { model.setIconStatus(item, 'normal'); }); } }); model.setIconStatus(type, 'emphasis'); ecModel.eachComponent( { mainType: 'series', query: seriesIndex == null ? null : { seriesIndex: seriesIndex } }, generateNewSeriesTypes ); api.dispatchAction({ type: 'changeMagicType', currentType: type, newOption: newOption }); }; registerAction({ type: 'changeMagicType', event: 'magicTypeChanged', update: 'prepareAndUpdate' }, function (payload, ecModel) { ecModel.mergeOption(payload.newOption); }); register$1('magicType', MagicType); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var dataViewLang = lang.toolbox.dataView; var BLOCK_SPLITER = new Array(60).join('-'); var ITEM_SPLITER = '\t'; /** * Group series into two types * 1. on category axis, like line, bar * 2. others, like scatter, pie * @param {module:echarts/model/Global} ecModel * @return {Object} * @inner */ function groupSeries(ecModel) { var seriesGroupByCategoryAxis = {}; var otherSeries = []; var meta = []; ecModel.eachRawSeries(function (seriesModel) { var coordSys = seriesModel.coordinateSystem; if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) { var baseAxis = coordSys.getBaseAxis(); if (baseAxis.type === 'category') { var key = baseAxis.dim + '_' + baseAxis.index; if (!seriesGroupByCategoryAxis[key]) { seriesGroupByCategoryAxis[key] = { categoryAxis: baseAxis, valueAxis: coordSys.getOtherAxis(baseAxis), series: [] }; meta.push({ axisDim: baseAxis.dim, axisIndex: baseAxis.index }); } seriesGroupByCategoryAxis[key].series.push(seriesModel); } else { otherSeries.push(seriesModel); } } else { otherSeries.push(seriesModel); } }); return { seriesGroupByCategoryAxis: seriesGroupByCategoryAxis, other: otherSeries, meta: meta }; } /** * Assemble content of series on cateogory axis * @param {Array.} series * @return {string} * @inner */ function assembleSeriesWithCategoryAxis(series) { var tables = []; each$1(series, function (group, key) { var categoryAxis = group.categoryAxis; var valueAxis = group.valueAxis; var valueAxisDim = valueAxis.dim; var headers = [' '].concat(map(group.series, function (series) { return series.name; })); var columns = [categoryAxis.model.getCategories()]; each$1(group.series, function (series) { columns.push(series.getRawData().mapArray(valueAxisDim, function (val) { return val; })); }); // Assemble table content var lines = [headers.join(ITEM_SPLITER)]; for (var i = 0; i < columns[0].length; i++) { var items = []; for (var j = 0; j < columns.length; j++) { items.push(columns[j][i]); } lines.push(items.join(ITEM_SPLITER)); } tables.push(lines.join('\n')); }); return tables.join('\n\n' + BLOCK_SPLITER + '\n\n'); } /** * Assemble content of other series * @param {Array.} series * @return {string} * @inner */ function assembleOtherSeries(series) { return map(series, function (series) { var data = series.getRawData(); var lines = [series.name]; var vals = []; data.each(data.dimensions, function () { var argLen = arguments.length; var dataIndex = arguments[argLen - 1]; var name = data.getName(dataIndex); for (var i = 0; i < argLen - 1; i++) { vals[i] = arguments[i]; } lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER)); }); return lines.join('\n'); }).join('\n\n' + BLOCK_SPLITER + '\n\n'); } /** * @param {module:echarts/model/Global} * @return {Object} * @inner */ function getContentFromModel(ecModel) { var result = groupSeries(ecModel); return { value: filter([ assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other) ], function (str) { return str.replace(/[\n\t\s]/g, ''); }).join('\n\n' + BLOCK_SPLITER + '\n\n'), meta: result.meta }; } function trim$1(str) { return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); } /** * If a block is tsv format */ function isTSVFormat(block) { // Simple method to find out if a block is tsv format var firstLine = block.slice(0, block.indexOf('\n')); if (firstLine.indexOf(ITEM_SPLITER) >= 0) { return true; } } var itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g'); /** * @param {string} tsv * @return {Object} */ function parseTSVContents(tsv) { var tsvLines = tsv.split(/\n+/g); var headers = trim$1(tsvLines.shift()).split(itemSplitRegex); var categories = []; var series = map(headers, function (header) { return { name: header, data: [] }; }); for (var i = 0; i < tsvLines.length; i++) { var items = trim$1(tsvLines[i]).split(itemSplitRegex); categories.push(items.shift()); for (var j = 0; j < items.length; j++) { series[j] && (series[j].data[i] = items[j]); } } return { series: series, categories: categories }; } /** * @param {string} str * @return {Array.} * @inner */ function parseListContents(str) { var lines = str.split(/\n+/g); var seriesName = trim$1(lines.shift()); var data = []; for (var i = 0; i < lines.length; i++) { var items = trim$1(lines[i]).split(itemSplitRegex); var name = ''; var value; var hasName = false; if (isNaN(items[0])) { // First item is name hasName = true; name = items[0]; items = items.slice(1); data[i] = { name: name, value: [] }; value = data[i].value; } else { value = data[i] = []; } for (var j = 0; j < items.length; j++) { value.push(+items[j]); } if (value.length === 1) { hasName ? (data[i].value = value[0]) : (data[i] = value[0]); } } return { name: seriesName, data: data }; } /** * @param {string} str * @param {Array.} blockMetaList * @return {Object} * @inner */ function parseContents(str, blockMetaList) { var blocks = str.split(new RegExp('\n*' + BLOCK_SPLITER + '\n*', 'g')); var newOption = { series: [] }; each$1(blocks, function (block, idx) { if (isTSVFormat(block)) { var result = parseTSVContents(block); var blockMeta = blockMetaList[idx]; var axisKey = blockMeta.axisDim + 'Axis'; if (blockMeta) { newOption[axisKey] = newOption[axisKey] || []; newOption[axisKey][blockMeta.axisIndex] = { data: result.categories }; newOption.series = newOption.series.concat(result.series); } } else { var result = parseListContents(block); newOption.series.push(result); } }); return newOption; } /** * @alias {module:echarts/component/toolbox/feature/DataView} * @constructor * @param {module:echarts/model/Model} model */ function DataView(model) { this._dom = null; this.model = model; } DataView.defaultOption = { show: true, readOnly: false, optionToContent: null, contentToOption: null, icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28', title: clone(dataViewLang.title), lang: clone(dataViewLang.lang), backgroundColor: '#fff', textColor: '#000', textareaColor: '#fff', textareaBorderColor: '#333', buttonColor: '#c23531', buttonTextColor: '#fff' }; DataView.prototype.onclick = function (ecModel, api) { var container = api.getDom(); var model = this.model; if (this._dom) { container.removeChild(this._dom); } var root = document.createElement('div'); root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;'; root.style.backgroundColor = model.get('backgroundColor') || '#fff'; // Create elements var header = document.createElement('h4'); var lang$$1 = model.get('lang') || []; header.innerHTML = lang$$1[0] || model.get('title'); header.style.cssText = 'margin: 10px 20px;'; header.style.color = model.get('textColor'); var viewMain = document.createElement('div'); var textarea = document.createElement('textarea'); viewMain.style.cssText = 'display:block;width:100%;overflow:auto;'; var optionToContent = model.get('optionToContent'); var contentToOption = model.get('contentToOption'); var result = getContentFromModel(ecModel); if (typeof optionToContent === 'function') { var htmlOrDom = optionToContent(api.getOption()); if (typeof htmlOrDom === 'string') { viewMain.innerHTML = htmlOrDom; } else if (isDom(htmlOrDom)) { viewMain.appendChild(htmlOrDom); } } else { // Use default textarea viewMain.appendChild(textarea); textarea.readOnly = model.get('readOnly'); textarea.style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;'; textarea.style.color = model.get('textColor'); textarea.style.borderColor = model.get('textareaBorderColor'); textarea.style.backgroundColor = model.get('textareaColor'); textarea.value = result.value; } var blockMetaList = result.meta; var buttonContainer = document.createElement('div'); buttonContainer.style.cssText = 'position:absolute;bottom:0;left:0;right:0;'; var buttonStyle = 'float:right;margin-right:20px;border:none;' + 'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px'; var closeButton = document.createElement('div'); var refreshButton = document.createElement('div'); buttonStyle += ';background-color:' + model.get('buttonColor'); buttonStyle += ';color:' + model.get('buttonTextColor'); var self = this; function close() { container.removeChild(root); self._dom = null; } addEventListener(closeButton, 'click', close); addEventListener(refreshButton, 'click', function () { var newOption; try { if (typeof contentToOption === 'function') { newOption = contentToOption(viewMain, api.getOption()); } else { newOption = parseContents(textarea.value, blockMetaList); } } catch (e) { close(); throw new Error('Data view format error ' + e); } if (newOption) { api.dispatchAction({ type: 'changeDataView', newOption: newOption }); } close(); }); closeButton.innerHTML = lang$$1[1]; refreshButton.innerHTML = lang$$1[2]; refreshButton.style.cssText = buttonStyle; closeButton.style.cssText = buttonStyle; !model.get('readOnly') && buttonContainer.appendChild(refreshButton); buttonContainer.appendChild(closeButton); // http://stackoverflow.com/questions/6637341/use-tab-to-indent-in-textarea addEventListener(textarea, 'keydown', function (e) { if ((e.keyCode || e.which) === 9) { // get caret position/selection var val = this.value; var start = this.selectionStart; var end = this.selectionEnd; // set textarea value to: text before caret + tab + text after caret this.value = val.substring(0, start) + ITEM_SPLITER + val.substring(end); // put caret at right position again this.selectionStart = this.selectionEnd = start + 1; // prevent the focus lose stop(e); } }); root.appendChild(header); root.appendChild(viewMain); root.appendChild(buttonContainer); viewMain.style.height = (container.clientHeight - 80) + 'px'; container.appendChild(root); this._dom = root; }; DataView.prototype.remove = function (ecModel, api) { this._dom && api.getDom().removeChild(this._dom); }; DataView.prototype.dispose = function (ecModel, api) { this.remove(ecModel, api); }; /** * @inner */ function tryMergeDataOption(newData, originalData) { return map(newData, function (newVal, idx) { var original = originalData && originalData[idx]; if (isObject$1(original) && !isArray(original)) { if (isObject$1(newVal) && !isArray(newVal)) { newVal = newVal.value; } // Original data has option return defaults({ value: newVal }, original); } else { return newVal; } }); } register$1('dataView', DataView); registerAction({ type: 'changeDataView', event: 'dataViewChanged', update: 'prepareAndUpdate' }, function (payload, ecModel) { var newSeriesOptList = []; each$1(payload.newOption.series, function (seriesOpt) { var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0]; if (!seriesModel) { // New created series // Geuss the series type newSeriesOptList.push(extend({ // Default is scatter type: 'scatter' }, seriesOpt)); } else { var originalData = seriesModel.get('data'); newSeriesOptList.push({ name: seriesOpt.name, data: tryMergeDataOption(seriesOpt.data, originalData) }); } }); ecModel.mergeOption(defaults({ series: newSeriesOptList }, payload.newOption)); }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var each$29 = each$1; var ATTR$2 = '\0_ec_hist_store'; /** * @param {module:echarts/model/Global} ecModel * @param {Object} newSnapshot {dataZoomId, batch: [payloadInfo, ...]} */ function push(ecModel, newSnapshot) { var store = giveStore$1(ecModel); // If previous dataZoom can not be found, // complete an range with current range. each$29(newSnapshot, function (batchItem, dataZoomId) { var i = store.length - 1; for (; i >= 0; i--) { var snapshot = store[i]; if (snapshot[dataZoomId]) { break; } } if (i < 0) { // No origin range set, create one by current range. var dataZoomModel = ecModel.queryComponents( {mainType: 'dataZoom', subType: 'select', id: dataZoomId} )[0]; if (dataZoomModel) { var percentRange = dataZoomModel.getPercentRange(); store[0][dataZoomId] = { dataZoomId: dataZoomId, start: percentRange[0], end: percentRange[1] }; } } }); store.push(newSnapshot); } /** * @param {module:echarts/model/Global} ecModel * @return {Object} snapshot */ function pop(ecModel) { var store = giveStore$1(ecModel); var head = store[store.length - 1]; store.length > 1 && store.pop(); // Find top for all dataZoom. var snapshot = {}; each$29(head, function (batchItem, dataZoomId) { for (var i = store.length - 1; i >= 0; i--) { var batchItem = store[i][dataZoomId]; if (batchItem) { snapshot[dataZoomId] = batchItem; break; } } }); return snapshot; } /** * @param {module:echarts/model/Global} ecModel */ function clear$1(ecModel) { ecModel[ATTR$2] = null; } /** * @param {module:echarts/model/Global} ecModel * @return {number} records. always >= 1. */ function count(ecModel) { return giveStore$1(ecModel).length; } /** * [{key: dataZoomId, value: {dataZoomId, range}}, ...] * History length of each dataZoom may be different. * this._history[0] is used to store origin range. * @type {Array.} */ function giveStore$1(ecModel) { var store = ecModel[ATTR$2]; if (!store) { store = ecModel[ATTR$2] = [{}]; } return store; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ DataZoomModel.extend({ type: 'dataZoom.select' }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ DataZoomView.extend({ type: 'dataZoom.select' }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * DataZoom component entry */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Use dataZoomSelect var dataZoomLang = lang.toolbox.dataZoom; var each$28 = each$1; // Spectial component id start with \0ec\0, see echarts/model/Global.js~hasInnerId var DATA_ZOOM_ID_BASE = '\0_ec_\0toolbox-dataZoom_'; function DataZoom(model, ecModel, api) { /** * @private * @type {module:echarts/component/helper/BrushController} */ (this._brushController = new BrushController(api.getZr())) .on('brush', bind(this._onBrush, this)) .mount(); /** * @private * @type {boolean} */ this._isZoomActive; } DataZoom.defaultOption = { show: true, // Icon group icon: { zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1', back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26' }, // `zoom`, `back` title: clone(dataZoomLang.title) }; var proto$6 = DataZoom.prototype; proto$6.render = function (featureModel, ecModel, api, payload) { this.model = featureModel; this.ecModel = ecModel; this.api = api; updateZoomBtnStatus(featureModel, ecModel, this, payload, api); updateBackBtnStatus(featureModel, ecModel); }; proto$6.onclick = function (ecModel, api, type) { handlers$1[type].call(this); }; proto$6.remove = function (ecModel, api) { this._brushController.unmount(); }; proto$6.dispose = function (ecModel, api) { this._brushController.dispose(); }; /** * @private */ var handlers$1 = { zoom: function () { var nextActive = !this._isZoomActive; this.api.dispatchAction({ type: 'takeGlobalCursor', key: 'dataZoomSelect', dataZoomSelectActive: nextActive }); }, back: function () { this._dispatchZoomAction(pop(this.ecModel)); } }; /** * @private */ proto$6._onBrush = function (areas, opt) { if (!opt.isEnd || !areas.length) { return; } var snapshot = {}; var ecModel = this.ecModel; this._brushController.updateCovers([]); // remove cover var brushTargetManager = new BrushTargetManager( retrieveAxisSetting(this.model.option), ecModel, {include: ['grid']} ); brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { if (coordSys.type !== 'cartesian2d') { return; } var brushType = area.brushType; if (brushType === 'rect') { setBatch('x', coordSys, coordRange[0]); setBatch('y', coordSys, coordRange[1]); } else { setBatch(({lineX: 'x', lineY: 'y'})[brushType], coordSys, coordRange); } }); push(ecModel, snapshot); this._dispatchZoomAction(snapshot); function setBatch(dimName, coordSys, minMax) { var axis = coordSys.getAxis(dimName); var axisModel = axis.model; var dataZoomModel = findDataZoom(dimName, axisModel, ecModel); // Restrict range. var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan(); if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) { minMax = sliderMove( 0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan ); } dataZoomModel && (snapshot[dataZoomModel.id] = { dataZoomId: dataZoomModel.id, startValue: minMax[0], endValue: minMax[1] }); } function findDataZoom(dimName, axisModel, ecModel) { var found; ecModel.eachComponent({mainType: 'dataZoom', subType: 'select'}, function (dzModel) { var has = dzModel.getAxisModel(dimName, axisModel.componentIndex); has && (found = dzModel); }); return found; } }; /** * @private */ proto$6._dispatchZoomAction = function (snapshot) { var batch = []; // Convert from hash map to array. each$28(snapshot, function (batchItem, dataZoomId) { batch.push(clone(batchItem)); }); batch.length && this.api.dispatchAction({ type: 'dataZoom', from: this.uid, batch: batch }); }; function retrieveAxisSetting(option) { var setting = {}; // Compatible with previous setting: null => all axis, false => no axis. each$1(['xAxisIndex', 'yAxisIndex'], function (name) { setting[name] = option[name]; setting[name] == null && (setting[name] = 'all'); (setting[name] === false || setting[name] === 'none') && (setting[name] = []); }); return setting; } function updateBackBtnStatus(featureModel, ecModel) { featureModel.setIconStatus( 'back', count(ecModel) > 1 ? 'emphasis' : 'normal' ); } function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) { var zoomActive = view._isZoomActive; if (payload && payload.type === 'takeGlobalCursor') { zoomActive = payload.key === 'dataZoomSelect' ? payload.dataZoomSelectActive : false; } view._isZoomActive = zoomActive; featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal'); var brushTargetManager = new BrushTargetManager( retrieveAxisSetting(featureModel.option), ecModel, {include: ['grid']} ); view._brushController .setPanels(brushTargetManager.makePanelOpts(api, function (targetInfo) { return (targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared) ? 'lineX' : (!targetInfo.xAxisDeclared && targetInfo.yAxisDeclared) ? 'lineY' : 'rect'; })) .enableBrush( zoomActive ? { brushType: 'auto', brushStyle: { // FIXME user customized? lineWidth: 0, fill: 'rgba(0,0,0,0.2)' } } : false ); } register$1('dataZoom', DataZoom); // Create special dataZoom option for select // FIXME consider the case of merge option, where axes options are not exists. registerPreprocessor(function (option) { if (!option) { return; } var dataZoomOpts = option.dataZoom || (option.dataZoom = []); if (!isArray(dataZoomOpts)) { option.dataZoom = dataZoomOpts = [dataZoomOpts]; } var toolboxOpt = option.toolbox; if (toolboxOpt) { // Assume there is only one toolbox if (isArray(toolboxOpt)) { toolboxOpt = toolboxOpt[0]; } if (toolboxOpt && toolboxOpt.feature) { var dataZoomOpt = toolboxOpt.feature.dataZoom; // FIXME: If add dataZoom when setOption in merge mode, // no axis info to be added. See `test/dataZoom-extreme.html` addForAxis('xAxis', dataZoomOpt); addForAxis('yAxis', dataZoomOpt); } } function addForAxis(axisName, dataZoomOpt) { if (!dataZoomOpt) { return; } // Try not to modify model, because it is not merged yet. var axisIndicesName = axisName + 'Index'; var givenAxisIndices = dataZoomOpt[axisIndicesName]; if (givenAxisIndices != null && givenAxisIndices != 'all' && !isArray(givenAxisIndices) ) { givenAxisIndices = (givenAxisIndices === false || givenAxisIndices === 'none') ? [] : [givenAxisIndices]; } forEachComponent(axisName, function (axisOpt, axisIndex) { if (givenAxisIndices != null && givenAxisIndices != 'all' && indexOf(givenAxisIndices, axisIndex) === -1 ) { return; } var newOpt = { type: 'select', $fromToolbox: true, // Id for merge mapping. id: DATA_ZOOM_ID_BASE + axisName + axisIndex }; // FIXME // Only support one axis now. newOpt[axisIndicesName] = axisIndex; dataZoomOpts.push(newOpt); }); } function forEachComponent(mainType, cb) { var opts = option[mainType]; if (!isArray(opts)) { opts = opts ? [opts] : []; } each$28(opts, cb); } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var restoreLang = lang.toolbox.restore; function Restore(model) { this.model = model; } Restore.defaultOption = { show: true, icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5', title: restoreLang.title }; var proto$7 = Restore.prototype; proto$7.onclick = function (ecModel, api, type) { clear$1(ecModel); api.dispatchAction({ type: 'restore', from: this.uid }); }; register$1('restore', Restore); registerAction( {type: 'restore', event: 'restore', update: 'prepareAndUpdate'}, function (payload, ecModel) { ecModel.resetOption('recreate'); } ); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var urn = 'urn:schemas-microsoft-com:vml'; var win = typeof window === 'undefined' ? null : window; var vmlInited = false; var doc = win && win.document; function createNode(tagName) { return doCreateNode(tagName); } // Avoid assign to an exported variable, for transforming to cjs. var doCreateNode; if (doc && !env$1.canvasSupported) { try { !doc.namespaces.zrvml && doc.namespaces.add('zrvml', urn); doCreateNode = function (tagName) { return doc.createElement(''); }; } catch (e) { doCreateNode = function (tagName) { return doc.createElement('<' + tagName + ' xmlns="' + urn + '" class="zrvml">'); }; } } // From raphael function initVML() { if (vmlInited || !doc) { return; } vmlInited = true; var styleSheets = doc.styleSheets; if (styleSheets.length < 31) { doc.createStyleSheet().addRule('.zrvml', 'behavior:url(#default#VML)'); } else { // http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx styleSheets[0].addRule('.zrvml', 'behavior:url(#default#VML)'); } } // http://www.w3.org/TR/NOTE-VML // TODO Use proxy like svg instead of overwrite brush methods var CMD$3 = PathProxy.CMD; var round$3 = Math.round; var sqrt = Math.sqrt; var abs$1 = Math.abs; var cos = Math.cos; var sin = Math.sin; var mathMax$8 = Math.max; if (!env$1.canvasSupported) { var comma = ','; var imageTransformPrefix = 'progid:DXImageTransform.Microsoft'; var Z = 21600; var Z2 = Z / 2; var ZLEVEL_BASE = 100000; var Z_BASE$1 = 1000; var initRootElStyle = function (el) { el.style.cssText = 'position:absolute;left:0;top:0;width:1px;height:1px;'; el.coordsize = Z + ',' + Z; el.coordorigin = '0,0'; }; var encodeHtmlAttribute = function (s) { return String(s).replace(/&/g, '&').replace(/"/g, '"'); }; var rgb2Str = function (r, g, b) { return 'rgb(' + [r, g, b].join(',') + ')'; }; var append = function (parent, child) { if (child && parent && child.parentNode !== parent) { parent.appendChild(child); } }; var remove = function (parent, child) { if (child && parent && child.parentNode === parent) { parent.removeChild(child); } }; var getZIndex = function (zlevel, z, z2) { // z 的取值范围为 [0, 1000] return (parseFloat(zlevel) || 0) * ZLEVEL_BASE + (parseFloat(z) || 0) * Z_BASE$1 + z2; }; var parsePercent$3 = function (value, maxValue) { if (typeof value === 'string') { if (value.lastIndexOf('%') >= 0) { return parseFloat(value) / 100 * maxValue; } return parseFloat(value); } return value; }; /*************************************************** * PATH **************************************************/ var setColorAndOpacity = function (el, color, opacity) { var colorArr = parse(color); opacity = +opacity; if (isNaN(opacity)) { opacity = 1; } if (colorArr) { el.color = rgb2Str(colorArr[0], colorArr[1], colorArr[2]); el.opacity = opacity * colorArr[3]; } }; var getColorAndAlpha = function (color) { var colorArr = parse(color); return [ rgb2Str(colorArr[0], colorArr[1], colorArr[2]), colorArr[3] ]; }; var updateFillNode = function (el, style, zrEl) { // TODO pattern var fill = style.fill; if (fill != null) { // Modified from excanvas if (fill instanceof Gradient) { var gradientType; var angle = 0; var focus = [0, 0]; // additional offset var shift = 0; // scale factor for offset var expansion = 1; var rect = zrEl.getBoundingRect(); var rectWidth = rect.width; var rectHeight = rect.height; if (fill.type === 'linear') { gradientType = 'gradient'; var transform = zrEl.transform; var p0 = [fill.x * rectWidth, fill.y * rectHeight]; var p1 = [fill.x2 * rectWidth, fill.y2 * rectHeight]; if (transform) { applyTransform(p0, p0, transform); applyTransform(p1, p1, transform); } var dx = p1[0] - p0[0]; var dy = p1[1] - p0[1]; angle = Math.atan2(dx, dy) * 180 / Math.PI; // The angle should be a non-negative number. if (angle < 0) { angle += 360; } // Very small angles produce an unexpected result because they are // converted to a scientific notation string. if (angle < 1e-6) { angle = 0; } } else { gradientType = 'gradientradial'; var p0 = [fill.x * rectWidth, fill.y * rectHeight]; var transform = zrEl.transform; var scale$$1 = zrEl.scale; var width = rectWidth; var height = rectHeight; focus = [ // Percent in bounding rect (p0[0] - rect.x) / width, (p0[1] - rect.y) / height ]; if (transform) { applyTransform(p0, p0, transform); } width /= scale$$1[0] * Z; height /= scale$$1[1] * Z; var dimension = mathMax$8(width, height); shift = 2 * 0 / dimension; expansion = 2 * fill.r / dimension - shift; } // We need to sort the color stops in ascending order by offset, // otherwise IE won't interpret it correctly. var stops = fill.colorStops.slice(); stops.sort(function(cs1, cs2) { return cs1.offset - cs2.offset; }); var length$$1 = stops.length; // Color and alpha list of first and last stop var colorAndAlphaList = []; var colors = []; for (var i = 0; i < length$$1; i++) { var stop = stops[i]; var colorAndAlpha = getColorAndAlpha(stop.color); colors.push(stop.offset * expansion + shift + ' ' + colorAndAlpha[0]); if (i === 0 || i === length$$1 - 1) { colorAndAlphaList.push(colorAndAlpha); } } if (length$$1 >= 2) { var color1 = colorAndAlphaList[0][0]; var color2 = colorAndAlphaList[1][0]; var opacity1 = colorAndAlphaList[0][1] * style.opacity; var opacity2 = colorAndAlphaList[1][1] * style.opacity; el.type = gradientType; el.method = 'none'; el.focus = '100%'; el.angle = angle; el.color = color1; el.color2 = color2; el.colors = colors.join(','); // When colors attribute is used, the meanings of opacity and o:opacity2 // are reversed. el.opacity = opacity2; // FIXME g_o_:opacity ? el.opacity2 = opacity1; } if (gradientType === 'radial') { el.focusposition = focus.join(','); } } else { // FIXME Change from Gradient fill to color fill setColorAndOpacity(el, fill, style.opacity); } } }; var updateStrokeNode = function (el, style) { // if (style.lineJoin != null) { // el.joinstyle = style.lineJoin; // } // if (style.miterLimit != null) { // el.miterlimit = style.miterLimit * Z; // } // if (style.lineCap != null) { // el.endcap = style.lineCap; // } if (style.lineDash != null) { el.dashstyle = style.lineDash.join(' '); } if (style.stroke != null && !(style.stroke instanceof Gradient)) { setColorAndOpacity(el, style.stroke, style.opacity); } }; var updateFillAndStroke = function (vmlEl, type, style, zrEl) { var isFill = type == 'fill'; var el = vmlEl.getElementsByTagName(type)[0]; // Stroke must have lineWidth if (style[type] != null && style[type] !== 'none' && (isFill || (!isFill && style.lineWidth))) { vmlEl[isFill ? 'filled' : 'stroked'] = 'true'; // FIXME Remove before updating, or set `colors` will throw error if (style[type] instanceof Gradient) { remove(vmlEl, el); } if (!el) { el = createNode(type); } isFill ? updateFillNode(el, style, zrEl) : updateStrokeNode(el, style); append(vmlEl, el); } else { vmlEl[isFill ? 'filled' : 'stroked'] = 'false'; remove(vmlEl, el); } }; var points$3 = [[], [], []]; var pathDataToString = function (path, m) { var M = CMD$3.M; var C = CMD$3.C; var L = CMD$3.L; var A = CMD$3.A; var Q = CMD$3.Q; var str = []; var nPoint; var cmdStr; var cmd; var i; var xi; var yi; var data = path.data; var dataLength = path.len(); for (i = 0; i < dataLength;) { cmd = data[i++]; cmdStr = ''; nPoint = 0; switch (cmd) { case M: cmdStr = ' m '; nPoint = 1; xi = data[i++]; yi = data[i++]; points$3[0][0] = xi; points$3[0][1] = yi; break; case L: cmdStr = ' l '; nPoint = 1; xi = data[i++]; yi = data[i++]; points$3[0][0] = xi; points$3[0][1] = yi; break; case Q: case C: cmdStr = ' c '; nPoint = 3; var x1 = data[i++]; var y1 = data[i++]; var x2 = data[i++]; var y2 = data[i++]; var x3; var y3; if (cmd === Q) { // Convert quadratic to cubic using degree elevation x3 = x2; y3 = y2; x2 = (x2 + 2 * x1) / 3; y2 = (y2 + 2 * y1) / 3; x1 = (xi + 2 * x1) / 3; y1 = (yi + 2 * y1) / 3; } else { x3 = data[i++]; y3 = data[i++]; } points$3[0][0] = x1; points$3[0][1] = y1; points$3[1][0] = x2; points$3[1][1] = y2; points$3[2][0] = x3; points$3[2][1] = y3; xi = x3; yi = y3; break; case A: var x = 0; var y = 0; var sx = 1; var sy = 1; var angle = 0; if (m) { // Extract SRT from matrix x = m[4]; y = m[5]; sx = sqrt(m[0] * m[0] + m[1] * m[1]); sy = sqrt(m[2] * m[2] + m[3] * m[3]); angle = Math.atan2(-m[1] / sy, m[0] / sx); } var cx = data[i++]; var cy = data[i++]; var rx = data[i++]; var ry = data[i++]; var startAngle = data[i++] + angle; var endAngle = data[i++] + startAngle + angle; // FIXME // var psi = data[i++]; i++; var clockwise = data[i++]; var x0 = cx + cos(startAngle) * rx; var y0 = cy + sin(startAngle) * ry; var x1 = cx + cos(endAngle) * rx; var y1 = cy + sin(endAngle) * ry; var type = clockwise ? ' wa ' : ' at '; if (Math.abs(x0 - x1) < 1e-4) { // IE won't render arches drawn counter clockwise if x0 == x1. if (Math.abs(endAngle - startAngle) > 1e-2) { // Offset x0 by 1/80 of a pixel. Use something // that can be represented in binary if (clockwise) { x0 += 270 / Z; } } else { // Avoid case draw full circle if (Math.abs(y0 - cy) < 1e-4) { if ((clockwise && x0 < cx) || (!clockwise && x0 > cx)) { y1 -= 270 / Z; } else { y1 += 270 / Z; } } else if ((clockwise && y0 < cy) || (!clockwise && y0 > cy)) { x1 += 270 / Z; } else { x1 -= 270 / Z; } } } str.push( type, round$3(((cx - rx) * sx + x) * Z - Z2), comma, round$3(((cy - ry) * sy + y) * Z - Z2), comma, round$3(((cx + rx) * sx + x) * Z - Z2), comma, round$3(((cy + ry) * sy + y) * Z - Z2), comma, round$3((x0 * sx + x) * Z - Z2), comma, round$3((y0 * sy + y) * Z - Z2), comma, round$3((x1 * sx + x) * Z - Z2), comma, round$3((y1 * sy + y) * Z - Z2) ); xi = x1; yi = y1; break; case CMD$3.R: var p0 = points$3[0]; var p1 = points$3[1]; // x0, y0 p0[0] = data[i++]; p0[1] = data[i++]; // x1, y1 p1[0] = p0[0] + data[i++]; p1[1] = p0[1] + data[i++]; if (m) { applyTransform(p0, p0, m); applyTransform(p1, p1, m); } p0[0] = round$3(p0[0] * Z - Z2); p1[0] = round$3(p1[0] * Z - Z2); p0[1] = round$3(p0[1] * Z - Z2); p1[1] = round$3(p1[1] * Z - Z2); str.push( // x0, y0 ' m ', p0[0], comma, p0[1], // x1, y0 ' l ', p1[0], comma, p0[1], // x1, y1 ' l ', p1[0], comma, p1[1], // x0, y1 ' l ', p0[0], comma, p1[1] ); break; case CMD$3.Z: // FIXME Update xi, yi str.push(' x '); } if (nPoint > 0) { str.push(cmdStr); for (var k = 0; k < nPoint; k++) { var p = points$3[k]; m && applyTransform(p, p, m); // 不 round 会非常慢 str.push( round$3(p[0] * Z - Z2), comma, round$3(p[1] * Z - Z2), k < nPoint - 1 ? comma : '' ); } } } return str.join(''); }; // Rewrite the original path method Path.prototype.brushVML = function (vmlRoot) { var style = this.style; var vmlEl = this._vmlEl; if (!vmlEl) { vmlEl = createNode('shape'); initRootElStyle(vmlEl); this._vmlEl = vmlEl; } updateFillAndStroke(vmlEl, 'fill', style, this); updateFillAndStroke(vmlEl, 'stroke', style, this); var m = this.transform; var needTransform = m != null; var strokeEl = vmlEl.getElementsByTagName('stroke')[0]; if (strokeEl) { var lineWidth = style.lineWidth; // Get the line scale. // Determinant of this.m_ means how much the area is enlarged by the // transformation. So its square root can be used as a scale factor // for width. if (needTransform && !style.strokeNoScale) { var det = m[0] * m[3] - m[1] * m[2]; lineWidth *= sqrt(abs$1(det)); } strokeEl.weight = lineWidth + 'px'; } var path = this.path || (this.path = new PathProxy()); if (this.__dirtyPath) { path.beginPath(); this.buildPath(path, this.shape); path.toStatic(); this.__dirtyPath = false; } vmlEl.path = pathDataToString(path, this.transform); vmlEl.style.zIndex = getZIndex(this.zlevel, this.z, this.z2); // Append to root append(vmlRoot, vmlEl); // Text if (style.text != null) { this.drawRectText(vmlRoot, this.getBoundingRect()); } else { this.removeRectText(vmlRoot); } }; Path.prototype.onRemove = function (vmlRoot) { remove(vmlRoot, this._vmlEl); this.removeRectText(vmlRoot); }; Path.prototype.onAdd = function (vmlRoot) { append(vmlRoot, this._vmlEl); this.appendRectText(vmlRoot); }; /*************************************************** * IMAGE **************************************************/ var isImage = function (img) { // FIXME img instanceof Image 如果 img 是一个字符串的时候,IE8 下会报错 return (typeof img === 'object') && img.tagName && img.tagName.toUpperCase() === 'IMG'; // return img instanceof Image; }; // Rewrite the original path method ZImage.prototype.brushVML = function (vmlRoot) { var style = this.style; var image = style.image; // Image original width, height var ow; var oh; if (isImage(image)) { var src = image.src; if (src === this._imageSrc) { ow = this._imageWidth; oh = this._imageHeight; } else { var imageRuntimeStyle = image.runtimeStyle; var oldRuntimeWidth = imageRuntimeStyle.width; var oldRuntimeHeight = imageRuntimeStyle.height; imageRuntimeStyle.width = 'auto'; imageRuntimeStyle.height = 'auto'; // get the original size ow = image.width; oh = image.height; // and remove overides imageRuntimeStyle.width = oldRuntimeWidth; imageRuntimeStyle.height = oldRuntimeHeight; // Caching image original width, height and src this._imageSrc = src; this._imageWidth = ow; this._imageHeight = oh; } image = src; } else { if (image === this._imageSrc) { ow = this._imageWidth; oh = this._imageHeight; } } if (!image) { return; } var x = style.x || 0; var y = style.y || 0; var dw = style.width; var dh = style.height; var sw = style.sWidth; var sh = style.sHeight; var sx = style.sx || 0; var sy = style.sy || 0; var hasCrop = sw && sh; var vmlEl = this._vmlEl; if (!vmlEl) { // FIXME 使用 group 在 left, top 都不是 0 的时候就无法显示了。 // vmlEl = vmlCore.createNode('group'); vmlEl = doc.createElement('div'); initRootElStyle(vmlEl); this._vmlEl = vmlEl; } var vmlElStyle = vmlEl.style; var hasRotation = false; var m; var scaleX = 1; var scaleY = 1; if (this.transform) { m = this.transform; scaleX = sqrt(m[0] * m[0] + m[1] * m[1]); scaleY = sqrt(m[2] * m[2] + m[3] * m[3]); hasRotation = m[1] || m[2]; } if (hasRotation) { // If filters are necessary (rotation exists), create them // filters are bog-slow, so only create them if abbsolutely necessary // The following check doesn't account for skews (which don't exist // in the canvas spec (yet) anyway. // From excanvas var p0 = [x, y]; var p1 = [x + dw, y]; var p2 = [x, y + dh]; var p3 = [x + dw, y + dh]; applyTransform(p0, p0, m); applyTransform(p1, p1, m); applyTransform(p2, p2, m); applyTransform(p3, p3, m); var maxX = mathMax$8(p0[0], p1[0], p2[0], p3[0]); var maxY = mathMax$8(p0[1], p1[1], p2[1], p3[1]); var transformFilter = []; transformFilter.push('M11=', m[0] / scaleX, comma, 'M12=', m[2] / scaleY, comma, 'M21=', m[1] / scaleX, comma, 'M22=', m[3] / scaleY, comma, 'Dx=', round$3(x * scaleX + m[4]), comma, 'Dy=', round$3(y * scaleY + m[5])); vmlElStyle.padding = '0 ' + round$3(maxX) + 'px ' + round$3(maxY) + 'px 0'; // FIXME DXImageTransform 在 IE11 的兼容模式下不起作用 vmlElStyle.filter = imageTransformPrefix + '.Matrix(' + transformFilter.join('') + ', SizingMethod=clip)'; } else { if (m) { x = x * scaleX + m[4]; y = y * scaleY + m[5]; } vmlElStyle.filter = ''; vmlElStyle.left = round$3(x) + 'px'; vmlElStyle.top = round$3(y) + 'px'; } var imageEl = this._imageEl; var cropEl = this._cropEl; if (!imageEl) { imageEl = doc.createElement('div'); this._imageEl = imageEl; } var imageELStyle = imageEl.style; if (hasCrop) { // Needs know image original width and height if (! (ow && oh)) { var tmpImage = new Image(); var self = this; tmpImage.onload = function () { tmpImage.onload = null; ow = tmpImage.width; oh = tmpImage.height; // Adjust image width and height to fit the ratio destinationSize / sourceSize imageELStyle.width = round$3(scaleX * ow * dw / sw) + 'px'; imageELStyle.height = round$3(scaleY * oh * dh / sh) + 'px'; // Caching image original width, height and src self._imageWidth = ow; self._imageHeight = oh; self._imageSrc = image; }; tmpImage.src = image; } else { imageELStyle.width = round$3(scaleX * ow * dw / sw) + 'px'; imageELStyle.height = round$3(scaleY * oh * dh / sh) + 'px'; } if (! cropEl) { cropEl = doc.createElement('div'); cropEl.style.overflow = 'hidden'; this._cropEl = cropEl; } var cropElStyle = cropEl.style; cropElStyle.width = round$3((dw + sx * dw / sw) * scaleX); cropElStyle.height = round$3((dh + sy * dh / sh) * scaleY); cropElStyle.filter = imageTransformPrefix + '.Matrix(Dx=' + (-sx * dw / sw * scaleX) + ',Dy=' + (-sy * dh / sh * scaleY) + ')'; if (! cropEl.parentNode) { vmlEl.appendChild(cropEl); } if (imageEl.parentNode != cropEl) { cropEl.appendChild(imageEl); } } else { imageELStyle.width = round$3(scaleX * dw) + 'px'; imageELStyle.height = round$3(scaleY * dh) + 'px'; vmlEl.appendChild(imageEl); if (cropEl && cropEl.parentNode) { vmlEl.removeChild(cropEl); this._cropEl = null; } } var filterStr = ''; var alpha = style.opacity; if (alpha < 1) { filterStr += '.Alpha(opacity=' + round$3(alpha * 100) + ') '; } filterStr += imageTransformPrefix + '.AlphaImageLoader(src=' + image + ', SizingMethod=scale)'; imageELStyle.filter = filterStr; vmlEl.style.zIndex = getZIndex(this.zlevel, this.z, this.z2); // Append to root append(vmlRoot, vmlEl); // Text if (style.text != null) { this.drawRectText(vmlRoot, this.getBoundingRect()); } }; ZImage.prototype.onRemove = function (vmlRoot) { remove(vmlRoot, this._vmlEl); this._vmlEl = null; this._cropEl = null; this._imageEl = null; this.removeRectText(vmlRoot); }; ZImage.prototype.onAdd = function (vmlRoot) { append(vmlRoot, this._vmlEl); this.appendRectText(vmlRoot); }; /*************************************************** * TEXT **************************************************/ var DEFAULT_STYLE_NORMAL = 'normal'; var fontStyleCache = {}; var fontStyleCacheCount = 0; var MAX_FONT_CACHE_SIZE = 100; var fontEl = document.createElement('div'); var getFontStyle = function (fontString) { var fontStyle = fontStyleCache[fontString]; if (!fontStyle) { // Clear cache if (fontStyleCacheCount > MAX_FONT_CACHE_SIZE) { fontStyleCacheCount = 0; fontStyleCache = {}; } var style = fontEl.style; var fontFamily; try { style.font = fontString; fontFamily = style.fontFamily.split(',')[0]; } catch (e) { } fontStyle = { style: style.fontStyle || DEFAULT_STYLE_NORMAL, variant: style.fontVariant || DEFAULT_STYLE_NORMAL, weight: style.fontWeight || DEFAULT_STYLE_NORMAL, size: parseFloat(style.fontSize || 12) | 0, family: fontFamily || 'Microsoft YaHei' }; fontStyleCache[fontString] = fontStyle; fontStyleCacheCount++; } return fontStyle; }; var textMeasureEl; // Overwrite measure text method $override$1('measureText', function (text, textFont) { var doc$$1 = doc; if (!textMeasureEl) { textMeasureEl = doc$$1.createElement('div'); textMeasureEl.style.cssText = 'position:absolute;top:-20000px;left:0;' + 'padding:0;margin:0;border:none;white-space:pre;'; doc.body.appendChild(textMeasureEl); } try { textMeasureEl.style.font = textFont; } catch (ex) { // Ignore failures to set to invalid font. } textMeasureEl.innerHTML = ''; // Don't use innerHTML or innerText because they allow markup/whitespace. textMeasureEl.appendChild(doc$$1.createTextNode(text)); return { width: textMeasureEl.offsetWidth }; }); var tmpRect$2 = new BoundingRect(); var drawRectText = function (vmlRoot, rect, textRect, fromTextEl) { var style = this.style; // Optimize, avoid normalize every time. this.__dirty && normalizeTextStyle(style, true); var text = style.text; // Convert to string text != null && (text += ''); if (!text) { return; } // Convert rich text to plain text. Rich text is not supported in // IE8-, but tags in rich text template will be removed. if (style.rich) { var contentBlock = parseRichText(text, style); text = []; for (var i = 0; i < contentBlock.lines.length; i++) { var tokens = contentBlock.lines[i].tokens; var textLine = []; for (var j = 0; j < tokens.length; j++) { textLine.push(tokens[j].text); } text.push(textLine.join('')); } text = text.join('\n'); } var x; var y; var align = style.textAlign; var verticalAlign = style.textVerticalAlign; var fontStyle = getFontStyle(style.font); // FIXME encodeHtmlAttribute ? var font = fontStyle.style + ' ' + fontStyle.variant + ' ' + fontStyle.weight + ' ' + fontStyle.size + 'px "' + fontStyle.family + '"'; textRect = textRect || getBoundingRect(text, font, align, verticalAlign); // Transform rect to view space var m = this.transform; // Ignore transform for text in other element if (m && !fromTextEl) { tmpRect$2.copy(rect); tmpRect$2.applyTransform(m); rect = tmpRect$2; } if (!fromTextEl) { var textPosition = style.textPosition; var distance$$1 = style.textDistance; // Text position represented by coord if (textPosition instanceof Array) { x = rect.x + parsePercent$3(textPosition[0], rect.width); y = rect.y + parsePercent$3(textPosition[1], rect.height); align = align || 'left'; } else { var res = adjustTextPositionOnRect( textPosition, rect, distance$$1 ); x = res.x; y = res.y; // Default align and baseline when has textPosition align = align || res.textAlign; verticalAlign = verticalAlign || res.textVerticalAlign; } } else { x = rect.x; y = rect.y; } x = adjustTextX(x, textRect.width, align); y = adjustTextY(y, textRect.height, verticalAlign); // Force baseline 'middle' y += textRect.height / 2; // var fontSize = fontStyle.size; // 1.75 is an arbitrary number, as there is no info about the text baseline // switch (baseline) { // case 'hanging': // case 'top': // y += fontSize / 1.75; // break; // case 'middle': // break; // default: // // case null: // // case 'alphabetic': // // case 'ideographic': // // case 'bottom': // y -= fontSize / 2.25; // break; // } // switch (align) { // case 'left': // break; // case 'center': // x -= textRect.width / 2; // break; // case 'right': // x -= textRect.width; // break; // case 'end': // align = elementStyle.direction == 'ltr' ? 'right' : 'left'; // break; // case 'start': // align = elementStyle.direction == 'rtl' ? 'right' : 'left'; // break; // default: // align = 'left'; // } var createNode$$1 = createNode; var textVmlEl = this._textVmlEl; var pathEl; var textPathEl; var skewEl; if (!textVmlEl) { textVmlEl = createNode$$1('line'); pathEl = createNode$$1('path'); textPathEl = createNode$$1('textpath'); skewEl = createNode$$1('skew'); // FIXME Why here is not cammel case // Align 'center' seems wrong textPathEl.style['v-text-align'] = 'left'; initRootElStyle(textVmlEl); pathEl.textpathok = true; textPathEl.on = true; textVmlEl.from = '0 0'; textVmlEl.to = '1000 0.05'; append(textVmlEl, skewEl); append(textVmlEl, pathEl); append(textVmlEl, textPathEl); this._textVmlEl = textVmlEl; } else { // 这里是在前面 appendChild 保证顺序的前提下 skewEl = textVmlEl.firstChild; pathEl = skewEl.nextSibling; textPathEl = pathEl.nextSibling; } var coords = [x, y]; var textVmlElStyle = textVmlEl.style; // Ignore transform for text in other element if (m && fromTextEl) { applyTransform(coords, coords, m); skewEl.on = true; skewEl.matrix = m[0].toFixed(3) + comma + m[2].toFixed(3) + comma + m[1].toFixed(3) + comma + m[3].toFixed(3) + ',0,0'; // Text position skewEl.offset = (round$3(coords[0]) || 0) + ',' + (round$3(coords[1]) || 0); // Left top point as origin skewEl.origin = '0 0'; textVmlElStyle.left = '0px'; textVmlElStyle.top = '0px'; } else { skewEl.on = false; textVmlElStyle.left = round$3(x) + 'px'; textVmlElStyle.top = round$3(y) + 'px'; } textPathEl.string = encodeHtmlAttribute(text); // TODO try { textPathEl.style.font = font; } // Error font format catch (e) {} updateFillAndStroke(textVmlEl, 'fill', { fill: style.textFill, opacity: style.opacity }, this); updateFillAndStroke(textVmlEl, 'stroke', { stroke: style.textStroke, opacity: style.opacity, lineDash: style.lineDash }, this); textVmlEl.style.zIndex = getZIndex(this.zlevel, this.z, this.z2); // Attached to root append(vmlRoot, textVmlEl); }; var removeRectText = function (vmlRoot) { remove(vmlRoot, this._textVmlEl); this._textVmlEl = null; }; var appendRectText = function (vmlRoot) { append(vmlRoot, this._textVmlEl); }; var list = [RectText, Displayable, ZImage, Path, Text]; // In case Displayable has been mixed in RectText for (var i$3 = 0; i$3 < list.length; i$3++) { var proto$8 = list[i$3].prototype; proto$8.drawRectText = drawRectText; proto$8.removeRectText = removeRectText; proto$8.appendRectText = appendRectText; } Text.prototype.brushVML = function (vmlRoot) { var style = this.style; if (style.text != null) { this.drawRectText(vmlRoot, { x: style.x || 0, y: style.y || 0, width: 0, height: 0 }, this.getBoundingRect(), true); } else { this.removeRectText(vmlRoot); } }; Text.prototype.onRemove = function (vmlRoot) { this.removeRectText(vmlRoot); }; Text.prototype.onAdd = function (vmlRoot) { this.appendRectText(vmlRoot); }; } /** * VML Painter. * * @module zrender/vml/Painter */ function parseInt10$1(val) { return parseInt(val, 10); } /** * @alias module:zrender/vml/Painter */ function VMLPainter(root, storage) { initVML(); this.root = root; this.storage = storage; var vmlViewport = document.createElement('div'); var vmlRoot = document.createElement('div'); vmlViewport.style.cssText = 'display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;'; vmlRoot.style.cssText = 'position:absolute;left:0;top:0;'; root.appendChild(vmlViewport); this._vmlRoot = vmlRoot; this._vmlViewport = vmlViewport; this.resize(); // Modify storage var oldDelFromStorage = storage.delFromStorage; var oldAddToStorage = storage.addToStorage; storage.delFromStorage = function (el) { oldDelFromStorage.call(storage, el); if (el) { el.onRemove && el.onRemove(vmlRoot); } }; storage.addToStorage = function (el) { // Displayable already has a vml node el.onAdd && el.onAdd(vmlRoot); oldAddToStorage.call(storage, el); }; this._firstPaint = true; } VMLPainter.prototype = { constructor: VMLPainter, getType: function () { return 'vml'; }, /** * @return {HTMLDivElement} */ getViewportRoot: function () { return this._vmlViewport; }, getViewportRootOffset: function () { var viewportRoot = this.getViewportRoot(); if (viewportRoot) { return { offsetLeft: viewportRoot.offsetLeft || 0, offsetTop: viewportRoot.offsetTop || 0 }; } }, /** * 刷新 */ refresh: function () { var list = this.storage.getDisplayList(true, true); this._paintList(list); }, _paintList: function (list) { var vmlRoot = this._vmlRoot; for (var i = 0; i < list.length; i++) { var el = list[i]; if (el.invisible || el.ignore) { if (!el.__alreadyNotVisible) { el.onRemove(vmlRoot); } // Set as already invisible el.__alreadyNotVisible = true; } else { if (el.__alreadyNotVisible) { el.onAdd(vmlRoot); } el.__alreadyNotVisible = false; if (el.__dirty) { el.beforeBrush && el.beforeBrush(); (el.brushVML || el.brush).call(el, vmlRoot); el.afterBrush && el.afterBrush(); } } el.__dirty = false; } if (this._firstPaint) { // Detached from document at first time // to avoid page refreshing too many times // FIXME 如果每次都先 removeChild 可能会导致一些填充和描边的效果改变 this._vmlViewport.appendChild(vmlRoot); this._firstPaint = false; } }, resize: function (width, height) { var width = width == null ? this._getWidth() : width; var height = height == null ? this._getHeight() : height; if (this._width != width || this._height != height) { this._width = width; this._height = height; var vmlViewportStyle = this._vmlViewport.style; vmlViewportStyle.width = width + 'px'; vmlViewportStyle.height = height + 'px'; } }, dispose: function () { this.root.innerHTML = ''; this._vmlRoot = this._vmlViewport = this.storage = null; }, getWidth: function () { return this._width; }, getHeight: function () { return this._height; }, clear: function () { if (this._vmlViewport) { this.root.removeChild(this._vmlViewport); } }, _getWidth: function () { var root = this.root; var stl = root.currentStyle; return ((root.clientWidth || parseInt10$1(stl.width)) - parseInt10$1(stl.paddingLeft) - parseInt10$1(stl.paddingRight)) | 0; }, _getHeight: function () { var root = this.root; var stl = root.currentStyle; return ((root.clientHeight || parseInt10$1(stl.height)) - parseInt10$1(stl.paddingTop) - parseInt10$1(stl.paddingBottom)) | 0; } }; // Not supported methods function createMethodNotSupport(method) { return function () { zrLog('In IE8.0 VML mode painter not support method "' + method + '"'); }; } // Unsupported methods each$1([ 'getLayer', 'insertLayer', 'eachLayer', 'eachBuiltinLayer', 'eachOtherLayer', 'getLayers', 'modLayer', 'delLayer', 'clearLayer', 'toDataURL', 'pathToImage' ], function (name) { VMLPainter.prototype[name] = createMethodNotSupport(name); }); registerPainter('vml', VMLPainter); var svgURI = 'http://www.w3.org/2000/svg'; function createElement(name) { return document.createElementNS(svgURI, name); } // TODO // 1. shadow // 2. Image: sx, sy, sw, sh var CMD$4 = PathProxy.CMD; var arrayJoin = Array.prototype.join; var NONE = 'none'; var mathRound = Math.round; var mathSin$3 = Math.sin; var mathCos$3 = Math.cos; var PI$5 = Math.PI; var PI2$7 = Math.PI * 2; var degree = 180 / PI$5; var EPSILON$4 = 1e-4; function round4(val) { return mathRound(val * 1e4) / 1e4; } function isAroundZero$1(val) { return val < EPSILON$4 && val > -EPSILON$4; } function pathHasFill(style, isText) { var fill = isText ? style.textFill : style.fill; return fill != null && fill !== NONE; } function pathHasStroke(style, isText) { var stroke = isText ? style.textStroke : style.stroke; return stroke != null && stroke !== NONE; } function setTransform(svgEl, m) { if (m) { attr(svgEl, 'transform', 'matrix(' + arrayJoin.call(m, ',') + ')'); } } function attr(el, key, val) { if (!val || val.type !== 'linear' && val.type !== 'radial') { // Don't set attribute for gradient, since it need new dom nodes if (typeof val === 'string' && val.indexOf('NaN') > -1) { console.log(val); } el.setAttribute(key, val); } } function attrXLink(el, key, val) { el.setAttributeNS('http://www.w3.org/1999/xlink', key, val); } function bindStyle(svgEl, style, isText) { if (pathHasFill(style, isText)) { var fill = isText ? style.textFill : style.fill; fill = fill === 'transparent' ? NONE : fill; /** * FIXME: * This is a temporary fix for Chrome's clipping bug * that happens when a clip-path is referring another one. * This fix should be used before Chrome's bug is fixed. * For an element that has clip-path, and fill is none, * set it to be "rgba(0, 0, 0, 0.002)" will hide the element. * Otherwise, it will show black fill color. * 0.002 is used because this won't work for alpha values smaller * than 0.002. * * See * https://bugs.chromium.org/p/chromium/issues/detail?id=659790 * for more information. */ if (svgEl.getAttribute('clip-path') !== 'none' && fill === NONE) { fill = 'rgba(0, 0, 0, 0.002)'; } attr(svgEl, 'fill', fill); attr(svgEl, 'fill-opacity', style.opacity); } else { attr(svgEl, 'fill', NONE); } if (pathHasStroke(style, isText)) { var stroke = isText ? style.textStroke : style.stroke; stroke = stroke === 'transparent' ? NONE : stroke; attr(svgEl, 'stroke', stroke); var strokeWidth = isText ? style.textStrokeWidth : style.lineWidth; var strokeScale = !isText && style.strokeNoScale ? style.host.getLineScale() : 1; attr(svgEl, 'stroke-width', strokeWidth / strokeScale); // stroke then fill for text; fill then stroke for others attr(svgEl, 'paint-order', isText ? 'stroke' : 'fill'); attr(svgEl, 'stroke-opacity', style.opacity); var lineDash = style.lineDash; if (lineDash) { attr(svgEl, 'stroke-dasharray', style.lineDash.join(',')); attr(svgEl, 'stroke-dashoffset', mathRound(style.lineDashOffset || 0)); } else { attr(svgEl, 'stroke-dasharray', ''); } // PENDING style.lineCap && attr(svgEl, 'stroke-linecap', style.lineCap); style.lineJoin && attr(svgEl, 'stroke-linejoin', style.lineJoin); style.miterLimit && attr(svgEl, 'stroke-miterlimit', style.miterLimit); } else { attr(svgEl, 'stroke', NONE); } } /*************************************************** * PATH **************************************************/ function pathDataToString$1(path) { var str = []; var data = path.data; var dataLength = path.len(); for (var i = 0; i < dataLength;) { var cmd = data[i++]; var cmdStr = ''; var nData = 0; switch (cmd) { case CMD$4.M: cmdStr = 'M'; nData = 2; break; case CMD$4.L: cmdStr = 'L'; nData = 2; break; case CMD$4.Q: cmdStr = 'Q'; nData = 4; break; case CMD$4.C: cmdStr = 'C'; nData = 6; break; case CMD$4.A: var cx = data[i++]; var cy = data[i++]; var rx = data[i++]; var ry = data[i++]; var theta = data[i++]; var dTheta = data[i++]; var psi = data[i++]; var clockwise = data[i++]; var dThetaPositive = Math.abs(dTheta); var isCircle = isAroundZero$1(dThetaPositive - PI2$7) && !isAroundZero$1(dThetaPositive); var large = false; if (dThetaPositive >= PI2$7) { large = true; } else if (isAroundZero$1(dThetaPositive)) { large = false; } else { large = (dTheta > -PI$5 && dTheta < 0 || dTheta > PI$5) === !!clockwise; } var x0 = round4(cx + rx * mathCos$3(theta)); var y0 = round4(cy + ry * mathSin$3(theta)); // It will not draw if start point and end point are exactly the same // We need to shift the end point with a small value // FIXME A better way to draw circle ? if (isCircle) { if (clockwise) { dTheta = PI2$7 - 1e-4; } else { dTheta = -PI2$7 + 1e-4; } large = true; if (i === 9) { // Move to (x0, y0) only when CMD.A comes at the // first position of a shape. // For instance, when drawing a ring, CMD.A comes // after CMD.M, so it's unnecessary to move to // (x0, y0). str.push('M', x0, y0); } } var x = round4(cx + rx * mathCos$3(theta + dTheta)); var y = round4(cy + ry * mathSin$3(theta + dTheta)); // FIXME Ellipse str.push('A', round4(rx), round4(ry), mathRound(psi * degree), +large, +clockwise, x, y); break; case CMD$4.Z: cmdStr = 'Z'; break; case CMD$4.R: var x = round4(data[i++]); var y = round4(data[i++]); var w = round4(data[i++]); var h = round4(data[i++]); str.push( 'M', x, y, 'L', x + w, y, 'L', x + w, y + h, 'L', x, y + h, 'L', x, y ); break; } cmdStr && str.push(cmdStr); for (var j = 0; j < nData; j++) { // PENDING With scale str.push(round4(data[i++])); } } return str.join(' '); } var svgPath = {}; svgPath.brush = function (el) { var style = el.style; var svgEl = el.__svgEl; if (!svgEl) { svgEl = createElement('path'); el.__svgEl = svgEl; } if (!el.path) { el.createPathProxy(); } var path = el.path; if (el.__dirtyPath) { path.beginPath(); el.buildPath(path, el.shape); el.__dirtyPath = false; var pathStr = pathDataToString$1(path); if (pathStr.indexOf('NaN') < 0) { // Ignore illegal path, which may happen such in out-of-range // data in Calendar series. attr(svgEl, 'd', pathStr); } } bindStyle(svgEl, style); setTransform(svgEl, el.transform); if (style.text != null) { svgTextDrawRectText(el, el.getBoundingRect()); } }; /*************************************************** * IMAGE **************************************************/ var svgImage = {}; svgImage.brush = function (el) { var style = el.style; var image = style.image; if (image instanceof HTMLImageElement) { var src = image.src; image = src; } if (! image) { return; } var x = style.x || 0; var y = style.y || 0; var dw = style.width; var dh = style.height; var svgEl = el.__svgEl; if (! svgEl) { svgEl = createElement('image'); el.__svgEl = svgEl; } if (image !== el.__imageSrc) { attrXLink(svgEl, 'href', image); // Caching image src el.__imageSrc = image; } attr(svgEl, 'width', dw); attr(svgEl, 'height', dh); attr(svgEl, 'x', x); attr(svgEl, 'y', y); setTransform(svgEl, el.transform); if (style.text != null) { svgTextDrawRectText(el, el.getBoundingRect()); } }; /*************************************************** * TEXT **************************************************/ var svgText = {}; var tmpRect$3 = new BoundingRect(); var svgTextDrawRectText = function (el, rect, textRect) { var style = el.style; el.__dirty && normalizeTextStyle(style, true); var text = style.text; // Convert to string if (text == null) { // Draw no text only when text is set to null, but not '' return; } else { text += ''; } var textSvgEl = el.__textSvgEl; if (! textSvgEl) { textSvgEl = createElement('text'); el.__textSvgEl = textSvgEl; } var x; var y; var textPosition = style.textPosition; var distance = style.textDistance; var align = style.textAlign || 'left'; if (typeof style.fontSize === 'number') { style.fontSize += 'px'; } var font = style.font || [ style.fontStyle || '', style.fontWeight || '', style.fontSize || '', style.fontFamily || '' ].join(' ') || DEFAULT_FONT; var verticalAlign = getVerticalAlignForSvg(style.textVerticalAlign); textRect = getBoundingRect(text, font, align, verticalAlign); var lineHeight = textRect.lineHeight; // Text position represented by coord if (textPosition instanceof Array) { x = rect.x + textPosition[0]; y = rect.y + textPosition[1]; } else { var newPos = adjustTextPositionOnRect( textPosition, rect, distance ); x = newPos.x; y = newPos.y; verticalAlign = getVerticalAlignForSvg(newPos.textVerticalAlign); align = newPos.textAlign; } attr(textSvgEl, 'alignment-baseline', verticalAlign); if (font) { textSvgEl.style.font = font; } var textPadding = style.textPadding; // Make baseline top attr(textSvgEl, 'x', x); attr(textSvgEl, 'y', y); bindStyle(textSvgEl, style, true); if (el instanceof Text || el.style.transformText) { // Transform text with element setTransform(textSvgEl, el.transform); } else { if (el.transform) { tmpRect$3.copy(rect); tmpRect$3.applyTransform(el.transform); rect = tmpRect$3; } else { var pos = el.transformCoordToGlobal(rect.x, rect.y); rect.x = pos[0]; rect.y = pos[1]; } // Text rotation, but no element transform var origin = style.textOrigin; if (origin === 'center') { x = textRect.width / 2 + x; y = textRect.height / 2 + y; } else if (origin) { x = origin[0] + x; y = origin[1] + y; } var rotate$$1 = -style.textRotation || 0; var transform = create$1(); // Apply textRotate to element matrix rotate(transform, el.transform, rotate$$1); setTransform(textSvgEl, transform); } var textLines = text.split('\n'); var nTextLines = textLines.length; var textAnchor = align; // PENDING if (textAnchor === 'left') { textAnchor = 'start'; textPadding && (x += textPadding[3]); } else if (textAnchor === 'right') { textAnchor = 'end'; textPadding && (x -= textPadding[1]); } else if (textAnchor === 'center') { textAnchor = 'middle'; textPadding && (x += (textPadding[3] - textPadding[1]) / 2); } var dy = 0; if (verticalAlign === 'baseline') { dy = -textRect.height + lineHeight; textPadding && (dy -= textPadding[2]); } else if (verticalAlign === 'middle') { dy = (-textRect.height + lineHeight) / 2; textPadding && (y += (textPadding[0] - textPadding[2]) / 2); } else { textPadding && (dy += textPadding[0]); } // Font may affect position of each tspan elements if (el.__text !== text || el.__textFont !== font) { var tspanList = el.__tspanList || []; el.__tspanList = tspanList; for (var i = 0; i < nTextLines; i++) { // Using cached tspan elements var tspan = tspanList[i]; if (! tspan) { tspan = tspanList[i] = createElement('tspan'); textSvgEl.appendChild(tspan); attr(tspan, 'alignment-baseline', verticalAlign); attr(tspan, 'text-anchor', textAnchor); } else { tspan.innerHTML = ''; } attr(tspan, 'x', x); attr(tspan, 'y', y + i * lineHeight + dy); tspan.appendChild(document.createTextNode(textLines[i])); } // Remove unsed tspan elements for (; i < tspanList.length; i++) { textSvgEl.removeChild(tspanList[i]); } tspanList.length = nTextLines; el.__text = text; el.__textFont = font; } else if (el.__tspanList.length) { // Update span x and y var len = el.__tspanList.length; for (var i = 0; i < len; ++i) { var tspan = el.__tspanList[i]; if (tspan) { attr(tspan, 'x', x); attr(tspan, 'y', y + i * lineHeight + dy); } } } }; function getVerticalAlignForSvg(verticalAlign) { if (verticalAlign === 'middle') { return 'middle'; } else if (verticalAlign === 'bottom') { return 'baseline'; } else { return 'hanging'; } } svgText.drawRectText = svgTextDrawRectText; svgText.brush = function (el) { var style = el.style; if (style.text != null) { // 强制设置 textPosition style.textPosition = [0, 0]; svgTextDrawRectText(el, { x: style.x || 0, y: style.y || 0, width: 0, height: 0 }, el.getBoundingRect()); } }; // Myers' Diff Algorithm // Modified from https://github.com/kpdecker/jsdiff/blob/master/src/diff/base.js function Diff() {} Diff.prototype = { diff: function (oldArr, newArr, equals) { if (!equals) { equals = function (a, b) { return a === b; }; } this.equals = equals; var self = this; oldArr = oldArr.slice(); newArr = newArr.slice(); // Allow subclasses to massage the input prior to running var newLen = newArr.length; var oldLen = oldArr.length; var editLength = 1; var maxEditLength = newLen + oldLen; var bestPath = [{ newPos: -1, components: [] }]; // Seed editLength = 0, i.e. the content starts with the same values var oldPos = this.extractCommon(bestPath[0], newArr, oldArr, 0); if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { var indices = []; for (var i = 0; i < newArr.length; i++) { indices.push(i); } // Identity per the equality and tokenizer return [{ indices: indices, count: newArr.length }]; } // Main worker method. checks all permutations of a given edit length for acceptance. function execEditLength() { for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { var basePath; var addPath = bestPath[diagonalPath - 1]; var removePath = bestPath[diagonalPath + 1]; var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; if (addPath) { // No one else is going to attempt to use this value, clear it bestPath[diagonalPath - 1] = undefined; } var canAdd = addPath && addPath.newPos + 1 < newLen; var canRemove = removePath && 0 <= oldPos && oldPos < oldLen; if (!canAdd && !canRemove) { // If this path is a terminal then prune bestPath[diagonalPath] = undefined; continue; } // Select the diagonal that we want to branch from. We select the prior // path whose position in the new string is the farthest from the origin // and does not pass the bounds of the diff graph if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) { basePath = clonePath(removePath); self.pushComponent(basePath.components, undefined, true); } else { basePath = addPath; // No need to clone, we've pulled it from the list basePath.newPos++; self.pushComponent(basePath.components, true, undefined); } oldPos = self.extractCommon(basePath, newArr, oldArr, diagonalPath); // If we have hit the end of both strings, then we are done if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) { return buildValues(self, basePath.components, newArr, oldArr); } else { // Otherwise track this path as a potential candidate and continue. bestPath[diagonalPath] = basePath; } } editLength++; } while (editLength <= maxEditLength) { var ret = execEditLength(); if (ret) { return ret; } } }, pushComponent: function (components, added, removed) { var last = components[components.length - 1]; if (last && last.added === added && last.removed === removed) { // We need to clone here as the component clone operation is just // as shallow array clone components[components.length - 1] = {count: last.count + 1, added: added, removed: removed }; } else { components.push({count: 1, added: added, removed: removed }); } }, extractCommon: function (basePath, newArr, oldArr, diagonalPath) { var newLen = newArr.length; var oldLen = oldArr.length; var newPos = basePath.newPos; var oldPos = newPos - diagonalPath; var commonCount = 0; while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newArr[newPos + 1], oldArr[oldPos + 1])) { newPos++; oldPos++; commonCount++; } if (commonCount) { basePath.components.push({count: commonCount}); } basePath.newPos = newPos; return oldPos; }, tokenize: function (value) { return value.slice(); }, join: function (value) { return value.slice(); } }; function buildValues(diff, components, newArr, oldArr) { var componentPos = 0; var componentLen = components.length; var newPos = 0; var oldPos = 0; for (; componentPos < componentLen; componentPos++) { var component = components[componentPos]; if (!component.removed) { var indices = []; for (var i = newPos; i < newPos + component.count; i++) { indices.push(i); } component.indices = indices; newPos += component.count; // Common case if (!component.added) { oldPos += component.count; } } else { var indices = []; for (var i = oldPos; i < oldPos + component.count; i++) { indices.push(i); } component.indices = indices; oldPos += component.count; } } return components; } function clonePath(path) { return { newPos: path.newPos, components: path.components.slice(0) }; } var arrayDiff = new Diff(); var arrayDiff$1 = function (oldArr, newArr, callback) { return arrayDiff.diff(oldArr, newArr, callback); }; /** * @file Manages elements that can be defined in in SVG, * e.g., gradients, clip path, etc. * @author Zhang Wenli */ var MARK_UNUSED = '0'; var MARK_USED = '1'; /** * Manages elements that can be defined in in SVG, * e.g., gradients, clip path, etc. * * @class * @param {number} zrId zrender instance id * @param {SVGElement} svgRoot root of SVG document * @param {string|string[]} tagNames possible tag names * @param {string} markLabel label name to make if the element * is used */ function Definable( zrId, svgRoot, tagNames, markLabel, domName ) { this._zrId = zrId; this._svgRoot = svgRoot; this._tagNames = typeof tagNames === 'string' ? [tagNames] : tagNames; this._markLabel = markLabel; this._domName = domName || '_dom'; this.nextId = 0; } Definable.prototype.createElement = createElement; /** * Get the tag for svgRoot; optionally creates one if not exists. * * @param {boolean} isForceCreating if need to create when not exists * @return {SVGDefsElement} SVG element, null if it doesn't * exist and isForceCreating is false */ Definable.prototype.getDefs = function (isForceCreating) { var svgRoot = this._svgRoot; var defs = this._svgRoot.getElementsByTagName('defs'); if (defs.length === 0) { // Not exist if (isForceCreating) { defs = svgRoot.insertBefore( this.createElement('defs'), // Create new tag svgRoot.firstChild // Insert in the front of svg ); if (!defs.contains) { // IE doesn't support contains method defs.contains = function (el) { var children = defs.children; if (!children) { return false; } for (var i = children.length - 1; i >= 0; --i) { if (children[i] === el) { return true; } } return false; }; } return defs; } else { return null; } } else { return defs[0]; } }; /** * Update DOM element if necessary. * * @param {Object|string} element style element. e.g., for gradient, * it may be '#ccc' or {type: 'linear', ...} * @param {Function|undefined} onUpdate update callback */ Definable.prototype.update = function (element, onUpdate) { if (!element) { return; } var defs = this.getDefs(false); if (element[this._domName] && defs.contains(element[this._domName])) { // Update DOM if (typeof onUpdate === 'function') { onUpdate(element); } } else { // No previous dom, create new var dom = this.add(element); if (dom) { element[this._domName] = dom; } } }; /** * Add gradient dom to defs * * @param {SVGElement} dom DOM to be added to */ Definable.prototype.addDom = function (dom) { var defs = this.getDefs(true); defs.appendChild(dom); }; /** * Remove DOM of a given element. * * @param {SVGElement} element element to remove dom */ Definable.prototype.removeDom = function (element) { var defs = this.getDefs(false); if (defs && element[this._domName]) { defs.removeChild(element[this._domName]); element[this._domName] = null; } }; /** * Get DOMs of this element. * * @return {HTMLDomElement} doms of this defineable elements in */ Definable.prototype.getDoms = function () { var defs = this.getDefs(false); if (!defs) { // No dom when defs is not defined return []; } var doms = []; each$1(this._tagNames, function (tagName) { var tags = defs.getElementsByTagName(tagName); // Note that tags is HTMLCollection, which is array-like // rather than real array. // So `doms.concat(tags)` add tags as one object. doms = doms.concat([].slice.call(tags)); }); return doms; }; /** * Mark DOMs to be unused before painting, and clear unused ones at the end * of the painting. */ Definable.prototype.markAllUnused = function () { var doms = this.getDoms(); var that = this; each$1(doms, function (dom) { dom[that._markLabel] = MARK_UNUSED; }); }; /** * Mark a single DOM to be used. * * @param {SVGElement} dom DOM to mark */ Definable.prototype.markUsed = function (dom) { if (dom) { dom[this._markLabel] = MARK_USED; } }; /** * Remove unused DOMs defined in */ Definable.prototype.removeUnused = function () { var defs = this.getDefs(false); if (!defs) { // Nothing to remove return; } var doms = this.getDoms(); var that = this; each$1(doms, function (dom) { if (dom[that._markLabel] !== MARK_USED) { // Remove gradient defs.removeChild(dom); } }); }; /** * Get SVG proxy. * * @param {Displayable} displayable displayable element * @return {Path|Image|Text} svg proxy of given element */ Definable.prototype.getSvgProxy = function (displayable) { if (displayable instanceof Path) { return svgPath; } else if (displayable instanceof ZImage) { return svgImage; } else if (displayable instanceof Text) { return svgText; } else { return svgPath; } }; /** * Get text SVG element. * * @param {Displayable} displayable displayable element * @return {SVGElement} SVG element of text */ Definable.prototype.getTextSvgElement = function (displayable) { return displayable.__textSvgEl; }; /** * Get SVG element. * * @param {Displayable} displayable displayable element * @return {SVGElement} SVG element */ Definable.prototype.getSvgElement = function (displayable) { return displayable.__svgEl; }; /** * @file Manages SVG gradient elements. * @author Zhang Wenli */ /** * Manages SVG gradient elements. * * @class * @extends Definable * @param {number} zrId zrender instance id * @param {SVGElement} svgRoot root of SVG document */ function GradientManager(zrId, svgRoot) { Definable.call( this, zrId, svgRoot, ['linearGradient', 'radialGradient'], '__gradient_in_use__' ); } inherits(GradientManager, Definable); /** * Create new gradient DOM for fill or stroke if not exist, * but will not update gradient if exists. * * @param {SvgElement} svgElement SVG element to paint * @param {Displayable} displayable zrender displayable element */ GradientManager.prototype.addWithoutUpdate = function ( svgElement, displayable ) { if (displayable && displayable.style) { var that = this; each$1(['fill', 'stroke'], function (fillOrStroke) { if (displayable.style[fillOrStroke] && (displayable.style[fillOrStroke].type === 'linear' || displayable.style[fillOrStroke].type === 'radial') ) { var gradient = displayable.style[fillOrStroke]; var defs = that.getDefs(true); // Create dom in if not exists var dom; if (gradient._dom) { // Gradient exists dom = gradient._dom; if (!defs.contains(gradient._dom)) { // _dom is no longer in defs, recreate that.addDom(dom); } } else { // New dom dom = that.add(gradient); } that.markUsed(displayable); var id = dom.getAttribute('id'); svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')'); } }); } }; /** * Add a new gradient tag in * * @param {Gradient} gradient zr gradient instance * @return {SVGLinearGradientElement | SVGRadialGradientElement} * created DOM */ GradientManager.prototype.add = function (gradient) { var dom; if (gradient.type === 'linear') { dom = this.createElement('linearGradient'); } else if (gradient.type === 'radial') { dom = this.createElement('radialGradient'); } else { zrLog('Illegal gradient type.'); return null; } // Set dom id with gradient id, since each gradient instance // will have no more than one dom element. // id may exists before for those dirty elements, in which case // id should remain the same, and other attributes should be // updated. gradient.id = gradient.id || this.nextId++; dom.setAttribute('id', 'zr' + this._zrId + '-gradient-' + gradient.id); this.updateDom(gradient, dom); this.addDom(dom); return dom; }; /** * Update gradient. * * @param {Gradient} gradient zr gradient instance */ GradientManager.prototype.update = function (gradient) { var that = this; Definable.prototype.update.call(this, gradient, function () { var type = gradient.type; var tagName = gradient._dom.tagName; if (type === 'linear' && tagName === 'linearGradient' || type === 'radial' && tagName === 'radialGradient' ) { // Gradient type is not changed, update gradient that.updateDom(gradient, gradient._dom); } else { // Remove and re-create if type is changed that.removeDom(gradient); that.add(gradient); } }); }; /** * Update gradient dom * * @param {Gradient} gradient zr gradient instance * @param {SVGLinearGradientElement | SVGRadialGradientElement} dom * DOM to update */ GradientManager.prototype.updateDom = function (gradient, dom) { if (gradient.type === 'linear') { dom.setAttribute('x1', gradient.x); dom.setAttribute('y1', gradient.y); dom.setAttribute('x2', gradient.x2); dom.setAttribute('y2', gradient.y2); } else if (gradient.type === 'radial') { dom.setAttribute('cx', gradient.x); dom.setAttribute('cy', gradient.y); dom.setAttribute('r', gradient.r); } else { zrLog('Illegal gradient type.'); return; } if (gradient.global) { // x1, x2, y1, y2 in range of 0 to canvas width or height dom.setAttribute('gradientUnits', 'userSpaceOnUse'); } else { // x1, x2, y1, y2 in range of 0 to 1 dom.setAttribute('gradientUnits', 'objectBoundingBox'); } // Remove color stops if exists dom.innerHTML = ''; // Add color stops var colors = gradient.colorStops; for (var i = 0, len = colors.length; i < len; ++i) { var stop = this.createElement('stop'); stop.setAttribute('offset', colors[i].offset * 100 + '%'); stop.setAttribute('stop-color', colors[i].color); dom.appendChild(stop); } // Store dom element in gradient, to avoid creating multiple // dom instances for the same gradient element gradient._dom = dom; }; /** * Mark a single gradient to be used * * @param {Displayable} displayable displayable element */ GradientManager.prototype.markUsed = function (displayable) { if (displayable.style) { var gradient = displayable.style.fill; if (gradient && gradient._dom) { Definable.prototype.markUsed.call(this, gradient._dom); } gradient = displayable.style.stroke; if (gradient && gradient._dom) { Definable.prototype.markUsed.call(this, gradient._dom); } } }; /** * @file Manages SVG clipPath elements. * @author Zhang Wenli */ /** * Manages SVG clipPath elements. * * @class * @extends Definable * @param {number} zrId zrender instance id * @param {SVGElement} svgRoot root of SVG document */ function ClippathManager(zrId, svgRoot) { Definable.call(this, zrId, svgRoot, 'clipPath', '__clippath_in_use__'); } inherits(ClippathManager, Definable); /** * Update clipPath. * * @param {Displayable} displayable displayable element */ ClippathManager.prototype.update = function (displayable) { var svgEl = this.getSvgElement(displayable); if (svgEl) { this.updateDom(svgEl, displayable.__clipPaths, false); } var textEl = this.getTextSvgElement(displayable); if (textEl) { // Make another clipPath for text, since it's transform // matrix is not the same with svgElement this.updateDom(textEl, displayable.__clipPaths, true); } this.markUsed(displayable); }; /** * Create an SVGElement of displayable and create a of its * clipPath * * @param {Displayable} parentEl parent element * @param {ClipPath[]} clipPaths clipPaths of parent element * @param {boolean} isText if parent element is Text */ ClippathManager.prototype.updateDom = function ( parentEl, clipPaths, isText ) { if (clipPaths && clipPaths.length > 0) { // Has clipPath, create with the first clipPath var defs = this.getDefs(true); var clipPath = clipPaths[0]; var clipPathEl; var id; var dom = isText ? '_textDom' : '_dom'; if (clipPath[dom]) { // Use a dom that is already in id = clipPath[dom].getAttribute('id'); clipPathEl = clipPath[dom]; // Use a dom that is already in if (!defs.contains(clipPathEl)) { // This happens when set old clipPath that has // been previously removed defs.appendChild(clipPathEl); } } else { // New id = 'zr' + this._zrId + '-clip-' + this.nextId; ++this.nextId; clipPathEl = this.createElement('clipPath'); clipPathEl.setAttribute('id', id); defs.appendChild(clipPathEl); clipPath[dom] = clipPathEl; } // Build path and add to var svgProxy = this.getSvgProxy(clipPath); if (clipPath.transform && clipPath.parent.invTransform && !isText ) { /** * If a clipPath has a parent with transform, the transform * of parent should not be considered when setting transform * of clipPath. So we need to transform back from parent's * transform, which is done by multiplying parent's inverse * transform. */ // Store old transform var transform = Array.prototype.slice.call( clipPath.transform ); // Transform back from parent, and brush path mul$1( clipPath.transform, clipPath.parent.invTransform, clipPath.transform ); svgProxy.brush(clipPath); // Set back transform of clipPath clipPath.transform = transform; } else { svgProxy.brush(clipPath); } var pathEl = this.getSvgElement(clipPath); clipPathEl.innerHTML = ''; /** * Use `cloneNode()` here to appendChild to multiple parents, * which may happend when Text and other shapes are using the same * clipPath. Since Text will create an extra clipPath DOM due to * different transform rules. */ clipPathEl.appendChild(pathEl.cloneNode()); parentEl.setAttribute('clip-path', 'url(#' + id + ')'); if (clipPaths.length > 1) { // Make the other clipPaths recursively this.updateDom(clipPathEl, clipPaths.slice(1), isText); } } else { // No clipPath if (parentEl) { parentEl.setAttribute('clip-path', 'none'); } } }; /** * Mark a single clipPath to be used * * @param {Displayable} displayable displayable element */ ClippathManager.prototype.markUsed = function (displayable) { var that = this; if (displayable.__clipPaths && displayable.__clipPaths.length > 0) { each$1(displayable.__clipPaths, function (clipPath) { if (clipPath._dom) { Definable.prototype.markUsed.call(that, clipPath._dom); } if (clipPath._textDom) { Definable.prototype.markUsed.call(that, clipPath._textDom); } }); } }; /** * @file Manages SVG shadow elements. * @author Zhang Wenli */ /** * Manages SVG shadow elements. * * @class * @extends Definable * @param {number} zrId zrender instance id * @param {SVGElement} svgRoot root of SVG document */ function ShadowManager(zrId, svgRoot) { Definable.call( this, zrId, svgRoot, ['filter'], '__filter_in_use__', '_shadowDom' ); } inherits(ShadowManager, Definable); /** * Create new shadow DOM for fill or stroke if not exist, * but will not update shadow if exists. * * @param {SvgElement} svgElement SVG element to paint * @param {Displayable} displayable zrender displayable element */ ShadowManager.prototype.addWithoutUpdate = function ( svgElement, displayable ) { if (displayable && hasShadow(displayable.style)) { var style = displayable.style; // Create dom in if not exists var dom; if (style._shadowDom) { // Gradient exists dom = style._shadowDom; var defs = this.getDefs(true); if (!defs.contains(style._shadowDom)) { // _shadowDom is no longer in defs, recreate this.addDom(dom); } } else { // New dom dom = this.add(displayable); } this.markUsed(displayable); var id = dom.getAttribute('id'); svgElement.style.filter = 'url(#' + id + ')'; } }; /** * Add a new shadow tag in * * @param {Displayable} displayable zrender displayable element * @return {SVGFilterElement} created DOM */ ShadowManager.prototype.add = function (displayable) { var dom = this.createElement('filter'); var style = displayable.style; // Set dom id with shadow id, since each shadow instance // will have no more than one dom element. // id may exists before for those dirty elements, in which case // id should remain the same, and other attributes should be // updated. style._shadowDomId = style._shadowDomId || this.nextId++; dom.setAttribute('id', 'zr' + this._zrId + '-shadow-' + style._shadowDomId); this.updateDom(displayable, dom); this.addDom(dom); return dom; }; /** * Update shadow. * * @param {Displayable} displayable zrender displayable element */ ShadowManager.prototype.update = function (svgElement, displayable) { var style = displayable.style; if (hasShadow(style)) { var that = this; Definable.prototype.update.call(this, displayable, function (style) { that.updateDom(displayable, style._shadowDom); }); } else { // Remove shadow this.remove(svgElement, style); } }; /** * Remove DOM and clear parent filter */ ShadowManager.prototype.remove = function (svgElement, style) { if (style._shadowDomId != null) { this.removeDom(style); svgElement.style.filter = ''; } }; /** * Update shadow dom * * @param {Displayable} displayable zrender displayable element * @param {SVGFilterElement} dom DOM to update */ ShadowManager.prototype.updateDom = function (displayable, dom) { var domChild = dom.getElementsByTagName('feDropShadow'); if (domChild.length === 0) { domChild = this.createElement('feDropShadow'); } else { domChild = domChild[0]; } var style = displayable.style; var scaleX = displayable.scale ? (displayable.scale[0] || 1) : 1; var scaleY = displayable.scale ? (displayable.scale[1] || 1) : 1; // TODO: textBoxShadowBlur is not supported yet var offsetX, offsetY, blur, color; if (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY) { offsetX = style.shadowOffsetX || 0; offsetY = style.shadowOffsetY || 0; blur = style.shadowBlur; color = style.shadowColor; } else if (style.textShadowBlur) { offsetX = style.textShadowOffsetX || 0; offsetY = style.textShadowOffsetY || 0; blur = style.textShadowBlur; color = style.textShadowColor; } else { // Remove shadow this.removeDom(dom, style); return; } domChild.setAttribute('dx', offsetX / scaleX); domChild.setAttribute('dy', offsetY / scaleY); domChild.setAttribute('flood-color', color); // Divide by two here so that it looks the same as in canvas // See: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-shadowblur var stdDx = blur / 2 / scaleX; var stdDy = blur / 2 / scaleY; var stdDeviation = stdDx + ' ' + stdDy; domChild.setAttribute('stdDeviation', stdDeviation); // Fix filter clipping problem dom.setAttribute('x', '-100%'); dom.setAttribute('y', '-100%'); dom.setAttribute('width', Math.ceil(blur / 2 * 200) + '%'); dom.setAttribute('height', Math.ceil(blur / 2 * 200) + '%'); dom.appendChild(domChild); // Store dom element in shadow, to avoid creating multiple // dom instances for the same shadow element style._shadowDom = dom; }; /** * Mark a single shadow to be used * * @param {Displayable} displayable displayable element */ ShadowManager.prototype.markUsed = function (displayable) { var style = displayable.style; if (style && style._shadowDom) { Definable.prototype.markUsed.call(this, style._shadowDom); } }; function hasShadow(style) { // TODO: textBoxShadowBlur is not supported yet return style && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY || style.textShadowBlur || style.textShadowOffsetX || style.textShadowOffsetY); } /** * SVG Painter * @module zrender/svg/Painter */ function parseInt10$2(val) { return parseInt(val, 10); } function getSvgProxy(el) { if (el instanceof Path) { return svgPath; } else if (el instanceof ZImage) { return svgImage; } else if (el instanceof Text) { return svgText; } else { return svgPath; } } function checkParentAvailable(parent, child) { return child && parent && child.parentNode !== parent; } function insertAfter(parent, child, prevSibling) { if (checkParentAvailable(parent, child) && prevSibling) { var nextSibling = prevSibling.nextSibling; nextSibling ? parent.insertBefore(child, nextSibling) : parent.appendChild(child); } } function prepend(parent, child) { if (checkParentAvailable(parent, child)) { var firstChild = parent.firstChild; firstChild ? parent.insertBefore(child, firstChild) : parent.appendChild(child); } } function remove$1(parent, child) { if (child && parent && child.parentNode === parent) { parent.removeChild(child); } } function getTextSvgElement(displayable) { return displayable.__textSvgEl; } function getSvgElement(displayable) { return displayable.__svgEl; } /** * @alias module:zrender/svg/Painter * @constructor * @param {HTMLElement} root 绘图容器 * @param {module:zrender/Storage} storage * @param {Object} opts */ var SVGPainter = function (root, storage, opts, zrId) { this.root = root; this.storage = storage; this._opts = opts = extend({}, opts || {}); var svgRoot = createElement('svg'); svgRoot.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); svgRoot.setAttribute('version', '1.1'); svgRoot.setAttribute('baseProfile', 'full'); svgRoot.style.cssText = 'user-select:none;position:absolute;left:0;top:0;'; this.gradientManager = new GradientManager(zrId, svgRoot); this.clipPathManager = new ClippathManager(zrId, svgRoot); this.shadowManager = new ShadowManager(zrId, svgRoot); var viewport = document.createElement('div'); viewport.style.cssText = 'overflow:hidden;position:relative'; this._svgRoot = svgRoot; this._viewport = viewport; root.appendChild(viewport); viewport.appendChild(svgRoot); this.resize(opts.width, opts.height); this._visibleList = []; }; SVGPainter.prototype = { constructor: SVGPainter, getType: function () { return 'svg'; }, getViewportRoot: function () { return this._viewport; }, getViewportRootOffset: function () { var viewportRoot = this.getViewportRoot(); if (viewportRoot) { return { offsetLeft: viewportRoot.offsetLeft || 0, offsetTop: viewportRoot.offsetTop || 0 }; } }, refresh: function () { var list = this.storage.getDisplayList(true); this._paintList(list); }, setBackgroundColor: function (backgroundColor) { // TODO gradient this._viewport.style.background = backgroundColor; }, _paintList: function (list) { this.gradientManager.markAllUnused(); this.clipPathManager.markAllUnused(); this.shadowManager.markAllUnused(); var svgRoot = this._svgRoot; var visibleList = this._visibleList; var listLen = list.length; var newVisibleList = []; var i; for (i = 0; i < listLen; i++) { var displayable = list[i]; var svgProxy = getSvgProxy(displayable); var svgElement = getSvgElement(displayable) || getTextSvgElement(displayable); if (!displayable.invisible) { if (displayable.__dirty) { svgProxy && svgProxy.brush(displayable); // Update clipPath this.clipPathManager.update(displayable); // Update gradient and shadow if (displayable.style) { this.gradientManager .update(displayable.style.fill); this.gradientManager .update(displayable.style.stroke); this.shadowManager .update(svgElement, displayable); } displayable.__dirty = false; } newVisibleList.push(displayable); } } var diff = arrayDiff$1(visibleList, newVisibleList); var prevSvgElement; // First do remove, in case element moved to the head and do remove // after add for (i = 0; i < diff.length; i++) { var item = diff[i]; if (item.removed) { for (var k = 0; k < item.count; k++) { var displayable = visibleList[item.indices[k]]; var svgElement = getSvgElement(displayable); var textSvgElement = getTextSvgElement(displayable); remove$1(svgRoot, svgElement); remove$1(svgRoot, textSvgElement); } } } for (i = 0; i < diff.length; i++) { var item = diff[i]; if (item.added) { for (var k = 0; k < item.count; k++) { var displayable = newVisibleList[item.indices[k]]; var svgElement = getSvgElement(displayable); var textSvgElement = getTextSvgElement(displayable); prevSvgElement ? insertAfter(svgRoot, svgElement, prevSvgElement) : prepend(svgRoot, svgElement); if (svgElement) { insertAfter(svgRoot, textSvgElement, svgElement); } else if (prevSvgElement) { insertAfter( svgRoot, textSvgElement, prevSvgElement ); } else { prepend(svgRoot, textSvgElement); } // Insert text insertAfter(svgRoot, textSvgElement, svgElement); prevSvgElement = textSvgElement || svgElement || prevSvgElement; this.gradientManager .addWithoutUpdate(svgElement, displayable); this.shadowManager .addWithoutUpdate(prevSvgElement, displayable); this.clipPathManager.markUsed(displayable); } } else if (!item.removed) { for (var k = 0; k < item.count; k++) { var displayable = newVisibleList[item.indices[k]]; prevSvgElement = svgElement = getTextSvgElement(displayable) || getSvgElement(displayable) || prevSvgElement; this.gradientManager.markUsed(displayable); this.gradientManager .addWithoutUpdate(svgElement, displayable); this.shadowManager.markUsed(displayable); this.shadowManager .addWithoutUpdate(svgElement, displayable); this.clipPathManager.markUsed(displayable); } } } this.gradientManager.removeUnused(); this.clipPathManager.removeUnused(); this.shadowManager.removeUnused(); this._visibleList = newVisibleList; }, _getDefs: function (isForceCreating) { var svgRoot = this._svgRoot; var defs = this._svgRoot.getElementsByTagName('defs'); if (defs.length === 0) { // Not exist if (isForceCreating) { var defs = svgRoot.insertBefore( createElement('defs'), // Create new tag svgRoot.firstChild // Insert in the front of svg ); if (!defs.contains) { // IE doesn't support contains method defs.contains = function (el) { var children = defs.children; if (!children) { return false; } for (var i = children.length - 1; i >= 0; --i) { if (children[i] === el) { return true; } } return false; }; } return defs; } else { return null; } } else { return defs[0]; } }, resize: function (width, height) { var viewport = this._viewport; // FIXME Why ? viewport.style.display = 'none'; // Save input w/h var opts = this._opts; width != null && (opts.width = width); height != null && (opts.height = height); width = this._getSize(0); height = this._getSize(1); viewport.style.display = ''; if (this._width !== width || this._height !== height) { this._width = width; this._height = height; var viewportStyle = viewport.style; viewportStyle.width = width + 'px'; viewportStyle.height = height + 'px'; var svgRoot = this._svgRoot; // Set width by 'svgRoot.width = width' is invalid svgRoot.setAttribute('width', width); svgRoot.setAttribute('height', height); } }, /** * 获取绘图区域宽度 */ getWidth: function () { return this._width; }, /** * 获取绘图区域高度 */ getHeight: function () { return this._height; }, _getSize: function (whIdx) { var opts = this._opts; var wh = ['width', 'height'][whIdx]; var cwh = ['clientWidth', 'clientHeight'][whIdx]; var plt = ['paddingLeft', 'paddingTop'][whIdx]; var prb = ['paddingRight', 'paddingBottom'][whIdx]; if (opts[wh] != null && opts[wh] !== 'auto') { return parseFloat(opts[wh]); } var root = this.root; // IE8 does not support getComputedStyle, but it use VML. var stl = document.defaultView.getComputedStyle(root); return ( (root[cwh] || parseInt10$2(stl[wh]) || parseInt10$2(root.style[wh])) - (parseInt10$2(stl[plt]) || 0) - (parseInt10$2(stl[prb]) || 0) ) | 0; }, dispose: function () { this.root.innerHTML = ''; this._svgRoot = this._viewport = this.storage = null; }, clear: function () { if (this._viewport) { this.root.removeChild(this._viewport); } }, pathToDataUrl: function () { this.refresh(); var html = this._svgRoot.outerHTML; return 'data:image/svg+xml;charset=UTF-8,' + html; } }; // Not supported methods function createMethodNotSupport$1(method) { return function () { zrLog('In SVG mode painter not support method "' + method + '"'); }; } // Unsuppoted methods each$1([ 'getLayer', 'insertLayer', 'eachLayer', 'eachBuiltinLayer', 'eachOtherLayer', 'getLayers', 'modLayer', 'delLayer', 'clearLayer', 'toDataURL', 'pathToImage' ], function (name) { SVGPainter.prototype[name] = createMethodNotSupport$1(name); }); registerPainter('svg', SVGPainter); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ // Import all charts and components exports.version = version; exports.dependencies = dependencies; exports.PRIORITY = PRIORITY; exports.init = init; exports.connect = connect; exports.disConnect = disConnect; exports.disconnect = disconnect; exports.dispose = dispose; exports.getInstanceByDom = getInstanceByDom; exports.getInstanceById = getInstanceById; exports.registerTheme = registerTheme; exports.registerPreprocessor = registerPreprocessor; exports.registerProcessor = registerProcessor; exports.registerPostUpdate = registerPostUpdate; exports.registerAction = registerAction; exports.registerCoordinateSystem = registerCoordinateSystem; exports.getCoordinateSystemDimensions = getCoordinateSystemDimensions; exports.registerLayout = registerLayout; exports.registerVisual = registerVisual; exports.registerLoading = registerLoading; exports.extendComponentModel = extendComponentModel; exports.extendComponentView = extendComponentView; exports.extendSeriesModel = extendSeriesModel; exports.extendChartView = extendChartView; exports.setCanvasCreator = setCanvasCreator; exports.registerMap = registerMap; exports.getMap = getMap; exports.dataTool = dataTool; exports.zrender = zrender; exports.graphic = graphic; exports.number = number; exports.format = format; exports.throttle = throttle; exports.helper = helper; exports.matrix = matrix; exports.vector = vector; exports.color = color; exports.parseGeoJSON = parseGeoJson$1; exports.parseGeoJson = parseGeoJson; exports.util = ecUtil; exports.List = List; exports.Model = Model; exports.Axis = Axis; exports.env = env$1; }))); //# sourceMappingURL=echarts.js.map ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/highcharts/adapters/standalone-framework.js ================================================ ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/highcharts/adapters/standalone-framework.src.js ================================================ ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/highcharts/highcharts-3d.js ================================================ /* Highcharts JS v4.2.7 (2016-09-21) 3D features for Highcharts JS @license: www.highcharts.com/license */ (function(d){typeof module==="object"&&module.exports?module.exports=d:d(Highcharts)})(function(d){function C(c){return c!==void 0&&c!==null}function H(c){var b=0,a,f;for(a=0;ae&&g-e>n/2+1.0E-4?(k=k.concat(u(c,b,a,f,e,e+n/2,d,j)),k=k.concat(u(c,b,a,f,e+n/2,g,d,j))):gn/2+1.0E-4?(k=k.concat(u(c,b, a,f,e,e-n/2,d,j)),k=k.concat(u(c,b,a,f,e-n/2,g,d,j))):(k=g-e,k=["C",c+a*l(e)-a*E*k*q(e)+d,b+f*q(e)+f*E*k*l(e)+j,c+a*l(g)+a*E*k*q(g)+d,b+f*q(g)-f*E*k*l(g)+j,c+a*l(g)+d,b+f*q(g)+j]);return k}function L(c,b){var a=c.plotLeft,f=c.plotWidth+a,e=c.plotTop,g=c.plotHeight+e,d=a+c.plotWidth/2,j=e+c.plotHeight/2,k=Number.MAX_VALUE,h=-Number.MAX_VALUE,m=Number.MAX_VALUE,s=-Number.MAX_VALUE,l,p=1;l=[{x:a,y:e,z:0},{x:a,y:e,z:b}];t([0,1],function(a){l.push({x:f,y:l[a].y,z:l[a].z})});t([0,1,2,3],function(a){l.push({x:l[a].x, y:g,z:l[a].z})});l=r(l,c,!1);t(l,function(a){k=Math.min(k,a.x);h=Math.max(h,a.x);m=Math.min(m,a.y);s=Math.max(s,a.y)});a>k&&(p=Math.min(p,1-Math.abs((a+d)/(k+d))%1));fm&&(p=m<0?Math.min(p,(e+j)/(-m+e+j)):Math.min(p,1-(e+j)/(m+j)%1));g0&&kn&&(a=2*n-a);return a}var a=c.x,f=c.y,e=c.start,d=c.end-1.0E-5,i=c.r,j=c.innerR,k=c.depth,h=c.alpha,m=c.beta,s=l(e),t=q(e),c=l(d),p=q(d),o=i*l(m);i*=l(h); var x=j*l(m),y=j*l(h),j=k*q(m),v=k*q(h),k=["M",a+o*s,f+i*t],k=k.concat(u(a,f,o,i,e,d,0,0)),k=k.concat(["L",a+x*c,f+y*p]),k=k.concat(u(a,f,x,y,d,e,0,0)),k=k.concat(["Z"]),r=m>0?n/2:0,m=h>0?0:n/2,r=e>-r?e:d>-r?-r:e,w=dz&&en-m&&e0?4:-1}).css({stroke:g.color}).add()):(d={x:l+(b.yAxis[0].opposite?0:-e.size),y:n+(b.xAxis[0].opposite?-g.size:0),z:j,width:h+e.size,height:k+g.size,depth:i.size,insidePlotArea:!1},this.backFrame? this.backFrame.animate(d):this.backFrame=a.cuboid(d).attr({fill:i.color,zIndex:-3}).css({stroke:i.color}).add(),b={x:l+(b.yAxis[0].opposite?h:-e.size),y:n+(b.xAxis[0].opposite?-g.size:0),z:0,width:e.size,height:k+g.size,depth:j,insidePlotArea:!1},this.sideFrame?this.sideFrame.animate(b):this.sideFrame=a.cuboid(b).attr({fill:e.color,zIndex:-2}).css({stroke:e.color}).add())}});d.wrap(d.Axis.prototype,"getPlotLinePath",function(c){var b=c.apply(this,[].slice.call(arguments,1));if(!this.chart.is3d())return b; if(b===null)return b;var a=this.chart,d=a.options.chart.options3d,a=this.isZAxis?a.plotWidth:d.depth,d=this.opposite;this.horiz&&(d=!d);b=[this.swapZ({x:b[1],y:b[2],z:d?a:0}),this.swapZ({x:b[1],y:b[2],z:a}),this.swapZ({x:b[4],y:b[5],z:a}),this.swapZ({x:b[4],y:b[5],z:d?0:a})];b=r(b,this.chart,!1);return b=this.chart.renderer.toLinePath(b,!1)});d.wrap(d.Axis.prototype,"getLinePath",function(c){return this.chart.is3d()?[]:c.apply(this,[].slice.call(arguments,1))});d.wrap(d.Axis.prototype,"getPlotBandPath", function(c){if(!this.chart.is3d())return c.apply(this,[].slice.call(arguments,1));var b=arguments,a=b[1],b=this.getPlotLinePath(b[2]);(a=this.getPlotLinePath(a))&&b?a.push("L",b[10],b[11],"L",b[7],b[8],"L",b[4],b[5],"L",b[1],b[2]):a=null;return a});d.wrap(d.Tick.prototype,"getMarkPath",function(c){var b=c.apply(this,[].slice.call(arguments,1));if(!this.axis.chart.is3d())return b;b=[this.axis.swapZ({x:b[1],y:b[2],z:0}),this.axis.swapZ({x:b[4],y:b[5],z:0})];b=r(b,this.axis.chart,!1);return b=["M",b[0].x, b[0].y,"L",b[1].x,b[1].y]});d.wrap(d.Tick.prototype,"getLabelPosition",function(c){var b=c.apply(this,[].slice.call(arguments,1));this.axis.chart.is3d()&&(b=r([this.axis.swapZ({x:b.x,y:b.y,z:0})],this.axis.chart,!1)[0]);return b});d.wrap(d.Axis.prototype,"getTitlePosition",function(c){var b=this.chart.is3d(),a,d;if(b)d=this.axisTitleMargin,this.axisTitleMargin=0;a=c.apply(this,[].slice.call(arguments,1));if(b)a=r([this.swapZ({x:a.x,y:a.y,z:0})],this.chart,!1)[0],a[this.horiz?"y":"x"]+=(this.horiz? 1:-1)*(this.opposite?-1:1)*d,this.axisTitleMargin=d;return a});d.wrap(d.Axis.prototype,"drawCrosshair",function(c){var b=arguments;this.chart.is3d()&&b[2]&&(b[2]={plotX:b[2].plotXold||b[2].plotX,plotY:b[2].plotYold||b[2].plotY});c.apply(this,[].slice.call(b,1))});d.Axis.prototype.swapZ=function(c,b){if(this.isZAxis){var a=b?0:this.chart.plotLeft,d=this.chart;return{x:a+(d.yAxis[0].opposite?c.z:d.xAxis[0].width-c.z),y:c.y,z:c.x-a}}return c};var G=d.ZAxis=function(){this.isZAxis=!0;this.init.apply(this, arguments)};d.extend(G.prototype,d.Axis.prototype);d.extend(G.prototype,{setOptions:function(c){c=d.merge({offset:0,lineWidth:0},c);d.Axis.prototype.setOptions.call(this,c);this.coll="zAxis"},setAxisSize:function(){d.Axis.prototype.setAxisSize.call(this);this.width=this.len=this.chart.options.chart.options3d.depth;this.right=this.chart.chartWidth-this.width-this.left},getSeriesExtremes:function(){var c=this,b=c.chart;c.hasVisibleSeries=!1;c.dataMin=c.dataMax=c.ignoreMinPadding=c.ignoreMaxPadding= null;c.buildStacks&&c.buildStacks();d.each(c.series,function(a){if(a.visible||!b.options.chart.ignoreHiddenSeries)if(c.hasVisibleSeries=!0,a=a.zData,a.length)c.dataMin=Math.min(A(c.dataMin,a[0]),Math.min.apply(null,a)),c.dataMax=Math.max(A(c.dataMax,a[0]),Math.max.apply(null,a))})}});d.wrap(d.Chart.prototype,"getAxes",function(c){var b=this,a=this.options,a=a.zAxis=d.splat(a.zAxis||{});c.call(this);if(b.is3d())this.zAxis=[],d.each(a,function(a,c){a.index=c;a.isX=!0;(new G(b,a)).setScale()})});d.wrap(d.seriesTypes.column.prototype, "translate",function(c){c.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var b=this.chart,a=this.options,f=a.depth||25,e=(a.stacking?a.stack||0:this._i)*(f+(a.groupZPadding||1));a.grouping!==!1&&(e=0);e+=a.groupZPadding||1;d.each(this.data,function(a){if(a.y!==null){var c=a.shapeArgs,d=a.tooltipPos;a.shapeType="cuboid";c.z=e;c.depth=f;c.insidePlotArea=!0;d=r([{x:d[0],y:d[1],z:e}],b,!0)[0];a.tooltipPos=[d.x,d.y]}});this.z=e}});d.wrap(d.seriesTypes.column.prototype,"animate",function(c){if(this.chart.is3d()){var b= arguments[1],a=this.yAxis,f=this,e=this.yAxis.reversed;if(d.svg)b?d.each(f.data,function(b){if(b.y!==null&&(b.height=b.shapeArgs.height,b.shapey=b.shapeArgs.y,b.shapeArgs.height=1,!e))b.shapeArgs.y=b.stackY?b.plotY+a.translate(b.stackY):b.plotY+(b.negative?-b.height:b.height)}):(d.each(f.data,function(a){if(a.y!==null)a.shapeArgs.height=a.height,a.shapeArgs.y=a.shapey,a.graphic&&a.graphic.animate(a.shapeArgs,f.options.animation)}),this.drawDataLabels(),f.animate=null)}else c.apply(this,[].slice.call(arguments, 1))});d.wrap(d.seriesTypes.column.prototype,"init",function(c){c.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var b=this.options,a=b.grouping,d=b.stacking,e=A(this.yAxis.options.reversedStacks,!0),g=0;if(a===void 0||a){a=this.chart.retrieveStacks(d);g=b.stack||0;for(d=0;d=a.min&&g<=a.max:!1,f.push({x:e.plotX,y:e.plotY,z:e.plotZ});b=r(f,b,!0);for(i=0;i{point.x}
          y: {point.y}
          z: {point.z}
          ":"x: {point.x}
          y: {point.y}
          z: {point.z}
          ";return c});if(d.VMLRenderer)d.setOptions({animate:!1}), d.VMLRenderer.prototype.cuboid=d.SVGRenderer.prototype.cuboid,d.VMLRenderer.prototype.cuboidPath=d.SVGRenderer.prototype.cuboidPath,d.VMLRenderer.prototype.toLinePath=d.SVGRenderer.prototype.toLinePath,d.VMLRenderer.prototype.createElement3D=d.SVGRenderer.prototype.createElement3D,d.VMLRenderer.prototype.arc3d=function(c){c=d.SVGRenderer.prototype.arc3d.call(this,c);c.css({zIndex:c.zIndex});return c},d.VMLRenderer.prototype.arc3dPath=d.SVGRenderer.prototype.arc3dPath,d.wrap(d.Axis.prototype,"render", function(c){c.apply(this,[].slice.call(arguments,1));this.sideFrame&&(this.sideFrame.css({zIndex:0}),this.sideFrame.front.attr({fill:this.sideFrame.color}));this.bottomFrame&&(this.bottomFrame.css({zIndex:1}),this.bottomFrame.front.attr({fill:this.bottomFrame.color}));this.backFrame&&(this.backFrame.css({zIndex:0}),this.backFrame.front.attr({fill:this.backFrame.color}))})}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/highcharts/highcharts-3d.src.js ================================================ // ==ClosureCompiler== // @compilation_level SIMPLE_OPTIMIZATIONS /** * @license Highcharts JS v4.2.7 (2016-09-21) * * 3D features for Highcharts JS * * @license: www.highcharts.com/license */ (function (factory) { if (typeof module === 'object' && module.exports) { module.exports = factory; } else { factory(Highcharts); } }(function (Highcharts) { /** Shorthands for often used function */ var animObject = Highcharts.animObject, each = Highcharts.each, extend = Highcharts.extend, inArray = Highcharts.inArray, merge = Highcharts.merge, pick = Highcharts.pick, wrap = Highcharts.wrap; /** * Mathematical Functionility */ var PI = Math.PI, deg2rad = (PI / 180), // degrees to radians sin = Math.sin, cos = Math.cos, round = Math.round; /** * Apply 3-D rotation * Euler Angles (XYZ): cosA = cos(Alfa|Roll), cosB = cos(Beta|Pitch), cosG = cos(Gamma|Yaw) * * Composite rotation: * | cosB * cosG | cosB * sinG | -sinB | * | sinA * sinB * cosG - cosA * sinG | sinA * sinB * sinG + cosA * cosG | sinA * cosB | * | cosA * sinB * cosG + sinA * sinG | cosA * sinB * sinG - sinA * cosG | cosA * cosB | * * Now, Gamma/Yaw is not used (angle=0), so we assume cosG = 1 and sinG = 0, so we get: * | cosB | 0 | - sinB | * | sinA * sinB | cosA | sinA * cosB | * | cosA * sinB | - sinA | cosA * cosB | * * But in browsers, y is reversed, so we get sinA => -sinA. The general result is: * | cosB | 0 | - sinB | | x | | px | * | - sinA * sinB | cosA | - sinA * cosB | x | y | = | py | * | cosA * sinB | sinA | cosA * cosB | | z | | pz | */ function rotate3D(x, y, z, angles) { return { x: angles.cosB * x - angles.sinB * z, y: -angles.sinA * angles.sinB * x + angles.cosA * y - angles.cosB * angles.sinA * z, z: angles.cosA * angles.sinB * x + angles.sinA * y + angles.cosA * angles.cosB * z }; } function perspective3D(coordinate, origin, distance) { var projection = ((distance > 0) && (distance < Number.POSITIVE_INFINITY)) ? distance / (coordinate.z + origin.z + distance) : 1; return { x: coordinate.x * projection, y: coordinate.y * projection }; } /** * Transforms a given array of points according to the angles in chart.options. * Parameters: * - points: the array of points * - chart: the chart * - insidePlotArea: wether to verifiy the points are inside the plotArea * Returns: * - an array of transformed points */ var perspective = Highcharts.perspective = function (points, chart, insidePlotArea) { var options3d = chart.options.chart.options3d, inverted = insidePlotArea ? chart.inverted : false, origin = { x: chart.plotWidth / 2, y: chart.plotHeight / 2, z: options3d.depth / 2, vd: pick(options3d.depth, 1) * pick(options3d.viewDistance, 0) }, scale = chart.scale3d || 1, beta = deg2rad * options3d.beta * (inverted ? -1 : 1), alpha = deg2rad * options3d.alpha * (inverted ? -1 : 1), angles = { cosA: cos(alpha), cosB: cos(-beta), sinA: sin(alpha), sinB: sin(-beta) }; if (!insidePlotArea) { origin.x += chart.plotLeft; origin.y += chart.plotTop; } // Transform each point return Highcharts.map(points, function (point) { var rotated = rotate3D( (inverted ? point.y : point.x) - origin.x, (inverted ? point.x : point.y) - origin.y, (point.z || 0) - origin.z, angles ), coordinate = perspective3D(rotated, origin, origin.vd); // Apply perspective // Apply translation coordinate.x = coordinate.x * scale + origin.x; coordinate.y = coordinate.y * scale + origin.y; coordinate.z = rotated.z * scale + origin.z; return { x: (inverted ? coordinate.y : coordinate.x), y: (inverted ? coordinate.x : coordinate.y), z: coordinate.z }; }); };/*** EXTENSION TO THE SVG-RENDERER TO ENABLE 3D SHAPES ***/ ////// HELPER METHODS ////// var dFactor = (4 * (Math.sqrt(2) - 1) / 3) / (PI / 2); function defined(obj) { return obj !== undefined && obj !== null; } //Shoelace algorithm -- http://en.wikipedia.org/wiki/Shoelace_formula function shapeArea(vertexes) { var area = 0, i, j; for (i = 0; i < vertexes.length; i++) { j = (i + 1) % vertexes.length; area += vertexes[i].x * vertexes[j].y - vertexes[j].x * vertexes[i].y; } return area / 2; } function averageZ(vertexes) { var z = 0, i; for (i = 0; i < vertexes.length; i++) { z += vertexes[i].z; } return vertexes.length ? z / vertexes.length : 0; } /** Method to construct a curved path * Can 'wrap' around more then 180 degrees */ function curveTo(cx, cy, rx, ry, start, end, dx, dy) { var result = []; if ((end > start) && (end - start > PI / 2 + 0.0001)) { result = result.concat(curveTo(cx, cy, rx, ry, start, start + (PI / 2), dx, dy)); result = result.concat(curveTo(cx, cy, rx, ry, start + (PI / 2), end, dx, dy)); } else if ((end < start) && (start - end > PI / 2 + 0.0001)) { result = result.concat(curveTo(cx, cy, rx, ry, start, start - (PI / 2), dx, dy)); result = result.concat(curveTo(cx, cy, rx, ry, start - (PI / 2), end, dx, dy)); } else { var arcAngle = end - start; result = [ 'C', cx + (rx * cos(start)) - ((rx * dFactor * arcAngle) * sin(start)) + dx, cy + (ry * sin(start)) + ((ry * dFactor * arcAngle) * cos(start)) + dy, cx + (rx * cos(end)) + ((rx * dFactor * arcAngle) * sin(end)) + dx, cy + (ry * sin(end)) - ((ry * dFactor * arcAngle) * cos(end)) + dy, cx + (rx * cos(end)) + dx, cy + (ry * sin(end)) + dy ]; } return result; } Highcharts.SVGRenderer.prototype.toLinePath = function (points, closed) { var result = []; // Put "L x y" for each point Highcharts.each(points, function (point) { result.push('L', point.x, point.y); }); if (points.length) { // Set the first element to M result[0] = 'M'; // If it is a closed line, add Z if (closed) { result.push('Z'); } } return result; }; ////// CUBOIDS ////// Highcharts.SVGRenderer.prototype.cuboid = function (shapeArgs) { var result = this.g(), paths = this.cuboidPath(shapeArgs); // create the 3 sides result.front = this.path(paths[0]).attr({ zIndex: paths[3], 'stroke-linejoin': 'round' }).add(result); result.top = this.path(paths[1]).attr({ zIndex: paths[4], 'stroke-linejoin': 'round' }).add(result); result.side = this.path(paths[2]).attr({ zIndex: paths[5], 'stroke-linejoin': 'round' }).add(result); // apply the fill everywhere, the top a bit brighter, the side a bit darker result.fillSetter = function (color) { var c0 = color, c1 = Highcharts.Color(color).brighten(0.1).get(), c2 = Highcharts.Color(color).brighten(-0.1).get(); this.front.attr({ fill: c0 }); this.top.attr({ fill: c1 }); this.side.attr({ fill: c2 }); this.color = color; return this; }; // apply opacaity everywhere result.opacitySetter = function (opacity) { this.front.attr({ opacity: opacity }); this.top.attr({ opacity: opacity }); this.side.attr({ opacity: opacity }); return this; }; result.attr = function (args) { if (args.shapeArgs || defined(args.x)) { var shapeArgs = args.shapeArgs || args; var paths = this.renderer.cuboidPath(shapeArgs); this.front.attr({ d: paths[0], zIndex: paths[3] }); this.top.attr({ d: paths[1], zIndex: paths[4] }); this.side.attr({ d: paths[2], zIndex: paths[5] }); } else { return Highcharts.SVGElement.prototype.attr.call(this, args); // getter returns value } return this; }; result.animate = function (args, duration, complete) { if (defined(args.x) && defined(args.y)) { var paths = this.renderer.cuboidPath(args); this.front.attr({ zIndex: paths[3] }).animate({ d: paths[0] }, duration, complete); this.top.attr({ zIndex: paths[4] }).animate({ d: paths[1] }, duration, complete); this.side.attr({ zIndex: paths[5] }).animate({ d: paths[2] }, duration, complete); this.attr({ zIndex: -paths[6] // #4774 }); } else if (args.opacity) { this.front.animate(args, duration, complete); this.top.animate(args, duration, complete); this.side.animate(args, duration, complete); } else { Highcharts.SVGElement.prototype.animate.call(this, args, duration, complete); } return this; }; // destroy all children result.destroy = function () { this.front.destroy(); this.top.destroy(); this.side.destroy(); return null; }; // Apply the Z index to the cuboid group result.attr({ zIndex: -paths[6] }); return result; }; /** * Generates a cuboid */ Highcharts.SVGRenderer.prototype.cuboidPath = function (shapeArgs) { var x = shapeArgs.x, y = shapeArgs.y, z = shapeArgs.z, h = shapeArgs.height, w = shapeArgs.width, d = shapeArgs.depth, chart = Highcharts.charts[this.chartIndex], map = Highcharts.map; // The 8 corners of the cube var pArr = [ { x: x, y: y, z: z }, { x: x + w, y: y, z: z }, { x: x + w, y: y + h, z: z }, { x: x, y: y + h, z: z }, { x: x, y: y + h, z: z + d }, { x: x + w, y: y + h, z: z + d }, { x: x + w, y: y, z: z + d }, { x: x, y: y, z: z + d } ]; // apply perspective pArr = perspective(pArr, chart, shapeArgs.insidePlotArea); // helper method to decide which side is visible function mapPath(i) { return pArr[i]; } var pickShape = function (path1, path2) { var ret = []; path1 = map(path1, mapPath); path2 = map(path2, mapPath); if (shapeArea(path1) < 0) { ret = path1; } else if (shapeArea(path2) < 0) { ret = path2; } return ret; }; // front or back var front = [3, 2, 1, 0]; var back = [7, 6, 5, 4]; var path1 = pickShape(front, back); // top or bottom var top = [1, 6, 7, 0]; var bottom = [4, 5, 2, 3]; var path2 = pickShape(top, bottom); // side var right = [1, 2, 5, 6]; var left = [0, 7, 4, 3]; var path3 = pickShape(right, left); return [this.toLinePath(path1, true), this.toLinePath(path2, true), this.toLinePath(path3, true), averageZ(path1), averageZ(path2), averageZ(path3), averageZ(map(bottom, mapPath)) * 9e9]; // #4774 }; ////// SECTORS ////// Highcharts.SVGRenderer.prototype.arc3d = function (attribs) { var wrapper = this.g(), renderer = wrapper.renderer, customAttribs = ['x', 'y', 'r', 'innerR', 'start', 'end']; /** * Get custom attributes. Mutate the original object and return an object with only custom attr. */ function suckOutCustom(params) { var hasCA = false, ca = {}; for (var key in params) { if (inArray(key, customAttribs) !== -1) { ca[key] = params[key]; delete params[key]; hasCA = true; } } return hasCA ? ca : false; } attribs = merge(attribs); attribs.alpha *= deg2rad; attribs.beta *= deg2rad; // Create the different sub sections of the shape wrapper.top = renderer.path(); wrapper.side1 = renderer.path(); wrapper.side2 = renderer.path(); wrapper.inn = renderer.path(); wrapper.out = renderer.path(); /** * Add all faces */ wrapper.onAdd = function () { var parent = wrapper.parentGroup; wrapper.top.add(wrapper); wrapper.out.add(parent); wrapper.inn.add(parent); wrapper.side1.add(parent); wrapper.side2.add(parent); }; /** * Compute the transformed paths and set them to the composite shapes */ wrapper.setPaths = function (attribs) { var paths = wrapper.renderer.arc3dPath(attribs), zIndex = paths.zTop * 100; wrapper.attribs = attribs; wrapper.top.attr({ d: paths.top, zIndex: paths.zTop }); wrapper.inn.attr({ d: paths.inn, zIndex: paths.zInn }); wrapper.out.attr({ d: paths.out, zIndex: paths.zOut }); wrapper.side1.attr({ d: paths.side1, zIndex: paths.zSide1 }); wrapper.side2.attr({ d: paths.side2, zIndex: paths.zSide2 }); // show all children wrapper.zIndex = zIndex; wrapper.attr({ zIndex: zIndex }); // Set the radial gradient center the first time if (attribs.center) { wrapper.top.setRadialReference(attribs.center); delete attribs.center; } }; wrapper.setPaths(attribs); // Apply the fill to the top and a darker shade to the sides wrapper.fillSetter = function (value) { var darker = Highcharts.Color(value).brighten(-0.1).get(); this.fill = value; this.side1.attr({ fill: darker }); this.side2.attr({ fill: darker }); this.inn.attr({ fill: darker }); this.out.attr({ fill: darker }); this.top.attr({ fill: value }); return this; }; // Apply the same value to all. These properties cascade down to the children // when set to the composite arc3d. each(['opacity', 'translateX', 'translateY', 'visibility'], function (setter) { wrapper[setter + 'Setter'] = function (value, key) { wrapper[key] = value; each(['out', 'inn', 'side1', 'side2', 'top'], function (el) { wrapper[el].attr(key, value); }); }; }); /** * Override attr to remove shape attributes and use those to set child paths */ wrap(wrapper, 'attr', function (proceed, params, val) { var ca; if (typeof params === 'object') { ca = suckOutCustom(params); if (ca) { extend(wrapper.attribs, ca); wrapper.setPaths(wrapper.attribs); } } return proceed.call(this, params, val); }); /** * Override the animate function by sucking out custom parameters related to the shapes directly, * and update the shapes from the animation step. */ wrap(wrapper, 'animate', function (proceed, params, animation, complete) { var ca, from = this.attribs, to, anim; // Attribute-line properties connected to 3D. These shouldn't have been in the // attribs collection in the first place. delete params.center; delete params.z; delete params.depth; delete params.alpha; delete params.beta; anim = animObject(pick(animation, this.renderer.globalAnimation)); if (anim.duration) { params = merge(params); // Don't mutate the original object ca = suckOutCustom(params); if (ca) { to = ca; anim.step = function (a, fx) { function interpolate(key) { return from[key] + (pick(to[key], from[key]) - from[key]) * fx.pos; } fx.elem.setPaths(merge(from, { x: interpolate('x'), y: interpolate('y'), r: interpolate('r'), innerR: interpolate('innerR'), start: interpolate('start'), end: interpolate('end') })); }; } animation = anim; // Only when duration (#5572) } return proceed.call(this, params, animation, complete); }); // destroy all children wrapper.destroy = function () { this.top.destroy(); this.out.destroy(); this.inn.destroy(); this.side1.destroy(); this.side2.destroy(); Highcharts.SVGElement.prototype.destroy.call(this); }; // hide all children wrapper.hide = function () { this.top.hide(); this.out.hide(); this.inn.hide(); this.side1.hide(); this.side2.hide(); }; wrapper.show = function () { this.top.show(); this.out.show(); this.inn.show(); this.side1.show(); this.side2.show(); }; return wrapper; }; /** * Generate the paths required to draw a 3D arc */ Highcharts.SVGRenderer.prototype.arc3dPath = function (shapeArgs) { var cx = shapeArgs.x, // x coordinate of the center cy = shapeArgs.y, // y coordinate of the center start = shapeArgs.start, // start angle end = shapeArgs.end - 0.00001, // end angle r = shapeArgs.r, // radius ir = shapeArgs.innerR, // inner radius d = shapeArgs.depth, // depth alpha = shapeArgs.alpha, // alpha rotation of the chart beta = shapeArgs.beta; // beta rotation of the chart // Derived Variables var cs = cos(start), // cosinus of the start angle ss = sin(start), // sinus of the start angle ce = cos(end), // cosinus of the end angle se = sin(end), // sinus of the end angle rx = r * cos(beta), // x-radius ry = r * cos(alpha), // y-radius irx = ir * cos(beta), // x-radius (inner) iry = ir * cos(alpha), // y-radius (inner) dx = d * sin(beta), // distance between top and bottom in x dy = d * sin(alpha); // distance between top and bottom in y // TOP var top = ['M', cx + (rx * cs), cy + (ry * ss)]; top = top.concat(curveTo(cx, cy, rx, ry, start, end, 0, 0)); top = top.concat([ 'L', cx + (irx * ce), cy + (iry * se) ]); top = top.concat(curveTo(cx, cy, irx, iry, end, start, 0, 0)); top = top.concat(['Z']); // OUTSIDE var b = (beta > 0 ? PI / 2 : 0), a = (alpha > 0 ? 0 : PI / 2); var start2 = start > -b ? start : (end > -b ? -b : start), end2 = end < PI - a ? end : (start < PI - a ? PI - a : end), midEnd = 2 * PI - a; // When slice goes over bottom middle, need to add both, left and right outer side. // Additionally, when we cross right hand edge, create sharp edge. Outer shape/wall: // // ------- // / ^ \ // 4) / / \ \ 1) // / / \ \ // / / \ \ // (c)=> ==== ==== <=(d) // \ \ / / // \ \<=(a)/ / // \ \ / / <=(b) // 3) \ v / 2) // ------- // // (a) - inner side // (b) - outer side // (c) - left edge (sharp) // (d) - right edge (sharp) // 1..n - rendering order for startAngle = 0, when set to e.g 90, order changes clockwise (1->2, 2->3, n->1) and counterclockwise for negative startAngle var out = ['M', cx + (rx * cos(start2)), cy + (ry * sin(start2))]; out = out.concat(curveTo(cx, cy, rx, ry, start2, end2, 0, 0)); if (end > midEnd && start < midEnd) { // When shape is wide, it can cross both, (c) and (d) edges, when using startAngle // Go to outer side out = out.concat([ 'L', cx + (rx * cos(end2)) + dx, cy + (ry * sin(end2)) + dy ]); // Curve to the right edge of the slice (d) out = out.concat(curveTo(cx, cy, rx, ry, end2, midEnd, dx, dy)); // Go to the inner side out = out.concat([ 'L', cx + (rx * cos(midEnd)), cy + (ry * sin(midEnd)) ]); // Curve to the true end of the slice out = out.concat(curveTo(cx, cy, rx, ry, midEnd, end, 0, 0)); // Go to the outer side out = out.concat([ 'L', cx + (rx * cos(end)) + dx, cy + (ry * sin(end)) + dy ]); // Go back to middle (d) out = out.concat(curveTo(cx, cy, rx, ry, end, midEnd, dx, dy)); out = out.concat([ 'L', cx + (rx * cos(midEnd)), cy + (ry * sin(midEnd)) ]); // Go back to the left edge out = out.concat(curveTo(cx, cy, rx, ry, midEnd, end2, 0, 0)); } else if (end > PI - a && start < PI - a) { // But shape can cross also only (c) edge: // Go to outer side out = out.concat([ 'L', cx + (rx * cos(end2)) + dx, cy + (ry * sin(end2)) + dy ]); // Curve to the true end of the slice out = out.concat(curveTo(cx, cy, rx, ry, end2, end, dx, dy)); // Go to the inner side out = out.concat([ 'L', cx + (rx * cos(end)), cy + (ry * sin(end)) ]); // Go back to the artifical end2 out = out.concat(curveTo(cx, cy, rx, ry, end, end2, 0, 0)); } out = out.concat([ 'L', cx + (rx * cos(end2)) + dx, cy + (ry * sin(end2)) + dy ]); out = out.concat(curveTo(cx, cy, rx, ry, end2, start2, dx, dy)); out = out.concat(['Z']); // INSIDE var inn = ['M', cx + (irx * cs), cy + (iry * ss)]; inn = inn.concat(curveTo(cx, cy, irx, iry, start, end, 0, 0)); inn = inn.concat([ 'L', cx + (irx * cos(end)) + dx, cy + (iry * sin(end)) + dy ]); inn = inn.concat(curveTo(cx, cy, irx, iry, end, start, dx, dy)); inn = inn.concat(['Z']); // SIDES var side1 = [ 'M', cx + (rx * cs), cy + (ry * ss), 'L', cx + (rx * cs) + dx, cy + (ry * ss) + dy, 'L', cx + (irx * cs) + dx, cy + (iry * ss) + dy, 'L', cx + (irx * cs), cy + (iry * ss), 'Z' ]; var side2 = [ 'M', cx + (rx * ce), cy + (ry * se), 'L', cx + (rx * ce) + dx, cy + (ry * se) + dy, 'L', cx + (irx * ce) + dx, cy + (iry * se) + dy, 'L', cx + (irx * ce), cy + (iry * se), 'Z' ]; // correction for changed position of vanishing point caused by alpha and beta rotations var angleCorr = Math.atan2(dy, -dx), angleEnd = Math.abs(end + angleCorr), angleStart = Math.abs(start + angleCorr), angleMid = Math.abs((start + end) / 2 + angleCorr); // set to 0-PI range function toZeroPIRange(angle) { angle = angle % (2 * PI); if (angle > PI) { angle = 2 * PI - angle; } return angle; } angleEnd = toZeroPIRange(angleEnd); angleStart = toZeroPIRange(angleStart); angleMid = toZeroPIRange(angleMid); // *1e5 is to compensate pInt in zIndexSetter var incPrecision = 1e5, a1 = angleMid * incPrecision, a2 = angleStart * incPrecision, a3 = angleEnd * incPrecision; return { top: top, zTop: PI * incPrecision + 1, // max angle is PI, so this is allways higher out: out, zOut: Math.max(a1, a2, a3), inn: inn, zInn: Math.max(a1, a2, a3), side1: side1, zSide1: a3 * 0.99, // to keep below zOut and zInn in case of same values side2: side2, zSide2: a2 * 0.99 }; }; /*** EXTENSION FOR 3D CHARTS ***/ // Shorthand to check the is3d flag Highcharts.Chart.prototype.is3d = function () { return this.options.chart.options3d && this.options.chart.options3d.enabled; // #4280 }; /** * Calculate scale of the 3D view. That is required to * fit chart's 3D projection into the actual plotting area. Reported as #4933. * @notice This function should ideally take the plot values instead of a chart object, * but since the chart object is needed for perspective it is not practical. * Possible to make both getScale and perspective more logical and also immutable. * @param {Object} chart Chart object * @param {Number} chart.plotLeft * @param {Number} chart.plotWidth * @param {Number} chart.plotTop * @param {Number} chart.plotHeight * @param {Number} depth The depth of the chart * @return {Number} The scale to fit the 3D chart into the plotting area. */ function getScale(chart, depth) { var plotLeft = chart.plotLeft, plotRight = chart.plotWidth + plotLeft, plotTop = chart.plotTop, plotBottom = chart.plotHeight + plotTop, originX = plotLeft + chart.plotWidth / 2, originY = plotTop + chart.plotHeight / 2, bbox3d = { minX: Number.MAX_VALUE, maxX: -Number.MAX_VALUE, minY: Number.MAX_VALUE, maxY: -Number.MAX_VALUE }, corners, scale = 1; // Top left corners: corners = [{ x: plotLeft, y: plotTop, z: 0 }, { x: plotLeft, y: plotTop, z: depth }]; // Top right corners: each([0, 1], function (i) { corners.push({ x: plotRight, y: corners[i].y, z: corners[i].z }); }); // All bottom corners: each([0, 1, 2, 3], function (i) { corners.push({ x: corners[i].x, y: plotBottom, z: corners[i].z }); }); // Calculate 3D corners: corners = perspective(corners, chart, false); // Get bounding box of 3D element: each(corners, function (corner) { bbox3d.minX = Math.min(bbox3d.minX, corner.x); bbox3d.maxX = Math.max(bbox3d.maxX, corner.x); bbox3d.minY = Math.min(bbox3d.minY, corner.y); bbox3d.maxY = Math.max(bbox3d.maxY, corner.y); }); // Left edge: if (plotLeft > bbox3d.minX) { scale = Math.min(scale, 1 - Math.abs((plotLeft + originX) / (bbox3d.minX + originX)) % 1); } // Right edge: if (plotRight < bbox3d.maxX) { scale = Math.min(scale, (plotRight - originX) / (bbox3d.maxX - originX)); } // Top edge: if (plotTop > bbox3d.minY) { if (bbox3d.minY < 0) { scale = Math.min(scale, (plotTop + originY) / (-bbox3d.minY + plotTop + originY)); } else { scale = Math.min(scale, 1 - (plotTop + originY) / (bbox3d.minY + originY) % 1); } } // Bottom edge: if (plotBottom < bbox3d.maxY) { scale = Math.min(scale, Math.abs((plotBottom - originY) / (bbox3d.maxY - originY))); } return scale; } Highcharts.wrap(Highcharts.Chart.prototype, 'isInsidePlot', function (proceed) { return this.is3d() || proceed.apply(this, [].slice.call(arguments, 1)); }); var defaultChartOptions = Highcharts.getOptions(); defaultChartOptions.chart.options3d = { enabled: false, alpha: 0, beta: 0, depth: 100, fitToPlot: true, viewDistance: 25, frame: { bottom: { size: 1, color: 'rgba(255,255,255,0)' }, side: { size: 1, color: 'rgba(255,255,255,0)' }, back: { size: 1, color: 'rgba(255,255,255,0)' } } }; Highcharts.wrap(Highcharts.Chart.prototype, 'init', function (proceed) { var args = [].slice.call(arguments, 1), plotOptions, pieOptions; if (args[0].chart && args[0].chart.options3d && args[0].chart.options3d.enabled) { // Normalize alpha and beta to (-360, 360) range args[0].chart.options3d.alpha = (args[0].chart.options3d.alpha || 0) % 360; args[0].chart.options3d.beta = (args[0].chart.options3d.beta || 0) % 360; plotOptions = args[0].plotOptions || {}; pieOptions = plotOptions.pie || {}; pieOptions.borderColor = Highcharts.pick(pieOptions.borderColor, undefined); } proceed.apply(this, args); }); Highcharts.wrap(Highcharts.Chart.prototype, 'setChartSize', function (proceed) { var chart = this, options3d = chart.options.chart.options3d; proceed.apply(chart, [].slice.call(arguments, 1)); if (chart.is3d()) { var inverted = chart.inverted, clipBox = chart.clipBox, margin = chart.margin, x = inverted ? 'y' : 'x', y = inverted ? 'x' : 'y', w = inverted ? 'height' : 'width', h = inverted ? 'width' : 'height'; clipBox[x] = -(margin[3] || 0); clipBox[y] = -(margin[0] || 0); clipBox[w] = chart.chartWidth + (margin[3] || 0) + (margin[1] || 0); clipBox[h] = chart.chartHeight + (margin[0] || 0) + (margin[2] || 0); // Set scale, used later in perspective method(): chart.scale3d = 1; // @notice getScale uses perspective, so scale3d has to be reset. if (options3d.fitToPlot === true) { chart.scale3d = getScale(chart, options3d.depth); } } }); Highcharts.wrap(Highcharts.Chart.prototype, 'redraw', function (proceed) { if (this.is3d()) { // Set to force a redraw of all elements this.isDirtyBox = true; } proceed.apply(this, [].slice.call(arguments, 1)); }); // Draw the series in the reverse order (#3803, #3917) Highcharts.wrap(Highcharts.Chart.prototype, 'renderSeries', function (proceed) { var series, i = this.series.length; if (this.is3d()) { while (i--) { series = this.series[i]; series.translate(); series.render(); } } else { proceed.call(this); } }); Highcharts.Chart.prototype.retrieveStacks = function (stacking) { var series = this.series, stacks = {}, stackNumber, i = 1; Highcharts.each(this.series, function (s) { stackNumber = pick(s.options.stack, (stacking ? 0 : series.length - 1 - s.index)); // #3841, #4532 if (!stacks[stackNumber]) { stacks[stackNumber] = { series: [s], position: i }; i++; } else { stacks[stackNumber].series.push(s); } }); stacks.totalStacks = i + 1; return stacks; }; /*** EXTENSION TO THE AXIS ***/ Highcharts.wrap(Highcharts.Axis.prototype, 'setOptions', function (proceed, userOptions) { var options; proceed.call(this, userOptions); if (this.chart.is3d()) { options = this.options; options.tickWidth = Highcharts.pick(options.tickWidth, 0); options.gridLineWidth = Highcharts.pick(options.gridLineWidth, 1); } }); Highcharts.wrap(Highcharts.Axis.prototype, 'render', function (proceed) { proceed.apply(this, [].slice.call(arguments, 1)); // Do not do this if the chart is not 3D if (!this.chart.is3d()) { return; } var chart = this.chart, renderer = chart.renderer, options3d = chart.options.chart.options3d, frame = options3d.frame, fbottom = frame.bottom, fback = frame.back, fside = frame.side, depth = options3d.depth, height = this.height, width = this.width, left = this.left, top = this.top; if (this.isZAxis) { return; } if (this.horiz) { var bottomShape = { x: left, y: top + (chart.xAxis[0].opposite ? -fbottom.size : height), z: 0, width: width, height: fbottom.size, depth: depth, insidePlotArea: false }; if (!this.bottomFrame) { this.bottomFrame = renderer.cuboid(bottomShape).attr({ fill: fbottom.color, zIndex: (chart.yAxis[0].reversed && options3d.alpha > 0 ? 4 : -1) }) .css({ stroke: fbottom.color }).add(); } else { this.bottomFrame.animate(bottomShape); } } else { // BACK var backShape = { x: left + (chart.yAxis[0].opposite ? 0 : -fside.size), y: top + (chart.xAxis[0].opposite ? -fbottom.size : 0), z: depth, width: width + fside.size, height: height + fbottom.size, depth: fback.size, insidePlotArea: false }; if (!this.backFrame) { this.backFrame = renderer.cuboid(backShape).attr({ fill: fback.color, zIndex: -3 }).css({ stroke: fback.color }).add(); } else { this.backFrame.animate(backShape); } var sideShape = { x: left + (chart.yAxis[0].opposite ? width : -fside.size), y: top + (chart.xAxis[0].opposite ? -fbottom.size : 0), z: 0, width: fside.size, height: height + fbottom.size, depth: depth, insidePlotArea: false }; if (!this.sideFrame) { this.sideFrame = renderer.cuboid(sideShape).attr({ fill: fside.color, zIndex: -2 }).css({ stroke: fside.color }).add(); } else { this.sideFrame.animate(sideShape); } } }); Highcharts.wrap(Highcharts.Axis.prototype, 'getPlotLinePath', function (proceed) { var path = proceed.apply(this, [].slice.call(arguments, 1)); // Do not do this if the chart is not 3D if (!this.chart.is3d()) { return path; } if (path === null) { return path; } var chart = this.chart, options3d = chart.options.chart.options3d, d = this.isZAxis ? chart.plotWidth : options3d.depth, opposite = this.opposite; if (this.horiz) { opposite = !opposite; } var pArr = [ this.swapZ({ x: path[1], y: path[2], z: (opposite ? d : 0) }), this.swapZ({ x: path[1], y: path[2], z: d }), this.swapZ({ x: path[4], y: path[5], z: d }), this.swapZ({ x: path[4], y: path[5], z: (opposite ? 0 : d) }) ]; pArr = perspective(pArr, this.chart, false); path = this.chart.renderer.toLinePath(pArr, false); return path; }); // Do not draw axislines in 3D Highcharts.wrap(Highcharts.Axis.prototype, 'getLinePath', function (proceed) { return this.chart.is3d() ? [] : proceed.apply(this, [].slice.call(arguments, 1)); }); Highcharts.wrap(Highcharts.Axis.prototype, 'getPlotBandPath', function (proceed) { // Do not do this if the chart is not 3D if (!this.chart.is3d()) { return proceed.apply(this, [].slice.call(arguments, 1)); } var args = arguments, from = args[1], to = args[2], toPath = this.getPlotLinePath(to), path = this.getPlotLinePath(from); if (path && toPath) { path.push( 'L', toPath[10], // These two do not exist in the regular getPlotLine toPath[11], // ---- # 3005 'L', toPath[7], toPath[8], 'L', toPath[4], toPath[5], 'L', toPath[1], toPath[2] ); } else { // outside the axis area path = null; } return path; }); /*** EXTENSION TO THE TICKS ***/ Highcharts.wrap(Highcharts.Tick.prototype, 'getMarkPath', function (proceed) { var path = proceed.apply(this, [].slice.call(arguments, 1)); // Do not do this if the chart is not 3D if (!this.axis.chart.is3d()) { return path; } var pArr = [ this.axis.swapZ({ x: path[1], y: path[2], z: 0 }), this.axis.swapZ({ x: path[4], y: path[5], z: 0 }) ]; pArr = perspective(pArr, this.axis.chart, false); path = [ 'M', pArr[0].x, pArr[0].y, 'L', pArr[1].x, pArr[1].y ]; return path; }); Highcharts.wrap(Highcharts.Tick.prototype, 'getLabelPosition', function (proceed) { var pos = proceed.apply(this, [].slice.call(arguments, 1)); // Do not do this if the chart is not 3D if (this.axis.chart.is3d()) { pos = perspective([this.axis.swapZ({ x: pos.x, y: pos.y, z: 0 })], this.axis.chart, false)[0]; } return pos; }); Highcharts.wrap(Highcharts.Axis.prototype, 'getTitlePosition', function (proceed) { var is3d = this.chart.is3d(), pos, axisTitleMargin; // Pull out the axis title margin, that is not subject to the perspective if (is3d) { axisTitleMargin = this.axisTitleMargin; this.axisTitleMargin = 0; } pos = proceed.apply(this, [].slice.call(arguments, 1)); if (is3d) { pos = perspective([this.swapZ({ x: pos.x, y: pos.y, z: 0 })], this.chart, false)[0]; // Re-apply the axis title margin outside the perspective pos[this.horiz ? 'y' : 'x'] += (this.horiz ? 1 : -1) * // horizontal axis reverses the margin ... (this.opposite ? -1 : 1) * // ... so does opposite axes axisTitleMargin; this.axisTitleMargin = axisTitleMargin; } return pos; }); Highcharts.wrap(Highcharts.Axis.prototype, 'drawCrosshair', function (proceed) { var args = arguments; if (this.chart.is3d()) { if (args[2]) { args[2] = { plotX: args[2].plotXold || args[2].plotX, plotY: args[2].plotYold || args[2].plotY }; } } proceed.apply(this, [].slice.call(args, 1)); }); /*** Z-AXIS ***/ Highcharts.Axis.prototype.swapZ = function (p, insidePlotArea) { if (this.isZAxis) { var plotLeft = insidePlotArea ? 0 : this.chart.plotLeft; var chart = this.chart; return { x: plotLeft + (chart.yAxis[0].opposite ? p.z : chart.xAxis[0].width - p.z), y: p.y, z: p.x - plotLeft }; } return p; }; var ZAxis = Highcharts.ZAxis = function () { this.isZAxis = true; this.init.apply(this, arguments); }; Highcharts.extend(ZAxis.prototype, Highcharts.Axis.prototype); Highcharts.extend(ZAxis.prototype, { setOptions: function (userOptions) { userOptions = Highcharts.merge({ offset: 0, lineWidth: 0 }, userOptions); Highcharts.Axis.prototype.setOptions.call(this, userOptions); this.coll = 'zAxis'; }, setAxisSize: function () { Highcharts.Axis.prototype.setAxisSize.call(this); this.width = this.len = this.chart.options.chart.options3d.depth; this.right = this.chart.chartWidth - this.width - this.left; }, getSeriesExtremes: function () { var axis = this, chart = axis.chart; axis.hasVisibleSeries = false; // Reset properties in case we're redrawing (#3353) axis.dataMin = axis.dataMax = axis.ignoreMinPadding = axis.ignoreMaxPadding = null; if (axis.buildStacks) { axis.buildStacks(); } // loop through this axis' series Highcharts.each(axis.series, function (series) { if (series.visible || !chart.options.chart.ignoreHiddenSeries) { var seriesOptions = series.options, zData, threshold = seriesOptions.threshold; axis.hasVisibleSeries = true; // Validate threshold in logarithmic axes if (axis.isLog && threshold <= 0) { threshold = null; } zData = series.zData; if (zData.length) { axis.dataMin = Math.min(pick(axis.dataMin, zData[0]), Math.min.apply(null, zData)); axis.dataMax = Math.max(pick(axis.dataMax, zData[0]), Math.max.apply(null, zData)); } } }); } }); /** * Extend the chart getAxes method to also get the color axis */ Highcharts.wrap(Highcharts.Chart.prototype, 'getAxes', function (proceed) { var chart = this, options = this.options, zAxisOptions = options.zAxis = Highcharts.splat(options.zAxis || {}); proceed.call(this); if (!chart.is3d()) { return; } this.zAxis = []; Highcharts.each(zAxisOptions, function (axisOptions, i) { axisOptions.index = i; axisOptions.isX = true; //Z-Axis is shown horizontally, so it's kind of a X-Axis var zAxis = new ZAxis(chart, axisOptions); zAxis.setScale(); }); }); /*** EXTENSION FOR 3D COLUMNS ***/ Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'translate', function (proceed) { proceed.apply(this, [].slice.call(arguments, 1)); // Do not do this if the chart is not 3D if (!this.chart.is3d()) { return; } var series = this, chart = series.chart, seriesOptions = series.options, depth = seriesOptions.depth || 25; var stack = seriesOptions.stacking ? (seriesOptions.stack || 0) : series._i; var z = stack * (depth + (seriesOptions.groupZPadding || 1)); if (seriesOptions.grouping !== false) { z = 0; } z += (seriesOptions.groupZPadding || 1); Highcharts.each(series.data, function (point) { if (point.y !== null) { var shapeArgs = point.shapeArgs, tooltipPos = point.tooltipPos; point.shapeType = 'cuboid'; shapeArgs.z = z; shapeArgs.depth = depth; shapeArgs.insidePlotArea = true; // Translate the tooltip position in 3d space tooltipPos = perspective([{ x: tooltipPos[0], y: tooltipPos[1], z: z }], chart, true)[0]; point.tooltipPos = [tooltipPos.x, tooltipPos.y]; } }); // store for later use #4067 series.z = z; }); Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'animate', function (proceed) { if (!this.chart.is3d()) { proceed.apply(this, [].slice.call(arguments, 1)); } else { var args = arguments, init = args[1], yAxis = this.yAxis, series = this, reversed = this.yAxis.reversed; if (Highcharts.svg) { // VML is too slow anyway if (init) { Highcharts.each(series.data, function (point) { if (point.y !== null) { point.height = point.shapeArgs.height; point.shapey = point.shapeArgs.y; //#2968 point.shapeArgs.height = 1; if (!reversed) { if (point.stackY) { point.shapeArgs.y = point.plotY + yAxis.translate(point.stackY); } else { point.shapeArgs.y = point.plotY + (point.negative ? -point.height : point.height); } } } }); } else { // run the animation Highcharts.each(series.data, function (point) { if (point.y !== null) { point.shapeArgs.height = point.height; point.shapeArgs.y = point.shapey; //#2968 // null value do not have a graphic if (point.graphic) { point.graphic.animate(point.shapeArgs, series.options.animation); } } }); // redraw datalabels to the correct position this.drawDataLabels(); // delete this function to allow it only once series.animate = null; } } } }); Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'init', function (proceed) { proceed.apply(this, [].slice.call(arguments, 1)); if (this.chart.is3d()) { var seriesOptions = this.options, grouping = seriesOptions.grouping, stacking = seriesOptions.stacking, reversedStacks = pick(this.yAxis.options.reversedStacks, true), z = 0; if (!(grouping !== undefined && !grouping)) { var stacks = this.chart.retrieveStacks(stacking), stack = seriesOptions.stack || 0, i; // position within the stack for (i = 0; i < stacks[stack].series.length; i++) { if (stacks[stack].series[i] === this) { break; } } z = (10 * (stacks.totalStacks - stacks[stack].position)) + (reversedStacks ? i : -i); // #4369 // In case when axis is reversed, columns are also reversed inside the group (#3737) if (!this.xAxis.reversed) { z = (stacks.totalStacks * 10) - z; } } seriesOptions.zIndex = z; } }); function draw3DPoints(proceed) { // Do not do this if the chart is not 3D if (this.chart.is3d()) { var grouping = this.chart.options.plotOptions.column.grouping; if (grouping !== undefined && !grouping && this.group.zIndex !== undefined && !this.zIndexSet) { this.group.attr({ zIndex: this.group.zIndex * 10 }); this.zIndexSet = true; // #4062 set zindex only once } var options = this.options, states = this.options.states; this.borderWidth = options.borderWidth = defined(options.edgeWidth) ? options.edgeWidth : 1; //#4055 Highcharts.each(this.data, function (point) { if (point.y !== null) { var pointAttr = point.pointAttr; // Set the border color to the fill color to provide a smooth edge this.borderColor = Highcharts.pick(options.edgeColor, pointAttr[''].fill); pointAttr[''].stroke = this.borderColor; pointAttr.hover.stroke = Highcharts.pick(states.hover.edgeColor, this.borderColor); pointAttr.select.stroke = Highcharts.pick(states.select.edgeColor, this.borderColor); } }); } proceed.apply(this, [].slice.call(arguments, 1)); } Highcharts.wrap(Highcharts.Series.prototype, 'alignDataLabel', function (proceed) { // Only do this for 3D columns and columnranges if (this.chart.is3d() && (this.type === 'column' || this.type === 'columnrange')) { var series = this, chart = series.chart; var args = arguments, alignTo = args[4]; var pos = ({ x: alignTo.x, y: alignTo.y, z: series.z }); pos = perspective([pos], chart, true)[0]; alignTo.x = pos.x; alignTo.y = pos.y; } proceed.apply(this, [].slice.call(arguments, 1)); }); if (Highcharts.seriesTypes.columnrange) { Highcharts.wrap(Highcharts.seriesTypes.columnrange.prototype, 'drawPoints', draw3DPoints); } Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'drawPoints', draw3DPoints); /*** EXTENSION FOR 3D CYLINDRICAL COLUMNS Not supported ***/ /* var defaultOptions = Highcharts.getOptions(); defaultOptions.plotOptions.cylinder = Highcharts.merge(defaultOptions.plotOptions.column); var CylinderSeries = Highcharts.extendClass(Highcharts.seriesTypes.column, { type: 'cylinder' }); Highcharts.seriesTypes.cylinder = CylinderSeries; Highcharts.wrap(Highcharts.seriesTypes.cylinder.prototype, 'translate', function (proceed) { proceed.apply(this, [].slice.call(arguments, 1)); // Do not do this if the chart is not 3D if (!this.chart.is3d()) { return; } var series = this, chart = series.chart, options = chart.options, cylOptions = options.plotOptions.cylinder, options3d = options.chart.options3d, depth = cylOptions.depth || 0, alpha = options3d.alpha; var z = cylOptions.stacking ? (this.options.stack || 0) * depth : series._i * depth; z += depth / 2; if (cylOptions.grouping !== false) { z = 0; } Highcharts.each(series.data, function (point) { var shapeArgs = point.shapeArgs; point.shapeType = 'arc3d'; shapeArgs.x += depth / 2; shapeArgs.z = z; shapeArgs.start = 0; shapeArgs.end = 2 * PI; shapeArgs.r = depth * 0.95; shapeArgs.innerR = 0; shapeArgs.depth = shapeArgs.height * (1 / sin((90 - alpha) * deg2rad)) - z; shapeArgs.alpha = 90 - alpha; shapeArgs.beta = 0; }); }); */ /*** EXTENSION FOR 3D PIES ***/ Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'translate', function (proceed) { proceed.apply(this, [].slice.call(arguments, 1)); // Do not do this if the chart is not 3D if (!this.chart.is3d()) { return; } var series = this, chart = series.chart, options = chart.options, seriesOptions = series.options, depth = seriesOptions.depth || 0, options3d = options.chart.options3d, alpha = options3d.alpha, beta = options3d.beta, z = seriesOptions.stacking ? (seriesOptions.stack || 0) * depth : series._i * depth; z += depth / 2; if (seriesOptions.grouping !== false) { z = 0; } each(series.data, function (point) { var shapeArgs = point.shapeArgs, angle; point.shapeType = 'arc3d'; shapeArgs.z = z; shapeArgs.depth = depth * 0.75; shapeArgs.alpha = alpha; shapeArgs.beta = beta; shapeArgs.center = series.center; angle = (shapeArgs.end + shapeArgs.start) / 2; point.slicedTranslation = { translateX: round(cos(angle) * seriesOptions.slicedOffset * cos(alpha * deg2rad)), translateY: round(sin(angle) * seriesOptions.slicedOffset * cos(alpha * deg2rad)) }; }); }); Highcharts.wrap(Highcharts.seriesTypes.pie.prototype.pointClass.prototype, 'haloPath', function (proceed) { var args = arguments; return this.series.chart.is3d() ? [] : proceed.call(this, args[1]); }); Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'drawPoints', function (proceed) { var options = this.options, states = options.states; // Do not do this if the chart is not 3D if (this.chart.is3d()) { // Set the border color to the fill color to provide a smooth edge this.borderWidth = options.borderWidth = options.edgeWidth || 1; this.borderColor = options.edgeColor = Highcharts.pick(options.edgeColor, options.borderColor, undefined); states.hover.borderColor = Highcharts.pick(states.hover.edgeColor, this.borderColor); states.hover.borderWidth = Highcharts.pick(states.hover.edgeWidth, this.borderWidth); states.select.borderColor = Highcharts.pick(states.select.edgeColor, this.borderColor); states.select.borderWidth = Highcharts.pick(states.select.edgeWidth, this.borderWidth); each(this.data, function (point) { var pointAttr = point.pointAttr; pointAttr[''].stroke = point.series.borderColor || point.color; pointAttr['']['stroke-width'] = point.series.borderWidth; pointAttr.hover.stroke = states.hover.borderColor; pointAttr.hover['stroke-width'] = states.hover.borderWidth; pointAttr.select.stroke = states.select.borderColor; pointAttr.select['stroke-width'] = states.select.borderWidth; }); } proceed.apply(this, [].slice.call(arguments, 1)); if (this.chart.is3d()) { each(this.points, function (point) { var graphic = point.graphic; // #4584 Check if has graphic - null points don't have it if (graphic) { // Hide null or 0 points (#3006, 3650) graphic[point.y && point.visible ? 'show' : 'hide'](); } }); } }); Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'drawDataLabels', function (proceed) { if (this.chart.is3d()) { var series = this, chart = series.chart, options3d = chart.options.chart.options3d; each(series.data, function (point) { var shapeArgs = point.shapeArgs, r = shapeArgs.r, a1 = (shapeArgs.alpha || options3d.alpha) * deg2rad, //#3240 issue with datalabels for 0 and null values b1 = (shapeArgs.beta || options3d.beta) * deg2rad, a2 = (shapeArgs.start + shapeArgs.end) / 2, labelPos = point.labelPos, labelIndexes = [0, 2, 4], // [x1, y1, x2, y2, x3, y3] yOffset = (-r * (1 - cos(a1)) * sin(a2)), // + (sin(a2) > 0 ? sin(a1) * d : 0) xOffset = r * (cos(b1) - 1) * cos(a2); // Apply perspective on label positions each(labelIndexes, function (index) { labelPos[index] += xOffset; labelPos[index + 1] += yOffset; }); }); } proceed.apply(this, [].slice.call(arguments, 1)); }); Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'addPoint', function (proceed) { proceed.apply(this, [].slice.call(arguments, 1)); if (this.chart.is3d()) { // destroy (and rebuild) everything!!! this.update(this.userOptions, true); // #3845 pass the old options } }); Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'animate', function (proceed) { if (!this.chart.is3d()) { proceed.apply(this, [].slice.call(arguments, 1)); } else { var args = arguments, init = args[1], animation = this.options.animation, attribs, center = this.center, group = this.group, markerGroup = this.markerGroup; if (Highcharts.svg) { // VML is too slow anyway if (animation === true) { animation = {}; } // Initialize the animation if (init) { // Scale down the group and place it in the center group.oldtranslateX = group.translateX; group.oldtranslateY = group.translateY; attribs = { translateX: center[0], translateY: center[1], scaleX: 0.001, // #1499 scaleY: 0.001 }; group.attr(attribs); if (markerGroup) { markerGroup.attrSetters = group.attrSetters; markerGroup.attr(attribs); } // Run the animation } else { attribs = { translateX: group.oldtranslateX, translateY: group.oldtranslateY, scaleX: 1, scaleY: 1 }; group.animate(attribs, animation); if (markerGroup) { markerGroup.animate(attribs, animation); } // Delete this function to allow it only once this.animate = null; } } } }); /*** EXTENSION FOR 3D SCATTER CHART ***/ Highcharts.wrap(Highcharts.seriesTypes.scatter.prototype, 'translate', function (proceed) { //function translate3d(proceed) { proceed.apply(this, [].slice.call(arguments, 1)); if (!this.chart.is3d()) { return; } var series = this, chart = series.chart, zAxis = Highcharts.pick(series.zAxis, chart.options.zAxis[0]), rawPoints = [], rawPoint, projectedPoints, projectedPoint, zValue, i; for (i = 0; i < series.data.length; i++) { rawPoint = series.data[i]; zValue = zAxis.isLog && zAxis.val2lin ? zAxis.val2lin(rawPoint.z) : rawPoint.z; // #4562 rawPoint.plotZ = zAxis.translate(zValue); rawPoint.isInside = rawPoint.isInside ? (zValue >= zAxis.min && zValue <= zAxis.max) : false; rawPoints.push({ x: rawPoint.plotX, y: rawPoint.plotY, z: rawPoint.plotZ }); } projectedPoints = perspective(rawPoints, chart, true); for (i = 0; i < series.data.length; i++) { rawPoint = series.data[i]; projectedPoint = projectedPoints[i]; rawPoint.plotXold = rawPoint.plotX; rawPoint.plotYold = rawPoint.plotY; rawPoint.plotZold = rawPoint.plotZ; rawPoint.plotX = projectedPoint.x; rawPoint.plotY = projectedPoint.y; rawPoint.plotZ = projectedPoint.z; } }); Highcharts.wrap(Highcharts.seriesTypes.scatter.prototype, 'init', function (proceed, chart, options) { if (chart.is3d()) { // add a third coordinate this.axisTypes = ['xAxis', 'yAxis', 'zAxis']; this.pointArrayMap = ['x', 'y', 'z']; this.parallelArrays = ['x', 'y', 'z']; // Require direct touch rather than using the k-d-tree, because the k-d-tree currently doesn't // take the xyz coordinate system into account (#4552) this.directTouch = true; } var result = proceed.apply(this, [chart, options]); if (this.chart.is3d()) { // Set a new default tooltip formatter var default3dScatterTooltip = 'x: {point.x}
          y: {point.y}
          z: {point.z}
          '; if (this.userOptions.tooltip) { this.tooltipOptions.pointFormat = this.userOptions.tooltip.pointFormat || default3dScatterTooltip; } else { this.tooltipOptions.pointFormat = default3dScatterTooltip; } } return result; }); /** * Extension to the VML Renderer */ if (Highcharts.VMLRenderer) { Highcharts.setOptions({ animate: false }); Highcharts.VMLRenderer.prototype.cuboid = Highcharts.SVGRenderer.prototype.cuboid; Highcharts.VMLRenderer.prototype.cuboidPath = Highcharts.SVGRenderer.prototype.cuboidPath; Highcharts.VMLRenderer.prototype.toLinePath = Highcharts.SVGRenderer.prototype.toLinePath; Highcharts.VMLRenderer.prototype.createElement3D = Highcharts.SVGRenderer.prototype.createElement3D; Highcharts.VMLRenderer.prototype.arc3d = function (shapeArgs) { var result = Highcharts.SVGRenderer.prototype.arc3d.call(this, shapeArgs); result.css({ zIndex: result.zIndex }); return result; }; Highcharts.VMLRenderer.prototype.arc3dPath = Highcharts.SVGRenderer.prototype.arc3dPath; Highcharts.wrap(Highcharts.Axis.prototype, 'render', function (proceed) { proceed.apply(this, [].slice.call(arguments, 1)); // VML doesn't support a negative z-index if (this.sideFrame) { this.sideFrame.css({ zIndex: 0 }); this.sideFrame.front.attr({ fill: this.sideFrame.color }); } if (this.bottomFrame) { this.bottomFrame.css({ zIndex: 1 }); this.bottomFrame.front.attr({ fill: this.bottomFrame.color }); } if (this.backFrame) { this.backFrame.css({ zIndex: 0 }); this.backFrame.front.attr({ fill: this.backFrame.color }); } }); } })); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/highcharts/highcharts-more.js ================================================ /* Highcharts JS v4.2.7 (2016-09-21) (c) 2009-2016 Torstein Honsi License: www.highcharts.com/license */ (function(m){typeof module==="object"&&module.exports?module.exports=m:m(Highcharts)})(function(m){function M(a,b,c){this.init(a,b,c)}var R=m.arrayMin,S=m.arrayMax,s=m.each,J=m.extend,G=m.isNumber,v=m.merge,T=m.map,r=m.pick,B=m.pInt,H=m.correctFloat,p=m.getOptions().plotOptions,i=m.seriesTypes,t=m.extendClass,N=m.splat,w=m.wrap,O=m.Axis,z=m.Tick,I=m.Point,U=m.Pointer,V=m.CenteredSeriesMixin,C=m.TrackerMixin,x=m.Series,y=Math,F=y.round,D=y.floor,P=y.max,W=m.Color,n=function(){};J(M.prototype,{init:function(a, b,c){var d=this,g=d.defaultOptions;d.chart=b;d.options=a=v(g,b.angular?{background:{}}:void 0,a);(a=a.background)&&s([].concat(N(a)).reverse(),function(a){var b=a.backgroundColor,g=c.userOptions,a=v(d.defaultBackgroundOptions,a);if(b)a.backgroundColor=b;a.color=a.backgroundColor;c.options.plotBands.unshift(a);g.plotBands=g.plotBands||[];g.plotBands!==c.options.plotBands&&g.plotBands.unshift(a)})},defaultOptions:{center:["50%","50%"],size:"85%",startAngle:0},defaultBackgroundOptions:{shape:"circle", borderWidth:1,borderColor:"silver",backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"#FFF"],[1,"#DDD"]]},from:-Number.MAX_VALUE,innerRadius:0,to:Number.MAX_VALUE,outerRadius:"105%"}});var A=O.prototype,z=z.prototype,X={getOffset:n,redraw:function(){this.isDirty=!1},render:function(){this.isDirty=!1},setScale:n,setCategories:n,setTitle:n},Q={isRadial:!0,defaultRadialGaugeOptions:{labels:{align:"center",x:0,y:null},minorGridLineWidth:0,minorTickInterval:"auto",minorTickLength:10,minorTickPosition:"inside", minorTickWidth:1,tickLength:10,tickPosition:"inside",tickWidth:2,title:{rotation:0},zIndex:2},defaultRadialXOptions:{gridLineWidth:1,labels:{align:null,distance:15,x:0,y:null},maxPadding:0,minPadding:0,showLastLabel:!1,tickLength:0},defaultRadialYOptions:{gridLineInterpolation:"circle",labels:{align:"right",x:-3,y:-2},showLastLabel:!1,title:{x:4,text:null,rotation:90}},setOptions:function(a){a=this.options=v(this.defaultOptions,this.defaultRadialOptions,a);if(!a.plotBands)a.plotBands=[]},getOffset:function(){A.getOffset.call(this); this.chart.axisOffset[this.side]=0;this.center=this.pane.center=V.getCenter.call(this.pane)},getLinePath:function(a,b){var c=this.center,d,g=this.chart;d=r(b,c[2]/2-this.offset);this.isCircular||b!==void 0?c=this.chart.renderer.symbols.arc(this.left+c[0],this.top+c[1],d,d,{start:this.startAngleRad,end:this.endAngleRad,open:!0,innerR:0}):(d=this.postTranslate(this.angleRad,d),c=["M",c[0]+g.plotLeft,c[1]+g.plotTop,"L",d.x,d.y]);return c},setAxisTranslation:function(){A.setAxisTranslation.call(this); if(this.center)this.transA=this.isCircular?(this.endAngleRad-this.startAngleRad)/(this.max-this.min||1):this.center[2]/2/(this.max-this.min||1),this.minPixelPadding=this.isXAxis?this.transA*this.minPointOffset:0},beforeSetTickPositions:function(){(this.autoConnect=this.isCircular&&r(this.userMax,this.options.max)===void 0&&this.endAngleRad-this.startAngleRad===2*Math.PI)&&(this.max+=this.categories&&1||this.pointRange||this.closestPointRange||0)},setAxisSize:function(){A.setAxisSize.call(this);if(this.isRadial){this.center= this.pane.center=m.CenteredSeriesMixin.getCenter.call(this.pane);if(this.isCircular)this.sector=this.endAngleRad-this.startAngleRad;this.len=this.width=this.height=this.center[2]*r(this.sector,1)/2}},getPosition:function(a,b){return this.postTranslate(this.isCircular?this.translate(a):this.angleRad,r(this.isCircular?b:this.translate(a),this.center[2]/2)-this.offset)},postTranslate:function(a,b){var c=this.chart,d=this.center,a=this.startAngleRad+a;return{x:c.plotLeft+d[0]+Math.cos(a)*b,y:c.plotTop+ d[1]+Math.sin(a)*b}},getPlotBandPath:function(a,b,c){var d=this.center,g=this.startAngleRad,e=d[2]/2,j=[r(c.outerRadius,"100%"),c.innerRadius,r(c.thickness,10)],l=Math.min(this.offset,0),h=/%$/,f,k=this.isCircular;this.options.gridLineInterpolation==="polygon"?d=this.getPlotLinePath(a).concat(this.getPlotLinePath(b,!0)):(a=Math.max(a,this.min),b=Math.min(b,this.max),k||(j[0]=this.translate(a),j[1]=this.translate(b)),j=T(j,function(a){h.test(a)&&(a=B(a,10)*e/100);return a}),c.shape==="circle"||!k? (a=-Math.PI/2,b=Math.PI*1.5,f=!0):(a=g+this.translate(a),b=g+this.translate(b)),j[0]-=l,j[2]-=l,d=this.chart.renderer.symbols.arc(this.left+d[0],this.top+d[1],j[0],j[0],{start:Math.min(a,b),end:Math.max(a,b),innerR:r(j[1],j[0]-j[2]),open:f}));return d},getPlotLinePath:function(a,b){var c=this,d=c.center,g=c.chart,e=c.getPosition(a),j,l,h;c.isCircular?h=["M",d[0]+g.plotLeft,d[1]+g.plotTop,"L",e.x,e.y]:c.options.gridLineInterpolation==="circle"?(a=c.translate(a))&&(h=c.getLinePath(0,a)):(s(g.xAxis, function(a){a.pane===c.pane&&(j=a)}),h=[],a=c.translate(a),d=j.tickPositions,j.autoConnect&&(d=d.concat([d[0]])),b&&(d=[].concat(d).reverse()),s(d,function(e,b){l=j.getPosition(e,a);h.push(b?"L":"M",l.x,l.y)}));return h},getTitlePosition:function(){var a=this.center,b=this.chart,c=this.options.title;return{x:b.plotLeft+a[0]+(c.x||0),y:b.plotTop+a[1]-{high:0.5,middle:0.25,low:0}[c.align]*a[2]+(c.y||0)}}};w(A,"init",function(a,b,c){var k;var d=b.angular,g=b.polar,e=c.isX,j=d&&e,l,h=b.options,f=c.pane|| 0;if(d){if(J(this,j?X:Q),l=!e)this.defaultRadialOptions=this.defaultRadialGaugeOptions}else if(g)J(this,Q),this.defaultRadialOptions=(l=e)?this.defaultRadialXOptions:v(this.defaultYAxisOptions,this.defaultRadialYOptions);if(d||g)b.inverted=!1,h.chart.zoomType=null;a.call(this,b,c);if(!j&&(d||g)){a=this.options;if(!b.panes)b.panes=[];this.pane=(k=b.panes[f]=b.panes[f]||new M(N(h.pane)[f],b,this),b=k);b=b.options;this.angleRad=(a.angle||0)*Math.PI/180;this.startAngleRad=(b.startAngle-90)*Math.PI/180; this.endAngleRad=(r(b.endAngle,b.startAngle+360)-90)*Math.PI/180;this.offset=a.offset||0;this.isCircular=l}});w(A,"autoLabelAlign",function(a){if(!this.isRadial)return a.apply(this,[].slice.call(arguments,1))});w(z,"getPosition",function(a,b,c,d,g){var e=this.axis;return e.getPosition?e.getPosition(c):a.call(this,b,c,d,g)});w(z,"getLabelPosition",function(a,b,c,d,g,e,j,l,h){var f=this.axis,k=e.y,o=20,u=e.align,i=(f.translate(this.pos)+f.startAngleRad+Math.PI/2)/Math.PI*180%360;f.isRadial?(a=f.getPosition(this.pos, f.center[2]/2+r(e.distance,-25)),e.rotation==="auto"?d.attr({rotation:i}):k===null&&(k=f.chart.renderer.fontMetrics(d.styles.fontSize).b-d.getBBox().height/2),u===null&&(f.isCircular?(this.label.getBBox().width>f.len*f.tickInterval/(f.max-f.min)&&(o=0),u=i>o&&i<180-o?"left":i>180+o&&i<360-o?"right":"center"):u="center",d.attr({align:u})),a.x+=e.x,a.y+=k):a=a.call(this,b,c,d,g,e,j,l,h);return a});w(z,"getMarkPath",function(a,b,c,d,g,e,j){var l=this.axis;l.isRadial?(a=l.getPosition(this.pos,l.center[2]/ 2+d),b=["M",b,c,"L",a.x,a.y]):b=a.call(this,b,c,d,g,e,j);return b});p.arearange=v(p.area,{lineWidth:1,marker:null,threshold:null,tooltip:{pointFormat:'\u25cf {series.name}: {point.low} - {point.high}
          '},trackByArea:!0,dataLabels:{align:null,verticalAlign:null,xLow:0,xHigh:0,yLow:0,yHigh:0},states:{hover:{halo:!1}}});i.arearange=t(i.area,{type:"arearange",pointArrayMap:["low","high"],dataLabelCollections:["dataLabel","dataLabelUpper"],toYData:function(a){return[a.low, a.high]},pointValKey:"low",deferTranslatePolar:!0,highToXY:function(a){var b=this.chart,c=this.xAxis.postTranslate(a.rectPlotX,this.yAxis.len-a.plotHigh);a.plotHighX=c.x-b.plotLeft;a.plotHigh=c.y-b.plotTop},translate:function(){var a=this,b=a.yAxis;i.area.prototype.translate.apply(a);s(a.points,function(a){var d=a.low,g=a.high,e=a.plotY;g===null||d===null?a.isNull=!0:(a.plotLow=e,a.plotHigh=b.translate(g,0,1,0,1))});this.chart.polar&&s(this.points,function(b){a.highToXY(b)})},getGraphPath:function(a){var b= [],c=[],d,g=i.area.prototype.getGraphPath,e,j,l;l=this.options;var h=l.step,a=a||this.points;for(d=a.length;d--;)e=a[d],!e.isNull&&!l.connectEnds&&(!a[d+1]||a[d+1].isNull)&&c.push({plotX:e.plotX,plotY:e.plotY,doCurve:!1}),j={polarPlotY:e.polarPlotY,rectPlotX:e.rectPlotX,yBottom:e.yBottom,plotX:r(e.plotHighX,e.plotX),plotY:e.plotHigh,isNull:e.isNull},c.push(j),b.push(j),!e.isNull&&!l.connectEnds&&(!a[d-1]||a[d-1].isNull)&&c.push({plotX:e.plotX,plotY:e.plotY,doCurve:!1});a=g.call(this,a);if(h)h===!0&& (h="left"),l.step={left:"right",center:"center",right:"left"}[h];b=g.call(this,b);c=g.call(this,c);l.step=h;l=[].concat(a,b);!this.chart.polar&&c[0]==="M"&&(c[0]="L");this.graphPath=l;this.areaPath=this.areaPath.concat(a,c);l.isArea=!0;l.xMap=a.xMap;this.areaPath.xMap=a.xMap;return l},drawDataLabels:function(){var a=this.data,b=a.length,c,d=[],g=x.prototype,e=this.options.dataLabels,j=e.align,l=e.verticalAlign,h=e.inside,f,k,o=this.chart.inverted;if(e.enabled||this._hasPointLabels){for(c=b;c--;)if(f= a[c]){k=h?f.plotHighf.plotLow;f.y=f.high;f._plotY=f.plotY;f.plotY=f.plotHigh;d[c]=f.dataLabel;f.dataLabel=f.dataLabelUpper;f.below=k;if(o){if(!j)e.align=k?"right":"left"}else if(!l)e.verticalAlign=k?"top":"bottom";e.x=e.xHigh;e.y=e.yHigh}g.drawDataLabels&&g.drawDataLabels.apply(this,arguments);for(c=b;c--;)if(f=a[c]){k=h?f.plotHighf.plotLow;f.dataLabelUpper=f.dataLabel;f.dataLabel=d[c];f.y=f.low;f.plotY=f._plotY;f.below=!k;if(o){if(!j)e.align=k?"left":"right"}else if(!l)e.verticalAlign= k?"bottom":"top";e.x=e.xLow;e.y=e.yLow}g.drawDataLabels&&g.drawDataLabels.apply(this,arguments)}e.align=j;e.verticalAlign=l},alignDataLabel:function(){i.column.prototype.alignDataLabel.apply(this,arguments)},setStackedPoints:n,getSymbol:n,drawPoints:n});p.areasplinerange=v(p.arearange);i.areasplinerange=t(i.arearange,{type:"areasplinerange",getPointSpline:i.spline.prototype.getPointSpline});(function(){var a=i.column.prototype;p.columnrange=v(p.column,p.arearange,{lineWidth:1,pointRange:null});i.columnrange= t(i.arearange,{type:"columnrange",translate:function(){var b=this,c=b.yAxis,d=b.xAxis,g=d.startAngleRad,e,j=b.chart,l=b.xAxis.isRadial,h;a.translate.apply(b);s(b.points,function(a){var k=a.shapeArgs,o=b.options.minPointLength,u,i;a.plotHigh=h=c.translate(a.high,0,1,0,1);a.plotLow=a.plotY;i=h;u=r(a.rectPlotY,a.plotY)-h;Math.abs(u)\u25cf {series.name}
          Maximum: {point.high}
          Upper quartile: {point.q3}
          Median: {point.median}
          Lower quartile: {point.q1}
          Minimum: {point.low}
          '}, whiskerLength:"50%",whiskerWidth:2});i.boxplot=t(i.column,{type:"boxplot",pointArrayMap:["low","q1","median","q3","high"],toYData:function(a){return[a.low,a.q1,a.median,a.q3,a.high]},pointValKey:"high",pointAttrToOptions:{fill:"fillColor",stroke:"color","stroke-width":"lineWidth"},drawDataLabels:n,translate:function(){var a=this.yAxis,b=this.pointArrayMap;i.column.prototype.translate.apply(this);s(this.points,function(c){s(b,function(b){c[b]!==null&&(c[b+"Plot"]=a.translate(c[b],0,1,0,1))})})},drawPoints:function(){var a= this,b=a.options,c=a.chart.renderer,d,g,e,j,l,h,f,k,o,i,m,K,L,p,v,n,w,t,x,y,C,B,z=a.doQuartiles!==!1,A,E=a.options.whiskerLength;s(a.points,function(q){o=q.graphic;C=q.shapeArgs;m={};p={};n={};B=q.color||a.color;if(q.plotY!==void 0)if(d=q.pointAttr[q.selected?"selected":""],w=C.width,t=D(C.x),x=t+w,y=F(w/2),g=D(z?q.q1Plot:q.lowPlot),e=D(z?q.q3Plot:q.lowPlot),j=D(q.highPlot),l=D(q.lowPlot),m.stroke=q.stemColor||b.stemColor||B,m["stroke-width"]=r(q.stemWidth,b.stemWidth,b.lineWidth),m.dashstyle=q.stemDashStyle|| b.stemDashStyle,p.stroke=q.whiskerColor||b.whiskerColor||B,p["stroke-width"]=r(q.whiskerWidth,b.whiskerWidth,b.lineWidth),n.stroke=q.medianColor||b.medianColor||B,n["stroke-width"]=r(q.medianWidth,b.medianWidth,b.lineWidth),f=m["stroke-width"]%2/2,k=t+y+f,i=["M",k,e,"L",k,j,"M",k,g,"L",k,l],z&&(f=d["stroke-width"]%2/2,k=D(k)+f,g=D(g)+f,e=D(e)+f,t+=f,x+=f,K=["M",t,e,"L",t,g,"L",x,g,"L",x,e,"L",t,e,"z"]),E&&(f=p["stroke-width"]%2/2,j+=f,l+=f,A=/%$/.test(E)?y*parseFloat(E)/100:E/2,L=["M",k-A,j,"L",k+ A,j,"M",k-A,l,"L",k+A,l]),f=n["stroke-width"]%2/2,h=F(q.medianPlot)+f,v=["M",t,h,"L",x,h],o)q.stem.animate({d:i}),E&&q.whiskers.animate({d:L}),z&&q.box.animate({d:K}),q.medianShape.animate({d:v});else{q.graphic=o=c.g().add(a.group);q.stem=c.path(i).attr(m).add(o);if(E)q.whiskers=c.path(L).attr(p).add(o);if(z)q.box=c.path(K).attr(d).add(o);q.medianShape=c.path(v).attr(n).add(o)}})},setStackedPoints:n});p.errorbar=v(p.boxplot,{color:"#000000",grouping:!1,linkedTo:":previous",tooltip:{pointFormat:'\u25cf {series.name}: {point.low} - {point.high}
          '}, whiskerWidth:null});i.errorbar=t(i.boxplot,{type:"errorbar",pointArrayMap:["low","high"],toYData:function(a){return[a.low,a.high]},pointValKey:"high",doQuartiles:!1,drawDataLabels:i.arearange?function(){var a=this.pointValKey;i.arearange.prototype.drawDataLabels.call(this);s(this.data,function(b){b.y=b[a]})}:n,getColumnMetrics:function(){return this.linkedParent&&this.linkedParent.columnMetrics||i.column.prototype.getColumnMetrics.call(this)}});p.waterfall=v(p.column,{lineWidth:1,lineColor:"#333", dashStyle:"dot",borderColor:"#333",dataLabels:{inside:!0},states:{hover:{lineWidthPlus:0}}});i.waterfall=t(i.column,{type:"waterfall",upColorProp:"fill",pointValKey:"y",pointClass:t(I,{isValid:function(){return G(this.y,!0)||this.isSum||this.isIntermediateSum}}),translate:function(){var a=this.options,b=this.yAxis,c,d,g,e,j,l,h,f,k,o=r(a.minPointLength,5),u=a.threshold,m=a.stacking;i.column.prototype.translate.apply(this);this.minPointLengthOffset=0;h=f=u;d=this.points;for(c=0,a=d.length;c0?b.toPixels(h, !0)-e.y:b.toPixels(h,!0)-b.toPixels(h-l,!0),h+=l);e.height<0&&(e.y+=e.height,e.height*=-1);g.plotY=e.y=F(e.y)-this.borderWidth%2/2;e.height=P(F(e.height),0.001);g.yBottom=e.y+e.height;if(e.height<=o)e.height=o,this.minPointLengthOffset+=o;e.y-=this.minPointLengthOffset;e=g.plotY+(g.negative?e.height:0)-this.minPointLengthOffset;this.chart.inverted?g.tooltipPos[0]=b.len-e:g.tooltipPos[1]=e}},processData:function(a){var b=this.yData,c=this.options.data,d,g=b.length,e,j,l,h,f,k;j=e=l=h=this.options.threshold|| 0;for(k=0;k0?(b.pointAttr=g,b.color=d):b.pointAttr=a.pointAttr})},getGraphPath:function(){var a=this.data,b=a.length,c=F(this.options.lineWidth+this.borderWidth)%2/2,d=[],g,e,j;for(j=1;j0&&a.splice(b,0,"z");return this.areaPath=a},drawGraph:function(){this.options.fillColor=this.color;i.area.prototype.drawGraph.call(this)},drawLegendSymbol:m.LegendSymbolMixin.drawRectangle,drawTracker:x.prototype.drawTracker, setStackedPoints:n});p.bubble=v(p.scatter,{dataLabels:{formatter:function(){return this.point.z},inside:!0,verticalAlign:"middle"},marker:{lineColor:null,lineWidth:1},minSize:8,maxSize:"20%",softThreshold:!1,states:{hover:{halo:{size:5}}},tooltip:{pointFormat:"({point.x}, {point.y}), Size: {point.z}"},turboThreshold:0,zThreshold:0,zoneAxis:"z"});C=t(I,{haloPath:function(){return I.prototype.haloPath.call(this,this.shapeArgs.r+this.series.options.states.hover.halo.size)},ttBelow:!1});i.bubble=t(i.scatter, {type:"bubble",pointClass:C,pointArrayMap:["y","z"],parallelArrays:["x","y","z"],trackerGroups:["group","dataLabelsGroup"],bubblePadding:!0,zoneAxis:"z",pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor"},applyOpacity:function(a){var b=this.options.marker,c=r(b.fillOpacity,0.5),a=a||b.fillColor||this.color;c!==1&&(a=W(a).setOpacity(c).get("rgba"));return a},convertAttribs:function(){var a=x.prototype.convertAttribs.apply(this,arguments);a.fill=this.applyOpacity(a.fill); return a},getRadii:function(a,b,c,d){var g,e,j,l=this.zData,h=[],f=this.options,k=f.sizeBy!=="width",o=f.zThreshold,i=b-a;for(e=0,g=l.length;e0?(j-a)/i:0.5,k&&j>=0&&(j=Math.sqrt(j)),j=y.ceil(c+j*(d-c))/2),h.push(j);this.radii=h},animate:function(a){var b=this.options.animation;if(!a)s(this.points,function(a){var d=a.graphic,a=a.shapeArgs;d&&a&&(d.attr("r",1),d.animate({r:a.r}, b))}),this.animate=null},translate:function(){var a,b=this.data,c,d,g=this.radii;i.scatter.prototype.translate.call(this);for(a=b.length;a--;)c=b[a],d=g?g[a]:0,G(d)&&d>=this.minPxSize/2?(c.shapeType="circle",c.shapeArgs={x:c.plotX,y:c.plotY,r:d},c.dlBox={x:c.plotX-d,y:c.plotY-d,width:2*d,height:2*d}):c.shapeArgs=c.plotY=c.dlBox=void 0},drawLegendSymbol:function(a,b){var c=this.chart.renderer,d=c.fontMetrics(a.itemStyle.fontSize).f/2;b.legendSymbol=c.circle(d,a.baseline-d,d).attr({zIndex:3}).add(b.legendGroup); b.legendSymbol.isMarker=!0},drawPoints:i.column.prototype.drawPoints,alignDataLabel:i.column.prototype.alignDataLabel,buildKDTree:n,applyZones:n});O.prototype.beforePadding=function(){var a=this,b=this.len,c=this.chart,d=0,g=b,e=this.isXAxis,j=e?"xData":"yData",l=this.min,h={},f=y.min(c.plotWidth,c.plotHeight),k=Number.MAX_VALUE,i=-Number.MAX_VALUE,m=this.max-l,p=b/m,n=[];s(this.series,function(b){var g=b.options;if(b.bubblePadding&&(b.visible||!c.options.chart.ignoreHiddenSeries))if(a.allowZoomOutside= !0,n.push(b),e)s(["minSize","maxSize"],function(a){var b=g[a],e=/%$/.test(b),b=B(b);h[a]=e?f*b/100:b}),b.minPxSize=h.minSize,b.maxPxSize=h.maxSize,b=b.zData,b.length&&(k=r(g.zMin,y.min(k,y.max(R(b),g.displayNegative===!1?g.zThreshold:-Number.MAX_VALUE))),i=r(g.zMax,y.max(i,S(b))))});s(n,function(b){var c=b[j],f=c.length,h;e&&b.getRadii(k,i,b.minPxSize,b.maxPxSize);if(m>0)for(;f--;)G(c[f])&&a.dataMin<=c[f]&&c[f]<=a.dataMax&&(h=b.radii[f],d=Math.min((c[f]-l)*p-h,d),g=Math.max((c[f]-l)*p+h,g))});n.length&& m>0&&!this.isLog&&(g-=b,p*=(b+d-g)/b,s([["min","userMin",d],["max","userMax",g]],function(b){r(a.options[b[0]],a[b[1]])===void 0&&(a[b[0]]+=b[2]/p)}))};(function(){function a(a,b){var c=this.chart,d=this.options.animation,h=this.group,f=this.markerGroup,k=this.xAxis.center,i=c.plotLeft,m=c.plotTop;if(c.polar){if(c.renderer.isSVG)d===!0&&(d={}),b?(c={translateX:k[0]+i,translateY:k[1]+m,scaleX:0.001,scaleY:0.001},h.attr(c),f&&f.attr(c)):(c={translateX:i,translateY:m,scaleX:1,scaleY:1},h.animate(c,d), f&&f.animate(c,d),this.animate=null)}else a.call(this,b)}var b=x.prototype,c=U.prototype,d;b.searchPointByAngle=function(a){var b=this.chart,c=this.xAxis.pane.center;return this.searchKDTree({clientX:180+Math.atan2(a.chartX-c[0]-b.plotLeft,a.chartY-c[1]-b.plotTop)*(-180/Math.PI)})};w(b,"buildKDTree",function(a){if(this.chart.polar)this.kdByAngle?this.searchPoint=this.searchPointByAngle:this.kdDimensions=2;a.apply(this)});b.toXY=function(a){var b,c=this.chart,d=a.plotX;b=a.plotY;a.rectPlotX=d;a.rectPlotY= b;b=this.xAxis.postTranslate(a.plotX,this.yAxis.len-b);a.plotX=a.polarPlotX=b.x-c.plotLeft;a.plotY=a.polarPlotY=b.y-c.plotTop;this.kdByAngle?(c=(d/Math.PI*180+this.xAxis.pane.options.startAngle)%360,c<0&&(c+=360),a.clientX=c):a.clientX=a.plotX};i.spline&&w(i.spline.prototype,"getPointSpline",function(a,b,c,d){var h,f,k,i,m,p,n;if(this.chart.polar){h=c.plotX;f=c.plotY;a=b[d-1];k=b[d+1];this.connectEnds&&(a||(a=b[b.length-2]),k||(k=b[1]));if(a&&k)i=a.plotX,m=a.plotY,b=k.plotX,p=k.plotY,i=(1.5*h+i)/ 2.5,m=(1.5*f+m)/2.5,k=(1.5*h+b)/2.5,n=(1.5*f+p)/2.5,b=Math.sqrt(Math.pow(i-h,2)+Math.pow(m-f,2)),p=Math.sqrt(Math.pow(k-h,2)+Math.pow(n-f,2)),i=Math.atan2(m-f,i-h),m=Math.atan2(n-f,k-h),n=Math.PI/2+(i+m)/2,Math.abs(i-n)>Math.PI/2&&(n-=Math.PI),i=h+Math.cos(n)*b,m=f+Math.sin(n)*b,k=h+Math.cos(Math.PI+n)*p,n=f+Math.sin(Math.PI+n)*p,c.rightContX=k,c.rightContY=n;d?(c=["C",a.rightContX||a.plotX,a.rightContY||a.plotY,i||h,m||f,h,f],a.rightContX=a.rightContY=null):c=["M",h,f]}else c=a.call(this,b,c,d); return c});w(b,"translate",function(a){var b=this.chart;a.call(this);if(b.polar&&(this.kdByAngle=b.tooltip&&b.tooltip.shared,!this.preventPostTranslate)){a=this.points;for(b=a.length;b--;)this.toXY(a[b])}});w(b,"getGraphPath",function(a,b){var c=this,d,h;if(this.chart.polar){b=b||this.points;for(d=0;db.center[1]}}),w(d,"alignDataLabel",function(a,c,d,i,h,f){if(this.chart.polar){a=c.rectPlotX/Math.PI*180;if(i.align===null)i.align=a>20&&a<160?"left":a>200&&a<340?"right":"center";if(i.verticalAlign===null)i.verticalAlign=a<45||a>315?"bottom":a>135&&a<225?"top":"middle";b.alignDataLabel.call(this,c,d,i,h,f)}else a.call(this,c,d,i,h,f)});w(c,"getCoordinates",function(a,b){var c=this.chart,d={xAxis:[],yAxis:[]};c.polar? s(c.axes,function(a){var f=a.isXAxis,g=a.center,i=b.chartX-g[0]-c.plotLeft,g=b.chartY-g[1]-c.plotTop;d[f?"xAxis":"yAxis"].push({axis:a,value:a.translate(f?Math.PI-Math.atan2(i,g):Math.sqrt(Math.pow(i,2)+Math.pow(g,2)),!0)})}):d=a.call(this,b);return d})})()}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/highcharts/highcharts-more.src.js ================================================ // ==ClosureCompiler== // @compilation_level SIMPLE_OPTIMIZATIONS /** * @license Highcharts JS v4.2.7 (2016-09-21) * * (c) 2009-2016 Torstein Honsi * * License: www.highcharts.com/license */ (function (factory) { if (typeof module === 'object' && module.exports) { module.exports = factory; } else { factory(Highcharts); } }(function (Highcharts) { var arrayMin = Highcharts.arrayMin, arrayMax = Highcharts.arrayMax, each = Highcharts.each, extend = Highcharts.extend, isNumber = Highcharts.isNumber, merge = Highcharts.merge, map = Highcharts.map, pick = Highcharts.pick, pInt = Highcharts.pInt, correctFloat = Highcharts.correctFloat, defaultPlotOptions = Highcharts.getOptions().plotOptions, seriesTypes = Highcharts.seriesTypes, extendClass = Highcharts.extendClass, splat = Highcharts.splat, wrap = Highcharts.wrap, Axis = Highcharts.Axis, Tick = Highcharts.Tick, Point = Highcharts.Point, Pointer = Highcharts.Pointer, CenteredSeriesMixin = Highcharts.CenteredSeriesMixin, TrackerMixin = Highcharts.TrackerMixin, Series = Highcharts.Series, math = Math, mathRound = math.round, mathFloor = math.floor, mathMax = math.max, Color = Highcharts.Color, noop = function () {}, UNDEFINED;/** * The Pane object allows options that are common to a set of X and Y axes. * * In the future, this can be extended to basic Highcharts and Highstock. */ function Pane(options, chart, firstAxis) { this.init(options, chart, firstAxis); } // Extend the Pane prototype extend(Pane.prototype, { /** * Initiate the Pane object */ init: function (options, chart, firstAxis) { var pane = this, backgroundOption, defaultOptions = pane.defaultOptions; pane.chart = chart; // Set options. Angular charts have a default background (#3318) pane.options = options = merge(defaultOptions, chart.angular ? { background: {} } : undefined, options); backgroundOption = options.background; // To avoid having weighty logic to place, update and remove the backgrounds, // push them to the first axis' plot bands and borrow the existing logic there. if (backgroundOption) { each([].concat(splat(backgroundOption)).reverse(), function (config) { var backgroundColor = config.backgroundColor, // if defined, replace the old one (specific for gradients) axisUserOptions = firstAxis.userOptions; config = merge(pane.defaultBackgroundOptions, config); if (backgroundColor) { config.backgroundColor = backgroundColor; } config.color = config.backgroundColor; // due to naming in plotBands firstAxis.options.plotBands.unshift(config); axisUserOptions.plotBands = axisUserOptions.plotBands || []; // #3176 if (axisUserOptions.plotBands !== firstAxis.options.plotBands) { axisUserOptions.plotBands.unshift(config); } }); } }, /** * The default options object */ defaultOptions: { // background: {conditional}, center: ['50%', '50%'], size: '85%', startAngle: 0 //endAngle: startAngle + 360 }, /** * The default background options */ defaultBackgroundOptions: { shape: 'circle', borderWidth: 1, borderColor: 'silver', backgroundColor: { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, stops: [ [0, '#FFF'], [1, '#DDD'] ] }, from: -Number.MAX_VALUE, // corrected to axis min innerRadius: 0, to: Number.MAX_VALUE, // corrected to axis max outerRadius: '105%' } }); var axisProto = Axis.prototype, tickProto = Tick.prototype; /** * Augmented methods for the x axis in order to hide it completely, used for the X axis in gauges */ var hiddenAxisMixin = { getOffset: noop, redraw: function () { this.isDirty = false; // prevent setting Y axis dirty }, render: function () { this.isDirty = false; // prevent setting Y axis dirty }, setScale: noop, setCategories: noop, setTitle: noop }; /** * Augmented methods for the value axis */ var radialAxisMixin = { isRadial: true, /** * The default options extend defaultYAxisOptions */ defaultRadialGaugeOptions: { labels: { align: 'center', x: 0, y: null // auto }, minorGridLineWidth: 0, minorTickInterval: 'auto', minorTickLength: 10, minorTickPosition: 'inside', minorTickWidth: 1, tickLength: 10, tickPosition: 'inside', tickWidth: 2, title: { rotation: 0 }, zIndex: 2 // behind dials, points in the series group }, // Circular axis around the perimeter of a polar chart defaultRadialXOptions: { gridLineWidth: 1, // spokes labels: { align: null, // auto distance: 15, x: 0, y: null // auto }, maxPadding: 0, minPadding: 0, showLastLabel: false, tickLength: 0 }, // Radial axis, like a spoke in a polar chart defaultRadialYOptions: { gridLineInterpolation: 'circle', labels: { align: 'right', x: -3, y: -2 }, showLastLabel: false, title: { x: 4, text: null, rotation: 90 } }, /** * Merge and set options */ setOptions: function (userOptions) { var options = this.options = merge( this.defaultOptions, this.defaultRadialOptions, userOptions ); // Make sure the plotBands array is instanciated for each Axis (#2649) if (!options.plotBands) { options.plotBands = []; } }, /** * Wrap the getOffset method to return zero offset for title or labels in a radial * axis */ getOffset: function () { // Call the Axis prototype method (the method we're in now is on the instance) axisProto.getOffset.call(this); // Title or label offsets are not counted this.chart.axisOffset[this.side] = 0; // Set the center array this.center = this.pane.center = CenteredSeriesMixin.getCenter.call(this.pane); }, /** * Get the path for the axis line. This method is also referenced in the getPlotLinePath * method. */ getLinePath: function (lineWidth, radius) { var center = this.center, end, chart = this.chart, r = pick(radius, center[2] / 2 - this.offset), path; if (this.isCircular || radius !== undefined) { path = this.chart.renderer.symbols.arc( this.left + center[0], this.top + center[1], r, r, { start: this.startAngleRad, end: this.endAngleRad, open: true, innerR: 0 } ); } else { end = this.postTranslate(this.angleRad, r); path = ['M', center[0] + chart.plotLeft, center[1] + chart.plotTop, 'L', end.x, end.y]; } return path; }, /** * Override setAxisTranslation by setting the translation to the difference * in rotation. This allows the translate method to return angle for * any given value. */ setAxisTranslation: function () { // Call uber method axisProto.setAxisTranslation.call(this); // Set transA and minPixelPadding if (this.center) { // it's not defined the first time if (this.isCircular) { this.transA = (this.endAngleRad - this.startAngleRad) / ((this.max - this.min) || 1); } else { this.transA = (this.center[2] / 2) / ((this.max - this.min) || 1); } if (this.isXAxis) { this.minPixelPadding = this.transA * this.minPointOffset; } else { // This is a workaround for regression #2593, but categories still don't position correctly. this.minPixelPadding = 0; } } }, /** * In case of auto connect, add one closestPointRange to the max value right before * tickPositions are computed, so that ticks will extend passed the real max. */ beforeSetTickPositions: function () { // If autoConnect is true, polygonal grid lines are connected, and one closestPointRange // is added to the X axis to prevent the last point from overlapping the first. this.autoConnect = this.isCircular && pick(this.userMax, this.options.max) === undefined && this.endAngleRad - this.startAngleRad === 2 * Math.PI; if (this.autoConnect) { this.max += (this.categories && 1) || this.pointRange || this.closestPointRange || 0; // #1197, #2260 } }, /** * Override the setAxisSize method to use the arc's circumference as length. This * allows tickPixelInterval to apply to pixel lengths along the perimeter */ setAxisSize: function () { axisProto.setAxisSize.call(this); if (this.isRadial) { // Set the center array this.center = this.pane.center = Highcharts.CenteredSeriesMixin.getCenter.call(this.pane); // The sector is used in Axis.translate to compute the translation of reversed axis points (#2570) if (this.isCircular) { this.sector = this.endAngleRad - this.startAngleRad; } // Axis len is used to lay out the ticks this.len = this.width = this.height = this.center[2] * pick(this.sector, 1) / 2; } }, /** * Returns the x, y coordinate of a point given by a value and a pixel distance * from center */ getPosition: function (value, length) { return this.postTranslate( this.isCircular ? this.translate(value) : this.angleRad, // #2848 pick(this.isCircular ? length : this.translate(value), this.center[2] / 2) - this.offset ); }, /** * Translate from intermediate plotX (angle), plotY (axis.len - radius) to final chart coordinates. */ postTranslate: function (angle, radius) { var chart = this.chart, center = this.center; angle = this.startAngleRad + angle; return { x: chart.plotLeft + center[0] + Math.cos(angle) * radius, y: chart.plotTop + center[1] + Math.sin(angle) * radius }; }, /** * Find the path for plot bands along the radial axis */ getPlotBandPath: function (from, to, options) { var center = this.center, startAngleRad = this.startAngleRad, fullRadius = center[2] / 2, radii = [ pick(options.outerRadius, '100%'), options.innerRadius, pick(options.thickness, 10) ], offset = Math.min(this.offset, 0), percentRegex = /%$/, start, end, open, isCircular = this.isCircular, // X axis in a polar chart ret; // Polygonal plot bands if (this.options.gridLineInterpolation === 'polygon') { ret = this.getPlotLinePath(from).concat(this.getPlotLinePath(to, true)); // Circular grid bands } else { // Keep within bounds from = Math.max(from, this.min); to = Math.min(to, this.max); // Plot bands on Y axis (radial axis) - inner and outer radius depend on to and from if (!isCircular) { radii[0] = this.translate(from); radii[1] = this.translate(to); } // Convert percentages to pixel values radii = map(radii, function (radius) { if (percentRegex.test(radius)) { radius = (pInt(radius, 10) * fullRadius) / 100; } return radius; }); // Handle full circle if (options.shape === 'circle' || !isCircular) { start = -Math.PI / 2; end = Math.PI * 1.5; open = true; } else { start = startAngleRad + this.translate(from); end = startAngleRad + this.translate(to); } radii[0] -= offset; // #5283 radii[2] -= offset; // #5283 ret = this.chart.renderer.symbols.arc( this.left + center[0], this.top + center[1], radii[0], radii[0], { start: Math.min(start, end), // Math is for reversed yAxis (#3606) end: Math.max(start, end), innerR: pick(radii[1], radii[0] - radii[2]), open: open } ); } return ret; }, /** * Find the path for plot lines perpendicular to the radial axis. */ getPlotLinePath: function (value, reverse) { var axis = this, center = axis.center, chart = axis.chart, end = axis.getPosition(value), xAxis, xy, tickPositions, ret; // Spokes if (axis.isCircular) { ret = ['M', center[0] + chart.plotLeft, center[1] + chart.plotTop, 'L', end.x, end.y]; // Concentric circles } else if (axis.options.gridLineInterpolation === 'circle') { value = axis.translate(value); if (value) { // a value of 0 is in the center ret = axis.getLinePath(0, value); } // Concentric polygons } else { // Find the X axis in the same pane each(chart.xAxis, function (a) { if (a.pane === axis.pane) { xAxis = a; } }); ret = []; value = axis.translate(value); tickPositions = xAxis.tickPositions; if (xAxis.autoConnect) { tickPositions = tickPositions.concat([tickPositions[0]]); } // Reverse the positions for concatenation of polygonal plot bands if (reverse) { tickPositions = [].concat(tickPositions).reverse(); } each(tickPositions, function (pos, i) { xy = xAxis.getPosition(pos, value); ret.push(i ? 'L' : 'M', xy.x, xy.y); }); } return ret; }, /** * Find the position for the axis title, by default inside the gauge */ getTitlePosition: function () { var center = this.center, chart = this.chart, titleOptions = this.options.title; return { x: chart.plotLeft + center[0] + (titleOptions.x || 0), y: chart.plotTop + center[1] - ({ high: 0.5, middle: 0.25, low: 0 }[titleOptions.align] * center[2]) + (titleOptions.y || 0) }; } }; /** * Override axisProto.init to mix in special axis instance functions and function overrides */ wrap(axisProto, 'init', function (proceed, chart, userOptions) { var axis = this, angular = chart.angular, polar = chart.polar, isX = userOptions.isX, isHidden = angular && isX, isCircular, options, chartOptions = chart.options, paneIndex = userOptions.pane || 0, pane, paneOptions; // Before prototype.init if (angular) { extend(this, isHidden ? hiddenAxisMixin : radialAxisMixin); isCircular = !isX; if (isCircular) { this.defaultRadialOptions = this.defaultRadialGaugeOptions; } } else if (polar) { //extend(this, userOptions.isX ? radialAxisMixin : radialAxisMixin); extend(this, radialAxisMixin); isCircular = isX; this.defaultRadialOptions = isX ? this.defaultRadialXOptions : merge(this.defaultYAxisOptions, this.defaultRadialYOptions); } // Disable certain features on angular and polar axes if (angular || polar) { chart.inverted = false; chartOptions.chart.zoomType = null; } // Run prototype.init proceed.call(this, chart, userOptions); if (!isHidden && (angular || polar)) { options = this.options; // Create the pane and set the pane options. if (!chart.panes) { chart.panes = []; } this.pane = pane = chart.panes[paneIndex] = chart.panes[paneIndex] || new Pane( splat(chartOptions.pane)[paneIndex], chart, axis ); paneOptions = pane.options; // Start and end angle options are // given in degrees relative to top, while internal computations are // in radians relative to right (like SVG). this.angleRad = (options.angle || 0) * Math.PI / 180; // Y axis in polar charts this.startAngleRad = (paneOptions.startAngle - 90) * Math.PI / 180; // Gauges this.endAngleRad = (pick(paneOptions.endAngle, paneOptions.startAngle + 360) - 90) * Math.PI / 180; // Gauges this.offset = options.offset || 0; this.isCircular = isCircular; } }); /** * Wrap auto label align to avoid setting axis-wide rotation on radial axes (#4920) * @param {Function} proceed * @returns {String} Alignment */ wrap(axisProto, 'autoLabelAlign', function (proceed) { if (!this.isRadial) { return proceed.apply(this, [].slice.call(arguments, 1)); } // else return undefined }); /** * Add special cases within the Tick class' methods for radial axes. */ wrap(tickProto, 'getPosition', function (proceed, horiz, pos, tickmarkOffset, old) { var axis = this.axis; return axis.getPosition ? axis.getPosition(pos) : proceed.call(this, horiz, pos, tickmarkOffset, old); }); /** * Wrap the getLabelPosition function to find the center position of the label * based on the distance option */ wrap(tickProto, 'getLabelPosition', function (proceed, x, y, label, horiz, labelOptions, tickmarkOffset, index, step) { var axis = this.axis, optionsY = labelOptions.y, ret, centerSlot = 20, // 20 degrees to each side at the top and bottom align = labelOptions.align, angle = ((axis.translate(this.pos) + axis.startAngleRad + Math.PI / 2) / Math.PI * 180) % 360; if (axis.isRadial) { // Both X and Y axes in a polar chart ret = axis.getPosition(this.pos, (axis.center[2] / 2) + pick(labelOptions.distance, -25)); // Automatically rotated if (labelOptions.rotation === 'auto') { label.attr({ rotation: angle }); // Vertically centered } else if (optionsY === null) { optionsY = axis.chart.renderer.fontMetrics(label.styles.fontSize).b - label.getBBox().height / 2; } // Automatic alignment if (align === null) { if (axis.isCircular) { // Y axis if (this.label.getBBox().width > axis.len * axis.tickInterval / (axis.max - axis.min)) { // #3506 centerSlot = 0; } if (angle > centerSlot && angle < 180 - centerSlot) { align = 'left'; // right hemisphere } else if (angle > 180 + centerSlot && angle < 360 - centerSlot) { align = 'right'; // left hemisphere } else { align = 'center'; // top or bottom } } else { align = 'center'; } label.attr({ align: align }); } ret.x += labelOptions.x; ret.y += optionsY; } else { ret = proceed.call(this, x, y, label, horiz, labelOptions, tickmarkOffset, index, step); } return ret; }); /** * Wrap the getMarkPath function to return the path of the radial marker */ wrap(tickProto, 'getMarkPath', function (proceed, x, y, tickLength, tickWidth, horiz, renderer) { var axis = this.axis, endPoint, ret; if (axis.isRadial) { endPoint = axis.getPosition(this.pos, axis.center[2] / 2 + tickLength); ret = [ 'M', x, y, 'L', endPoint.x, endPoint.y ]; } else { ret = proceed.call(this, x, y, tickLength, tickWidth, horiz, renderer); } return ret; }); /* * The AreaRangeSeries class * */ /** * Extend the default options with map options */ defaultPlotOptions.arearange = merge(defaultPlotOptions.area, { lineWidth: 1, marker: null, threshold: null, tooltip: { pointFormat: '\u25CF {series.name}: {point.low} - {point.high}
          ' }, trackByArea: true, dataLabels: { align: null, verticalAlign: null, xLow: 0, xHigh: 0, yLow: 0, yHigh: 0 }, states: { hover: { halo: false } } }); /** * Add the series type */ seriesTypes.arearange = extendClass(seriesTypes.area, { type: 'arearange', pointArrayMap: ['low', 'high'], dataLabelCollections: ['dataLabel', 'dataLabelUpper'], toYData: function (point) { return [point.low, point.high]; }, pointValKey: 'low', deferTranslatePolar: true, /** * Translate a point's plotHigh from the internal angle and radius measures to * true plotHigh coordinates. This is an addition of the toXY method found in * Polar.js, because it runs too early for arearanges to be considered (#3419). */ highToXY: function (point) { // Find the polar plotX and plotY var chart = this.chart, xy = this.xAxis.postTranslate(point.rectPlotX, this.yAxis.len - point.plotHigh); point.plotHighX = xy.x - chart.plotLeft; point.plotHigh = xy.y - chart.plotTop; }, /** * Translate data points from raw values x and y to plotX and plotY */ translate: function () { var series = this, yAxis = series.yAxis; seriesTypes.area.prototype.translate.apply(series); // Set plotLow and plotHigh each(series.points, function (point) { var low = point.low, high = point.high, plotY = point.plotY; if (high === null || low === null) { point.isNull = true; } else { point.plotLow = plotY; point.plotHigh = yAxis.translate(high, 0, 1, 0, 1); } }); // Postprocess plotHigh if (this.chart.polar) { each(this.points, function (point) { series.highToXY(point); }); } }, /** * Extend the line series' getSegmentPath method by applying the segment * path to both lower and higher values of the range */ getGraphPath: function (points) { var highPoints = [], highAreaPoints = [], i, getGraphPath = seriesTypes.area.prototype.getGraphPath, point, pointShim, linePath, lowerPath, options = this.options, step = options.step, higherPath, higherAreaPath; points = points || this.points; i = points.length; // Create the top line and the top part of the area fill. The area fill compensates for // null points by drawing down to the lower graph, moving across the null gap and // starting again at the lower graph. i = points.length; while (i--) { point = points[i]; if (!point.isNull && !options.connectEnds && (!points[i + 1] || points[i + 1].isNull)) { highAreaPoints.push({ plotX: point.plotX, plotY: point.plotY, doCurve: false // #5186, gaps in areasplinerange fill }); } pointShim = { polarPlotY: point.polarPlotY, rectPlotX: point.rectPlotX, yBottom: point.yBottom, plotX: pick(point.plotHighX, point.plotX), // plotHighX is for polar charts plotY: point.plotHigh, isNull: point.isNull }; highAreaPoints.push(pointShim); highPoints.push(pointShim); if (!point.isNull && !options.connectEnds && (!points[i - 1] || points[i - 1].isNull)) { highAreaPoints.push({ plotX: point.plotX, plotY: point.plotY, doCurve: false // #5186, gaps in areasplinerange fill }); } } // Get the paths lowerPath = getGraphPath.call(this, points); if (step) { if (step === true) { step = 'left'; } options.step = { left: 'right', center: 'center', right: 'left' }[step]; // swap for reading in getGraphPath } higherPath = getGraphPath.call(this, highPoints); higherAreaPath = getGraphPath.call(this, highAreaPoints); options.step = step; // Create a line on both top and bottom of the range linePath = [].concat(lowerPath, higherPath); // For the area path, we need to change the 'move' statement into 'lineTo' or 'curveTo' if (!this.chart.polar && higherAreaPath[0] === 'M') { higherAreaPath[0] = 'L'; // this probably doesn't work for spline } this.graphPath = linePath; this.areaPath = this.areaPath.concat(lowerPath, higherAreaPath); // Prepare for sideways animation linePath.isArea = true; linePath.xMap = lowerPath.xMap; this.areaPath.xMap = lowerPath.xMap; return linePath; }, /** * Extend the basic drawDataLabels method by running it for both lower and higher * values. */ drawDataLabels: function () { var data = this.data, length = data.length, i, originalDataLabels = [], seriesProto = Series.prototype, dataLabelOptions = this.options.dataLabels, align = dataLabelOptions.align, verticalAlign = dataLabelOptions.verticalAlign, inside = dataLabelOptions.inside, point, up, inverted = this.chart.inverted; if (dataLabelOptions.enabled || this._hasPointLabels) { // Step 1: set preliminary values for plotY and dataLabel and draw the upper labels i = length; while (i--) { point = data[i]; if (point) { up = inside ? point.plotHigh < point.plotLow : point.plotHigh > point.plotLow; // Set preliminary values point.y = point.high; point._plotY = point.plotY; point.plotY = point.plotHigh; // Store original data labels and set preliminary label objects to be picked up // in the uber method originalDataLabels[i] = point.dataLabel; point.dataLabel = point.dataLabelUpper; // Set the default offset point.below = up; if (inverted) { if (!align) { dataLabelOptions.align = up ? 'right' : 'left'; } } else { if (!verticalAlign) { dataLabelOptions.verticalAlign = up ? 'top' : 'bottom'; } } dataLabelOptions.x = dataLabelOptions.xHigh; dataLabelOptions.y = dataLabelOptions.yHigh; } } if (seriesProto.drawDataLabels) { seriesProto.drawDataLabels.apply(this, arguments); // #1209 } // Step 2: reorganize and handle data labels for the lower values i = length; while (i--) { point = data[i]; if (point) { up = inside ? point.plotHigh < point.plotLow : point.plotHigh > point.plotLow; // Move the generated labels from step 1, and reassign the original data labels point.dataLabelUpper = point.dataLabel; point.dataLabel = originalDataLabels[i]; // Reset values point.y = point.low; point.plotY = point._plotY; // Set the default offset point.below = !up; if (inverted) { if (!align) { dataLabelOptions.align = up ? 'left' : 'right'; } } else { if (!verticalAlign) { dataLabelOptions.verticalAlign = up ? 'bottom' : 'top'; } } dataLabelOptions.x = dataLabelOptions.xLow; dataLabelOptions.y = dataLabelOptions.yLow; } } if (seriesProto.drawDataLabels) { seriesProto.drawDataLabels.apply(this, arguments); } } dataLabelOptions.align = align; dataLabelOptions.verticalAlign = verticalAlign; }, alignDataLabel: function () { seriesTypes.column.prototype.alignDataLabel.apply(this, arguments); }, setStackedPoints: noop, getSymbol: noop, drawPoints: noop }); /** * The AreaSplineRangeSeries class */ defaultPlotOptions.areasplinerange = merge(defaultPlotOptions.arearange); /** * AreaSplineRangeSeries object */ seriesTypes.areasplinerange = extendClass(seriesTypes.arearange, { type: 'areasplinerange', getPointSpline: seriesTypes.spline.prototype.getPointSpline }); (function () { var colProto = seriesTypes.column.prototype; /** * The ColumnRangeSeries class */ defaultPlotOptions.columnrange = merge(defaultPlotOptions.column, defaultPlotOptions.arearange, { lineWidth: 1, pointRange: null }); /** * ColumnRangeSeries object */ seriesTypes.columnrange = extendClass(seriesTypes.arearange, { type: 'columnrange', /** * Translate data points from raw values x and y to plotX and plotY */ translate: function () { var series = this, yAxis = series.yAxis, xAxis = series.xAxis, startAngleRad = xAxis.startAngleRad, start, chart = series.chart, isRadial = series.xAxis.isRadial, plotHigh; colProto.translate.apply(series); // Set plotLow and plotHigh each(series.points, function (point) { var shapeArgs = point.shapeArgs, minPointLength = series.options.minPointLength, heightDifference, height, y; point.plotHigh = plotHigh = yAxis.translate(point.high, 0, 1, 0, 1); point.plotLow = point.plotY; // adjust shape y = plotHigh; height = pick(point.rectPlotY, point.plotY) - plotHigh; // Adjust for minPointLength if (Math.abs(height) < minPointLength) { heightDifference = (minPointLength - height); height += heightDifference; y -= heightDifference / 2; // Adjust for negative ranges or reversed Y axis (#1457) } else if (height < 0) { height *= -1; y -= height; } if (isRadial) { start = point.barX + startAngleRad; point.shapeType = 'path'; point.shapeArgs = { d: series.polarArc(y + height, y, start, start + point.pointWidth) }; } else { shapeArgs.height = height; shapeArgs.y = y; point.tooltipPos = chart.inverted ? [ yAxis.len + yAxis.pos - chart.plotLeft - y - height / 2, xAxis.len + xAxis.pos - chart.plotTop - shapeArgs.x - shapeArgs.width / 2, height ] : [ xAxis.left - chart.plotLeft + shapeArgs.x + shapeArgs.width / 2, yAxis.pos - chart.plotTop + y + height / 2, height ]; // don't inherit from column tooltip position - #3372 } }); }, directTouch: true, trackerGroups: ['group', 'dataLabelsGroup'], drawGraph: noop, crispCol: colProto.crispCol, pointAttrToOptions: colProto.pointAttrToOptions, drawPoints: colProto.drawPoints, drawTracker: colProto.drawTracker, getColumnMetrics: colProto.getColumnMetrics, animate: function () { return colProto.animate.apply(this, arguments); }, polarArc: function () { return colProto.polarArc.apply(this, arguments); } }); }()); /* * The GaugeSeries class */ /** * Extend the default options */ defaultPlotOptions.gauge = merge(defaultPlotOptions.line, { dataLabels: { enabled: true, defer: false, y: 15, borderWidth: 1, borderColor: 'silver', borderRadius: 3, crop: false, verticalAlign: 'top', zIndex: 2 }, dial: { // radius: '80%', // backgroundColor: 'black', // borderColor: 'silver', // borderWidth: 0, // baseWidth: 3, // topWidth: 1, // baseLength: '70%' // of radius // rearLength: '10%' }, pivot: { //radius: 5, //borderWidth: 0 //borderColor: 'silver', //backgroundColor: 'black' }, tooltip: { headerFormat: '' }, showInLegend: false }); /** * Extend the point object */ var GaugePoint = extendClass(Point, { /** * Don't do any hover colors or anything */ setState: function (state) { this.state = state; } }); /** * Add the series type */ var GaugeSeries = { type: 'gauge', pointClass: GaugePoint, // chart.angular will be set to true when a gauge series is present, and this will // be used on the axes angular: true, directTouch: true, // #5063 drawGraph: noop, fixedBox: true, forceDL: true, noSharedTooltip: true, trackerGroups: ['group', 'dataLabelsGroup'], /** * Calculate paths etc */ translate: function () { var series = this, yAxis = series.yAxis, options = series.options, center = yAxis.center; series.generatePoints(); each(series.points, function (point) { var dialOptions = merge(options.dial, point.dial), radius = (pInt(pick(dialOptions.radius, 80)) * center[2]) / 200, baseLength = (pInt(pick(dialOptions.baseLength, 70)) * radius) / 100, rearLength = (pInt(pick(dialOptions.rearLength, 10)) * radius) / 100, baseWidth = dialOptions.baseWidth || 3, topWidth = dialOptions.topWidth || 1, overshoot = options.overshoot, rotation = yAxis.startAngleRad + yAxis.translate(point.y, null, null, null, true); // Handle the wrap and overshoot options if (isNumber(overshoot)) { overshoot = overshoot / 180 * Math.PI; rotation = Math.max(yAxis.startAngleRad - overshoot, Math.min(yAxis.endAngleRad + overshoot, rotation)); } else if (options.wrap === false) { rotation = Math.max(yAxis.startAngleRad, Math.min(yAxis.endAngleRad, rotation)); } rotation = rotation * 180 / Math.PI; point.shapeType = 'path'; point.shapeArgs = { d: dialOptions.path || [ 'M', -rearLength, -baseWidth / 2, 'L', baseLength, -baseWidth / 2, radius, -topWidth / 2, radius, topWidth / 2, baseLength, baseWidth / 2, -rearLength, baseWidth / 2, 'z' ], translateX: center[0], translateY: center[1], rotation: rotation }; // Positions for data label point.plotX = center[0]; point.plotY = center[1]; }); }, /** * Draw the points where each point is one needle */ drawPoints: function () { var series = this, center = series.yAxis.center, pivot = series.pivot, options = series.options, pivotOptions = options.pivot, renderer = series.chart.renderer; each(series.points, function (point) { var graphic = point.graphic, shapeArgs = point.shapeArgs, d = shapeArgs.d, dialOptions = merge(options.dial, point.dial); // #1233 if (graphic) { graphic.animate(shapeArgs); shapeArgs.d = d; // animate alters it } else { point.graphic = renderer[point.shapeType](shapeArgs) .attr({ stroke: dialOptions.borderColor || 'none', 'stroke-width': dialOptions.borderWidth || 0, fill: dialOptions.backgroundColor || 'black', rotation: shapeArgs.rotation, // required by VML when animation is false zIndex: 1 }) .add(series.group); } }); // Add or move the pivot if (pivot) { pivot.animate({ // #1235 translateX: center[0], translateY: center[1] }); } else { series.pivot = renderer.circle(0, 0, pick(pivotOptions.radius, 5)) .attr({ 'stroke-width': pivotOptions.borderWidth || 0, stroke: pivotOptions.borderColor || 'silver', fill: pivotOptions.backgroundColor || 'black', zIndex: 2 }) .translate(center[0], center[1]) .add(series.group); } }, /** * Animate the arrow up from startAngle */ animate: function (init) { var series = this; if (!init) { each(series.points, function (point) { var graphic = point.graphic; if (graphic) { // start value graphic.attr({ rotation: series.yAxis.startAngleRad * 180 / Math.PI }); // animate graphic.animate({ rotation: point.shapeArgs.rotation }, series.options.animation); } }); // delete this function to allow it only once series.animate = null; } }, render: function () { this.group = this.plotGroup( 'group', 'series', this.visible ? 'visible' : 'hidden', this.options.zIndex, this.chart.seriesGroup ); Series.prototype.render.call(this); this.group.clip(this.chart.clipRect); }, /** * Extend the basic setData method by running processData and generatePoints immediately, * in order to access the points from the legend. */ setData: function (data, redraw) { Series.prototype.setData.call(this, data, false); this.processData(); this.generatePoints(); if (pick(redraw, true)) { this.chart.redraw(); } }, /** * If the tracking module is loaded, add the point tracker */ drawTracker: TrackerMixin && TrackerMixin.drawTrackerPoint }; seriesTypes.gauge = extendClass(seriesTypes.line, GaugeSeries); /* **************************************************************************** * Start Box plot series code * *****************************************************************************/ // Set default options defaultPlotOptions.boxplot = merge(defaultPlotOptions.column, { fillColor: '#FFFFFF', lineWidth: 1, //medianColor: null, medianWidth: 2, states: { hover: { brightness: -0.3 } }, //stemColor: null, //stemDashStyle: 'solid' //stemWidth: null, threshold: null, tooltip: { pointFormat: '\u25CF {series.name}
          ' + 'Maximum: {point.high}
          ' + 'Upper quartile: {point.q3}
          ' + 'Median: {point.median}
          ' + 'Lower quartile: {point.q1}
          ' + 'Minimum: {point.low}
          ' }, //whiskerColor: null, whiskerLength: '50%', whiskerWidth: 2 }); // Create the series object seriesTypes.boxplot = extendClass(seriesTypes.column, { type: 'boxplot', pointArrayMap: ['low', 'q1', 'median', 'q3', 'high'], // array point configs are mapped to this toYData: function (point) { // return a plain array for speedy calculation return [point.low, point.q1, point.median, point.q3, point.high]; }, pointValKey: 'high', // defines the top of the tracker /** * One-to-one mapping from options to SVG attributes */ pointAttrToOptions: { // mapping between SVG attributes and the corresponding options fill: 'fillColor', stroke: 'color', 'stroke-width': 'lineWidth' }, /** * Disable data labels for box plot */ drawDataLabels: noop, /** * Translate data points from raw values x and y to plotX and plotY */ translate: function () { var series = this, yAxis = series.yAxis, pointArrayMap = series.pointArrayMap; seriesTypes.column.prototype.translate.apply(series); // do the translation on each point dimension each(series.points, function (point) { each(pointArrayMap, function (key) { if (point[key] !== null) { point[key + 'Plot'] = yAxis.translate(point[key], 0, 1, 0, 1); } }); }); }, /** * Draw the data points */ drawPoints: function () { var series = this, //state = series.state, points = series.points, options = series.options, chart = series.chart, renderer = chart.renderer, pointAttr, q1Plot, q3Plot, highPlot, lowPlot, medianPlot, crispCorr, crispX, graphic, stemPath, stemAttr, boxPath, whiskersPath, whiskersAttr, medianPath, medianAttr, width, left, right, halfWidth, shapeArgs, color, doQuartiles = series.doQuartiles !== false, // error bar inherits this series type but doesn't do quartiles pointWiskerLength, whiskerLength = series.options.whiskerLength; each(points, function (point) { graphic = point.graphic; shapeArgs = point.shapeArgs; // the box stemAttr = {}; whiskersAttr = {}; medianAttr = {}; color = point.color || series.color; if (point.plotY !== UNDEFINED) { pointAttr = point.pointAttr[point.selected ? 'selected' : '']; // crisp vector coordinates width = shapeArgs.width; left = mathFloor(shapeArgs.x); right = left + width; halfWidth = mathRound(width / 2); //crispX = mathRound(left + halfWidth) + crispCorr; q1Plot = mathFloor(doQuartiles ? point.q1Plot : point.lowPlot);// + crispCorr; q3Plot = mathFloor(doQuartiles ? point.q3Plot : point.lowPlot);// + crispCorr; highPlot = mathFloor(point.highPlot);// + crispCorr; lowPlot = mathFloor(point.lowPlot);// + crispCorr; // Stem attributes stemAttr.stroke = point.stemColor || options.stemColor || color; stemAttr['stroke-width'] = pick(point.stemWidth, options.stemWidth, options.lineWidth); stemAttr.dashstyle = point.stemDashStyle || options.stemDashStyle; // Whiskers attributes whiskersAttr.stroke = point.whiskerColor || options.whiskerColor || color; whiskersAttr['stroke-width'] = pick(point.whiskerWidth, options.whiskerWidth, options.lineWidth); // Median attributes medianAttr.stroke = point.medianColor || options.medianColor || color; medianAttr['stroke-width'] = pick(point.medianWidth, options.medianWidth, options.lineWidth); // The stem crispCorr = (stemAttr['stroke-width'] % 2) / 2; crispX = left + halfWidth + crispCorr; stemPath = [ // stem up 'M', crispX, q3Plot, 'L', crispX, highPlot, // stem down 'M', crispX, q1Plot, 'L', crispX, lowPlot ]; // The box if (doQuartiles) { crispCorr = (pointAttr['stroke-width'] % 2) / 2; crispX = mathFloor(crispX) + crispCorr; q1Plot = mathFloor(q1Plot) + crispCorr; q3Plot = mathFloor(q3Plot) + crispCorr; left += crispCorr; right += crispCorr; boxPath = [ 'M', left, q3Plot, 'L', left, q1Plot, 'L', right, q1Plot, 'L', right, q3Plot, 'L', left, q3Plot, 'z' ]; } // The whiskers if (whiskerLength) { crispCorr = (whiskersAttr['stroke-width'] % 2) / 2; highPlot = highPlot + crispCorr; lowPlot = lowPlot + crispCorr; pointWiskerLength = (/%$/).test(whiskerLength) ? halfWidth * parseFloat(whiskerLength) / 100 : whiskerLength / 2; whiskersPath = [ // High whisker 'M', crispX - pointWiskerLength, highPlot, 'L', crispX + pointWiskerLength, highPlot, // Low whisker 'M', crispX - pointWiskerLength, lowPlot, 'L', crispX + pointWiskerLength, lowPlot ]; } // The median crispCorr = (medianAttr['stroke-width'] % 2) / 2; medianPlot = mathRound(point.medianPlot) + crispCorr; medianPath = [ 'M', left, medianPlot, 'L', right, medianPlot ]; // Create or update the graphics if (graphic) { // update point.stem.animate({ d: stemPath }); if (whiskerLength) { point.whiskers.animate({ d: whiskersPath }); } if (doQuartiles) { point.box.animate({ d: boxPath }); } point.medianShape.animate({ d: medianPath }); } else { // create new point.graphic = graphic = renderer.g() .add(series.group); point.stem = renderer.path(stemPath) .attr(stemAttr) .add(graphic); if (whiskerLength) { point.whiskers = renderer.path(whiskersPath) .attr(whiskersAttr) .add(graphic); } if (doQuartiles) { point.box = renderer.path(boxPath) .attr(pointAttr) .add(graphic); } point.medianShape = renderer.path(medianPath) .attr(medianAttr) .add(graphic); } } }); }, setStackedPoints: noop // #3890 }); /* **************************************************************************** * End Box plot series code * *****************************************************************************/ /* **************************************************************************** * Start error bar series code * *****************************************************************************/ // 1 - set default options defaultPlotOptions.errorbar = merge(defaultPlotOptions.boxplot, { color: '#000000', grouping: false, linkedTo: ':previous', tooltip: { pointFormat: '\u25CF {series.name}: {point.low} - {point.high}
          ' }, whiskerWidth: null }); // 2 - Create the series object seriesTypes.errorbar = extendClass(seriesTypes.boxplot, { type: 'errorbar', pointArrayMap: ['low', 'high'], // array point configs are mapped to this toYData: function (point) { // return a plain array for speedy calculation return [point.low, point.high]; }, pointValKey: 'high', // defines the top of the tracker doQuartiles: false, drawDataLabels: seriesTypes.arearange ? function () { var valKey = this.pointValKey; seriesTypes.arearange.prototype.drawDataLabels.call(this); // Arearange drawDataLabels does not reset point.y to high, but to low after drawing. #4133 each(this.data, function (point) { point.y = point[valKey]; }); } : noop, /** * Get the width and X offset, either on top of the linked series column * or standalone */ getColumnMetrics: function () { return (this.linkedParent && this.linkedParent.columnMetrics) || seriesTypes.column.prototype.getColumnMetrics.call(this); } }); /* **************************************************************************** * End error bar series code * *****************************************************************************/ /* **************************************************************************** * Start Waterfall series code * *****************************************************************************/ // 1 - set default options defaultPlotOptions.waterfall = merge(defaultPlotOptions.column, { lineWidth: 1, lineColor: '#333', dashStyle: 'dot', borderColor: '#333', dataLabels: { inside: true }, states: { hover: { lineWidthPlus: 0 // #3126 } } }); // 2 - Create the series object seriesTypes.waterfall = extendClass(seriesTypes.column, { type: 'waterfall', upColorProp: 'fill', pointValKey: 'y', /** * Pass the null test in ColumnSeries.translate. */ pointClass: extendClass(Point, { isValid: function () { return isNumber(this.y, true) || this.isSum || this.isIntermediateSum; } }), /** * Translate data points from raw values */ translate: function () { var series = this, options = series.options, yAxis = series.yAxis, len, i, points, point, shapeArgs, stack, y, yValue, previousY, previousIntermediate, range, minPointLength = pick(options.minPointLength, 5), threshold = options.threshold, stacking = options.stacking, tooltipY; // run column series translate seriesTypes.column.prototype.translate.apply(this); series.minPointLengthOffset = 0; previousY = previousIntermediate = threshold; points = series.points; for (i = 0, len = points.length; i < len; i++) { // cache current point object point = points[i]; yValue = this.processedYData[i]; shapeArgs = point.shapeArgs; // get current stack stack = stacking && yAxis.stacks[(series.negStacks && yValue < threshold ? '-' : '') + series.stackKey]; range = stack ? stack[point.x].points[series.index + ',' + i] : [0, yValue]; // override point value for sums // #3710 Update point does not propagate to sum if (point.isSum) { point.y = correctFloat(yValue); } else if (point.isIntermediateSum) { point.y = correctFloat(yValue - previousIntermediate); // #3840 } // up points y = mathMax(previousY, previousY + point.y) + range[0]; shapeArgs.y = yAxis.toPixels(y, true); // sum points if (point.isSum) { shapeArgs.y = yAxis.toPixels(range[1], true); shapeArgs.height = Math.min(yAxis.toPixels(range[0], true), yAxis.len) - shapeArgs.y + series.minPointLengthOffset; // #4256 } else if (point.isIntermediateSum) { shapeArgs.y = yAxis.toPixels(range[1], true); shapeArgs.height = Math.min(yAxis.toPixels(previousIntermediate, true), yAxis.len) - shapeArgs.y + series.minPointLengthOffset; previousIntermediate = range[1]; // If it's not the sum point, update previous stack end position and get // shape height (#3886) } else { shapeArgs.height = yValue > 0 ? yAxis.toPixels(previousY, true) - shapeArgs.y : yAxis.toPixels(previousY, true) - yAxis.toPixels(previousY - yValue, true); previousY += yValue; } // #3952 Negative sum or intermediate sum not rendered correctly if (shapeArgs.height < 0) { shapeArgs.y += shapeArgs.height; shapeArgs.height *= -1; } point.plotY = shapeArgs.y = mathRound(shapeArgs.y) - (series.borderWidth % 2) / 2; shapeArgs.height = mathMax(mathRound(shapeArgs.height), 0.001); // #3151 point.yBottom = shapeArgs.y + shapeArgs.height; if (shapeArgs.height <= minPointLength) { shapeArgs.height = minPointLength; series.minPointLengthOffset += minPointLength; } shapeArgs.y -= series.minPointLengthOffset; // Correct tooltip placement (#3014) tooltipY = point.plotY + (point.negative ? shapeArgs.height : 0) - series.minPointLengthOffset; if (series.chart.inverted) { point.tooltipPos[0] = yAxis.len - tooltipY; } else { point.tooltipPos[1] = tooltipY; } } }, /** * Call default processData then override yData to reflect waterfall's extremes on yAxis */ processData: function (force) { var series = this, options = series.options, yData = series.yData, points = series.options.data, // #3710 Update point does not propagate to sum point, dataLength = yData.length, threshold = options.threshold || 0, subSum, sum, dataMin, dataMax, y, i; sum = subSum = dataMin = dataMax = threshold; for (i = 0; i < dataLength; i++) { y = yData[i]; point = points && points[i] ? points[i] : {}; if (y === 'sum' || point.isSum) { yData[i] = correctFloat(sum); } else if (y === 'intermediateSum' || point.isIntermediateSum) { yData[i] = correctFloat(subSum); } else { sum += y; subSum += y; } dataMin = Math.min(sum, dataMin); dataMax = Math.max(sum, dataMax); } Series.prototype.processData.call(this, force); // Record extremes series.dataMin = dataMin; series.dataMax = dataMax; }, /** * Return y value or string if point is sum */ toYData: function (pt) { if (pt.isSum) { return (pt.x === 0 ? null : 'sum'); //#3245 Error when first element is Sum or Intermediate Sum } if (pt.isIntermediateSum) { return (pt.x === 0 ? null : 'intermediateSum'); //#3245 } return pt.y; }, /** * Postprocess mapping between options and SVG attributes */ getAttribs: function () { seriesTypes.column.prototype.getAttribs.apply(this, arguments); var series = this, options = series.options, stateOptions = options.states, upColor = options.upColor || series.color, hoverColor = Highcharts.Color(upColor).brighten(options.states.hover.brightness).get(), seriesDownPointAttr = merge(series.pointAttr), upColorProp = series.upColorProp; seriesDownPointAttr[''][upColorProp] = upColor; seriesDownPointAttr.hover[upColorProp] = stateOptions.hover.upColor || hoverColor; seriesDownPointAttr.select[upColorProp] = stateOptions.select.upColor || upColor; each(series.points, function (point) { if (!point.options.color) { // Up color if (point.y > 0) { point.pointAttr = seriesDownPointAttr; point.color = upColor; // Down color (#3710, update to negative) } else { point.pointAttr = series.pointAttr; } } }); }, /** * Draw columns' connector lines */ getGraphPath: function () { var data = this.data, length = data.length, lineWidth = this.options.lineWidth + this.borderWidth, normalizer = mathRound(lineWidth) % 2 / 2, path = [], M = 'M', L = 'L', prevArgs, pointArgs, i, d; for (i = 1; i < length; i++) { pointArgs = data[i].shapeArgs; prevArgs = data[i - 1].shapeArgs; d = [ M, prevArgs.x + prevArgs.width, prevArgs.y + normalizer, L, pointArgs.x, prevArgs.y + normalizer ]; if (data[i - 1].y < 0) { d[2] += prevArgs.height; d[5] += prevArgs.height; } path = path.concat(d); } return path; }, /** * Extremes are recorded in processData */ getExtremes: noop, drawGraph: Series.prototype.drawGraph }); /* **************************************************************************** * End Waterfall series code * *****************************************************************************/ /** * Set the default options for polygon */ defaultPlotOptions.polygon = merge(defaultPlotOptions.scatter, { marker: { enabled: false, states: { hover: { enabled: false } } }, stickyTracking: false, tooltip: { followPointer: true, pointFormat: '' }, trackByArea: true }); /** * The polygon series class */ seriesTypes.polygon = extendClass(seriesTypes.scatter, { type: 'polygon', getGraphPath: function () { var graphPath = Series.prototype.getGraphPath.call(this), i = graphPath.length + 1; // Close all segments while (i--) { if ((i === graphPath.length || graphPath[i] === 'M') && i > 0) { graphPath.splice(i, 0, 'z'); } } this.areaPath = graphPath; return graphPath; }, drawGraph: function () { this.options.fillColor = this.color; // Hack into the fill logic in area.drawGraph seriesTypes.area.prototype.drawGraph.call(this); }, drawLegendSymbol: Highcharts.LegendSymbolMixin.drawRectangle, drawTracker: Series.prototype.drawTracker, setStackedPoints: noop // No stacking points on polygons (#5310) }); /* **************************************************************************** * Start Bubble series code * *****************************************************************************/ // 1 - set default options defaultPlotOptions.bubble = merge(defaultPlotOptions.scatter, { dataLabels: { formatter: function () { // #2945 return this.point.z; }, inside: true, verticalAlign: 'middle' }, // displayNegative: true, marker: { // fillOpacity: 0.5, lineColor: null, // inherit from series.color lineWidth: 1 }, minSize: 8, maxSize: '20%', // negativeColor: null, // sizeBy: 'area' softThreshold: false, states: { hover: { halo: { size: 5 } } }, tooltip: { pointFormat: '({point.x}, {point.y}), Size: {point.z}' }, turboThreshold: 0, zThreshold: 0, zoneAxis: 'z' }); var BubblePoint = extendClass(Point, { haloPath: function () { return Point.prototype.haloPath.call(this, this.shapeArgs.r + this.series.options.states.hover.halo.size); }, ttBelow: false }); // 2 - Create the series object seriesTypes.bubble = extendClass(seriesTypes.scatter, { type: 'bubble', pointClass: BubblePoint, pointArrayMap: ['y', 'z'], parallelArrays: ['x', 'y', 'z'], trackerGroups: ['group', 'dataLabelsGroup'], bubblePadding: true, zoneAxis: 'z', /** * Mapping between SVG attributes and the corresponding options */ pointAttrToOptions: { stroke: 'lineColor', 'stroke-width': 'lineWidth', fill: 'fillColor' }, /** * Apply the fillOpacity to all fill positions */ applyOpacity: function (fill) { var markerOptions = this.options.marker, fillOpacity = pick(markerOptions.fillOpacity, 0.5); // When called from Legend.colorizeItem, the fill isn't predefined fill = fill || markerOptions.fillColor || this.color; if (fillOpacity !== 1) { fill = Color(fill).setOpacity(fillOpacity).get('rgba'); } return fill; }, /** * Extend the convertAttribs method by applying opacity to the fill */ convertAttribs: function () { var obj = Series.prototype.convertAttribs.apply(this, arguments); obj.fill = this.applyOpacity(obj.fill); return obj; }, /** * Get the radius for each point based on the minSize, maxSize and each point's Z value. This * must be done prior to Series.translate because the axis needs to add padding in * accordance with the point sizes. */ getRadii: function (zMin, zMax, minSize, maxSize) { var len, i, pos, zData = this.zData, radii = [], options = this.options, sizeByArea = options.sizeBy !== 'width', zThreshold = options.zThreshold, zRange = zMax - zMin, value, radius; // Set the shape type and arguments to be picked up in drawPoints for (i = 0, len = zData.length; i < len; i++) { value = zData[i]; // When sizing by threshold, the absolute value of z determines the size // of the bubble. if (options.sizeByAbsoluteValue && value !== null) { value = Math.abs(value - zThreshold); zMax = Math.max(zMax - zThreshold, Math.abs(zMin - zThreshold)); zMin = 0; } if (value === null) { radius = null; // Issue #4419 - if value is less than zMin, push a radius that's always smaller than the minimum size } else if (value < zMin) { radius = minSize / 2 - 1; } else { // Relative size, a number between 0 and 1 pos = zRange > 0 ? (value - zMin) / zRange : 0.5; if (sizeByArea && pos >= 0) { pos = Math.sqrt(pos); } radius = math.ceil(minSize + pos * (maxSize - minSize)) / 2; } radii.push(radius); } this.radii = radii; }, /** * Perform animation on the bubbles */ animate: function (init) { var animation = this.options.animation; if (!init) { // run the animation each(this.points, function (point) { var graphic = point.graphic, shapeArgs = point.shapeArgs; if (graphic && shapeArgs) { // start values graphic.attr('r', 1); // animate graphic.animate({ r: shapeArgs.r }, animation); } }); // delete this function to allow it only once this.animate = null; } }, /** * Extend the base translate method to handle bubble size */ translate: function () { var i, data = this.data, point, radius, radii = this.radii; // Run the parent method seriesTypes.scatter.prototype.translate.call(this); // Set the shape type and arguments to be picked up in drawPoints i = data.length; while (i--) { point = data[i]; radius = radii ? radii[i] : 0; // #1737 if (isNumber(radius) && radius >= this.minPxSize / 2) { // Shape arguments point.shapeType = 'circle'; point.shapeArgs = { x: point.plotX, y: point.plotY, r: radius }; // Alignment box for the data label point.dlBox = { x: point.plotX - radius, y: point.plotY - radius, width: 2 * radius, height: 2 * radius }; } else { // below zThreshold or z = null point.shapeArgs = point.plotY = point.dlBox = UNDEFINED; // #1691 } } }, /** * Get the series' symbol in the legend * * @param {Object} legend The legend object * @param {Object} item The series (this) or point */ drawLegendSymbol: function (legend, item) { var renderer = this.chart.renderer, radius = renderer.fontMetrics(legend.itemStyle.fontSize).f / 2; item.legendSymbol = renderer.circle( radius, legend.baseline - radius, radius ).attr({ zIndex: 3 }).add(item.legendGroup); item.legendSymbol.isMarker = true; }, drawPoints: seriesTypes.column.prototype.drawPoints, alignDataLabel: seriesTypes.column.prototype.alignDataLabel, buildKDTree: noop, applyZones: noop }); /** * Add logic to pad each axis with the amount of pixels * necessary to avoid the bubbles to overflow. */ Axis.prototype.beforePadding = function () { var axis = this, axisLength = this.len, chart = this.chart, pxMin = 0, pxMax = axisLength, isXAxis = this.isXAxis, dataKey = isXAxis ? 'xData' : 'yData', min = this.min, extremes = {}, smallestSize = math.min(chart.plotWidth, chart.plotHeight), zMin = Number.MAX_VALUE, zMax = -Number.MAX_VALUE, range = this.max - min, transA = axisLength / range, activeSeries = []; // Handle padding on the second pass, or on redraw each(this.series, function (series) { var seriesOptions = series.options, zData; if (series.bubblePadding && (series.visible || !chart.options.chart.ignoreHiddenSeries)) { // Correction for #1673 axis.allowZoomOutside = true; // Cache it activeSeries.push(series); if (isXAxis) { // because X axis is evaluated first // For each series, translate the size extremes to pixel values each(['minSize', 'maxSize'], function (prop) { var length = seriesOptions[prop], isPercent = /%$/.test(length); length = pInt(length); extremes[prop] = isPercent ? smallestSize * length / 100 : length; }); series.minPxSize = extremes.minSize; series.maxPxSize = extremes.maxSize; // Find the min and max Z zData = series.zData; if (zData.length) { // #1735 zMin = pick(seriesOptions.zMin, math.min( zMin, math.max( arrayMin(zData), seriesOptions.displayNegative === false ? seriesOptions.zThreshold : -Number.MAX_VALUE ) )); zMax = pick(seriesOptions.zMax, math.max(zMax, arrayMax(zData))); } } } }); each(activeSeries, function (series) { var data = series[dataKey], i = data.length, radius; if (isXAxis) { series.getRadii(zMin, zMax, series.minPxSize, series.maxPxSize); } if (range > 0) { while (i--) { if (isNumber(data[i]) && axis.dataMin <= data[i] && data[i] <= axis.dataMax) { radius = series.radii[i]; pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin); pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax); } } } }); if (activeSeries.length && range > 0 && !this.isLog) { pxMax -= axisLength; transA *= (axisLength + pxMin - pxMax) / axisLength; each([['min', 'userMin', pxMin], ['max', 'userMax', pxMax]], function (keys) { if (pick(axis.options[keys[0]], axis[keys[1]]) === UNDEFINED) { axis[keys[0]] += keys[2] / transA; } }); } }; /* **************************************************************************** * End Bubble series code * *****************************************************************************/ (function () { /** * Extensions for polar charts. Additionally, much of the geometry required for polar charts is * gathered in RadialAxes.js. * */ var seriesProto = Series.prototype, pointerProto = Pointer.prototype, colProto; /** * Search a k-d tree by the point angle, used for shared tooltips in polar charts */ seriesProto.searchPointByAngle = function (e) { var series = this, chart = series.chart, xAxis = series.xAxis, center = xAxis.pane.center, plotX = e.chartX - center[0] - chart.plotLeft, plotY = e.chartY - center[1] - chart.plotTop; return this.searchKDTree({ clientX: 180 + (Math.atan2(plotX, plotY) * (-180 / Math.PI)) }); }; /** * Wrap the buildKDTree function so that it searches by angle (clientX) in case of shared tooltip, * and by two dimensional distance in case of non-shared. */ wrap(seriesProto, 'buildKDTree', function (proceed) { if (this.chart.polar) { if (this.kdByAngle) { this.searchPoint = this.searchPointByAngle; } else { this.kdDimensions = 2; } } proceed.apply(this); }); /** * Translate a point's plotX and plotY from the internal angle and radius measures to * true plotX, plotY coordinates */ seriesProto.toXY = function (point) { var xy, chart = this.chart, plotX = point.plotX, plotY = point.plotY, clientX; // Save rectangular plotX, plotY for later computation point.rectPlotX = plotX; point.rectPlotY = plotY; // Find the polar plotX and plotY xy = this.xAxis.postTranslate(point.plotX, this.yAxis.len - plotY); point.plotX = point.polarPlotX = xy.x - chart.plotLeft; point.plotY = point.polarPlotY = xy.y - chart.plotTop; // If shared tooltip, record the angle in degrees in order to align X points. Otherwise, // use a standard k-d tree to get the nearest point in two dimensions. if (this.kdByAngle) { clientX = ((plotX / Math.PI * 180) + this.xAxis.pane.options.startAngle) % 360; if (clientX < 0) { // #2665 clientX += 360; } point.clientX = clientX; } else { point.clientX = point.plotX; } }; if (seriesTypes.spline) { /** * Overridden method for calculating a spline from one point to the next */ wrap(seriesTypes.spline.prototype, 'getPointSpline', function (proceed, segment, point, i) { var ret, smoothing = 1.5, // 1 means control points midway between points, 2 means 1/3 from the point, 3 is 1/4 etc; denom = smoothing + 1, plotX, plotY, lastPoint, nextPoint, lastX, lastY, nextX, nextY, leftContX, leftContY, rightContX, rightContY, distanceLeftControlPoint, distanceRightControlPoint, leftContAngle, rightContAngle, jointAngle; if (this.chart.polar) { plotX = point.plotX; plotY = point.plotY; lastPoint = segment[i - 1]; nextPoint = segment[i + 1]; // Connect ends if (this.connectEnds) { if (!lastPoint) { lastPoint = segment[segment.length - 2]; // not the last but the second last, because the segment is already connected } if (!nextPoint) { nextPoint = segment[1]; } } // find control points if (lastPoint && nextPoint) { lastX = lastPoint.plotX; lastY = lastPoint.plotY; nextX = nextPoint.plotX; nextY = nextPoint.plotY; leftContX = (smoothing * plotX + lastX) / denom; leftContY = (smoothing * plotY + lastY) / denom; rightContX = (smoothing * plotX + nextX) / denom; rightContY = (smoothing * plotY + nextY) / denom; distanceLeftControlPoint = Math.sqrt(Math.pow(leftContX - plotX, 2) + Math.pow(leftContY - plotY, 2)); distanceRightControlPoint = Math.sqrt(Math.pow(rightContX - plotX, 2) + Math.pow(rightContY - plotY, 2)); leftContAngle = Math.atan2(leftContY - plotY, leftContX - plotX); rightContAngle = Math.atan2(rightContY - plotY, rightContX - plotX); jointAngle = (Math.PI / 2) + ((leftContAngle + rightContAngle) / 2); // Ensure the right direction, jointAngle should be in the same quadrant as leftContAngle if (Math.abs(leftContAngle - jointAngle) > Math.PI / 2) { jointAngle -= Math.PI; } // Find the corrected control points for a spline straight through the point leftContX = plotX + Math.cos(jointAngle) * distanceLeftControlPoint; leftContY = plotY + Math.sin(jointAngle) * distanceLeftControlPoint; rightContX = plotX + Math.cos(Math.PI + jointAngle) * distanceRightControlPoint; rightContY = plotY + Math.sin(Math.PI + jointAngle) * distanceRightControlPoint; // Record for drawing in next point point.rightContX = rightContX; point.rightContY = rightContY; } // moveTo or lineTo if (!i) { ret = ['M', plotX, plotY]; } else { // curve from last point to this ret = [ 'C', lastPoint.rightContX || lastPoint.plotX, lastPoint.rightContY || lastPoint.plotY, leftContX || plotX, leftContY || plotY, plotX, plotY ]; lastPoint.rightContX = lastPoint.rightContY = null; // reset for updating series later } } else { ret = proceed.call(this, segment, point, i); } return ret; }); } /** * Extend translate. The plotX and plotY values are computed as if the polar chart were a * cartesian plane, where plotX denotes the angle in radians and (yAxis.len - plotY) is the pixel distance from * center. */ wrap(seriesProto, 'translate', function (proceed) { var chart = this.chart, points, i; // Run uber method proceed.call(this); // Postprocess plot coordinates if (chart.polar) { this.kdByAngle = chart.tooltip && chart.tooltip.shared; if (!this.preventPostTranslate) { points = this.points; i = points.length; while (i--) { // Translate plotX, plotY from angle and radius to true plot coordinates this.toXY(points[i]); } } } }); /** * Extend getSegmentPath to allow connecting ends across 0 to provide a closed circle in * line-like series. */ wrap(seriesProto, 'getGraphPath', function (proceed, points) { var series = this, i, firstValid; // Connect the path if (this.chart.polar) { points = points || this.points; // Append first valid point in order to connect the ends for (i = 0; i < points.length; i++) { if (!points[i].isNull) { firstValid = i; break; } } if (this.options.connectEnds !== false && firstValid !== undefined) { this.connectEnds = true; // re-used in splines points.splice(points.length, 0, points[firstValid]); } // For area charts, pseudo points are added to the graph, now we need to translate these each(points, function (point) { if (point.polarPlotY === undefined) { series.toXY(point); } }); } // Run uber method return proceed.apply(this, [].slice.call(arguments, 1)); }); function polarAnimate(proceed, init) { var chart = this.chart, animation = this.options.animation, group = this.group, markerGroup = this.markerGroup, center = this.xAxis.center, plotLeft = chart.plotLeft, plotTop = chart.plotTop, attribs; // Specific animation for polar charts if (chart.polar) { // Enable animation on polar charts only in SVG. In VML, the scaling is different, plus animation // would be so slow it would't matter. if (chart.renderer.isSVG) { if (animation === true) { animation = {}; } // Initialize the animation if (init) { // Scale down the group and place it in the center attribs = { translateX: center[0] + plotLeft, translateY: center[1] + plotTop, scaleX: 0.001, // #1499 scaleY: 0.001 }; group.attr(attribs); if (markerGroup) { //markerGroup.attrSetters = group.attrSetters; markerGroup.attr(attribs); } // Run the animation } else { attribs = { translateX: plotLeft, translateY: plotTop, scaleX: 1, scaleY: 1 }; group.animate(attribs, animation); if (markerGroup) { markerGroup.animate(attribs, animation); } // Delete this function to allow it only once this.animate = null; } } // For non-polar charts, revert to the basic animation } else { proceed.call(this, init); } } // Define the animate method for regular series wrap(seriesProto, 'animate', polarAnimate); if (seriesTypes.column) { colProto = seriesTypes.column.prototype; colProto.polarArc = function (low, high, start, end) { var center = this.xAxis.center, len = this.yAxis.len; return this.chart.renderer.symbols.arc( center[0], center[1], len - high, null, { start: start, end: end, innerR: len - pick(low, len) } ); }; /** * Define the animate method for columnseries */ wrap(colProto, 'animate', polarAnimate); /** * Extend the column prototype's translate method */ wrap(colProto, 'translate', function (proceed) { var xAxis = this.xAxis, startAngleRad = xAxis.startAngleRad, start, points, point, i; this.preventPostTranslate = true; // Run uber method proceed.call(this); // Postprocess plot coordinates if (xAxis.isRadial) { points = this.points; i = points.length; while (i--) { point = points[i]; start = point.barX + startAngleRad; point.shapeType = 'path'; point.shapeArgs = { d: this.polarArc(point.yBottom, point.plotY, start, start + point.pointWidth) }; // Provide correct plotX, plotY for tooltip this.toXY(point); point.tooltipPos = [point.plotX, point.plotY]; point.ttBelow = point.plotY > xAxis.center[1]; } } }); /** * Align column data labels outside the columns. #1199. */ wrap(colProto, 'alignDataLabel', function (proceed, point, dataLabel, options, alignTo, isNew) { if (this.chart.polar) { var angle = point.rectPlotX / Math.PI * 180, align, verticalAlign; // Align nicely outside the perimeter of the columns if (options.align === null) { if (angle > 20 && angle < 160) { align = 'left'; // right hemisphere } else if (angle > 200 && angle < 340) { align = 'right'; // left hemisphere } else { align = 'center'; // top or bottom } options.align = align; } if (options.verticalAlign === null) { if (angle < 45 || angle > 315) { verticalAlign = 'bottom'; // top part } else if (angle > 135 && angle < 225) { verticalAlign = 'top'; // bottom part } else { verticalAlign = 'middle'; // left or right } options.verticalAlign = verticalAlign; } seriesProto.alignDataLabel.call(this, point, dataLabel, options, alignTo, isNew); } else { proceed.call(this, point, dataLabel, options, alignTo, isNew); } }); } /** * Extend getCoordinates to prepare for polar axis values */ wrap(pointerProto, 'getCoordinates', function (proceed, e) { var chart = this.chart, ret = { xAxis: [], yAxis: [] }; if (chart.polar) { each(chart.axes, function (axis) { var isXAxis = axis.isXAxis, center = axis.center, x = e.chartX - center[0] - chart.plotLeft, y = e.chartY - center[1] - chart.plotTop; ret[isXAxis ? 'xAxis' : 'yAxis'].push({ axis: axis, value: axis.translate( isXAxis ? Math.PI - Math.atan2(x, y) : // angle Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)), // distance from center true ) }); }); } else { ret = proceed.call(this, e); } return ret; }); }()); })); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/highcharts/highcharts.js ================================================ /* Highcharts JS v4.2.7 (2016-09-21) (c) 2009-2016 Torstein Honsi License: www.highcharts.com/license */ (function(D,ea){typeof module==="object"&&module.exports?module.exports=D.document?ea(D):ea:D.Highcharts=ea(D)})(typeof window!=="undefined"?window:this,function(D){function ea(a,b){var c="Highcharts error #"+a+": www.highcharts.com/errors/"+a;if(b)throw Error(c);D.console&&console.log(c)}function tb(a,b,c){this.options=b;this.elem=a;this.prop=c}function E(){var a,b=arguments,c,d={},e=function(a,b){var c,d;typeof a!=="object"&&(a={});for(d in b)b.hasOwnProperty(d)&&(c=b[d],a[d]=u.isObject(c,!0)&& d!=="renderTo"&&typeof c.nodeType!=="number"?e(a[d]||{},c):b[d]);return a};b[0]===!0&&(d=b[1],b=Array.prototype.slice.call(b,2));c=b.length;for(a=0;a-1?h.thousandsSep: ""))):e=Ta(f,e)}j.push(e);a=a.slice(c+1);c=(d=!d)?"}":"{"}j.push(a);return j.join("")}function vb(a){return Z.pow(10,V(Z.log(a)/Z.LN10))}function wb(a,b,c,d,e){var f,g=a,c=p(c,1);f=a/c;b||(b=[1,2,2.5,5,10],d===!1&&(c===1?b=[1,2,5,10]:c<=0.1&&(b=[1/c])));for(d=0;d=a||!e&&f<=(b[d]+(b[d+1]||b[d]))/2)break;g*=c;return g}function kb(a,b){var c=a.length,d,e;for(e=0;ec&&(c=a[b]);return c}function Ua(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destroy(),delete a[c]}function Va(a){lb||(lb=ca(Pa));a&&lb.appendChild(a);lb.innerHTML=""}function $(a,b){return parseFloat(a.toPrecision(b||14))}function cb(a,b){b.renderer.globalAnimation=p(a,b.animation)}function Wa(a){return ba(a)?E(a):{duration:a?500:0}}function Hb(){var a=T.global,b= a.useUTC,c=b?"getUTC":"get",d=b?"setUTC":"set";ma=a.Date||D.Date;ub=b&&a.timezoneOffset;bb=b&&a.getTimezoneOffset;mb=function(a,c,d,h,i,j){var k;b?(k=ma.UTC.apply(0,arguments),k+=ab(k)):k=(new ma(a,c,p(d,1),p(h,0),p(i,0),p(j,0))).getTime();return k};xb=c+"Minutes";yb=c+"Hours";zb=c+"Day";Xa=c+"Date";db=c+"Month";eb=c+"FullYear";Ib=d+"Milliseconds";Jb=d+"Seconds";Kb=d+"Minutes";Lb=d+"Hours";nb=d+"Date";Ab=d+"Month";Bb=d+"FullYear"}function na(a){if(!(this instanceof na))return new na(a);this.init(a)} function J(){}function Ya(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!0;!c&&!d&&this.addLabel()}function Mb(a,b,c,d,e){var f=a.chart.inverted;this.axis=a;this.isNegative=c;this.options=b;this.x=d;this.total=null;this.points={};this.stack=e;this.rightCliff=this.leftCliff=0;this.alignOptions={align:b.align||(f?c?"left":"right":"center"),verticalAlign:b.verticalAlign||(f?"middle":c?"bottom":"top"),y:p(b.y,f?4:c?14:-6),x:p(b.x,f?c?-6:6:0)};this.textAlign=b.textAlign||(f?c?"right":"left": "center")}var z,y=D.document,Z=Math,C=Z.round,V=Z.floor,va=Z.ceil,t=Z.max,F=Z.min,Q=Z.abs,W=Z.cos,da=Z.sin,ta=Z.PI,ka=ta*2/360,Ba=D.navigator&&D.navigator.userAgent||"",Nb=D.opera,Aa=/(msie|trident|edge)/i.test(Ba)&&!Nb,ob=y&&y.documentMode===8,pb=!Aa&&/AppleWebKit/.test(Ba),Qa=/Firefox/.test(Ba),Ob=/(Mobile|Android|Windows Phone)/.test(Ba),Ia="http://www.w3.org/2000/svg",fa=y&&y.createElementNS&&!!y.createElementNS(Ia,"svg").createSVGRect,Sb=Qa&&parseInt(Ba.split("Firefox/")[1],10)<4,la=y&&!fa&& !Aa&&!!y.createElement("canvas").getContext,fb,gb,Pb={},Cb=0,lb,T,Ta,G,Ca=function(){},U=[],hb=0,Pa="div",X="M",S="L",Tb=/[0-9]/g,qb=["plotTop","marginRight","marginBottom","plotLeft"],ma,mb,ub,bb,xb,yb,zb,Xa,db,eb,Ib,Jb,Kb,Lb,nb,Ab,Bb,L={},u;u=D.Highcharts?ea(16,!0):{win:D};u.seriesTypes=L;var Ja=[],oa,pa,q,Da,Db,Ea,N,Y,H,Za,Ka;tb.prototype={dSetter:function(){var a=this.paths[0],b=this.paths[1],c=[],d=this.now,e=a.length,f;if(d===1)c=this.toD;else if(e===b.length&&d<1)for(;e--;)f=parseFloat(a[e]), c[e]=isNaN(f)?a[e]:d*parseFloat(b[e]-f)+f;else c=b;this.elem.attr("d",c)},update:function(){var a=this.elem,b=this.prop,c=this.now,d=this.options.step;if(this[b+"Setter"])this[b+"Setter"]();else a.attr?a.element&&a.attr(b,c):a.style[b]=c+this.unit;d&&d.call(a,c,this)},run:function(a,b,c){var d=this,e=function(a){return e.stopped?!1:d.step(a)},f;this.startTime=+new ma;this.start=a;this.end=b;this.unit=c;this.now=this.start;this.pos=0;e.elem=this.elem;if(e()&&Ja.push(e)===1)e.timerId=setInterval(function(){for(f= 0;f=f+this.startTime){this.now=this.end;this.pos=1;this.update();a=g[this.prop]=!0;for(h in g)g[h]!==!0&&(a=!1);a&&e&&e.call(c);c=!1}else this.pos=d.easing((b-this.startTime)/f),this.now=this.start+(this.end-this.start)*this.pos,this.update(),c=!0;return c},initPath:function(a, b,c){function d(a){for(n=a.length;n--;)(a[n]===X||a[n]===S)&&a.splice(n+1,0,a[n+1],a[n+2],a[n+1],a[n+2])}function e(a,b){for(;a.length0&&c--;)m=a.slice().splice(a.length/A-k,k*A),m[0]=b[l-k-c*k],j&&(m[k-6]=m[k-2],m[k-5]=m[k-1]),[].splice.apply(a,[a.length/A,0].concat(m)),o&&c--}var b=b||"",g,h=a.startX, i=a.endX,j=b.indexOf("C")>-1,k=j?7:3,l,m,n,b=b.split(" "),c=c.slice(),o=a.isArea,A=o?2:1,r;j&&(d(b),d(c));if(h&&i){for(n=0;n3?g.length%3:0;c=p(c,e.decimalPoint);d=p(d,e.thousandsSep);a=a<0?"-":"";a+=h?g.substr(0,h)+d:"";a+=g.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+d);b&&(d=Math.abs(i-g+Math.pow(10,-Math.max(b,f)-1)),a+=c+d.toFixed(b).slice(2));return a};Math.easeInOutSine=function(a){return-0.5*(Math.cos(Math.PI*a)-1)};oa=function(a,b){var c;if(b=== "width")return Math.min(a.offsetWidth,a.scrollWidth)-oa(a,"padding-left")-oa(a,"padding-right");else if(b==="height")return Math.min(a.offsetHeight,a.scrollHeight)-oa(a,"padding-top")-oa(a,"padding-bottom");return(c=D.getComputedStyle(a,void 0))&&B(c.getPropertyValue(b))};pa=function(a,b){return b.indexOf?b.indexOf(a):[].indexOf.call(b,a)};Da=function(a,b){return[].filter.call(a,b)};Ea=function(a,b){for(var c=[],d=0,e=a.length;d-1&&(f.splice(h,1),g[b]=f),d(b,c)):(e(),g[b]=[])):(e(),a.hcEvents={})};H=function(a,b,c,d){var e;e=a.hcEvents;var f,g,c=c|| {};if(y.createEvent&&(a.dispatchEvent||a.fireEvent))e=y.createEvent("Events"),e.initEvent(b,!0,!0),e.target=a,x(e,c),a.dispatchEvent?a.dispatchEvent(e):a.fireEvent(b,e);else if(e){e=e[b]||[];f=e.length;if(!c.preventDefault)c.preventDefault=function(){c.defaultPrevented=!0};c.target=a;if(!c.type)c.type=b;for(b=0;b{point.key}
          ',pointFormat:'\u25cf {series.name}: {point.y}
          ',shadow:!0,snap:Ob?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px",pointerEvents:"none",whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com", href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}};var ga=T.plotOptions,ha=ga.line;Hb();na.prototype={parsers:[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(a){return[B(a[1]),B(a[2]),B(a[3]),parseFloat(a[4],10)]}},{regex:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(a){return[B(a[1],16),B(a[2],16),B(a[3],16), 1]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(a){return[B(a[1]),B(a[2]),B(a[3]),1]}}],init:function(a){var b,c,d,e;if((this.input=a)&&a.stops)this.stops=Ea(a.stops,function(a){return new na(a[1])});else for(d=this.parsers.length;d--&&!c;)e=this.parsers[d],(b=e.regex.exec(a))&&(c=e.parse(b));this.rgba=c||[]},get:function(a){var b=this.input,c=this.rgba,d;this.stops?(d=E(b),d.stops=[].concat(d.stops),q(this.stops,function(b,c){d.stops[c]=[d.stops[c][0], b.get(a)]})):d=c&&I(c[0])?a==="rgb"||!a&&c[3]===1?"rgb("+c[0]+","+c[1]+","+c[2]+")":a==="a"?c[3]:"rgba("+c.join(",")+")":b;return d},brighten:function(a){var b,c=this.rgba;if(this.stops)q(this.stops,function(b){b.brighten(a)});else if(I(a)&&a!==0)for(b=0;b<3;b++)c[b]+=B(a*255),c[b]<0&&(c[b]=0),c[b]>255&&(c[b]=255);return this},setOpacity:function(a){this.rgba[3]=a;return this}};J.prototype={opacity:1,textProps:"direction,fontSize,fontWeight,fontFamily,fontStyle,color,lineHeight,width,textDecoration,textOverflow,textShadow".split(","), init:function(a,b){this.element=b==="span"?ca(b):y.createElementNS(Ia,b);this.renderer=a},animate:function(a,b,c){b=p(b,this.renderer.globalAnimation,!0);Ka(this);if(b){if(c)b.complete=c;Za(this,a,b)}else this.attr(a,null,c);return this},colorGradient:function(a,b,c){var d=this.renderer,e,f,g,h,i,j,k,l,m,n,o,A=[],r;a.linearGradient?f="linearGradient":a.radialGradient&&(f="radialGradient");if(f){g=a[f];i=d.gradients;k=a.stops;n=c.radialReference;za(g)&&(a[f]=g={x1:g[0],y1:g[1],x2:g[2],y2:g[3],gradientUnits:"userSpaceOnUse"}); f==="radialGradient"&&n&&!s(g.gradientUnits)&&(h=g,g=E(g,d.getRadialAttr(n,h),{gradientUnits:"userSpaceOnUse"}));for(o in g)o!=="id"&&A.push(o,g[o]);for(o in k)A.push(k[o]);A=A.join(",");i[A]?n=i[A].attr("id"):(g.id=n="highcharts-"+Cb++,i[A]=j=d.createElement(f).attr(g).add(d.defs),j.radAttr=h,j.stops=[],q(k,function(a){a[1].indexOf("rgba")===0?(e=na(a[1]),l=e.get("rgb"),m=e.get("a")):(l=a[1],m=1);a=d.createElement("stop").attr({offset:a[0],"stop-color":l,"stop-opacity":m}).add(j);j.stops.push(a)})); r="url("+d.url+"#"+n+")";c.setAttribute(b,r);c.gradient=A;a.toString=function(){return r}}},applyTextShadow:function(a){var b=this.element,c,d=a.indexOf("contrast")!==-1,e={},f=this.renderer.forExport,g=f||b.style.textShadow!==z&&!Aa;if(d)e.textShadow=a=a.replace(/contrast/g,this.renderer.getContrast(b.style.fill));if(pb||f)e.textRendering="geometricPrecision";g?this.css(e):(this.fakeTS=!0,this.ySetter=this.xSetter,c=[].slice.call(b.getElementsByTagName("tspan")),q(a.split(/\s?,\s?/g),function(a){var d= b.firstChild,e,f,a=a.split(" ");e=a[a.length-1];(f=a[a.length-2])&&q(c,function(a,c){var g;c===0&&(a.setAttribute("x",b.getAttribute("x")),c=b.getAttribute("y"),a.setAttribute("y",c||0),c===null&&b.setAttribute("y",0));g=a.cloneNode(1);O(g,{"class":"highcharts-text-shadow",fill:e,stroke:e,"stroke-opacity":1/t(B(f),3),"stroke-width":f,"stroke-linejoin":"round"});b.insertBefore(g,d)})}))},attr:function(a,b,c){var d,e=this.element,f,g=this,h;typeof a==="string"&&b!==z&&(d=a,a={},a[d]=b);if(typeof a=== "string")g=(this[a+"Getter"]||this._defaultGetter).call(this,a,e);else{for(d in a){b=a[d];h=!1;this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(d)&&(f||(this.symbolAttr(a),f=!0),h=!0);if(this.rotation&&(d==="x"||d==="y"))this.doTransform=!0;h||(h=this[d+"Setter"]||this._defaultSetter,h.call(this,b,d,e),this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(d)&&this.updateShadows(d,b,h))}if(this.doTransform)this.updateTransform(),this.doTransform=!1}c&& c();return g},updateShadows:function(a,b,c){for(var d=this.shadows,e=d.length;e--;)c.call(d[e],a==="height"?Math.max(b-(d[e].cutHeight||0),0):a==="d"?this.d:b,a,d[e])},addClass:function(a){var b=this.element,c=O(b,"class")||"";c.indexOf(a)===-1&&O(b,"class",c+" "+a);return this},symbolAttr:function(a){var b=this;q("x,y,r,start,end,width,height,innerR,anchorX,anchorY".split(","),function(c){b[c]=p(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](b.x,b.y,b.width,b.height,b)})},clip:function(a){return this.attr("clip-path", a?"url("+this.renderer.url+"#"+a.id+")":"none")},crisp:function(a){var b,c={},d,e=this.strokeWidth||0;d=C(e)%2/2;a.x=V(a.x||this.x||0)+d;a.y=V(a.y||this.y||0)+d;a.width=V((a.width||this.width||0)-2*d);a.height=V((a.height||this.height||0)-2*d);a.strokeWidth=e;for(b in a)this[b]!==a[b]&&(this[b]=c[b]=a[b]);return c},css:function(a){var b=this.styles,c={},d=this.element,e,f,g="";e=!b;if(a&&a.color)a.fill=a.color;if(b)for(f in a)a[f]!==b[f]&&(c[f]=a[f],e=!0);if(e){e=this.textWidth=a&&a.width&&d.nodeName.toLowerCase()=== "text"&&B(a.width)||this.textWidth;b&&(a=x(b,c));this.styles=a;e&&(la||!fa&&this.renderer.forExport)&&delete a.width;if(Aa&&!fa)M(this.element,a);else{b=function(a,b){return"-"+b.toLowerCase()};for(f in a)g+=f.replace(/([A-Z])/g,b)+":"+a[f]+";";O(d,"style",g)}e&&this.added&&this.renderer.buildText(this)}return this},on:function(a,b){var c=this,d=c.element;gb&&a==="click"?(d.ontouchstart=function(a){c.touchEventFired=ma.now();a.preventDefault();b.call(d,a)},d.onclick=function(a){(Ba.indexOf("Android")=== -1||ma.now()-(c.touchEventFired||0)>1100)&&b.call(d,a)}):d["on"+a]=b;return this},setRadialReference:function(a){var b=this.renderer.gradients[this.element.gradient];this.element.radialReference=a;b&&b.radAttr&&b.animate(this.renderer.getRadialAttr(a,b.radAttr));return this},translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){this.inverted=!0;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.scaleX, d=this.scaleY,e=this.inverted,f=this.rotation,g=this.element;e&&(a+=this.attr("width"),b+=this.attr("height"));a=["translate("+a+","+b+")"];e?a.push("rotate(90) scale(-1,1)"):f&&a.push("rotate("+f+" "+(g.getAttribute("x")||0)+" "+(g.getAttribute("y")||0)+")");(s(c)||s(d))&&a.push("scale("+p(c,1)+" "+p(d,1)+")");a.length&&g.setAttribute("transform",a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){var d,e,f,g,h={};e=this.renderer;f=e.alignedObjects; if(a){if(this.alignOptions=a,this.alignByTranslate=b,!c||ya(c))this.alignTo=d=c||"renderer",ra(f,this),f.push(this),c=null}else a=this.alignOptions,b=this.alignByTranslate,d=this.alignTo;c=p(c,e[d],e);d=a.align;e=a.verticalAlign;f=(c.x||0)+(a.x||0);g=(c.y||0)+(a.y||0);if(d==="right"||d==="center")f+=(c.width-(a.width||0))/{right:1,center:2}[d];h[b?"translateX":"x"]=C(f);if(e==="bottom"||e==="middle")g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||1);h[b?"translateY":"y"]=C(g);this[this.placed? "animate":"attr"](h);this.placed=!0;this.alignAttr=h;return this},getBBox:function(a,b){var c,d=this.renderer,e,f,g,h=this.element,i=this.styles;e=this.textStr;var j,k=h.style,l,m=d.cache,n=d.cacheKeys,o;f=p(b,this.rotation);g=f*ka;e!==z&&(o=e.toString().replace(Tb,"0")+["",f||0,i&&i.fontSize,h.style.width].join(","));o&&!a&&(c=m[o]);if(!c){if(h.namespaceURI===Ia||d.forExport){try{l=this.fakeTS&&function(a){q(h.querySelectorAll(".highcharts-text-shadow"),function(b){b.style.display=a})},Qa&&k.textShadow? (j=k.textShadow,k.textShadow=""):l&&l("none"),c=h.getBBox?x({},h.getBBox()):{width:h.offsetWidth,height:h.offsetHeight},j?k.textShadow=j:l&&l("")}catch(A){}if(!c||c.width<0)c={width:0,height:0}}else c=this.htmlGetBBox();if(d.isSVG){d=c.width;e=c.height;if(Aa&&i&&i.fontSize==="11px"&&e.toPrecision(3)==="16.9")c.height=e=14;if(f)c.width=Q(e*da(g))+Q(d*W(g)),c.height=Q(e*W(g))+Q(d*da(g))}if(o&&c.height>0){for(;n.length>250;)delete m[n.shift()];m[o]||n.push(o);m[o]=c}}return c},show:function(a){return this.attr({visibility:a? "inherit":"visible"})},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var b=this;b.animate({opacity:0},{duration:a||150,complete:function(){b.attr({y:-9999})}})},add:function(a){var b=this.renderer,c=this.element,d;if(a)this.parentGroup=a;this.parentInverted=a&&a.inverted;this.textStr!==void 0&&b.buildText(this);this.added=!0;if(!a||a.handleZ||this.zIndex)d=this.zIndexSetter();d||(a?a.element:b.box).appendChild(c);if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var b= a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this,b=a.element||{},c=a.shadows,d=a.renderer.isSVG&&b.nodeName==="SPAN"&&a.parentGroup,e,f;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=b.point=null;Ka(a);if(a.clipPath)a.clipPath=a.clipPath.destroy();if(a.stops){for(f=0;f]*>/g,"")))},textSetter:function(a){if(a!==this.textStr)delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this)},fillSetter:function(a,b,c){typeof a==="string"?c.setAttribute(b,a):a&&this.colorGradient(a,b,c)},visibilitySetter:function(a,b, c){a==="inherit"?c.removeAttribute(b):c.setAttribute(b,a)},zIndexSetter:function(a,b){var c=this.renderer,d=this.parentGroup,c=(d||c).element||c.box,e,f,g=this.element,h;e=this.added;var i;if(s(a))g.zIndex=a,a=+a,this[b]===a&&(e=!1),this[b]=a;if(e){if((a=this.zIndex)&&d)d.handleZ=!0;d=c.childNodes;for(i=0;ia||!s(a)&&s(f)))c.insertBefore(g,e),h=!0;h||c.appendChild(g)}return h},_defaultSetter:function(a,b,c){c.setAttribute(b,a)}};J.prototype.yGetter= J.prototype.xGetter;J.prototype.translateXSetter=J.prototype.translateYSetter=J.prototype.rotationSetter=J.prototype.verticalAlignSetter=J.prototype.scaleXSetter=J.prototype.scaleYSetter=function(a,b){this[b]=a;this.doTransform=!0};J.prototype.opacitySetter=J.prototype.displaySetter=function(a,b,c){this[b]=a;c.setAttribute(b,a)};J.prototype["stroke-widthSetter"]=J.prototype.strokeSetter=function(a,b,c){this[b]=a;if(this.stroke&&this["stroke-width"])this.strokeWidth=this["stroke-width"],J.prototype.fillSetter.call(this, this.stroke,"stroke",c),c.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0;else if(b==="stroke-width"&&a===0&&this.hasStroke)c.removeAttribute("stroke"),this.hasStroke=!1};var Fa=function(){this.init.apply(this,arguments)};Fa.prototype={Element:J,init:function(a,b,c,d,e,f){var g,d=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(d));g=d.element;a.appendChild(g);a.innerHTML.indexOf("xmlns")===-1&&O(g,"xmlns",Ia);this.isSVG=!0;this.box=g;this.boxWrapper=d;this.alignedObjects= [];this.url=(Qa||pb)&&y.getElementsByTagName("base").length?D.location.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(y.createTextNode("Created with Highcharts 4.2.7"));this.defs=this.createElement("defs").add();this.allowHTML=f;this.forExport=e;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(b,c,!1);var h;if(Qa&&a.getBoundingClientRect)this.subPixelFix=b=function(){M(a,{left:0,top:0}); h=a.getBoundingClientRect();M(a,{left:va(h.left)-h.left+"px",top:va(h.top)-h.top+"px"})},b(),N(D,"resize",b)},getStyle:function(a){return this.style=x({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();Ua(this.gradients||{});this.gradients=null;if(a)this.defs=a.destroy();this.subPixelFix&&Y(D,"resize", this.subPixelFix);return this.alignedObjects=null},createElement:function(a){var b=new this.Element;b.init(this,a);return b},draw:function(){},getRadialAttr:function(a,b){return{cx:a[0]-a[2]/2+b.cx*a[2],cy:a[1]-a[2]/2+b.cy*a[2],r:b.r*a[2]}},buildText:function(a){for(var b=a.element,c=this,d=c.forExport,e=p(a.textStr,"").toString(),f=e.indexOf("<")!==-1,g=b.childNodes,h,i,j,k=O(b,"x"),l=a.styles,m=a.textWidth,n=l&&l.lineHeight,o=l&&l.textShadow,A=l&&l.textOverflow==="ellipsis",r=g.length,K=m&&!a.added&& this.box,w=function(a){return n?B(n):c.fontMetrics(/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:l&&l.fontSize||c.style.fontSize||12,a).h},v=function(a){return a.replace(/</g,"<").replace(/>/g,">")};r--;)b.removeChild(g[r]);!f&&!o&&!A&&!m&&e.indexOf(" ")===-1?b.appendChild(y.createTextNode(v(e))):(h=/<.*style="([^"]+)".*>/,i=/<.*href="(http[^"]+)".*>/,K&&K.appendChild(b),e=f?e.replace(/<(b|strong)>/g,'').replace(/<(i|em)>/g,'').replace(//g,"").split(//g):[e],e=Da(e,function(a){return a!==""}),q(e,function(e,f){var g,n=0,e=e.replace(/^\s+|\s+$/g,"").replace(//g,"|||");g=e.split("|||");q(g,function(e){if(e!==""||g.length===1){var o={},r=y.createElementNS(Ia,"tspan"),p;h.test(e)&&(p=e.match(h)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),O(r,"style",p));i.test(e)&&!d&&(O(r,"onclick",'location.href="'+e.match(i)[1]+'"'),M(r,{cursor:"pointer"})); e=v(e.replace(/<(.|\n)*?>/g,"")||" ");if(e!==" "){r.appendChild(y.createTextNode(e));if(n)o.dx=0;else if(f&&k!==null)o.x=k;O(r,o);b.appendChild(r);!n&&f&&(!fa&&d&&M(r,{display:"block"}),O(r,"dy",w(r)));if(m){for(var o=e.replace(/([^\^])-/g,"$1- ").split(" "),q=l.whiteSpace==="nowrap",K=g.length>1||f||o.length>1&&!q,Ra,s,La=[],t=w(r),x=1,C=a.rotation,u=e,z=u.length;(K||A)&&(o.length||La.length);)a.rotation=0,Ra=a.getBBox(!0),s=Ra.width,!fa&&c.forExport&&(s=c.measureSpanWidth(r.firstChild.data,a.styles)), Ra=s>m,j===void 0&&(j=Ra),A&&j?(z/=2,u===""||!Ra&&z<0.5?o=[]:(u=e.substring(0,u.length+(Ra?-1:1)*va(z)),o=[u+(m>3?"\u2026":"")],r.removeChild(r.firstChild))):!Ra||o.length===1?(o=La,La=[],o.length&&!q&&(x++,r=y.createElementNS(Ia,"tspan"),O(r,{dy:t,x:k}),p&&O(r,"style",p),b.appendChild(r)),s>m&&(m=s)):(r.removeChild(r.firstChild),La.unshift(o.pop())),o.length&&r.appendChild(y.createTextNode(o.join(" ").replace(/- /g,"-")));a.rotation=C}n++}}})}),j&&a.attr("title",a.textStr),K&&K.removeChild(b),o&& a.applyTextShadow&&a.applyTextShadow(o))},getContrast:function(a){a=na(a).rgba;return a[0]+a[1]+a[2]>384?"#000000":"#FFFFFF"},button:function(a,b,c,d,e,f,g,h,i){var j=this.label(a,b,c,i,null,null,null,null,"button"),k=0,l,m,n,o,A,r,a={x1:0,y1:0,x2:0,y2:1},e=E({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:a,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},e);n=e.style;delete e.style;f=E(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#FFF"],[1,"#ACF"]]}},f);o= f.style;delete f.style;g=E(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#9BD"],[1,"#CDF"]]}},g);A=g.style;delete g.style;h=E(e,{style:{color:"#CCC"}},h);r=h.style;delete h.style;N(j.element,Aa?"mouseover":"mouseenter",function(){k!==3&&j.attr(f).css(o)});N(j.element,Aa?"mouseout":"mouseleave",function(){k!==3&&(l=[e,f,g][k],m=[n,o,A][k],j.attr(l).css(m))});j.setState=function(a){(j.state=k=a)?a===2?j.attr(g).css(A):a===3&&j.attr(h).css(r):j.attr(e).css(n)};return j.on("click",function(a){k!== 3&&d.call(j,a)}).attr(e).css(x({cursor:"default"},n))},crispLine:function(a,b){a[1]===a[4]&&(a[1]=a[4]=C(a[1])-b%2/2);a[2]===a[5]&&(a[2]=a[5]=C(a[2])+b%2/2);return a},path:function(a){var b={fill:"none"};za(a)?b.d=a:ba(a)&&x(b,a);return this.createElement("path").attr(b)},circle:function(a,b,c){a=ba(a)?a:{x:a,y:b,r:c};b=this.createElement("circle");b.xSetter=b.ySetter=function(a,b,c){c.setAttribute("c"+b,a)};return b.attr(a)},arc:function(a,b,c,d,e,f){if(ba(a))b=a.y,c=a.r,d=a.innerR,e=a.start,f=a.end, a=a.x;a=this.symbol("arc",a||0,b||0,c||0,c||0,{innerR:d||0,start:e||0,end:f||0});a.r=c;return a},rect:function(a,b,c,d,e,f){var e=ba(a)?a.r:e,g=this.createElement("rect"),a=ba(a)?a:a===z?{}:{x:a,y:b,width:t(c,0),height:t(d,0)};if(f!==z)g.strokeWidth=f,a=g.crisp(a);if(e)a.r=e;g.rSetter=function(a,b,c){O(c,{rx:a,ry:a})};return g.attr(a)},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a;this.height=b;for(this.boxWrapper[p(c,!0)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()}, g:function(a){var b=this.createElement("g");return s(a)?b.attr({"class":"highcharts-"+a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:"none"};arguments.length>1&&x(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e,f){var g=this,h,i=this.symbols[a],i=i&&i(C(b),C(c),d,e,f),j=/^url\((.*?)\)$/,k,l;if(i)h=this.path(i), x(h,{symbolName:a,x:b,y:c,width:d,height:e}),f&&x(h,f);else if(j.test(a))l=function(a,b){a.element&&(a.attr({width:b[0],height:b[1]}),a.alignByTranslate||a.translate(C((d-b[0])/2),C((e-b[1])/2)))},k=a.match(j)[1],a=Pb[k]||f&&f.width&&f.height&&[f.width,f.height],h=this.image(k).attr({x:b,y:c}),h.isImg=!0,a?l(h,a):(h.attr({width:0,height:0}),ca("img",{onload:function(){var a=U[g.chartIndex];this.width===0&&(M(this,{position:"absolute",top:"-999em"}),y.body.appendChild(this));l(h,Pb[k]=[this.width, this.height]);this.parentNode&&this.parentNode.removeChild(this);g.imgCount--;if(!g.imgCount&&a&&a.onload)a.onload()},src:k}),this.imgCount++);return h},symbols:{circle:function(a,b,c,d){var e=0.166*c;return[X,a+c/2,b,"C",a+c+e,b,a+c+e,b+d,a+c/2,b+d,"C",a-e,b+d,a-e,b,a+c/2,b,"Z"]},square:function(a,b,c,d){return[X,a,b,S,a+c,b,a+c,b+d,a,b+d,"Z"]},triangle:function(a,b,c,d){return[X,a+c/2,b,S,a+c,b+d,a,b+d,"Z"]},"triangle-down":function(a,b,c,d){return[X,a,b,S,a+c,b,a+c/2,b+d,"Z"]},diamond:function(a, b,c,d){return[X,a+c/2,b,S,a+c,b+d/2,a+c/2,b+d,a,b+d/2,"Z"]},arc:function(a,b,c,d,e){var f=e.start,c=e.r||c||d,g=e.end-0.001,d=e.innerR,h=e.open,i=W(f),j=da(f),k=W(g),g=da(g),e=e.end-fc&&e>b+g&&eb+g&&ed&&h>a+g&&ha+g&&hk&&/[ \-]/.test(b.textContent||b.innerText))M(b,{width:k+"px",display:"block",whiteSpace:l||"normal"});this.getSpanCorrection(b.offsetWidth,j,h,i,g)}M(b,{left:e+(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"});if(pb)j=b.offsetHeight;this.cTT=m}}else this.alignOnAdd=!0},setSpanRotation:function(a,b,c){var d={},e=Aa?"-ms-transform":pb?"-webkit-transform":Qa?"MozTransform":Nb?"-o-transform":"";d[e]=d.transform="rotate("+a+"deg)";d[e+(Qa?"Origin":"-origin")]= d.transformOrigin=b*100+"% "+c+"px";M(this.element,d)},getSpanCorrection:function(a,b,c){this.xCorr=-a*c;this.yCorr=-b}});x(Fa.prototype,{html:function(a,b,c){var d=this.createElement("span"),e=d.element,f=d.renderer,g=f.isSVG,h=function(a,b){q(["display","opacity","visibility"],function(c){ib(a,c+"Setter",function(a,c,d,e){a.call(this,c,d,e);b[d]=c})})};d.textSetter=function(a){a!==e.innerHTML&&delete this.bBox;e.innerHTML=this.textStr=a;d.htmlUpdateTransform()};g&&h(d,d.element.style);d.xSetter= d.ySetter=d.alignSetter=d.rotationSetter=function(a,b){b==="align"&&(b="textAlign");d[b]=a;d.htmlUpdateTransform()};d.attr({text:a,x:C(b),y:C(c)}).css({position:"absolute",fontFamily:this.style.fontFamily,fontSize:this.style.fontSize});e.style.whiteSpace="nowrap";d.css=d.htmlCss;if(g)d.add=function(a){var b,c=f.box.parentNode,g=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)g.push(a),a=a.parentGroup;q(g.reverse(),function(a){var d,e=O(a.element,"class");e&&(e={className:e});b=a.div=a.div||ca(Pa, e,{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px",display:a.display,opacity:a.opacity,pointerEvents:a.styles&&a.styles.pointerEvents},b||c);d=b.style;x(a,{translateXSetter:function(b,c){d.left=b+"px";a[c]=b;a.doTransform=!0},translateYSetter:function(b,c){d.top=b+"px";a[c]=b;a.doTransform=!0}});h(a,d)})}}else b=c;b.appendChild(e);d.added=!0;d.alignOnAdd&&d.htmlUpdateTransform();return d};return d}});var P;if(!fa&&!la){P={init:function(a,b){var c=["<",b,' filled="f" stroked="f"'], d=["position: ","absolute",";"],e=b===Pa;(b==="shape"||e)&&d.push("left:0;top:0;width:1px;height:1px;");d.push("visibility: ",e?"hidden":"visible");c.push(' style="',d.join(""),'"/>');if(b)c=e||b==="span"||b==="img"?c.join(""):a.prepVML(c),this.element=ca(c);this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box,e=a&&a.inverted,d=a?a.element||a:d;if(a)this.parentGroup=a;e&&b.invertChild(c,d);d.appendChild(c);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform(); if(this.onAdd)this.onAdd();return this},updateTransform:J.prototype.htmlUpdateTransform,setSpanRotation:function(){var a=this.rotation,b=W(a*ka),c=da(a*ka);M(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",b,", M12=",-c,", M21=",c,", M22=",b,", sizingMethod='auto expand')"].join(""):"none"})},getSpanCorrection:function(a,b,c,d,e){var f=d?W(d*ka):1,g=d?da(d*ka):0,h=p(this.elemHeight,this.element.offsetHeight),i;this.xCorr=f<0&&-a;this.yCorr=g<0&&-h;i=f*g<0;this.xCorr+=g*b*(i? 1-c:c);this.yCorr-=f*b*(d?i?c:1-c:1);e&&e!=="left"&&(this.xCorr-=a*c*(f<0?-1:1),d&&(this.yCorr-=h*c*(g<0?-1:1)),M(this.element,{textAlign:e}))},pathToVML:function(a){for(var b=a.length,c=[];b--;)if(I(a[b]))c[b]=C(a[b]*10)-5;else if(a[b]==="Z")c[b]="x";else if(c[b]=a[b],a.isArc&&(a[b]==="wa"||a[b]==="at"))c[b+5]===c[b+7]&&(c[b+7]+=a[b+7]>a[b+5]?1:-1),c[b+6]===c[b+8]&&(c[b+8]+=a[b+8]>a[b+6]?1:-1);return c.join(" ")||"x"},clip:function(a){var b=this,c;a?(c=a.members,ra(c,b),c.push(b),b.destroyClip=function(){ra(c, b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(),a={clip:ob?"inherit":"rect(auto)"});return b.css(a)},css:J.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&Va(a)},destroy:function(){this.destroyClip&&this.destroyClip();return J.prototype.destroy.apply(this)},on:function(a,b){this.element["on"+a]=function(){var a=D.event;a.target=a.srcElement;b(a)};return this},cutOffPath:function(a,b){var c,a=a.split(/[ ,]/);c=a.length;if(c===9||c===11)a[c-4]=a[c-2]=B(a[c-2])-10*b;return a.join(" ")}, shadow:function(a,b,c){var d=[],e,f=this.element,g=this.renderer,h,i=f.style,j,k=f.path,l,m,n,o;k&&typeof k.value!=="string"&&(k="x");m=k;if(a){n=p(a.width,3);o=(a.opacity||0.15)/n;for(e=1;e<=3;e++){l=n*2+1-2*e;c&&(m=this.cutOffPath(k.value,l+0.5));j=[''];h=ca(g.prepVML(j),null,{left:B(i.left)+p(a.offsetX,1),top:B(i.top)+p(a.offsetY,1)});if(c)h.cutOff=l+1;j=[''];ca(g.prepVML(j),null,null,h);b?b.element.appendChild(h):f.parentNode.insertBefore(h,f);d.push(h)}this.shadows=d}return this},updateShadows:Ca,setAttr:function(a,b){ob?this.element[a]=b:this.element.setAttribute(a,b)},classSetter:function(a){this.element.className=a},dashstyleSetter:function(a,b,c){(c.getElementsByTagName("stroke")[0]||ca(this.renderer.prepVML([""]),null,null,c))[b]=a||"solid";this[b]=a},dSetter:function(a,b,c){var d=this.shadows,a=a||[];this.d= a.join&&a.join(" ");c.path=a=this.pathToVML(a);if(d)for(c=d.length;c--;)d[c].path=d[c].cutOff?this.cutOffPath(a,d[c].cutOff):a;this.setAttr(b,a)},fillSetter:function(a,b,c){var d=c.nodeName;if(d==="SPAN")c.style.color=a;else if(d!=="IMG")c.filled=a!=="none",this.setAttr("fillcolor",this.renderer.color(a,c,b,this))},"fill-opacitySetter":function(a,b,c){ca(this.renderer.prepVML(["<",b.split("-")[0],' opacity="',a,'"/>']),null,null,c)},opacitySetter:Ca,rotationSetter:function(a,b,c){c=c.style;this[b]= c[b]=a;c.left=-C(da(a*ka)+1)+"px";c.top=C(W(a*ka))+"px"},strokeSetter:function(a,b,c){this.setAttr("strokecolor",this.renderer.color(a,c,b,this))},"stroke-widthSetter":function(a,b,c){c.stroked=!!a;this[b]=a;I(a)&&(a+="px");this.setAttr("strokeweight",a)},titleSetter:function(a,b){this.setAttr(b,a)},visibilitySetter:function(a,b,c){a==="inherit"&&(a="visible");this.shadows&&q(this.shadows,function(c){c.style[b]=a});c.nodeName==="DIV"&&(a=a==="hidden"?"-999em":0,ob||(c.style[b]=a?"visible":"hidden"), b="top");c.style[b]=a},displaySetter:function(a,b,c){c.style[b]=a},xSetter:function(a,b,c){this[b]=a;b==="x"?b="left":b==="y"&&(b="top");this.updateClipping?(this[b]=a,this.updateClipping()):c.style[b]=a},zIndexSetter:function(a,b,c){c.style[b]=a}};P["stroke-opacitySetter"]=P["fill-opacitySetter"];u.VMLElement=P=sa(J,P);P.prototype.ySetter=P.prototype.widthSetter=P.prototype.heightSetter=P.prototype.xSetter;var Eb={Element:P,isIE8:Ba.indexOf("MSIE 8.0")>-1,init:function(a,b,c,d){var e;this.alignedObjects= [];d=this.createElement(Pa).css(x(this.getStyle(d),{position:"relative"}));e=d.element;a.appendChild(d.element);this.isVML=!0;this.box=e;this.boxWrapper=d;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(b,c,!1);if(!y.namespaces.hcv){y.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{y.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(f){y.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}}, isHidden:function(){return!this.box.offsetWidth},clipRect:function(a,b,c,d){var e=this.createElement(),f=ba(a);return x(e,{members:[],count:0,left:(f?a.x:a)+1,top:(f?a.y:b)+1,width:(f?a.width:c)-1,height:(f?a.height:d)-1,getCSS:function(a){var b=a.element,c=b.nodeName,a=a.inverted,d=this.top-(c==="shape"?b.offsetTop:0),e=this.left,b=e+this.width,f=d+this.height,d={clip:"rect("+C(a?e:d)+"px,"+C(a?f:b)+"px,"+C(a?b:f)+"px,"+C(a?d:e)+"px)"};!a&&ob&&c==="DIV"&&x(d,{width:b+"px",height:f+"px"});return d}, updateClipping:function(){q(e.members,function(a){a.element&&a.css(e.getCSS(a))})}})},color:function(a,b,c,d){var e=this,f,g=/^rgba/,h,i,j="none";a&&a.linearGradient?i="gradient":a&&a.radialGradient&&(i="pattern");if(i){var k,l,m=a.linearGradient||a.radialGradient,n,o,A,r,p,w="",a=a.stops,v,s=[],t=function(){h=[''];ca(e.prepVML(h),null,null,b)};n=a[0];v=a[a.length-1];n[0]>0&&a.unshift([0, n[1]]);v[0]<1&&a.push([1,v[1]]);q(a,function(a,b){g.test(a[1])?(f=na(a[1]),k=f.get("rgb"),l=f.get("a")):(k=a[1],l=1);s.push(a[0]*100+"% "+k);b?(A=l,r=k):(o=l,p=k)});if(c==="fill")if(i==="gradient")c=m.x1||m[0]||0,a=m.y1||m[1]||0,n=m.x2||m[2]||0,m=m.y2||m[3]||0,w='angle="'+(90-Z.atan((m-a)/(n-c))*180/ta)+'"',t();else{var j=m.r,aa=j*2,x=j*2,u=m.cx,C=m.cy,z=b.radialReference,y,j=function(){z&&(y=d.getBBox(),u+=(z[0]-y.x)/y.width-0.5,C+=(z[1]-y.y)/y.height-0.5,aa*=z[2]/y.width,x*=z[2]/y.height);w='src="'+ T.global.VMLRadialGradientURL+'" size="'+aa+","+x+'" origin="0.5,0.5" position="'+u+","+C+'" color2="'+p+'" ';t()};d.added?j():d.onAdd=j;j=r}else j=k}else if(g.test(a)&&b.tagName!=="IMG")f=na(a),d[c+"-opacitySetter"](f.get("a"),c,b),j=f.get("rgb");else{j=b.getElementsByTagName(c);if(j.length)j[0].opacity=1,j[0].type="solid";j=a}return j},prepVML:function(a){var b=this.isIE8,a=a.join("");b?(a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'): a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):a=a.replace("<","1&&f.attr({x:b,y:c,width:d,height:e});return f},createElement:function(a){return a==="rect"?this.symbol(a):Fa.prototype.createElement.call(this,a)},invertChild:function(a,b){var c=this,d=b.style,e=a.tagName==="IMG"&&a.style;M(a,{flip:"x",left:B(d.width)-(e?B(e.top):1),top:B(d.height)-(e?B(e.left):1),rotation:-90});q(a.childNodes,function(b){c.invertChild(b,a)})},symbols:{arc:function(a,b,c,d,e){var f=e.start,g=e.end,h=e.r||c|| d,c=e.innerR,d=W(f),i=da(f),j=W(g),k=da(g);if(g-f===0)return["x"];f=["wa",a-h,b-h,a+h,b+h,a+h*d,b+h*i,a+h*j,b+h*k];e.open&&!c&&f.push("e",X,a,b);f.push("at",a-c,b-c,a+c,b+c,a+c*j,b+c*k,a+c*d,b+c*i,"x","e");f.isArc=!0;return f},circle:function(a,b,c,d,e){e&&(c=d=2*e.r);e&&e.isCircle&&(a-=c/2,b-=d/2);return["wa",a,b,a+c,b+d,a+c,b+d/2,a+c,b+d/2,"e"]},rect:function(a,b,c,d,e){return Fa.prototype.symbols[!s(e)||!e.r?"square":"callout"].call(0,a,b,c,d,e)}}};u.VMLRenderer=P=function(){this.init.apply(this, arguments)};P.prototype=E(Fa.prototype,Eb);fb=P}Fa.prototype.measureSpanWidth=function(a,b){var c=y.createElement("span"),d;d=y.createTextNode(a);c.appendChild(d);M(c,b);this.box.appendChild(c);d=c.offsetWidth;Va(c);return d};var Qb;if(la)u.CanVGRenderer=P=function(){Ia="http://www.w3.org/1999/xhtml"},P.prototype.symbols={},Qb=function(){function a(){var a=b.length,d;for(d=0;d0&&c+i*j>e&&(n=C((d-c)/W(h*ka)));else if(d=c+(1-i)*j,c-i*je&&(l=e-a.x+l*i,m=-1),l=F(k,l),ll||b.autoRotation&&g.styles.width)n=l;if(n){o.width=n;if(!b.options.labels.style.textOverflow)o.textOverflow="ellipsis";g.css(o)}},getPosition:function(a,b,c,d){var e=this.axis,f=e.chart,g=d&&f.oldChartHeight||f.chartHeight;return{x:a?e.translate(b+ c,null,null,d)+e.transB:e.left+e.offset+(e.opposite?(d&&f.oldChartWidth||f.chartWidth)-e.right-e.left:0),y:a?g-e.bottom+e.offset-(e.opposite?e.height:0):g-e.translate(b+c,null,null,d)-e.transB}},getLabelPosition:function(a,b,c,d,e,f,g,h){var i=this.axis,j=i.transA,k=i.reversed,l=i.staggerLines,m=i.tickRotCorr||{x:0,y:0},n=e.y;s(n)||(n=i.side===0?c.rotation?-8:-c.getBBox().height:i.side===2?m.y+8:W(c.rotation*ka)*(m.y-c.getBBox(!1,0).height/2));a=a+e.x+m.x-(f&&d?f*j*(k?-1:1):0);b=b+n-(f&&!d?f*j*(k? 1:-1):0);l&&(c=g/(h||1)%l,i.opposite&&(c=l-c-1),b+=c*(i.labelOffset/l));return{x:a,y:C(b)}},getMarkPath:function(a,b,c,d,e,f){return f.crispLine([X,a,b,S,a+(e?0:-c),b+(e?c:0)],d)},render:function(a,b,c){var d=this.axis,e=d.options,f=d.chart.renderer,g=d.horiz,h=this.type,i=this.label,j=this.pos,k=e.labels,l=this.gridLine,m=h?h+"Grid":"grid",n=h?h+"Tick":"tick",o=e[m+"LineWidth"],A=e[m+"LineColor"],r=e[m+"LineDashStyle"],m=d.tickSize(n),n=e[n+"Color"],q=this.mark,w=k.step,v=!0,s=d.tickmarkOffset,t= this.getPosition(g,j,s,b),aa=t.x,t=t.y,x=g&&aa===d.pos+d.len||!g&&t===d.pos?-1:1,c=p(c,1);this.isActive=!0;if(o){j=d.getPlotLinePath(j+s,o*x,b,!0);if(l===z){l={stroke:A,"stroke-width":o};if(r)l.dashstyle=r;if(!h)l.zIndex=1;if(b)l.opacity=0;this.gridLine=l=o?f.path(j).attr(l).add(d.gridGroup):null}if(!b&&l&&j)l[this.isNew?"attr":"animate"]({d:j,opacity:c})}if(m)d.opposite&&(m[0]=-m[0]),h=this.getMarkPath(aa,t,m[0],m[1]*x,g,f),q?q.animate({d:h,opacity:c}):this.mark=f.path(h).attr({stroke:n,"stroke-width":m[1], opacity:c}).add(d.axisGroup);if(i&&I(aa))i.xy=t=this.getLabelPosition(aa,t,i,g,k,s,a,w),this.isFirst&&!this.isLast&&!p(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!p(e.showLastLabel,1)?v=!1:g&&!d.isRadial&&!k.step&&!k.rotation&&!b&&c!==0&&this.handleOverflow(t),w&&a%w&&(v=!1),v&&I(t.y)?(t.opacity=c,i[this.isNew?"attr":"animate"](t)):(Ka(i),i.attr("y",-9999)),this.isNew=!1},destroy:function(){Ua(this,this.axis)}};u.PlotLineOrBand=function(a,b){this.axis=a;if(b)this.options=b,this.id=b.id};u.PlotLineOrBand.prototype= {render:function(){var a=this,b=a.axis,c=b.horiz,d=a.options,e=d.label,f=a.label,g=d.width,h=d.to,i=d.from,j=s(i)&&s(h),k=d.value,l=d.dashStyle,m=a.svgElem,n=[],o,A=d.color,r=p(d.zIndex,0),q=d.events,w={},v=b.chart.renderer,n=b.log2lin;b.isLog&&(i=n(i),h=n(h),k=n(k));if(g){if(n=b.getPlotLinePath(k,g),w={stroke:A,"stroke-width":g},l)w.dashstyle=l}else if(j){n=b.getPlotBandPath(i,h,d);if(A)w.fill=A;if(d.borderWidth)w.stroke=d.borderColor,w["stroke-width"]=d.borderWidth}else return;w.zIndex=r;if(m)if(n)m.show(), m.animate({d:n});else{if(m.hide(),f)a.label=f=f.destroy()}else if(n&&n.length&&(a.svgElem=m=v.path(n).attr(w).add(),q))for(o in d=function(b){m.on(b,function(c){q[b].apply(a,[c])})},q)d(o);e&&s(e.text)&&n&&n.length&&b.width>0&&b.height>0&&!n.flat?(e=E({align:c&&j&&"center",x:c?!j&&4:10,verticalAlign:!c&&j&&"middle",y:c?j?16:10:j?6:-4,rotation:c&&!j&&90},e),this.renderLabel(e,n,j,r)):f&&f.hide();return a},renderLabel:function(a,b,c,d){var e=this.label,f=this.axis.chart.renderer;if(!e)e={align:a.textAlign|| a.align,rotation:a.rotation},e.zIndex=d,this.label=e=f.text(a.text,0,0,a.useHTML).attr(e).css(a.style).add();d=[b[1],b[4],c?b[6]:b[1]];b=[b[2],b[5],c?b[7]:b[2]];c=Oa(d);f=Oa(b);e.align(a,!1,{x:c,y:f,width:Ha(d)-c,height:Ha(b)-f});e.show()},destroy:function(){ra(this.axis.plotLinesAndBands,this);delete this.axis;Ua(this)}};var ia=u.Axis=function(){this.init.apply(this,arguments)};ia.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M", day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#D8D8D8",labels:{enabled:!0,style:{color:"#606060",cursor:"default",fontSize:"11px"},x:0},lineColor:"#C0D0E0",lineWidth:1,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",title:{align:"middle", style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return u.numberFormat(this.total,-1)},style:E(ga.line.dataLabels.style,{color:"#000000"})}},defaultLeftAxisOptions:{labels:{x:-15},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45], x:0},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},init:function(a,b){var c=b.isX;this.chart=a;this.horiz=a.inverted?!c:c;this.isXAxis=c;this.coll=this.coll||(c?"xAxis":"yAxis");this.opposite=b.opposite;this.side=b.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(b);var d=this.options,e=d.type;this.labelFormatter=d.labels.formatter||this.defaultLabelFormatter;this.userOptions=b;this.minPixelPadding=0;this.reversed=d.reversed;this.visible= d.visible!==!1;this.zoomEnabled=d.zoomEnabled!==!1;this.hasNames=e==="category"||d.categories===!0;this.categories=d.categories||this.hasNames;this.names=this.names||[];this.isLog=e==="logarithmic";this.isDatetimeAxis=e==="datetime";this.isLinked=s(d.linkedTo);this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=d.minRange||d.maxZoom;this.range=d.range;this.offset=d.offset||0;this.stacks={};this.oldStacks={}; this.stacksTouched=0;this.min=this.max=null;this.crosshair=p(d.crosshair,ua(a.options.tooltip.crosshairs)[c?0:1],!1);var f,d=this.options.events;pa(this,a.axes)===-1&&(c?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||[];if(a.inverted&&c&&this.reversed===z)this.reversed=!0;this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(f in d)N(this,f,d[f]);if(this.isLog)this.val2lin=this.log2lin,this.lin2val=this.lin2log},setOptions:function(a){this.options= E(this.defaultOptions,this.coll==="yAxis"&&this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],E(T[this.coll],a))},defaultLabelFormatter:function(){var a=this.axis,b=this.value,c=a.categories,d=this.dateTimeLabelFormat,e=T.lang.numericSymbols,f=e&&e.length,g,h=a.options.labels.format,a=a.isLog?b:a.tickInterval;if(h)g=Na(h,this);else if(c)g=b;else if(d)g=Ta(d,b);else if(f&&a>=1E3)for(;f--&&g===z;)c= Math.pow(1E3,f+1),a>=c&&b*10%c===0&&e[f]!==null&&b!==0&&(g=u.numberFormat(b/c,-1)+e[f]);g===z&&(g=Q(b)>=1E4?u.numberFormat(b,-1):u.numberFormat(b,-1,z,""));return g},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.threshold=null;a.softThreshold=!a.isXAxis;a.buildStacks&&a.buildStacks();q(a.series,function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries){var d=c.options,e=d.threshold,f;a.hasVisibleSeries=!0;a.isLog&&e<=0&&(e=null);if(a.isXAxis){if(d= c.xData,d.length)c=Oa(d),!I(c)&&!(c instanceof ma)&&(d=Da(d,function(a){return I(a)}),c=Oa(d)),a.dataMin=F(p(a.dataMin,d[0]),c),a.dataMax=t(p(a.dataMax,d[0]),Ha(d))}else{c.getExtremes();f=c.dataMax;c=c.dataMin;if(s(c)&&s(f))a.dataMin=F(p(a.dataMin,c),c),a.dataMax=t(p(a.dataMax,f),f);if(s(e))a.threshold=e;if(!d.softThreshold||a.isLog)a.softThreshold=!1}}})},translate:function(a,b,c,d,e,f){var g=this.linkedParent||this,h=1,i=0,j=d?g.oldTransA:g.transA,d=d?g.oldMin:g.min,k=g.minPixelPadding,e=(g.isOrdinal|| g.isBroken||g.isLog&&e)&&g.lin2val;if(!j)j=g.transA;if(c)h*=-1,i=g.len;g.reversed&&(h*=-1,i-=h*(g.sector||g.len));b?(a=a*h+i,a-=k,a=a/j+d,e&&(a=g.lin2val(a))):(e&&(a=g.val2lin(a)),f==="between"&&(f=0.5),a=h*(a-d)*j+i+h*k+(I(f)?j*f*g.pointRange:0));return a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a-(b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,b,c,d,e){var f=this.chart,g=this.left,h=this.top, i,j,k=c&&f.oldChartHeight||f.chartHeight,l=c&&f.oldChartWidth||f.chartWidth,m;i=this.transB;var n=function(a,b,c){if(ac)d?a=F(t(b,a),c):m=!0;return a},e=p(e,this.translate(a,null,null,c)),a=c=C(e+i);i=j=C(k-e-i);I(e)?this.horiz?(i=h,j=k-this.bottom,a=c=n(a,g,g+this.width)):(a=g,c=l-this.right,i=j=n(i,h,h+this.height)):m=!0;return m&&!d?null:f.renderer.crispLine([X,a,i,S,c,j],b||1)},getLinearTickPositions:function(a,b,c){var d,e=$(V(b/a)*a),f=$(va(c/a)*a),g=[];if(b===c&&I(b))return[b];for(b= e;b<=f;){g.push(b);b=$(b+a);if(b===d)break;d=b}return g},getMinorTickPositions:function(){var a=this.options,b=this.tickPositions,c=this.minorTickInterval,d=[],e,f=this.pointRangePadding||0;e=this.min-f;var f=this.max+f,g=f-e;if(g&&g/c=this.minRange,f,g,h,i,j,k;if(this.isXAxis&&this.minRange===z&&!this.isLog)s(a.min)||s(a.max)?this.minRange=null:(q(this.series,function(a){i=a.xData;for(g=j=a.xIncrement?1:i.length-1;g>0;g--)if(h=i[g]-i[g-1],f===z||h0)this.names.length=0,this.minRange=void 0,q(this.series||[],function(b){b.processedXData||(b.processData(),b.generatePoints());q(b.points,function(c,d){var e;if(c.options&&c.options.x===void 0&&(e=a.nameToX(c),e!==c.x))c.x=e,b.xData[d]=e})})},setAxisTranslation:function(a){var b= this,c=b.max-b.min,d=b.axisPointRange||0,e,f=0,g=0,h=b.linkedParent,i=!!b.categories,j=b.transA,k=b.isXAxis;if(k||i||d)if(h?(f=h.minPointOffset,g=h.pointRangePadding):(e=b.getClosest(),q(b.series,function(a){var c=i?1:k?p(a.options.pointRange,e,0):b.axisPointRange||0,a=a.options.pointPlacement;d=t(d,c);b.single||(f=t(f,ya(a)?0:c/2),g=t(g,a==="on"?0:c))})),h=b.ordinalSlope&&e?b.ordinalSlope/e:1,b.minPointOffset=f*=h,b.pointRangePadding=g*=h,b.pointRange=F(d,c),k)b.closestPointRange=e;if(a)b.oldTransA= j;b.translationSlope=b.transA=j=b.len/(c+g||1);b.transB=b.horiz?b.left:b.bottom;b.minPixelPadding=j*f},minFromRange:function(){return this.max-this.range},setTickInterval:function(a){var b=this,c=b.chart,d=b.options,e=b.isLog,f=b.log2lin,g=b.isDatetimeAxis,h=b.isXAxis,i=b.isLinked,j=d.maxPadding,k=d.minPadding,l=d.tickInterval,m=d.tickPixelInterval,n=b.categories,o=b.threshold,A=b.softThreshold,r,K,w,v;!g&&!n&&!i&&this.getTickAmount();w=p(b.userMin,d.min);v=p(b.userMax,d.max);i?(b.linkedParent=c[b.coll][d.linkedTo], c=b.linkedParent.getExtremes(),b.min=p(c.min,c.dataMin),b.max=p(c.max,c.dataMax),d.type!==b.linkedParent.options.type&&ea(11,1)):(!A&&s(o)&&(b.dataMin>=o?(r=o,k=0):b.dataMax<=o&&(K=o,j=0)),b.min=p(w,r,b.dataMin),b.max=p(v,K,b.dataMax));if(e)!a&&F(b.min,p(b.dataMin,b.min))<=0&&ea(10,1),b.min=$(f(b.min),15),b.max=$(f(b.max),15);if(b.range&&s(b.max))b.userMin=b.min=w=t(b.min,b.minFromRange()),b.userMax=v=b.max,b.range=null;H(b,"foundExtremes");b.beforePadding&&b.beforePadding();b.adjustForMinRange(); if(!n&&!b.axisPointRange&&!b.usePercentage&&!i&&s(b.min)&&s(b.max)&&(f=b.max-b.min))!s(w)&&k&&(b.min-=f*k),!s(v)&&j&&(b.max+=f*j);if(I(d.floor))b.min=t(b.min,d.floor);if(I(d.ceiling))b.max=F(b.max,d.ceiling);if(A&&s(b.dataMin))if(o=o||0,!s(w)&&b.min=o)b.min=o;else if(!s(v)&&b.max>o&&b.dataMax<=o)b.max=o;b.tickInterval=b.min===b.max||b.min===void 0||b.max===void 0?1:i&&!l&&m===b.linkedParent.options.tickPixelInterval?l=b.linkedParent.tickInterval:p(l,this.tickAmount?(b.max-b.min)/t(this.tickAmount- 1,1):void 0,n?1:(b.max-b.min)*m/t(b.len,m));h&&!a&&q(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)});b.setAxisTranslation(!0);b.beforeSetTickPositions&&b.beforeSetTickPositions();if(b.postProcessTickInterval)b.tickInterval=b.postProcessTickInterval(b.tickInterval);if(b.pointRange&&!l)b.tickInterval=t(b.pointRange,b.tickInterval);a=p(d.minTickInterval,b.isDatetimeAxis&&b.closestPointRange);if(!l&&b.tickInterval0.5&&b.tickInterval<5&&b.max>1E3&&b.max<9999)),!!this.tickAmount);if(!this.tickAmount)b.tickInterval=b.unsquish();this.setTickPositions()},setTickPositions:function(){var a=this.options,b,c=a.tickPositions,d=a.tickPositioner,e=a.startOnTick,f=a.endOnTick,g;this.tickmarkOffset=this.categories&&a.tickmarkPlacement==="between"&&this.tickInterval===1?0.5:0;this.minorTickInterval=a.minorTickInterval==="auto"&&this.tickInterval?this.tickInterval/ 5:a.minorTickInterval;this.tickPositions=b=c&&c.slice();if(!b&&(b=this.isDatetimeAxis?this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval,a.units),this.min,this.max,a.startOfWeek,this.ordinalPositions,this.closestPointRange,!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max),b.length>this.len&&(b=[b[0],b.pop()]),this.tickPositions=b,d&&(d=d.apply(this,[this.min,this.max]))))this.tickPositions= b=d;if(!this.isLinked)this.trimTicks(b,e,f),this.min===this.max&&s(this.min)&&!this.tickAmount&&(g=!0,this.min-=0.5,this.max+=0.5),this.single=g,!c&&!d&&this.adjustTickAmount()},trimTicks:function(a,b,c){var d=a[0],e=a[a.length-1],f=this.minPointOffset||0;if(b)this.min=d;else for(;this.min-f>a[0];)a.shift();if(c)this.max=e;else for(;this.max+fc&&(this.tickInterval*=2,this.setTickPositions());if(s(d)){for(a=c=b.length;a--;)(d===3&&a%2===1||d<=2&&a>0&&a=e&&(b=e));this.displayBtn=a!==z||b!==z;this.setExtremes(a,b,!1,z,{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsetLeft||0,d=this.horiz,e=p(b.width, a.plotWidth-c+(b.offsetRight||0)),f=p(b.height,a.plotHeight),g=p(b.top,a.plotTop),b=p(b.left,a.plotLeft+c),c=/%$/;c.test(f)&&(f=Math.round(parseFloat(f)/100*a.plotHeight));c.test(g)&&(g=Math.round(parseFloat(g)/100*a.plotHeight+a.plotTop));this.left=b;this.top=g;this.width=e;this.height=f;this.bottom=a.chartHeight-f-g;this.right=a.chartWidth-e-b;this.len=t(d?e:f,0);this.pos=d?b:g},getExtremes:function(){var a=this.isLog,b=this.lin2log;return{min:a?$(b(this.min)):this.min,max:a?$(b(this.max)):this.max, dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,c=this.lin2log,d=b?c(this.min):this.min,b=b?c(this.max):this.max;a===null?a=d:d>a?a=d:b15&&a<165?"right":a>195&&a<345?"left":"center"},tickSize:function(a){var b=this.options,c=b[a+"Length"],d=p(b[a+"Width"],a==="tick"&&this.isXAxis?1:0);if(d&&c)return b[a+"Position"]=== "inside"&&(c=-c),[c,d]},labelMetrics:function(){return this.chart.renderer.fontMetrics(this.options.labels.style.fontSize,this.ticks[0]&&this.ticks[0].label)},unsquish:function(){var a=this.options.labels,b=this.horiz,c=this.tickInterval,d=c,e=this.len/(((this.categories?1:0)+this.max-this.min)/c),f,g=a.rotation,h=this.labelMetrics(),i,j=Number.MAX_VALUE,k,l=function(a){a/=e||1;a=a>1?va(a):1;return a*c};b?(k=!a.staggerLines&&!a.step&&(s(g)?[g]:e=-90&&a<=90)i=l(Q(h.h/da(ka*a))),b=i+Q(a/360),bm)m=a.labelLength});this.maxLabelLength=m;if(this.autoRotation)m>h&&m>j.h?i.rotation=this.labelRotation:this.labelRotation=0;else if(g&&(l={width:h+"px"},!k)){l.textOverflow="clip";for(n=c.length;!f&&n--;)if(o=c[n],h=d[o].label)if(h.styles.textOverflow=== "ellipsis"?h.css({textOverflow:"clip"}):d[o].labelLength>g&&h.css({width:g+"px"}),h.getBBox().height>this.len/c.length-(j.h-j.f))h.specCss={textOverflow:"ellipsis"}}if(i.rotation&&(l={width:(m>a.chartHeight*0.5?a.chartHeight*0.33:a.chartHeight)+"px"},!k))l.textOverflow="ellipsis";if(this.labelAlign=e.align||this.autoLabelAlign(this.labelRotation))i.align=this.labelAlign;q(c,function(a){var b=(a=d[a])&&a.label;if(b)b.attr(i),l&&b.css(E(l,b.specCss)),delete b.specCss,a.rotation=i.rotation});this.tickRotCorr= b.rotCorr(j.b,this.labelRotation||0,this.side!==0)},hasData:function(){return this.hasVisibleSeries||s(this.min)&&s(this.max)&&!!this.tickPositions},getOffset:function(){var a=this,b=a.chart,c=b.renderer,d=a.options,e=a.tickPositions,f=a.ticks,g=a.horiz,h=a.side,i=b.inverted?[1,0,3,2][h]:h,j,k,l=0,m,n=0,o=d.title,A=d.labels,r=0,K=a.opposite,w=b.axisOffset,b=b.clipOffset,v=[-1,1,1,-1][h],x,u=a.axisParent,aa=this.tickSize("tick");j=a.hasData();a.showAxis=k=j||p(d.showEmpty,!0);a.staggerLines=a.horiz&& A.staggerLines;if(!a.axisGroup)a.gridGroup=c.g("grid").attr({zIndex:d.gridZIndex||1}).add(u),a.axisGroup=c.g("axis").attr({zIndex:d.zIndex||2}).add(u),a.labelGroup=c.g("axis-labels").attr({zIndex:A.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels").add(u);if(j||a.isLinked){if(q(e,function(b){f[b]?f[b].addLabel():f[b]=new Ya(a,b)}),a.renderUnsquish(),A.reserveSpace!==!1&&(h===0||h===2||{1:"left",3:"right"}[h]===a.labelAlign||a.labelAlign==="center")&&q(e,function(a){r=t(f[a].getLabelSize(), r)}),a.staggerLines)r*=a.staggerLines,a.labelOffset=r*(a.opposite?-1:1)}else for(x in f)f[x].destroy(),delete f[x];if(o&&o.text&&o.enabled!==!1){if(!a.axisTitle)(x=o.textAlign)||(x=(g?{low:"left",middle:"center",high:"right"}:{low:K?"right":"left",middle:"center",high:K?"left":"right"})[o.align]),a.axisTitle=c.text(o.text,0,0,o.useHTML).attr({zIndex:7,rotation:o.rotation||0,align:x}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(o.style).add(a.axisGroup),a.axisTitle.isNew=!0;if(k)l= a.axisTitle.getBBox()[g?"height":"width"],m=o.offset,n=s(m)?0:p(o.margin,g?5:10);a.axisTitle[k?"show":"hide"](!0)}a.offset=v*p(d.offset,w[h]);a.tickRotCorr=a.tickRotCorr||{x:0,y:0};c=h===0?-a.labelMetrics().h:h===2?a.tickRotCorr.y:0;n=Math.abs(r)+n;r&&(n-=c,n+=v*(g?p(A.y,a.tickRotCorr.y+v*8):A.x));a.axisTitleMargin=p(m,n);w[h]=t(w[h],a.axisTitleMargin+l+v*a.offset,n,j&&e.length&&aa?aa[0]:0);d=d.offset?0:V(d.lineWidth/2)*2;b[i]=t(b[i],d)},getLinePath:function(a){var b=this.chart,c=this.opposite,d= this.offset,e=this.horiz,f=this.left+(c?this.width:0)+d,d=b.chartHeight-this.bottom-(c?this.height:0)+d;c&&(a*=-1);return b.renderer.crispLine([X,e?this.left:f,e?d:this.top,S,e?b.chartWidth-this.right:f,e?d:b.chartHeight-this.bottom],a)},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,d=this.len,e=this.options.title,f=a?b:c,g=this.opposite,h=this.offset,i=e.x||0,j=e.y||0,k=this.chart.renderer.fontMetrics(e.style.fontSize).f,d={low:f+(a?0:d),middle:f+d/2,high:f+(a?d:0)}[e.align], b=(a?c+this.height:b)+(a?1:-1)*(g?-1:1)*this.axisTitleMargin+(this.side===2?k:0);return{x:a?d+i:b+(g?this.width:0)+h+i,y:a?b+j-(g?this.height:0)+h:d+j}},render:function(){var a=this,b=a.chart,c=b.renderer,d=a.options,e=a.isLog,f=a.lin2log,g=a.isLinked,h=a.tickPositions,i=a.axisTitle,j=a.ticks,k=a.minorTicks,l=a.alternateBands,m=d.stackLabels,n=d.alternateGridColor,o=a.tickmarkOffset,A=d.lineWidth,r,p=b.hasRendered&&I(a.oldMin),w=a.showAxis,v=Wa(c.globalAnimation),s,t;a.labelEdge.length=0;a.overlap= !1;q([j,k,l],function(a){for(var b in a)a[b].isActive=!1});if(a.hasData()||g){a.minorTickInterval&&!a.categories&&q(a.getMinorTickPositions(),function(b){k[b]||(k[b]=new Ya(a,b,"minor"));p&&k[b].isNew&&k[b].render(null,!0);k[b].render(null,!1,1)});if(h.length&&(q(h,function(b,c){if(!g||b>=a.min&&b<=a.max)j[b]||(j[b]=new Ya(a,b)),p&&j[b].isNew&&j[b].render(c,!0,0.1),j[b].render(c)}),o&&(a.min===0||a.single)))j[-1]||(j[-1]=new Ya(a,-1,null,!0)),j[-1].render(-1);n&&q(h,function(c,d){t=h[d+1]!==z?h[d+ 1]+o:a.max-o;if(d%2===0&&c=G.second?0:k*V(i.getMilliseconds()/k));if(j>=G.second)i[Jb](j>=G.minute?0:k*V(i.getSeconds()/k));if(j>=G.minute)i[Kb](j>=G.hour?0:k*V(i[xb]()/k));if(j>=G.hour)i[Lb](j>=G.day?0:k*V(i[yb]()/k));if(j>=G.day)i[nb](j>=G.month?1:k*V(i[Xa]()/k));j>=G.month&&(i[Ab](j>=G.year?0:k*V(i[db]()/k)),h=i[eb]());j>=G.year&&(h-=h%k,i[Bb](h));if(j===G.week)i[nb](i[Xa]()- i[zb]()+p(d,1));b=1;if(ub||bb)i=i.getTime(),i=new ma(i+ab(i));h=i[eb]();for(var d=i.getTime(),l=i[db](),m=i[Xa](),n=!g||!!bb,o=(G.day+(g?ab(i):i.getTimezoneOffset()*6E4))%G.day;d=0.5)a=C(a),i=this.getLinearTickPositions(a,b,c);else if(a>=0.08)for(var f=V(b),j,k,l,m,n,e=a>0.3?[1,2,4]:a>0.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];fb&&(!d||m<=c)&&m!==z&&i.push(m),m>c&&(n=!0),m=l}else if(b=g(b),c=g(c),a=e[d?"minorTickInterval":"tickInterval"],a=p(a==="auto"?null:a,this._minorAutoInterval,(c-b)*(e.tickPixelInterval/ (d?5:1))/((d?f/this.tickPositions.length:f)||1)),a=wb(a,null,vb(a)),i=Ea(this.getLinearTickPositions(a,b,c),h),!d)this._minorAutoInterval=a/5;if(!d)this.tickInterval=a;return i};ia.prototype.log2lin=function(a){return Z.log(a)/Z.LN10};ia.prototype.lin2log=function(a){return Z.pow(10,a)};var Rb=u.Tooltip=function(){this.init.apply(this,arguments)};Rb.prototype={init:function(a,b){var c=b.borderWidth,d=b.style,e=B(d.padding);this.chart=a;this.options=b;this.crosshairs=[];this.now={x:0,y:0};this.isHidden= !0;this.label=a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:e,fill:b.backgroundColor,"stroke-width":c,r:b.borderRadius,zIndex:8,display:"none"}).css(d).css({padding:0}).add();la||this.label.shadow(b.shadow);this.shared=b.shared},destroy:function(){if(this.label)this.label=this.label.destroy();clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,b,c,d){var e=this,f=e.now,g=e.options.animation!==!1&&!e.isHidden&&(Q(a-f.x)>1|| Q(b-f.y)>1),h=e.followPointer||e.len>1;x(f,{x:g?(2*f.x+a)/3:a,y:g?(f.y+b)/2:b,anchorX:h?z:g?(2*f.anchorX+c)/3:c,anchorY:h?z:g?(f.anchorY+d)/2:d});e.label.attr(f);if(g)clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&&e.move(a,b,c,d)},32)},hide:function(a){var b=this;clearTimeout(this.hideTimer);a=p(a,this.options.hideDelay,500);if(!this.isHidden)this.hideTimer=Sa(function(){b.label[a?"fadeOut":"hide"]();b.isHidden=!0},a)},getAnchor:function(a,b){var c,d=this.chart,e=d.inverted, f=d.plotTop,g=d.plotLeft,h=0,i=0,j,k,a=ua(a);c=a[0].tooltipPos;this.followPointer&&b&&(b.chartX===z&&(b=d.pointer.normalize(b)),c=[b.chartX-d.plotLeft,b.chartY-f]);c||(q(a,function(a){j=a.series.yAxis;k=a.series.xAxis;h+=a.plotX+(!e&&k?k.left-g:0);i+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&j?j.top-f:0)}),h/=a.length,i/=a.length,c=[e?d.plotWidth-i:h,this.shared&&!e&&a.length>1&&b?b.chartY-f:e?d.plotHeight-h:i]);return Ea(c,C)},getPosition:function(a,b,c){var d=this.chart,e=this.distance, f={},g=c.h||0,h,i=["y",d.chartHeight,b,c.plotY+d.plotTop,d.plotTop,d.plotTop+d.plotHeight],j=["x",d.chartWidth,a,c.plotX+d.plotLeft,d.plotLeft,d.plotLeft+d.plotWidth],k=!this.followPointer&&p(c.ttBelow,!d.inverted===!!c.negative),l=function(a,b,c,d,h,i){var j=cb?d:d+g);else return!1},m=function(a,b,c,d){var g;db-e?g=!1:f[a]=db-c/2?b-c-2:d-c/2;return g},n=function(a){var b= i;i=j;j=b;h=a},o=function(){l.apply(0,i)!==!1?m.apply(0,j)===!1&&!h&&(n(!0),o()):h?f.x=f.y=0:(n(!0),o())};(d.inverted||this.len>1)&&n();o();return f},defaultFormatter:function(a){var b=this.points||ua(this),c;c=[a.tooltipFooterHeaderFormatter(b[0])];c=c.concat(a.bodyFormatter(b));c.push(a.tooltipFooterHeaderFormatter(b[0],!0));return c.join("")},refresh:function(a,b){var c=this.chart,d=this.label,e=this.options,f,g,h,i={},j,k=[];j=e.formatter||this.defaultFormatter;var i=c.hoverPoints,l,m=this.shared; clearTimeout(this.hideTimer);this.followPointer=ua(a)[0].series.tooltipOptions.followPointer;h=this.getAnchor(a,b);f=h[0];g=h[1];m&&(!a.series||!a.series.noSharedTooltip)?(c.hoverPoints=a,i&&q(i,function(a){a.setState()}),q(a,function(a){a.setState("hover");k.push(a.getLabelConfig())}),i={x:a[0].category,y:a[0].y},i.points=k,this.len=k.length,a=a[0]):i=a.getLabelConfig();j=j.call(i,this);i=a.series;this.distance=p(i.tooltipOptions.distance,16);j===!1?this.hide():(this.isHidden&&(Ka(d),d.attr({opacity:1, display:"block"}).show()),d.attr({text:j}),l=e.borderColor||a.color||i.color||"#606060",d.attr({stroke:l}),this.updatePosition({plotX:f,plotY:g,negative:a.negative,ttBelow:a.ttBelow,h:h[2]||0}),this.isHidden=!1);H(c,"tooltipRefresh",{text:j,x:f+c.plotLeft,y:g+c.plotTop,borderColor:l})},updatePosition:function(a){var b=this.chart,c=this.label,c=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);this.move(C(c.x),C(c.y||0),a.plotX+b.plotLeft,a.plotY+b.plotTop)},getXDateFormat:function(a, b,c){var d,b=b.dateTimeLabelFormats,e=c&&c.closestPointRange,f,g={millisecond:15,second:12,minute:9,hour:6,day:3},h,i="millisecond";if(e){h=Ta("%m-%d %H:%M:%S.%L",a.x);for(f in G){if(e===G.week&&+Ta("%w",a.x)===c.options.startOfWeek&&h.substr(6)==="00:00:00.000"){f="week";break}if(G[f]>e){f=i;break}if(g[f]&&h.substr(g[f])!=="01-01 00:00:00.000".substr(g[f]))break;f!=="week"&&(i=f)}f&&(d=b[f])}else d=b.day;return d||b.year},tooltipFooterHeaderFormatter:function(a,b){var c=b?"footer":"header",d=a.series, e=d.tooltipOptions,f=e.xDateFormat,g=d.xAxis,h=g&&g.options.type==="datetime"&&I(a.key),c=e[c+"Format"];h&&!f&&(f=this.getXDateFormat(a,e,g));h&&f&&(c=c.replace("{point.key}","{point.key:"+f+"}"));return Na(c,{point:a,series:d})},bodyFormatter:function(a){return Ea(a,function(a){var c=a.series.tooltipOptions;return(c.pointFormatter||a.point.tooltipFormatter).call(a.point,c.pointFormat)})}};var ja;gb=y&&y.documentElement.ontouchstart!==z;var $a=u.Pointer=function(a,b){this.init(a,b)};$a.prototype= {init:function(a,b){var c=b.chart,d=c.events,e=la?"":c.zoomType,c=a.inverted,f;this.options=b;this.chart=a;this.zoomX=f=/x/.test(e);this.zoomY=e=/y/.test(e);this.zoomHor=f&&!c||e&&c;this.zoomVert=e&&!c||f&&c;this.hasZoom=f||e;this.runChartClick=d&&!!d.click;this.pinchDown=[];this.lastValidTouch={};if(u.Tooltip&&b.tooltip.enabled)a.tooltip=new Rb(a,b.tooltip),this.followTouchMove=p(b.tooltip.followTouchMove,!0);this.setDOMEvents()},normalize:function(a,b){var c,d,a=a||D.event;if(!a.target)a.target= a.srcElement;d=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;if(!b)this.chartPosition=b=Db(this.chart.container);d.pageX===z?(c=t(a.x,a.clientX-b.left),d=a.y):(c=d.pageX-b.left,d=d.pageY-b.top);return x(a,{chartX:C(c),chartY:C(d)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};q(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})});return b},runPointActions:function(a){var b=this.chart,c=b.series,d=b.tooltip, e=d?d.shared:!1,f=!0,g=b.hoverPoint,h=b.hoverSeries,i,j,k,l=[],m;if(!e&&!h)for(i=0;i b.series.group.zIndex?-1:1;return c!==0?c:d!==0?d:e}));if(e)for(i=l.length;i--;)(l[i].clientX!==l[0].clientX||l[i].series.noSharedTooltip)&&l.splice(i,1);if(l[0]&&(l[0]!==this.hoverPoint||d&&d.isHidden)){if(e&&!l[0].series.noSharedTooltip){for(i=0;i>=0;i--)l[i].onMouseOver(a,l[i]!==(h&&h.directTouch&&g||l[0]));if(h&&h.directTouch&&g&&g!==l[0])g.onMouseOver(a,!1);l.length&&d&&d.refresh(l.sort(function(a,b){return a.series.index-b.series.index}),a)}else if(d&&d.refresh(l[0],a),!h||!h.directTouch)l[0].onMouseOver(a); this.prevKDPoint=l[0];f=!1}f&&(c=h&&h.tooltipOptions.followPointer,d&&c&&!d.isHidden&&(c=d.getAnchor([{}],a),d.updatePosition({plotX:c[0],plotY:c[1]})));if(!this._onDocumentMouseMove)this._onDocumentMouseMove=function(a){if(U[ja])U[ja].pointer.onDocumentMouseMove(a)},N(y,"mousemove",this._onDocumentMouseMove);q(e?l:[p(g,l[0])],function(c){q(b.axes,function(b){(!c||c.series&&c.series[b.coll]===b)&&b.drawCrosshair(a,c)})})},reset:function(a,b){var c=this.chart,d=c.hoverSeries,e=c.hoverPoint,f=c.hoverPoints, g=c.tooltip,h=g&&g.shared?f:e;a&&h&&q(ua(h),function(b){b.series.isCartesian&&b.plotX===void 0&&(a=!1)});if(a)g&&h&&(g.refresh(h),e&&(e.setState(e.state,!0),q(c.axes,function(a){a.crosshair&&a.drawCrosshair(null,e)})));else{if(e)e.onMouseOut();f&&q(f,function(a){a.setState()});if(d)d.onMouseOut();g&&g.hide(b);if(this._onDocumentMouseMove)Y(y,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null;q(c.axes,function(a){a.hideCrosshair()});this.hoverX=this.prevKDPoint=c.hoverPoints=c.hoverPoint= null}},scaleGroups:function(a,b){var c=this.chart,d;q(c.series,function(e){d=a||e.getPlotBox();e.xAxis&&e.xAxis.zoomEnabled&&(e.group.attr(d),e.markerGroup&&(e.markerGroup.attr(d),e.markerGroup.clip(b?c.clipRect:null)),e.dataLabelsGroup&&e.dataLabelsGroup.attr(d))});c.clipRect.attr(b||c.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type;b.cancelClick=!1;b.mouseDownX=this.mouseDownX=a.chartX;b.mouseDownY=this.mouseDownY=a.chartY},drag:function(a){var b=this.chart,c=b.options.chart, d=a.chartX,e=a.chartY,f=this.zoomHor,g=this.zoomVert,h=b.plotLeft,i=b.plotTop,j=b.plotWidth,k=b.plotHeight,l,m=this.selectionMarker,n=this.mouseDownX,o=this.mouseDownY,p=c.panKey&&a[c.panKey+"Key"];if(!m||!m.touch)if(dh+j&&(d=h+j),ei+k&&(e=i+k),this.hasDragged=Math.sqrt(Math.pow(n-d,2)+Math.pow(o-e,2)),this.hasDragged>10){l=b.isInsidePlot(n-h,o-i);if(b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&l&&!p&&!m)this.selectionMarker=m=b.renderer.rect(h,i,f?1:j,g?1:k,0).attr({fill:c.selectionMarkerFill|| "rgba(69,114,167,0.25)",zIndex:7}).add();m&&f&&(d-=n,m.attr({width:Q(d),x:(d>0?0:d)+n}));m&&g&&(d=e-o,m.attr({height:Q(d),y:(d>0?0:d)+o}));l&&!m&&c.panning&&b.pan(a,c.panning)}},drop:function(a){var b=this,c=this.chart,d=this.hasPinched;if(this.selectionMarker){var e={originalEvent:a,xAxis:[],yAxis:[]},f=this.selectionMarker,g=f.attr?f.attr("x"):f.x,h=f.attr?f.attr("y"):f.y,i=f.attr?f.attr("width"):f.width,j=f.attr?f.attr("height"):f.height,k;if(this.hasDragged||d)q(c.axes,function(c){if(c.zoomEnabled&& s(c.min)&&(d||b[{xAxis:"zoomX",yAxis:"zoomY"}[c.coll]])){var f=c.horiz,n=a.type==="touchend"?c.minPixelPadding:0,o=c.toValue((f?g:h)+n),f=c.toValue((f?g+i:h+j)-n);e[c.coll].push({axis:c,min:F(o,f),max:t(o,f)});k=!0}}),k&&H(c,"selection",e,function(a){c.zoom(x(a,d?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();d&&this.scaleGroups()}if(c)M(c.container,{cursor:c._cursor}),c.cancelClick=this.hasDragged>10,c.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[]}, onContainerMouseDown:function(a){a=this.normalize(a);a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(a){U[ja]&&U[ja].pointer.drop(a)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition,a=this.normalize(a,c);c&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&this.reset()},onContainerMouseLeave:function(a){var b=U[ja];if(b&&(a.relatedTarget||a.toElement))b.pointer.reset(),b.pointer.chartPosition= null},onContainerMouseMove:function(a){var b=this.chart;if(!s(ja)||!U[ja]||!U[ja].mouseIsDown)ja=b.index;a=this.normalize(a);a.returnValue=!1;b.mouseIsDown==="mousedown"&&this.drag(a);(this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop))&&!b.openMenu&&this.runPointActions(a)},inClass:function(a,b){for(var c;a;){if(c=O(a,"class")){if(c.indexOf(b)!==-1)return!0;if(c.indexOf("highcharts-container")!==-1)return!1}a=a.parentNode}},onTrackerMouseOut:function(a){var b= this.chart.hoverSeries,a=a.relatedTarget||a.toElement;if(b&&a&&!b.options.stickyTracking&&!this.inClass(a,"highcharts-tooltip")&&!this.inClass(a,"highcharts-series-"+b.index))b.onMouseOut()},onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop,a=this.normalize(a);b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(H(c.series,"click",x(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(x(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY- e)&&H(b,"click",a)))},setDOMEvents:function(){var a=this,b=a.chart.container;b.onmousedown=function(b){a.onContainerMouseDown(b)};b.onmousemove=function(b){a.onContainerMouseMove(b)};b.onclick=function(b){a.onContainerClick(b)};N(b,"mouseleave",a.onContainerMouseLeave);hb===1&&N(y,"mouseup",a.onDocumentMouseUp);if(gb)b.ontouchstart=function(b){a.onContainerTouchStart(b)},b.ontouchmove=function(b){a.onContainerTouchMove(b)},hb===1&&N(y,"touchend",a.onDocumentTouchEnd)},destroy:function(){var a;Y(this.chart.container, "mouseleave",this.onContainerMouseLeave);hb||(Y(y,"mouseup",this.onDocumentMouseUp),Y(y,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(a in this)this[a]=null}};x(u.Pointer.prototype,{pinchTranslate:function(a,b,c,d,e,f){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,b,c,d,e,f);(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,b,c,d,e,f)},pinchTranslateDirection:function(a,b,c,d,e,f,g,h){var i=this.chart,j=a?"x":"y",k=a?"X":"Y",l="chart"+ k,m=a?"width":"height",n=i["plot"+(a?"Left":"Top")],o,p,r=h||1,q=i.inverted,w=i.bounds[a?"h":"v"],v=b.length===1,t=b[0][l],s=c[0][l],x=!v&&b[1][l],u=!v&&c[1][l],z,c=function(){!v&&Q(t-x)>20&&(r=h||Q(s-u)/Q(t-x));p=(n-s)/r+t;o=i["plot"+(a?"Width":"Height")]/r};c();b=p;bw.max&&(b=w.max-o,z=!0);z?(s-=0.8*(s-g[j][0]),v||(u-=0.8*(u-g[j][1])),c()):g[j]=[s,u];q||(f[j]=p-n,f[m]=o);f=q?1/r:r;e[m]=o;e[j]=b;d[q?a?"scaleY":"scaleX":"scale"+k]=r;d["translate"+k]=f*n+(s-f*t)},pinch:function(a){var b= this,c=b.chart,d=b.pinchDown,e=a.touches,f=e.length,g=b.lastValidTouch,h=b.hasZoom,i=b.selectionMarker,j={},k=f===1&&(b.inClass(a.target,"highcharts-tracker")&&c.runTrackerClick||b.runChartClick),l={};if(f>1)b.initiated=!0;h&&b.initiated&&!k&&a.preventDefault();Ea(e,function(a){return b.normalize(a)});if(a.type==="touchstart")q(e,function(a,b){d[b]={chartX:a.chartX,chartY:a.chartY}}),g.x=[d[0].chartX,d[1]&&d[1].chartX],g.y=[d[0].chartY,d[1]&&d[1].chartY],q(c.axes,function(a){if(a.zoomEnabled){var b= c.bounds[a.horiz?"h":"v"],d=a.minPixelPadding,e=a.toPixels(p(a.options.min,a.dataMin)),f=a.toPixels(p(a.options.max,a.dataMax)),g=F(e,f),e=t(e,f);b.min=F(a.pos,g-d);b.max=t(a.pos+a.len,e+d)}}),b.res=!0;else if(d.length){if(!i)b.selectionMarker=i=x({destroy:Ca,touch:!0},c.plotBox);b.pinchTranslate(d,e,j,i,l,g);b.hasPinched=h;b.scaleGroups(j,l);if(!h&&b.followTouchMove&&f===1)this.runPointActions(b.normalize(a));else if(b.res)b.res=!1,this.reset(!1,0)}},touch:function(a,b){var c=this.chart,d;ja=c.index; if(a.touches.length===1)if(a=this.normalize(a),c.isInsidePlot(a.chartX-c.plotLeft,a.chartY-c.plotTop)&&!c.openMenu){b&&this.runPointActions(a);if(a.type==="touchmove")c=this.pinchDown,d=c[0]?Math.sqrt(Math.pow(c[0].chartX-a.chartX,2)+Math.pow(c[0].chartY-a.chartY,2))>=4:!1;p(d,!0)&&this.pinch(a)}else b&&this.reset();else a.touches.length===2&&this.pinch(a)},onContainerTouchStart:function(a){this.touch(a,!0)},onContainerTouchMove:function(a){this.touch(a)},onDocumentTouchEnd:function(a){U[ja]&&U[ja].pointer.drop(a)}}); if(D.PointerEvent||D.MSPointerEvent){var wa={},Fb=!!D.PointerEvent,Ub=function(){var a,b=[];b.item=function(a){return this[a]};for(a in wa)wa.hasOwnProperty(a)&&b.push({pageX:wa[a].pageX,pageY:wa[a].pageY,target:wa[a].target});return b},Gb=function(a,b,c,d){if((a.pointerType==="touch"||a.pointerType===a.MSPOINTER_TYPE_TOUCH)&&U[ja])d(a),d=U[ja].pointer,d[b]({type:c,target:a.currentTarget,preventDefault:Ca,touches:Ub()})};x($a.prototype,{onContainerPointerDown:function(a){Gb(a,"onContainerTouchStart", "touchstart",function(a){wa[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){Gb(a,"onContainerTouchMove","touchmove",function(a){wa[a.pointerId]={pageX:a.pageX,pageY:a.pageY};if(!wa[a.pointerId].target)wa[a.pointerId].target=a.currentTarget})},onDocumentPointerUp:function(a){Gb(a,"onDocumentTouchEnd","touchend",function(a){delete wa[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,Fb?"pointerdown":"MSPointerDown",this.onContainerPointerDown); a(this.chart.container,Fb?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(y,Fb?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});ib($a.prototype,"init",function(a,b,c){a.call(this,b,c);this.hasZoom&&M(b.container,{"-ms-touch-action":"none","touch-action":"none"})});ib($a.prototype,"setDOMEvents",function(a){a.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(N)});ib($a.prototype,"destroy",function(a){this.batchMSEvents(Y);a.call(this)})}var sb=u.Legend=function(a, b){this.init(a,b)};sb.prototype={init:function(a,b){var c=this,d=b.itemStyle,e=b.itemMarginTop||0;this.options=b;if(b.enabled)c.itemStyle=d,c.itemHiddenStyle=E(d,b.itemHiddenStyle),c.itemMarginTop=e,c.padding=d=p(b.padding,8),c.initialItemX=d,c.initialItemY=d-5,c.maxItemWidth=0,c.chart=a,c.itemHeight=0,c.symbolWidth=p(b.symbolWidth,16),c.pages=[],c.render(),N(c.chart,"endResize",function(){c.positionCheckboxes()})},colorizeItem:function(a,b){var c=this.options,d=a.legendItem,e=a.legendLine,f=a.legendSymbol, g=this.itemHiddenStyle.color,c=b?c.itemStyle.color:g,h=b?a.legendColor||a.color||"#CCC":g,g=a.options&&a.options.marker,i={fill:h},j;d&&d.css({fill:c,color:c});e&&e.attr({stroke:h});if(f){if(g&&f.isMarker)for(j in i.stroke=h,g=a.convertAttribs(g),g)d=g[j],d!==z&&(i[j]=d);f.attr(i)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,e=d[0],d=d[1],f=a.checkbox;(a=a.legendGroup)&&a.element&&a.translate(b?e:this.legendWidth-e-2*c-4,d);if(f)f.x=e,f.y=d},destroyItem:function(a){var b= a.checkbox;q(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())});b&&Va(a.checkbox)},destroy:function(){var a=this.group,b=this.box;if(b)this.box=b.destroy();if(a)this.group=a.destroy()},positionCheckboxes:function(a){var b=this.group.alignAttr,c,d=this.clipHeight||this.legendHeight,e=this.titleHeight;if(b)c=b.translateY,q(this.allItems,function(f){var g=f.checkbox,h;g&&(h=c+e+g.y+(a||0)+3,M(g,{left:b.translateX+f.checkboxOffset+g.x-20+"px",top:h+"px", display:h>c-6&&h(m||b.chartWidth-2*j-A-d.x))this.itemX=A,this.itemY+=o+this.lastLineHeight+n,this.lastLineHeight=0;this.maxItemWidth=t(this.maxItemWidth,f);this.lastItemY=o+this.itemY+n;this.lastLineHeight=t(g,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];e?this.itemX+=f:(this.itemY+=o+g+n,this.lastLineHeight=g);this.offsetWidth=m||t((e?this.itemX-A-k:f)+j,this.offsetWidth)},getAllItems:function(){var a=[];q(this.chart.series, function(b){var c=b.options;if(p(c.showInLegend,!s(c.linkedTo)?z:!1,!0))a=a.concat(b.legendItems||(c.legendType==="point"?b.data:b))});return a},adjustMargins:function(a,b){var c=this.chart,d=this.options,e=d.align.charAt(0)+d.verticalAlign.charAt(0)+d.layout.charAt(0);d.floating||q([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/],function(f,g){f.test(e)&&!s(a[g])&&(c[qb[g]]=t(c[qb[g]],c.legend[(g+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][g]*d[g%2?"x":"y"]+p(d.margin,12)+b[g]))})}, render:function(){var a=this,b=a.chart,c=b.renderer,d=a.group,e,f,g,h,i=a.box,j=a.options,k=a.padding,l=j.borderWidth,m=j.backgroundColor;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;if(!d)a.group=d=c.g("legend").attr({zIndex:7}).add(),a.contentGroup=c.g().attr({zIndex:1}).add(d),a.scrollGroup=c.g().add(a.contentGroup);a.renderTitle();e=a.getAllItems();kb(e,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});j.reversed&& e.reverse();a.allItems=e;a.display=f=!!e.length;a.lastLineHeight=0;q(e,function(b){a.renderItem(b)});g=(j.width||a.offsetWidth)+k;h=a.lastItemY+a.lastLineHeight+a.titleHeight;h=a.handleOverflow(h);h+=k;if(l||m){if(i){if(g>0&&h>0)i[i.isNew?"attr":"animate"](i.crisp({width:g,height:h})),i.isNew=!1}else a.box=i=c.rect(0,0,g,h,j.borderRadius,l||0).attr({stroke:j.borderColor,"stroke-width":l||0,fill:m||"none"}).add(d).shadow(j.shadow),i.isNew=!0;i[f?"show":"hide"]()}a.legendWidth=g;a.legendHeight=h;q(e, function(b){a.positionItem(b)});f&&d.align(x({width:g,height:h},j),!0,"spacingBox");b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=this,c=this.chart,d=c.renderer,e=this.options,f=e.y,f=c.spacingBox.height+(e.verticalAlign==="top"?-f:f)-this.padding,g=e.maxHeight,h,i=this.clipRect,j=e.navigation,k=p(j.animation,!0),l=j.arrowSize||12,m=this.nav,n=this.pages,o=this.padding,A,r=this.allItems,s=function(a){i.attr({height:a});if(b.contentGroup.div)b.contentGroup.div.style.clip= "rect("+o+"px,9999px,"+(o+a)+"px,0)"};e.layout==="horizontal"&&(f/=2);g&&(f=F(f,g));n.length=0;if(a>f&&j.enabled!==!1){this.clipHeight=h=t(f-20-this.titleHeight-o,0);this.currentPage=p(this.currentPage,1);this.fullHeight=a;q(r,function(a,b){var c=a._legendItemPos[1],d=C(a.legendItem.getBBox().height),e=n.length;if(!e||c-n[e-1]>h&&(A||c)!==n[e-1])n.push(A||c),e++;b===r.length-1&&c+d-n[e-1]>h&&n.push(c);c!==A&&(A=c)});if(!i)i=b.clipRect=d.clipRect(0,o,9999,0),b.contentGroup.clip(i);s(h);if(!m)this.nav= m=d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,l,l).on("click",function(){b.scroll(-1,k)}).add(m),this.pager=d.text("",15,10).css(j.style).add(m),this.down=d.symbol("triangle-down",0,0,l,l).on("click",function(){b.scroll(1,k)}).add(m);b.scroll(0);a=f}else if(m)s(c.chartHeight),m.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0;return a},scroll:function(a,b){var c=this.pages,d=c.length,e=this.currentPage+a,f=this.clipHeight,g=this.options.navigation,h=g.activeColor, g=g.inactiveColor,i=this.pager,j=this.padding;e>d&&(e=d);if(e>0)b!==z&&cb(b,this.chart),this.nav.attr({translateX:j,translateY:f+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:e===1?g:h}).css({cursor:e===1?"default":"pointer"}),i.attr({text:e+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,fill:e===d?g:h}).css({cursor:e===d?"default":"pointer"}),c=-c[e-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=e,this.positionCheckboxes(c)}};P= u.LegendSymbolMixin={drawRectangle:function(a,b){var c=a.options.symbolHeight||a.fontMetrics.f;b.legendSymbol=this.chart.renderer.rect(0,a.baseline-c+1,a.symbolWidth,c,a.options.symbolRadius||0).attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var b=this.options,c=b.marker,d=a.symbolWidth,e=this.chart.renderer,f=this.legendGroup,a=a.baseline-C(a.fontMetrics.b*0.3),g;if(b.lineWidth){g={"stroke-width":b.lineWidth};if(b.dashStyle)g.dashstyle=b.dashStyle;this.legendLine=e.path([X,0,a,S, d,a]).attr(g).add(f)}if(c&&c.enabled!==!1)b=c.radius,this.legendSymbol=c=e.symbol(this.symbol,d/2-b,a-b,2*b,2*b,c).add(f),c.isMarker=!0}};(/Trident\/7\.0/.test(Ba)||Qa)&&ib(sb.prototype,"positionItem",function(a,b){var c=this,d=function(){b._legendItemPos&&a.call(c,b)};d();setTimeout(d)});var jb=u.Chart=function(){this.getArgs.apply(this,arguments)};u.chart=function(a,b,c){return new jb(a,b,c)};jb.prototype={callbacks:[],getArgs:function(){var a=[].slice.call(arguments);if(ya(a[0])||a[0].nodeName)this.renderTo= a.shift();this.init(a[0],a[1])},init:function(a,b){var c,d=a.series;a.series=null;c=E(T,a);c.series=a.series=d;this.userOptions=a;d=c.chart;this.margin=this.splashArray("margin",d);this.spacing=this.splashArray("spacing",d);var e=d.events;this.bounds={h:{},v:{}};this.callback=b;this.isResizing=0;this.options=c;this.axes=[];this.series=[];this.hasCartesianSeries=d.showAxes;var f=this,g;f.index=U.length;U.push(f);hb++;d.reflow!==!1&&N(f,"load",function(){f.initReflow()});if(e)for(g in e)N(f,g,e[g]); f.xAxis=[];f.yAxis=[];f.animation=la?!1:p(d.animation,!0);f.pointCount=f.colorCounter=f.symbolCounter=0;f.firstRender()},initSeries:function(a){var b=this.options.chart;(b=L[a.type||b.type||b.defaultSeriesType])||ea(17,!0);b=new b;b.init(this,a);return b},isInsidePlot:function(a,b,c){var d=c?b:a,a=c?a:b;return d>=0&&d<=this.plotWidth&&a>=0&&a<=this.plotHeight},redraw:function(a){var b=this.axes,c=this.series,d=this.pointer,e=this.legend,f=this.isDirtyLegend,g,h,i=this.hasCartesianSeries,j=this.isDirtyBox, k=c.length,l=k,m=this.renderer,n=m.isHidden(),o=[];cb(a,this);n&&this.cloneRenderTo();for(this.layOutTitles();l--;)if(a=c[l],a.options.stacking&&(g=!0,a.isDirty)){h=!0;break}if(h)for(l=k;l--;)if(a=c[l],a.options.stacking)a.isDirty=!0;q(c,function(a){a.isDirty&&a.options.legendType==="point"&&(a.updateTotals&&a.updateTotals(),f=!0);a.isDirtyData&&H(a,"updatedData")});if(f&&e.options.enabled)e.render(),this.isDirtyLegend=!1;g&&this.getStacks();if(i&&!this.isResizing)this.maxTicks=null,q(b,function(a){a.updateNames(); a.setScale()});this.getMargins();i&&(q(b,function(a){a.isDirty&&(j=!0)}),q(b,function(a){var b=a.min+","+a.max;if(a.extKey!==b)a.extKey=b,o.push(function(){H(a,"afterSetExtremes",x(a.eventArgs,a.getExtremes()));delete a.eventArgs});(j||g)&&a.redraw()}));j&&this.drawChartBox();q(c,function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()});d&&d.reset(!0);m.draw();H(this,"redraw");n&&this.cloneRenderTo(!0);q(o,function(a){a.call()})},get:function(a){var b=this.axes,c=this.series,d,e;for(d= 0;d19?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container; if(a){if(b){for(;b.childNodes.length;)this.renderTo.appendChild(b.firstChild);Va(b);delete this.renderToClone}}else c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),M(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),y.body.appendChild(b),c&&b.appendChild(c)},getContainer:function(){var a,b=this.options,c=b.chart,d,e;a=this.renderTo;var f="highcharts-"+Cb++;if(!a)this.renderTo= a=c.renderTo;if(ya(a))this.renderTo=a=y.getElementById(a);a||ea(13,!0);d=B(O(a,"data-highcharts-chart"));I(d)&&U[d]&&U[d].hasRendered&&U[d].destroy();O(a,"data-highcharts-chart",this.index);a.innerHTML="";!c.skipClone&&!a.offsetWidth&&this.cloneRenderTo();this.getChartSize();d=this.chartWidth;e=this.chartHeight;this.container=a=ca(Pa,{className:"highcharts-container"+(c.className?" "+c.className:""),id:f},x({position:"relative",overflow:"hidden",width:d+"px",height:e+"px",textAlign:"left",lineHeight:"normal", zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},c.style),this.renderToClone||a);this._cursor=a.style.cursor;this.renderer=new (u[c.renderer]||fb)(a,d,e,c.style,c.forExport,b.exporting&&b.exporting.allowHTML);la&&this.renderer.create(this,a,d,e);this.renderer.chartIndex=this.index},getMargins:function(a){var b=this.spacing,c=this.margin,d=this.titleOffset;this.resetMargins();if(d&&!s(c[0]))this.plotTop=t(this.plotTop,d+this.options.title.margin+b[0]);this.legend.display&&this.legend.adjustMargins(c, b);this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);a||this.getAxisMargins()},getAxisMargins:function(){var a=this,b=a.axisOffset=[0,0,0,0],c=a.margin;a.hasCartesianSeries&&q(a.axes,function(a){a.visible&&a.getOffset()});q(qb,function(d,e){s(c[e])||(a[d]+=b[e])});a.setChartSize()},reflow:function(a){var b=this,c=b.options.chart,d=b.renderTo,e=s(c.width),f=c.width||oa(d,"width"),c=c.height||oa(d,"height"),d=a?a.target:D;if(!e&& !b.isPrinting&&f&&c&&(d===D||d===y)){if(f!==b.containerWidth||c!==b.containerHeight)clearTimeout(b.reflowTimeout),b.reflowTimeout=Sa(function(){b.container&&b.setSize(void 0,void 0,!1)},a?100:0);b.containerWidth=f;b.containerHeight=c}},initReflow:function(){var a=this,b=function(b){a.reflow(b)};N(D,"resize",b);N(a,"destroy",function(){Y(D,"resize",b)})},setSize:function(a,b,c){var d=this,e=d.renderer;d.isResizing+=1;cb(c,d);d.oldChartHeight=d.chartHeight;d.oldChartWidth=d.chartWidth;if(a!==void 0)d.options.chart.width= a;if(b!==void 0)d.options.chart.height=b;d.getChartSize();a=e.globalAnimation;(a?Za:M)(d.container,{width:d.chartWidth+"px",height:d.chartHeight+"px"},a);d.setChartSize(!0);e.setSize(d.chartWidth,d.chartHeight,c);d.maxTicks=null;q(d.axes,function(a){a.isDirty=!0;a.setScale()});q(d.series,function(a){a.isDirty=!0});d.isDirtyLegend=!0;d.isDirtyBox=!0;d.layOutTitles();d.getMargins();d.redraw(c);d.oldChartHeight=null;H(d,"resize");Sa(function(){d&&H(d,"endResize",null,function(){d.isResizing-=1})},Wa(a).duration)}, setChartSize:function(a){var b=this.inverted,c=this.renderer,d=this.chartWidth,e=this.chartHeight,f=this.options.chart,g=this.spacing,h=this.clipOffset,i,j,k,l;this.plotLeft=i=C(this.plotLeft);this.plotTop=j=C(this.plotTop);this.plotWidth=k=t(0,C(d-i-this.marginRight));this.plotHeight=l=t(0,C(e-j-this.marginBottom));this.plotSizeX=b?l:k;this.plotSizeY=b?k:l;this.plotBorderWidth=f.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:d-g[3]-g[1],height:e-g[0]-g[2]};this.plotBox=c.plotBox= {x:i,y:j,width:k,height:l};d=2*V(this.plotBorderWidth/2);b=va(t(d,h[3])/2);c=va(t(d,h[0])/2);this.clipBox={x:b,y:c,width:V(this.plotSizeX-t(d,h[1])/2-b),height:t(0,V(this.plotSizeY-t(d,h[2])/2-c))};a||q(this.axes,function(a){a.setAxisSize();a.setAxisTranslation()})},resetMargins:function(){var a=this;q(qb,function(b,c){a[b]=p(a.margin[c],a.spacing[c])});a.axisOffset=[0,0,0,0];a.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight, e=this.chartBackground,f=this.plotBackground,g=this.plotBorder,h=this.plotBGImage,i=a.borderWidth||0,j=a.backgroundColor,k=a.plotBackgroundColor,l=a.plotBackgroundImage,m=a.plotBorderWidth||0,n,o=this.plotLeft,p=this.plotTop,r=this.plotWidth,q=this.plotHeight,w=this.plotBox,v=this.clipRect,s=this.clipBox;n=i+(a.shadow?8:0);if(i||j)if(e)e.animate(e.crisp({width:c-n,height:d-n}));else{e={fill:j||"none"};if(i)e.stroke=a.borderColor,e["stroke-width"]=i;this.chartBackground=b.rect(n/2,n/2,c-n,d-n,a.borderRadius, i).attr(e).addClass("highcharts-background").add().shadow(a.shadow)}if(k)f?f.animate(w):this.plotBackground=b.rect(o,p,r,q,0).attr({fill:k}).add().shadow(a.plotShadow);if(l)h?h.animate(w):this.plotBGImage=b.image(l,o,p,r,q).add();v?v.animate({width:s.width,height:s.height}):this.clipRect=b.clipRect(s);if(m)g?(g.strokeWidth=-m,g.animate(g.crisp({x:o,y:p,width:r,height:q}))):this.plotBorder=b.rect(o,p,r,q,0,-m).attr({stroke:a.plotBorderColor,"stroke-width":m,fill:"none",zIndex:1}).add();this.isDirtyBox= !1},propFromSeries:function(){var a=this,b=a.options.chart,c,d=a.options.series,e,f;q(["inverted","angular","polar"],function(g){c=L[b.type||b.defaultSeriesType];f=a[g]||b[g]||c&&c.prototype[g];for(e=d&&d.length;!f&&e--;)(c=L[d[e].type])&&c.prototype[g]&&(f=!0);a[g]=f})},linkSeries:function(){var a=this,b=a.series;q(b,function(a){a.linkedSeries.length=0});q(b,function(b){var d=b.options.linkedTo;if(ya(d)&&(d=d===":previous"?a.series[b.index-1]:a.get(d))&&d.linkedParent!==b)d.linkedSeries.push(b), b.linkedParent=d,b.visible=p(b.options.visible,d.options.visible,b.visible)})},renderSeries:function(){q(this.series,function(a){a.translate();a.render()})},renderLabels:function(){var a=this,b=a.options.labels;b.items&&q(b.items,function(c){var d=x(b.style,c.style),e=B(d.left)+a.plotLeft,f=B(d.top)+a.plotTop+12;delete d.left;delete d.top;a.renderer.text(c.html,e,f).attr({zIndex:2}).css(d).add()})},render:function(){var a=this.axes,b=this.renderer,c=this.options,d,e,f,g;this.setTitle();this.legend= new sb(this,c.legend);this.getStacks&&this.getStacks();this.getMargins(!0);this.setChartSize();d=this.plotWidth;e=this.plotHeight-=21;q(a,function(a){a.setScale()});this.getAxisMargins();f=d/this.plotWidth>1.1;g=e/this.plotHeight>1.05;if(f||g)this.maxTicks=null,q(a,function(a){(a.horiz&&f||!a.horiz&&g)&&a.setTickInterval(!0)}),this.getMargins();this.drawChartBox();this.hasCartesianSeries&&q(a,function(a){a.visible&&a.render()});if(!this.seriesGroup)this.seriesGroup=b.g("series-group").attr({zIndex:3}).add(); this.renderSeries();this.renderLabels();this.showCredits(c.credits);this.hasRendered=!0},showCredits:function(a){if(a.enabled&&!this.credits)this.credits=this.renderer.text(a.text,0,0).on("click",function(){if(a.href)D.location.href=a.href}).attr({align:a.position.align,zIndex:8}).css(a.style).add().align(a.position)},destroy:function(){var a=this,b=a.axes,c=a.series,d=a.container,e,f=d&&d.parentNode;H(a,"destroy");U[a.index]=z;hb--;a.renderTo.removeAttribute("data-highcharts-chart");Y(a);for(e=b.length;e--;)b[e]= b[e].destroy();for(e=c.length;e--;)c[e]=c[e].destroy();q("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(b){var c=a[b];c&&c.destroy&&(a[b]=c.destroy())});if(d)d.innerHTML="",Y(d),f&&Va(d);for(e in a)delete a[e]},isReadyToRender:function(){var a=this;return!fa&&D==D.top&&y.readyState!=="complete"||la&&!D.canvg?(la?Qb.push(function(){a.firstRender()},a.options.global.canvasToolsURL): y.attachEvent("onreadystatechange",function(){y.detachEvent("onreadystatechange",a.firstRender);y.readyState==="complete"&&a.firstRender()}),!1):!0},firstRender:function(){var a=this,b=a.options;if(a.isReadyToRender()){a.getContainer();H(a,"init");a.resetMargins();a.setChartSize();a.propFromSeries();a.getAxes();q(b.series||[],function(b){a.initSeries(b)});a.linkSeries();H(a,"beforeRender");if(u.Pointer)a.pointer=new $a(a,b);a.render();a.renderer.draw();if(!a.renderer.imgCount&&a.onload)a.onload(); a.cloneRenderTo(!0)}},onload:function(){var a=this;q([this.callback].concat(this.callbacks),function(b){b&&a.index!==void 0&&b.apply(a,[a])});H(a,"load");this.onload=null},splashArray:function(a,b){var c=b[a],c=ba(c)?c:[c,c,c,c];return[p(b[a+"Top"],c[0]),p(b[a+"Right"],c[1]),p(b[a+"Bottom"],c[2]),p(b[a+"Left"],c[3])]}};var Eb=u.CenteredSeriesMixin={getCenter:function(){var a=this.options,b=this.chart,c=2*(a.slicedOffset||0),d=b.plotWidth-2*c,b=b.plotHeight-2*c,e=a.center,e=[p(e[0],"50%"),p(e[1],"50%"), a.size||"100%",a.innerSize||0],f=F(d,b),g,h;for(g=0;g<4;++g)h=e[g],a=g<2||g===2&&/%$/.test(h),e[g]=(/%$/.test(h)?[d,b,f,e[2]][g]*parseFloat(h)/100:parseFloat(h))+(a?c:0);e[3]>e[2]&&(e[3]=e[2]);return e}},Ma=function(){};Ma.prototype={init:function(a,b,c){this.series=a;this.color=a.color;this.applyOptions(b,c);this.pointAttr={};if(a.options.colorByPoint&&(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter++],a.colorCounter===b.length))a.colorCounter=0;a.chart.pointCount++; return this},applyOptions:function(a,b){var c=this.series,d=c.options.pointValKey||c.pointValKey,a=Ma.prototype.optionsToObject.call(this,a);x(this,a);this.options=this.options?x(this.options,a):a;a.group&&delete this.group;if(d)this.y=this[d];this.isNull=p(this.isValid&&!this.isValid(),this.x===null||!I(this.y,!0));if("name"in this&&b===void 0&&c.xAxis&&c.xAxis.hasNames)this.x=c.xAxis.nameToX(this);if(this.x===void 0&&c)this.x=b===void 0?c.autoIncrement(this):b;return this},optionsToObject:function(a){var b= {},c=this.series,d=c.options.keys,e=d||c.pointArrayMap||["y"],f=e.length,g=0,h=0;if(I(a)||a===null)b[e[0]]=a;else if(za(a)){if(!d&&a.length>f){c=typeof a[0];if(c==="string")b.name=a[0];else if(c==="number")b.x=a[0];g++}for(;hm){for(c=0;k===null&&ci||this.forceCrop))if(b[d- 1]o)b=[],c=[];else if(b[0]o)e=this.cropData(this.xData,this.yData,n,o),b=e.xData,c=e.yData,e=e.start,f=!0;for(i=b.length||1;--i;)d=m?j(b[i])-j(b[i-1]):b[i]-b[i-1],d>0&&(g===z||d=c){f=t(0,i-h);break}for(c=i;cd){g=c+h;break}return{xData:a.slice(f, g),yData:b.slice(f,g),start:f,end:g}},generatePoints:function(){var a=this.options.data,b=this.data,c,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,i,j=this.hasGroupedData,k,l=[],m;if(!b&&!j)b=[],b.length=a.length,b=this.data=b;for(m=0;m0),j=this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||(c[l+1]||j)>=g&&(c[l-1]||j)<=h,i&&j)if(i=k.length)for(;i--;)k[i]!== null&&(e[f++]=k[i]);else e[f++]=k;this.dataMin=Oa(e);this.dataMax=Ha(e)},translate:function(){this.processedXData||this.processData();this.generatePoints();for(var a=this.options,b=a.stacking,c=this.xAxis,d=c.categories,e=this.yAxis,f=this.points,g=f.length,h=!!this.modifyValue,i=a.pointPlacement,j=i==="between"||I(i),k=a.threshold,l=a.startFromThreshold?k:0,m,n,o,q,r=Number.MAX_VALUE,a=0;a=0&&n<=e.len&&m>=0&&m<=c.len;K.clientX=j?$(c.translate(w,0,0,0,1,i)):m;K.negative=K.y<(k||0);K.category=d&&d[K.x]!==z?d[K.x]:K.x;K.isNull||(o!==void 0&&(r=F(r,Q(m-o))),o=m)}this.closestPointRangePx=r},getValidPoints:function(a,b){var c=this.chart;return Da(a||this.points||[],function(a){return b&&!c.isInsidePlot(a.plotX,a.plotY,c.inverted)?!1:!a.isNull})},setClip:function(a){var b=this.chart,c=this.options, d=b.renderer,e=b.inverted,f=this.clipBox,g=f||b.clipBox,h=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,g.height,c.xAxis,c.yAxis].join(","),i=b[h],j=b[h+"m"];if(!i){if(a)g.width=0,b[h+"m"]=j=d.clipRect(-99,e?-b.plotLeft:-b.plotTop,99,e?b.chartWidth:b.chartHeight);b[h]=i=d.clipRect(g);i.count={length:0}}a&&!i.count[this.index]&&(i.count[this.index]=!0,i.count.length+=1);if(c.clip!==!1)this.group.clip(a||f?i:b.clipRect),this.markerGroup.clip(j),this.sharedClipKey=h;a||(i.count[this.index]&& (delete i.count[this.index],i.count.length-=1),i.count.length===0&&h&&b[h]&&(f||(b[h]=b[h].destroy()),b[h+"m"]&&(b[h+"m"]=b[h+"m"].destroy())))},animate:function(a){var b=this.chart,c=Wa(this.options.animation),d;a?this.setClip(c):(d=this.sharedClipKey,(a=b[d])&&a.animate({width:b.plotSizeX},c),b[d+"m"]&&b[d+"m"].animate({width:b.plotSizeX+99},c),this.animate=null)},afterAnimate:function(){this.setClip();H(this,"afterAnimate")},drawPoints:function(){var a,b=this.points,c=this.chart,d,e,f,g,h,i,j, k,l=this.options.marker,m=this.pointAttr[""],n,o,q,r=this.markerGroup,s=p(l.enabled,this.xAxis.isRadial,this.closestPointRangePx>2*l.radius);if(l.enabled!==!1||this._hasPointMarkers)for(f=b.length;f--;)if(g=b[f],d=V(g.plotX),e=g.plotY,k=g.graphic,n=g.marker||{},o=!!g.marker,a=s&&n.enabled===z||n.enabled,q=g.isInside,a&&I(e)&&g.y!==null)if(a=g.pointAttr[g.selected?"select":""]||m,h=a.r,i=p(n.symbol,this.symbol),j=i.indexOf("url")===0,k)k[q?"show":"hide"](!0).attr(a).animate(x({x:d-h,y:e-h},k.symbolName? {width:2*h,height:2*h}:{}));else{if(q&&(h>0||j))g.graphic=c.renderer.symbol(i,d-h,e-h,2*h,2*h,o?n:l).attr(a).add(r)}else if(k)g.graphic=k.destroy()},convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={},a=a||{},b=b||{},c=c||{},d=d||{};for(f in e)g=e[f],h[f]=p(a[g],b[f],c[f],d[f]);return h},getAttribs:function(){var a=this,b=a.options,c=ga[a.type].marker?b.marker:b,d=c.states,e=d.hover,f,g=a.color,h=a.options.negativeColor,i={stroke:g,fill:g},j=a.points||[],k,l=[],m,n=a.pointAttrToOptions; f=a.hasPointSpecificOptions;var o=c.lineColor,A=c.fillColor;k=b.turboThreshold;var r=a.zones,t=a.zoneAxis||"y",w,v;b.marker?(e.radius=+e.radius||+c.radius+ +e.radiusPlus,e.lineWidth=e.lineWidth||c.lineWidth+e.lineWidthPlus):(e.color=e.color||na(e.color||g).brighten(e.brightness).get(),e.negativeColor=e.negativeColor||na(e.negativeColor||h).brighten(e.brightness).get());l[""]=a.convertAttribs(c,i);q(["hover","select"],function(b){l[b]=a.convertAttribs(d[b],l[""])});a.pointAttr=l;g=j.length;if(!k|| g=i.value;)i=r[++f];k.color=k.fillColor=i=p(i.color,a.color)}f=b.colorByPoint||k.color;if(k.options)for(v in n)s(c[n[v]])&&(f=!0);if(f){c=c||{};m=[];d=c.states||{};f=d.hover=d.hover||{};if(!b.marker||k.negative&&!f.fillColor&&!e.fillColor)f[a.pointAttrToOptions.fill]=f.color||!k.options.color&&e[k.negative&&h?"negativeColor":"color"]||na(k.color).brighten(f.brightness|| e.brightness).get();w={color:k.color};if(!A)w.fillColor=k.color;if(!o)w.lineColor=k.color;c.hasOwnProperty("color")&&!c.color&&delete c.color;if(i&&!e.fillColor)f.fillColor=i;m[""]=a.convertAttribs(x(w,c),l[""]);m.hover=a.convertAttribs(d.hover,l.hover,m[""]);m.select=a.convertAttribs(d.select,l.select,m[""])}else m=l;k.pointAttr=m}},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(Ba),d,e=a.data||[],f,g,h;H(a,"destroy");Y(a);q(a.axisTypes||[],function(b){if(h=a[b])ra(h.series,a), h.isDirty=h.forceRedraw=!0});a.legendItem&&a.chart.legend.destroyItem(a);for(d=e.length;d--;)(f=e[d])&&f.destroy&&f.destroy();a.points=null;clearTimeout(a.animationTimeout);for(g in a)a[g]instanceof J&&!a[g].survive&&(d=c&&g==="group"?"hide":"destroy",a[g][d]());if(b.hoverSeries===a)b.hoverSeries=null;ra(b.series,a);for(g in a)delete a[g]},getGraphPath:function(a,b,c){var d=this,e=d.options,f=e.step,g,h=[],i=[],j,a=a||d.points;(g=a.reversed)&&a.reverse();(f={right:1,center:2}[f]||f&&3)&&g&&(f=4-f); e.connectNulls&&!b&&!c&&(a=this.getValidPoints(a));q(a,function(g,l){var m=g.plotX,n=g.plotY,o=a[l-1];if((g.leftCliff||o&&o.rightCliff)&&!c)j=!0;g.isNull&&!s(b)&&l>0?j=!e.connectNulls:g.isNull&&!b?j=!0:(l===0||j?o=[X,g.plotX,g.plotY]:d.getPointSpline?o=d.getPointSpline(a,g,l):f?(o=f===1?[S,o.plotX,n]:f===2?[S,(o.plotX+m)/2,o.plotY,S,(o.plotX+m)/2,n]:[S,m,o.plotY],o.push(S,m,n)):o=[S,m,n],i.push(g.x),f&&i.push(g.x),h.push.apply(h,o),j=!1)});h.xMap=i;return d.graphPath=h},drawGraph:function(){var a= this,b=this.options,c=[["graph",b.lineColor||this.color,b.dashStyle]],d=b.lineWidth,e=b.linecap!=="square",f=(this.gappedPath||this.getGraphPath).call(this);q(this.zones,function(d,e){c.push(["zoneGraph"+e,d.color||a.color,d.dashStyle||b.dashStyle])});q(c,function(c,h){var i=c[0],j=a[i];if(j)j.endX=f.xMap,j.animate({d:f});else if(d&&f.length)j={stroke:c[1],"stroke-width":d,fill:"none",zIndex:1},c[2]?j.dashstyle=c[2]:e&&(j["stroke-linecap"]=j["stroke-linejoin"]="round"),j=a[i]=a.chart.renderer.path(f).attr(j).add(a.group).shadow(h< 2&&b.shadow);if(j)j.startX=f.xMap,j.isArea=f.isArea})},applyZones:function(){var a=this,b=this.chart,c=b.renderer,d=this.zones,e,f,g=this.clips||[],h,i=this.graph,j=this.area,k=t(b.chartWidth,b.chartHeight),l=this[(this.zoneAxis||"y")+"Axis"],m,n,o=b.inverted,A,r,s,w,v=!1;if(d.length&&(i||j)&&l&&l.min!==z)n=l.reversed,A=l.horiz,i&&i.hide(),j&&j.hide(),m=l.getExtremes(),q(d,function(d,q){e=n?A?b.plotWidth:0:A?0:l.toPixels(m.min);e=F(t(p(f,e),0),k);f=F(t(C(l.toPixels(p(d.value,m.max),!0)),0),k);v&& (e=f=l.toPixels(m.max));r=Math.abs(e-f);s=F(e,f);w=t(e,f);if(l.isXAxis){if(h={x:o?w:s,y:0,width:r,height:k},!A)h.x=b.plotHeight-h.x}else if(h={x:0,y:o?w:s,width:k,height:r},A)h.y=b.plotWidth-h.y;o&&c.isVML&&(h=l.isXAxis?{x:0,y:n?s:w,height:h.width,width:b.chartWidth}:{x:h.y-b.plotLeft-b.spacingBox.x,y:0,width:h.height,height:b.chartHeight});g[q]?g[q].animate(h):(g[q]=c.clipRect(h),i&&a["zoneGraph"+q].clip(g[q]),j&&a["zoneArea"+q].clip(g[q]));v=d.value>m.max}),this.clips=g},invertGroups:function(){function a(){var a= {width:b.yAxis.len,height:b.xAxis.len};q(["group","markerGroup"],function(c){b[c]&&b[c].attr(a).invert()})}var b=this,c=b.chart;if(b.xAxis)N(c,"resize",a),N(b,"destroy",function(){Y(c,"resize",a)}),a(),b.invertGroups=a},plotGroup:function(a,b,c,d,e){var f=this[a],g=!f;g&&(this[a]=f=this.chart.renderer.g(b).attr({zIndex:d||0.1}).add(e),f.addClass("highcharts-series-"+this.index));f.attr({visibility:c})[g?"attr":"animate"](this.getPlotBox());return f},getPlotBox:function(){var a=this.chart,b=this.xAxis, c=this.yAxis;if(a.inverted)b=c,c=this.xAxis;return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var a=this,b=a.chart,c,d=a.options,e=!!a.animate&&b.renderer.isSVG&&Wa(d.animation).duration,f=a.visible?"inherit":"hidden",g=d.zIndex,h=a.hasRendered,i=b.seriesGroup;c=a.plotGroup("group","series",f,g,i);a.markerGroup=a.plotGroup("markerGroup","markers",f,g,i);e&&a.animate(!0);a.getAttribs();c.inverted=a.isCartesian?b.inverted:!1;a.drawGraph&&(a.drawGraph(), a.applyZones());q(a.points,function(a){a.redraw&&a.redraw()});a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&a.options.enableMouseTracking!==!1&&a.drawTracker();b.inverted&&a.invertGroups();d.clip!==!1&&!a.sharedClipKey&&!h&&c.clip(b.clipRect);e&&a.animate();if(!h)a.animationTimeout=Sa(function(){a.afterAnimate()},e);a.isDirty=a.isDirtyData=!1;a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirty||this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis; c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:p(d&&d.left,a.plotLeft),translateY:p(e&&e.top,a.plotTop)}));this.translate();this.render();b&&delete this.kdTree},kdDimensions:1,kdAxisArray:["clientX","plotY"],searchPoint:function(a,b){var c=this.xAxis,d=this.yAxis,e=this.chart.inverted;return this.searchKDTree({clientX:e?c.len-a.chartY+c.pos:a.chartX-c.pos,plotY:e?d.len-a.chartX+d.pos:a.chartY-d.pos},b)},buildKDTree:function(){function a(c,e,f){var g,h;if(h=c&& c.length)return g=b.kdAxisArray[e%f],c.sort(function(a,b){return a[g]-b[g]}),h=Math.floor(h/2),{point:c[h],left:a(c.slice(0,h),e+1,f),right:a(c.slice(h+1),e+1,f)}}var b=this,c=b.kdDimensions;delete b.kdTree;Sa(function(){b.kdTree=a(b.getValidPoints(null,!b.directTouch),c,c)},b.options.kdNow?0:1)},searchKDTree:function(a,b){function c(a,b,j,k){var l=b.point,m=d.kdAxisArray[j%k],n,o,p=l;o=s(a[e])&&s(l[e])?Math.pow(a[e]-l[e],2):null;n=s(a[f])&&s(l[f])?Math.pow(a[f]-l[f],2):null;n=(o||0)+(n||0);l.dist= s(n)?Math.sqrt(n):Number.MAX_VALUE;l.distX=s(o)?Math.sqrt(o):Number.MAX_VALUE;m=a[m]-l[m];n=m<0?"left":"right";o=m<0?"right":"left";b[n]&&(n=c(a,b[n],j+1,k),p=n[g]0&&this.singleStacks===!1&&(r.points[x][0]=r.points[this.index+","+v+",0"][0])}e==="percent"?(q=q?i:j,k&&m[q]&&m[q][v]?(q=m[q][v],r.total=q.total=t(q.total,r.total)+Q(u)||0):r.total=$(r.total+(Q(u)||0))):r.total=$(r.total+(u||0));r.cum=p(r.cum,g)+(u||0);if(u!==null)r.points[x].push(r.cum),c[w]=r.cum}if(e==="percent")l.usePercentage=!0;this.stackedYData= c;l.oldStacks={}}};R.prototype.setPercentStacks=function(){var a=this,b=a.stackKey,c=a.yAxis.stacks,d=a.processedXData,e;q([b,"-"+b],function(b){var f;for(var g=d.length,h,i;g--;)if(h=d[g],e=a.getStackIndicator(e,h,a.index),f=(i=c[b]&&c[b][h])&&i.points[e.key],h=f)i=i.total?100/i.total:0,h[0]=$(h[0]*i),h[1]=$(h[1]*i),a.stackedYData[g]=h[1]})};R.prototype.getStackIndicator=function(a,b,c){!s(a)||a.x!==b?a={x:b,index:0}:a.index++;a.key=[c,b,a.index].join(",");return a};x(jb.prototype,{addSeries:function(a, b,c){var d,e=this;a&&(b=p(b,!0),H(e,"addSeries",{options:a},function(){d=e.initSeries(a);e.isDirtyLegend=!0;e.linkSeries();b&&e.redraw(c)}));return d},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options,a=E(a,{index:this[e].length,isX:b});new ia(this,a);f[e]=ua(f[e]||{});f[e].push(a);p(c,!0)&&this.redraw(d)},showLoading:function(a){var b=this,c=b.options,d=b.loadingDiv,e=c.loading,f=function(){d&&M(d,{left:b.plotLeft+"px",top:b.plotTop+"px",width:b.plotWidth+"px",height:b.plotHeight+ "px"})};if(!d)b.loadingDiv=d=ca(Pa,{className:"highcharts-loading"},x(e.style,{zIndex:10,display:"none"}),b.container),b.loadingSpan=ca("span",null,e.labelStyle,d),N(b,"redraw",f);b.loadingSpan.innerHTML=a||c.lang.loading;if(!b.loadingShown)M(d,{opacity:0,display:""}),Za(d,{opacity:e.style.opacity},{duration:e.showDuration||0}),b.loadingShown=!0;f()},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&Za(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){M(b,{display:"none"})}}); this.loadingShown=!1}});x(Ma.prototype,{update:function(a,b,c,d){function e(){f.applyOptions(a);if(f.y===null&&h)f.graphic=h.destroy();if(ba(a,!0))f.redraw=function(){if(h&&h.element&&a&&a.marker&&a.marker.symbol)f.graphic=h.destroy();if(a&&a.dataLabels&&f.dataLabel)f.dataLabel=f.dataLabel.destroy();f.redraw=null};i=f.index;g.updateParallelArrays(f,i);k.data[i]=ba(k.data[i],!0)?f.options:a;g.isDirty=g.isDirtyData=!0;if(!g.fixedBox&&g.hasCartesianSeries)j.isDirtyBox=!0;if(k.legendType==="point")j.isDirtyLegend= !0;b&&j.redraw(c)}var f=this,g=f.series,h=f.graphic,i,j=g.chart,k=g.options,b=p(b,!0);d===!1?e():f.firePointEvent("update",{options:a},e)},remove:function(a,b){this.series.removePoint(pa(this,this.series.data),a,b)}});x(R.prototype,{addPoint:function(a,b,c,d){var e=this.options,f=this.data,g=this.chart,h=this.xAxis&&this.xAxis.names,i=e.data,j,k,l=this.xData,m,n,b=p(b,!0);j={series:this};this.pointClass.prototype.applyOptions.apply(j,[a]);n=j.x;m=l.length;if(this.requireSorting&&nn;)m--;this.updateParallelArrays(j,"splice",m,0,0);this.updateParallelArrays(j,m);if(h&&j.name)h[n]=j.name;i.splice(m,0,a);k&&(this.data.splice(m,0,null),this.processData());e.legendType==="point"&&this.generatePoints();c&&(f[0]&&f[0].remove?f[0].remove(!1):(f.shift(),this.updateParallelArrays(j,"shift"),i.shift()));this.isDirtyData=this.isDirty=!0;b&&(this.getAttribs(),g.redraw(d))},removePoint:function(a,b,c){var d=this,e=d.data,f=e[a],g=d.points,h=d.chart,i=function(){g&&g.length===e.length&& g.splice(a,1);e.splice(a,1);d.options.data.splice(a,1);d.updateParallelArrays(f||{series:d},"splice",a,1);f&&f.destroy();d.isDirty=!0;d.isDirtyData=!0;b&&h.redraw()};cb(c,h);b=p(b,!0);f?f.firePointEvent("remove",null,i):i()},remove:function(a,b,c){function d(){e.destroy();f.isDirtyLegend=f.isDirtyBox=!0;f.linkSeries();p(a,!0)&&f.redraw(b)}var e=this,f=e.chart;c!==!1?H(e,"remove",null,d):d()},update:function(a,b){var c=this,d=this.chart,e=this.userOptions,f=this.type,g=L[f].prototype,h=["group","markerGroup", "dataLabelsGroup"],i;if(a.type&&a.type!==f||a.zIndex!==void 0)h.length=0;q(h,function(a){h[a]=c[a];delete c[a]});a=E(e,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1,null,!1);for(i in g)this[i]=z;x(this,L[a.type||f].prototype);q(h,function(a){c[a]=h[a]});this.init(d,a);d.linkSeries();p(b,!0)&&d.redraw(!1)}});x(ia.prototype,{update:function(a,b){var c=this.chart,a=c.options[this.coll][this.options.index]=E(this.userOptions,a);this.destroy(!0);this.init(c, x(a,{events:z}));c.isDirtyBox=!0;p(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,d=this.series,e=d.length;e--;)d[e]&&d[e].remove(!1);ra(b.axes,this);ra(b[c],this);b.options[c].splice(this.options.index,1);q(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;p(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}});var xa=sa(R);L.line=xa;ga.area=E(ha,{softThreshold:!1,threshold:0}); var qa=sa(R,{type:"area",singleStacks:!1,getStackPoints:function(){var a=[],b=[],c=this.xAxis,d=this.yAxis,e=d.stacks[this.stackKey],f={},g=this.points,h=this.index,i=d.series,j=i.length,k,l=p(d.options.reversedStacks,!0)?1:-1,m,n;if(this.options.stacking){for(m=0;m=0&&m=0&&ma&&h>e?(h=t(a,e),j=2*e-h):hc&&j>e?(j=t(c,e),h=2*e-j):j0.5;b=Math.round(b)+f;d-=b;g&&d&&(b-=1,d+=1);return{x:a,y:b,width:c,height:d}},translate:function(){var a=this,b=a.chart,c=a.options,d=a.borderWidth=p(c.borderWidth,a.closestPointRange*a.xAxis.transA<2?0:1),e=a.yAxis,f=a.translatedThreshold=e.getThreshold(c.threshold),g=p(c.minPointLength,5),h=a.getColumnMetrics(),i=h.width, j=a.barW=t(i,1+2*d),k=a.pointXOffset=h.offset;b.inverted&&(f-=0.5);c.pointPadding&&(j=va(j));R.prototype.translate.apply(a);q(a.points,function(c){var d=F(p(c.yBottom,f),9E4),h=999+Q(d),h=F(t(-h,c.plotY),e.len+h),o=c.plotX+k,q=j,r=F(h,d),s,w=t(h,d)-r;Q(w)g?d-g:f-(s?g:0));c.barX=o;c.pointWidth=i;c.tooltipPos=b.inverted?[e.len+e.pos-b.plotLeft-h,a.xAxis.len-o-q/2,w]:[o+q/2,h+e.pos-b.plotTop,w];c.shapeType="rect";c.shapeArgs=a.crispCol.apply(a, c.isNull?[c.plotX,e.len/2,0,0]:[o,r,q,w])})},getSymbol:Ca,drawLegendSymbol:P.drawRectangle,drawGraph:Ca,drawPoints:function(){var a=this,b=this.chart,c=a.options,d=b.renderer,e=c.animationLimit||250,f,g;q(a.points,function(h){var i=h.graphic,j;if(I(h.plotY)&&h.y!==null)f=h.shapeArgs,j=s(a.borderWidth)?{"stroke-width":a.borderWidth}:{},g=h.pointAttr[h.selected?"select":""]||a.pointAttr[""],i?(Ka(i),i.attr(j).attr(g)[b.pointCount\u25cf {series.name}
          ',pointFormat:"x: {point.x}
          y: {point.y}
          "}});qa=sa(R,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0, trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,kdDimensions:2,drawGraph:function(){this.options.lineWidth&&R.prototype.drawGraph.call(this)}});L.scatter=qa;ga.pie=E(ha,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.y===null?void 0:this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:0.1, shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}});ha={type:"pie",isCartesian:!1,pointClass:sa(Ma,{init:function(){Ma.prototype.init.apply(this,arguments);var a=this,b;a.name=p(a.name,"Slice");b=function(b){a.slice(b.type==="select")};N(a,"select",b);N(a,"unselect",b);return a},setVisible:function(a,b){var c=this,d=c.series,e=d.chart,f=d.options.ignoreHiddenPoint,b=p(b,f);if(a!==c.visible){c.visible=c.options.visible=a=a===z?!c.visible:a;d.options.data[pa(c,d.data)]=c.options;q(["graphic", "dataLabel","connector","shadowGroup"],function(b){if(c[b])c[b][a?"show":"hide"](!0)});c.legendItem&&e.legend.colorizeItem(c,a);!a&&c.state==="hover"&&c.setState("");if(f)d.isDirty=!0;b&&e.redraw()}},slice:function(a,b,c){var d=this.series;cb(c,d.chart);p(b,!0);this.sliced=this.options.sliced=a=s(a)?a:!this.sliced;d.options.data[pa(this,d.data)]=this.options;a=a?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)},haloPath:function(a){var b= this.shapeArgs,c=this.series.chart;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(c.plotLeft+b.x,c.plotTop+b.y,b.r+a,b.r+a,{innerR:this.shapeArgs.r,start:b.start,end:b.end})}}),requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},animate:function(a){var b=this,c=b.points,d=b.startAngleRad;if(!a)q(c,function(a){var c=a.graphic,g=a.shapeArgs; c&&(c.attr({r:a.startR||b.center[3]/2,start:d,end:d}),c.animate({r:g.r,start:g.start,end:g.end},b.options.animation))}),b.animate=null},updateTotals:function(){var a,b=0,c=this.points,d=c.length,e,f=this.options.ignoreHiddenPoint;for(a=0;a0&&(e.visible||!f)?e.y/b*100:0,e.total=b},generatePoints:function(){R.prototype.generatePoints.call(this);this.updateTotals()},translate:function(a){this.generatePoints(); var b=0,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f,g,h,i=c.startAngle||0,j=this.startAngleRad=ta/180*(i-90),i=(this.endAngleRad=ta/180*(p(c.endAngle,i+360)-90))-j,k=this.points,l=c.dataLabels.distance,c=c.ignoreHiddenPoint,m,n=k.length,o;if(!a)this.center=a=this.getCenter();this.getX=function(b,c){h=Z.asin(F((b-a[1])/(a[2]/2+l),1));return a[0]+(c?-1:1)*W(h)*(a[2]/2+l)};for(m=0;m1.5*ta?h-=2*ta:h<-ta/2&&(h+=2*ta);o.slicedTranslation={translateX:C(W(h)*d),translateY:C(da(h)*d)};f=W(h)*a[2]/2;g=da(h)*a[2]/2;o.tooltipPos=[a[0]+f*0.7,a[1]+g*0.7];o.half=h<-ta/2||h>ta/2?1:0;o.angle=h;e=F(e,l/2);o.labelPos=[a[0]+f+W(h)*l,a[1]+g+da(h)*l,a[0]+f+W(h)*e,a[1]+g+da(h)*e,a[0]+f,a[1]+g,l<0?"center":o.half?"right":"left",h]}},drawGraph:null,drawPoints:function(){var a=this,b=a.chart.renderer,c,d,e=a.options.shadow,f, g,h,i;if(e&&!a.shadowGroup)a.shadowGroup=b.g("shadow").add(a.group);q(a.points,function(j){if(j.y!==null){d=j.graphic;h=j.shapeArgs;f=j.shadowGroup;g=j.pointAttr[j.selected?"select":""];if(!g.stroke)g.stroke=g.fill;if(e&&!f)f=j.shadowGroup=b.g("shadow").add(a.shadowGroup);c=j.sliced?j.slicedTranslation:{translateX:0,translateY:0};f&&f.attr(c);if(d)d.setRadialReference(a.center).attr(g).animate(x(h,c));else{i={"stroke-linejoin":"round"};if(!j.visible)i.visibility="hidden";j.graphic=d=b[j.shapeType](h).setRadialReference(a.center).attr(g).attr(i).attr(c).add(a.group).shadow(e, f)}}})},searchPoint:Ca,sortByAngle:function(a,b){a.sort(function(a,d){return a.angle!==void 0&&(d.angle-a.angle)*b})},drawLegendSymbol:P.drawRectangle,getCenter:Eb.getCenter,getSymbol:Ca};ha=sa(R,ha);L.pie=ha;R.prototype.drawDataLabels=function(){var a=this,b=a.options,c=b.cursor,d=b.dataLabels,e=a.points,f,g,h=a.hasRendered||0,i,j,k=p(d.defer,!0),l=a.chart.renderer;if(d.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(d),j=a.plotGroup("dataLabelsGroup","data-labels",k&&!h?"hidden": "visible",d.zIndex||6),k&&(j.attr({opacity:+h}),h||N(a,"afterAnimate",function(){a.visible&&j.show(!0);j[b.animation?"animate":"attr"]({opacity:1},{duration:200})})),g=d,q(e,function(e){var h,k=e.dataLabel,q,r,t=e.connector,w=!0,v,u={};f=e.dlOptions||e.options&&e.options.dataLabels;h=p(f&&f.enabled,g.enabled)&&e.y!==null;if(k&&!h)e.dataLabel=k.destroy();else if(h){d=E(g,f);v=d.style;h=d.rotation;q=e.getLabelConfig();i=d.format?Na(d.format,q):d.formatter.call(q,d);v.color=p(d.color,v.color,a.color, "black");if(k)if(s(i))k.attr({text:i}),w=!1;else{if(e.dataLabel=k=k.destroy(),t)e.connector=t.destroy()}else if(s(i)){k={fill:d.backgroundColor,stroke:d.borderColor,"stroke-width":d.borderWidth,r:d.borderRadius||0,rotation:h,padding:d.padding,zIndex:1};if(v.color==="contrast")u.color=d.inside||d.distance<0||b.stacking?l.getContrast(e.color||a.color):"#000000";if(c)u.cursor=c;for(r in k)k[r]===z&&delete k[r];k=e.dataLabel=l[h?"text":"label"](i,0,-9999,d.shape,null,null,d.useHTML).attr(k).css(x(v,u)).add(j).shadow(d.shadow)}k&& a.alignDataLabel(e,k,d,null,w)}})};R.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=p(a.plotX,-9999),i=p(a.plotY,-9999),j=b.getBBox(),k=f.renderer.fontMetrics(c.style.fontSize).b,l=c.rotation,m=c.align,n=this.visible&&(a.series.forceDL||f.isInsidePlot(h,C(i),g)||d&&f.isInsidePlot(h,g?d.x+1:d.y+d.height-1,g)),o=p(c.overflow,"justify")==="justify";if(n)d=x({x:g?f.plotWidth-i:h,y:C(g?f.plotHeight-h:i),width:0,height:0},d),x(c,{width:j.width,height:j.height}),l?(o=!1,g=f.renderer.rotCorr(k, l),g={x:d.x+c.x+d.width/2+g.x,y:d.y+c.y+{top:0,middle:0.5,bottom:1}[c.verticalAlign]*d.height},b[e?"attr":"animate"](g).attr({align:m}),h=(l+720)%360,h=h>180&&h<360,m==="left"?g.y-=h?j.height:0:m==="center"?(g.x-=j.width/2,g.y-=j.height/2):m==="right"&&(g.x-=j.width,g.y-=h?0:j.height)):(b.align(c,null,d),g=b.alignAttr),o?this.justifyDataLabel(b,c,g,j,d,e):p(c.crop,!0)&&(n=f.isInsidePlot(g.x,g.y)&&f.isInsidePlot(g.x+j.width,g.y+j.height)),c.shape&&!l&&b.attr({anchorX:a.plotX,anchorY:a.plotY});if(!n)Ka(b), b.attr({y:-9999}),b.placed=!1};R.prototype.justifyDataLabel=function(a,b,c,d,e,f){var g=this.chart,h=b.align,i=b.verticalAlign,j,k,l=a.box?0:a.padding||0;j=c.x+l;if(j<0)h==="right"?b.align="left":b.x=-j,k=!0;j=c.x+d.width-l;if(j>g.plotWidth)h==="left"?b.align="right":b.x=g.plotWidth-j,k=!0;j=c.y+l;if(j<0)i==="bottom"?b.verticalAlign="top":b.y=-j,k=!0;j=c.y+d.height-l;if(j>g.plotHeight)i==="top"?b.verticalAlign="bottom":b.y=g.plotHeight-j,k=!0;if(k)a.placed=!f,a.align(b,null,e)};if(L.pie)L.pie.prototype.drawDataLabels= function(){var a=this,b=a.data,c,d=a.chart,e=a.options.dataLabels,f=p(e.connectorPadding,10),g=p(e.connectorWidth,1),h=d.plotWidth,i=d.plotHeight,j,k,l=p(e.softConnector,!0),m=e.distance,n=a.center,o=n[2]/2,s=n[1],r=m>0,u,w,v,x=[[],[]],z,y,D,E,B,G=[0,0,0,0],M=function(a,b){return b.y-a.y};if(a.visible&&(e.enabled||a._hasPointLabels)){R.prototype.drawDataLabels.apply(a);q(b,function(a){if(a.dataLabel&&a.visible)x[a.half].push(a),a.dataLabel._pos=null});for(E=2;E--;){var H=[],N=[],I=x[E],L=I.length, J;if(L){a.sortByAngle(I,E-0.5);for(B=b=0;!b&&I[B];)b=I[B]&&I[B].dataLabel&&(I[B].dataLabel.getBBox().height||21),B++;if(m>0){w=F(s+o+m,d.plotHeight);for(B=t(0,s-o-m);B<=w;B+=b)H.push(B);w=H.length;if(L>w){c=[].concat(I);c.sort(M);for(B=L;B--;)c[B].rank=B;for(B=L;B--;)I[B].rank>=w&&I.splice(B,1);L=I.length}for(B=0;B0){if(w=N.pop(),J=w.i,y=w.y,c>y&&H[J+1]!==null||ch-f&&(G[1]=t(C(z+w-h+f),G[1])),y- b/2<0?G[0]=t(C(-y+b/2),G[0]):y+b/2>i&&(G[2]=t(C(y+b/2-i),G[2]))}}}if(Ha(G)===0||this.verifyDataLabelOverflow(G))this.placeDataLabels(),r&&g&&q(this.points,function(b){j=b.connector;v=b.labelPos;if((u=b.dataLabel)&&u._pos&&b.visible)D=u._attr.visibility,z=u.connX,y=u.connY,k=l?[X,z+(v[6]==="left"?5:-5),y,"C",z,y,2*v[2]-v[4],2*v[3]-v[5],v[2],v[3],S,v[4],v[5]]:[X,z+(v[6]==="left"?5:-5),y,S,v[2],v[3],S,v[4],v[5]],j?(j.animate({d:k}),j.attr("visibility",D)):b.connector=j=a.chart.renderer.path(k).attr({"stroke-width":g, stroke:e.connectorColor||b.color||"#606060",visibility:D}).add(a.dataLabelsGroup);else if(j)b.connector=j.destroy()})}},L.pie.prototype.placeDataLabels=function(){q(this.points,function(a){var b=a.dataLabel;if(b&&a.visible)(a=b._pos)?(b.attr(b._attr),b[b.moved?"animate":"attr"](a),b.moved=!0):b&&b.attr({y:-9999})})},L.pie.prototype.alignDataLabel=Ca,L.pie.prototype.verifyDataLabelOverflow=function(a){var b=this.center,c=this.options,d=c.center,e=c.minSize||80,f=e,g;d[0]!==null?f=t(b[2]-t(a[1],a[3]), e):(f=t(b[2]-a[1]-a[3],e),b[0]+=(a[3]-a[1])/2);d[1]!==null?f=t(F(f,b[2]-t(a[0],a[2])),e):(f=t(F(f,b[2]-a[0]-a[2]),e),b[1]+=(a[0]-a[2])/2);fp(this.translatedThreshold, g.yAxis.len)),j=p(c.inside,!!this.options.stacking);if(h){d=E(h);if(d.y<0)d.height+=d.y,d.y=0;h=d.y+d.height-g.yAxis.len;h>0&&(d.height-=h);f&&(d={x:g.yAxis.len-d.y-d.height,y:g.xAxis.len-d.x-d.width,width:d.height,height:d.width});if(!j)f?(d.x+=i?0:d.width,d.width=0):(d.y+=i?d.height:0,d.height=0)}c.align=p(c.align,!f||j?"center":i?"right":"left");c.verticalAlign=p(c.verticalAlign,f||j?"middle":i?"top":"bottom");R.prototype.alignDataLabel.call(this,a,b,c,d,e)};(function(a){var b=a.Chart,c=a.each, d=a.pick,e=a.addEvent;b.prototype.callbacks.push(function(a){function b(){var e=[];c(a.series,function(a){var b=a.options.dataLabels,f=a.dataLabelCollections||["dataLabel"];(b.enabled||a._hasPointLabels)&&!b.allowOverlap&&a.visible&&c(f,function(b){c(a.points,function(a){if(a[b])a[b].labelrank=d(a.labelrank,a.shapeArgs&&a.shapeArgs.height),e.push(a[b])})})});a.hideOverlappingLabels(e)}b();e(a,"redraw",b)});b.prototype.hideOverlappingLabels=function(a){var b=a.length,d,e,j,k,l,m,n,o,p;for(e=0;el.x+n.translateX+(j.width-p)||m.x+o.translateX+(k.width-p)l.y+n.translateY+(j.height-p)||m.y+o.translateY+(k.height-p)h;if(b.series.length&&(i||l>F(k.dataMin,k.min))&&(!i||j
          /g, '') .split(//g); } else { lines = [textStr]; } // Trim empty lines (#5261) lines = grep(lines, function (line) { return line !== ''; }); // build the lines each(lines, function buildTextLines(line, lineNo) { var spans, spanNo = 0; line = line .replace(/^\s+|\s+$/g, '') // Trim to prevent useless/costly process on the spaces (#5258) .replace(//g, '|||'); spans = line.split('|||'); each(spans, function buildTextSpans(span) { if (span !== '' || spans.length === 1) { var attributes = {}, tspan = doc.createElementNS(SVG_NS, 'tspan'), spanStyle; // #390 if (styleRegex.test(span)) { spanStyle = span.match(styleRegex)[1].replace(/(;| |^)color([ :])/, '$1fill$2'); attr(tspan, 'style', spanStyle); } if (hrefRegex.test(span) && !forExport) { // Not for export - #1529 attr(tspan, 'onclick', 'location.href=\"' + span.match(hrefRegex)[1] + '\"'); css(tspan, { cursor: 'pointer' }); } span = unescapeAngleBrackets(span.replace(/<(.|\n)*?>/g, '') || ' '); // Nested tags aren't supported, and cause crash in Safari (#1596) if (span !== ' ') { // add the text node tspan.appendChild(doc.createTextNode(span)); if (!spanNo) { // first span in a line, align it to the left if (lineNo && parentX !== null) { attributes.x = parentX; } } else { attributes.dx = 0; // #16 } // add attributes attr(tspan, attributes); // Append it textNode.appendChild(tspan); // first span on subsequent line, add the line height if (!spanNo && lineNo) { // allow getting the right offset height in exporting in IE if (!hasSVG && forExport) { css(tspan, { display: 'block' }); } // Set the line height based on the font size of either // the text element or the tspan element attr( tspan, 'dy', getLineHeight(tspan) ); } /*if (width) { renderer.breakText(wrapper, width); }*/ // Check width and apply soft breaks or ellipsis if (width) { var words = span.replace(/([^\^])-/g, '$1- ').split(' '), // #1273 noWrap = textStyles.whiteSpace === 'nowrap', hasWhiteSpace = spans.length > 1 || lineNo || (words.length > 1 && !noWrap), tooLong, actualWidth, rest = [], dy = getLineHeight(tspan), softLineNo = 1, rotation = wrapper.rotation, wordStr = span, // for ellipsis cursor = wordStr.length, // binary search cursor bBox; while ((hasWhiteSpace || ellipsis) && (words.length || rest.length)) { wrapper.rotation = 0; // discard rotation when computing box bBox = wrapper.getBBox(true); actualWidth = bBox.width; // Old IE cannot measure the actualWidth for SVG elements (#2314) if (!hasSVG && renderer.forExport) { actualWidth = renderer.measureSpanWidth(tspan.firstChild.data, wrapper.styles); } tooLong = actualWidth > width; // For ellipsis, do a binary search for the correct string length if (wasTooLong === undefined) { wasTooLong = tooLong; // First time } if (ellipsis && wasTooLong) { cursor /= 2; if (wordStr === '' || (!tooLong && cursor < 0.5)) { words = []; // All ok, break out } else { wordStr = span.substring(0, wordStr.length + (tooLong ? -1 : 1) * mathCeil(cursor)); words = [wordStr + (width > 3 ? '\u2026' : '')]; tspan.removeChild(tspan.firstChild); } // Looping down, this is the first word sequence that is not too long, // so we can move on to build the next line. } else if (!tooLong || words.length === 1) { words = rest; rest = []; if (words.length && !noWrap) { softLineNo++; tspan = doc.createElementNS(SVG_NS, 'tspan'); attr(tspan, { dy: dy, x: parentX }); if (spanStyle) { // #390 attr(tspan, 'style', spanStyle); } textNode.appendChild(tspan); } if (actualWidth > width) { // a single word is pressing it out width = actualWidth; } } else { // append to existing line tspan tspan.removeChild(tspan.firstChild); rest.unshift(words.pop()); } if (words.length) { tspan.appendChild(doc.createTextNode(words.join(' ').replace(/- /g, '-'))); } } wrapper.rotation = rotation; } spanNo++; } } }); }); if (wasTooLong) { wrapper.attr('title', wrapper.textStr); } if (tempParent) { tempParent.removeChild(textNode); // attach it to the DOM to read offset width } // Apply the text shadow if (textShadow && wrapper.applyTextShadow) { wrapper.applyTextShadow(textShadow); } } }, /* breakText: function (wrapper, width) { var bBox = wrapper.getBBox(), node = wrapper.element, textLength = node.textContent.length, pos = mathRound(width * textLength / bBox.width), // try this position first, based on average character width increment = 0, finalPos; if (bBox.width > width) { while (finalPos === undefined) { textLength = node.getSubStringLength(0, pos); if (textLength <= width) { if (increment === -1) { finalPos = pos; } else { increment = 1; } } else { if (increment === 1) { finalPos = pos - 1; } else { increment = -1; } } pos += increment; } } console.log('width', width, 'stringWidth', node.getSubStringLength(0, finalPos)) }, */ /** * Returns white for dark colors and black for bright colors */ getContrast: function (color) { color = Color(color).rgba; return color[0] + color[1] + color[2] > 384 ? '#000000' : '#FFFFFF'; }, /** * Create a button with preset states * @param {String} text * @param {Number} x * @param {Number} y * @param {Function} callback * @param {Object} normalState * @param {Object} hoverState * @param {Object} pressedState */ button: function (text, x, y, callback, normalState, hoverState, pressedState, disabledState, shape) { var label = this.label(text, x, y, shape, null, null, null, null, 'button'), curState = 0, stateOptions, stateStyle, normalStyle, hoverStyle, pressedStyle, disabledStyle, verticalGradient = { x1: 0, y1: 0, x2: 0, y2: 1 }; // Normal state - prepare the attributes normalState = merge({ 'stroke-width': 1, stroke: '#CCCCCC', fill: { linearGradient: verticalGradient, stops: [ [0, '#FEFEFE'], [1, '#F6F6F6'] ] }, r: 2, padding: 5, style: { color: 'black' } }, normalState); normalStyle = normalState.style; delete normalState.style; // Hover state hoverState = merge(normalState, { stroke: '#68A', fill: { linearGradient: verticalGradient, stops: [ [0, '#FFF'], [1, '#ACF'] ] } }, hoverState); hoverStyle = hoverState.style; delete hoverState.style; // Pressed state pressedState = merge(normalState, { stroke: '#68A', fill: { linearGradient: verticalGradient, stops: [ [0, '#9BD'], [1, '#CDF'] ] } }, pressedState); pressedStyle = pressedState.style; delete pressedState.style; // Disabled state disabledState = merge(normalState, { style: { color: '#CCC' } }, disabledState); disabledStyle = disabledState.style; delete disabledState.style; // Add the events. IE9 and IE10 need mouseover and mouseout to funciton (#667). addEvent(label.element, isMS ? 'mouseover' : 'mouseenter', function () { if (curState !== 3) { label.attr(hoverState) .css(hoverStyle); } }); addEvent(label.element, isMS ? 'mouseout' : 'mouseleave', function () { if (curState !== 3) { stateOptions = [normalState, hoverState, pressedState][curState]; stateStyle = [normalStyle, hoverStyle, pressedStyle][curState]; label.attr(stateOptions) .css(stateStyle); } }); label.setState = function (state) { label.state = curState = state; if (!state) { label.attr(normalState) .css(normalStyle); } else if (state === 2) { label.attr(pressedState) .css(pressedStyle); } else if (state === 3) { label.attr(disabledState) .css(disabledStyle); } }; return label .on('click', function (e) { if (curState !== 3) { callback.call(label, e); } }) .attr(normalState) .css(extend({ cursor: 'default' }, normalStyle)); }, /** * Make a straight line crisper by not spilling out to neighbour pixels * @param {Array} points * @param {Number} width */ crispLine: function (points, width) { // points format: [M, 0, 0, L, 100, 0] // normalize to a crisp line if (points[1] === points[4]) { // Substract due to #1129. Now bottom and left axis gridlines behave the same. points[1] = points[4] = mathRound(points[1]) - (width % 2 / 2); } if (points[2] === points[5]) { points[2] = points[5] = mathRound(points[2]) + (width % 2 / 2); } return points; }, /** * Draw a path * @param {Array} path An SVG path in array form */ path: function (path) { var attr = { fill: NONE }; if (isArray(path)) { attr.d = path; } else if (isObject(path)) { // attributes extend(attr, path); } return this.createElement('path').attr(attr); }, /** * Draw and return an SVG circle * @param {Number} x The x position * @param {Number} y The y position * @param {Number} r The radius */ circle: function (x, y, r) { var attr = isObject(x) ? x : { x: x, y: y, r: r }, wrapper = this.createElement('circle'); // Setting x or y translates to cx and cy wrapper.xSetter = wrapper.ySetter = function (value, key, element) { element.setAttribute('c' + key, value); }; return wrapper.attr(attr); }, /** * Draw and return an arc * @param {Number} x X position * @param {Number} y Y position * @param {Number} r Radius * @param {Number} innerR Inner radius like used in donut charts * @param {Number} start Starting angle * @param {Number} end Ending angle */ arc: function (x, y, r, innerR, start, end) { var arc; if (isObject(x)) { y = x.y; r = x.r; innerR = x.innerR; start = x.start; end = x.end; x = x.x; } // Arcs are defined as symbols for the ability to set // attributes in attr and animate arc = this.symbol('arc', x || 0, y || 0, r || 0, r || 0, { innerR: innerR || 0, start: start || 0, end: end || 0 }); arc.r = r; // #959 return arc; }, /** * Draw and return a rectangle * @param {Number} x Left position * @param {Number} y Top position * @param {Number} width * @param {Number} height * @param {Number} r Border corner radius * @param {Number} strokeWidth A stroke width can be supplied to allow crisp drawing */ rect: function (x, y, width, height, r, strokeWidth) { r = isObject(x) ? x.r : r; var wrapper = this.createElement('rect'), attribs = isObject(x) ? x : x === UNDEFINED ? {} : { x: x, y: y, width: mathMax(width, 0), height: mathMax(height, 0) }; if (strokeWidth !== UNDEFINED) { wrapper.strokeWidth = strokeWidth; attribs = wrapper.crisp(attribs); } if (r) { attribs.r = r; } wrapper.rSetter = function (value, key, element) { attr(element, { rx: value, ry: value }); }; return wrapper.attr(attribs); }, /** * Resize the box and re-align all aligned elements * @param {Object} width * @param {Object} height * @param {Boolean} animate * */ setSize: function (width, height, animate) { var renderer = this, alignedObjects = renderer.alignedObjects, i = alignedObjects.length; renderer.width = width; renderer.height = height; renderer.boxWrapper[pick(animate, true) ? 'animate' : 'attr']({ width: width, height: height }); while (i--) { alignedObjects[i].align(); } }, /** * Create a group * @param {String} name The group will be given a class name of 'highcharts-{name}'. * This can be used for styling and scripting. */ g: function (name) { var elem = this.createElement('g'); return defined(name) ? elem.attr({ 'class': PREFIX + name }) : elem; }, /** * Display an image * @param {String} src * @param {Number} x * @param {Number} y * @param {Number} width * @param {Number} height */ image: function (src, x, y, width, height) { var attribs = { preserveAspectRatio: NONE }, elemWrapper; // optional properties if (arguments.length > 1) { extend(attribs, { x: x, y: y, width: width, height: height }); } elemWrapper = this.createElement('image').attr(attribs); // set the href in the xlink namespace if (elemWrapper.element.setAttributeNS) { elemWrapper.element.setAttributeNS('http://www.w3.org/1999/xlink', 'href', src); } else { // could be exporting in IE // using href throws "not supported" in ie7 and under, requries regex shim to fix later elemWrapper.element.setAttribute('hc-svg-href', src); } return elemWrapper; }, /** * Draw a symbol out of pre-defined shape paths from the namespace 'symbol' object. * * @param {Object} symbol * @param {Object} x * @param {Object} y * @param {Object} radius * @param {Object} options */ symbol: function (symbol, x, y, width, height, options) { var ren = this, obj, // get the symbol definition function symbolFn = this.symbols[symbol], // check if there's a path defined for this symbol path = symbolFn && symbolFn( mathRound(x), mathRound(y), width, height, options ), imageRegex = /^url\((.*?)\)$/, imageSrc, imageSize, centerImage; if (path) { obj = this.path(path); // expando properties for use in animate and attr extend(obj, { symbolName: symbol, x: x, y: y, width: width, height: height }); if (options) { extend(obj, options); } // image symbols } else if (imageRegex.test(symbol)) { // On image load, set the size and position centerImage = function (img, size) { if (img.element) { // it may be destroyed in the meantime (#1390) img.attr({ width: size[0], height: size[1] }); if (!img.alignByTranslate) { // #185 img.translate( mathRound((width - size[0]) / 2), // #1378 mathRound((height - size[1]) / 2) ); } } }; imageSrc = symbol.match(imageRegex)[1]; imageSize = symbolSizes[imageSrc] || (options && options.width && options.height && [options.width, options.height]); // Ireate the image synchronously, add attribs async obj = this.image(imageSrc) .attr({ x: x, y: y }); obj.isImg = true; if (imageSize) { centerImage(obj, imageSize); } else { // Initialize image to be 0 size so export will still function if there's no cached sizes. obj.attr({ width: 0, height: 0 }); // Create a dummy JavaScript image to get the width and height. Due to a bug in IE < 8, // the created element must be assigned to a variable in order to load (#292). createElement('img', { onload: function () { var chart = charts[ren.chartIndex]; // Special case for SVGs on IE11, the width is not accessible until the image is // part of the DOM (#2854). if (this.width === 0) { css(this, { position: ABSOLUTE, top: '-999em' }); doc.body.appendChild(this); } // Center the image centerImage(obj, symbolSizes[imageSrc] = [this.width, this.height]); // Clean up after #2854 workaround. if (this.parentNode) { this.parentNode.removeChild(this); } // Fire the load event when all external images are loaded ren.imgCount--; if (!ren.imgCount && chart && chart.onload) { chart.onload(); } }, src: imageSrc }); this.imgCount++; } } return obj; }, /** * An extendable collection of functions for defining symbol paths. */ symbols: { 'circle': function (x, y, w, h) { var cpw = 0.166 * w; return [ M, x + w / 2, y, 'C', x + w + cpw, y, x + w + cpw, y + h, x + w / 2, y + h, 'C', x - cpw, y + h, x - cpw, y, x + w / 2, y, 'Z' ]; }, 'square': function (x, y, w, h) { return [ M, x, y, L, x + w, y, x + w, y + h, x, y + h, 'Z' ]; }, 'triangle': function (x, y, w, h) { return [ M, x + w / 2, y, L, x + w, y + h, x, y + h, 'Z' ]; }, 'triangle-down': function (x, y, w, h) { return [ M, x, y, L, x + w, y, x + w / 2, y + h, 'Z' ]; }, 'diamond': function (x, y, w, h) { return [ M, x + w / 2, y, L, x + w, y + h / 2, x + w / 2, y + h, x, y + h / 2, 'Z' ]; }, 'arc': function (x, y, w, h, options) { var start = options.start, radius = options.r || w || h, end = options.end - 0.001, // to prevent cos and sin of start and end from becoming equal on 360 arcs (related: #1561) innerRadius = options.innerR, open = options.open, cosStart = mathCos(start), sinStart = mathSin(start), cosEnd = mathCos(end), sinEnd = mathSin(end), longArc = options.end - start < mathPI ? 0 : 1; return [ M, x + radius * cosStart, y + radius * sinStart, 'A', // arcTo radius, // x radius radius, // y radius 0, // slanting longArc, // long or short arc 1, // clockwise x + radius * cosEnd, y + radius * sinEnd, open ? M : L, x + innerRadius * cosEnd, y + innerRadius * sinEnd, 'A', // arcTo innerRadius, // x radius innerRadius, // y radius 0, // slanting longArc, // long or short arc 0, // clockwise x + innerRadius * cosStart, y + innerRadius * sinStart, open ? '' : 'Z' // close ]; }, /** * Callout shape used for default tooltips, also used for rounded rectangles in VML */ callout: function (x, y, w, h, options) { var arrowLength = 6, halfDistance = 6, r = mathMin((options && options.r) || 0, w, h), safeDistance = r + halfDistance, anchorX = options && options.anchorX, anchorY = options && options.anchorY, path; path = [ 'M', x + r, y, 'L', x + w - r, y, // top side 'C', x + w, y, x + w, y, x + w, y + r, // top-right corner 'L', x + w, y + h - r, // right side 'C', x + w, y + h, x + w, y + h, x + w - r, y + h, // bottom-right corner 'L', x + r, y + h, // bottom side 'C', x, y + h, x, y + h, x, y + h - r, // bottom-left corner 'L', x, y + r, // left side 'C', x, y, x, y, x + r, y // top-right corner ]; if (anchorX && anchorX > w && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace right side path.splice(13, 3, 'L', x + w, anchorY - halfDistance, x + w + arrowLength, anchorY, x + w, anchorY + halfDistance, x + w, y + h - r ); } else if (anchorX && anchorX < 0 && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace left side path.splice(33, 3, 'L', x, anchorY + halfDistance, x - arrowLength, anchorY, x, anchorY - halfDistance, x, y + r ); } else if (anchorY && anchorY > h && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace bottom path.splice(23, 3, 'L', anchorX + halfDistance, y + h, anchorX, y + h + arrowLength, anchorX - halfDistance, y + h, x + r, y + h ); } else if (anchorY && anchorY < 0 && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace top path.splice(3, 3, 'L', anchorX - halfDistance, y, anchorX, y - arrowLength, anchorX + halfDistance, y, w - r, y ); } return path; } }, /** * Define a clipping rectangle * @param {String} id * @param {Number} x * @param {Number} y * @param {Number} width * @param {Number} height */ clipRect: function (x, y, width, height) { var wrapper, id = PREFIX + idCounter++, clipPath = this.createElement('clipPath').attr({ id: id }).add(this.defs); wrapper = this.rect(x, y, width, height, 0).add(clipPath); wrapper.id = id; wrapper.clipPath = clipPath; wrapper.count = 0; return wrapper; }, /** * Add text to the SVG object * @param {String} str * @param {Number} x Left position * @param {Number} y Top position * @param {Boolean} useHTML Use HTML to render the text */ text: function (str, x, y, useHTML) { // declare variables var renderer = this, fakeSVG = useCanVG || (!hasSVG && renderer.forExport), wrapper, attr = {}; if (useHTML && (renderer.allowHTML || !renderer.forExport)) { return renderer.html(str, x, y); } attr.x = Math.round(x || 0); // X is always needed for line-wrap logic if (y) { attr.y = Math.round(y); } if (str || str === 0) { attr.text = str; } wrapper = renderer.createElement('text') .attr(attr); // Prevent wrapping from creating false offsetWidths in export in legacy IE (#1079, #1063) if (fakeSVG) { wrapper.css({ position: ABSOLUTE }); } if (!useHTML) { wrapper.xSetter = function (value, key, element) { var tspans = element.getElementsByTagName('tspan'), tspan, parentVal = element.getAttribute(key), i; for (i = 0; i < tspans.length; i++) { tspan = tspans[i]; // If the x values are equal, the tspan represents a linebreak if (tspan.getAttribute(key) === parentVal) { tspan.setAttribute(key, value); } } element.setAttribute(key, value); }; } return wrapper; }, /** * Utility to return the baseline offset and total line height from the font size */ fontMetrics: function (fontSize, elem) { var lineHeight, baseline, style; fontSize = fontSize || this.style.fontSize; if (!fontSize && elem && win.getComputedStyle) { elem = elem.element || elem; // SVGElement style = win.getComputedStyle(elem, ''); fontSize = style && style.fontSize; // #4309, the style doesn't exist inside a hidden iframe in Firefox } fontSize = /px/.test(fontSize) ? pInt(fontSize) : /em/.test(fontSize) ? parseFloat(fontSize) * 12 : 12; // Empirical values found by comparing font size and bounding box height. // Applies to the default font family. http://jsfiddle.net/highcharts/7xvn7/ lineHeight = fontSize < 24 ? fontSize + 3 : mathRound(fontSize * 1.2); baseline = mathRound(lineHeight * 0.8); return { h: lineHeight, b: baseline, f: fontSize }; }, /** * Correct X and Y positioning of a label for rotation (#1764) */ rotCorr: function (baseline, rotation, alterY) { var y = baseline; if (rotation && alterY) { y = mathMax(y * mathCos(rotation * deg2rad), 4); } return { x: (-baseline / 3) * mathSin(rotation * deg2rad), y: y }; }, /** * Add a label, a text item that can hold a colored or gradient background * as well as a border and shadow. * @param {string} str * @param {Number} x * @param {Number} y * @param {String} shape * @param {Number} anchorX In case the shape has a pointer, like a flag, this is the * coordinates it should be pinned to * @param {Number} anchorY * @param {Boolean} baseline Whether to position the label relative to the text baseline, * like renderer.text, or to the upper border of the rectangle. * @param {String} className Class name for the group */ label: function (str, x, y, shape, anchorX, anchorY, useHTML, baseline, className) { var renderer = this, wrapper = renderer.g(className), text = renderer.text('', 0, 0, useHTML) .attr({ zIndex: 1 }), //.add(wrapper), box, bBox, alignFactor = 0, padding = 3, paddingLeft = 0, width, height, wrapperX, wrapperY, crispAdjust = 0, deferredAttr = {}, baselineOffset, hasBGImage = /^url\((.*?)\)$/.test(shape), needsBox = hasBGImage, updateBoxSize, updateTextPadding, boxAttr; /** * This function runs after the label is added to the DOM (when the bounding box is * available), and after the text of the label is updated to detect the new bounding * box and reflect it in the border box. */ updateBoxSize = function () { var boxX, boxY, style = text.element.style; bBox = (width === undefined || height === undefined || wrapper.styles.textAlign) && defined(text.textStr) && text.getBBox(); //#3295 && 3514 box failure when string equals 0 wrapper.width = (width || bBox.width || 0) + 2 * padding + paddingLeft; wrapper.height = (height || bBox.height || 0) + 2 * padding; // update the label-scoped y offset baselineOffset = padding + renderer.fontMetrics(style && style.fontSize, text).b; if (needsBox) { if (!box) { // create the border box if it is not already present boxX = crispAdjust; boxY = (baseline ? -baselineOffset : 0) + crispAdjust; wrapper.box = box = renderer.symbols[shape] || hasBGImage ? // Symbol definition exists (#5324) renderer.symbol(shape, boxX, boxY, wrapper.width, wrapper.height, deferredAttr) : renderer.rect(boxX, boxY, wrapper.width, wrapper.height, 0, deferredAttr[STROKE_WIDTH]); if (!box.isImg) { // #4324, fill "none" causes it to be ignored by mouse events in IE box.attr('fill', NONE); } box.add(wrapper); } // apply the box attributes if (!box.isImg) { // #1630 box.attr(extend({ width: mathRound(wrapper.width), height: mathRound(wrapper.height) }, deferredAttr)); } deferredAttr = null; } }; /** * This function runs after setting text or padding, but only if padding is changed */ updateTextPadding = function () { var styles = wrapper.styles, textAlign = styles && styles.textAlign, x = paddingLeft + padding, y; // determin y based on the baseline y = baseline ? 0 : baselineOffset; // compensate for alignment if (defined(width) && bBox && (textAlign === 'center' || textAlign === 'right')) { x += { center: 0.5, right: 1 }[textAlign] * (width - bBox.width); } // update if anything changed if (x !== text.x || y !== text.y) { text.attr('x', x); if (y !== UNDEFINED) { text.attr('y', y); } } // record current values text.x = x; text.y = y; }; /** * Set a box attribute, or defer it if the box is not yet created * @param {Object} key * @param {Object} value */ boxAttr = function (key, value) { if (box) { box.attr(key, value); } else { deferredAttr[key] = value; } }; /** * After the text element is added, get the desired size of the border box * and add it before the text in the DOM. */ wrapper.onAdd = function () { text.add(wrapper); wrapper.attr({ text: (str || str === 0) ? str : '', // alignment is available now // #3295: 0 not rendered if given as a value x: x, y: y }); if (box && defined(anchorX)) { wrapper.attr({ anchorX: anchorX, anchorY: anchorY }); } }; /* * Add specific attribute setters. */ // only change local variables wrapper.widthSetter = function (value) { width = value; }; wrapper.heightSetter = function (value) { height = value; }; wrapper.paddingSetter = function (value) { if (defined(value) && value !== padding) { padding = wrapper.padding = value; updateTextPadding(); } }; wrapper.paddingLeftSetter = function (value) { if (defined(value) && value !== paddingLeft) { paddingLeft = value; updateTextPadding(); } }; // change local variable and prevent setting attribute on the group wrapper.alignSetter = function (value) { value = { left: 0, center: 0.5, right: 1 }[value]; if (value !== alignFactor) { alignFactor = value; if (bBox) { // Bounding box exists, means we're dynamically changing wrapper.attr({ x: wrapperX }); // #5134 } } }; // apply these to the box and the text alike wrapper.textSetter = function (value) { if (value !== UNDEFINED) { text.textSetter(value); } updateBoxSize(); updateTextPadding(); }; // apply these to the box but not to the text wrapper['stroke-widthSetter'] = function (value, key) { if (value) { needsBox = true; } crispAdjust = value % 2 / 2; boxAttr(key, value); }; wrapper.strokeSetter = wrapper.fillSetter = wrapper.rSetter = function (value, key) { if (key === 'fill' && value) { needsBox = true; } boxAttr(key, value); }; wrapper.anchorXSetter = function (value, key) { anchorX = value; boxAttr(key, mathRound(value) - crispAdjust - wrapperX); }; wrapper.anchorYSetter = function (value, key) { anchorY = value; boxAttr(key, value - wrapperY); }; // rename attributes wrapper.xSetter = function (value) { wrapper.x = value; // for animation getter if (alignFactor) { value -= alignFactor * ((width || bBox.width) + 2 * padding); } wrapperX = mathRound(value); wrapper.attr('translateX', wrapperX); }; wrapper.ySetter = function (value) { wrapperY = wrapper.y = mathRound(value); wrapper.attr('translateY', wrapperY); }; // Redirect certain methods to either the box or the text var baseCss = wrapper.css; return extend(wrapper, { /** * Pick up some properties and apply them to the text instead of the wrapper */ css: function (styles) { if (styles) { var textStyles = {}; styles = merge(styles); // create a copy to avoid altering the original object (#537) each(wrapper.textProps, function (prop) { if (styles[prop] !== UNDEFINED) { textStyles[prop] = styles[prop]; delete styles[prop]; } }); text.css(textStyles); } return baseCss.call(wrapper, styles); }, /** * Return the bounding box of the box, not the group */ getBBox: function () { return { width: bBox.width + 2 * padding, height: bBox.height + 2 * padding, x: bBox.x - padding, y: bBox.y - padding }; }, /** * Apply the shadow to the box */ shadow: function (b) { if (box) { box.shadow(b); } return wrapper; }, /** * Destroy and release memory. */ destroy: function () { // Added by button implementation removeEvent(wrapper.element, 'mouseenter'); removeEvent(wrapper.element, 'mouseleave'); if (text) { text = text.destroy(); } if (box) { box = box.destroy(); } // Call base implementation to destroy the rest SVGElement.prototype.destroy.call(wrapper); // Release local pointers (#1298) wrapper = renderer = updateBoxSize = updateTextPadding = boxAttr = null; } }); } }; // end SVGRenderer // general renderer Renderer = SVGRenderer; // extend SvgElement for useHTML option extend(SVGElement.prototype, { /** * Apply CSS to HTML elements. This is used in text within SVG rendering and * by the VML renderer */ htmlCss: function (styles) { var wrapper = this, element = wrapper.element, textWidth = styles && element.tagName === 'SPAN' && styles.width; if (textWidth) { delete styles.width; wrapper.textWidth = textWidth; wrapper.updateTransform(); } if (styles && styles.textOverflow === 'ellipsis') { styles.whiteSpace = 'nowrap'; styles.overflow = 'hidden'; } wrapper.styles = extend(wrapper.styles, styles); css(wrapper.element, styles); return wrapper; }, /** * VML and useHTML method for calculating the bounding box based on offsets * @param {Boolean} refresh Whether to force a fresh value from the DOM or to * use the cached value * * @return {Object} A hash containing values for x, y, width and height */ htmlGetBBox: function () { var wrapper = this, element = wrapper.element; // faking getBBox in exported SVG in legacy IE // faking getBBox in exported SVG in legacy IE (is this a duplicate of the fix for #1079?) if (element.nodeName === 'text') { element.style.position = ABSOLUTE; } return { x: element.offsetLeft, y: element.offsetTop, width: element.offsetWidth, height: element.offsetHeight }; }, /** * VML override private method to update elements based on internal * properties based on SVG transform */ htmlUpdateTransform: function () { // aligning non added elements is expensive if (!this.added) { this.alignOnAdd = true; return; } var wrapper = this, renderer = wrapper.renderer, elem = wrapper.element, translateX = wrapper.translateX || 0, translateY = wrapper.translateY || 0, x = wrapper.x || 0, y = wrapper.y || 0, align = wrapper.textAlign || 'left', alignCorrection = { left: 0, center: 0.5, right: 1 }[align], shadows = wrapper.shadows, styles = wrapper.styles; // apply translate css(elem, { marginLeft: translateX, marginTop: translateY }); if (shadows) { // used in labels/tooltip each(shadows, function (shadow) { css(shadow, { marginLeft: translateX + 1, marginTop: translateY + 1 }); }); } // apply inversion if (wrapper.inverted) { // wrapper is a group each(elem.childNodes, function (child) { renderer.invertChild(child, elem); }); } if (elem.tagName === 'SPAN') { var rotation = wrapper.rotation, baseline, textWidth = pInt(wrapper.textWidth), whiteSpace = styles && styles.whiteSpace, currentTextTransform = [rotation, align, elem.innerHTML, wrapper.textWidth, wrapper.textAlign].join(','); if (currentTextTransform !== wrapper.cTT) { // do the calculations and DOM access only if properties changed baseline = renderer.fontMetrics(elem.style.fontSize).b; // Renderer specific handling of span rotation if (defined(rotation)) { wrapper.setSpanRotation(rotation, alignCorrection, baseline); } // Reset multiline/ellipsis in order to read width (#4928, #5417) css(elem, { width: '', whiteSpace: whiteSpace || 'nowrap' }); // Update textWidth if (elem.offsetWidth > textWidth && /[ \-]/.test(elem.textContent || elem.innerText)) { // #983, #1254 css(elem, { width: textWidth + PX, display: 'block', whiteSpace: whiteSpace || 'normal' // #3331 }); } wrapper.getSpanCorrection(elem.offsetWidth, baseline, alignCorrection, rotation, align); } // apply position with correction css(elem, { left: (x + (wrapper.xCorr || 0)) + PX, top: (y + (wrapper.yCorr || 0)) + PX }); // force reflow in webkit to apply the left and top on useHTML element (#1249) if (isWebKit) { baseline = elem.offsetHeight; // assigned to baseline for lint purpose } // record current text transform wrapper.cTT = currentTextTransform; } }, /** * Set the rotation of an individual HTML span */ setSpanRotation: function (rotation, alignCorrection, baseline) { var rotationStyle = {}, cssTransformKey = isMS ? '-ms-transform' : isWebKit ? '-webkit-transform' : isFirefox ? 'MozTransform' : isOpera ? '-o-transform' : ''; rotationStyle[cssTransformKey] = rotationStyle.transform = 'rotate(' + rotation + 'deg)'; rotationStyle[cssTransformKey + (isFirefox ? 'Origin' : '-origin')] = rotationStyle.transformOrigin = (alignCorrection * 100) + '% ' + baseline + 'px'; css(this.element, rotationStyle); }, /** * Get the correction in X and Y positioning as the element is rotated. */ getSpanCorrection: function (width, baseline, alignCorrection) { this.xCorr = -width * alignCorrection; this.yCorr = -baseline; } }); // Extend SvgRenderer for useHTML option. extend(SVGRenderer.prototype, { /** * Create HTML text node. This is used by the VML renderer as well as the SVG * renderer through the useHTML option. * * @param {String} str * @param {Number} x * @param {Number} y */ html: function (str, x, y) { var wrapper = this.createElement('span'), element = wrapper.element, renderer = wrapper.renderer, isSVG = renderer.isSVG, addSetters = function (element, style) { // These properties are set as attributes on the SVG group, and as // identical CSS properties on the div. (#3542) each(['display', 'opacity', 'visibility'], function (prop) { wrap(element, prop + 'Setter', function (proceed, value, key, elem) { proceed.call(this, value, key, elem); style[key] = value; }); }); }; // Text setter wrapper.textSetter = function (value) { if (value !== element.innerHTML) { delete this.bBox; } element.innerHTML = this.textStr = value; wrapper.htmlUpdateTransform(); }; // Add setters for the element itself (#4938) if (isSVG) { // #4938, only for HTML within SVG addSetters(wrapper, wrapper.element.style); } // Various setters which rely on update transform wrapper.xSetter = wrapper.ySetter = wrapper.alignSetter = wrapper.rotationSetter = function (value, key) { if (key === 'align') { key = 'textAlign'; // Do not overwrite the SVGElement.align method. Same as VML. } wrapper[key] = value; wrapper.htmlUpdateTransform(); }; // Set the default attributes wrapper .attr({ text: str, x: mathRound(x), y: mathRound(y) }) .css({ position: ABSOLUTE, fontFamily: this.style.fontFamily, fontSize: this.style.fontSize }); // Keep the whiteSpace style outside the wrapper.styles collection element.style.whiteSpace = 'nowrap'; // Use the HTML specific .css method wrapper.css = wrapper.htmlCss; // This is specific for HTML within SVG if (isSVG) { wrapper.add = function (svgGroupWrapper) { var htmlGroup, container = renderer.box.parentNode, parentGroup, parents = []; this.parentGroup = svgGroupWrapper; // Create a mock group to hold the HTML elements if (svgGroupWrapper) { htmlGroup = svgGroupWrapper.div; if (!htmlGroup) { // Read the parent chain into an array and read from top down parentGroup = svgGroupWrapper; while (parentGroup) { parents.push(parentGroup); // Move up to the next parent group parentGroup = parentGroup.parentGroup; } // Ensure dynamically updating position when any parent is translated each(parents.reverse(), function (parentGroup) { var htmlGroupStyle, cls = attr(parentGroup.element, 'class'); if (cls) { cls = { className: cls }; } // else null // Create a HTML div and append it to the parent div to emulate // the SVG group structure htmlGroup = parentGroup.div = parentGroup.div || createElement(DIV, cls, { position: ABSOLUTE, left: (parentGroup.translateX || 0) + PX, top: (parentGroup.translateY || 0) + PX, display: parentGroup.display, opacity: parentGroup.opacity, // #5075 pointerEvents: parentGroup.styles && parentGroup.styles.pointerEvents // #5595 }, htmlGroup || container); // the top group is appended to container // Shortcut htmlGroupStyle = htmlGroup.style; // Set listeners to update the HTML div's position whenever the SVG group // position is changed extend(parentGroup, { translateXSetter: function (value, key) { htmlGroupStyle.left = value + PX; parentGroup[key] = value; parentGroup.doTransform = true; }, translateYSetter: function (value, key) { htmlGroupStyle.top = value + PX; parentGroup[key] = value; parentGroup.doTransform = true; } }); addSetters(parentGroup, htmlGroupStyle); }); } } else { htmlGroup = container; } htmlGroup.appendChild(element); // Shared with VML: wrapper.added = true; if (wrapper.alignOnAdd) { wrapper.htmlUpdateTransform(); } return wrapper; }; } return wrapper; } }); /* **************************************************************************** * * * START OF INTERNET EXPLORER <= 8 SPECIFIC CODE * * * * For applications and websites that don't need IE support, like platform * * targeted mobile apps and web apps, this code can be removed. * * * *****************************************************************************/ /** * @constructor */ var VMLRenderer, VMLElement; if (!hasSVG && !useCanVG) { /** * The VML element wrapper. */ VMLElement = { /** * Initialize a new VML element wrapper. It builds the markup as a string * to minimize DOM traffic. * @param {Object} renderer * @param {Object} nodeName */ init: function (renderer, nodeName) { var wrapper = this, markup = ['<', nodeName, ' filled="f" stroked="f"'], style = ['position: ', ABSOLUTE, ';'], isDiv = nodeName === DIV; // divs and shapes need size if (nodeName === 'shape' || isDiv) { style.push('left:0;top:0;width:1px;height:1px;'); } style.push('visibility: ', isDiv ? HIDDEN : VISIBLE); markup.push(' style="', style.join(''), '"/>'); // create element with default attributes and style if (nodeName) { markup = isDiv || nodeName === 'span' || nodeName === 'img' ? markup.join('') : renderer.prepVML(markup); wrapper.element = createElement(markup); } wrapper.renderer = renderer; }, /** * Add the node to the given parent * @param {Object} parent */ add: function (parent) { var wrapper = this, renderer = wrapper.renderer, element = wrapper.element, box = renderer.box, inverted = parent && parent.inverted, // get the parent node parentNode = parent ? parent.element || parent : box; if (parent) { this.parentGroup = parent; } // if the parent group is inverted, apply inversion on all children if (inverted) { // only on groups renderer.invertChild(element, parentNode); } // append it parentNode.appendChild(element); // align text after adding to be able to read offset wrapper.added = true; if (wrapper.alignOnAdd && !wrapper.deferUpdateTransform) { wrapper.updateTransform(); } // fire an event for internal hooks if (wrapper.onAdd) { wrapper.onAdd(); } return wrapper; }, /** * VML always uses htmlUpdateTransform */ updateTransform: SVGElement.prototype.htmlUpdateTransform, /** * Set the rotation of a span with oldIE's filter */ setSpanRotation: function () { // Adjust for alignment and rotation. Rotation of useHTML content is not yet implemented // but it can probably be implemented for Firefox 3.5+ on user request. FF3.5+ // has support for CSS3 transform. The getBBox method also needs to be updated // to compensate for the rotation, like it currently does for SVG. // Test case: http://jsfiddle.net/highcharts/Ybt44/ var rotation = this.rotation, costheta = mathCos(rotation * deg2rad), sintheta = mathSin(rotation * deg2rad); css(this.element, { filter: rotation ? ['progid:DXImageTransform.Microsoft.Matrix(M11=', costheta, ', M12=', -sintheta, ', M21=', sintheta, ', M22=', costheta, ', sizingMethod=\'auto expand\')'].join('') : NONE }); }, /** * Get the positioning correction for the span after rotating. */ getSpanCorrection: function (width, baseline, alignCorrection, rotation, align) { var costheta = rotation ? mathCos(rotation * deg2rad) : 1, sintheta = rotation ? mathSin(rotation * deg2rad) : 0, height = pick(this.elemHeight, this.element.offsetHeight), quad, nonLeft = align && align !== 'left'; // correct x and y this.xCorr = costheta < 0 && -width; this.yCorr = sintheta < 0 && -height; // correct for baseline and corners spilling out after rotation quad = costheta * sintheta < 0; this.xCorr += sintheta * baseline * (quad ? 1 - alignCorrection : alignCorrection); this.yCorr -= costheta * baseline * (rotation ? (quad ? alignCorrection : 1 - alignCorrection) : 1); // correct for the length/height of the text if (nonLeft) { this.xCorr -= width * alignCorrection * (costheta < 0 ? -1 : 1); if (rotation) { this.yCorr -= height * alignCorrection * (sintheta < 0 ? -1 : 1); } css(this.element, { textAlign: align }); } }, /** * Converts a subset of an SVG path definition to its VML counterpart. Takes an array * as the parameter and returns a string. */ pathToVML: function (value) { // convert paths var i = value.length, path = []; while (i--) { // Multiply by 10 to allow subpixel precision. // Substracting half a pixel seems to make the coordinates // align with SVG, but this hasn't been tested thoroughly if (isNumber(value[i])) { path[i] = mathRound(value[i] * 10) - 5; } else if (value[i] === 'Z') { // close the path path[i] = 'x'; } else { path[i] = value[i]; // When the start X and end X coordinates of an arc are too close, // they are rounded to the same value above. In this case, substract or // add 1 from the end X and Y positions. #186, #760, #1371, #1410. if (value.isArc && (value[i] === 'wa' || value[i] === 'at')) { // Start and end X if (path[i + 5] === path[i + 7]) { path[i + 7] += value[i + 7] > value[i + 5] ? 1 : -1; } // Start and end Y if (path[i + 6] === path[i + 8]) { path[i + 8] += value[i + 8] > value[i + 6] ? 1 : -1; } } } } // Loop up again to handle path shortcuts (#2132) /*while (i++ < path.length) { if (path[i] === 'H') { // horizontal line to path[i] = 'L'; path.splice(i + 2, 0, path[i - 1]); } else if (path[i] === 'V') { // vertical line to path[i] = 'L'; path.splice(i + 1, 0, path[i - 2]); } }*/ return path.join(' ') || 'x'; }, /** * Set the element's clipping to a predefined rectangle * * @param {String} id The id of the clip rectangle */ clip: function (clipRect) { var wrapper = this, clipMembers, cssRet; if (clipRect) { clipMembers = clipRect.members; erase(clipMembers, wrapper); // Ensure unique list of elements (#1258) clipMembers.push(wrapper); wrapper.destroyClip = function () { erase(clipMembers, wrapper); }; cssRet = clipRect.getCSS(wrapper); } else { if (wrapper.destroyClip) { wrapper.destroyClip(); } cssRet = { clip: docMode8 ? 'inherit' : 'rect(auto)' }; // #1214 } return wrapper.css(cssRet); }, /** * Set styles for the element * @param {Object} styles */ css: SVGElement.prototype.htmlCss, /** * Removes a child either by removeChild or move to garbageBin. * Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not. */ safeRemoveChild: function (element) { // discardElement will detach the node from its parent before attaching it // to the garbage bin. Therefore it is important that the node is attached and have parent. if (element.parentNode) { discardElement(element); } }, /** * Extend element.destroy by removing it from the clip members array */ destroy: function () { if (this.destroyClip) { this.destroyClip(); } return SVGElement.prototype.destroy.apply(this); }, /** * Add an event listener. VML override for normalizing event parameters. * @param {String} eventType * @param {Function} handler */ on: function (eventType, handler) { // simplest possible event model for internal use this.element['on' + eventType] = function () { var evt = win.event; evt.target = evt.srcElement; handler(evt); }; return this; }, /** * In stacked columns, cut off the shadows so that they don't overlap */ cutOffPath: function (path, length) { var len; path = path.split(/[ ,]/); len = path.length; if (len === 9 || len === 11) { path[len - 4] = path[len - 2] = pInt(path[len - 2]) - 10 * length; } return path.join(' '); }, /** * Apply a drop shadow by copying elements and giving them different strokes * @param {Boolean|Object} shadowOptions */ shadow: function (shadowOptions, group, cutOff) { var shadows = [], i, element = this.element, renderer = this.renderer, shadow, elemStyle = element.style, markup, path = element.path, strokeWidth, modifiedPath, shadowWidth, shadowElementOpacity; // some times empty paths are not strings if (path && typeof path.value !== 'string') { path = 'x'; } modifiedPath = path; if (shadowOptions) { shadowWidth = pick(shadowOptions.width, 3); shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth; for (i = 1; i <= 3; i++) { strokeWidth = (shadowWidth * 2) + 1 - (2 * i); // Cut off shadows for stacked column items if (cutOff) { modifiedPath = this.cutOffPath(path.value, strokeWidth + 0.5); } markup = ['']; shadow = createElement(renderer.prepVML(markup), null, { left: pInt(elemStyle.left) + pick(shadowOptions.offsetX, 1), top: pInt(elemStyle.top) + pick(shadowOptions.offsetY, 1) } ); if (cutOff) { shadow.cutOff = strokeWidth + 1; } // apply the opacity markup = ['']; createElement(renderer.prepVML(markup), null, null, shadow); // insert it if (group) { group.element.appendChild(shadow); } else { element.parentNode.insertBefore(shadow, element); } // record it shadows.push(shadow); } this.shadows = shadows; } return this; }, updateShadows: noop, // Used in SVG only setAttr: function (key, value) { if (docMode8) { // IE8 setAttribute bug this.element[key] = value; } else { this.element.setAttribute(key, value); } }, classSetter: function (value) { // IE8 Standards mode has problems retrieving the className unless set like this this.element.className = value; }, dashstyleSetter: function (value, key, element) { var strokeElem = element.getElementsByTagName('stroke')[0] || createElement(this.renderer.prepVML(['']), null, null, element); strokeElem[key] = value || 'solid'; this[key] = value; /* because changing stroke-width will change the dash length and cause an epileptic effect */ }, dSetter: function (value, key, element) { var i, shadows = this.shadows; value = value || []; this.d = value.join && value.join(' '); // used in getter for animation element.path = value = this.pathToVML(value); // update shadows if (shadows) { i = shadows.length; while (i--) { shadows[i].path = shadows[i].cutOff ? this.cutOffPath(value, shadows[i].cutOff) : value; } } this.setAttr(key, value); }, fillSetter: function (value, key, element) { var nodeName = element.nodeName; if (nodeName === 'SPAN') { // text color element.style.color = value; } else if (nodeName !== 'IMG') { // #1336 element.filled = value !== NONE; this.setAttr('fillcolor', this.renderer.color(value, element, key, this)); } }, 'fill-opacitySetter': function (value, key, element) { createElement( this.renderer.prepVML(['<', key.split('-')[0], ' opacity="', value, '"/>']), null, null, element ); }, opacitySetter: noop, // Don't bother - animation is too slow and filters introduce artifacts rotationSetter: function (value, key, element) { var style = element.style; this[key] = style[key] = value; // style is for #1873 // Correction for the 1x1 size of the shape container. Used in gauge needles. style.left = -mathRound(mathSin(value * deg2rad) + 1) + PX; style.top = mathRound(mathCos(value * deg2rad)) + PX; }, strokeSetter: function (value, key, element) { this.setAttr('strokecolor', this.renderer.color(value, element, key, this)); }, 'stroke-widthSetter': function (value, key, element) { element.stroked = !!value; // VML "stroked" attribute this[key] = value; // used in getter, issue #113 if (isNumber(value)) { value += PX; } this.setAttr('strokeweight', value); }, titleSetter: function (value, key) { this.setAttr(key, value); }, visibilitySetter: function (value, key, element) { // Handle inherited visibility if (value === 'inherit') { value = VISIBLE; } // Let the shadow follow the main element if (this.shadows) { each(this.shadows, function (shadow) { shadow.style[key] = value; }); } // Instead of toggling the visibility CSS property, move the div out of the viewport. // This works around #61 and #586 if (element.nodeName === 'DIV') { value = value === HIDDEN ? '-999em' : 0; // In order to redraw, IE7 needs the div to be visible when tucked away // outside the viewport. So the visibility is actually opposite of // the expected value. This applies to the tooltip only. if (!docMode8) { element.style[key] = value ? VISIBLE : HIDDEN; } key = 'top'; } element.style[key] = value; }, displaySetter: function (value, key, element) { element.style[key] = value; }, xSetter: function (value, key, element) { this[key] = value; // used in getter if (key === 'x') { key = 'left'; } else if (key === 'y') { key = 'top'; }/* else { value = mathMax(0, value); // don't set width or height below zero (#311) }*/ // clipping rectangle special if (this.updateClipping) { this[key] = value; // the key is now 'left' or 'top' for 'x' and 'y' this.updateClipping(); } else { // normal element.style[key] = value; } }, zIndexSetter: function (value, key, element) { element.style[key] = value; } }; VMLElement['stroke-opacitySetter'] = VMLElement['fill-opacitySetter']; Highcharts.VMLElement = VMLElement = extendClass(SVGElement, VMLElement); // Some shared setters VMLElement.prototype.ySetter = VMLElement.prototype.widthSetter = VMLElement.prototype.heightSetter = VMLElement.prototype.xSetter; /** * The VML renderer */ var VMLRendererExtension = { // inherit SVGRenderer Element: VMLElement, isIE8: userAgent.indexOf('MSIE 8.0') > -1, /** * Initialize the VMLRenderer * @param {Object} container * @param {Number} width * @param {Number} height */ init: function (container, width, height, style) { var renderer = this, boxWrapper, box, css; renderer.alignedObjects = []; boxWrapper = renderer.createElement(DIV) .css(extend(this.getStyle(style), { position: 'relative' })); box = boxWrapper.element; container.appendChild(boxWrapper.element); // generate the containing box renderer.isVML = true; renderer.box = box; renderer.boxWrapper = boxWrapper; renderer.gradients = {}; renderer.cache = {}; // Cache for numerical bounding boxes renderer.cacheKeys = []; renderer.imgCount = 0; renderer.setSize(width, height, false); // The only way to make IE6 and IE7 print is to use a global namespace. However, // with IE8 the only way to make the dynamic shapes visible in screen and print mode // seems to be to add the xmlns attribute and the behaviour style inline. if (!doc.namespaces.hcv) { doc.namespaces.add('hcv', 'urn:schemas-microsoft-com:vml'); // Setup default CSS (#2153, #2368, #2384) css = 'hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke' + '{ behavior:url(#default#VML); display: inline-block; } '; try { doc.createStyleSheet().cssText = css; } catch (e) { doc.styleSheets[0].cssText += css; } } }, /** * Detect whether the renderer is hidden. This happens when one of the parent elements * has display: none */ isHidden: function () { return !this.box.offsetWidth; }, /** * Define a clipping rectangle. In VML it is accomplished by storing the values * for setting the CSS style to all associated members. * * @param {Number} x * @param {Number} y * @param {Number} width * @param {Number} height */ clipRect: function (x, y, width, height) { // create a dummy element var clipRect = this.createElement(), isObj = isObject(x); // mimic a rectangle with its style object for automatic updating in attr return extend(clipRect, { members: [], count: 0, left: (isObj ? x.x : x) + 1, top: (isObj ? x.y : y) + 1, width: (isObj ? x.width : width) - 1, height: (isObj ? x.height : height) - 1, getCSS: function (wrapper) { var element = wrapper.element, nodeName = element.nodeName, isShape = nodeName === 'shape', inverted = wrapper.inverted, rect = this, top = rect.top - (isShape ? element.offsetTop : 0), left = rect.left, right = left + rect.width, bottom = top + rect.height, ret = { clip: 'rect(' + mathRound(inverted ? left : top) + 'px,' + mathRound(inverted ? bottom : right) + 'px,' + mathRound(inverted ? right : bottom) + 'px,' + mathRound(inverted ? top : left) + 'px)' }; // issue 74 workaround if (!inverted && docMode8 && nodeName === 'DIV') { extend(ret, { width: right + PX, height: bottom + PX }); } return ret; }, // used in attr and animation to update the clipping of all members updateClipping: function () { each(clipRect.members, function (member) { if (member.element) { // Deleted series, like in stock/members/series-remove demo. Should be removed from members, but this will do. member.css(clipRect.getCSS(member)); } }); } }); }, /** * Take a color and return it if it's a string, make it a gradient if it's a * gradient configuration object, and apply opacity. * * @param {Object} color The color or config object */ color: function (color, elem, prop, wrapper) { var renderer = this, colorObject, regexRgba = /^rgba/, markup, fillType, ret = NONE; // Check for linear or radial gradient if (color && color.linearGradient) { fillType = 'gradient'; } else if (color && color.radialGradient) { fillType = 'pattern'; } if (fillType) { var stopColor, stopOpacity, gradient = color.linearGradient || color.radialGradient, x1, y1, x2, y2, opacity1, opacity2, color1, color2, fillAttr = '', stops = color.stops, firstStop, lastStop, colors = [], addFillNode = function () { // Add the fill subnode. When colors attribute is used, the meanings of opacity and o:opacity2 // are reversed. markup = ['']; createElement(renderer.prepVML(markup), null, null, elem); }; // Extend from 0 to 1 firstStop = stops[0]; lastStop = stops[stops.length - 1]; if (firstStop[0] > 0) { stops.unshift([ 0, firstStop[1] ]); } if (lastStop[0] < 1) { stops.push([ 1, lastStop[1] ]); } // Compute the stops each(stops, function (stop, i) { if (regexRgba.test(stop[1])) { colorObject = Color(stop[1]); stopColor = colorObject.get('rgb'); stopOpacity = colorObject.get('a'); } else { stopColor = stop[1]; stopOpacity = 1; } // Build the color attribute colors.push((stop[0] * 100) + '% ' + stopColor); // Only start and end opacities are allowed, so we use the first and the last if (!i) { opacity1 = stopOpacity; color2 = stopColor; } else { opacity2 = stopOpacity; color1 = stopColor; } }); // Apply the gradient to fills only. if (prop === 'fill') { // Handle linear gradient angle if (fillType === 'gradient') { x1 = gradient.x1 || gradient[0] || 0; y1 = gradient.y1 || gradient[1] || 0; x2 = gradient.x2 || gradient[2] || 0; y2 = gradient.y2 || gradient[3] || 0; fillAttr = 'angle="' + (90 - math.atan( (y2 - y1) / // y vector (x2 - x1) // x vector ) * 180 / mathPI) + '"'; addFillNode(); // Radial (circular) gradient } else { var r = gradient.r, sizex = r * 2, sizey = r * 2, cx = gradient.cx, cy = gradient.cy, radialReference = elem.radialReference, bBox, applyRadialGradient = function () { if (radialReference) { bBox = wrapper.getBBox(); cx += (radialReference[0] - bBox.x) / bBox.width - 0.5; cy += (radialReference[1] - bBox.y) / bBox.height - 0.5; sizex *= radialReference[2] / bBox.width; sizey *= radialReference[2] / bBox.height; } fillAttr = 'src="' + defaultOptions.global.VMLRadialGradientURL + '" ' + 'size="' + sizex + ',' + sizey + '" ' + 'origin="0.5,0.5" ' + 'position="' + cx + ',' + cy + '" ' + 'color2="' + color2 + '" '; addFillNode(); }; // Apply radial gradient if (wrapper.added) { applyRadialGradient(); } else { // We need to know the bounding box to get the size and position right wrapper.onAdd = applyRadialGradient; } // The fill element's color attribute is broken in IE8 standards mode, so we // need to set the parent shape's fillcolor attribute instead. ret = color1; } // Gradients are not supported for VML stroke, return the first color. #722. } else { ret = stopColor; } // If the color is an rgba color, split it and add a fill node // to hold the opacity component } else if (regexRgba.test(color) && elem.tagName !== 'IMG') { colorObject = Color(color); wrapper[prop + '-opacitySetter'](colorObject.get('a'), prop, elem); ret = colorObject.get('rgb'); } else { var propNodes = elem.getElementsByTagName(prop); // 'stroke' or 'fill' node if (propNodes.length) { propNodes[0].opacity = 1; propNodes[0].type = 'solid'; } ret = color; } return ret; }, /** * Take a VML string and prepare it for either IE8 or IE6/IE7. * @param {Array} markup A string array of the VML markup to prepare */ prepVML: function (markup) { var vmlStyle = 'display:inline-block;behavior:url(#default#VML);', isIE8 = this.isIE8; markup = markup.join(''); if (isIE8) { // add xmlns and style inline markup = markup.replace('/>', ' xmlns="urn:schemas-microsoft-com:vml" />'); if (markup.indexOf('style="') === -1) { markup = markup.replace('/>', ' style="' + vmlStyle + '" />'); } else { markup = markup.replace('style="', 'style="' + vmlStyle); } } else { // add namespace markup = markup.replace('<', ' 1) { obj.attr({ x: x, y: y, width: width, height: height }); } return obj; }, /** * For rectangles, VML uses a shape for rect to overcome bugs and rotation problems */ createElement: function (nodeName) { return nodeName === 'rect' ? this.symbol(nodeName) : SVGRenderer.prototype.createElement.call(this, nodeName); }, /** * In the VML renderer, each child of an inverted div (group) is inverted * @param {Object} element * @param {Object} parentNode */ invertChild: function (element, parentNode) { var ren = this, parentStyle = parentNode.style, imgStyle = element.tagName === 'IMG' && element.style; // #1111 css(element, { flip: 'x', left: pInt(parentStyle.width) - (imgStyle ? pInt(imgStyle.top) : 1), top: pInt(parentStyle.height) - (imgStyle ? pInt(imgStyle.left) : 1), rotation: -90 }); // Recursively invert child elements, needed for nested composite shapes like box plots and error bars. #1680, #1806. each(element.childNodes, function (child) { ren.invertChild(child, element); }); }, /** * Symbol definitions that override the parent SVG renderer's symbols * */ symbols: { // VML specific arc function arc: function (x, y, w, h, options) { var start = options.start, end = options.end, radius = options.r || w || h, innerRadius = options.innerR, cosStart = mathCos(start), sinStart = mathSin(start), cosEnd = mathCos(end), sinEnd = mathSin(end), ret; if (end - start === 0) { // no angle, don't show it. return ['x']; } ret = [ 'wa', // clockwise arc to x - radius, // left y - radius, // top x + radius, // right y + radius, // bottom x + radius * cosStart, // start x y + radius * sinStart, // start y x + radius * cosEnd, // end x y + radius * sinEnd // end y ]; if (options.open && !innerRadius) { ret.push( 'e', M, x, // - innerRadius, y// - innerRadius ); } ret.push( 'at', // anti clockwise arc to x - innerRadius, // left y - innerRadius, // top x + innerRadius, // right y + innerRadius, // bottom x + innerRadius * cosEnd, // start x y + innerRadius * sinEnd, // start y x + innerRadius * cosStart, // end x y + innerRadius * sinStart, // end y 'x', // finish path 'e' // close ); ret.isArc = true; return ret; }, // Add circle symbol path. This performs significantly faster than v:oval. circle: function (x, y, w, h, wrapper) { if (wrapper) { w = h = 2 * wrapper.r; } // Center correction, #1682 if (wrapper && wrapper.isCircle) { x -= w / 2; y -= h / 2; } // Return the path return [ 'wa', // clockwisearcto x, // left y, // top x + w, // right y + h, // bottom x + w, // start x y + h / 2, // start y x + w, // end x y + h / 2, // end y //'x', // finish path 'e' // close ]; }, /** * Add rectangle symbol path which eases rotation and omits arcsize problems * compared to the built-in VML roundrect shape. When borders are not rounded, * use the simpler square path, else use the callout path without the arrow. */ rect: function (x, y, w, h, options) { return SVGRenderer.prototype.symbols[ !defined(options) || !options.r ? 'square' : 'callout' ].call(0, x, y, w, h, options); } } }; Highcharts.VMLRenderer = VMLRenderer = function () { this.init.apply(this, arguments); }; VMLRenderer.prototype = merge(SVGRenderer.prototype, VMLRendererExtension); // general renderer Renderer = VMLRenderer; } // This method is used with exporting in old IE, when emulating SVG (see #2314) SVGRenderer.prototype.measureSpanWidth = function (text, styles) { var measuringSpan = doc.createElement('span'), offsetWidth, textNode = doc.createTextNode(text); measuringSpan.appendChild(textNode); css(measuringSpan, styles); this.box.appendChild(measuringSpan); offsetWidth = measuringSpan.offsetWidth; discardElement(measuringSpan); // #2463 return offsetWidth; }; /* **************************************************************************** * * * END OF INTERNET EXPLORER <= 8 SPECIFIC CODE * * * *****************************************************************************/ /* **************************************************************************** * * * START OF ANDROID < 3 SPECIFIC CODE. THIS CAN BE REMOVED IF YOU'RE NOT * * TARGETING THAT SYSTEM. * * * *****************************************************************************/ var CanVGRenderer, CanVGController; /** * Downloads a script and executes a callback when done. * @param {String} scriptLocation * @param {Function} callback */ function getScript(scriptLocation, callback) { var head = doc.getElementsByTagName('head')[0], script = doc.createElement('script'); script.type = 'text/javascript'; script.src = scriptLocation; script.onload = callback; head.appendChild(script); } if (useCanVG) { /** * The CanVGRenderer is empty from start to keep the source footprint small. * When requested, the CanVGController downloads the rest of the source packaged * together with the canvg library. */ Highcharts.CanVGRenderer = CanVGRenderer = function () { // Override the global SVG namespace to fake SVG/HTML that accepts CSS SVG_NS = 'http://www.w3.org/1999/xhtml'; }; /** * Start with an empty symbols object. This is needed when exporting is used (exporting.src.js will add a few symbols), but * the implementation from SvgRenderer will not be merged in until first render. */ CanVGRenderer.prototype.symbols = {}; /** * Handles on demand download of canvg rendering support. */ CanVGController = (function () { // List of renderering calls var deferredRenderCalls = []; /** * When downloaded, we are ready to draw deferred charts. */ function drawDeferred() { var callLength = deferredRenderCalls.length, callIndex; // Draw all pending render calls for (callIndex = 0; callIndex < callLength; callIndex++) { deferredRenderCalls[callIndex](); } // Clear the list deferredRenderCalls = []; } return { push: function (func, scriptLocation) { // Only get the script once if (deferredRenderCalls.length === 0) { getScript(scriptLocation, drawDeferred); } // Register render call deferredRenderCalls.push(func); } }; }()); Renderer = CanVGRenderer; } // end CanVGRenderer /* **************************************************************************** * * * END OF ANDROID < 3 SPECIFIC CODE * * * *****************************************************************************/ /** * The Tick class */ function Tick(axis, pos, type, noLabel) { this.axis = axis; this.pos = pos; this.type = type || ''; this.isNew = true; if (!type && !noLabel) { this.addLabel(); } } Tick.prototype = { /** * Write the tick label */ addLabel: function () { var tick = this, axis = tick.axis, options = axis.options, chart = axis.chart, categories = axis.categories, names = axis.names, pos = tick.pos, labelOptions = options.labels, str, tickPositions = axis.tickPositions, isFirst = pos === tickPositions[0], isLast = pos === tickPositions[tickPositions.length - 1], value = categories ? pick(categories[pos], names[pos], pos) : pos, label = tick.label, tickPositionInfo = tickPositions.info, dateTimeLabelFormat; // Set the datetime label format. If a higher rank is set for this position, use that. If not, // use the general format. if (axis.isDatetimeAxis && tickPositionInfo) { dateTimeLabelFormat = options.dateTimeLabelFormats[tickPositionInfo.higherRanks[pos] || tickPositionInfo.unitName]; } // set properties for access in render method tick.isFirst = isFirst; tick.isLast = isLast; // get the string str = axis.labelFormatter.call({ axis: axis, chart: chart, isFirst: isFirst, isLast: isLast, dateTimeLabelFormat: dateTimeLabelFormat, value: axis.isLog ? correctFloat(axis.lin2log(value)) : value }); // prepare CSS //css = width && { width: mathMax(1, mathRound(width - 2 * (labelOptions.padding || 10))) + PX }; // first call if (!defined(label)) { tick.label = label = defined(str) && labelOptions.enabled ? chart.renderer.text( str, 0, 0, labelOptions.useHTML ) //.attr(attr) // without position absolute, IE export sometimes is wrong .css(merge(labelOptions.style)) .add(axis.labelGroup) : null; tick.labelLength = label && label.getBBox().width; // Un-rotated length tick.rotation = 0; // Base value to detect change for new calls to getBBox // update } else if (label) { label.attr({ text: str }); } }, /** * Get the offset height or width of the label */ getLabelSize: function () { return this.label ? this.label.getBBox()[this.axis.horiz ? 'height' : 'width'] : 0; }, /** * Handle the label overflow by adjusting the labels to the left and right edge, or * hide them if they collide into the neighbour label. */ handleOverflow: function (xy) { var axis = this.axis, pxPos = xy.x, chartWidth = axis.chart.chartWidth, spacing = axis.chart.spacing, leftBound = pick(axis.labelLeft, mathMin(axis.pos, spacing[3])), rightBound = pick(axis.labelRight, mathMax(axis.pos + axis.len, chartWidth - spacing[1])), label = this.label, rotation = this.rotation, factor = { left: 0, center: 0.5, right: 1 }[axis.labelAlign], labelWidth = label.getBBox().width, slotWidth = axis.getSlotWidth(), modifiedSlotWidth = slotWidth, xCorrection = factor, goRight = 1, leftPos, rightPos, textWidth, css = {}; // Check if the label overshoots the chart spacing box. If it does, move it. // If it now overshoots the slotWidth, add ellipsis. if (!rotation) { leftPos = pxPos - factor * labelWidth; rightPos = pxPos + (1 - factor) * labelWidth; if (leftPos < leftBound) { modifiedSlotWidth = xy.x + modifiedSlotWidth * (1 - factor) - leftBound; } else if (rightPos > rightBound) { modifiedSlotWidth = rightBound - xy.x + modifiedSlotWidth * factor; goRight = -1; } modifiedSlotWidth = mathMin(slotWidth, modifiedSlotWidth); // #4177 if (modifiedSlotWidth < slotWidth && axis.labelAlign === 'center') { xy.x += goRight * (slotWidth - modifiedSlotWidth - xCorrection * (slotWidth - mathMin(labelWidth, modifiedSlotWidth))); } // If the label width exceeds the available space, set a text width to be // picked up below. Also, if a width has been set before, we need to set a new // one because the reported labelWidth will be limited by the box (#3938). if (labelWidth > modifiedSlotWidth || (axis.autoRotation && label.styles.width)) { textWidth = modifiedSlotWidth; } // Add ellipsis to prevent rotated labels to be clipped against the edge of the chart } else if (rotation < 0 && pxPos - factor * labelWidth < leftBound) { textWidth = mathRound(pxPos / mathCos(rotation * deg2rad) - leftBound); } else if (rotation > 0 && pxPos + factor * labelWidth > rightBound) { textWidth = mathRound((chartWidth - pxPos) / mathCos(rotation * deg2rad)); } if (textWidth) { css.width = textWidth; if (!axis.options.labels.style.textOverflow) { css.textOverflow = 'ellipsis'; } label.css(css); } }, /** * Get the x and y position for ticks and labels */ getPosition: function (horiz, pos, tickmarkOffset, old) { var axis = this.axis, chart = axis.chart, cHeight = (old && chart.oldChartHeight) || chart.chartHeight; return { x: horiz ? axis.translate(pos + tickmarkOffset, null, null, old) + axis.transB : axis.left + axis.offset + (axis.opposite ? ((old && chart.oldChartWidth) || chart.chartWidth) - axis.right - axis.left : 0), y: horiz ? cHeight - axis.bottom + axis.offset - (axis.opposite ? axis.height : 0) : cHeight - axis.translate(pos + tickmarkOffset, null, null, old) - axis.transB }; }, /** * Get the x, y position of the tick label */ getLabelPosition: function (x, y, label, horiz, labelOptions, tickmarkOffset, index, step) { var axis = this.axis, transA = axis.transA, reversed = axis.reversed, staggerLines = axis.staggerLines, rotCorr = axis.tickRotCorr || { x: 0, y: 0 }, yOffset = labelOptions.y, line; if (!defined(yOffset)) { if (axis.side === 0) { yOffset = label.rotation ? -8 : -label.getBBox().height; } else if (axis.side === 2) { yOffset = rotCorr.y + 8; } else { // #3140, #3140 yOffset = mathCos(label.rotation * deg2rad) * (rotCorr.y - label.getBBox(false, 0).height / 2); } } x = x + labelOptions.x + rotCorr.x - (tickmarkOffset && horiz ? tickmarkOffset * transA * (reversed ? -1 : 1) : 0); y = y + yOffset - (tickmarkOffset && !horiz ? tickmarkOffset * transA * (reversed ? 1 : -1) : 0); // Correct for staggered labels if (staggerLines) { line = (index / (step || 1) % staggerLines); if (axis.opposite) { line = staggerLines - line - 1; } y += line * (axis.labelOffset / staggerLines); } return { x: x, y: mathRound(y) }; }, /** * Extendible method to return the path of the marker */ getMarkPath: function (x, y, tickLength, tickWidth, horiz, renderer) { return renderer.crispLine([ M, x, y, L, x + (horiz ? 0 : -tickLength), y + (horiz ? tickLength : 0) ], tickWidth); }, /** * Put everything in place * * @param index {Number} * @param old {Boolean} Use old coordinates to prepare an animation into new position */ render: function (index, old, opacity) { var tick = this, axis = tick.axis, options = axis.options, chart = axis.chart, renderer = chart.renderer, horiz = axis.horiz, type = tick.type, label = tick.label, pos = tick.pos, labelOptions = options.labels, gridLine = tick.gridLine, gridPrefix = type ? type + 'Grid' : 'grid', tickPrefix = type ? type + 'Tick' : 'tick', gridLineWidth = options[gridPrefix + 'LineWidth'], gridLineColor = options[gridPrefix + 'LineColor'], dashStyle = options[gridPrefix + 'LineDashStyle'], tickSize = axis.tickSize(tickPrefix), tickColor = options[tickPrefix + 'Color'], gridLinePath, mark = tick.mark, markPath, step = /*axis.labelStep || */labelOptions.step, attribs, show = true, tickmarkOffset = axis.tickmarkOffset, xy = tick.getPosition(horiz, pos, tickmarkOffset, old), x = xy.x, y = xy.y, reverseCrisp = ((horiz && x === axis.pos + axis.len) || (!horiz && y === axis.pos)) ? -1 : 1; // #1480, #1687 opacity = pick(opacity, 1); this.isActive = true; // create the grid line if (gridLineWidth) { gridLinePath = axis.getPlotLinePath(pos + tickmarkOffset, gridLineWidth * reverseCrisp, old, true); if (gridLine === UNDEFINED) { attribs = { stroke: gridLineColor, 'stroke-width': gridLineWidth }; if (dashStyle) { attribs.dashstyle = dashStyle; } if (!type) { attribs.zIndex = 1; } if (old) { attribs.opacity = 0; } tick.gridLine = gridLine = gridLineWidth ? renderer.path(gridLinePath) .attr(attribs).add(axis.gridGroup) : null; } // If the parameter 'old' is set, the current call will be followed // by another call, therefore do not do any animations this time if (!old && gridLine && gridLinePath) { gridLine[tick.isNew ? 'attr' : 'animate']({ d: gridLinePath, opacity: opacity }); } } // create the tick mark if (tickSize) { if (axis.opposite) { tickSize[0] = -tickSize[0]; } markPath = tick.getMarkPath(x, y, tickSize[0], tickSize[1] * reverseCrisp, horiz, renderer); if (mark) { // updating mark.animate({ d: markPath, opacity: opacity }); } else { // first time tick.mark = renderer.path( markPath ).attr({ stroke: tickColor, 'stroke-width': tickSize[1], opacity: opacity }).add(axis.axisGroup); } } // the label is created on init - now move it into place if (label && isNumber(x)) { label.xy = xy = tick.getLabelPosition(x, y, label, horiz, labelOptions, tickmarkOffset, index, step); // Apply show first and show last. If the tick is both first and last, it is // a single centered tick, in which case we show the label anyway (#2100). if ((tick.isFirst && !tick.isLast && !pick(options.showFirstLabel, 1)) || (tick.isLast && !tick.isFirst && !pick(options.showLastLabel, 1))) { show = false; // Handle label overflow and show or hide accordingly } else if (horiz && !axis.isRadial && !labelOptions.step && !labelOptions.rotation && !old && opacity !== 0) { tick.handleOverflow(xy); } // apply step if (step && index % step) { // show those indices dividable by step show = false; } // Set the new position, and show or hide if (show && isNumber(xy.y)) { xy.opacity = opacity; label[tick.isNew ? 'attr' : 'animate'](xy); } else { stop(label); // #5332 label.attr('y', -9999); // #1338 } tick.isNew = false; } }, /** * Destructor for the tick prototype */ destroy: function () { destroyObjectProperties(this, this.axis); } }; /** * The object wrapper for plot lines and plot bands * @param {Object} options */ Highcharts.PlotLineOrBand = function (axis, options) { this.axis = axis; if (options) { this.options = options; this.id = options.id; } }; Highcharts.PlotLineOrBand.prototype = { /** * Render the plot line or plot band. If it is already existing, * move it. */ render: function () { var plotLine = this, axis = plotLine.axis, horiz = axis.horiz, options = plotLine.options, optionsLabel = options.label, label = plotLine.label, width = options.width, to = options.to, from = options.from, isBand = defined(from) && defined(to), value = options.value, dashStyle = options.dashStyle, svgElem = plotLine.svgElem, path = [], addEvent, eventType, color = options.color, zIndex = pick(options.zIndex, 0), events = options.events, attribs = {}, renderer = axis.chart.renderer, log2lin = axis.log2lin; // logarithmic conversion if (axis.isLog) { from = log2lin(from); to = log2lin(to); value = log2lin(value); } // plot line if (width) { path = axis.getPlotLinePath(value, width); attribs = { stroke: color, 'stroke-width': width }; if (dashStyle) { attribs.dashstyle = dashStyle; } } else if (isBand) { // plot band path = axis.getPlotBandPath(from, to, options); if (color) { attribs.fill = color; } if (options.borderWidth) { attribs.stroke = options.borderColor; attribs['stroke-width'] = options.borderWidth; } } else { return; } // zIndex attribs.zIndex = zIndex; // common for lines and bands if (svgElem) { if (path) { svgElem.show(); svgElem.animate({ d: path }); } else { svgElem.hide(); if (label) { plotLine.label = label = label.destroy(); } } } else if (path && path.length) { plotLine.svgElem = svgElem = renderer.path(path) .attr(attribs).add(); // events if (events) { addEvent = function (eventType) { svgElem.on(eventType, function (e) { events[eventType].apply(plotLine, [e]); }); }; for (eventType in events) { addEvent(eventType); } } } // the plot band/line label if (optionsLabel && defined(optionsLabel.text) && path && path.length && axis.width > 0 && axis.height > 0 && !path.flat) { // apply defaults optionsLabel = merge({ align: horiz && isBand && 'center', x: horiz ? !isBand && 4 : 10, verticalAlign: !horiz && isBand && 'middle', y: horiz ? isBand ? 16 : 10 : isBand ? 6 : -4, rotation: horiz && !isBand && 90 }, optionsLabel); this.renderLabel(optionsLabel, path, isBand, zIndex); } else if (label) { // move out of sight label.hide(); } // chainable return plotLine; }, /** * Render and align label for plot line or band. */ renderLabel: function (optionsLabel, path, isBand, zIndex) { var plotLine = this, label = plotLine.label, renderer = plotLine.axis.chart.renderer, attribs, xs, ys, x, y; // add the SVG element if (!label) { attribs = { align: optionsLabel.textAlign || optionsLabel.align, rotation: optionsLabel.rotation }; attribs.zIndex = zIndex; plotLine.label = label = renderer.text( optionsLabel.text, 0, 0, optionsLabel.useHTML ) .attr(attribs) .css(optionsLabel.style) .add(); } // get the bounding box and align the label // #3000 changed to better handle choice between plotband or plotline xs = [path[1], path[4], (isBand ? path[6] : path[1])]; ys = [path[2], path[5], (isBand ? path[7] : path[2])]; x = arrayMin(xs); y = arrayMin(ys); label.align(optionsLabel, false, { x: x, y: y, width: arrayMax(xs) - x, height: arrayMax(ys) - y }); label.show(); }, /** * Remove the plot line or band */ destroy: function () { // remove it from the lookup erase(this.axis.plotLinesAndBands, this); delete this.axis; destroyObjectProperties(this); } }; /** * Object with members for extending the Axis prototype */ AxisPlotLineOrBandExtension = { /** * Create the path for a plot band */ getPlotBandPath: function (from, to) { var toPath = this.getPlotLinePath(to, null, null, true), path = this.getPlotLinePath(from, null, null, true); if (path && toPath) { // Flat paths don't need labels (#3836) path.flat = path.toString() === toPath.toString(); path.push( toPath[4], toPath[5], toPath[1], toPath[2] ); } else { // outside the axis area path = null; } return path; }, addPlotBand: function (options) { return this.addPlotBandOrLine(options, 'plotBands'); }, addPlotLine: function (options) { return this.addPlotBandOrLine(options, 'plotLines'); }, /** * Add a plot band or plot line after render time * * @param options {Object} The plotBand or plotLine configuration object */ addPlotBandOrLine: function (options, coll) { var obj = new Highcharts.PlotLineOrBand(this, options).render(), userOptions = this.userOptions; if (obj) { // #2189 // Add it to the user options for exporting and Axis.update if (coll) { userOptions[coll] = userOptions[coll] || []; userOptions[coll].push(options); } this.plotLinesAndBands.push(obj); } return obj; }, /** * Remove a plot band or plot line from the chart by id * @param {Object} id */ removePlotBandOrLine: function (id) { var plotLinesAndBands = this.plotLinesAndBands, options = this.options, userOptions = this.userOptions, i = plotLinesAndBands.length; while (i--) { if (plotLinesAndBands[i].id === id) { plotLinesAndBands[i].destroy(); } } each([options.plotLines || [], userOptions.plotLines || [], options.plotBands || [], userOptions.plotBands || []], function (arr) { i = arr.length; while (i--) { if (arr[i].id === id) { erase(arr, arr[i]); } } }); } }; /** * Create a new axis object * @param {Object} chart * @param {Object} options */ var Axis = Highcharts.Axis = function () { this.init.apply(this, arguments); }; Axis.prototype = { /** * Default options for the X axis - the Y axis has extended defaults */ defaultOptions: { // allowDecimals: null, // alternateGridColor: null, // categories: [], dateTimeLabelFormats: { millisecond: '%H:%M:%S.%L', second: '%H:%M:%S', minute: '%H:%M', hour: '%H:%M', day: '%e. %b', week: '%e. %b', month: '%b \'%y', year: '%Y' }, endOnTick: false, gridLineColor: '#D8D8D8', // gridLineDashStyle: 'solid', // gridLineWidth: 0, // reversed: false, labels: { enabled: true, // rotation: 0, // align: 'center', // step: null, style: { color: '#606060', cursor: 'default', fontSize: '11px' }, x: 0 //y: undefined /*formatter: function () { return this.value; },*/ }, lineColor: '#C0D0E0', lineWidth: 1, //linkedTo: null, //max: undefined, //min: undefined, minPadding: 0.01, maxPadding: 0.01, //minRange: null, minorGridLineColor: '#E0E0E0', // minorGridLineDashStyle: null, minorGridLineWidth: 1, minorTickColor: '#A0A0A0', //minorTickInterval: null, minorTickLength: 2, minorTickPosition: 'outside', // inside or outside //minorTickWidth: 0, //opposite: false, //offset: 0, //plotBands: [{ // events: {}, // zIndex: 1, // labels: { align, x, verticalAlign, y, style, rotation, textAlign } //}], //plotLines: [{ // events: {} // dashStyle: {} // zIndex: // labels: { align, x, verticalAlign, y, style, rotation, textAlign } //}], //reversed: false, // showFirstLabel: true, // showLastLabel: true, startOfWeek: 1, startOnTick: false, tickColor: '#C0D0E0', //tickInterval: null, tickLength: 10, tickmarkPlacement: 'between', // on or between tickPixelInterval: 100, tickPosition: 'outside', //tickWidth: 1, title: { //text: null, align: 'middle', // low, middle or high //margin: 0 for horizontal, 10 for vertical axes, //rotation: 0, //side: 'outside', style: { color: '#707070' } //x: 0, //y: 0 }, type: 'linear' // linear, logarithmic or datetime //visible: true }, /** * This options set extends the defaultOptions for Y axes */ defaultYAxisOptions: { endOnTick: true, gridLineWidth: 1, tickPixelInterval: 72, showLastLabel: true, labels: { x: -8 }, lineWidth: 0, maxPadding: 0.05, minPadding: 0.05, startOnTick: true, //tickWidth: 0, title: { rotation: 270, text: 'Values' }, stackLabels: { enabled: false, //align: dynamic, //y: dynamic, //x: dynamic, //verticalAlign: dynamic, //textAlign: dynamic, //rotation: 0, formatter: function () { return Highcharts.numberFormat(this.total, -1); }, style: merge(defaultPlotOptions.line.dataLabels.style, { color: '#000000' }) } }, /** * These options extend the defaultOptions for left axes */ defaultLeftAxisOptions: { labels: { x: -15 }, title: { rotation: 270 } }, /** * These options extend the defaultOptions for right axes */ defaultRightAxisOptions: { labels: { x: 15 }, title: { rotation: 90 } }, /** * These options extend the defaultOptions for bottom axes */ defaultBottomAxisOptions: { labels: { autoRotation: [-45], x: 0 // overflow: undefined, // staggerLines: null }, title: { rotation: 0 } }, /** * These options extend the defaultOptions for top axes */ defaultTopAxisOptions: { labels: { autoRotation: [-45], x: 0 // overflow: undefined // staggerLines: null }, title: { rotation: 0 } }, /** * Initialize the axis */ init: function (chart, userOptions) { var isXAxis = userOptions.isX, axis = this; axis.chart = chart; // Flag, is the axis horizontal axis.horiz = chart.inverted ? !isXAxis : isXAxis; // Flag, isXAxis axis.isXAxis = isXAxis; axis.coll = axis.coll || (isXAxis ? 'xAxis' : 'yAxis'); axis.opposite = userOptions.opposite; // needed in setOptions axis.side = userOptions.side || (axis.horiz ? (axis.opposite ? 0 : 2) : // top : bottom (axis.opposite ? 1 : 3)); // right : left axis.setOptions(userOptions); var options = this.options, type = options.type, isDatetimeAxis = type === 'datetime'; axis.labelFormatter = options.labels.formatter || axis.defaultLabelFormatter; // can be overwritten by dynamic format // Flag, stagger lines or not axis.userOptions = userOptions; //axis.axisTitleMargin = UNDEFINED,// = options.title.margin, axis.minPixelPadding = 0; axis.reversed = options.reversed; axis.visible = options.visible !== false; axis.zoomEnabled = options.zoomEnabled !== false; // Initial categories axis.hasNames = type === 'category' || options.categories === true; axis.categories = options.categories || axis.hasNames; axis.names = axis.names || []; // Preserve on update (#3830) // Elements //axis.axisGroup = UNDEFINED; //axis.gridGroup = UNDEFINED; //axis.axisTitle = UNDEFINED; //axis.axisLine = UNDEFINED; // Shorthand types axis.isLog = type === 'logarithmic'; axis.isDatetimeAxis = isDatetimeAxis; // Flag, if axis is linked to another axis axis.isLinked = defined(options.linkedTo); // Linked axis. //axis.linkedParent = UNDEFINED; // Tick positions //axis.tickPositions = UNDEFINED; // array containing predefined positions // Tick intervals //axis.tickInterval = UNDEFINED; //axis.minorTickInterval = UNDEFINED; // Major ticks axis.ticks = {}; axis.labelEdge = []; // Minor ticks axis.minorTicks = {}; // List of plotLines/Bands axis.plotLinesAndBands = []; // Alternate bands axis.alternateBands = {}; // Axis metrics //axis.left = UNDEFINED; //axis.top = UNDEFINED; //axis.width = UNDEFINED; //axis.height = UNDEFINED; //axis.bottom = UNDEFINED; //axis.right = UNDEFINED; //axis.transA = UNDEFINED; //axis.transB = UNDEFINED; //axis.oldTransA = UNDEFINED; axis.len = 0; //axis.oldMin = UNDEFINED; //axis.oldMax = UNDEFINED; //axis.oldUserMin = UNDEFINED; //axis.oldUserMax = UNDEFINED; //axis.oldAxisLength = UNDEFINED; axis.minRange = axis.userMinRange = options.minRange || options.maxZoom; axis.range = options.range; axis.offset = options.offset || 0; // Dictionary for stacks axis.stacks = {}; axis.oldStacks = {}; axis.stacksTouched = 0; // Min and max in the data //axis.dataMin = UNDEFINED, //axis.dataMax = UNDEFINED, // The axis range axis.max = null; axis.min = null; // User set min and max //axis.userMin = UNDEFINED, //axis.userMax = UNDEFINED, // Crosshair options axis.crosshair = pick(options.crosshair, splat(chart.options.tooltip.crosshairs)[isXAxis ? 0 : 1], false); // Run Axis var eventType, events = axis.options.events; // Register if (inArray(axis, chart.axes) === -1) { // don't add it again on Axis.update() if (isXAxis) { // #2713 chart.axes.splice(chart.xAxis.length, 0, axis); } else { chart.axes.push(axis); } chart[axis.coll].push(axis); } axis.series = axis.series || []; // populated by Series // inverted charts have reversed xAxes as default if (chart.inverted && isXAxis && axis.reversed === UNDEFINED) { axis.reversed = true; } axis.removePlotBand = axis.removePlotBandOrLine; axis.removePlotLine = axis.removePlotBandOrLine; // register event listeners for (eventType in events) { addEvent(axis, eventType, events[eventType]); } // extend logarithmic axis if (axis.isLog) { axis.val2lin = axis.log2lin; axis.lin2val = axis.lin2log; } }, /** * Merge and set options */ setOptions: function (userOptions) { this.options = merge( this.defaultOptions, this.coll === 'yAxis' && this.defaultYAxisOptions, [this.defaultTopAxisOptions, this.defaultRightAxisOptions, this.defaultBottomAxisOptions, this.defaultLeftAxisOptions][this.side], merge( defaultOptions[this.coll], // if set in setOptions (#1053) userOptions ) ); }, /** * The default label formatter. The context is a special config object for the label. */ defaultLabelFormatter: function () { var axis = this.axis, value = this.value, categories = axis.categories, dateTimeLabelFormat = this.dateTimeLabelFormat, numericSymbols = defaultOptions.lang.numericSymbols, i = numericSymbols && numericSymbols.length, multi, ret, formatOption = axis.options.labels.format, // make sure the same symbol is added for all labels on a linear axis numericSymbolDetector = axis.isLog ? value : axis.tickInterval; if (formatOption) { ret = format(formatOption, this); } else if (categories) { ret = value; } else if (dateTimeLabelFormat) { // datetime axis ret = dateFormat(dateTimeLabelFormat, value); } else if (i && numericSymbolDetector >= 1000) { // Decide whether we should add a numeric symbol like k (thousands) or M (millions). // If we are to enable this in tooltip or other places as well, we can move this // logic to the numberFormatter and enable it by a parameter. while (i-- && ret === UNDEFINED) { multi = Math.pow(1000, i + 1); if (numericSymbolDetector >= multi && (value * 10) % multi === 0 && numericSymbols[i] !== null && value !== 0) { // #5480 ret = Highcharts.numberFormat(value / multi, -1) + numericSymbols[i]; } } } if (ret === UNDEFINED) { if (mathAbs(value) >= 10000) { // add thousands separators ret = Highcharts.numberFormat(value, -1); } else { // small numbers ret = Highcharts.numberFormat(value, -1, UNDEFINED, ''); // #2466 } } return ret; }, /** * Get the minimum and maximum for the series of each axis */ getSeriesExtremes: function () { var axis = this, chart = axis.chart; axis.hasVisibleSeries = false; // Reset properties in case we're redrawing (#3353) axis.dataMin = axis.dataMax = axis.threshold = null; axis.softThreshold = !axis.isXAxis; if (axis.buildStacks) { axis.buildStacks(); } // loop through this axis' series each(axis.series, function (series) { if (series.visible || !chart.options.chart.ignoreHiddenSeries) { var seriesOptions = series.options, xData, threshold = seriesOptions.threshold, seriesDataMin, seriesDataMax; axis.hasVisibleSeries = true; // Validate threshold in logarithmic axes if (axis.isLog && threshold <= 0) { threshold = null; } // Get dataMin and dataMax for X axes if (axis.isXAxis) { xData = series.xData; if (xData.length) { // If xData contains values which is not numbers, then filter them out. // To prevent performance hit, we only do this after we have already // found seriesDataMin because in most cases all data is valid. #5234. seriesDataMin = arrayMin(xData); if (!isNumber(seriesDataMin) && !(seriesDataMin instanceof Date)) { // Date for #5010 xData = grep(xData, function (x) { return isNumber(x); }); seriesDataMin = arrayMin(xData); // Do it again with valid data } axis.dataMin = mathMin(pick(axis.dataMin, xData[0]), seriesDataMin); axis.dataMax = mathMax(pick(axis.dataMax, xData[0]), arrayMax(xData)); } // Get dataMin and dataMax for Y axes, as well as handle stacking and processed data } else { // Get this particular series extremes series.getExtremes(); seriesDataMax = series.dataMax; seriesDataMin = series.dataMin; // Get the dataMin and dataMax so far. If percentage is used, the min and max are // always 0 and 100. If seriesDataMin and seriesDataMax is null, then series // doesn't have active y data, we continue with nulls if (defined(seriesDataMin) && defined(seriesDataMax)) { axis.dataMin = mathMin(pick(axis.dataMin, seriesDataMin), seriesDataMin); axis.dataMax = mathMax(pick(axis.dataMax, seriesDataMax), seriesDataMax); } // Adjust to threshold if (defined(threshold)) { axis.threshold = threshold; } // If any series has a hard threshold, it takes precedence if (!seriesOptions.softThreshold || axis.isLog) { axis.softThreshold = false; } } } }); }, /** * Translate from axis value to pixel position on the chart, or back * */ translate: function (val, backwards, cvsCoord, old, handleLog, pointPlacement) { var axis = this.linkedParent || this, // #1417 sign = 1, cvsOffset = 0, localA = old ? axis.oldTransA : axis.transA, localMin = old ? axis.oldMin : axis.min, returnValue, minPixelPadding = axis.minPixelPadding, doPostTranslate = (axis.isOrdinal || axis.isBroken || (axis.isLog && handleLog)) && axis.lin2val; if (!localA) { localA = axis.transA; } // In vertical axes, the canvas coordinates start from 0 at the top like in // SVG. if (cvsCoord) { sign *= -1; // canvas coordinates inverts the value cvsOffset = axis.len; } // Handle reversed axis if (axis.reversed) { sign *= -1; cvsOffset -= sign * (axis.sector || axis.len); } // From pixels to value if (backwards) { // reverse translation val = val * sign + cvsOffset; val -= minPixelPadding; returnValue = val / localA + localMin; // from chart pixel to value if (doPostTranslate) { // log and ordinal axes returnValue = axis.lin2val(returnValue); } // From value to pixels } else { if (doPostTranslate) { // log and ordinal axes val = axis.val2lin(val); } if (pointPlacement === 'between') { pointPlacement = 0.5; } returnValue = sign * (val - localMin) * localA + cvsOffset + (sign * minPixelPadding) + (isNumber(pointPlacement) ? localA * pointPlacement * axis.pointRange : 0); } return returnValue; }, /** * Utility method to translate an axis value to pixel position. * @param {Number} value A value in terms of axis units * @param {Boolean} paneCoordinates Whether to return the pixel coordinate relative to the chart * or just the axis/pane itself. */ toPixels: function (value, paneCoordinates) { return this.translate(value, false, !this.horiz, null, true) + (paneCoordinates ? 0 : this.pos); }, /* * Utility method to translate a pixel position in to an axis value * @param {Number} pixel The pixel value coordinate * @param {Boolean} paneCoordiantes Whether the input pixel is relative to the chart or just the * axis/pane itself. */ toValue: function (pixel, paneCoordinates) { return this.translate(pixel - (paneCoordinates ? 0 : this.pos), true, !this.horiz, null, true); }, /** * Create the path for a plot line that goes from the given value on * this axis, across the plot to the opposite side * @param {Number} value * @param {Number} lineWidth Used for calculation crisp line * @param {Number] old Use old coordinates (for resizing and rescaling) */ getPlotLinePath: function (value, lineWidth, old, force, translatedValue) { var axis = this, chart = axis.chart, axisLeft = axis.left, axisTop = axis.top, x1, y1, x2, y2, cHeight = (old && chart.oldChartHeight) || chart.chartHeight, cWidth = (old && chart.oldChartWidth) || chart.chartWidth, skip, transB = axis.transB, /** * Check if x is between a and b. If not, either move to a/b or skip, * depending on the force parameter. */ between = function (x, a, b) { if (x < a || x > b) { if (force) { x = mathMin(mathMax(a, x), b); } else { skip = true; } } return x; }; translatedValue = pick(translatedValue, axis.translate(value, null, null, old)); x1 = x2 = mathRound(translatedValue + transB); y1 = y2 = mathRound(cHeight - translatedValue - transB); if (!isNumber(translatedValue)) { // no min or max skip = true; } else if (axis.horiz) { y1 = axisTop; y2 = cHeight - axis.bottom; x1 = x2 = between(x1, axisLeft, axisLeft + axis.width); } else { x1 = axisLeft; x2 = cWidth - axis.right; y1 = y2 = between(y1, axisTop, axisTop + axis.height); } return skip && !force ? null : chart.renderer.crispLine([M, x1, y1, L, x2, y2], lineWidth || 1); }, /** * Set the tick positions of a linear axis to round values like whole tens or every five. */ getLinearTickPositions: function (tickInterval, min, max) { var pos, lastPos, roundedMin = correctFloat(mathFloor(min / tickInterval) * tickInterval), roundedMax = correctFloat(mathCeil(max / tickInterval) * tickInterval), tickPositions = []; // For single points, add a tick regardless of the relative position (#2662) if (min === max && isNumber(min)) { return [min]; } // Populate the intermediate values pos = roundedMin; while (pos <= roundedMax) { // Place the tick on the rounded value tickPositions.push(pos); // Always add the raw tickInterval, not the corrected one. pos = correctFloat(pos + tickInterval); // If the interval is not big enough in the current min - max range to actually increase // the loop variable, we need to break out to prevent endless loop. Issue #619 if (pos === lastPos) { break; } // Record the last value lastPos = pos; } return tickPositions; }, /** * Return the minor tick positions. For logarithmic axes, reuse the same logic * as for major ticks. */ getMinorTickPositions: function () { var axis = this, options = axis.options, tickPositions = axis.tickPositions, minorTickInterval = axis.minorTickInterval, minorTickPositions = [], pos, i, pointRangePadding = axis.pointRangePadding || 0, min = axis.min - pointRangePadding, // #1498 max = axis.max + pointRangePadding, // #1498 range = max - min, len; // If minor ticks get too dense, they are hard to read, and may cause long running script. So we don't draw them. if (range && range / minorTickInterval < axis.len / 3) { // #3875 if (axis.isLog) { len = tickPositions.length; for (i = 1; i < len; i++) { minorTickPositions = minorTickPositions.concat( axis.getLogTickPositions(minorTickInterval, tickPositions[i - 1], tickPositions[i], true) ); } } else if (axis.isDatetimeAxis && options.minorTickInterval === 'auto') { // #1314 minorTickPositions = minorTickPositions.concat( axis.getTimeTicks( axis.normalizeTimeTickInterval(minorTickInterval), min, max, options.startOfWeek ) ); } else { for (pos = min + (tickPositions[0] - min) % minorTickInterval; pos <= max; pos += minorTickInterval) { minorTickPositions.push(pos); } } } if (minorTickPositions.length !== 0) { // don't change the extremes, when there is no minor ticks axis.trimTicks(minorTickPositions, options.startOnTick, options.endOnTick); // #3652 #3743 #1498 } return minorTickPositions; }, /** * Adjust the min and max for the minimum range. Keep in mind that the series data is * not yet processed, so we don't have information on data cropping and grouping, or * updated axis.pointRange or series.pointRange. The data can't be processed until * we have finally established min and max. */ adjustForMinRange: function () { var axis = this, options = axis.options, min = axis.min, max = axis.max, zoomOffset, spaceAvailable = axis.dataMax - axis.dataMin >= axis.minRange, closestDataRange, i, distance, xData, loopLength, minArgs, maxArgs, minRange; // Set the automatic minimum range based on the closest point distance if (axis.isXAxis && axis.minRange === UNDEFINED && !axis.isLog) { if (defined(options.min) || defined(options.max)) { axis.minRange = null; // don't do this again } else { // Find the closest distance between raw data points, as opposed to // closestPointRange that applies to processed points (cropped and grouped) each(axis.series, function (series) { xData = series.xData; loopLength = series.xIncrement ? 1 : xData.length - 1; for (i = loopLength; i > 0; i--) { distance = xData[i] - xData[i - 1]; if (closestDataRange === UNDEFINED || distance < closestDataRange) { closestDataRange = distance; } } }); axis.minRange = mathMin(closestDataRange * 5, axis.dataMax - axis.dataMin); } } // if minRange is exceeded, adjust if (max - min < axis.minRange) { minRange = axis.minRange; zoomOffset = (minRange - max + min) / 2; // if min and max options have been set, don't go beyond it minArgs = [min - zoomOffset, pick(options.min, min - zoomOffset)]; if (spaceAvailable) { // if space is available, stay within the data range minArgs[2] = axis.isLog ? axis.log2lin(axis.dataMin) : axis.dataMin; } min = arrayMax(minArgs); maxArgs = [min + minRange, pick(options.max, min + minRange)]; if (spaceAvailable) { // if space is availabe, stay within the data range maxArgs[2] = axis.isLog ? axis.log2lin(axis.dataMax) : axis.dataMax; } max = arrayMin(maxArgs); // now if the max is adjusted, adjust the min back if (max - min < minRange) { minArgs[0] = max - minRange; minArgs[1] = pick(options.min, max - minRange); min = arrayMax(minArgs); } } // Record modified extremes axis.min = min; axis.max = max; }, /** * Find the closestPointRange across all series */ getClosest: function () { var ret; if (this.categories) { ret = 1; } else { each(this.series, function (series) { var seriesClosest = series.closestPointRange; if (!series.noSharedTooltip && defined(seriesClosest)) { ret = defined(ret) ? mathMin(ret, seriesClosest) : seriesClosest; } }); } return ret; }, /** * When a point name is given and no x, search for the name in the existing categories, * or if categories aren't provided, search names or create a new category (#2522). */ nameToX: function (point) { var explicitCategories = isArray(this.categories), names = explicitCategories ? this.categories : this.names, nameX = point.options.x, x; point.series.requireSorting = false; if (!defined(nameX)) { nameX = this.options.nameToX === false ? point.series.autoIncrement() : inArray(point.name, names); } if (nameX === -1) { // The name is not found in currenct categories if (!explicitCategories) { x = names.length; } } else { x = nameX; } // Write the last point's name to the names array this.names[x] = point.name; return x; }, /** * When changes have been done to series data, update the axis.names. */ updateNames: function () { var axis = this; if (this.names.length > 0) { this.names.length = 0; this.minRange = undefined; each(this.series || [], function (series) { // When adding a series, points are not yet generated if (!series.processedXData) { series.processData(); series.generatePoints(); } each(series.points, function (point, i) { var x; if (point.options && point.options.x === undefined) { x = axis.nameToX(point); if (x !== point.x) { point.x = x; series.xData[i] = x; } } }); }); } }, /** * Update translation information */ setAxisTranslation: function (saveOld) { var axis = this, range = axis.max - axis.min, pointRange = axis.axisPointRange || 0, closestPointRange, minPointOffset = 0, pointRangePadding = 0, linkedParent = axis.linkedParent, ordinalCorrection, hasCategories = !!axis.categories, transA = axis.transA, isXAxis = axis.isXAxis; // Adjust translation for padding. Y axis with categories need to go through the same (#1784). if (isXAxis || hasCategories || pointRange) { if (linkedParent) { minPointOffset = linkedParent.minPointOffset; pointRangePadding = linkedParent.pointRangePadding; } else { // Get the closest points closestPointRange = axis.getClosest(); each(axis.series, function (series) { var seriesPointRange = hasCategories ? 1 : (isXAxis ? pick(series.options.pointRange, closestPointRange, 0) : (axis.axisPointRange || 0)), // #2806 pointPlacement = series.options.pointPlacement; pointRange = mathMax(pointRange, seriesPointRange); if (!axis.single) { // minPointOffset is the value padding to the left of the axis in order to make // room for points with a pointRange, typically columns. When the pointPlacement option // is 'between' or 'on', this padding does not apply. minPointOffset = mathMax( minPointOffset, isString(pointPlacement) ? 0 : seriesPointRange / 2 ); // Determine the total padding needed to the length of the axis to make room for the // pointRange. If the series' pointPlacement is 'on', no padding is added. pointRangePadding = mathMax( pointRangePadding, pointPlacement === 'on' ? 0 : seriesPointRange ); } }); } // Record minPointOffset and pointRangePadding ordinalCorrection = axis.ordinalSlope && closestPointRange ? axis.ordinalSlope / closestPointRange : 1; // #988, #1853 axis.minPointOffset = minPointOffset = minPointOffset * ordinalCorrection; axis.pointRangePadding = pointRangePadding = pointRangePadding * ordinalCorrection; // pointRange means the width reserved for each point, like in a column chart axis.pointRange = mathMin(pointRange, range); // closestPointRange means the closest distance between points. In columns // it is mostly equal to pointRange, but in lines pointRange is 0 while closestPointRange // is some other value if (isXAxis) { axis.closestPointRange = closestPointRange; } } // Secondary values if (saveOld) { axis.oldTransA = transA; } axis.translationSlope = axis.transA = transA = axis.len / ((range + pointRangePadding) || 1); axis.transB = axis.horiz ? axis.left : axis.bottom; // translation addend axis.minPixelPadding = transA * minPointOffset; }, minFromRange: function () { return this.max - this.range; }, /** * Set the tick positions to round values and optionally extend the extremes * to the nearest tick */ setTickInterval: function (secondPass) { var axis = this, chart = axis.chart, options = axis.options, isLog = axis.isLog, log2lin = axis.log2lin, isDatetimeAxis = axis.isDatetimeAxis, isXAxis = axis.isXAxis, isLinked = axis.isLinked, maxPadding = options.maxPadding, minPadding = options.minPadding, length, linkedParentExtremes, tickIntervalOption = options.tickInterval, minTickInterval, tickPixelIntervalOption = options.tickPixelInterval, categories = axis.categories, threshold = axis.threshold, softThreshold = axis.softThreshold, thresholdMin, thresholdMax, hardMin, hardMax; if (!isDatetimeAxis && !categories && !isLinked) { this.getTickAmount(); } // Min or max set either by zooming/setExtremes or initial options hardMin = pick(axis.userMin, options.min); hardMax = pick(axis.userMax, options.max); // Linked axis gets the extremes from the parent axis if (isLinked) { axis.linkedParent = chart[axis.coll][options.linkedTo]; linkedParentExtremes = axis.linkedParent.getExtremes(); axis.min = pick(linkedParentExtremes.min, linkedParentExtremes.dataMin); axis.max = pick(linkedParentExtremes.max, linkedParentExtremes.dataMax); if (options.type !== axis.linkedParent.options.type) { error(11, 1); // Can't link axes of different type } // Initial min and max from the extreme data values } else { // Adjust to hard threshold if (!softThreshold && defined(threshold)) { if (axis.dataMin >= threshold) { thresholdMin = threshold; minPadding = 0; } else if (axis.dataMax <= threshold) { thresholdMax = threshold; maxPadding = 0; } } axis.min = pick(hardMin, thresholdMin, axis.dataMin); axis.max = pick(hardMax, thresholdMax, axis.dataMax); } if (isLog) { if (!secondPass && mathMin(axis.min, pick(axis.dataMin, axis.min)) <= 0) { // #978 error(10, 1); // Can't plot negative values on log axis } // The correctFloat cures #934, float errors on full tens. But it // was too aggressive for #4360 because of conversion back to lin, // therefore use precision 15. axis.min = correctFloat(log2lin(axis.min), 15); axis.max = correctFloat(log2lin(axis.max), 15); } // handle zoomed range if (axis.range && defined(axis.max)) { axis.userMin = axis.min = hardMin = mathMax(axis.min, axis.minFromRange()); // #618 axis.userMax = hardMax = axis.max; axis.range = null; // don't use it when running setExtremes } // Hook for Highstock Scroller. Consider combining with beforePadding. fireEvent(axis, 'foundExtremes'); // Hook for adjusting this.min and this.max. Used by bubble series. if (axis.beforePadding) { axis.beforePadding(); } // adjust min and max for the minimum range axis.adjustForMinRange(); // Pad the values to get clear of the chart's edges. To avoid tickInterval taking the padding // into account, we do this after computing tick interval (#1337). if (!categories && !axis.axisPointRange && !axis.usePercentage && !isLinked && defined(axis.min) && defined(axis.max)) { length = axis.max - axis.min; if (length) { if (!defined(hardMin) && minPadding) { axis.min -= length * minPadding; } if (!defined(hardMax) && maxPadding) { axis.max += length * maxPadding; } } } // Stay within floor and ceiling if (isNumber(options.floor)) { axis.min = mathMax(axis.min, options.floor); } if (isNumber(options.ceiling)) { axis.max = mathMin(axis.max, options.ceiling); } // When the threshold is soft, adjust the extreme value only if // the data extreme and the padded extreme land on either side of the threshold. For example, // a series of [0, 1, 2, 3] would make the yAxis add a tick for -1 because of the // default minPadding and startOnTick options. This is prevented by the softThreshold // option. if (softThreshold && defined(axis.dataMin)) { threshold = threshold || 0; if (!defined(hardMin) && axis.min < threshold && axis.dataMin >= threshold) { axis.min = threshold; } else if (!defined(hardMax) && axis.max > threshold && axis.dataMax <= threshold) { axis.max = threshold; } } // get tickInterval if (axis.min === axis.max || axis.min === undefined || axis.max === undefined) { axis.tickInterval = 1; } else if (isLinked && !tickIntervalOption && tickPixelIntervalOption === axis.linkedParent.options.tickPixelInterval) { axis.tickInterval = tickIntervalOption = axis.linkedParent.tickInterval; } else { axis.tickInterval = pick( tickIntervalOption, this.tickAmount ? ((axis.max - axis.min) / mathMax(this.tickAmount - 1, 1)) : undefined, categories ? // for categoried axis, 1 is default, for linear axis use tickPix 1 : // don't let it be more than the data range (axis.max - axis.min) * tickPixelIntervalOption / mathMax(axis.len, tickPixelIntervalOption) ); } // Now we're finished detecting min and max, crop and group series data. This // is in turn needed in order to find tick positions in ordinal axes. if (isXAxis && !secondPass) { each(axis.series, function (series) { series.processData(axis.min !== axis.oldMin || axis.max !== axis.oldMax); }); } // set the translation factor used in translate function axis.setAxisTranslation(true); // hook for ordinal axes and radial axes if (axis.beforeSetTickPositions) { axis.beforeSetTickPositions(); } // hook for extensions, used in Highstock ordinal axes if (axis.postProcessTickInterval) { axis.tickInterval = axis.postProcessTickInterval(axis.tickInterval); } // In column-like charts, don't cramp in more ticks than there are points (#1943, #4184) if (axis.pointRange && !tickIntervalOption) { axis.tickInterval = mathMax(axis.pointRange, axis.tickInterval); } // Before normalizing the tick interval, handle minimum tick interval. This applies only if tickInterval is not defined. minTickInterval = pick(options.minTickInterval, axis.isDatetimeAxis && axis.closestPointRange); if (!tickIntervalOption && axis.tickInterval < minTickInterval) { axis.tickInterval = minTickInterval; } // for linear axes, get magnitude and normalize the interval if (!isDatetimeAxis && !isLog && !tickIntervalOption) { axis.tickInterval = normalizeTickInterval( axis.tickInterval, null, getMagnitude(axis.tickInterval), // If the tick interval is between 0.5 and 5 and the axis max is in the order of // thousands, chances are we are dealing with years. Don't allow decimals. #3363. pick(options.allowDecimals, !(axis.tickInterval > 0.5 && axis.tickInterval < 5 && axis.max > 1000 && axis.max < 9999)), !!this.tickAmount ); } // Prevent ticks from getting so close that we can't draw the labels if (!this.tickAmount) { axis.tickInterval = axis.unsquish(); } this.setTickPositions(); }, /** * Now we have computed the normalized tickInterval, get the tick positions */ setTickPositions: function () { var options = this.options, tickPositions, tickPositionsOption = options.tickPositions, tickPositioner = options.tickPositioner, startOnTick = options.startOnTick, endOnTick = options.endOnTick, single; // Set the tickmarkOffset this.tickmarkOffset = (this.categories && options.tickmarkPlacement === 'between' && this.tickInterval === 1) ? 0.5 : 0; // #3202 // get minorTickInterval this.minorTickInterval = options.minorTickInterval === 'auto' && this.tickInterval ? this.tickInterval / 5 : options.minorTickInterval; // Find the tick positions this.tickPositions = tickPositions = tickPositionsOption && tickPositionsOption.slice(); // Work on a copy (#1565) if (!tickPositions) { if (this.isDatetimeAxis) { tickPositions = this.getTimeTicks( this.normalizeTimeTickInterval(this.tickInterval, options.units), this.min, this.max, options.startOfWeek, this.ordinalPositions, this.closestPointRange, true ); } else if (this.isLog) { tickPositions = this.getLogTickPositions(this.tickInterval, this.min, this.max); } else { tickPositions = this.getLinearTickPositions(this.tickInterval, this.min, this.max); } // Too dense ticks, keep only the first and last (#4477) if (tickPositions.length > this.len) { tickPositions = [tickPositions[0], tickPositions.pop()]; } this.tickPositions = tickPositions; // Run the tick positioner callback, that allows modifying auto tick positions. if (tickPositioner) { tickPositioner = tickPositioner.apply(this, [this.min, this.max]); if (tickPositioner) { this.tickPositions = tickPositions = tickPositioner; } } } if (!this.isLinked) { // reset min/max or remove extremes based on start/end on tick this.trimTicks(tickPositions, startOnTick, endOnTick); // When there is only one point, or all points have the same value on this axis, then min // and max are equal and tickPositions.length is 0 or 1. In this case, add some padding // in order to center the point, but leave it with one tick. #1337. if (this.min === this.max && defined(this.min) && !this.tickAmount) { // Substract half a unit (#2619, #2846, #2515, #3390) single = true; this.min -= 0.5; this.max += 0.5; } this.single = single; if (!tickPositionsOption && !tickPositioner) { this.adjustTickAmount(); } } }, /** * Handle startOnTick and endOnTick by either adapting to padding min/max or rounded min/max */ trimTicks: function (tickPositions, startOnTick, endOnTick) { var roundedMin = tickPositions[0], roundedMax = tickPositions[tickPositions.length - 1], minPointOffset = this.minPointOffset || 0; if (startOnTick) { this.min = roundedMin; } else { while (this.min - minPointOffset > tickPositions[0]) { tickPositions.shift(); } } if (endOnTick) { this.max = roundedMax; } else { while (this.max + minPointOffset < tickPositions[tickPositions.length - 1]) { tickPositions.pop(); } } // If no tick are left, set one tick in the middle (#3195) if (tickPositions.length === 0 && defined(roundedMin)) { tickPositions.push((roundedMax + roundedMin) / 2); } }, /** * Check if there are multiple axes in the same pane * @returns {Boolean} There are other axes */ alignToOthers: function () { var others = {}, // Whether there is another axis to pair with this one hasOther, options = this.options; if (this.chart.options.chart.alignTicks !== false && options.alignTicks !== false) { each(this.chart[this.coll], function (axis) { var otherOptions = axis.options, horiz = axis.horiz, key = [ horiz ? otherOptions.left : otherOptions.top, otherOptions.width, otherOptions.height, otherOptions.pane ].join(','); if (axis.series.length) { // #4442 if (others[key]) { hasOther = true; // #4201 } else { others[key] = 1; } } }); } return hasOther; }, /** * Set the max ticks of either the x and y axis collection */ getTickAmount: function () { var options = this.options, tickAmount = options.tickAmount, tickPixelInterval = options.tickPixelInterval; if (!defined(options.tickInterval) && this.len < tickPixelInterval && !this.isRadial && !this.isLog && options.startOnTick && options.endOnTick) { tickAmount = 2; } if (!tickAmount && this.alignToOthers()) { // Add 1 because 4 tick intervals require 5 ticks (including first and last) tickAmount = mathCeil(this.len / tickPixelInterval) + 1; } // For tick amounts of 2 and 3, compute five ticks and remove the intermediate ones. This // prevents the axis from adding ticks that are too far away from the data extremes. if (tickAmount < 4) { this.finalTickAmt = tickAmount; tickAmount = 5; } this.tickAmount = tickAmount; }, /** * When using multiple axes, adjust the number of ticks to match the highest * number of ticks in that group */ adjustTickAmount: function () { var tickInterval = this.tickInterval, tickPositions = this.tickPositions, tickAmount = this.tickAmount, finalTickAmt = this.finalTickAmt, currentTickAmount = tickPositions && tickPositions.length, i, len; if (currentTickAmount < tickAmount) { while (tickPositions.length < tickAmount) { tickPositions.push(correctFloat( tickPositions[tickPositions.length - 1] + tickInterval )); } this.transA *= (currentTickAmount - 1) / (tickAmount - 1); this.max = tickPositions[tickPositions.length - 1]; // We have too many ticks, run second pass to try to reduce ticks } else if (currentTickAmount > tickAmount) { this.tickInterval *= 2; this.setTickPositions(); } // The finalTickAmt property is set in getTickAmount if (defined(finalTickAmt)) { i = len = tickPositions.length; while (i--) { if ( (finalTickAmt === 3 && i % 2 === 1) || // Remove every other tick (finalTickAmt <= 2 && i > 0 && i < len - 1) // Remove all but first and last ) { tickPositions.splice(i, 1); } } this.finalTickAmt = UNDEFINED; } }, /** * Set the scale based on data min and max, user set min and max or options * */ setScale: function () { var axis = this, isDirtyData, isDirtyAxisLength; axis.oldMin = axis.min; axis.oldMax = axis.max; axis.oldAxisLength = axis.len; // set the new axisLength axis.setAxisSize(); //axisLength = horiz ? axisWidth : axisHeight; isDirtyAxisLength = axis.len !== axis.oldAxisLength; // is there new data? each(axis.series, function (series) { if (series.isDirtyData || series.isDirty || series.xAxis.isDirty) { // when x axis is dirty, we need new data extremes for y as well isDirtyData = true; } }); // do we really need to go through all this? if (isDirtyAxisLength || isDirtyData || axis.isLinked || axis.forceRedraw || axis.userMin !== axis.oldUserMin || axis.userMax !== axis.oldUserMax || axis.alignToOthers()) { if (axis.resetStacks) { axis.resetStacks(); } axis.forceRedraw = false; // get data extremes if needed axis.getSeriesExtremes(); // get fixed positions based on tickInterval axis.setTickInterval(); // record old values to decide whether a rescale is necessary later on (#540) axis.oldUserMin = axis.userMin; axis.oldUserMax = axis.userMax; // Mark as dirty if it is not already set to dirty and extremes have changed. #595. if (!axis.isDirty) { axis.isDirty = isDirtyAxisLength || axis.min !== axis.oldMin || axis.max !== axis.oldMax; } } else if (axis.cleanStacks) { axis.cleanStacks(); } }, /** * Set the extremes and optionally redraw * @param {Number} newMin * @param {Number} newMax * @param {Boolean} redraw * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration * @param {Object} eventArguments * */ setExtremes: function (newMin, newMax, redraw, animation, eventArguments) { var axis = this, chart = axis.chart; redraw = pick(redraw, true); // defaults to true each(axis.series, function (serie) { delete serie.kdTree; }); // Extend the arguments with min and max eventArguments = extend(eventArguments, { min: newMin, max: newMax }); // Fire the event fireEvent(axis, 'setExtremes', eventArguments, function () { // the default event handler axis.userMin = newMin; axis.userMax = newMax; axis.eventArgs = eventArguments; if (redraw) { chart.redraw(animation); } }); }, /** * Overridable method for zooming chart. Pulled out in a separate method to allow overriding * in stock charts. */ zoom: function (newMin, newMax) { var dataMin = this.dataMin, dataMax = this.dataMax, options = this.options, min = mathMin(dataMin, pick(options.min, dataMin)), max = mathMax(dataMax, pick(options.max, dataMax)); // Prevent pinch zooming out of range. Check for defined is for #1946. #1734. if (!this.allowZoomOutside) { if (defined(dataMin) && newMin <= min) { newMin = min; } if (defined(dataMax) && newMax >= max) { newMax = max; } } // In full view, displaying the reset zoom button is not required this.displayBtn = newMin !== UNDEFINED || newMax !== UNDEFINED; // Do it this.setExtremes( newMin, newMax, false, UNDEFINED, { trigger: 'zoom' } ); return true; }, /** * Update the axis metrics */ setAxisSize: function () { var chart = this.chart, options = this.options, offsetLeft = options.offsetLeft || 0, offsetRight = options.offsetRight || 0, horiz = this.horiz, width = pick(options.width, chart.plotWidth - offsetLeft + offsetRight), height = pick(options.height, chart.plotHeight), top = pick(options.top, chart.plotTop), left = pick(options.left, chart.plotLeft + offsetLeft), percentRegex = /%$/; // Check for percentage based input values. Rounding fixes problems with // column overflow and plot line filtering (#4898, #4899) if (percentRegex.test(height)) { height = Math.round(parseFloat(height) / 100 * chart.plotHeight); } if (percentRegex.test(top)) { top = Math.round(parseFloat(top) / 100 * chart.plotHeight + chart.plotTop); } // Expose basic values to use in Series object and navigator this.left = left; this.top = top; this.width = width; this.height = height; this.bottom = chart.chartHeight - height - top; this.right = chart.chartWidth - width - left; // Direction agnostic properties this.len = mathMax(horiz ? width : height, 0); // mathMax fixes #905 this.pos = horiz ? left : top; // distance from SVG origin }, /** * Get the actual axis extremes */ getExtremes: function () { var axis = this, isLog = axis.isLog, lin2log = axis.lin2log; return { min: isLog ? correctFloat(lin2log(axis.min)) : axis.min, max: isLog ? correctFloat(lin2log(axis.max)) : axis.max, dataMin: axis.dataMin, dataMax: axis.dataMax, userMin: axis.userMin, userMax: axis.userMax }; }, /** * Get the zero plane either based on zero or on the min or max value. * Used in bar and area plots */ getThreshold: function (threshold) { var axis = this, isLog = axis.isLog, lin2log = axis.lin2log, realMin = isLog ? lin2log(axis.min) : axis.min, realMax = isLog ? lin2log(axis.max) : axis.max; if (threshold === null) { threshold = realMin; } else if (realMin > threshold) { threshold = realMin; } else if (realMax < threshold) { threshold = realMax; } return axis.translate(threshold, 0, 1, 0, 1); }, /** * Compute auto alignment for the axis label based on which side the axis is on * and the given rotation for the label */ autoLabelAlign: function (rotation) { var ret, angle = (pick(rotation, 0) - (this.side * 90) + 720) % 360; if (angle > 15 && angle < 165) { ret = 'right'; } else if (angle > 195 && angle < 345) { ret = 'left'; } else { ret = 'center'; } return ret; }, /** * Get the tick length and width for the axis. * @param {String} prefix 'tick' or 'minorTick' * @returns {Array} An array of tickLength and tickWidth */ tickSize: function (prefix) { var options = this.options, tickLength = options[prefix + 'Length'], tickWidth = pick(options[prefix + 'Width'], prefix === 'tick' && this.isXAxis ? 1 : 0); // X axis defaults to 1 if (tickWidth && tickLength) { // Negate the length if (options[prefix + 'Position'] === 'inside') { tickLength = -tickLength; } return [tickLength, tickWidth]; } }, /** * Return the size of the labels */ labelMetrics: function () { return this.chart.renderer.fontMetrics( this.options.labels.style.fontSize, this.ticks[0] && this.ticks[0].label ); }, /** * Prevent the ticks from getting so close we can't draw the labels. On a horizontal * axis, this is handled by rotating the labels, removing ticks and adding ellipsis. * On a vertical axis remove ticks and add ellipsis. */ unsquish: function () { var labelOptions = this.options.labels, horiz = this.horiz, tickInterval = this.tickInterval, newTickInterval = tickInterval, slotSize = this.len / (((this.categories ? 1 : 0) + this.max - this.min) / tickInterval), rotation, rotationOption = labelOptions.rotation, labelMetrics = this.labelMetrics(), step, bestScore = Number.MAX_VALUE, autoRotation, // Return the multiple of tickInterval that is needed to avoid collision getStep = function (spaceNeeded) { var step = spaceNeeded / (slotSize || 1); step = step > 1 ? mathCeil(step) : 1; return step * tickInterval; }; if (horiz) { autoRotation = !labelOptions.staggerLines && !labelOptions.step && ( // #3971 defined(rotationOption) ? [rotationOption] : slotSize < pick(labelOptions.autoRotationLimit, 80) && labelOptions.autoRotation ); if (autoRotation) { // Loop over the given autoRotation options, and determine which gives the best score. The // best score is that with the lowest number of steps and a rotation closest to horizontal. each(autoRotation, function (rot) { var score; if (rot === rotationOption || (rot && rot >= -90 && rot <= 90)) { // #3891 step = getStep(mathAbs(labelMetrics.h / mathSin(deg2rad * rot))); score = step + mathAbs(rot / 360); if (score < bestScore) { bestScore = score; rotation = rot; newTickInterval = step; } } }); } } else if (!labelOptions.step) { // #4411 newTickInterval = getStep(labelMetrics.h); } this.autoRotation = autoRotation; this.labelRotation = pick(rotation, rotationOption); return newTickInterval; }, /** * Get the general slot width for this axis. This may change between the pre-render (from Axis.getOffset) * and the final tick rendering and placement (#5086). */ getSlotWidth: function () { var chart = this.chart, horiz = this.horiz, labelOptions = this.options.labels, slotCount = Math.max(this.tickPositions.length - (this.categories ? 0 : 1), 1), marginLeft = chart.margin[3]; return (horiz && (labelOptions.step || 0) < 2 && !labelOptions.rotation && // #4415 ((this.staggerLines || 1) * chart.plotWidth) / slotCount) || (!horiz && ((marginLeft && (marginLeft - chart.spacing[3])) || chart.chartWidth * 0.33)); // #1580, #1931 }, /** * Render the axis labels and determine whether ellipsis or rotation need to be applied */ renderUnsquish: function () { var chart = this.chart, renderer = chart.renderer, tickPositions = this.tickPositions, ticks = this.ticks, labelOptions = this.options.labels, horiz = this.horiz, slotWidth = this.getSlotWidth(), innerWidth = mathMax(1, mathRound(slotWidth - 2 * (labelOptions.padding || 5))), attr = {}, labelMetrics = this.labelMetrics(), textOverflowOption = labelOptions.style.textOverflow, css, maxLabelLength = 0, label, i, pos; // Set rotation option unless it is "auto", like in gauges if (!isString(labelOptions.rotation)) { attr.rotation = labelOptions.rotation || 0; // #4443 } // Get the longest label length each(tickPositions, function (tick) { tick = ticks[tick]; if (tick && tick.labelLength > maxLabelLength) { maxLabelLength = tick.labelLength; } }); this.maxLabelLength = maxLabelLength; // Handle auto rotation on horizontal axis if (this.autoRotation) { // Apply rotation only if the label is too wide for the slot, and // the label is wider than its height. if (maxLabelLength > innerWidth && maxLabelLength > labelMetrics.h) { attr.rotation = this.labelRotation; } else { this.labelRotation = 0; } // Handle word-wrap or ellipsis on vertical axis } else if (slotWidth) { // For word-wrap or ellipsis css = { width: innerWidth + PX }; if (!textOverflowOption) { css.textOverflow = 'clip'; // On vertical axis, only allow word wrap if there is room for more lines. i = tickPositions.length; while (!horiz && i--) { pos = tickPositions[i]; label = ticks[pos].label; if (label) { // Reset ellipsis in order to get the correct bounding box (#4070) if (label.styles.textOverflow === 'ellipsis') { label.css({ textOverflow: 'clip' }); // Set the correct width in order to read the bounding box height (#4678, #5034) } else if (ticks[pos].labelLength > slotWidth) { label.css({ width: slotWidth + 'px' }); } if (label.getBBox().height > this.len / tickPositions.length - (labelMetrics.h - labelMetrics.f)) { label.specCss = { textOverflow: 'ellipsis' }; } } } } } // Add ellipsis if the label length is significantly longer than ideal if (attr.rotation) { css = { width: (maxLabelLength > chart.chartHeight * 0.5 ? chart.chartHeight * 0.33 : chart.chartHeight) + PX }; if (!textOverflowOption) { css.textOverflow = 'ellipsis'; } } // Set the explicit or automatic label alignment this.labelAlign = labelOptions.align || this.autoLabelAlign(this.labelRotation); if (this.labelAlign) { attr.align = this.labelAlign; } // Apply general and specific CSS each(tickPositions, function (pos) { var tick = ticks[pos], label = tick && tick.label; if (label) { label.attr(attr); // This needs to go before the CSS in old IE (#4502) if (css) { label.css(merge(css, label.specCss)); } delete label.specCss; tick.rotation = attr.rotation; } }); // Note: Why is this not part of getLabelPosition? this.tickRotCorr = renderer.rotCorr(labelMetrics.b, this.labelRotation || 0, this.side !== 0); }, /** * Return true if the axis has associated data */ hasData: function () { return this.hasVisibleSeries || (defined(this.min) && defined(this.max) && !!this.tickPositions); }, /** * Render the tick labels to a preliminary position to get their sizes */ getOffset: function () { var axis = this, chart = axis.chart, renderer = chart.renderer, options = axis.options, tickPositions = axis.tickPositions, ticks = axis.ticks, horiz = axis.horiz, side = axis.side, invertedSide = chart.inverted ? [1, 0, 3, 2][side] : side, hasData, showAxis, titleOffset = 0, titleOffsetOption, titleMargin = 0, axisTitleOptions = options.title, labelOptions = options.labels, labelOffset = 0, // reset labelOffsetPadded, opposite = axis.opposite, axisOffset = chart.axisOffset, clipOffset = chart.clipOffset, clip, directionFactor = [-1, 1, 1, -1][side], n, textAlign, axisParent = axis.axisParent, // Used in color axis lineHeightCorrection, tickSize = this.tickSize('tick'); // For reuse in Axis.render hasData = axis.hasData(); axis.showAxis = showAxis = hasData || pick(options.showEmpty, true); // Set/reset staggerLines axis.staggerLines = axis.horiz && labelOptions.staggerLines; // Create the axisGroup and gridGroup elements on first iteration if (!axis.axisGroup) { axis.gridGroup = renderer.g('grid') .attr({ zIndex: options.gridZIndex || 1 }) .add(axisParent); axis.axisGroup = renderer.g('axis') .attr({ zIndex: options.zIndex || 2 }) .add(axisParent); axis.labelGroup = renderer.g('axis-labels') .attr({ zIndex: labelOptions.zIndex || 7 }) .addClass(PREFIX + axis.coll.toLowerCase() + '-labels') .add(axisParent); } if (hasData || axis.isLinked) { // Generate ticks each(tickPositions, function (pos) { if (!ticks[pos]) { ticks[pos] = new Tick(axis, pos); } else { ticks[pos].addLabel(); // update labels depending on tick interval } }); axis.renderUnsquish(); // Left side must be align: right and right side must have align: left for labels if (labelOptions.reserveSpace !== false && (side === 0 || side === 2 || { 1: 'left', 3: 'right' }[side] === axis.labelAlign || axis.labelAlign === 'center')) { each(tickPositions, function (pos) { // get the highest offset labelOffset = mathMax( ticks[pos].getLabelSize(), labelOffset ); }); } if (axis.staggerLines) { labelOffset *= axis.staggerLines; axis.labelOffset = labelOffset * (axis.opposite ? -1 : 1); } } else { // doesn't have data for (n in ticks) { ticks[n].destroy(); delete ticks[n]; } } if (axisTitleOptions && axisTitleOptions.text && axisTitleOptions.enabled !== false) { if (!axis.axisTitle) { textAlign = axisTitleOptions.textAlign; if (!textAlign) { textAlign = (horiz ? { low: 'left', middle: 'center', high: 'right' } : { low: opposite ? 'right' : 'left', middle: 'center', high: opposite ? 'left' : 'right' })[axisTitleOptions.align]; } axis.axisTitle = renderer.text( axisTitleOptions.text, 0, 0, axisTitleOptions.useHTML ) .attr({ zIndex: 7, rotation: axisTitleOptions.rotation || 0, align: textAlign }) .addClass(PREFIX + this.coll.toLowerCase() + '-title') .css(axisTitleOptions.style) .add(axis.axisGroup); axis.axisTitle.isNew = true; } if (showAxis) { titleOffset = axis.axisTitle.getBBox()[horiz ? 'height' : 'width']; titleOffsetOption = axisTitleOptions.offset; titleMargin = defined(titleOffsetOption) ? 0 : pick(axisTitleOptions.margin, horiz ? 5 : 10); } // hide or show the title depending on whether showEmpty is set axis.axisTitle[showAxis ? 'show' : 'hide'](true); } // handle automatic or user set offset axis.offset = directionFactor * pick(options.offset, axisOffset[side]); axis.tickRotCorr = axis.tickRotCorr || { x: 0, y: 0 }; // polar if (side === 0) { lineHeightCorrection = -axis.labelMetrics().h; } else if (side === 2) { lineHeightCorrection = axis.tickRotCorr.y; } else { lineHeightCorrection = 0; } // Find the padded label offset labelOffsetPadded = Math.abs(labelOffset) + titleMargin; if (labelOffset) { labelOffsetPadded -= lineHeightCorrection; labelOffsetPadded += directionFactor * (horiz ? pick(labelOptions.y, axis.tickRotCorr.y + directionFactor * 8) : labelOptions.x); } axis.axisTitleMargin = pick(titleOffsetOption, labelOffsetPadded); axisOffset[side] = mathMax( axisOffset[side], axis.axisTitleMargin + titleOffset + directionFactor * axis.offset, labelOffsetPadded, // #3027 hasData && tickPositions.length && tickSize ? tickSize[0] : 0 // #4866 ); // Decide the clipping needed to keep the graph inside the plot area and axis lines clip = options.offset ? 0 : mathFloor(options.lineWidth / 2) * 2; // #4308, #4371 clipOffset[invertedSide] = mathMax(clipOffset[invertedSide], clip); }, /** * Get the path for the axis line */ getLinePath: function (lineWidth) { var chart = this.chart, opposite = this.opposite, offset = this.offset, horiz = this.horiz, lineLeft = this.left + (opposite ? this.width : 0) + offset, lineTop = chart.chartHeight - this.bottom - (opposite ? this.height : 0) + offset; if (opposite) { lineWidth *= -1; // crispify the other way - #1480, #1687 } return chart.renderer .crispLine([ M, horiz ? this.left : lineLeft, horiz ? lineTop : this.top, L, horiz ? chart.chartWidth - this.right : lineLeft, horiz ? lineTop : chart.chartHeight - this.bottom ], lineWidth); }, /** * Position the title */ getTitlePosition: function () { // compute anchor points for each of the title align options var horiz = this.horiz, axisLeft = this.left, axisTop = this.top, axisLength = this.len, axisTitleOptions = this.options.title, margin = horiz ? axisLeft : axisTop, opposite = this.opposite, offset = this.offset, xOption = axisTitleOptions.x || 0, yOption = axisTitleOptions.y || 0, fontSize = this.chart.renderer.fontMetrics(axisTitleOptions.style.fontSize).f, // the position in the length direction of the axis alongAxis = { low: margin + (horiz ? 0 : axisLength), middle: margin + axisLength / 2, high: margin + (horiz ? axisLength : 0) }[axisTitleOptions.align], // the position in the perpendicular direction of the axis offAxis = (horiz ? axisTop + this.height : axisLeft) + (horiz ? 1 : -1) * // horizontal axis reverses the margin (opposite ? -1 : 1) * // so does opposite axes this.axisTitleMargin + (this.side === 2 ? fontSize : 0); return { x: horiz ? alongAxis + xOption : offAxis + (opposite ? this.width : 0) + offset + xOption, y: horiz ? offAxis + yOption - (opposite ? this.height : 0) + offset : alongAxis + yOption }; }, /** * Render the axis */ render: function () { var axis = this, chart = axis.chart, renderer = chart.renderer, options = axis.options, isLog = axis.isLog, lin2log = axis.lin2log, isLinked = axis.isLinked, tickPositions = axis.tickPositions, axisTitle = axis.axisTitle, ticks = axis.ticks, minorTicks = axis.minorTicks, alternateBands = axis.alternateBands, stackLabelOptions = options.stackLabels, alternateGridColor = options.alternateGridColor, tickmarkOffset = axis.tickmarkOffset, lineWidth = options.lineWidth, linePath, hasRendered = chart.hasRendered, slideInTicks = hasRendered && isNumber(axis.oldMin), showAxis = axis.showAxis, animation = animObject(renderer.globalAnimation), from, to; // Reset axis.labelEdge.length = 0; //axis.justifyToPlot = overflow === 'justify'; axis.overlap = false; // Mark all elements inActive before we go over and mark the active ones each([ticks, minorTicks, alternateBands], function (coll) { var pos; for (pos in coll) { coll[pos].isActive = false; } }); // If the series has data draw the ticks. Else only the line and title if (axis.hasData() || isLinked) { // minor ticks if (axis.minorTickInterval && !axis.categories) { each(axis.getMinorTickPositions(), function (pos) { if (!minorTicks[pos]) { minorTicks[pos] = new Tick(axis, pos, 'minor'); } // render new ticks in old position if (slideInTicks && minorTicks[pos].isNew) { minorTicks[pos].render(null, true); } minorTicks[pos].render(null, false, 1); }); } // Major ticks. Pull out the first item and render it last so that // we can get the position of the neighbour label. #808. if (tickPositions.length) { // #1300 each(tickPositions, function (pos, i) { // linked axes need an extra check to find out if if (!isLinked || (pos >= axis.min && pos <= axis.max)) { if (!ticks[pos]) { ticks[pos] = new Tick(axis, pos); } // render new ticks in old position if (slideInTicks && ticks[pos].isNew) { ticks[pos].render(i, true, 0.1); } ticks[pos].render(i); } }); // In a categorized axis, the tick marks are displayed between labels. So // we need to add a tick mark and grid line at the left edge of the X axis. if (tickmarkOffset && (axis.min === 0 || axis.single)) { if (!ticks[-1]) { ticks[-1] = new Tick(axis, -1, null, true); } ticks[-1].render(-1); } } // alternate grid color if (alternateGridColor) { each(tickPositions, function (pos, i) { to = tickPositions[i + 1] !== UNDEFINED ? tickPositions[i + 1] + tickmarkOffset : axis.max - tickmarkOffset; if (i % 2 === 0 && pos < axis.max && to <= axis.max + (chart.polar ? -tickmarkOffset : tickmarkOffset)) { // #2248, #4660 if (!alternateBands[pos]) { alternateBands[pos] = new Highcharts.PlotLineOrBand(axis); } from = pos + tickmarkOffset; // #949 alternateBands[pos].options = { from: isLog ? lin2log(from) : from, to: isLog ? lin2log(to) : to, color: alternateGridColor }; alternateBands[pos].render(); alternateBands[pos].isActive = true; } }); } // custom plot lines and bands if (!axis._addedPlotLB) { // only first time each((options.plotLines || []).concat(options.plotBands || []), function (plotLineOptions) { axis.addPlotBandOrLine(plotLineOptions); }); axis._addedPlotLB = true; } } // end if hasData // Remove inactive ticks each([ticks, minorTicks, alternateBands], function (coll) { var pos, i, forDestruction = [], delay = animation.duration, destroyInactiveItems = function () { i = forDestruction.length; while (i--) { // When resizing rapidly, the same items may be destroyed in different timeouts, // or the may be reactivated if (coll[forDestruction[i]] && !coll[forDestruction[i]].isActive) { coll[forDestruction[i]].destroy(); delete coll[forDestruction[i]]; } } }; for (pos in coll) { if (!coll[pos].isActive) { // Render to zero opacity coll[pos].render(pos, false, 0); coll[pos].isActive = false; forDestruction.push(pos); } } // When the objects are finished fading out, destroy them syncTimeout( destroyInactiveItems, coll === alternateBands || !chart.hasRendered || !delay ? 0 : delay ); }); // Static items. As the axis group is cleared on subsequent calls // to render, these items are added outside the group. // axis line if (lineWidth) { linePath = axis.getLinePath(lineWidth); if (!axis.axisLine) { axis.axisLine = renderer.path(linePath) .attr({ stroke: options.lineColor, 'stroke-width': lineWidth, zIndex: 7 }) .add(axis.axisGroup); } else { axis.axisLine.animate({ d: linePath }); } // show or hide the line depending on options.showEmpty axis.axisLine[showAxis ? 'show' : 'hide'](true); } if (axisTitle && showAxis) { axisTitle[axisTitle.isNew ? 'attr' : 'animate']( axis.getTitlePosition() ); axisTitle.isNew = false; } // Stacked totals: if (stackLabelOptions && stackLabelOptions.enabled) { axis.renderStackTotals(); } // End stacked totals axis.isDirty = false; }, /** * Redraw the axis to reflect changes in the data or axis extremes */ redraw: function () { if (this.visible) { // render the axis this.render(); // move plot lines and bands each(this.plotLinesAndBands, function (plotLine) { plotLine.render(); }); } // mark associated series as dirty and ready for redraw each(this.series, function (series) { series.isDirty = true; }); }, /** * Destroys an Axis instance. */ destroy: function (keepEvents) { var axis = this, stacks = axis.stacks, stackKey, plotLinesAndBands = axis.plotLinesAndBands, i; // Remove the events if (!keepEvents) { removeEvent(axis); } // Destroy each stack total for (stackKey in stacks) { destroyObjectProperties(stacks[stackKey]); stacks[stackKey] = null; } // Destroy collections each([axis.ticks, axis.minorTicks, axis.alternateBands], function (coll) { destroyObjectProperties(coll); }); i = plotLinesAndBands.length; while (i--) { // #1975 plotLinesAndBands[i].destroy(); } // Destroy properties each(['stackTotalGroup', 'axisLine', 'axisTitle', 'axisGroup', 'gridGroup', 'labelGroup', 'cross'], function (prop) { if (axis[prop]) { axis[prop] = axis[prop].destroy(); } }); this._addedPlotLB = this.chart._labelPanes = this.ordinalSlope = undefined; // #1611, #2887, #4314, #5316 }, /** * Draw the crosshair * * @param {Object} e The event arguments from the modified pointer event * @param {Object} point The Point object */ drawCrosshair: function (e, point) { var path, options = this.crosshair, pos, attribs, categorized, strokeWidth; // Use last available event when updating non-snapped crosshairs without // mouse interaction (#5287) if (!e) { e = this.cross && this.cross.e; } if ( // Disabled in options !this.crosshair || // Snap ((defined(point) || !pick(options.snap, true)) === false) ) { this.hideCrosshair(); } else { // Get the path if (!pick(options.snap, true)) { pos = (this.horiz ? e.chartX - this.pos : this.len - e.chartY + this.pos); } else if (defined(point)) { pos = this.isXAxis ? point.plotX : this.len - point.plotY; // #3834 } if (this.isRadial) { path = this.getPlotLinePath(this.isXAxis ? point.x : pick(point.stackY, point.y)) || null; // #3189 } else { path = this.getPlotLinePath(null, null, null, null, pos) || null; // #3189 } if (path === null) { this.hideCrosshair(); return; } categorized = this.categories && !this.isRadial; strokeWidth = pick(options.width, (categorized ? this.transA : 1)); // Draw the cross if (this.cross) { this.cross .attr({ d: path, visibility: 'visible', 'stroke-width': strokeWidth // #4737 }); } else { attribs = { 'pointer-events': 'none', // #5259 'stroke-width': strokeWidth, stroke: options.color || (categorized ? 'rgba(155,200,255,0.2)' : '#C0C0C0'), zIndex: pick(options.zIndex, 2) }; if (options.dashStyle) { attribs.dashstyle = options.dashStyle; } this.cross = this.chart.renderer.path(path).attr(attribs).add(); } this.cross.e = e; } }, /** * Hide the crosshair. */ hideCrosshair: function () { if (this.cross) { this.cross.hide(); } } }; // end Axis extend(Axis.prototype, AxisPlotLineOrBandExtension); /** * Set the tick positions to a time unit that makes sense, for example * on the first of each month or on every Monday. Return an array * with the time positions. Used in datetime axes as well as for grouping * data on a datetime axis. * * @param {Object} normalizedInterval The interval in axis values (ms) and the count * @param {Number} min The minimum in axis values * @param {Number} max The maximum in axis values * @param {Number} startOfWeek */ Axis.prototype.getTimeTicks = function (normalizedInterval, min, max, startOfWeek) { var tickPositions = [], i, higherRanks = {}, useUTC = defaultOptions.global.useUTC, minYear, // used in months and years as a basis for Date.UTC() minDate = new Date(min - getTZOffset(min)), interval = normalizedInterval.unitRange, count = normalizedInterval.count; if (defined(min)) { // #1300 minDate[setMilliseconds](interval >= timeUnits.second ? 0 : // #3935 count * mathFloor(minDate.getMilliseconds() / count)); // #3652, #3654 if (interval >= timeUnits.second) { // second minDate[setSeconds](interval >= timeUnits.minute ? 0 : // #3935 count * mathFloor(minDate.getSeconds() / count)); } if (interval >= timeUnits.minute) { // minute minDate[setMinutes](interval >= timeUnits.hour ? 0 : count * mathFloor(minDate[getMinutes]() / count)); } if (interval >= timeUnits.hour) { // hour minDate[setHours](interval >= timeUnits.day ? 0 : count * mathFloor(minDate[getHours]() / count)); } if (interval >= timeUnits.day) { // day minDate[setDate](interval >= timeUnits.month ? 1 : count * mathFloor(minDate[getDate]() / count)); } if (interval >= timeUnits.month) { // month minDate[setMonth](interval >= timeUnits.year ? 0 : count * mathFloor(minDate[getMonth]() / count)); minYear = minDate[getFullYear](); } if (interval >= timeUnits.year) { // year minYear -= minYear % count; minDate[setFullYear](minYear); } // week is a special case that runs outside the hierarchy if (interval === timeUnits.week) { // get start of current week, independent of count minDate[setDate](minDate[getDate]() - minDate[getDay]() + pick(startOfWeek, 1)); } // get tick positions i = 1; if (timezoneOffset || getTimezoneOffset) { minDate = minDate.getTime(); minDate = new Date(minDate + getTZOffset(minDate)); } minYear = minDate[getFullYear](); var time = minDate.getTime(), minMonth = minDate[getMonth](), minDateDate = minDate[getDate](), variableDayLength = !useUTC || !!getTimezoneOffset, // #4951 localTimezoneOffset = (timeUnits.day + (useUTC ? getTZOffset(minDate) : minDate.getTimezoneOffset() * 60 * 1000) ) % timeUnits.day; // #950, #3359 // iterate and add tick positions at appropriate values while (time < max) { tickPositions.push(time); // if the interval is years, use Date.UTC to increase years if (interval === timeUnits.year) { time = makeTime(minYear + i * count, 0); // if the interval is months, use Date.UTC to increase months } else if (interval === timeUnits.month) { time = makeTime(minYear, minMonth + i * count); // if we're using global time, the interval is not fixed as it jumps // one hour at the DST crossover } else if (variableDayLength && (interval === timeUnits.day || interval === timeUnits.week)) { time = makeTime(minYear, minMonth, minDateDate + i * count * (interval === timeUnits.day ? 1 : 7)); // else, the interval is fixed and we use simple addition } else { time += interval * count; } i++; } // push the last time tickPositions.push(time); // mark new days if the time is dividible by day (#1649, #1760) each(grep(tickPositions, function (time) { return interval <= timeUnits.hour && time % timeUnits.day === localTimezoneOffset; }), function (time) { higherRanks[time] = 'day'; }); } // record information on the chosen unit - for dynamic label formatter tickPositions.info = extend(normalizedInterval, { higherRanks: higherRanks, totalRange: interval * count }); return tickPositions; }; /** * Get a normalized tick interval for dates. Returns a configuration object with * unit range (interval), count and name. Used to prepare data for getTimeTicks. * Previously this logic was part of getTimeTicks, but as getTimeTicks now runs * of segments in stock charts, the normalizing logic was extracted in order to * prevent it for running over again for each segment having the same interval. * #662, #697. */ Axis.prototype.normalizeTimeTickInterval = function (tickInterval, unitsOption) { var units = unitsOption || [[ 'millisecond', // unit name [1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples ], [ 'second', [1, 2, 5, 10, 15, 30] ], [ 'minute', [1, 2, 5, 10, 15, 30] ], [ 'hour', [1, 2, 3, 4, 6, 8, 12] ], [ 'day', [1, 2] ], [ 'week', [1, 2] ], [ 'month', [1, 2, 3, 4, 6] ], [ 'year', null ]], unit = units[units.length - 1], // default unit is years interval = timeUnits[unit[0]], multiples = unit[1], count, i; // loop through the units to find the one that best fits the tickInterval for (i = 0; i < units.length; i++) { unit = units[i]; interval = timeUnits[unit[0]]; multiples = unit[1]; if (units[i + 1]) { // lessThan is in the middle between the highest multiple and the next unit. var lessThan = (interval * multiples[multiples.length - 1] + timeUnits[units[i + 1][0]]) / 2; // break and keep the current unit if (tickInterval <= lessThan) { break; } } } // prevent 2.5 years intervals, though 25, 250 etc. are allowed if (interval === timeUnits.year && tickInterval < 5 * interval) { multiples = [1, 2, 5]; } // get the count count = normalizeTickInterval( tickInterval / interval, multiples, unit[0] === 'year' ? mathMax(getMagnitude(tickInterval / interval), 1) : 1 // #1913, #2360 ); return { unitRange: interval, count: count, unitName: unit[0] }; }; /** * Methods defined on the Axis prototype */ /** * Set the tick positions of a logarithmic axis */ Axis.prototype.getLogTickPositions = function (interval, min, max, minor) { var axis = this, options = axis.options, axisLength = axis.len, lin2log = axis.lin2log, log2lin = axis.log2lin, // Since we use this method for both major and minor ticks, // use a local variable and return the result positions = []; // Reset if (!minor) { axis._minorAutoInterval = null; } // First case: All ticks fall on whole logarithms: 1, 10, 100 etc. if (interval >= 0.5) { interval = mathRound(interval); positions = axis.getLinearTickPositions(interval, min, max); // Second case: We need intermediary ticks. For example // 1, 2, 4, 6, 8, 10, 20, 40 etc. } else if (interval >= 0.08) { var roundedMin = mathFloor(min), intermediate, i, j, len, pos, lastPos, break2; if (interval > 0.3) { intermediate = [1, 2, 4]; } else if (interval > 0.15) { // 0.2 equals five minor ticks per 1, 10, 100 etc intermediate = [1, 2, 4, 6, 8]; } else { // 0.1 equals ten minor ticks per 1, 10, 100 etc intermediate = [1, 2, 3, 4, 5, 6, 7, 8, 9]; } for (i = roundedMin; i < max + 1 && !break2; i++) { len = intermediate.length; for (j = 0; j < len && !break2; j++) { pos = log2lin(lin2log(i) * intermediate[j]); if (pos > min && (!minor || lastPos <= max) && lastPos !== UNDEFINED) { // #1670, lastPos is #3113 positions.push(lastPos); } if (lastPos > max) { break2 = true; } lastPos = pos; } } // Third case: We are so deep in between whole logarithmic values that // we might as well handle the tick positions like a linear axis. For // example 1.01, 1.02, 1.03, 1.04. } else { var realMin = lin2log(min), realMax = lin2log(max), tickIntervalOption = options[minor ? 'minorTickInterval' : 'tickInterval'], filteredTickIntervalOption = tickIntervalOption === 'auto' ? null : tickIntervalOption, tickPixelIntervalOption = options.tickPixelInterval / (minor ? 5 : 1), totalPixelLength = minor ? axisLength / axis.tickPositions.length : axisLength; interval = pick( filteredTickIntervalOption, axis._minorAutoInterval, (realMax - realMin) * tickPixelIntervalOption / (totalPixelLength || 1) ); interval = normalizeTickInterval( interval, null, getMagnitude(interval) ); positions = map(axis.getLinearTickPositions( interval, realMin, realMax ), log2lin); if (!minor) { axis._minorAutoInterval = interval / 5; } } // Set the axis-level tickInterval variable if (!minor) { axis.tickInterval = interval; } return positions; }; Axis.prototype.log2lin = function (num) { return math.log(num) / math.LN10; }; Axis.prototype.lin2log = function (num) { return math.pow(10, num); }; /** * The tooltip object * @param {Object} chart The chart instance * @param {Object} options Tooltip options */ var Tooltip = Highcharts.Tooltip = function () { this.init.apply(this, arguments); }; Tooltip.prototype = { init: function (chart, options) { var borderWidth = options.borderWidth, style = options.style, padding = pInt(style.padding); // Save the chart and options this.chart = chart; this.options = options; // Keep track of the current series //this.currentSeries = UNDEFINED; // List of crosshairs this.crosshairs = []; // Current values of x and y when animating this.now = { x: 0, y: 0 }; // The tooltip is initially hidden this.isHidden = true; // create the label this.label = chart.renderer.label('', 0, 0, options.shape || 'callout', null, null, options.useHTML, null, 'tooltip') .attr({ padding: padding, fill: options.backgroundColor, 'stroke-width': borderWidth, r: options.borderRadius, zIndex: 8, display: 'none' // #2301, #2657, #3532, #5570 }) .css(style) .css({ padding: 0 }) // Remove it from VML, the padding is applied as an attribute instead (#1117) .add(); // When using canVG the shadow shows up as a gray circle // even if the tooltip is hidden. if (!useCanVG) { this.label.shadow(options.shadow); } // Public property for getting the shared state. this.shared = options.shared; }, /** * Destroy the tooltip and its elements. */ destroy: function () { // Destroy and clear local variables if (this.label) { this.label = this.label.destroy(); } clearTimeout(this.hideTimer); clearTimeout(this.tooltipTimeout); }, /** * Provide a soft movement for the tooltip * * @param {Number} x * @param {Number} y * @private */ move: function (x, y, anchorX, anchorY) { var tooltip = this, now = tooltip.now, animate = tooltip.options.animation !== false && !tooltip.isHidden && // When we get close to the target position, abort animation and land on the right place (#3056) (mathAbs(x - now.x) > 1 || mathAbs(y - now.y) > 1), skipAnchor = tooltip.followPointer || tooltip.len > 1; // Get intermediate values for animation extend(now, { x: animate ? (2 * now.x + x) / 3 : x, y: animate ? (now.y + y) / 2 : y, anchorX: skipAnchor ? UNDEFINED : animate ? (2 * now.anchorX + anchorX) / 3 : anchorX, anchorY: skipAnchor ? UNDEFINED : animate ? (now.anchorY + anchorY) / 2 : anchorY }); // Move to the intermediate value tooltip.label.attr(now); // Run on next tick of the mouse tracker if (animate) { // Never allow two timeouts clearTimeout(this.tooltipTimeout); // Set the fixed interval ticking for the smooth tooltip this.tooltipTimeout = setTimeout(function () { // The interval function may still be running during destroy, so check that the chart is really there before calling. if (tooltip) { tooltip.move(x, y, anchorX, anchorY); } }, 32); } }, /** * Hide the tooltip */ hide: function (delay) { var tooltip = this; clearTimeout(this.hideTimer); // disallow duplicate timers (#1728, #1766) delay = pick(delay, this.options.hideDelay, 500); if (!this.isHidden) { this.hideTimer = syncTimeout(function () { tooltip.label[delay ? 'fadeOut' : 'hide'](); tooltip.isHidden = true; }, delay); } }, /** * Extendable method to get the anchor position of the tooltip * from a point or set of points */ getAnchor: function (points, mouseEvent) { var ret, chart = this.chart, inverted = chart.inverted, plotTop = chart.plotTop, plotLeft = chart.plotLeft, plotX = 0, plotY = 0, yAxis, xAxis; points = splat(points); // Pie uses a special tooltipPos ret = points[0].tooltipPos; // When tooltip follows mouse, relate the position to the mouse if (this.followPointer && mouseEvent) { if (mouseEvent.chartX === UNDEFINED) { mouseEvent = chart.pointer.normalize(mouseEvent); } ret = [ mouseEvent.chartX - chart.plotLeft, mouseEvent.chartY - plotTop ]; } // When shared, use the average position if (!ret) { each(points, function (point) { yAxis = point.series.yAxis; xAxis = point.series.xAxis; plotX += point.plotX + (!inverted && xAxis ? xAxis.left - plotLeft : 0); plotY += (point.plotLow ? (point.plotLow + point.plotHigh) / 2 : point.plotY) + (!inverted && yAxis ? yAxis.top - plotTop : 0); // #1151 }); plotX /= points.length; plotY /= points.length; ret = [ inverted ? chart.plotWidth - plotY : plotX, this.shared && !inverted && points.length > 1 && mouseEvent ? mouseEvent.chartY - plotTop : // place shared tooltip next to the mouse (#424) inverted ? chart.plotHeight - plotX : plotY ]; } return map(ret, mathRound); }, /** * Place the tooltip in a chart without spilling over * and not covering the point it self. */ getPosition: function (boxWidth, boxHeight, point) { var chart = this.chart, distance = this.distance, ret = {}, h = point.h || 0, // #4117 swapped, first = ['y', chart.chartHeight, boxHeight, point.plotY + chart.plotTop, chart.plotTop, chart.plotTop + chart.plotHeight], second = ['x', chart.chartWidth, boxWidth, point.plotX + chart.plotLeft, chart.plotLeft, chart.plotLeft + chart.plotWidth], // The far side is right or bottom preferFarSide = !this.followPointer && pick(point.ttBelow, !chart.inverted === !!point.negative), // #4984 /** * Handle the preferred dimension. When the preferred dimension is tooltip * on top or bottom of the point, it will look for space there. */ firstDimension = function (dim, outerSize, innerSize, point, min, max) { var roomLeft = innerSize < point - distance, roomRight = point + distance + innerSize < outerSize, alignedLeft = point - distance - innerSize, alignedRight = point + distance; if (preferFarSide && roomRight) { ret[dim] = alignedRight; } else if (!preferFarSide && roomLeft) { ret[dim] = alignedLeft; } else if (roomLeft) { ret[dim] = mathMin(max - innerSize, alignedLeft - h < 0 ? alignedLeft : alignedLeft - h); } else if (roomRight) { ret[dim] = mathMax(min, alignedRight + h + innerSize > outerSize ? alignedRight : alignedRight + h); } else { return false; } }, /** * Handle the secondary dimension. If the preferred dimension is tooltip * on top or bottom of the point, the second dimension is to align the tooltip * above the point, trying to align center but allowing left or right * align within the chart box. */ secondDimension = function (dim, outerSize, innerSize, point) { var retVal; // Too close to the edge, return false and swap dimensions if (point < distance || point > outerSize - distance) { retVal = false; // Align left/top } else if (point < innerSize / 2) { ret[dim] = 1; // Align right/bottom } else if (point > outerSize - innerSize / 2) { ret[dim] = outerSize - innerSize - 2; // Align center } else { ret[dim] = point - innerSize / 2; } return retVal; }, /** * Swap the dimensions */ swap = function (count) { var temp = first; first = second; second = temp; swapped = count; }, run = function () { if (firstDimension.apply(0, first) !== false) { if (secondDimension.apply(0, second) === false && !swapped) { swap(true); run(); } } else if (!swapped) { swap(true); run(); } else { ret.x = ret.y = 0; } }; // Under these conditions, prefer the tooltip on the side of the point if (chart.inverted || this.len > 1) { swap(); } run(); return ret; }, /** * In case no user defined formatter is given, this will be used. Note that the context * here is an object holding point, series, x, y etc. */ defaultFormatter: function (tooltip) { var items = this.points || splat(this), s; // build the header s = [tooltip.tooltipFooterHeaderFormatter(items[0])]; //#3397: abstraction to enable formatting of footer and header // build the values s = s.concat(tooltip.bodyFormatter(items)); // footer s.push(tooltip.tooltipFooterHeaderFormatter(items[0], true)); //#3397: abstraction to enable formatting of footer and header return s.join(''); }, /** * Refresh the tooltip's text and position. * @param {Object} point */ refresh: function (point, mouseEvent) { var tooltip = this, chart = tooltip.chart, label = tooltip.label, options = tooltip.options, x, y, anchor, textConfig = {}, text, pointConfig = [], formatter = options.formatter || tooltip.defaultFormatter, hoverPoints = chart.hoverPoints, borderColor, shared = tooltip.shared, currentSeries; clearTimeout(this.hideTimer); // get the reference point coordinates (pie charts use tooltipPos) tooltip.followPointer = splat(point)[0].series.tooltipOptions.followPointer; anchor = tooltip.getAnchor(point, mouseEvent); x = anchor[0]; y = anchor[1]; // shared tooltip, array is sent over if (shared && !(point.series && point.series.noSharedTooltip)) { // hide previous hoverPoints and set new chart.hoverPoints = point; if (hoverPoints) { each(hoverPoints, function (point) { point.setState(); }); } each(point, function (item) { item.setState(HOVER_STATE); pointConfig.push(item.getLabelConfig()); }); textConfig = { x: point[0].category, y: point[0].y }; textConfig.points = pointConfig; this.len = pointConfig.length; point = point[0]; // single point tooltip } else { textConfig = point.getLabelConfig(); } text = formatter.call(textConfig, tooltip); // register the current series currentSeries = point.series; this.distance = pick(currentSeries.tooltipOptions.distance, 16); // update the inner HTML if (text === false) { this.hide(); } else { // show it if (tooltip.isHidden) { stop(label); label.attr({ opacity: 1, display: 'block' }).show(); } // update text label.attr({ text: text }); // set the stroke color of the box borderColor = options.borderColor || point.color || currentSeries.color || '#606060'; label.attr({ stroke: borderColor }); tooltip.updatePosition({ plotX: x, plotY: y, negative: point.negative, ttBelow: point.ttBelow, h: anchor[2] || 0 }); this.isHidden = false; } fireEvent(chart, 'tooltipRefresh', { text: text, x: x + chart.plotLeft, y: y + chart.plotTop, borderColor: borderColor }); }, /** * Find the new position and perform the move */ updatePosition: function (point) { var chart = this.chart, label = this.label, pos = (this.options.positioner || this.getPosition).call( this, label.width, label.height, point ); // do the move this.move( mathRound(pos.x), mathRound(pos.y || 0), // can be undefined (#3977) point.plotX + chart.plotLeft, point.plotY + chart.plotTop ); }, /** * Get the best X date format based on the closest point range on the axis. */ getXDateFormat: function (point, options, xAxis) { var xDateFormat, dateTimeLabelFormats = options.dateTimeLabelFormats, closestPointRange = xAxis && xAxis.closestPointRange, n, blank = '01-01 00:00:00.000', strpos = { millisecond: 15, second: 12, minute: 9, hour: 6, day: 3 }, date, lastN = 'millisecond'; // for sub-millisecond data, #4223 if (closestPointRange) { date = dateFormat('%m-%d %H:%M:%S.%L', point.x); for (n in timeUnits) { // If the range is exactly one week and we're looking at a Sunday/Monday, go for the week format if (closestPointRange === timeUnits.week && +dateFormat('%w', point.x) === xAxis.options.startOfWeek && date.substr(6) === blank.substr(6)) { n = 'week'; break; } // The first format that is too great for the range if (timeUnits[n] > closestPointRange) { n = lastN; break; } // If the point is placed every day at 23:59, we need to show // the minutes as well. #2637. if (strpos[n] && date.substr(strpos[n]) !== blank.substr(strpos[n])) { break; } // Weeks are outside the hierarchy, only apply them on Mondays/Sundays like in the first condition if (n !== 'week') { lastN = n; } } if (n) { xDateFormat = dateTimeLabelFormats[n]; } } else { xDateFormat = dateTimeLabelFormats.day; } return xDateFormat || dateTimeLabelFormats.year; // #2546, 2581 }, /** * Format the footer/header of the tooltip * #3397: abstraction to enable formatting of footer and header */ tooltipFooterHeaderFormatter: function (labelConfig, isFooter) { var footOrHead = isFooter ? 'footer' : 'header', series = labelConfig.series, tooltipOptions = series.tooltipOptions, xDateFormat = tooltipOptions.xDateFormat, xAxis = series.xAxis, isDateTime = xAxis && xAxis.options.type === 'datetime' && isNumber(labelConfig.key), formatString = tooltipOptions[footOrHead + 'Format']; // Guess the best date format based on the closest point distance (#568, #3418) if (isDateTime && !xDateFormat) { xDateFormat = this.getXDateFormat(labelConfig, tooltipOptions, xAxis); } // Insert the footer date format if any if (isDateTime && xDateFormat) { formatString = formatString.replace('{point.key}', '{point.key:' + xDateFormat + '}'); } return format(formatString, { point: labelConfig, series: series }); }, /** * Build the body (lines) of the tooltip by iterating over the items and returning one entry for each item, * abstracting this functionality allows to easily overwrite and extend it. */ bodyFormatter: function (items) { return map(items, function (item) { var tooltipOptions = item.series.tooltipOptions; return (tooltipOptions.pointFormatter || item.point.tooltipFormatter).call(item.point, tooltipOptions.pointFormat); }); } }; var hoverChartIndex; // Global flag for touch support hasTouch = doc && doc.documentElement.ontouchstart !== UNDEFINED; /** * The mouse tracker object. All methods starting with "on" are primary DOM event handlers. * Subsequent methods should be named differently from what they are doing. * @param {Object} chart The Chart instance * @param {Object} options The root options object */ var Pointer = Highcharts.Pointer = function (chart, options) { this.init(chart, options); }; Pointer.prototype = { /** * Initialize Pointer */ init: function (chart, options) { var chartOptions = options.chart, chartEvents = chartOptions.events, zoomType = useCanVG ? '' : chartOptions.zoomType, inverted = chart.inverted, zoomX, zoomY; // Store references this.options = options; this.chart = chart; // Zoom status this.zoomX = zoomX = /x/.test(zoomType); this.zoomY = zoomY = /y/.test(zoomType); this.zoomHor = (zoomX && !inverted) || (zoomY && inverted); this.zoomVert = (zoomY && !inverted) || (zoomX && inverted); this.hasZoom = zoomX || zoomY; // Do we need to handle click on a touch device? this.runChartClick = chartEvents && !!chartEvents.click; this.pinchDown = []; this.lastValidTouch = {}; if (Highcharts.Tooltip && options.tooltip.enabled) { chart.tooltip = new Tooltip(chart, options.tooltip); this.followTouchMove = pick(options.tooltip.followTouchMove, true); } this.setDOMEvents(); }, /** * Add crossbrowser support for chartX and chartY * @param {Object} e The event object in standard browsers */ normalize: function (e, chartPosition) { var chartX, chartY, ePos; // IE normalizing e = e || win.event; if (!e.target) { e.target = e.srcElement; } // iOS (#2757) ePos = e.touches ? (e.touches.length ? e.touches.item(0) : e.changedTouches[0]) : e; // Get mouse position if (!chartPosition) { this.chartPosition = chartPosition = offset(this.chart.container); } // chartX and chartY if (ePos.pageX === UNDEFINED) { // IE < 9. #886. chartX = mathMax(e.x, e.clientX - chartPosition.left); // #2005, #2129: the second case is // for IE10 quirks mode within framesets chartY = e.y; } else { chartX = ePos.pageX - chartPosition.left; chartY = ePos.pageY - chartPosition.top; } return extend(e, { chartX: mathRound(chartX), chartY: mathRound(chartY) }); }, /** * Get the click position in terms of axis values. * * @param {Object} e A pointer event */ getCoordinates: function (e) { var coordinates = { xAxis: [], yAxis: [] }; each(this.chart.axes, function (axis) { coordinates[axis.isXAxis ? 'xAxis' : 'yAxis'].push({ axis: axis, value: axis.toValue(e[axis.horiz ? 'chartX' : 'chartY']) }); }); return coordinates; }, /** * With line type charts with a single tracker, get the point closest to the mouse. * Run Point.onMouseOver and display tooltip for the point or points. */ runPointActions: function (e) { var pointer = this, chart = pointer.chart, series = chart.series, tooltip = chart.tooltip, shared = tooltip ? tooltip.shared : false, followPointer, updatePosition = true, hoverPoint = chart.hoverPoint, hoverSeries = chart.hoverSeries, i, anchor, noSharedTooltip, stickToHoverSeries, directTouch, kdpoints = [], kdpointT; // For hovering over the empty parts of the plot area (hoverSeries is undefined). // If there is one series with point tracking (combo chart), don't go to nearest neighbour. if (!shared && !hoverSeries) { for (i = 0; i < series.length; i++) { if (series[i].directTouch || !series[i].options.stickyTracking) { series = []; } } } // If it has a hoverPoint and that series requires direct touch (like columns, #3899), or we're on // a noSharedTooltip series among shared tooltip series (#4546), use the hoverPoint . Otherwise, // search the k-d tree. stickToHoverSeries = hoverSeries && (shared ? hoverSeries.noSharedTooltip : hoverSeries.directTouch); if (stickToHoverSeries && hoverPoint) { kdpoints = [hoverPoint]; // Handle shared tooltip or cases where a series is not yet hovered } else { // When we have non-shared tooltip and sticky tracking is disabled, // search for the closest point only on hovered series: #5533, #5476 if (!shared && hoverSeries && !hoverSeries.options.stickyTracking) { series = [hoverSeries]; } // Find nearest points on all series each(series, function (s) { // Skip hidden series noSharedTooltip = s.noSharedTooltip && shared; directTouch = !shared && s.directTouch; if (s.visible && !noSharedTooltip && !directTouch && pick(s.options.enableMouseTracking, true)) { // #3821 kdpointT = s.searchPoint(e, !noSharedTooltip && s.kdDimensions === 1); // #3828 if (kdpointT && kdpointT.series) { // Point.series becomes null when reset and before redraw (#5197) kdpoints.push(kdpointT); } } }); // Sort kdpoints by distance to mouse pointer kdpoints.sort(function (p1, p2) { var isCloserX = p1.distX - p2.distX, isCloser = p1.dist - p2.dist, isAbove = p1.series.group.zIndex > p2.series.group.zIndex ? -1 : 1; // We have two points which are not in the same place on xAxis and shared tooltip: if (isCloserX !== 0) { return isCloserX; } // Points are not exactly in the same place on x/yAxis: if (isCloser !== 0) { return isCloser; } // The same xAxis and yAxis position, sort by z-index: return isAbove; }); } // Remove points with different x-positions, required for shared tooltip and crosshairs (#4645): if (shared) { i = kdpoints.length; while (i--) { if (kdpoints[i].clientX !== kdpoints[0].clientX || kdpoints[i].series.noSharedTooltip) { kdpoints.splice(i, 1); } } } // Refresh tooltip for kdpoint if new hover point or tooltip was hidden // #3926, #4200 if (kdpoints[0] && (kdpoints[0] !== pointer.hoverPoint || (tooltip && tooltip.isHidden))) { // Draw tooltip if necessary if (shared && !kdpoints[0].series.noSharedTooltip) { // Do mouseover on all points (#3919, #3985, #4410) for (i = 0; i >= 0; i--) { kdpoints[i].onMouseOver(e, kdpoints[i] !== ((hoverSeries && hoverSeries.directTouch && hoverPoint) || kdpoints[0])); } // Make sure that the hoverPoint and hoverSeries are stored for events (e.g. click), #5622 if (hoverSeries && hoverSeries.directTouch && hoverPoint && hoverPoint !== kdpoints[0]) { hoverPoint.onMouseOver(e, false); } if (kdpoints.length && tooltip) { // Keep the order of series in tooltip: tooltip.refresh(kdpoints.sort(function (p1, p2) { return p1.series.index - p2.series.index; }), e); } } else { if (tooltip) { tooltip.refresh(kdpoints[0], e); } if (!hoverSeries || !hoverSeries.directTouch) { // #4448 kdpoints[0].onMouseOver(e); } } pointer.prevKDPoint = kdpoints[0]; updatePosition = false; } // Update positions (regardless of kdpoint or hoverPoint) if (updatePosition) { followPointer = hoverSeries && hoverSeries.tooltipOptions.followPointer; if (tooltip && followPointer && !tooltip.isHidden) { anchor = tooltip.getAnchor([{}], e); tooltip.updatePosition({ plotX: anchor[0], plotY: anchor[1] }); } } // Start the event listener to pick up the tooltip and crosshairs if (!pointer._onDocumentMouseMove) { pointer._onDocumentMouseMove = function (e) { if (charts[hoverChartIndex]) { charts[hoverChartIndex].pointer.onDocumentMouseMove(e); } }; addEvent(doc, 'mousemove', pointer._onDocumentMouseMove); } // Crosshair. For each hover point, loop over axes and draw cross if that point // belongs to the axis (#4927). each(shared ? kdpoints : [pick(hoverPoint, kdpoints[0])], function drawPointCrosshair(point) { // #5269 each(chart.axes, function drawAxisCrosshair(axis) { // In case of snap = false, point is undefined, and we draw the crosshair anyway (#5066) if (!point || point.series && point.series[axis.coll] === axis) { // #5658 axis.drawCrosshair(e, point); } }); }); }, /** * Reset the tracking by hiding the tooltip, the hover series state and the hover point * * @param allowMove {Boolean} Instead of destroying the tooltip altogether, allow moving it if possible */ reset: function (allowMove, delay) { var pointer = this, chart = pointer.chart, hoverSeries = chart.hoverSeries, hoverPoint = chart.hoverPoint, hoverPoints = chart.hoverPoints, tooltip = chart.tooltip, tooltipPoints = tooltip && tooltip.shared ? hoverPoints : hoverPoint; // Check if the points have moved outside the plot area (#1003, #4736, #5101) if (allowMove && tooltipPoints) { each(splat(tooltipPoints), function (point) { if (point.series.isCartesian && point.plotX === undefined) { allowMove = false; } }); } // Just move the tooltip, #349 if (allowMove) { if (tooltip && tooltipPoints) { tooltip.refresh(tooltipPoints); if (hoverPoint) { // #2500 hoverPoint.setState(hoverPoint.state, true); each(chart.axes, function (axis) { if (axis.crosshair) { axis.drawCrosshair(null, hoverPoint); } }); } } // Full reset } else { if (hoverPoint) { hoverPoint.onMouseOut(); } if (hoverPoints) { each(hoverPoints, function (point) { point.setState(); }); } if (hoverSeries) { hoverSeries.onMouseOut(); } if (tooltip) { tooltip.hide(delay); } if (pointer._onDocumentMouseMove) { removeEvent(doc, 'mousemove', pointer._onDocumentMouseMove); pointer._onDocumentMouseMove = null; } // Remove crosshairs each(chart.axes, function (axis) { axis.hideCrosshair(); }); pointer.hoverX = pointer.prevKDPoint = chart.hoverPoints = chart.hoverPoint = null; } }, /** * Scale series groups to a certain scale and translation */ scaleGroups: function (attribs, clip) { var chart = this.chart, seriesAttribs; // Scale each series each(chart.series, function (series) { seriesAttribs = attribs || series.getPlotBox(); // #1701 if (series.xAxis && series.xAxis.zoomEnabled) { series.group.attr(seriesAttribs); if (series.markerGroup) { series.markerGroup.attr(seriesAttribs); series.markerGroup.clip(clip ? chart.clipRect : null); } if (series.dataLabelsGroup) { series.dataLabelsGroup.attr(seriesAttribs); } } }); // Clip chart.clipRect.attr(clip || chart.clipBox); }, /** * Start a drag operation */ dragStart: function (e) { var chart = this.chart; // Record the start position chart.mouseIsDown = e.type; chart.cancelClick = false; chart.mouseDownX = this.mouseDownX = e.chartX; chart.mouseDownY = this.mouseDownY = e.chartY; }, /** * Perform a drag operation in response to a mousemove event while the mouse is down */ drag: function (e) { var chart = this.chart, chartOptions = chart.options.chart, chartX = e.chartX, chartY = e.chartY, zoomHor = this.zoomHor, zoomVert = this.zoomVert, plotLeft = chart.plotLeft, plotTop = chart.plotTop, plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, clickedInside, size, selectionMarker = this.selectionMarker, mouseDownX = this.mouseDownX, mouseDownY = this.mouseDownY, panKey = chartOptions.panKey && e[chartOptions.panKey + 'Key']; // If the device supports both touch and mouse (like IE11), and we are touch-dragging // inside the plot area, don't handle the mouse event. #4339. if (selectionMarker && selectionMarker.touch) { return; } // If the mouse is outside the plot area, adjust to cooordinates // inside to prevent the selection marker from going outside if (chartX < plotLeft) { chartX = plotLeft; } else if (chartX > plotLeft + plotWidth) { chartX = plotLeft + plotWidth; } if (chartY < plotTop) { chartY = plotTop; } else if (chartY > plotTop + plotHeight) { chartY = plotTop + plotHeight; } // determine if the mouse has moved more than 10px this.hasDragged = Math.sqrt( Math.pow(mouseDownX - chartX, 2) + Math.pow(mouseDownY - chartY, 2) ); if (this.hasDragged > 10) { clickedInside = chart.isInsidePlot(mouseDownX - plotLeft, mouseDownY - plotTop); // make a selection if (chart.hasCartesianSeries && (this.zoomX || this.zoomY) && clickedInside && !panKey) { if (!selectionMarker) { this.selectionMarker = selectionMarker = chart.renderer.rect( plotLeft, plotTop, zoomHor ? 1 : plotWidth, zoomVert ? 1 : plotHeight, 0 ) .attr({ fill: chartOptions.selectionMarkerFill || 'rgba(69,114,167,0.25)', zIndex: 7 }) .add(); } } // adjust the width of the selection marker if (selectionMarker && zoomHor) { size = chartX - mouseDownX; selectionMarker.attr({ width: mathAbs(size), x: (size > 0 ? 0 : size) + mouseDownX }); } // adjust the height of the selection marker if (selectionMarker && zoomVert) { size = chartY - mouseDownY; selectionMarker.attr({ height: mathAbs(size), y: (size > 0 ? 0 : size) + mouseDownY }); } // panning if (clickedInside && !selectionMarker && chartOptions.panning) { chart.pan(e, chartOptions.panning); } } }, /** * On mouse up or touch end across the entire document, drop the selection. */ drop: function (e) { var pointer = this, chart = this.chart, hasPinched = this.hasPinched; if (this.selectionMarker) { var selectionData = { originalEvent: e, // #4890 xAxis: [], yAxis: [] }, selectionBox = this.selectionMarker, selectionLeft = selectionBox.attr ? selectionBox.attr('x') : selectionBox.x, selectionTop = selectionBox.attr ? selectionBox.attr('y') : selectionBox.y, selectionWidth = selectionBox.attr ? selectionBox.attr('width') : selectionBox.width, selectionHeight = selectionBox.attr ? selectionBox.attr('height') : selectionBox.height, runZoom; // a selection has been made if (this.hasDragged || hasPinched) { // record each axis' min and max each(chart.axes, function (axis) { if (axis.zoomEnabled && defined(axis.min) && (hasPinched || pointer[{ xAxis: 'zoomX', yAxis: 'zoomY' }[axis.coll]])) { // #859, #3569 var horiz = axis.horiz, minPixelPadding = e.type === 'touchend' ? axis.minPixelPadding : 0, // #1207, #3075 selectionMin = axis.toValue((horiz ? selectionLeft : selectionTop) + minPixelPadding), selectionMax = axis.toValue((horiz ? selectionLeft + selectionWidth : selectionTop + selectionHeight) - minPixelPadding); selectionData[axis.coll].push({ axis: axis, min: mathMin(selectionMin, selectionMax), // for reversed axes max: mathMax(selectionMin, selectionMax) }); runZoom = true; } }); if (runZoom) { fireEvent(chart, 'selection', selectionData, function (args) { chart.zoom(extend(args, hasPinched ? { animation: false } : null)); }); } } this.selectionMarker = this.selectionMarker.destroy(); // Reset scaling preview if (hasPinched) { this.scaleGroups(); } } // Reset all if (chart) { // it may be destroyed on mouse up - #877 css(chart.container, { cursor: chart._cursor }); chart.cancelClick = this.hasDragged > 10; // #370 chart.mouseIsDown = this.hasDragged = this.hasPinched = false; this.pinchDown = []; } }, onContainerMouseDown: function (e) { e = this.normalize(e); // issue #295, dragging not always working in Firefox if (e.preventDefault) { e.preventDefault(); } this.dragStart(e); }, onDocumentMouseUp: function (e) { if (charts[hoverChartIndex]) { charts[hoverChartIndex].pointer.drop(e); } }, /** * Special handler for mouse move that will hide the tooltip when the mouse leaves the plotarea. * Issue #149 workaround. The mouseleave event does not always fire. */ onDocumentMouseMove: function (e) { var chart = this.chart, chartPosition = this.chartPosition; e = this.normalize(e, chartPosition); // If we're outside, hide the tooltip if (chartPosition && !this.inClass(e.target, 'highcharts-tracker') && !chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) { this.reset(); } }, /** * When mouse leaves the container, hide the tooltip. */ onContainerMouseLeave: function (e) { var chart = charts[hoverChartIndex]; if (chart && (e.relatedTarget || e.toElement)) { // #4886, MS Touch end fires mouseleave but with no related target chart.pointer.reset(); chart.pointer.chartPosition = null; // also reset the chart position, used in #149 fix } }, // The mousemove, touchmove and touchstart event handler onContainerMouseMove: function (e) { var chart = this.chart; if (!defined(hoverChartIndex) || !charts[hoverChartIndex] || !charts[hoverChartIndex].mouseIsDown) { hoverChartIndex = chart.index; } e = this.normalize(e); e.returnValue = false; // #2251, #3224 if (chart.mouseIsDown === 'mousedown') { this.drag(e); } // Show the tooltip and run mouse over events (#977) if ((this.inClass(e.target, 'highcharts-tracker') || chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) && !chart.openMenu) { this.runPointActions(e); } }, /** * Utility to detect whether an element has, or has a parent with, a specific * class name. Used on detection of tracker objects and on deciding whether * hovering the tooltip should cause the active series to mouse out. */ inClass: function (element, className) { var elemClassName; while (element) { elemClassName = attr(element, 'class'); if (elemClassName) { if (elemClassName.indexOf(className) !== -1) { return true; } if (elemClassName.indexOf(PREFIX + 'container') !== -1) { return false; } } element = element.parentNode; } }, onTrackerMouseOut: function (e) { var series = this.chart.hoverSeries, relatedTarget = e.relatedTarget || e.toElement; if (series && relatedTarget && !series.options.stickyTracking && // #4886 !this.inClass(relatedTarget, PREFIX + 'tooltip') && !this.inClass(relatedTarget, PREFIX + 'series-' + series.index)) { // #2499, #4465 series.onMouseOut(); } }, onContainerClick: function (e) { var chart = this.chart, hoverPoint = chart.hoverPoint, plotLeft = chart.plotLeft, plotTop = chart.plotTop; e = this.normalize(e); if (!chart.cancelClick) { // On tracker click, fire the series and point events. #783, #1583 if (hoverPoint && this.inClass(e.target, PREFIX + 'tracker')) { // the series click event fireEvent(hoverPoint.series, 'click', extend(e, { point: hoverPoint })); // the point click event if (chart.hoverPoint) { // it may be destroyed (#1844) hoverPoint.firePointEvent('click', e); } // When clicking outside a tracker, fire a chart event } else { extend(e, this.getCoordinates(e)); // fire a click event in the chart if (chart.isInsidePlot(e.chartX - plotLeft, e.chartY - plotTop)) { fireEvent(chart, 'click', e); } } } }, /** * Set the JS DOM events on the container and document. This method should contain * a one-to-one assignment between methods and their handlers. Any advanced logic should * be moved to the handler reflecting the event's name. */ setDOMEvents: function () { var pointer = this, container = pointer.chart.container; container.onmousedown = function (e) { pointer.onContainerMouseDown(e); }; container.onmousemove = function (e) { pointer.onContainerMouseMove(e); }; container.onclick = function (e) { pointer.onContainerClick(e); }; addEvent(container, 'mouseleave', pointer.onContainerMouseLeave); if (chartCount === 1) { addEvent(doc, 'mouseup', pointer.onDocumentMouseUp); } if (hasTouch) { container.ontouchstart = function (e) { pointer.onContainerTouchStart(e); }; container.ontouchmove = function (e) { pointer.onContainerTouchMove(e); }; if (chartCount === 1) { addEvent(doc, 'touchend', pointer.onDocumentTouchEnd); } } }, /** * Destroys the Pointer object and disconnects DOM events. */ destroy: function () { var prop; removeEvent(this.chart.container, 'mouseleave', this.onContainerMouseLeave); if (!chartCount) { removeEvent(doc, 'mouseup', this.onDocumentMouseUp); removeEvent(doc, 'touchend', this.onDocumentTouchEnd); } // memory and CPU leak clearInterval(this.tooltipTimeout); for (prop in this) { this[prop] = null; } } }; /* Support for touch devices */ extend(Highcharts.Pointer.prototype, { /** * Run translation operations */ pinchTranslate: function (pinchDown, touches, transform, selectionMarker, clip, lastValidTouch) { if (this.zoomHor || this.pinchHor) { this.pinchTranslateDirection(true, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch); } if (this.zoomVert || this.pinchVert) { this.pinchTranslateDirection(false, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch); } }, /** * Run translation operations for each direction (horizontal and vertical) independently */ pinchTranslateDirection: function (horiz, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch, forcedScale) { var chart = this.chart, xy = horiz ? 'x' : 'y', XY = horiz ? 'X' : 'Y', sChartXY = 'chart' + XY, wh = horiz ? 'width' : 'height', plotLeftTop = chart['plot' + (horiz ? 'Left' : 'Top')], selectionWH, selectionXY, clipXY, scale = forcedScale || 1, inverted = chart.inverted, bounds = chart.bounds[horiz ? 'h' : 'v'], singleTouch = pinchDown.length === 1, touch0Start = pinchDown[0][sChartXY], touch0Now = touches[0][sChartXY], touch1Start = !singleTouch && pinchDown[1][sChartXY], touch1Now = !singleTouch && touches[1][sChartXY], outOfBounds, transformScale, scaleKey, setScale = function () { if (!singleTouch && mathAbs(touch0Start - touch1Start) > 20) { // Don't zoom if fingers are too close on this axis scale = forcedScale || mathAbs(touch0Now - touch1Now) / mathAbs(touch0Start - touch1Start); } clipXY = ((plotLeftTop - touch0Now) / scale) + touch0Start; selectionWH = chart['plot' + (horiz ? 'Width' : 'Height')] / scale; }; // Set the scale, first pass setScale(); selectionXY = clipXY; // the clip position (x or y) is altered if out of bounds, the selection position is not // Out of bounds if (selectionXY < bounds.min) { selectionXY = bounds.min; outOfBounds = true; } else if (selectionXY + selectionWH > bounds.max) { selectionXY = bounds.max - selectionWH; outOfBounds = true; } // Is the chart dragged off its bounds, determined by dataMin and dataMax? if (outOfBounds) { // Modify the touchNow position in order to create an elastic drag movement. This indicates // to the user that the chart is responsive but can't be dragged further. touch0Now -= 0.8 * (touch0Now - lastValidTouch[xy][0]); if (!singleTouch) { touch1Now -= 0.8 * (touch1Now - lastValidTouch[xy][1]); } // Set the scale, second pass to adapt to the modified touchNow positions setScale(); } else { lastValidTouch[xy] = [touch0Now, touch1Now]; } // Set geometry for clipping, selection and transformation if (!inverted) { clip[xy] = clipXY - plotLeftTop; clip[wh] = selectionWH; } scaleKey = inverted ? (horiz ? 'scaleY' : 'scaleX') : 'scale' + XY; transformScale = inverted ? 1 / scale : scale; selectionMarker[wh] = selectionWH; selectionMarker[xy] = selectionXY; transform[scaleKey] = scale; transform['translate' + XY] = (transformScale * plotLeftTop) + (touch0Now - (transformScale * touch0Start)); }, /** * Handle touch events with two touches */ pinch: function (e) { var self = this, chart = self.chart, pinchDown = self.pinchDown, touches = e.touches, touchesLength = touches.length, lastValidTouch = self.lastValidTouch, hasZoom = self.hasZoom, selectionMarker = self.selectionMarker, transform = {}, fireClickEvent = touchesLength === 1 && ((self.inClass(e.target, PREFIX + 'tracker') && chart.runTrackerClick) || self.runChartClick), clip = {}; // Don't initiate panning until the user has pinched. This prevents us from // blocking page scrolling as users scroll down a long page (#4210). if (touchesLength > 1) { self.initiated = true; } // On touch devices, only proceed to trigger click if a handler is defined if (hasZoom && self.initiated && !fireClickEvent) { e.preventDefault(); } // Normalize each touch map(touches, function (e) { return self.normalize(e); }); // Register the touch start position if (e.type === 'touchstart') { each(touches, function (e, i) { pinchDown[i] = { chartX: e.chartX, chartY: e.chartY }; }); lastValidTouch.x = [pinchDown[0].chartX, pinchDown[1] && pinchDown[1].chartX]; lastValidTouch.y = [pinchDown[0].chartY, pinchDown[1] && pinchDown[1].chartY]; // Identify the data bounds in pixels each(chart.axes, function (axis) { if (axis.zoomEnabled) { var bounds = chart.bounds[axis.horiz ? 'h' : 'v'], minPixelPadding = axis.minPixelPadding, min = axis.toPixels(pick(axis.options.min, axis.dataMin)), max = axis.toPixels(pick(axis.options.max, axis.dataMax)), absMin = mathMin(min, max), absMax = mathMax(min, max); // Store the bounds for use in the touchmove handler bounds.min = mathMin(axis.pos, absMin - minPixelPadding); bounds.max = mathMax(axis.pos + axis.len, absMax + minPixelPadding); } }); self.res = true; // reset on next move // Event type is touchmove, handle panning and pinching } else if (pinchDown.length) { // can be 0 when releasing, if touchend fires first // Set the marker if (!selectionMarker) { self.selectionMarker = selectionMarker = extend({ destroy: noop, touch: true }, chart.plotBox); } self.pinchTranslate(pinchDown, touches, transform, selectionMarker, clip, lastValidTouch); self.hasPinched = hasZoom; // Scale and translate the groups to provide visual feedback during pinching self.scaleGroups(transform, clip); // Optionally move the tooltip on touchmove if (!hasZoom && self.followTouchMove && touchesLength === 1) { this.runPointActions(self.normalize(e)); } else if (self.res) { self.res = false; this.reset(false, 0); } } }, /** * General touch handler shared by touchstart and touchmove. */ touch: function (e, start) { var chart = this.chart, hasMoved, pinchDown; hoverChartIndex = chart.index; if (e.touches.length === 1) { e = this.normalize(e); if (chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop) && !chart.openMenu) { // Run mouse events and display tooltip etc if (start) { this.runPointActions(e); } // Android fires touchmove events after the touchstart even if the // finger hasn't moved, or moved only a pixel or two. In iOS however, // the touchmove doesn't fire unless the finger moves more than ~4px. // So we emulate this behaviour in Android by checking how much it // moved, and cancelling on small distances. #3450. if (e.type === 'touchmove') { pinchDown = this.pinchDown; hasMoved = pinchDown[0] ? Math.sqrt( // #5266 Math.pow(pinchDown[0].chartX - e.chartX, 2) + Math.pow(pinchDown[0].chartY - e.chartY, 2) ) >= 4 : false; } if (pick(hasMoved, true)) { this.pinch(e); } } else if (start) { // Hide the tooltip on touching outside the plot area (#1203) this.reset(); } } else if (e.touches.length === 2) { this.pinch(e); } }, onContainerTouchStart: function (e) { this.touch(e, true); }, onContainerTouchMove: function (e) { this.touch(e); }, onDocumentTouchEnd: function (e) { if (charts[hoverChartIndex]) { charts[hoverChartIndex].pointer.drop(e); } } }); if (win.PointerEvent || win.MSPointerEvent) { // The touches object keeps track of the points being touched at all times var touches = {}, hasPointerEvent = !!win.PointerEvent, getWebkitTouches = function () { var key, fake = []; fake.item = function (i) { return this[i]; }; for (key in touches) { if (touches.hasOwnProperty(key)) { fake.push({ pageX: touches[key].pageX, pageY: touches[key].pageY, target: touches[key].target }); } } return fake; }, translateMSPointer = function (e, method, wktype, func) { var p; if ((e.pointerType === 'touch' || e.pointerType === e.MSPOINTER_TYPE_TOUCH) && charts[hoverChartIndex]) { func(e); p = charts[hoverChartIndex].pointer; p[method]({ type: wktype, target: e.currentTarget, preventDefault: noop, touches: getWebkitTouches() }); } }; /** * Extend the Pointer prototype with methods for each event handler and more */ extend(Pointer.prototype, { onContainerPointerDown: function (e) { translateMSPointer(e, 'onContainerTouchStart', 'touchstart', function (e) { touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY, target: e.currentTarget }; }); }, onContainerPointerMove: function (e) { translateMSPointer(e, 'onContainerTouchMove', 'touchmove', function (e) { touches[e.pointerId] = { pageX: e.pageX, pageY: e.pageY }; if (!touches[e.pointerId].target) { touches[e.pointerId].target = e.currentTarget; } }); }, onDocumentPointerUp: function (e) { translateMSPointer(e, 'onDocumentTouchEnd', 'touchend', function (e) { delete touches[e.pointerId]; }); }, /** * Add or remove the MS Pointer specific events */ batchMSEvents: function (fn) { fn(this.chart.container, hasPointerEvent ? 'pointerdown' : 'MSPointerDown', this.onContainerPointerDown); fn(this.chart.container, hasPointerEvent ? 'pointermove' : 'MSPointerMove', this.onContainerPointerMove); fn(doc, hasPointerEvent ? 'pointerup' : 'MSPointerUp', this.onDocumentPointerUp); } }); // Disable default IE actions for pinch and such on chart element wrap(Pointer.prototype, 'init', function (proceed, chart, options) { proceed.call(this, chart, options); if (this.hasZoom) { // #4014 css(chart.container, { '-ms-touch-action': NONE, 'touch-action': NONE }); } }); // Add IE specific touch events to chart wrap(Pointer.prototype, 'setDOMEvents', function (proceed) { proceed.apply(this); if (this.hasZoom || this.followTouchMove) { this.batchMSEvents(addEvent); } }); // Destroy MS events also wrap(Pointer.prototype, 'destroy', function (proceed) { this.batchMSEvents(removeEvent); proceed.call(this); }); } /** * The overview of the chart's series */ var Legend = Highcharts.Legend = function (chart, options) { this.init(chart, options); }; Legend.prototype = { /** * Initialize the legend */ init: function (chart, options) { var legend = this, itemStyle = options.itemStyle, padding, itemMarginTop = options.itemMarginTop || 0; this.options = options; if (!options.enabled) { return; } legend.itemStyle = itemStyle; legend.itemHiddenStyle = merge(itemStyle, options.itemHiddenStyle); legend.itemMarginTop = itemMarginTop; legend.padding = padding = pick(options.padding, 8); legend.initialItemX = padding; legend.initialItemY = padding - 5; // 5 is the number of pixels above the text legend.maxItemWidth = 0; legend.chart = chart; legend.itemHeight = 0; legend.symbolWidth = pick(options.symbolWidth, 16); legend.pages = []; // Render it legend.render(); // move checkboxes addEvent(legend.chart, 'endResize', function () { legend.positionCheckboxes(); }); }, /** * Set the colors for the legend item * @param {Object} item A Series or Point instance * @param {Object} visible Dimmed or colored */ colorizeItem: function (item, visible) { var legend = this, options = legend.options, legendItem = item.legendItem, legendLine = item.legendLine, legendSymbol = item.legendSymbol, hiddenColor = legend.itemHiddenStyle.color, textColor = visible ? options.itemStyle.color : hiddenColor, symbolColor = visible ? (item.legendColor || item.color || '#CCC') : hiddenColor, markerOptions = item.options && item.options.marker, symbolAttr = { fill: symbolColor }, key, val; if (legendItem) { legendItem.css({ fill: textColor, color: textColor }); // color for #1553, oldIE } if (legendLine) { legendLine.attr({ stroke: symbolColor }); } if (legendSymbol) { // Apply marker options if (markerOptions && legendSymbol.isMarker) { // #585 symbolAttr.stroke = symbolColor; markerOptions = item.convertAttribs(markerOptions); for (key in markerOptions) { val = markerOptions[key]; if (val !== UNDEFINED) { symbolAttr[key] = val; } } } legendSymbol.attr(symbolAttr); } }, /** * Position the legend item * @param {Object} item A Series or Point instance */ positionItem: function (item) { var legend = this, options = legend.options, symbolPadding = options.symbolPadding, ltr = !options.rtl, legendItemPos = item._legendItemPos, itemX = legendItemPos[0], itemY = legendItemPos[1], checkbox = item.checkbox, legendGroup = item.legendGroup; if (legendGroup && legendGroup.element) { legendGroup.translate( ltr ? itemX : legend.legendWidth - itemX - 2 * symbolPadding - 4, itemY ); } if (checkbox) { checkbox.x = itemX; checkbox.y = itemY; } }, /** * Destroy a single legend item * @param {Object} item The series or point */ destroyItem: function (item) { var checkbox = item.checkbox; // destroy SVG elements each(['legendItem', 'legendLine', 'legendSymbol', 'legendGroup'], function (key) { if (item[key]) { item[key] = item[key].destroy(); } }); if (checkbox) { discardElement(item.checkbox); } }, /** * Destroys the legend. */ destroy: function () { var legend = this, legendGroup = legend.group, box = legend.box; if (box) { legend.box = box.destroy(); } if (legendGroup) { legend.group = legendGroup.destroy(); } }, /** * Position the checkboxes after the width is determined */ positionCheckboxes: function (scrollOffset) { var alignAttr = this.group.alignAttr, translateY, clipHeight = this.clipHeight || this.legendHeight, titleHeight = this.titleHeight; if (alignAttr) { translateY = alignAttr.translateY; each(this.allItems, function (item) { var checkbox = item.checkbox, top; if (checkbox) { top = translateY + titleHeight + checkbox.y + (scrollOffset || 0) + 3; css(checkbox, { left: (alignAttr.translateX + item.checkboxOffset + checkbox.x - 20) + PX, top: top + PX, display: top > translateY - 6 && top < translateY + clipHeight - 6 ? '' : NONE }); } }); } }, /** * Render the legend title on top of the legend */ renderTitle: function () { var options = this.options, padding = this.padding, titleOptions = options.title, titleHeight = 0, bBox; if (titleOptions.text) { if (!this.title) { this.title = this.chart.renderer.label(titleOptions.text, padding - 3, padding - 4, null, null, null, null, null, 'legend-title') .attr({ zIndex: 1 }) .css(titleOptions.style) .add(this.group); } bBox = this.title.getBBox(); titleHeight = bBox.height; this.offsetWidth = bBox.width; // #1717 this.contentGroup.attr({ translateY: titleHeight }); } this.titleHeight = titleHeight; }, /** * Set the legend item text */ setText: function (item) { var options = this.options; item.legendItem.attr({ text: options.labelFormat ? format(options.labelFormat, item) : options.labelFormatter.call(item) }); }, /** * Render a single specific legend item * @param {Object} item A series or point */ renderItem: function (item) { var legend = this, chart = legend.chart, renderer = chart.renderer, options = legend.options, horizontal = options.layout === 'horizontal', symbolWidth = legend.symbolWidth, symbolPadding = options.symbolPadding, itemStyle = legend.itemStyle, itemHiddenStyle = legend.itemHiddenStyle, padding = legend.padding, itemDistance = horizontal ? pick(options.itemDistance, 20) : 0, ltr = !options.rtl, itemHeight, widthOption = options.width, itemMarginBottom = options.itemMarginBottom || 0, itemMarginTop = legend.itemMarginTop, initialItemX = legend.initialItemX, bBox, itemWidth, li = item.legendItem, series = item.series && item.series.drawLegendSymbol ? item.series : item, seriesOptions = series.options, showCheckbox = legend.createCheckboxForItem && seriesOptions && seriesOptions.showCheckbox, useHTML = options.useHTML; if (!li) { // generate it once, later move it // Generate the group box // A group to hold the symbol and text. Text is to be appended in Legend class. item.legendGroup = renderer.g('legend-item') .attr({ zIndex: 1 }) .add(legend.scrollGroup); // Generate the list item text and add it to the group item.legendItem = li = renderer.text( '', ltr ? symbolWidth + symbolPadding : -symbolPadding, legend.baseline || 0, useHTML ) .css(merge(item.visible ? itemStyle : itemHiddenStyle)) // merge to prevent modifying original (#1021) .attr({ align: ltr ? 'left' : 'right', zIndex: 2 }) .add(item.legendGroup); // Get the baseline for the first item - the font size is equal for all if (!legend.baseline) { legend.fontMetrics = renderer.fontMetrics(itemStyle.fontSize, li); legend.baseline = legend.fontMetrics.f + 3 + itemMarginTop; li.attr('y', legend.baseline); } // Draw the legend symbol inside the group box series.drawLegendSymbol(legend, item); if (legend.setItemEvents) { legend.setItemEvents(item, li, useHTML, itemStyle, itemHiddenStyle); } // add the HTML checkbox on top if (showCheckbox) { legend.createCheckboxForItem(item); } } // Colorize the items legend.colorizeItem(item, item.visible); // Always update the text legend.setText(item); // calculate the positions for the next line bBox = li.getBBox(); itemWidth = item.checkboxOffset = options.itemWidth || item.legendItemWidth || symbolWidth + symbolPadding + bBox.width + itemDistance + (showCheckbox ? 20 : 0); legend.itemHeight = itemHeight = mathRound(item.legendItemHeight || bBox.height); // if the item exceeds the width, start a new line if (horizontal && legend.itemX - initialItemX + itemWidth > (widthOption || (chart.chartWidth - 2 * padding - initialItemX - options.x))) { legend.itemX = initialItemX; legend.itemY += itemMarginTop + legend.lastLineHeight + itemMarginBottom; legend.lastLineHeight = 0; // reset for next line (#915, #3976) } // If the item exceeds the height, start a new column /*if (!horizontal && legend.itemY + options.y + itemHeight > chart.chartHeight - spacingTop - spacingBottom) { legend.itemY = legend.initialItemY; legend.itemX += legend.maxItemWidth; legend.maxItemWidth = 0; }*/ // Set the edge positions legend.maxItemWidth = mathMax(legend.maxItemWidth, itemWidth); legend.lastItemY = itemMarginTop + legend.itemY + itemMarginBottom; legend.lastLineHeight = mathMax(itemHeight, legend.lastLineHeight); // #915 // cache the position of the newly generated or reordered items item._legendItemPos = [legend.itemX, legend.itemY]; // advance if (horizontal) { legend.itemX += itemWidth; } else { legend.itemY += itemMarginTop + itemHeight + itemMarginBottom; legend.lastLineHeight = itemHeight; } // the width of the widest item legend.offsetWidth = widthOption || mathMax( (horizontal ? legend.itemX - initialItemX - itemDistance : itemWidth) + padding, legend.offsetWidth ); }, /** * Get all items, which is one item per series for normal series and one item per point * for pie series. */ getAllItems: function () { var allItems = []; each(this.chart.series, function (series) { var seriesOptions = series.options; // Handle showInLegend. If the series is linked to another series, defaults to false. if (!pick(seriesOptions.showInLegend, !defined(seriesOptions.linkedTo) ? UNDEFINED : false, true)) { return; } // use points or series for the legend item depending on legendType allItems = allItems.concat( series.legendItems || (seriesOptions.legendType === 'point' ? series.data : series) ); }); return allItems; }, /** * Adjust the chart margins by reserving space for the legend on only one side * of the chart. If the position is set to a corner, top or bottom is reserved * for horizontal legends and left or right for vertical ones. */ adjustMargins: function (margin, spacing) { var chart = this.chart, options = this.options, // Use the first letter of each alignment option in order to detect the side alignment = options.align.charAt(0) + options.verticalAlign.charAt(0) + options.layout.charAt(0); // #4189 - use charAt(x) notation instead of [x] for IE7 if (!options.floating) { each([ /(lth|ct|rth)/, /(rtv|rm|rbv)/, /(rbh|cb|lbh)/, /(lbv|lm|ltv)/ ], function (alignments, side) { if (alignments.test(alignment) && !defined(margin[side])) { // Now we have detected on which side of the chart we should reserve space for the legend chart[marginNames[side]] = mathMax( chart[marginNames[side]], chart.legend[(side + 1) % 2 ? 'legendHeight' : 'legendWidth'] + [1, -1, -1, 1][side] * options[(side % 2) ? 'x' : 'y'] + pick(options.margin, 12) + spacing[side] ); } }); } }, /** * Render the legend. This method can be called both before and after * chart.render. If called after, it will only rearrange items instead * of creating new ones. */ render: function () { var legend = this, chart = legend.chart, renderer = chart.renderer, legendGroup = legend.group, allItems, display, legendWidth, legendHeight, box = legend.box, options = legend.options, padding = legend.padding, legendBorderWidth = options.borderWidth, legendBackgroundColor = options.backgroundColor; legend.itemX = legend.initialItemX; legend.itemY = legend.initialItemY; legend.offsetWidth = 0; legend.lastItemY = 0; if (!legendGroup) { legend.group = legendGroup = renderer.g('legend') .attr({ zIndex: 7 }) .add(); legend.contentGroup = renderer.g() .attr({ zIndex: 1 }) // above background .add(legendGroup); legend.scrollGroup = renderer.g() .add(legend.contentGroup); } legend.renderTitle(); // add each series or point allItems = legend.getAllItems(); // sort by legendIndex stableSort(allItems, function (a, b) { return ((a.options && a.options.legendIndex) || 0) - ((b.options && b.options.legendIndex) || 0); }); // reversed legend if (options.reversed) { allItems.reverse(); } legend.allItems = allItems; legend.display = display = !!allItems.length; // render the items legend.lastLineHeight = 0; each(allItems, function (item) { legend.renderItem(item); }); // Get the box legendWidth = (options.width || legend.offsetWidth) + padding; legendHeight = legend.lastItemY + legend.lastLineHeight + legend.titleHeight; legendHeight = legend.handleOverflow(legendHeight); legendHeight += padding; // Draw the border and/or background if (legendBorderWidth || legendBackgroundColor) { if (!box) { legend.box = box = renderer.rect( 0, 0, legendWidth, legendHeight, options.borderRadius, legendBorderWidth || 0 ).attr({ stroke: options.borderColor, 'stroke-width': legendBorderWidth || 0, fill: legendBackgroundColor || NONE }) .add(legendGroup) .shadow(options.shadow); box.isNew = true; } else if (legendWidth > 0 && legendHeight > 0) { box[box.isNew ? 'attr' : 'animate']( box.crisp({ width: legendWidth, height: legendHeight }) ); box.isNew = false; } // hide the border if no items box[display ? 'show' : 'hide'](); } legend.legendWidth = legendWidth; legend.legendHeight = legendHeight; // Now that the legend width and height are established, put the items in the // final position each(allItems, function (item) { legend.positionItem(item); }); // 1.x compatibility: positioning based on style /*var props = ['left', 'right', 'top', 'bottom'], prop, i = 4; while (i--) { prop = props[i]; if (options.style[prop] && options.style[prop] !== 'auto') { options[i < 2 ? 'align' : 'verticalAlign'] = prop; options[i < 2 ? 'x' : 'y'] = pInt(options.style[prop]) * (i % 2 ? -1 : 1); } }*/ if (display) { legendGroup.align(extend({ width: legendWidth, height: legendHeight }, options), true, 'spacingBox'); } if (!chart.isResizing) { this.positionCheckboxes(); } }, /** * Set up the overflow handling by adding navigation with up and down arrows below the * legend. */ handleOverflow: function (legendHeight) { var legend = this, chart = this.chart, renderer = chart.renderer, options = this.options, optionsY = options.y, alignTop = options.verticalAlign === 'top', spaceHeight = chart.spacingBox.height + (alignTop ? -optionsY : optionsY) - this.padding, maxHeight = options.maxHeight, clipHeight, clipRect = this.clipRect, navOptions = options.navigation, animation = pick(navOptions.animation, true), arrowSize = navOptions.arrowSize || 12, nav = this.nav, pages = this.pages, padding = this.padding, lastY, allItems = this.allItems, clipToHeight = function (height) { clipRect.attr({ height: height }); // useHTML if (legend.contentGroup.div) { legend.contentGroup.div.style.clip = 'rect(' + padding + 'px,9999px,' + (padding + height) + 'px,0)'; } }; // Adjust the height if (options.layout === 'horizontal') { spaceHeight /= 2; } if (maxHeight) { spaceHeight = mathMin(spaceHeight, maxHeight); } // Reset the legend height and adjust the clipping rectangle pages.length = 0; if (legendHeight > spaceHeight && navOptions.enabled !== false) { this.clipHeight = clipHeight = mathMax(spaceHeight - 20 - this.titleHeight - padding, 0); this.currentPage = pick(this.currentPage, 1); this.fullHeight = legendHeight; // Fill pages with Y positions so that the top of each a legend item defines // the scroll top for each page (#2098) each(allItems, function (item, i) { var y = item._legendItemPos[1], h = mathRound(item.legendItem.getBBox().height), len = pages.length; if (!len || (y - pages[len - 1] > clipHeight && (lastY || y) !== pages[len - 1])) { pages.push(lastY || y); len++; } if (i === allItems.length - 1 && y + h - pages[len - 1] > clipHeight) { pages.push(y); } if (y !== lastY) { lastY = y; } }); // Only apply clipping if needed. Clipping causes blurred legend in PDF export (#1787) if (!clipRect) { clipRect = legend.clipRect = renderer.clipRect(0, padding, 9999, 0); legend.contentGroup.clip(clipRect); } clipToHeight(clipHeight); // Add navigation elements if (!nav) { this.nav = nav = renderer.g().attr({ zIndex: 1 }).add(this.group); this.up = renderer.symbol('triangle', 0, 0, arrowSize, arrowSize) .on('click', function () { legend.scroll(-1, animation); }) .add(nav); this.pager = renderer.text('', 15, 10) .css(navOptions.style) .add(nav); this.down = renderer.symbol('triangle-down', 0, 0, arrowSize, arrowSize) .on('click', function () { legend.scroll(1, animation); }) .add(nav); } // Set initial position legend.scroll(0); legendHeight = spaceHeight; } else if (nav) { clipToHeight(chart.chartHeight); nav.hide(); this.scrollGroup.attr({ translateY: 1 }); this.clipHeight = 0; // #1379 } return legendHeight; }, /** * Scroll the legend by a number of pages * @param {Object} scrollBy * @param {Object} animation */ scroll: function (scrollBy, animation) { var pages = this.pages, pageCount = pages.length, currentPage = this.currentPage + scrollBy, clipHeight = this.clipHeight, navOptions = this.options.navigation, activeColor = navOptions.activeColor, inactiveColor = navOptions.inactiveColor, pager = this.pager, padding = this.padding, scrollOffset; // When resizing while looking at the last page if (currentPage > pageCount) { currentPage = pageCount; } if (currentPage > 0) { if (animation !== UNDEFINED) { setAnimation(animation, this.chart); } this.nav.attr({ translateX: padding, translateY: clipHeight + this.padding + 7 + this.titleHeight, visibility: VISIBLE }); this.up.attr({ fill: currentPage === 1 ? inactiveColor : activeColor }) .css({ cursor: currentPage === 1 ? 'default' : 'pointer' }); pager.attr({ text: currentPage + '/' + pageCount }); this.down.attr({ x: 18 + this.pager.getBBox().width, // adjust to text width fill: currentPage === pageCount ? inactiveColor : activeColor }) .css({ cursor: currentPage === pageCount ? 'default' : 'pointer' }); scrollOffset = -pages[currentPage - 1] + this.initialItemY; this.scrollGroup.animate({ translateY: scrollOffset }); this.currentPage = currentPage; this.positionCheckboxes(scrollOffset); } } }; /* * LegendSymbolMixin */ var LegendSymbolMixin = Highcharts.LegendSymbolMixin = { /** * Get the series' symbol in the legend * * @param {Object} legend The legend object * @param {Object} item The series (this) or point */ drawRectangle: function (legend, item) { var symbolHeight = legend.options.symbolHeight || legend.fontMetrics.f; item.legendSymbol = this.chart.renderer.rect( 0, legend.baseline - symbolHeight + 1, // #3988 legend.symbolWidth, symbolHeight, legend.options.symbolRadius || 0 ).attr({ zIndex: 3 }).add(item.legendGroup); }, /** * Get the series' symbol in the legend. This method should be overridable to create custom * symbols through Highcharts.seriesTypes[type].prototype.drawLegendSymbols. * * @param {Object} legend The legend object */ drawLineMarker: function (legend) { var options = this.options, markerOptions = options.marker, radius, legendSymbol, symbolWidth = legend.symbolWidth, renderer = this.chart.renderer, legendItemGroup = this.legendGroup, verticalCenter = legend.baseline - mathRound(legend.fontMetrics.b * 0.3), attr; // Draw the line if (options.lineWidth) { attr = { 'stroke-width': options.lineWidth }; if (options.dashStyle) { attr.dashstyle = options.dashStyle; } this.legendLine = renderer.path([ M, 0, verticalCenter, L, symbolWidth, verticalCenter ]) .attr(attr) .add(legendItemGroup); } // Draw the marker if (markerOptions && markerOptions.enabled !== false) { radius = markerOptions.radius; this.legendSymbol = legendSymbol = renderer.symbol( this.symbol, (symbolWidth / 2) - radius, verticalCenter - radius, 2 * radius, 2 * radius, markerOptions ) .add(legendItemGroup); legendSymbol.isMarker = true; } } }; // Workaround for #2030, horizontal legend items not displaying in IE11 Preview, // and for #2580, a similar drawing flaw in Firefox 26. // Explore if there's a general cause for this. The problem may be related // to nested group elements, as the legend item texts are within 4 group elements. if (/Trident\/7\.0/.test(userAgent) || isFirefox) { wrap(Legend.prototype, 'positionItem', function (proceed, item) { var legend = this, runPositionItem = function () { // If chart destroyed in sync, this is undefined (#2030) if (item._legendItemPos) { proceed.call(legend, item); } }; // Do it now, for export and to get checkbox placement runPositionItem(); // Do it after to work around the core issue setTimeout(runPositionItem); }); } /** * The Chart class * @param {String|Object} renderTo The DOM element to render to, or its id * @param {Object} options * @param {Function} callback Function to run when the chart has loaded */ var Chart = Highcharts.Chart = function () { this.getArgs.apply(this, arguments); }; Highcharts.chart = function (a, b, c) { return new Chart(a, b, c); }; Chart.prototype = { /** * Hook for modules */ callbacks: [], /** * Handle the arguments passed to the constructor * @returns {Array} Arguments without renderTo */ getArgs: function () { var args = [].slice.call(arguments); // Remove the optional first argument, renderTo, and // set it on this. if (isString(args[0]) || args[0].nodeName) { this.renderTo = args.shift(); } this.init(args[0], args[1]); }, /** * Initialize the chart */ init: function (userOptions, callback) { // Handle regular options var options, seriesOptions = userOptions.series; // skip merging data points to increase performance userOptions.series = null; options = merge(defaultOptions, userOptions); // do the merge options.series = userOptions.series = seriesOptions; // set back the series data this.userOptions = userOptions; var optionsChart = options.chart; // Create margin & spacing array this.margin = this.splashArray('margin', optionsChart); this.spacing = this.splashArray('spacing', optionsChart); var chartEvents = optionsChart.events; //this.runChartClick = chartEvents && !!chartEvents.click; this.bounds = { h: {}, v: {} }; // Pixel data bounds for touch zoom this.callback = callback; this.isResizing = 0; this.options = options; //chartTitleOptions = UNDEFINED; //chartSubtitleOptions = UNDEFINED; this.axes = []; this.series = []; this.hasCartesianSeries = optionsChart.showAxes; //this.axisOffset = UNDEFINED; //this.maxTicks = UNDEFINED; // handle the greatest amount of ticks on grouped axes //this.inverted = UNDEFINED; //this.loadingShown = UNDEFINED; //this.container = UNDEFINED; //this.chartWidth = UNDEFINED; //this.chartHeight = UNDEFINED; //this.marginRight = UNDEFINED; //this.marginBottom = UNDEFINED; //this.containerWidth = UNDEFINED; //this.containerHeight = UNDEFINED; //this.oldChartWidth = UNDEFINED; //this.oldChartHeight = UNDEFINED; //this.renderTo = UNDEFINED; //this.renderToClone = UNDEFINED; //this.spacingBox = UNDEFINED //this.legend = UNDEFINED; // Elements //this.chartBackground = UNDEFINED; //this.plotBackground = UNDEFINED; //this.plotBGImage = UNDEFINED; //this.plotBorder = UNDEFINED; //this.loadingDiv = UNDEFINED; //this.loadingSpan = UNDEFINED; var chart = this, eventType; // Add the chart to the global lookup chart.index = charts.length; charts.push(chart); chartCount++; // Set up auto resize if (optionsChart.reflow !== false) { addEvent(chart, 'load', function () { chart.initReflow(); }); } // Chart event handlers if (chartEvents) { for (eventType in chartEvents) { addEvent(chart, eventType, chartEvents[eventType]); } } chart.xAxis = []; chart.yAxis = []; // Expose methods and variables chart.animation = useCanVG ? false : pick(optionsChart.animation, true); chart.pointCount = chart.colorCounter = chart.symbolCounter = 0; chart.firstRender(); }, /** * Initialize an individual series, called internally before render time */ initSeries: function (options) { var chart = this, optionsChart = chart.options.chart, type = options.type || optionsChart.type || optionsChart.defaultSeriesType, series, constr = seriesTypes[type]; // No such series type if (!constr) { error(17, true); } series = new constr(); series.init(this, options); return series; }, /** * Check whether a given point is within the plot area * * @param {Number} plotX Pixel x relative to the plot area * @param {Number} plotY Pixel y relative to the plot area * @param {Boolean} inverted Whether the chart is inverted */ isInsidePlot: function (plotX, plotY, inverted) { var x = inverted ? plotY : plotX, y = inverted ? plotX : plotY; return x >= 0 && x <= this.plotWidth && y >= 0 && y <= this.plotHeight; }, /** * Redraw legend, axes or series based on updated data * * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration */ redraw: function (animation) { var chart = this, axes = chart.axes, series = chart.series, pointer = chart.pointer, legend = chart.legend, redrawLegend = chart.isDirtyLegend, hasStackedSeries, hasDirtyStacks, hasCartesianSeries = chart.hasCartesianSeries, isDirtyBox = chart.isDirtyBox, seriesLength = series.length, i = seriesLength, serie, renderer = chart.renderer, isHiddenChart = renderer.isHidden(), afterRedraw = []; setAnimation(animation, chart); if (isHiddenChart) { chart.cloneRenderTo(); } // Adjust title layout (reflow multiline text) chart.layOutTitles(); // link stacked series while (i--) { serie = series[i]; if (serie.options.stacking) { hasStackedSeries = true; if (serie.isDirty) { hasDirtyStacks = true; break; } } } if (hasDirtyStacks) { // mark others as dirty i = seriesLength; while (i--) { serie = series[i]; if (serie.options.stacking) { serie.isDirty = true; } } } // Handle updated data in the series each(series, function (serie) { if (serie.isDirty) { if (serie.options.legendType === 'point') { if (serie.updateTotals) { serie.updateTotals(); } redrawLegend = true; } } if (serie.isDirtyData) { fireEvent(serie, 'updatedData'); } }); // handle added or removed series if (redrawLegend && legend.options.enabled) { // series or pie points are added or removed // draw legend graphics legend.render(); chart.isDirtyLegend = false; } // reset stacks if (hasStackedSeries) { chart.getStacks(); } if (hasCartesianSeries) { if (!chart.isResizing) { // reset maxTicks chart.maxTicks = null; // set axes scales each(axes, function (axis) { axis.updateNames(); axis.setScale(); }); } } chart.getMargins(); // #3098 if (hasCartesianSeries) { // If one axis is dirty, all axes must be redrawn (#792, #2169) each(axes, function (axis) { if (axis.isDirty) { isDirtyBox = true; } }); // redraw axes each(axes, function (axis) { // Fire 'afterSetExtremes' only if extremes are set var key = axis.min + ',' + axis.max; if (axis.extKey !== key) { // #821, #4452 axis.extKey = key; afterRedraw.push(function () { // prevent a recursive call to chart.redraw() (#1119) fireEvent(axis, 'afterSetExtremes', extend(axis.eventArgs, axis.getExtremes())); // #747, #751 delete axis.eventArgs; }); } if (isDirtyBox || hasStackedSeries) { axis.redraw(); } }); } // the plot areas size has changed if (isDirtyBox) { chart.drawChartBox(); } // redraw affected series each(series, function (serie) { if (serie.isDirty && serie.visible && (!serie.isCartesian || serie.xAxis)) { // issue #153 serie.redraw(); } }); // move tooltip or reset if (pointer) { pointer.reset(true); } // redraw if canvas renderer.draw(); // fire the event fireEvent(chart, 'redraw'); if (isHiddenChart) { chart.cloneRenderTo(true); } // Fire callbacks that are put on hold until after the redraw each(afterRedraw, function (callback) { callback.call(); }); }, /** * Get an axis, series or point object by id. * @param id {String} The id as given in the configuration options */ get: function (id) { var chart = this, axes = chart.axes, series = chart.series; var i, j, points; // search axes for (i = 0; i < axes.length; i++) { if (axes[i].options.id === id) { return axes[i]; } } // search series for (i = 0; i < series.length; i++) { if (series[i].options.id === id) { return series[i]; } } // search points for (i = 0; i < series.length; i++) { points = series[i].points || []; for (j = 0; j < points.length; j++) { if (points[j].id === id) { return points[j]; } } } return null; }, /** * Create the Axis instances based on the config options */ getAxes: function () { var chart = this, options = this.options, xAxisOptions = options.xAxis = splat(options.xAxis || {}), yAxisOptions = options.yAxis = splat(options.yAxis || {}), optionsArray; // make sure the options are arrays and add some members each(xAxisOptions, function (axis, i) { axis.index = i; axis.isX = true; }); each(yAxisOptions, function (axis, i) { axis.index = i; }); // concatenate all axis options into one array optionsArray = xAxisOptions.concat(yAxisOptions); each(optionsArray, function (axisOptions) { new Axis(chart, axisOptions); // eslint-disable-line no-new }); }, /** * Get the currently selected points from all series */ getSelectedPoints: function () { var points = []; each(this.series, function (serie) { points = points.concat(grep(serie.points || [], function (point) { return point.selected; })); }); return points; }, /** * Get the currently selected series */ getSelectedSeries: function () { return grep(this.series, function (serie) { return serie.selected; }); }, /** * Show the title and subtitle of the chart * * @param titleOptions {Object} New title options * @param subtitleOptions {Object} New subtitle options * */ setTitle: function (titleOptions, subtitleOptions, redraw) { var chart = this, options = chart.options, chartTitleOptions, chartSubtitleOptions; chartTitleOptions = options.title = merge(options.title, titleOptions); chartSubtitleOptions = options.subtitle = merge(options.subtitle, subtitleOptions); // add title and subtitle each([ ['title', titleOptions, chartTitleOptions], ['subtitle', subtitleOptions, chartSubtitleOptions] ], function (arr) { var name = arr[0], title = chart[name], titleOptions = arr[1], chartTitleOptions = arr[2]; if (title && titleOptions) { chart[name] = title = title.destroy(); // remove old } if (chartTitleOptions && chartTitleOptions.text && !title) { chart[name] = chart.renderer.text( chartTitleOptions.text, 0, 0, chartTitleOptions.useHTML ) .attr({ align: chartTitleOptions.align, 'class': PREFIX + name, zIndex: chartTitleOptions.zIndex || 4 }) .css(chartTitleOptions.style) .add(); } }); chart.layOutTitles(redraw); }, /** * Lay out the chart titles and cache the full offset height for use in getMargins */ layOutTitles: function (redraw) { var titleOffset = 0, title = this.title, subtitle = this.subtitle, options = this.options, titleOptions = options.title, subtitleOptions = options.subtitle, requiresDirtyBox, renderer = this.renderer, spacingBox = this.spacingBox; if (title) { title .css({ width: (titleOptions.width || spacingBox.width + titleOptions.widthAdjust) + PX }) .align(extend({ y: renderer.fontMetrics(titleOptions.style.fontSize, title).b - 3 }, titleOptions), false, spacingBox); if (!titleOptions.floating && !titleOptions.verticalAlign) { titleOffset = title.getBBox().height; } } if (subtitle) { subtitle .css({ width: (subtitleOptions.width || spacingBox.width + subtitleOptions.widthAdjust) + PX }) .align(extend({ y: titleOffset + (titleOptions.margin - 13) + renderer.fontMetrics(subtitleOptions.style.fontSize, title).b }, subtitleOptions), false, spacingBox); if (!subtitleOptions.floating && !subtitleOptions.verticalAlign) { titleOffset = mathCeil(titleOffset + subtitle.getBBox().height); } } requiresDirtyBox = this.titleOffset !== titleOffset; this.titleOffset = titleOffset; // used in getMargins if (!this.isDirtyBox && requiresDirtyBox) { this.isDirtyBox = requiresDirtyBox; // Redraw if necessary (#2719, #2744) if (this.hasRendered && pick(redraw, true) && this.isDirtyBox) { this.redraw(); } } }, /** * Get chart width and height according to options and container size */ getChartSize: function () { var chart = this, optionsChart = chart.options.chart, widthOption = optionsChart.width, heightOption = optionsChart.height, renderTo = chart.renderToClone || chart.renderTo; // Get inner width and height if (!defined(widthOption)) { chart.containerWidth = getStyle(renderTo, 'width'); } if (!defined(heightOption)) { chart.containerHeight = getStyle(renderTo, 'height'); } chart.chartWidth = mathMax(0, widthOption || chart.containerWidth || 600); // #1393, 1460 chart.chartHeight = mathMax(0, pick(heightOption, // the offsetHeight of an empty container is 0 in standard browsers, but 19 in IE7: chart.containerHeight > 19 ? chart.containerHeight : 400)); }, /** * Create a clone of the chart's renderTo div and place it outside the viewport to allow * size computation on chart.render and chart.redraw */ cloneRenderTo: function (revert) { var clone = this.renderToClone, container = this.container; // Destroy the clone and bring the container back to the real renderTo div if (revert) { if (clone) { while (clone.childNodes.length) { // #5231 this.renderTo.appendChild(clone.firstChild); } discardElement(clone); delete this.renderToClone; } // Set up the clone } else { if (container && container.parentNode === this.renderTo) { this.renderTo.removeChild(container); // do not clone this } this.renderToClone = clone = this.renderTo.cloneNode(0); css(clone, { position: ABSOLUTE, top: '-9999px', display: 'block' // #833 }); if (clone.style.setProperty) { // #2631 clone.style.setProperty('display', 'block', 'important'); } doc.body.appendChild(clone); if (container) { clone.appendChild(container); } } }, /** * Get the containing element, determine the size and create the inner container * div to hold the chart */ getContainer: function () { var chart = this, container, options = chart.options, optionsChart = options.chart, chartWidth, chartHeight, renderTo = chart.renderTo, indexAttrName = 'data-highcharts-chart', oldChartIndex, Ren, containerId = 'highcharts-' + idCounter++; if (!renderTo) { chart.renderTo = renderTo = optionsChart.renderTo; } if (isString(renderTo)) { chart.renderTo = renderTo = doc.getElementById(renderTo); } // Display an error if the renderTo is wrong if (!renderTo) { error(13, true); } // If the container already holds a chart, destroy it. The check for hasRendered is there // because web pages that are saved to disk from the browser, will preserve the data-highcharts-chart // attribute and the SVG contents, but not an interactive chart. So in this case, // charts[oldChartIndex] will point to the wrong chart if any (#2609). oldChartIndex = pInt(attr(renderTo, indexAttrName)); if (isNumber(oldChartIndex) && charts[oldChartIndex] && charts[oldChartIndex].hasRendered) { charts[oldChartIndex].destroy(); } // Make a reference to the chart from the div attr(renderTo, indexAttrName, chart.index); // remove previous chart renderTo.innerHTML = ''; // If the container doesn't have an offsetWidth, it has or is a child of a node // that has display:none. We need to temporarily move it out to a visible // state to determine the size, else the legend and tooltips won't render // properly. The allowClone option is used in sparklines as a micro optimization, // saving about 1-2 ms each chart. if (!optionsChart.skipClone && !renderTo.offsetWidth) { chart.cloneRenderTo(); } // get the width and height chart.getChartSize(); chartWidth = chart.chartWidth; chartHeight = chart.chartHeight; // create the inner container chart.container = container = createElement(DIV, { className: PREFIX + 'container' + (optionsChart.className ? ' ' + optionsChart.className : ''), id: containerId }, extend({ position: RELATIVE, overflow: HIDDEN, // needed for context menu (avoid scrollbars) and // content overflow in IE width: chartWidth + PX, height: chartHeight + PX, textAlign: 'left', lineHeight: 'normal', // #427 zIndex: 0, // #1072 '-webkit-tap-highlight-color': 'rgba(0,0,0,0)' }, optionsChart.style), chart.renderToClone || renderTo ); // cache the cursor (#1650) chart._cursor = container.style.cursor; // Initialize the renderer Ren = Highcharts[optionsChart.renderer] || Renderer; chart.renderer = new Ren( container, chartWidth, chartHeight, optionsChart.style, optionsChart.forExport, options.exporting && options.exporting.allowHTML ); if (useCanVG) { // If we need canvg library, extend and configure the renderer // to get the tracker for translating mouse events chart.renderer.create(chart, container, chartWidth, chartHeight); } // Add a reference to the charts index chart.renderer.chartIndex = chart.index; }, /** * Calculate margins by rendering axis labels in a preliminary position. Title, * subtitle and legend have already been rendered at this stage, but will be * moved into their final positions */ getMargins: function (skipAxes) { var chart = this, spacing = chart.spacing, margin = chart.margin, titleOffset = chart.titleOffset; chart.resetMargins(); // Adjust for title and subtitle if (titleOffset && !defined(margin[0])) { chart.plotTop = mathMax(chart.plotTop, titleOffset + chart.options.title.margin + spacing[0]); } // Adjust for legend if (chart.legend.display) { chart.legend.adjustMargins(margin, spacing); } // adjust for scroller if (chart.extraBottomMargin) { chart.marginBottom += chart.extraBottomMargin; } if (chart.extraTopMargin) { chart.plotTop += chart.extraTopMargin; } if (!skipAxes) { this.getAxisMargins(); } }, getAxisMargins: function () { var chart = this, axisOffset = chart.axisOffset = [0, 0, 0, 0], // top, right, bottom, left margin = chart.margin; // pre-render axes to get labels offset width if (chart.hasCartesianSeries) { each(chart.axes, function (axis) { if (axis.visible) { axis.getOffset(); } }); } // Add the axis offsets each(marginNames, function (m, side) { if (!defined(margin[side])) { chart[m] += axisOffset[side]; } }); chart.setChartSize(); }, /** * Resize the chart to its container if size is not explicitly set */ reflow: function (e) { var chart = this, optionsChart = chart.options.chart, renderTo = chart.renderTo, hasUserWidth = defined(optionsChart.width), width = optionsChart.width || getStyle(renderTo, 'width'), height = optionsChart.height || getStyle(renderTo, 'height'), target = e ? e.target : win; // Width and height checks for display:none. Target is doc in IE8 and Opera, // win in Firefox, Chrome and IE9. if (!hasUserWidth && !chart.isPrinting && width && height && (target === win || target === doc)) { // #1093 if (width !== chart.containerWidth || height !== chart.containerHeight) { clearTimeout(chart.reflowTimeout); // When called from window.resize, e is set, else it's called directly (#2224) chart.reflowTimeout = syncTimeout(function () { if (chart.container) { // It may have been destroyed in the meantime (#1257) chart.setSize(undefined, undefined, false); } }, e ? 100 : 0); } chart.containerWidth = width; chart.containerHeight = height; } }, /** * Add the event handlers necessary for auto resizing */ initReflow: function () { var chart = this, reflow = function (e) { chart.reflow(e); }; addEvent(win, 'resize', reflow); addEvent(chart, 'destroy', function () { removeEvent(win, 'resize', reflow); }); }, /** * Resize the chart to a given width and height * @param {Number} width * @param {Number} height * @param {Object|Boolean} animation */ setSize: function (width, height, animation) { var chart = this, renderer = chart.renderer, globalAnimation; // Handle the isResizing counter chart.isResizing += 1; // set the animation for the current process setAnimation(animation, chart); chart.oldChartHeight = chart.chartHeight; chart.oldChartWidth = chart.chartWidth; if (width !== undefined) { chart.options.chart.width = width; } if (height !== undefined) { chart.options.chart.height = height; } chart.getChartSize(); // Resize the container with the global animation applied if enabled (#2503) globalAnimation = renderer.globalAnimation; (globalAnimation ? animate : css)(chart.container, { width: chart.chartWidth + PX, height: chart.chartHeight + PX }, globalAnimation); chart.setChartSize(true); renderer.setSize(chart.chartWidth, chart.chartHeight, animation); // handle axes chart.maxTicks = null; each(chart.axes, function (axis) { axis.isDirty = true; axis.setScale(); }); // make sure non-cartesian series are also handled each(chart.series, function (serie) { serie.isDirty = true; }); chart.isDirtyLegend = true; // force legend redraw chart.isDirtyBox = true; // force redraw of plot and chart border chart.layOutTitles(); // #2857 chart.getMargins(); chart.redraw(animation); chart.oldChartHeight = null; fireEvent(chart, 'resize'); // Fire endResize and set isResizing back. If animation is disabled, fire without delay syncTimeout(function () { if (chart) { fireEvent(chart, 'endResize', null, function () { chart.isResizing -= 1; }); } }, animObject(globalAnimation).duration); }, /** * Set the public chart properties. This is done before and after the pre-render * to determine margin sizes */ setChartSize: function (skipAxes) { var chart = this, inverted = chart.inverted, renderer = chart.renderer, chartWidth = chart.chartWidth, chartHeight = chart.chartHeight, optionsChart = chart.options.chart, spacing = chart.spacing, clipOffset = chart.clipOffset, clipX, clipY, plotLeft, plotTop, plotWidth, plotHeight, plotBorderWidth; chart.plotLeft = plotLeft = mathRound(chart.plotLeft); chart.plotTop = plotTop = mathRound(chart.plotTop); chart.plotWidth = plotWidth = mathMax(0, mathRound(chartWidth - plotLeft - chart.marginRight)); chart.plotHeight = plotHeight = mathMax(0, mathRound(chartHeight - plotTop - chart.marginBottom)); chart.plotSizeX = inverted ? plotHeight : plotWidth; chart.plotSizeY = inverted ? plotWidth : plotHeight; chart.plotBorderWidth = optionsChart.plotBorderWidth || 0; // Set boxes used for alignment chart.spacingBox = renderer.spacingBox = { x: spacing[3], y: spacing[0], width: chartWidth - spacing[3] - spacing[1], height: chartHeight - spacing[0] - spacing[2] }; chart.plotBox = renderer.plotBox = { x: plotLeft, y: plotTop, width: plotWidth, height: plotHeight }; plotBorderWidth = 2 * mathFloor(chart.plotBorderWidth / 2); clipX = mathCeil(mathMax(plotBorderWidth, clipOffset[3]) / 2); clipY = mathCeil(mathMax(plotBorderWidth, clipOffset[0]) / 2); chart.clipBox = { x: clipX, y: clipY, width: mathFloor(chart.plotSizeX - mathMax(plotBorderWidth, clipOffset[1]) / 2 - clipX), height: mathMax(0, mathFloor(chart.plotSizeY - mathMax(plotBorderWidth, clipOffset[2]) / 2 - clipY)) }; if (!skipAxes) { each(chart.axes, function (axis) { axis.setAxisSize(); axis.setAxisTranslation(); }); } }, /** * Initial margins before auto size margins are applied */ resetMargins: function () { var chart = this; each(marginNames, function (m, side) { chart[m] = pick(chart.margin[side], chart.spacing[side]); }); chart.axisOffset = [0, 0, 0, 0]; // top, right, bottom, left chart.clipOffset = [0, 0, 0, 0]; }, /** * Draw the borders and backgrounds for chart and plot area */ drawChartBox: function () { var chart = this, optionsChart = chart.options.chart, renderer = chart.renderer, chartWidth = chart.chartWidth, chartHeight = chart.chartHeight, chartBackground = chart.chartBackground, plotBackground = chart.plotBackground, plotBorder = chart.plotBorder, plotBGImage = chart.plotBGImage, chartBorderWidth = optionsChart.borderWidth || 0, chartBackgroundColor = optionsChart.backgroundColor, plotBackgroundColor = optionsChart.plotBackgroundColor, plotBackgroundImage = optionsChart.plotBackgroundImage, plotBorderWidth = optionsChart.plotBorderWidth || 0, mgn, bgAttr, plotLeft = chart.plotLeft, plotTop = chart.plotTop, plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, plotBox = chart.plotBox, clipRect = chart.clipRect, clipBox = chart.clipBox; // Chart area mgn = chartBorderWidth + (optionsChart.shadow ? 8 : 0); if (chartBorderWidth || chartBackgroundColor) { if (!chartBackground) { bgAttr = { fill: chartBackgroundColor || NONE }; if (chartBorderWidth) { // #980 bgAttr.stroke = optionsChart.borderColor; bgAttr['stroke-width'] = chartBorderWidth; } chart.chartBackground = renderer.rect(mgn / 2, mgn / 2, chartWidth - mgn, chartHeight - mgn, optionsChart.borderRadius, chartBorderWidth) .attr(bgAttr) .addClass(PREFIX + 'background') .add() .shadow(optionsChart.shadow); } else { // resize chartBackground.animate( chartBackground.crisp({ width: chartWidth - mgn, height: chartHeight - mgn }) ); } } // Plot background if (plotBackgroundColor) { if (!plotBackground) { chart.plotBackground = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0) .attr({ fill: plotBackgroundColor }) .add() .shadow(optionsChart.plotShadow); } else { plotBackground.animate(plotBox); } } if (plotBackgroundImage) { if (!plotBGImage) { chart.plotBGImage = renderer.image(plotBackgroundImage, plotLeft, plotTop, plotWidth, plotHeight) .add(); } else { plotBGImage.animate(plotBox); } } // Plot clip if (!clipRect) { chart.clipRect = renderer.clipRect(clipBox); } else { clipRect.animate({ width: clipBox.width, height: clipBox.height }); } // Plot area border if (plotBorderWidth) { if (!plotBorder) { chart.plotBorder = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0, -plotBorderWidth) .attr({ stroke: optionsChart.plotBorderColor, 'stroke-width': plotBorderWidth, fill: NONE, zIndex: 1 }) .add(); } else { plotBorder.strokeWidth = -plotBorderWidth; plotBorder.animate( plotBorder.crisp({ x: plotLeft, y: plotTop, width: plotWidth, height: plotHeight }) //#3282 plotBorder should be negative ); } } // reset chart.isDirtyBox = false; }, /** * Detect whether a certain chart property is needed based on inspecting its options * and series. This mainly applies to the chart.invert property, and in extensions to * the chart.angular and chart.polar properties. */ propFromSeries: function () { var chart = this, optionsChart = chart.options.chart, klass, seriesOptions = chart.options.series, i, value; each(['inverted', 'angular', 'polar'], function (key) { // The default series type's class klass = seriesTypes[optionsChart.type || optionsChart.defaultSeriesType]; // Get the value from available chart-wide properties value = ( chart[key] || // 1. it is set before optionsChart[key] || // 2. it is set in the options (klass && klass.prototype[key]) // 3. it's default series class requires it ); // 4. Check if any the chart's series require it i = seriesOptions && seriesOptions.length; while (!value && i--) { klass = seriesTypes[seriesOptions[i].type]; if (klass && klass.prototype[key]) { value = true; } } // Set the chart property chart[key] = value; }); }, /** * Link two or more series together. This is done initially from Chart.render, * and after Chart.addSeries and Series.remove. */ linkSeries: function () { var chart = this, chartSeries = chart.series; // Reset links each(chartSeries, function (series) { series.linkedSeries.length = 0; }); // Apply new links each(chartSeries, function (series) { var linkedTo = series.options.linkedTo; if (isString(linkedTo)) { if (linkedTo === ':previous') { linkedTo = chart.series[series.index - 1]; } else { linkedTo = chart.get(linkedTo); } if (linkedTo && linkedTo.linkedParent !== series) { // #3341 avoid mutual linking linkedTo.linkedSeries.push(series); series.linkedParent = linkedTo; series.visible = pick(series.options.visible, linkedTo.options.visible, series.visible); // #3879 } } }); }, /** * Render series for the chart */ renderSeries: function () { each(this.series, function (serie) { serie.translate(); serie.render(); }); }, /** * Render labels for the chart */ renderLabels: function () { var chart = this, labels = chart.options.labels; if (labels.items) { each(labels.items, function (label) { var style = extend(labels.style, label.style), x = pInt(style.left) + chart.plotLeft, y = pInt(style.top) + chart.plotTop + 12; // delete to prevent rewriting in IE delete style.left; delete style.top; chart.renderer.text( label.html, x, y ) .attr({ zIndex: 2 }) .css(style) .add(); }); } }, /** * Render all graphics for the chart */ render: function () { var chart = this, axes = chart.axes, renderer = chart.renderer, options = chart.options, tempWidth, tempHeight, redoHorizontal, redoVertical; // Title chart.setTitle(); // Legend chart.legend = new Legend(chart, options.legend); // Get stacks if (chart.getStacks) { chart.getStacks(); } // Get chart margins chart.getMargins(true); chart.setChartSize(); // Record preliminary dimensions for later comparison tempWidth = chart.plotWidth; tempHeight = chart.plotHeight = chart.plotHeight - 21; // 21 is the most common correction for X axis labels // Get margins by pre-rendering axes each(axes, function (axis) { axis.setScale(); }); chart.getAxisMargins(); // If the plot area size has changed significantly, calculate tick positions again redoHorizontal = tempWidth / chart.plotWidth > 1.1; redoVertical = tempHeight / chart.plotHeight > 1.05; // Height is more sensitive if (redoHorizontal || redoVertical) { chart.maxTicks = null; // reset for second pass each(axes, function (axis) { if ((axis.horiz && redoHorizontal) || (!axis.horiz && redoVertical)) { axis.setTickInterval(true); // update to reflect the new margins } }); chart.getMargins(); // second pass to check for new labels } // Draw the borders and backgrounds chart.drawChartBox(); // Axes if (chart.hasCartesianSeries) { each(axes, function (axis) { if (axis.visible) { axis.render(); } }); } // The series if (!chart.seriesGroup) { chart.seriesGroup = renderer.g('series-group') .attr({ zIndex: 3 }) .add(); } chart.renderSeries(); // Labels chart.renderLabels(); // Credits chart.showCredits(options.credits); // Set flag chart.hasRendered = true; }, /** * Show chart credits based on config options */ showCredits: function (credits) { if (credits.enabled && !this.credits) { this.credits = this.renderer.text( credits.text, 0, 0 ) .on('click', function () { if (credits.href) { win.location.href = credits.href; } }) .attr({ align: credits.position.align, zIndex: 8 }) .css(credits.style) .add() .align(credits.position); } }, /** * Clean up memory usage */ destroy: function () { var chart = this, axes = chart.axes, series = chart.series, container = chart.container, i, parentNode = container && container.parentNode; // fire the chart.destoy event fireEvent(chart, 'destroy'); // Delete the chart from charts lookup array charts[chart.index] = UNDEFINED; chartCount--; chart.renderTo.removeAttribute('data-highcharts-chart'); // remove events removeEvent(chart); // ==== Destroy collections: // Destroy axes i = axes.length; while (i--) { axes[i] = axes[i].destroy(); } // Destroy each series i = series.length; while (i--) { series[i] = series[i].destroy(); } // ==== Destroy chart properties: each(['title', 'subtitle', 'chartBackground', 'plotBackground', 'plotBGImage', 'plotBorder', 'seriesGroup', 'clipRect', 'credits', 'pointer', 'scroller', 'rangeSelector', 'legend', 'resetZoomButton', 'tooltip', 'renderer'], function (name) { var prop = chart[name]; if (prop && prop.destroy) { chart[name] = prop.destroy(); } }); // remove container and all SVG if (container) { // can break in IE when destroyed before finished loading container.innerHTML = ''; removeEvent(container); if (parentNode) { discardElement(container); } } // clean it all up for (i in chart) { delete chart[i]; } }, /** * VML namespaces can't be added until after complete. Listening * for Perini's doScroll hack is not enough. */ isReadyToRender: function () { var chart = this; // Note: win == win.top is required if ((!hasSVG && (win == win.top && doc.readyState !== 'complete')) || (useCanVG && !win.canvg)) { // eslint-disable-line eqeqeq if (useCanVG) { // Delay rendering until canvg library is downloaded and ready CanVGController.push(function () { chart.firstRender(); }, chart.options.global.canvasToolsURL); } else { doc.attachEvent('onreadystatechange', function () { doc.detachEvent('onreadystatechange', chart.firstRender); if (doc.readyState === 'complete') { chart.firstRender(); } }); } return false; } return true; }, /** * Prepare for first rendering after all data are loaded */ firstRender: function () { var chart = this, options = chart.options; // Check whether the chart is ready to render if (!chart.isReadyToRender()) { return; } // Create the container chart.getContainer(); // Run an early event after the container and renderer are established fireEvent(chart, 'init'); chart.resetMargins(); chart.setChartSize(); // Set the common chart properties (mainly invert) from the given series chart.propFromSeries(); // get axes chart.getAxes(); // Initialize the series each(options.series || [], function (serieOptions) { chart.initSeries(serieOptions); }); chart.linkSeries(); // Run an event after axes and series are initialized, but before render. At this stage, // the series data is indexed and cached in the xData and yData arrays, so we can access // those before rendering. Used in Highstock. fireEvent(chart, 'beforeRender'); // depends on inverted and on margins being set if (Highcharts.Pointer) { chart.pointer = new Pointer(chart, options); } chart.render(); // add canvas chart.renderer.draw(); // Fire the load event if there are no external images if (!chart.renderer.imgCount && chart.onload) { chart.onload(); } // If the chart was rendered outside the top container, put it back in (#3679) chart.cloneRenderTo(true); }, /** * On chart load */ onload: function () { var chart = this; // Run callbacks each([this.callback].concat(this.callbacks), function (fn) { if (fn && chart.index !== undefined) { // Chart destroyed in its own callback (#3600) fn.apply(chart, [chart]); } }); fireEvent(chart, 'load'); // Don't run again this.onload = null; }, /** * Creates arrays for spacing and margin from given options. */ splashArray: function (target, options) { var oVar = options[target], tArray = isObject(oVar) ? oVar : [oVar, oVar, oVar, oVar]; return [pick(options[target + 'Top'], tArray[0]), pick(options[target + 'Right'], tArray[1]), pick(options[target + 'Bottom'], tArray[2]), pick(options[target + 'Left'], tArray[3])]; } }; // end Chart var CenteredSeriesMixin = Highcharts.CenteredSeriesMixin = { /** * Get the center of the pie based on the size and center options relative to the * plot area. Borrowed by the polar and gauge series types. */ getCenter: function () { var options = this.options, chart = this.chart, slicingRoom = 2 * (options.slicedOffset || 0), handleSlicingRoom, plotWidth = chart.plotWidth - 2 * slicingRoom, plotHeight = chart.plotHeight - 2 * slicingRoom, centerOption = options.center, positions = [pick(centerOption[0], '50%'), pick(centerOption[1], '50%'), options.size || '100%', options.innerSize || 0], smallestSize = mathMin(plotWidth, plotHeight), i, value; for (i = 0; i < 4; ++i) { value = positions[i]; handleSlicingRoom = i < 2 || (i === 2 && /%$/.test(value)); // i == 0: centerX, relative to width // i == 1: centerY, relative to height // i == 2: size, relative to smallestSize // i == 3: innerSize, relative to size positions[i] = relativeLength(value, [plotWidth, plotHeight, smallestSize, positions[2]][i]) + (handleSlicingRoom ? slicingRoom : 0); } // innerSize cannot be larger than size (#3632) if (positions[3] > positions[2]) { positions[3] = positions[2]; } return positions; } }; /** * The Point object and prototype. Inheritable and used as base for PiePoint */ var Point = function () {}; Point.prototype = { /** * Initialize the point * @param {Object} series The series object containing this point * @param {Object} options The data in either number, array or object format */ init: function (series, options, x) { var point = this, colors; point.series = series; point.color = series.color; // #3445 point.applyOptions(options, x); point.pointAttr = {}; if (series.options.colorByPoint) { colors = series.options.colors || series.chart.options.colors; point.color = point.color || colors[series.colorCounter++]; // loop back to zero if (series.colorCounter === colors.length) { series.colorCounter = 0; } } series.chart.pointCount++; return point; }, /** * Apply the options containing the x and y data and possible some extra properties. * This is called on point init or from point.update. * * @param {Object} options */ applyOptions: function (options, x) { var point = this, series = point.series, pointValKey = series.options.pointValKey || series.pointValKey; options = Point.prototype.optionsToObject.call(this, options); // copy options directly to point extend(point, options); point.options = point.options ? extend(point.options, options) : options; // Since options are copied into the Point instance, some accidental options must be shielded (#5681) if (options.group) { delete point.group; } // For higher dimension series types. For instance, for ranges, point.y is mapped to point.low. if (pointValKey) { point.y = point[pointValKey]; } point.isNull = pick( point.isValid && !point.isValid(), point.x === null || !isNumber(point.y, true) ); // #3571, check for NaN // If no x is set by now, get auto incremented value. All points must have an // x value, however the y value can be null to create a gap in the series if ('name' in point && x === undefined && series.xAxis && series.xAxis.hasNames) { point.x = series.xAxis.nameToX(point); } if (point.x === undefined && series) { if (x === undefined) { point.x = series.autoIncrement(point); } else { point.x = x; } } return point; }, /** * Transform number or array configs into objects */ optionsToObject: function (options) { var ret = {}, series = this.series, keys = series.options.keys, pointArrayMap = keys || series.pointArrayMap || ['y'], valueCount = pointArrayMap.length, firstItemType, i = 0, j = 0; if (isNumber(options) || options === null) { ret[pointArrayMap[0]] = options; } else if (isArray(options)) { // with leading x value if (!keys && options.length > valueCount) { firstItemType = typeof options[0]; if (firstItemType === 'string') { ret.name = options[0]; } else if (firstItemType === 'number') { ret.x = options[0]; } i++; } while (j < valueCount) { if (!keys || options[i] !== undefined) { // Skip undefined positions for keys ret[pointArrayMap[j]] = options[i]; } i++; j++; } } else if (typeof options === 'object') { ret = options; // This is the fastest way to detect if there are individual point dataLabels that need // to be considered in drawDataLabels. These can only occur in object configs. if (options.dataLabels) { series._hasPointLabels = true; } // Same approach as above for markers if (options.marker) { series._hasPointMarkers = true; } } return ret; }, /** * Destroy a point to clear memory. Its reference still stays in series.data. */ destroy: function () { var point = this, series = point.series, chart = series.chart, hoverPoints = chart.hoverPoints, prop; chart.pointCount--; if (hoverPoints) { point.setState(); erase(hoverPoints, point); if (!hoverPoints.length) { chart.hoverPoints = null; } } if (point === chart.hoverPoint) { point.onMouseOut(); } // remove all events if (point.graphic || point.dataLabel) { // removeEvent and destroyElements are performance expensive removeEvent(point); point.destroyElements(); } if (point.legendItem) { // pies have legend items chart.legend.destroyItem(point); } for (prop in point) { point[prop] = null; } }, /** * Destroy SVG elements associated with the point */ destroyElements: function () { var point = this, props = ['graphic', 'dataLabel', 'dataLabelUpper', 'connector', 'shadowGroup'], prop, i = 6; while (i--) { prop = props[i]; if (point[prop]) { point[prop] = point[prop].destroy(); } } }, /** * Return the configuration hash needed for the data label and tooltip formatters */ getLabelConfig: function () { return { x: this.category, y: this.y, color: this.color, key: this.name || this.category, series: this.series, point: this, percentage: this.percentage, total: this.total || this.stackTotal }; }, /** * Extendable method for formatting each point's tooltip line * * @return {String} A string to be concatenated in to the common tooltip text */ tooltipFormatter: function (pointFormat) { // Insert options for valueDecimals, valuePrefix, and valueSuffix var series = this.series, seriesTooltipOptions = series.tooltipOptions, valueDecimals = pick(seriesTooltipOptions.valueDecimals, ''), valuePrefix = seriesTooltipOptions.valuePrefix || '', valueSuffix = seriesTooltipOptions.valueSuffix || ''; // Loop over the point array map and replace unformatted values with sprintf formatting markup each(series.pointArrayMap || ['y'], function (key) { key = '{point.' + key; // without the closing bracket if (valuePrefix || valueSuffix) { pointFormat = pointFormat.replace(key + '}', valuePrefix + key + '}' + valueSuffix); } pointFormat = pointFormat.replace(key + '}', key + ':,.' + valueDecimals + 'f}'); }); return format(pointFormat, { point: this, series: this.series }); }, /** * Fire an event on the Point object. * @param {String} eventType * @param {Object} eventArgs Additional event arguments * @param {Function} defaultFunction Default event handler */ firePointEvent: function (eventType, eventArgs, defaultFunction) { var point = this, series = this.series, seriesOptions = series.options; // load event handlers on demand to save time on mouseover/out if (seriesOptions.point.events[eventType] || (point.options && point.options.events && point.options.events[eventType])) { this.importEvents(); } // add default handler if in selection mode if (eventType === 'click' && seriesOptions.allowPointSelect) { defaultFunction = function (event) { // Control key is for Windows, meta (= Cmd key) for Mac, Shift for Opera if (point.select) { // Could be destroyed by prior event handlers (#2911) point.select(null, event.ctrlKey || event.metaKey || event.shiftKey); } }; } fireEvent(this, eventType, eventArgs, defaultFunction); }, visible: true }; /** * @classDescription The base function which all other series types inherit from. The data in the series is stored * in various arrays. * * - First, series.options.data contains all the original config options for * each point whether added by options or methods like series.addPoint. * - Next, series.data contains those values converted to points, but in case the series data length * exceeds the cropThreshold, or if the data is grouped, series.data doesn't contain all the points. It * only contains the points that have been created on demand. * - Then there's series.points that contains all currently visible point objects. In case of cropping, * the cropped-away points are not part of this array. The series.points array starts at series.cropStart * compared to series.data and series.options.data. If however the series data is grouped, these can't * be correlated one to one. * - series.xData and series.processedXData contain clean x values, equivalent to series.data and series.points. * - series.yData and series.processedYData contain clean x values, equivalent to series.data and series.points. * * @param {Object} chart * @param {Object} options */ var Series = Highcharts.Series = function () {}; Series.prototype = { isCartesian: true, type: 'line', pointClass: Point, sorted: true, // requires the data to be sorted requireSorting: true, pointAttrToOptions: { // mapping between SVG attributes and the corresponding options stroke: 'lineColor', 'stroke-width': 'lineWidth', fill: 'fillColor', r: 'radius' }, directTouch: false, axisTypes: ['xAxis', 'yAxis'], colorCounter: 0, parallelArrays: ['x', 'y'], // each point's x and y values are stored in this.xData and this.yData init: function (chart, options) { var series = this, eventType, events, chartSeries = chart.series, sortByIndex = function (a, b) { return pick(a.options.index, a._i) - pick(b.options.index, b._i); }; series.chart = chart; series.options = options = series.setOptions(options); // merge with plotOptions series.linkedSeries = []; // bind the axes series.bindAxes(); // set some variables extend(series, { name: options.name, state: NORMAL_STATE, pointAttr: {}, visible: options.visible !== false, // true by default selected: options.selected === true // false by default }); // special if (useCanVG) { options.animation = false; } // register event listeners events = options.events; for (eventType in events) { addEvent(series, eventType, events[eventType]); } if ( (events && events.click) || (options.point && options.point.events && options.point.events.click) || options.allowPointSelect ) { chart.runTrackerClick = true; } series.getColor(); series.getSymbol(); // Set the data each(series.parallelArrays, function (key) { series[key + 'Data'] = []; }); series.setData(options.data, false); // Mark cartesian if (series.isCartesian) { chart.hasCartesianSeries = true; } // Register it in the chart chartSeries.push(series); series._i = chartSeries.length - 1; // Sort series according to index option (#248, #1123, #2456) stableSort(chartSeries, sortByIndex); if (this.yAxis) { stableSort(this.yAxis.series, sortByIndex); } each(chartSeries, function (series, i) { series.index = i; series.name = series.name || 'Series ' + (i + 1); }); }, /** * Set the xAxis and yAxis properties of cartesian series, and register the series * in the axis.series array */ bindAxes: function () { var series = this, seriesOptions = series.options, chart = series.chart, axisOptions; each(series.axisTypes || [], function (AXIS) { // repeat for xAxis and yAxis each(chart[AXIS], function (axis) { // loop through the chart's axis objects axisOptions = axis.options; // apply if the series xAxis or yAxis option mathches the number of the // axis, or if undefined, use the first axis if ((seriesOptions[AXIS] === axisOptions.index) || (seriesOptions[AXIS] !== UNDEFINED && seriesOptions[AXIS] === axisOptions.id) || (seriesOptions[AXIS] === UNDEFINED && axisOptions.index === 0)) { // register this series in the axis.series lookup axis.series.push(series); // set this series.xAxis or series.yAxis reference series[AXIS] = axis; // mark dirty for redraw axis.isDirty = true; } }); // The series needs an X and an Y axis if (!series[AXIS] && series.optionalAxis !== AXIS) { error(18, true); } }); }, /** * For simple series types like line and column, the data values are held in arrays like * xData and yData for quick lookup to find extremes and more. For multidimensional series * like bubble and map, this can be extended with arrays like zData and valueData by * adding to the series.parallelArrays array. */ updateParallelArrays: function (point, i) { var series = point.series, args = arguments, fn = isNumber(i) ? // Insert the value in the given position function (key) { var val = key === 'y' && series.toYData ? series.toYData(point) : point[key]; series[key + 'Data'][i] = val; } : // Apply the method specified in i with the following arguments as arguments function (key) { Array.prototype[i].apply(series[key + 'Data'], Array.prototype.slice.call(args, 2)); }; each(series.parallelArrays, fn); }, /** * Return an auto incremented x value based on the pointStart and pointInterval options. * This is only used if an x value is not given for the point that calls autoIncrement. */ autoIncrement: function () { var options = this.options, xIncrement = this.xIncrement, date, pointInterval, pointIntervalUnit = options.pointIntervalUnit; xIncrement = pick(xIncrement, options.pointStart, 0); this.pointInterval = pointInterval = pick(this.pointInterval, options.pointInterval, 1); // Added code for pointInterval strings if (pointIntervalUnit) { date = new Date(xIncrement); if (pointIntervalUnit === 'day') { date = +date[setDate](date[getDate]() + pointInterval); } else if (pointIntervalUnit === 'month') { date = +date[setMonth](date[getMonth]() + pointInterval); } else if (pointIntervalUnit === 'year') { date = +date[setFullYear](date[getFullYear]() + pointInterval); } pointInterval = date - xIncrement; } this.xIncrement = xIncrement + pointInterval; return xIncrement; }, /** * Set the series options by merging from the options tree * @param {Object} itemOptions */ setOptions: function (itemOptions) { var chart = this.chart, chartOptions = chart.options, plotOptions = chartOptions.plotOptions, userOptions = chart.userOptions || {}, userPlotOptions = userOptions.plotOptions || {}, typeOptions = plotOptions[this.type], options, zones; this.userOptions = itemOptions; // General series options take precedence over type options because otherwise, default // type options like column.animation would be overwritten by the general option. // But issues have been raised here (#3881), and the solution may be to distinguish // between default option and userOptions like in the tooltip below. options = merge( typeOptions, plotOptions.series, itemOptions ); // The tooltip options are merged between global and series specific options this.tooltipOptions = merge( defaultOptions.tooltip, defaultOptions.plotOptions[this.type].tooltip, userOptions.tooltip, userPlotOptions.series && userPlotOptions.series.tooltip, userPlotOptions[this.type] && userPlotOptions[this.type].tooltip, itemOptions.tooltip ); // Delete marker object if not allowed (#1125) if (typeOptions.marker === null) { delete options.marker; } // Handle color zones this.zoneAxis = options.zoneAxis; zones = this.zones = (options.zones || []).slice(); if ((options.negativeColor || options.negativeFillColor) && !options.zones) { zones.push({ value: options[this.zoneAxis + 'Threshold'] || options.threshold || 0, color: options.negativeColor, fillColor: options.negativeFillColor }); } if (zones.length) { // Push one extra zone for the rest if (defined(zones[zones.length - 1].value)) { zones.push({ color: this.color, fillColor: this.fillColor }); } } return options; }, getCyclic: function (prop, value, defaults) { var i, userOptions = this.userOptions, indexName = '_' + prop + 'Index', counterName = prop + 'Counter'; if (!value) { if (defined(userOptions[indexName])) { // after Series.update() i = userOptions[indexName]; } else { userOptions[indexName] = i = this.chart[counterName] % defaults.length; this.chart[counterName] += 1; } value = defaults[i]; } this[prop] = value; }, /** * Get the series' color */ getColor: function () { if (this.options.colorByPoint) { this.options.color = null; // #4359, selected slice got series.color even when colorByPoint was set. } else { this.getCyclic('color', this.options.color || defaultPlotOptions[this.type].color, this.chart.options.colors); } }, /** * Get the series' symbol */ getSymbol: function () { var seriesMarkerOption = this.options.marker; this.getCyclic('symbol', seriesMarkerOption.symbol, this.chart.options.symbols); // don't substract radius in image symbols (#604) if (/^url/.test(this.symbol)) { seriesMarkerOption.radius = 0; } }, drawLegendSymbol: LegendSymbolMixin.drawLineMarker, /** * Replace the series data with a new set of data * @param {Object} data * @param {Object} redraw */ setData: function (data, redraw, animation, updatePoints) { var series = this, oldData = series.points, oldDataLength = (oldData && oldData.length) || 0, dataLength, options = series.options, chart = series.chart, firstPoint = null, xAxis = series.xAxis, i, turboThreshold = options.turboThreshold, pt, xData = this.xData, yData = this.yData, pointArrayMap = series.pointArrayMap, valueCount = pointArrayMap && pointArrayMap.length; data = data || []; dataLength = data.length; redraw = pick(redraw, true); // If the point count is the same as is was, just run Point.update which is // cheaper, allows animation, and keeps references to points. if (updatePoints !== false && dataLength && oldDataLength === dataLength && !series.cropped && !series.hasGroupedData && series.visible) { each(data, function (point, i) { // .update doesn't exist on a linked, hidden series (#3709) if (oldData[i].update && point !== options.data[i]) { oldData[i].update(point, false, null, false); } }); } else { // Reset properties series.xIncrement = null; series.colorCounter = 0; // for series with colorByPoint (#1547) // Update parallel arrays each(this.parallelArrays, function (key) { series[key + 'Data'].length = 0; }); // In turbo mode, only one- or twodimensional arrays of numbers are allowed. The // first value is tested, and we assume that all the rest are defined the same // way. Although the 'for' loops are similar, they are repeated inside each // if-else conditional for max performance. if (turboThreshold && dataLength > turboThreshold) { // find the first non-null point i = 0; while (firstPoint === null && i < dataLength) { firstPoint = data[i]; i++; } if (isNumber(firstPoint)) { // assume all points are numbers for (i = 0; i < dataLength; i++) { xData[i] = this.autoIncrement(); yData[i] = data[i]; } } else if (isArray(firstPoint)) { // assume all points are arrays if (valueCount) { // [x, low, high] or [x, o, h, l, c] for (i = 0; i < dataLength; i++) { pt = data[i]; xData[i] = pt[0]; yData[i] = pt.slice(1, valueCount + 1); } } else { // [x, y] for (i = 0; i < dataLength; i++) { pt = data[i]; xData[i] = pt[0]; yData[i] = pt[1]; } } } else { error(12); // Highcharts expects configs to be numbers or arrays in turbo mode } } else { for (i = 0; i < dataLength; i++) { if (data[i] !== UNDEFINED) { // stray commas in oldIE pt = { series: series }; series.pointClass.prototype.applyOptions.apply(pt, [data[i]]); series.updateParallelArrays(pt, i); } } } // Forgetting to cast strings to numbers is a common caveat when handling CSV or JSON if (isString(yData[0])) { error(14, true); } series.data = []; series.options.data = series.userOptions.data = data; // destroy old points i = oldDataLength; while (i--) { if (oldData[i] && oldData[i].destroy) { oldData[i].destroy(); } } // reset minRange (#878) if (xAxis) { xAxis.minRange = xAxis.userMinRange; } // redraw series.isDirty = series.isDirtyData = chart.isDirtyBox = true; animation = false; } // Typically for pie series, points need to be processed and generated // prior to rendering the legend if (options.legendType === 'point') { this.processData(); this.generatePoints(); } if (redraw) { chart.redraw(animation); } }, /** * Process the data by cropping away unused data points if the series is longer * than the crop threshold. This saves computing time for lage series. */ processData: function (force) { var series = this, processedXData = series.xData, // copied during slice operation below processedYData = series.yData, dataLength = processedXData.length, croppedData, cropStart = 0, cropped, distance, closestPointRange, xAxis = series.xAxis, i, // loop variable options = series.options, cropThreshold = options.cropThreshold, getExtremesFromAll = series.getExtremesFromAll || options.getExtremesFromAll, // #4599 isCartesian = series.isCartesian, xExtremes, val2lin = xAxis && xAxis.val2lin, isLog = xAxis && xAxis.isLog, min, max; // If the series data or axes haven't changed, don't go through this. Return false to pass // the message on to override methods like in data grouping. if (isCartesian && !series.isDirty && !xAxis.isDirty && !series.yAxis.isDirty && !force) { return false; } if (xAxis) { xExtremes = xAxis.getExtremes(); // corrected for log axis (#3053) min = xExtremes.min; max = xExtremes.max; } // optionally filter out points outside the plot area if (isCartesian && series.sorted && !getExtremesFromAll && (!cropThreshold || dataLength > cropThreshold || series.forceCrop)) { // it's outside current extremes if (processedXData[dataLength - 1] < min || processedXData[0] > max) { processedXData = []; processedYData = []; // only crop if it's actually spilling out } else if (processedXData[0] < min || processedXData[dataLength - 1] > max) { croppedData = this.cropData(series.xData, series.yData, min, max); processedXData = croppedData.xData; processedYData = croppedData.yData; cropStart = croppedData.start; cropped = true; } } // Find the closest distance between processed points i = processedXData.length || 1; while (--i) { distance = isLog ? val2lin(processedXData[i]) - val2lin(processedXData[i - 1]) : processedXData[i] - processedXData[i - 1]; if (distance > 0 && (closestPointRange === UNDEFINED || distance < closestPointRange)) { closestPointRange = distance; // Unsorted data is not supported by the line tooltip, as well as data grouping and // navigation in Stock charts (#725) and width calculation of columns (#1900) } else if (distance < 0 && series.requireSorting) { error(15); } } // Record the properties series.cropped = cropped; // undefined or true series.cropStart = cropStart; series.processedXData = processedXData; series.processedYData = processedYData; series.closestPointRange = closestPointRange; }, /** * Iterate over xData and crop values between min and max. Returns object containing crop start/end * cropped xData with corresponding part of yData, dataMin and dataMax within the cropped range */ cropData: function (xData, yData, min, max) { var dataLength = xData.length, cropStart = 0, cropEnd = dataLength, cropShoulder = pick(this.cropShoulder, 1), // line-type series need one point outside i, j; // iterate up to find slice start for (i = 0; i < dataLength; i++) { if (xData[i] >= min) { cropStart = mathMax(0, i - cropShoulder); break; } } // proceed to find slice end for (j = i; j < dataLength; j++) { if (xData[j] > max) { cropEnd = j + cropShoulder; break; } } return { xData: xData.slice(cropStart, cropEnd), yData: yData.slice(cropStart, cropEnd), start: cropStart, end: cropEnd }; }, /** * Generate the data point after the data has been processed by cropping away * unused points and optionally grouped in Highcharts Stock. */ generatePoints: function () { var series = this, options = series.options, dataOptions = options.data, data = series.data, dataLength, processedXData = series.processedXData, processedYData = series.processedYData, pointClass = series.pointClass, processedDataLength = processedXData.length, cropStart = series.cropStart || 0, cursor, hasGroupedData = series.hasGroupedData, point, points = [], i; if (!data && !hasGroupedData) { var arr = []; arr.length = dataOptions.length; data = series.data = arr; } for (i = 0; i < processedDataLength; i++) { cursor = cropStart + i; if (!hasGroupedData) { if (data[cursor]) { point = data[cursor]; } else if (dataOptions[cursor] !== UNDEFINED) { // #970 data[cursor] = point = (new pointClass()).init(series, dataOptions[cursor], processedXData[i]); } points[i] = point; } else { // splat the y data in case of ohlc data array points[i] = (new pointClass()).init(series, [processedXData[i]].concat(splat(processedYData[i]))); points[i].dataGroup = series.groupMap[i]; } points[i].index = cursor; // For faster access in Point.update } // Hide cropped-away points - this only runs when the number of points is above cropThreshold, or when // swithching view from non-grouped data to grouped data (#637) if (data && (processedDataLength !== (dataLength = data.length) || hasGroupedData)) { for (i = 0; i < dataLength; i++) { if (i === cropStart && !hasGroupedData) { // when has grouped data, clear all points i += processedDataLength; } if (data[i]) { data[i].destroyElements(); data[i].plotX = UNDEFINED; // #1003 } } } series.data = data; series.points = points; }, /** * Calculate Y extremes for visible data */ getExtremes: function (yData) { var xAxis = this.xAxis, yAxis = this.yAxis, xData = this.processedXData, yDataLength, activeYData = [], activeCounter = 0, xExtremes = xAxis.getExtremes(), // #2117, need to compensate for log X axis xMin = xExtremes.min, xMax = xExtremes.max, validValue, withinRange, x, y, i, j; yData = yData || this.stackedYData || this.processedYData || []; yDataLength = yData.length; for (i = 0; i < yDataLength; i++) { x = xData[i]; y = yData[i]; // For points within the visible range, including the first point outside the // visible range, consider y extremes validValue = (isNumber(y, true) || isArray(y)) && (!yAxis.isLog || (y.length || y > 0)); withinRange = this.getExtremesFromAll || this.options.getExtremesFromAll || this.cropped || ((xData[i + 1] || x) >= xMin && (xData[i - 1] || x) <= xMax); if (validValue && withinRange) { j = y.length; if (j) { // array, like ohlc or range data while (j--) { if (y[j] !== null) { activeYData[activeCounter++] = y[j]; } } } else { activeYData[activeCounter++] = y; } } } this.dataMin = arrayMin(activeYData); this.dataMax = arrayMax(activeYData); }, /** * Translate data points from raw data values to chart specific positioning data * needed later in drawPoints, drawGraph and drawTracker. */ translate: function () { if (!this.processedXData) { // hidden series this.processData(); } this.generatePoints(); var series = this, options = series.options, stacking = options.stacking, xAxis = series.xAxis, categories = xAxis.categories, yAxis = series.yAxis, points = series.points, dataLength = points.length, hasModifyValue = !!series.modifyValue, i, pointPlacement = options.pointPlacement, dynamicallyPlaced = pointPlacement === 'between' || isNumber(pointPlacement), threshold = options.threshold, stackThreshold = options.startFromThreshold ? threshold : 0, plotX, plotY, lastPlotX, stackIndicator, closestPointRangePx = Number.MAX_VALUE; // Translate each point for (i = 0; i < dataLength; i++) { var point = points[i], xValue = point.x, yValue = point.y, yBottom = point.low, stack = stacking && yAxis.stacks[(series.negStacks && yValue < (stackThreshold ? 0 : threshold) ? '-' : '') + series.stackKey], pointStack, stackValues; // Discard disallowed y values for log axes (#3434) if (yAxis.isLog && yValue !== null && yValue <= 0) { point.isNull = true; } // Get the plotX translation point.plotX = plotX = correctFloat( // #5236 mathMin(mathMax(-1e5, xAxis.translate(xValue, 0, 0, 0, 1, pointPlacement, this.type === 'flags')), 1e5) // #3923 ); // Calculate the bottom y value for stacked series if (stacking && series.visible && !point.isNull && stack && stack[xValue]) { stackIndicator = series.getStackIndicator(stackIndicator, xValue, series.index); pointStack = stack[xValue]; stackValues = pointStack.points[stackIndicator.key]; yBottom = stackValues[0]; yValue = stackValues[1]; if (yBottom === stackThreshold && stackIndicator.key === stack[xValue].base) { yBottom = pick(threshold, yAxis.min); } if (yAxis.isLog && yBottom <= 0) { // #1200, #1232 yBottom = null; } point.total = point.stackTotal = pointStack.total; point.percentage = pointStack.total && (point.y / pointStack.total * 100); point.stackY = yValue; // Place the stack label pointStack.setOffset(series.pointXOffset || 0, series.barW || 0); } // Set translated yBottom or remove it point.yBottom = defined(yBottom) ? yAxis.translate(yBottom, 0, 1, 0, 1) : null; // general hook, used for Highstock compare mode if (hasModifyValue) { yValue = series.modifyValue(yValue, point); } // Set the the plotY value, reset it for redraws point.plotY = plotY = (typeof yValue === 'number' && yValue !== Infinity) ? mathMin(mathMax(-1e5, yAxis.translate(yValue, 0, 1, 0, 1)), 1e5) : // #3201 UNDEFINED; point.isInside = plotY !== UNDEFINED && plotY >= 0 && plotY <= yAxis.len && // #3519 plotX >= 0 && plotX <= xAxis.len; // Set client related positions for mouse tracking point.clientX = dynamicallyPlaced ? correctFloat(xAxis.translate(xValue, 0, 0, 0, 1, pointPlacement)) : plotX; // #1514, #5383, #5518 point.negative = point.y < (threshold || 0); // some API data point.category = categories && categories[point.x] !== UNDEFINED ? categories[point.x] : point.x; // Determine auto enabling of markers (#3635, #5099) if (!point.isNull) { if (lastPlotX !== undefined) { closestPointRangePx = mathMin(closestPointRangePx, mathAbs(plotX - lastPlotX)); } lastPlotX = plotX; } } series.closestPointRangePx = closestPointRangePx; }, /** * Return the series points with null points filtered out */ getValidPoints: function (points, insideOnly) { var chart = this.chart; return grep(points || this.points || [], function isValidPoint(point) { // #3916, #5029 if (insideOnly && !chart.isInsidePlot(point.plotX, point.plotY, chart.inverted)) { // #5085 return false; } return !point.isNull; }); }, /** * Set the clipping for the series. For animated series it is called twice, first to initiate * animating the clip then the second time without the animation to set the final clip. */ setClip: function (animation) { var chart = this.chart, options = this.options, renderer = chart.renderer, inverted = chart.inverted, seriesClipBox = this.clipBox, clipBox = seriesClipBox || chart.clipBox, sharedClipKey = this.sharedClipKey || ['_sharedClip', animation && animation.duration, animation && animation.easing, clipBox.height, options.xAxis, options.yAxis].join(','), // #4526 clipRect = chart[sharedClipKey], markerClipRect = chart[sharedClipKey + 'm']; // If a clipping rectangle with the same properties is currently present in the chart, use that. if (!clipRect) { // When animation is set, prepare the initial positions if (animation) { clipBox.width = 0; chart[sharedClipKey + 'm'] = markerClipRect = renderer.clipRect( -99, // include the width of the first marker inverted ? -chart.plotLeft : -chart.plotTop, 99, inverted ? chart.chartWidth : chart.chartHeight ); } chart[sharedClipKey] = clipRect = renderer.clipRect(clipBox); // Create hashmap for series indexes clipRect.count = { length: 0 }; } if (animation) { if (!clipRect.count[this.index]) { clipRect.count[this.index] = true; clipRect.count.length += 1; } } if (options.clip !== false) { this.group.clip(animation || seriesClipBox ? clipRect : chart.clipRect); this.markerGroup.clip(markerClipRect); this.sharedClipKey = sharedClipKey; } // Remove the shared clipping rectangle when all series are shown if (!animation) { if (clipRect.count[this.index]) { delete clipRect.count[this.index]; clipRect.count.length -= 1; } if (clipRect.count.length === 0 && sharedClipKey && chart[sharedClipKey]) { if (!seriesClipBox) { chart[sharedClipKey] = chart[sharedClipKey].destroy(); } if (chart[sharedClipKey + 'm']) { chart[sharedClipKey + 'm'] = chart[sharedClipKey + 'm'].destroy(); } } } }, /** * Animate in the series */ animate: function (init) { var series = this, chart = series.chart, clipRect, animation = animObject(series.options.animation), sharedClipKey; // Initialize the animation. Set up the clipping rectangle. if (init) { series.setClip(animation); // Run the animation } else { sharedClipKey = this.sharedClipKey; clipRect = chart[sharedClipKey]; if (clipRect) { clipRect.animate({ width: chart.plotSizeX }, animation); } if (chart[sharedClipKey + 'm']) { chart[sharedClipKey + 'm'].animate({ width: chart.plotSizeX + 99 }, animation); } // Delete this function to allow it only once series.animate = null; } }, /** * This runs after animation to land on the final plot clipping */ afterAnimate: function () { this.setClip(); fireEvent(this, 'afterAnimate'); }, /** * Draw the markers */ drawPoints: function () { var series = this, pointAttr, points = series.points, chart = series.chart, plotX, plotY, i, point, radius, symbol, isImage, graphic, options = series.options, seriesMarkerOptions = options.marker, seriesPointAttr = series.pointAttr[''], pointMarkerOptions, hasPointMarker, enabled, isInside, markerGroup = series.markerGroup, xAxis = series.xAxis, globallyEnabled = pick( seriesMarkerOptions.enabled, xAxis.isRadial, series.closestPointRangePx > 2 * seriesMarkerOptions.radius ); if (seriesMarkerOptions.enabled !== false || series._hasPointMarkers) { i = points.length; while (i--) { point = points[i]; plotX = mathFloor(point.plotX); // #1843 plotY = point.plotY; graphic = point.graphic; pointMarkerOptions = point.marker || {}; hasPointMarker = !!point.marker; enabled = (globallyEnabled && pointMarkerOptions.enabled === UNDEFINED) || pointMarkerOptions.enabled; isInside = point.isInside; // only draw the point if y is defined if (enabled && isNumber(plotY) && point.y !== null) { // shortcuts pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || seriesPointAttr; radius = pointAttr.r; symbol = pick(pointMarkerOptions.symbol, series.symbol); isImage = symbol.indexOf('url') === 0; if (graphic) { // update graphic[isInside ? 'show' : 'hide'](true) // Since the marker group isn't clipped, each individual marker must be toggled .attr(pointAttr) // #4759 .animate(extend({ x: plotX - radius, y: plotY - radius }, graphic.symbolName ? { // don't apply to image symbols #507 width: 2 * radius, height: 2 * radius } : {})); } else if (isInside && (radius > 0 || isImage)) { point.graphic = graphic = chart.renderer.symbol( symbol, plotX - radius, plotY - radius, 2 * radius, 2 * radius, hasPointMarker ? pointMarkerOptions : seriesMarkerOptions ) .attr(pointAttr) .add(markerGroup); } } else if (graphic) { point.graphic = graphic.destroy(); // #1269 } } } }, /** * Convert state properties from API naming conventions to SVG attributes * * @param {Object} options API options object * @param {Object} base1 SVG attribute object to inherit from * @param {Object} base2 Second level SVG attribute object to inherit from */ convertAttribs: function (options, base1, base2, base3) { var conversion = this.pointAttrToOptions, attr, option, obj = {}; options = options || {}; base1 = base1 || {}; base2 = base2 || {}; base3 = base3 || {}; for (attr in conversion) { option = conversion[attr]; obj[attr] = pick(options[option], base1[attr], base2[attr], base3[attr]); } return obj; }, /** * Get the state attributes. Each series type has its own set of attributes * that are allowed to change on a point's state change. Series wide attributes are stored for * all series, and additionally point specific attributes are stored for all * points with individual marker options. If such options are not defined for the point, * a reference to the series wide attributes is stored in point.pointAttr. */ getAttribs: function () { var series = this, seriesOptions = series.options, normalOptions = defaultPlotOptions[series.type].marker ? seriesOptions.marker : seriesOptions, stateOptions = normalOptions.states, stateOptionsHover = stateOptions[HOVER_STATE], pointStateOptionsHover, seriesColor = series.color, seriesNegativeColor = series.options.negativeColor, normalDefaults = { stroke: seriesColor, fill: seriesColor }, points = series.points || [], // #927 i, j, threshold, point, seriesPointAttr = [], pointAttr, pointAttrToOptions = series.pointAttrToOptions, hasPointSpecificOptions = series.hasPointSpecificOptions, defaultLineColor = normalOptions.lineColor, defaultFillColor = normalOptions.fillColor, turboThreshold = seriesOptions.turboThreshold, zones = series.zones, zoneAxis = series.zoneAxis || 'y', zoneColor, attr, key; // series type specific modifications if (seriesOptions.marker) { // line, spline, area, areaspline, scatter // if no hover radius is given, default to normal radius + 2 stateOptionsHover.radius = +stateOptionsHover.radius || +normalOptions.radius + +stateOptionsHover.radiusPlus; stateOptionsHover.lineWidth = stateOptionsHover.lineWidth || normalOptions.lineWidth + stateOptionsHover.lineWidthPlus; } else { // column, bar, pie // if no hover color is given, brighten the normal color stateOptionsHover.color = stateOptionsHover.color || Color(stateOptionsHover.color || seriesColor) .brighten(stateOptionsHover.brightness).get(); // if no hover negativeColor is given, brighten the normal negativeColor stateOptionsHover.negativeColor = stateOptionsHover.negativeColor || Color(stateOptionsHover.negativeColor || seriesNegativeColor) .brighten(stateOptionsHover.brightness).get(); } // general point attributes for the series normal state seriesPointAttr[NORMAL_STATE] = series.convertAttribs(normalOptions, normalDefaults); // HOVER_STATE and SELECT_STATE states inherit from normal state except the default radius each([HOVER_STATE, SELECT_STATE], function (state) { seriesPointAttr[state] = series.convertAttribs(stateOptions[state], seriesPointAttr[NORMAL_STATE]); }); // set it series.pointAttr = seriesPointAttr; // Generate the point-specific attribute collections if specific point // options are given. If not, create a referance to the series wide point // attributes i = points.length; if (!turboThreshold || i < turboThreshold || hasPointSpecificOptions) { while (i--) { point = points[i]; normalOptions = (point.options && point.options.marker) || point.options; if (normalOptions && normalOptions.enabled === false) { normalOptions.radius = 0; } zoneColor = null; if (zones.length) { j = 0; threshold = zones[j]; while (point[zoneAxis] >= threshold.value) { threshold = zones[++j]; } point.color = point.fillColor = zoneColor = pick(threshold.color, series.color); // #3636, #4267, #4430 - inherit color from series, when color is undefined } hasPointSpecificOptions = seriesOptions.colorByPoint || point.color; // #868 // check if the point has specific visual options if (point.options) { for (key in pointAttrToOptions) { if (defined(normalOptions[pointAttrToOptions[key]])) { hasPointSpecificOptions = true; } } } // a specific marker config object is defined for the individual point: // create it's own attribute collection if (hasPointSpecificOptions) { normalOptions = normalOptions || {}; pointAttr = []; stateOptions = normalOptions.states || {}; // reassign for individual point pointStateOptionsHover = stateOptions[HOVER_STATE] = stateOptions[HOVER_STATE] || {}; // Handle colors for column and pies if (!seriesOptions.marker || (point.negative && !pointStateOptionsHover.fillColor && !stateOptionsHover.fillColor)) { // column, bar, point or negative threshold for series with markers (#3636) // If no hover color is given, brighten the normal color. #1619, #2579 pointStateOptionsHover[series.pointAttrToOptions.fill] = pointStateOptionsHover.color || (!point.options.color && stateOptionsHover[(point.negative && seriesNegativeColor ? 'negativeColor' : 'color')]) || Color(point.color) .brighten(pointStateOptionsHover.brightness || stateOptionsHover.brightness) .get(); } // normal point state inherits series wide normal state attr = { color: point.color }; // #868 if (!defaultFillColor) { // Individual point color or negative color markers (#2219) attr.fillColor = point.color; } if (!defaultLineColor) { attr.lineColor = point.color; // Bubbles take point color, line markers use white } // Color is explicitly set to null or undefined (#1288, #4068) if (normalOptions.hasOwnProperty('color') && !normalOptions.color) { delete normalOptions.color; } // When zone is set, but series.states.hover.color is not set, apply zone color on hover, #4670: if (zoneColor && !stateOptionsHover.fillColor) { pointStateOptionsHover.fillColor = zoneColor; } pointAttr[NORMAL_STATE] = series.convertAttribs(extend(attr, normalOptions), seriesPointAttr[NORMAL_STATE]); // inherit from point normal and series hover pointAttr[HOVER_STATE] = series.convertAttribs( stateOptions[HOVER_STATE], seriesPointAttr[HOVER_STATE], pointAttr[NORMAL_STATE] ); // inherit from point normal and series hover pointAttr[SELECT_STATE] = series.convertAttribs( stateOptions[SELECT_STATE], seriesPointAttr[SELECT_STATE], pointAttr[NORMAL_STATE] ); // no marker config object is created: copy a reference to the series-wide // attribute collection } else { pointAttr = seriesPointAttr; } point.pointAttr = pointAttr; } } }, /** * Clear DOM objects and free up memory */ destroy: function () { var series = this, chart = series.chart, issue134 = /AppleWebKit\/533/.test(userAgent), destroy, i, data = series.data || [], point, prop, axis; // add event hook fireEvent(series, 'destroy'); // remove all events removeEvent(series); // erase from axes each(series.axisTypes || [], function (AXIS) { axis = series[AXIS]; if (axis) { erase(axis.series, series); axis.isDirty = axis.forceRedraw = true; } }); // remove legend items if (series.legendItem) { series.chart.legend.destroyItem(series); } // destroy all points with their elements i = data.length; while (i--) { point = data[i]; if (point && point.destroy) { point.destroy(); } } series.points = null; // Clear the animation timeout if we are destroying the series during initial animation clearTimeout(series.animationTimeout); // Destroy all SVGElements associated to the series for (prop in series) { if (series[prop] instanceof SVGElement && !series[prop].survive) { // Survive provides a hook for not destroying // issue 134 workaround destroy = issue134 && prop === 'group' ? 'hide' : 'destroy'; series[prop][destroy](); } } // remove from hoverSeries if (chart.hoverSeries === series) { chart.hoverSeries = null; } erase(chart.series, series); // clear all members for (prop in series) { delete series[prop]; } }, /** * Get the graph path */ getGraphPath: function (points, nullsAsZeroes, connectCliffs) { var series = this, options = series.options, step = options.step, reversed, graphPath = [], xMap = [], gap; points = points || series.points; // Bottom of a stack is reversed reversed = points.reversed; if (reversed) { points.reverse(); } // Reverse the steps (#5004) step = { right: 1, center: 2 }[step] || (step && 3); if (step && reversed) { step = 4 - step; } // Remove invalid points, especially in spline (#5015) if (options.connectNulls && !nullsAsZeroes && !connectCliffs) { points = this.getValidPoints(points); } // Build the line each(points, function (point, i) { var plotX = point.plotX, plotY = point.plotY, lastPoint = points[i - 1], pathToPoint; // the path to this point from the previous if ((point.leftCliff || (lastPoint && lastPoint.rightCliff)) && !connectCliffs) { gap = true; // ... and continue } // Line series, nullsAsZeroes is not handled if (point.isNull && !defined(nullsAsZeroes) && i > 0) { gap = !options.connectNulls; // Area series, nullsAsZeroes is set } else if (point.isNull && !nullsAsZeroes) { gap = true; } else { if (i === 0 || gap) { pathToPoint = [M, point.plotX, point.plotY]; } else if (series.getPointSpline) { // generate the spline as defined in the SplineSeries object pathToPoint = series.getPointSpline(points, point, i); } else if (step) { if (step === 1) { // right pathToPoint = [ L, lastPoint.plotX, plotY ]; } else if (step === 2) { // center pathToPoint = [ L, (lastPoint.plotX + plotX) / 2, lastPoint.plotY, L, (lastPoint.plotX + plotX) / 2, plotY ]; } else { pathToPoint = [ L, plotX, lastPoint.plotY ]; } pathToPoint.push(L, plotX, plotY); } else { // normal line to next point pathToPoint = [ L, plotX, plotY ]; } // Prepare for animation. When step is enabled, there are two path nodes for each x value. xMap.push(point.x); if (step) { xMap.push(point.x); } graphPath.push.apply(graphPath, pathToPoint); gap = false; } }); graphPath.xMap = xMap; series.graphPath = graphPath; return graphPath; }, /** * Draw the actual graph */ drawGraph: function () { var series = this, options = this.options, props = [['graph', options.lineColor || this.color, options.dashStyle]], lineWidth = options.lineWidth, roundCap = options.linecap !== 'square', graphPath = (this.gappedPath || this.getGraphPath).call(this), zones = this.zones; each(zones, function (threshold, i) { props.push(['zoneGraph' + i, threshold.color || series.color, threshold.dashStyle || options.dashStyle]); }); // Draw the graph each(props, function (prop, i) { var graphKey = prop[0], graph = series[graphKey], attribs; if (graph) { graph.endX = graphPath.xMap; graph.animate({ d: graphPath }); } else if (lineWidth && graphPath.length) { // #1487 attribs = { stroke: prop[1], 'stroke-width': lineWidth, fill: 'none', zIndex: 1 // #1069 }; if (prop[2]) { attribs.dashstyle = prop[2]; } else if (roundCap) { attribs['stroke-linecap'] = attribs['stroke-linejoin'] = 'round'; } graph = series[graphKey] = series.chart.renderer.path(graphPath) .attr(attribs) .add(series.group) .shadow((i < 2) && options.shadow); // add shadow to normal series (0) or to first zone (1) #3932 } // Helpers for animation if (graph) { graph.startX = graphPath.xMap; //graph.shiftUnit = options.step ? 2 : 1; graph.isArea = graphPath.isArea; // For arearange animation } }); }, /** * Clip the graphs into the positive and negative coloured graphs */ applyZones: function () { var series = this, chart = this.chart, renderer = chart.renderer, zones = this.zones, translatedFrom, translatedTo, clips = this.clips || [], clipAttr, graph = this.graph, area = this.area, chartSizeMax = mathMax(chart.chartWidth, chart.chartHeight), axis = this[(this.zoneAxis || 'y') + 'Axis'], extremes, reversed, inverted = chart.inverted, horiz, pxRange, pxPosMin, pxPosMax, ignoreZones = false; if (zones.length && (graph || area) && axis && axis.min !== UNDEFINED) { reversed = axis.reversed; horiz = axis.horiz; // The use of the Color Threshold assumes there are no gaps // so it is safe to hide the original graph and area if (graph) { graph.hide(); } if (area) { area.hide(); } // Create the clips extremes = axis.getExtremes(); each(zones, function (threshold, i) { translatedFrom = reversed ? (horiz ? chart.plotWidth : 0) : (horiz ? 0 : axis.toPixels(extremes.min)); translatedFrom = mathMin(mathMax(pick(translatedTo, translatedFrom), 0), chartSizeMax); translatedTo = mathMin(mathMax(mathRound(axis.toPixels(pick(threshold.value, extremes.max), true)), 0), chartSizeMax); if (ignoreZones) { translatedFrom = translatedTo = axis.toPixels(extremes.max); } pxRange = Math.abs(translatedFrom - translatedTo); pxPosMin = mathMin(translatedFrom, translatedTo); pxPosMax = mathMax(translatedFrom, translatedTo); if (axis.isXAxis) { clipAttr = { x: inverted ? pxPosMax : pxPosMin, y: 0, width: pxRange, height: chartSizeMax }; if (!horiz) { clipAttr.x = chart.plotHeight - clipAttr.x; } } else { clipAttr = { x: 0, y: inverted ? pxPosMax : pxPosMin, width: chartSizeMax, height: pxRange }; if (horiz) { clipAttr.y = chart.plotWidth - clipAttr.y; } } /// VML SUPPPORT if (inverted && renderer.isVML) { if (axis.isXAxis) { clipAttr = { x: 0, y: reversed ? pxPosMin : pxPosMax, height: clipAttr.width, width: chart.chartWidth }; } else { clipAttr = { x: clipAttr.y - chart.plotLeft - chart.spacingBox.x, y: 0, width: clipAttr.height, height: chart.chartHeight }; } } /// END OF VML SUPPORT if (clips[i]) { clips[i].animate(clipAttr); } else { clips[i] = renderer.clipRect(clipAttr); if (graph) { series['zoneGraph' + i].clip(clips[i]); } if (area) { series['zoneArea' + i].clip(clips[i]); } } // if this zone extends out of the axis, ignore the others ignoreZones = threshold.value > extremes.max; }); this.clips = clips; } }, /** * Initialize and perform group inversion on series.group and series.markerGroup */ invertGroups: function () { var series = this, chart = series.chart; // Pie, go away (#1736) if (!series.xAxis) { return; } // A fixed size is needed for inversion to work function setInvert() { var size = { width: series.yAxis.len, height: series.xAxis.len }; each(['group', 'markerGroup'], function (groupName) { if (series[groupName]) { series[groupName].attr(size).invert(); } }); } addEvent(chart, 'resize', setInvert); // do it on resize addEvent(series, 'destroy', function () { removeEvent(chart, 'resize', setInvert); }); // Do it now setInvert(); // do it now // On subsequent render and redraw, just do setInvert without setting up events again series.invertGroups = setInvert; }, /** * General abstraction for creating plot groups like series.group, series.dataLabelsGroup and * series.markerGroup. On subsequent calls, the group will only be adjusted to the updated plot size. */ plotGroup: function (prop, name, visibility, zIndex, parent) { var group = this[prop], isNew = !group; // Generate it on first call if (isNew) { this[prop] = group = this.chart.renderer.g(name) .attr({ zIndex: zIndex || 0.1 // IE8 and pointer logic use this }) .add(parent); group.addClass('highcharts-series-' + this.index); } // Place it on first and subsequent (redraw) calls group.attr({ visibility: visibility })[isNew ? 'attr' : 'animate'](this.getPlotBox()); return group; }, /** * Get the translation and scale for the plot area of this series */ getPlotBox: function () { var chart = this.chart, xAxis = this.xAxis, yAxis = this.yAxis; // Swap axes for inverted (#2339) if (chart.inverted) { xAxis = yAxis; yAxis = this.xAxis; } return { translateX: xAxis ? xAxis.left : chart.plotLeft, translateY: yAxis ? yAxis.top : chart.plotTop, scaleX: 1, // #1623 scaleY: 1 }; }, /** * Render the graph and markers */ render: function () { var series = this, chart = series.chart, group, options = series.options, // Animation doesn't work in IE8 quirks when the group div is hidden, // and looks bad in other oldIE animDuration = !!series.animate && chart.renderer.isSVG && animObject(options.animation).duration, visibility = series.visible ? 'inherit' : 'hidden', // #2597 zIndex = options.zIndex, hasRendered = series.hasRendered, chartSeriesGroup = chart.seriesGroup; // the group group = series.plotGroup( 'group', 'series', visibility, zIndex, chartSeriesGroup ); series.markerGroup = series.plotGroup( 'markerGroup', 'markers', visibility, zIndex, chartSeriesGroup ); // initiate the animation if (animDuration) { series.animate(true); } // cache attributes for shapes series.getAttribs(); // SVGRenderer needs to know this before drawing elements (#1089, #1795) group.inverted = series.isCartesian ? chart.inverted : false; // draw the graph if any if (series.drawGraph) { series.drawGraph(); series.applyZones(); } each(series.points, function (point) { if (point.redraw) { point.redraw(); } }); // draw the data labels (inn pies they go before the points) if (series.drawDataLabels) { series.drawDataLabels(); } // draw the points if (series.visible) { series.drawPoints(); } // draw the mouse tracking area if (series.drawTracker && series.options.enableMouseTracking !== false) { series.drawTracker(); } // Handle inverted series and tracker groups if (chart.inverted) { series.invertGroups(); } // Initial clipping, must be defined after inverting groups for VML. Applies to columns etc. (#3839). if (options.clip !== false && !series.sharedClipKey && !hasRendered) { group.clip(chart.clipRect); } // Run the animation if (animDuration) { series.animate(); } // Call the afterAnimate function on animation complete (but don't overwrite the animation.complete option // which should be available to the user). if (!hasRendered) { series.animationTimeout = syncTimeout(function () { series.afterAnimate(); }, animDuration); } series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see // (See #322) series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see series.hasRendered = true; }, /** * Redraw the series after an update in the axes. */ redraw: function () { var series = this, chart = series.chart, wasDirty = series.isDirty || series.isDirtyData, // cache it here as it is set to false in render, but used after group = series.group, xAxis = series.xAxis, yAxis = series.yAxis; // reposition on resize if (group) { if (chart.inverted) { group.attr({ width: chart.plotWidth, height: chart.plotHeight }); } group.animate({ translateX: pick(xAxis && xAxis.left, chart.plotLeft), translateY: pick(yAxis && yAxis.top, chart.plotTop) }); } series.translate(); series.render(); if (wasDirty) { // #3868, #3945 delete this.kdTree; } }, /** * KD Tree && PointSearching Implementation */ kdDimensions: 1, kdAxisArray: ['clientX', 'plotY'], searchPoint: function (e, compareX) { var series = this, xAxis = series.xAxis, yAxis = series.yAxis, inverted = series.chart.inverted; return this.searchKDTree({ clientX: inverted ? xAxis.len - e.chartY + xAxis.pos : e.chartX - xAxis.pos, plotY: inverted ? yAxis.len - e.chartX + yAxis.pos : e.chartY - yAxis.pos }, compareX); }, buildKDTree: function () { var series = this, dimensions = series.kdDimensions; // Internal function function _kdtree(points, depth, dimensions) { var axis, median, length = points && points.length; if (length) { // alternate between the axis axis = series.kdAxisArray[depth % dimensions]; // sort point array points.sort(function (a, b) { return a[axis] - b[axis]; }); median = Math.floor(length / 2); // build and return nod return { point: points[median], left: _kdtree(points.slice(0, median), depth + 1, dimensions), right: _kdtree(points.slice(median + 1), depth + 1, dimensions) }; } } // Start the recursive build process with a clone of the points array and null points filtered out (#3873) function startRecursive() { series.kdTree = _kdtree( series.getValidPoints( null, !series.directTouch // For line-type series restrict to plot area, but column-type series not (#3916, #4511) ), dimensions, dimensions ); } delete series.kdTree; // For testing tooltips, don't build async syncTimeout(startRecursive, series.options.kdNow ? 0 : 1); }, searchKDTree: function (point, compareX) { var series = this, kdX = this.kdAxisArray[0], kdY = this.kdAxisArray[1], kdComparer = compareX ? 'distX' : 'dist'; // Set the one and two dimensional distance on the point object function setDistance(p1, p2) { var x = (defined(p1[kdX]) && defined(p2[kdX])) ? Math.pow(p1[kdX] - p2[kdX], 2) : null, y = (defined(p1[kdY]) && defined(p2[kdY])) ? Math.pow(p1[kdY] - p2[kdY], 2) : null, r = (x || 0) + (y || 0); p2.dist = defined(r) ? Math.sqrt(r) : Number.MAX_VALUE; p2.distX = defined(x) ? Math.sqrt(x) : Number.MAX_VALUE; } function _search(search, tree, depth, dimensions) { var point = tree.point, axis = series.kdAxisArray[depth % dimensions], tdist, sideA, sideB, ret = point, nPoint1, nPoint2; setDistance(search, point); // Pick side based on distance to splitting point tdist = search[axis] - point[axis]; sideA = tdist < 0 ? 'left' : 'right'; sideB = tdist < 0 ? 'right' : 'left'; // End of tree if (tree[sideA]) { nPoint1 = _search(search, tree[sideA], depth + 1, dimensions); ret = (nPoint1[kdComparer] < ret[kdComparer] ? nPoint1 : point); } if (tree[sideB]) { // compare distance to current best to splitting point to decide wether to check side B or not if (Math.sqrt(tdist * tdist) < ret[kdComparer]) { nPoint2 = _search(search, tree[sideB], depth + 1, dimensions); ret = (nPoint2[kdComparer] < ret[kdComparer] ? nPoint2 : ret); } } return ret; } if (!this.kdTree) { this.buildKDTree(); } if (this.kdTree) { return _search(point, this.kdTree, this.kdDimensions, this.kdDimensions); } } }; // end Series prototype /** * The class for stack items */ function StackItem(axis, options, isNegative, x, stackOption) { var inverted = axis.chart.inverted; this.axis = axis; // Tells if the stack is negative this.isNegative = isNegative; // Save the options to be able to style the label this.options = options; // Save the x value to be able to position the label later this.x = x; // Initialize total value this.total = null; // This will keep each points' extremes stored by series.index and point index this.points = {}; // Save the stack option on the series configuration object, and whether to treat it as percent this.stack = stackOption; this.leftCliff = 0; this.rightCliff = 0; // The align options and text align varies on whether the stack is negative and // if the chart is inverted or not. // First test the user supplied value, then use the dynamic. this.alignOptions = { align: options.align || (inverted ? (isNegative ? 'left' : 'right') : 'center'), verticalAlign: options.verticalAlign || (inverted ? 'middle' : (isNegative ? 'bottom' : 'top')), y: pick(options.y, inverted ? 4 : (isNegative ? 14 : -6)), x: pick(options.x, inverted ? (isNegative ? -6 : 6) : 0) }; this.textAlign = options.textAlign || (inverted ? (isNegative ? 'right' : 'left') : 'center'); } StackItem.prototype = { destroy: function () { destroyObjectProperties(this, this.axis); }, /** * Renders the stack total label and adds it to the stack label group. */ render: function (group) { var options = this.options, formatOption = options.format, str = formatOption ? format(formatOption, this) : options.formatter.call(this); // format the text in the label // Change the text to reflect the new total and set visibility to hidden in case the serie is hidden if (this.label) { this.label.attr({ text: str, visibility: 'hidden' }); // Create new label } else { this.label = this.axis.chart.renderer.text(str, null, null, options.useHTML) // dummy positions, actual position updated with setOffset method in columnseries .css(options.style) // apply style .attr({ align: this.textAlign, // fix the text-anchor rotation: options.rotation, // rotation visibility: HIDDEN // hidden until setOffset is called }) .add(group); // add to the labels-group } }, /** * Sets the offset that the stack has from the x value and repositions the label. */ setOffset: function (xOffset, xWidth) { var stackItem = this, axis = stackItem.axis, chart = axis.chart, inverted = chart.inverted, reversed = axis.reversed, neg = (this.isNegative && !reversed) || (!this.isNegative && reversed), // #4056 y = axis.translate(axis.usePercentage ? 100 : this.total, 0, 0, 0, 1), // stack value translated mapped to chart coordinates yZero = axis.translate(0), // stack origin h = mathAbs(y - yZero), // stack height x = chart.xAxis[0].translate(this.x) + xOffset, // stack x position plotHeight = chart.plotHeight, stackBox = { // this is the box for the complete stack x: inverted ? (neg ? y : y - h) : x, y: inverted ? plotHeight - x - xWidth : (neg ? (plotHeight - y - h) : plotHeight - y), width: inverted ? h : xWidth, height: inverted ? xWidth : h }, label = this.label, alignAttr; if (label) { label.align(this.alignOptions, null, stackBox); // align the label to the box // Set visibility (#678) alignAttr = label.alignAttr; label[this.options.crop === false || chart.isInsidePlot(alignAttr.x, alignAttr.y) ? 'show' : 'hide'](true); } } }; /** * Generate stacks for each series and calculate stacks total values */ Chart.prototype.getStacks = function () { var chart = this; // reset stacks for each yAxis each(chart.yAxis, function (axis) { if (axis.stacks && axis.hasVisibleSeries) { axis.oldStacks = axis.stacks; } }); each(chart.series, function (series) { if (series.options.stacking && (series.visible === true || chart.options.chart.ignoreHiddenSeries === false)) { series.stackKey = series.type + pick(series.options.stack, ''); } }); }; // Stacking methods defined on the Axis prototype /** * Build the stacks from top down */ Axis.prototype.buildStacks = function () { var axisSeries = this.series, series, reversedStacks = pick(this.options.reversedStacks, true), len = axisSeries.length, i; if (!this.isXAxis) { this.usePercentage = false; i = len; while (i--) { axisSeries[reversedStacks ? i : len - i - 1].setStackedPoints(); } i = len; while (i--) { series = axisSeries[reversedStacks ? i : len - i - 1]; if (series.setStackCliffs) { series.setStackCliffs(); } } // Loop up again to compute percent stack if (this.usePercentage) { for (i = 0; i < len; i++) { axisSeries[i].setPercentStacks(); } } } }; Axis.prototype.renderStackTotals = function () { var axis = this, chart = axis.chart, renderer = chart.renderer, stacks = axis.stacks, stackKey, oneStack, stackCategory, stackTotalGroup = axis.stackTotalGroup; // Create a separate group for the stack total labels if (!stackTotalGroup) { axis.stackTotalGroup = stackTotalGroup = renderer.g('stack-labels') .attr({ visibility: VISIBLE, zIndex: 6 }) .add(); } // plotLeft/Top will change when y axis gets wider so we need to translate the // stackTotalGroup at every render call. See bug #506 and #516 stackTotalGroup.translate(chart.plotLeft, chart.plotTop); // Render each stack total for (stackKey in stacks) { oneStack = stacks[stackKey]; for (stackCategory in oneStack) { oneStack[stackCategory].render(stackTotalGroup); } } }; /** * Set all the stacks to initial states and destroy unused ones. */ Axis.prototype.resetStacks = function () { var stacks = this.stacks, type, i; if (!this.isXAxis) { for (type in stacks) { for (i in stacks[type]) { // Clean up memory after point deletion (#1044, #4320) if (stacks[type][i].touched < this.stacksTouched) { stacks[type][i].destroy(); delete stacks[type][i]; // Reset stacks } else { stacks[type][i].total = null; stacks[type][i].cum = 0; } } } } }; Axis.prototype.cleanStacks = function () { var stacks, type, i; if (!this.isXAxis) { if (this.oldStacks) { stacks = this.stacks = this.oldStacks; } // reset stacks for (type in stacks) { for (i in stacks[type]) { stacks[type][i].cum = stacks[type][i].total; } } } }; // Stacking methods defnied for Series prototype /** * Adds series' points value to corresponding stack */ Series.prototype.setStackedPoints = function () { if (!this.options.stacking || (this.visible !== true && this.chart.options.chart.ignoreHiddenSeries !== false)) { return; } var series = this, xData = series.processedXData, yData = series.processedYData, stackedYData = [], yDataLength = yData.length, seriesOptions = series.options, threshold = seriesOptions.threshold, stackThreshold = seriesOptions.startFromThreshold ? threshold : 0, stackOption = seriesOptions.stack, stacking = seriesOptions.stacking, stackKey = series.stackKey, negKey = '-' + stackKey, negStacks = series.negStacks, yAxis = series.yAxis, stacks = yAxis.stacks, oldStacks = yAxis.oldStacks, stackIndicator, isNegative, stack, other, key, pointKey, i, x, y; yAxis.stacksTouched += 1; // loop over the non-null y values and read them into a local array for (i = 0; i < yDataLength; i++) { x = xData[i]; y = yData[i]; stackIndicator = series.getStackIndicator(stackIndicator, x, series.index); pointKey = stackIndicator.key; // Read stacked values into a stack based on the x value, // the sign of y and the stack key. Stacking is also handled for null values (#739) isNegative = negStacks && y < (stackThreshold ? 0 : threshold); key = isNegative ? negKey : stackKey; // Create empty object for this stack if it doesn't exist yet if (!stacks[key]) { stacks[key] = {}; } // Initialize StackItem for this x if (!stacks[key][x]) { if (oldStacks[key] && oldStacks[key][x]) { stacks[key][x] = oldStacks[key][x]; stacks[key][x].total = null; } else { stacks[key][x] = new StackItem(yAxis, yAxis.options.stackLabels, isNegative, x, stackOption); } } // If the StackItem doesn't exist, create it first stack = stacks[key][x]; if (y !== null) { stack.points[pointKey] = stack.points[series.index] = [pick(stack.cum, stackThreshold)]; // Record the base of the stack if (!defined(stack.cum)) { stack.base = pointKey; } stack.touched = yAxis.stacksTouched; // In area charts, if there are multiple points on the same X value, let the // area fill the full span of those points if (stackIndicator.index > 0 && series.singleStacks === false) { stack.points[pointKey][0] = stack.points[series.index + ',' + x + ',0'][0]; } } // Add value to the stack total if (stacking === 'percent') { // Percent stacked column, totals are the same for the positive and negative stacks other = isNegative ? stackKey : negKey; if (negStacks && stacks[other] && stacks[other][x]) { other = stacks[other][x]; stack.total = other.total = mathMax(other.total, stack.total) + mathAbs(y) || 0; // Percent stacked areas } else { stack.total = correctFloat(stack.total + (mathAbs(y) || 0)); } } else { stack.total = correctFloat(stack.total + (y || 0)); } stack.cum = pick(stack.cum, stackThreshold) + (y || 0); if (y !== null) { stack.points[pointKey].push(stack.cum); stackedYData[i] = stack.cum; } } if (stacking === 'percent') { yAxis.usePercentage = true; } this.stackedYData = stackedYData; // To be used in getExtremes // Reset old stacks yAxis.oldStacks = {}; }; /** * Iterate over all stacks and compute the absolute values to percent */ Series.prototype.setPercentStacks = function () { var series = this, stackKey = series.stackKey, stacks = series.yAxis.stacks, processedXData = series.processedXData, stackIndicator; each([stackKey, '-' + stackKey], function (key) { var i = processedXData.length, x, stack, pointExtremes, totalFactor; while (i--) { x = processedXData[i]; stackIndicator = series.getStackIndicator(stackIndicator, x, series.index); stack = stacks[key] && stacks[key][x]; pointExtremes = stack && stack.points[stackIndicator.key]; if (pointExtremes) { totalFactor = stack.total ? 100 / stack.total : 0; pointExtremes[0] = correctFloat(pointExtremes[0] * totalFactor); // Y bottom value pointExtremes[1] = correctFloat(pointExtremes[1] * totalFactor); // Y value series.stackedYData[i] = pointExtremes[1]; } } }); }; /** * Get stack indicator, according to it's x-value, to determine points with the same x-value */ Series.prototype.getStackIndicator = function (stackIndicator, x, index) { if (!defined(stackIndicator) || stackIndicator.x !== x) { stackIndicator = { x: x, index: 0 }; } else { stackIndicator.index++; } stackIndicator.key = [index, x, stackIndicator.index].join(','); return stackIndicator; }; // Extend the Chart prototype for dynamic methods extend(Chart.prototype, { /** * Add a series dynamically after time * * @param {Object} options The config options * @param {Boolean} redraw Whether to redraw the chart after adding. Defaults to true. * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration * * @return {Object} series The newly created series object */ addSeries: function (options, redraw, animation) { var series, chart = this; if (options) { redraw = pick(redraw, true); // defaults to true fireEvent(chart, 'addSeries', { options: options }, function () { series = chart.initSeries(options); chart.isDirtyLegend = true; // the series array is out of sync with the display chart.linkSeries(); if (redraw) { chart.redraw(animation); } }); } return series; }, /** * Add an axis to the chart * @param {Object} options The axis option * @param {Boolean} isX Whether it is an X axis or a value axis */ addAxis: function (options, isX, redraw, animation) { var key = isX ? 'xAxis' : 'yAxis', chartOptions = this.options, userOptions = merge(options, { index: this[key].length, isX: isX }); new Axis(this, userOptions); // eslint-disable-line no-new // Push the new axis options to the chart options chartOptions[key] = splat(chartOptions[key] || {}); chartOptions[key].push(userOptions); if (pick(redraw, true)) { this.redraw(animation); } }, /** * Dim the chart and show a loading text or symbol * @param {String} str An optional text to show in the loading label instead of the default one */ showLoading: function (str) { var chart = this, options = chart.options, loadingDiv = chart.loadingDiv, loadingOptions = options.loading, setLoadingSize = function () { if (loadingDiv) { css(loadingDiv, { left: chart.plotLeft + PX, top: chart.plotTop + PX, width: chart.plotWidth + PX, height: chart.plotHeight + PX }); } }; // create the layer at the first call if (!loadingDiv) { chart.loadingDiv = loadingDiv = createElement(DIV, { className: PREFIX + 'loading' }, extend(loadingOptions.style, { zIndex: 10, display: NONE }), chart.container); chart.loadingSpan = createElement( 'span', null, loadingOptions.labelStyle, loadingDiv ); addEvent(chart, 'redraw', setLoadingSize); // #1080 } // update text chart.loadingSpan.innerHTML = str || options.lang.loading; // show it if (!chart.loadingShown) { css(loadingDiv, { opacity: 0, display: '' }); animate(loadingDiv, { opacity: loadingOptions.style.opacity }, { duration: loadingOptions.showDuration || 0 }); chart.loadingShown = true; } setLoadingSize(); }, /** * Hide the loading layer */ hideLoading: function () { var options = this.options, loadingDiv = this.loadingDiv; if (loadingDiv) { animate(loadingDiv, { opacity: 0 }, { duration: options.loading.hideDuration || 100, complete: function () { css(loadingDiv, { display: NONE }); } }); } this.loadingShown = false; } }); // extend the Point prototype for dynamic methods extend(Point.prototype, { /** * Update the point with new options (typically x/y data) and optionally redraw the series. * * @param {Object} options Point options as defined in the series.data array * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration * */ update: function (options, redraw, animation, runEvent) { var point = this, series = point.series, graphic = point.graphic, i, chart = series.chart, seriesOptions = series.options; redraw = pick(redraw, true); function update() { point.applyOptions(options); // Update visuals if (point.y === null && graphic) { // #4146 point.graphic = graphic.destroy(); } if (isObject(options, true)) { // Defer the actual redraw until getAttribs has been called (#3260) point.redraw = function () { if (graphic && graphic.element) { if (options && options.marker && options.marker.symbol) { point.graphic = graphic.destroy(); } } if (options && options.dataLabels && point.dataLabel) { // #2468 point.dataLabel = point.dataLabel.destroy(); } point.redraw = null; }; } // record changes in the parallel arrays i = point.index; series.updateParallelArrays(point, i); // Record the options to options.data. If there is an object from before, // use point options, otherwise use raw options. (#4701) seriesOptions.data[i] = isObject(seriesOptions.data[i], true) ? point.options : options; // redraw series.isDirty = series.isDirtyData = true; if (!series.fixedBox && series.hasCartesianSeries) { // #1906, #2320 chart.isDirtyBox = true; } if (seriesOptions.legendType === 'point') { // #1831, #1885 chart.isDirtyLegend = true; } if (redraw) { chart.redraw(animation); } } // Fire the event with a default handler of doing the update if (runEvent === false) { // When called from setData update(); } else { point.firePointEvent('update', { options: options }, update); } }, /** * Remove a point and optionally redraw the series and if necessary the axes * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration */ remove: function (redraw, animation) { this.series.removePoint(inArray(this, this.series.data), redraw, animation); } }); // Extend the series prototype for dynamic methods extend(Series.prototype, { /** * Add a point dynamically after chart load time * @param {Object} options Point options as given in series.data * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call * @param {Boolean} shift If shift is true, a point is shifted off the start * of the series as one is appended to the end. * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration */ addPoint: function (options, redraw, shift, animation) { var series = this, seriesOptions = series.options, data = series.data, chart = series.chart, names = series.xAxis && series.xAxis.names, dataOptions = seriesOptions.data, point, isInTheMiddle, xData = series.xData, i, x; // Optional redraw, defaults to true redraw = pick(redraw, true); // Get options and push the point to xData, yData and series.options. In series.generatePoints // the Point instance will be created on demand and pushed to the series.data array. point = { series: series }; series.pointClass.prototype.applyOptions.apply(point, [options]); x = point.x; // Get the insertion point i = xData.length; if (series.requireSorting && x < xData[i - 1]) { isInTheMiddle = true; while (i && xData[i - 1] > x) { i--; } } series.updateParallelArrays(point, 'splice', i, 0, 0); // insert undefined item series.updateParallelArrays(point, i); // update it if (names && point.name) { names[x] = point.name; } dataOptions.splice(i, 0, options); if (isInTheMiddle) { series.data.splice(i, 0, null); series.processData(); } // Generate points to be added to the legend (#1329) if (seriesOptions.legendType === 'point') { series.generatePoints(); } // Shift the first point off the parallel arrays if (shift) { if (data[0] && data[0].remove) { data[0].remove(false); } else { data.shift(); series.updateParallelArrays(point, 'shift'); dataOptions.shift(); } } // redraw series.isDirty = true; series.isDirtyData = true; if (redraw) { series.getAttribs(); // #1937 chart.redraw(animation); // Animation is set anyway on redraw, #5665 } }, /** * Remove a point (rendered or not), by index */ removePoint: function (i, redraw, animation) { var series = this, data = series.data, point = data[i], points = series.points, chart = series.chart, remove = function () { if (points && points.length === data.length) { // #4935 points.splice(i, 1); } data.splice(i, 1); series.options.data.splice(i, 1); series.updateParallelArrays(point || { series: series }, 'splice', i, 1); if (point) { point.destroy(); } // redraw series.isDirty = true; series.isDirtyData = true; if (redraw) { chart.redraw(); } }; setAnimation(animation, chart); redraw = pick(redraw, true); // Fire the event with a default handler of removing the point if (point) { point.firePointEvent('remove', null, remove); } else { remove(); } }, /** * Remove a series and optionally redraw the chart * * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call * @param {Boolean|Object} animation Whether to apply animation, and optionally animation * configuration */ remove: function (redraw, animation, withEvent) { var series = this, chart = series.chart; function remove() { // Destroy elements series.destroy(); // Redraw chart.isDirtyLegend = chart.isDirtyBox = true; chart.linkSeries(); if (pick(redraw, true)) { chart.redraw(animation); } } // Fire the event with a default handler of removing the point if (withEvent !== false) { fireEvent(series, 'remove', null, remove); } else { remove(); } }, /** * Update the series with a new set of options */ update: function (newOptions, redraw) { var series = this, chart = this.chart, // must use user options when changing type because this.options is merged // in with type specific plotOptions oldOptions = this.userOptions, oldType = this.type, proto = seriesTypes[oldType].prototype, preserve = ['group', 'markerGroup', 'dataLabelsGroup'], n; // If we're changing type or zIndex, create new groups (#3380, #3404) if ((newOptions.type && newOptions.type !== oldType) || newOptions.zIndex !== undefined) { preserve.length = 0; } // Make sure groups are not destroyed (#3094) each(preserve, function (prop) { preserve[prop] = series[prop]; delete series[prop]; }); // Do the merge, with some forced options newOptions = merge(oldOptions, { animation: false, index: this.index, pointStart: this.xData[0] // when updating after addPoint }, { data: this.options.data }, newOptions); // Destroy the series and delete all properties. Reinsert all methods // and properties from the new type prototype (#2270, #3719) this.remove(false, null, false); for (n in proto) { this[n] = UNDEFINED; } extend(this, seriesTypes[newOptions.type || oldType].prototype); // Re-register groups (#3094) each(preserve, function (prop) { series[prop] = preserve[prop]; }); this.init(chart, newOptions); chart.linkSeries(); // Links are lost in this.remove (#3028) if (pick(redraw, true)) { chart.redraw(false); } } }); // Extend the Axis.prototype for dynamic methods extend(Axis.prototype, { /** * Update the axis with a new options structure */ update: function (newOptions, redraw) { var chart = this.chart; newOptions = chart.options[this.coll][this.options.index] = merge(this.userOptions, newOptions); this.destroy(true); this.init(chart, extend(newOptions, { events: UNDEFINED })); chart.isDirtyBox = true; if (pick(redraw, true)) { chart.redraw(); } }, /** * Remove the axis from the chart */ remove: function (redraw) { var chart = this.chart, key = this.coll, // xAxis or yAxis axisSeries = this.series, i = axisSeries.length; // Remove associated series (#2687) while (i--) { if (axisSeries[i]) { axisSeries[i].remove(false); } } // Remove the axis erase(chart.axes, this); erase(chart[key], this); chart.options[key].splice(this.options.index, 1); each(chart[key], function (axis, i) { // Re-index, #1706 axis.options.index = i; }); this.destroy(); chart.isDirtyBox = true; if (pick(redraw, true)) { chart.redraw(); } }, /** * Update the axis title by options */ setTitle: function (newTitleOptions, redraw) { this.update({ title: newTitleOptions }, redraw); }, /** * Set new axis categories and optionally redraw * @param {Array} categories * @param {Boolean} redraw */ setCategories: function (categories, redraw) { this.update({ categories: categories }, redraw); } }); /** * LineSeries object */ var LineSeries = extendClass(Series); seriesTypes.line = LineSeries; /** * Set the default options for area */ defaultPlotOptions.area = merge(defaultSeriesOptions, { softThreshold: false, threshold: 0 // trackByArea: false, // lineColor: null, // overrides color, but lets fillColor be unaltered // fillOpacity: 0.75, // fillColor: null }); /** * AreaSeries object */ var AreaSeries = extendClass(Series, { type: 'area', singleStacks: false, /** * Return an array of stacked points, where null and missing points are replaced by * dummy points in order for gaps to be drawn correctly in stacks. */ getStackPoints: function () { var series = this, segment = [], keys = [], xAxis = this.xAxis, yAxis = this.yAxis, stack = yAxis.stacks[this.stackKey], pointMap = {}, points = this.points, seriesIndex = series.index, yAxisSeries = yAxis.series, seriesLength = yAxisSeries.length, visibleSeries, upOrDown = pick(yAxis.options.reversedStacks, true) ? 1 : -1, i, x; if (this.options.stacking) { // Create a map where we can quickly look up the points by their X value. for (i = 0; i < points.length; i++) { pointMap[points[i].x] = points[i]; } // Sort the keys (#1651) for (x in stack) { if (stack[x].total !== null) { // nulled after switching between grouping and not (#1651, #2336) keys.push(x); } } keys.sort(function (a, b) { return a - b; }); visibleSeries = map(yAxisSeries, function () { return this.visible; }); each(keys, function (x, idx) { var y = 0, stackPoint, stackedValues; if (pointMap[x] && !pointMap[x].isNull) { segment.push(pointMap[x]); // Find left and right cliff. -1 goes left, 1 goes right. each([-1, 1], function (direction) { var nullName = direction === 1 ? 'rightNull' : 'leftNull', cliffName = direction === 1 ? 'rightCliff' : 'leftCliff', cliff = 0, otherStack = stack[keys[idx + direction]]; // If there is a stack next to this one, to the left or to the right... if (otherStack) { i = seriesIndex; while (i >= 0 && i < seriesLength) { // Can go either up or down, depending on reversedStacks stackPoint = otherStack.points[i]; if (!stackPoint) { // If the next point in this series is missing, mark the point // with point.leftNull or point.rightNull = true. if (i === seriesIndex) { pointMap[x][nullName] = true; // If there are missing points in the next stack in any of the // series below this one, we need to substract the missing values // and add a hiatus to the left or right. } else if (visibleSeries[i]) { stackedValues = stack[x].points[i]; if (stackedValues) { cliff -= stackedValues[1] - stackedValues[0]; } } } // When reversedStacks is true, loop up, else loop down i += upOrDown; } } pointMap[x][cliffName] = cliff; }); // There is no point for this X value in this series, so we // insert a dummy point in order for the areas to be drawn // correctly. } else { // Loop down the stack to find the series below this one that has // a value (#1991) i = seriesIndex; while (i >= 0 && i < seriesLength) { stackPoint = stack[x].points[i]; if (stackPoint) { y = stackPoint[1]; break; } // When reversedStacks is true, loop up, else loop down i += upOrDown; } y = yAxis.toPixels(y, true); segment.push({ isNull: true, plotX: xAxis.toPixels(x, true), plotY: y, yBottom: y }); } }); } return segment; }, getGraphPath: function (points) { var getGraphPath = Series.prototype.getGraphPath, graphPath, options = this.options, stacking = options.stacking, yAxis = this.yAxis, topPath, //topPoints = [], bottomPath, bottomPoints = [], graphPoints = [], seriesIndex = this.index, i, areaPath, plotX, stacks = yAxis.stacks[this.stackKey], threshold = options.threshold, translatedThreshold = yAxis.getThreshold(options.threshold), isNull, yBottom, connectNulls = options.connectNulls || stacking === 'percent', /** * To display null points in underlying stacked series, this series graph must be * broken, and the area also fall down to fill the gap left by the null point. #2069 */ addDummyPoints = function (i, otherI, side) { var point = points[i], stackedValues = stacking && stacks[point.x].points[seriesIndex], nullVal = point[side + 'Null'] || 0, cliffVal = point[side + 'Cliff'] || 0, top, bottom, isNull = true; if (cliffVal || nullVal) { top = (nullVal ? stackedValues[0] : stackedValues[1]) + cliffVal; bottom = stackedValues[0] + cliffVal; isNull = !!nullVal; } else if (!stacking && points[otherI] && points[otherI].isNull) { top = bottom = threshold; } // Add to the top and bottom line of the area if (top !== undefined) { graphPoints.push({ plotX: plotX, plotY: top === null ? translatedThreshold : yAxis.getThreshold(top), isNull: isNull }); bottomPoints.push({ plotX: plotX, plotY: bottom === null ? translatedThreshold : yAxis.getThreshold(bottom), doCurve: false // #1041, gaps in areaspline areas }); } }; // Find what points to use points = points || this.points; // Fill in missing points if (stacking) { points = this.getStackPoints(); } for (i = 0; i < points.length; i++) { isNull = points[i].isNull; plotX = pick(points[i].rectPlotX, points[i].plotX); yBottom = pick(points[i].yBottom, translatedThreshold); if (!isNull || connectNulls) { if (!connectNulls) { addDummyPoints(i, i - 1, 'left'); } if (!(isNull && !stacking && connectNulls)) { // Skip null point when stacking is false and connectNulls true graphPoints.push(points[i]); bottomPoints.push({ x: i, plotX: plotX, plotY: yBottom }); } if (!connectNulls) { addDummyPoints(i, i + 1, 'right'); } } } topPath = getGraphPath.call(this, graphPoints, true, true); bottomPoints.reversed = true; bottomPath = getGraphPath.call(this, bottomPoints, true, true); if (bottomPath.length) { bottomPath[0] = L; } areaPath = topPath.concat(bottomPath); graphPath = getGraphPath.call(this, graphPoints, false, connectNulls); // TODO: don't set leftCliff and rightCliff when connectNulls? areaPath.xMap = topPath.xMap; this.areaPath = areaPath; return graphPath; }, /** * Draw the graph and the underlying area. This method calls the Series base * function and adds the area. The areaPath is calculated in the getSegmentPath * method called from Series.prototype.drawGraph. */ drawGraph: function () { // Define or reset areaPath this.areaPath = []; // Call the base method Series.prototype.drawGraph.apply(this); // Define local variables var series = this, areaPath = this.areaPath, options = this.options, zones = this.zones, props = [['area', this.color, options.fillColor]]; // area name, main color, fill color each(zones, function (threshold, i) { props.push(['zoneArea' + i, threshold.color || series.color, threshold.fillColor || options.fillColor]); }); each(props, function (prop) { var areaKey = prop[0], area = series[areaKey], attr; // Create or update the area if (area) { // update area.endX = areaPath.xMap; area.animate({ d: areaPath }); } else { // create attr = { fill: prop[2] || prop[1], zIndex: 0 // #1069 }; if (!prop[2]) { attr['fill-opacity'] = pick(options.fillOpacity, 0.75); } area = series[areaKey] = series.chart.renderer.path(areaPath) .attr(attr) .add(series.group); area.isArea = true; } area.startX = areaPath.xMap; area.shiftUnit = options.step ? 2 : 1; }); }, drawLegendSymbol: LegendSymbolMixin.drawRectangle }); seriesTypes.area = AreaSeries; /** * Set the default options for spline */ defaultPlotOptions.spline = merge(defaultSeriesOptions); /** * SplineSeries object */ var SplineSeries = extendClass(Series, { type: 'spline', /** * Get the spline segment from a given point's previous neighbour to the given point */ getPointSpline: function (points, point, i) { var smoothing = 1.5, // 1 means control points midway between points, 2 means 1/3 from the point, 3 is 1/4 etc denom = smoothing + 1, plotX = point.plotX, plotY = point.plotY, lastPoint = points[i - 1], nextPoint = points[i + 1], leftContX, leftContY, rightContX, rightContY, ret; function doCurve(otherPoint) { return otherPoint && !otherPoint.isNull && otherPoint.doCurve !== false; } // Find control points if (doCurve(lastPoint) && doCurve(nextPoint)) { var lastX = lastPoint.plotX, lastY = lastPoint.plotY, nextX = nextPoint.plotX, nextY = nextPoint.plotY, correction = 0; leftContX = (smoothing * plotX + lastX) / denom; leftContY = (smoothing * plotY + lastY) / denom; rightContX = (smoothing * plotX + nextX) / denom; rightContY = (smoothing * plotY + nextY) / denom; // Have the two control points make a straight line through main point if (rightContX !== leftContX) { // #5016, division by zero correction = ((rightContY - leftContY) * (rightContX - plotX)) / (rightContX - leftContX) + plotY - rightContY; } leftContY += correction; rightContY += correction; // to prevent false extremes, check that control points are between // neighbouring points' y values if (leftContY > lastY && leftContY > plotY) { leftContY = mathMax(lastY, plotY); rightContY = 2 * plotY - leftContY; // mirror of left control point } else if (leftContY < lastY && leftContY < plotY) { leftContY = mathMin(lastY, plotY); rightContY = 2 * plotY - leftContY; } if (rightContY > nextY && rightContY > plotY) { rightContY = mathMax(nextY, plotY); leftContY = 2 * plotY - rightContY; } else if (rightContY < nextY && rightContY < plotY) { rightContY = mathMin(nextY, plotY); leftContY = 2 * plotY - rightContY; } // record for drawing in next point point.rightContX = rightContX; point.rightContY = rightContY; } // Visualize control points for debugging /* if (leftContX) { this.chart.renderer.circle(leftContX + this.chart.plotLeft, leftContY + this.chart.plotTop, 2) .attr({ stroke: 'red', 'stroke-width': 2, fill: 'none', zIndex: 9 }) .add(); this.chart.renderer.path(['M', leftContX + this.chart.plotLeft, leftContY + this.chart.plotTop, 'L', plotX + this.chart.plotLeft, plotY + this.chart.plotTop]) .attr({ stroke: 'red', 'stroke-width': 2, zIndex: 9 }) .add(); } if (rightContX) { this.chart.renderer.circle(rightContX + this.chart.plotLeft, rightContY + this.chart.plotTop, 2) .attr({ stroke: 'green', 'stroke-width': 2, fill: 'none', zIndex: 9 }) .add(); this.chart.renderer.path(['M', rightContX + this.chart.plotLeft, rightContY + this.chart.plotTop, 'L', plotX + this.chart.plotLeft, plotY + this.chart.plotTop]) .attr({ stroke: 'green', 'stroke-width': 2, zIndex: 9 }) .add(); } // */ ret = [ 'C', pick(lastPoint.rightContX, lastPoint.plotX), pick(lastPoint.rightContY, lastPoint.plotY), pick(leftContX, plotX), pick(leftContY, plotY), plotX, plotY ]; lastPoint.rightContX = lastPoint.rightContY = null; // reset for updating series later return ret; } }); seriesTypes.spline = SplineSeries; /** * Set the default options for areaspline */ defaultPlotOptions.areaspline = merge(defaultPlotOptions.area); /** * AreaSplineSeries object */ var areaProto = AreaSeries.prototype, AreaSplineSeries = extendClass(SplineSeries, { type: 'areaspline', getStackPoints: areaProto.getStackPoints, getGraphPath: areaProto.getGraphPath, setStackCliffs: areaProto.setStackCliffs, drawGraph: areaProto.drawGraph, drawLegendSymbol: LegendSymbolMixin.drawRectangle }); seriesTypes.areaspline = AreaSplineSeries; /** * Set the default options for column */ defaultPlotOptions.column = merge(defaultSeriesOptions, { borderColor: '#FFFFFF', //borderWidth: 1, borderRadius: 0, //colorByPoint: undefined, groupPadding: 0.2, //grouping: true, marker: null, // point options are specified in the base options pointPadding: 0.1, //pointWidth: null, minPointLength: 0, cropThreshold: 50, // when there are more points, they will not animate out of the chart on xAxis.setExtremes pointRange: null, // null means auto, meaning 1 in a categorized axis and least distance between points if not categories states: { hover: { brightness: 0.1, shadow: false, halo: false }, select: { color: '#C0C0C0', borderColor: '#000000', shadow: false } }, dataLabels: { align: null, // auto verticalAlign: null, // auto y: null }, softThreshold: false, startFromThreshold: true, // false doesn't work well: http://jsfiddle.net/highcharts/hz8fopan/14/ stickyTracking: false, tooltip: { distance: 6 }, threshold: 0 }); /** * ColumnSeries object */ var ColumnSeries = extendClass(Series, { type: 'column', pointAttrToOptions: { // mapping between SVG attributes and the corresponding options stroke: 'borderColor', fill: 'color', r: 'borderRadius' }, cropShoulder: 0, directTouch: true, // When tooltip is not shared, this series (and derivatives) requires direct touch/hover. KD-tree does not apply. trackerGroups: ['group', 'dataLabelsGroup'], negStacks: true, // use separate negative stacks, unlike area stacks where a negative // point is substracted from previous (#1910) /** * Initialize the series */ init: function () { Series.prototype.init.apply(this, arguments); var series = this, chart = series.chart; // if the series is added dynamically, force redraw of other // series affected by a new column if (chart.hasRendered) { each(chart.series, function (otherSeries) { if (otherSeries.type === series.type) { otherSeries.isDirty = true; } }); } }, /** * Return the width and x offset of the columns adjusted for grouping, groupPadding, pointPadding, * pointWidth etc. */ getColumnMetrics: function () { var series = this, options = series.options, xAxis = series.xAxis, yAxis = series.yAxis, reversedXAxis = xAxis.reversed, stackKey, stackGroups = {}, columnCount = 0; // Get the total number of column type series. // This is called on every series. Consider moving this logic to a // chart.orderStacks() function and call it on init, addSeries and removeSeries if (options.grouping === false) { columnCount = 1; } else { each(series.chart.series, function (otherSeries) { var otherOptions = otherSeries.options, otherYAxis = otherSeries.yAxis, columnIndex; if (otherSeries.type === series.type && otherSeries.visible && yAxis.len === otherYAxis.len && yAxis.pos === otherYAxis.pos) { // #642, #2086 if (otherOptions.stacking) { stackKey = otherSeries.stackKey; if (stackGroups[stackKey] === UNDEFINED) { stackGroups[stackKey] = columnCount++; } columnIndex = stackGroups[stackKey]; } else if (otherOptions.grouping !== false) { // #1162 columnIndex = columnCount++; } otherSeries.columnIndex = columnIndex; } }); } var categoryWidth = mathMin( mathAbs(xAxis.transA) * (xAxis.ordinalSlope || options.pointRange || xAxis.closestPointRange || xAxis.tickInterval || 1), // #2610 xAxis.len // #1535 ), groupPadding = categoryWidth * options.groupPadding, groupWidth = categoryWidth - 2 * groupPadding, pointOffsetWidth = groupWidth / columnCount, pointWidth = mathMin( options.maxPointWidth || xAxis.len, pick(options.pointWidth, pointOffsetWidth * (1 - 2 * options.pointPadding)) ), pointPadding = (pointOffsetWidth - pointWidth) / 2, colIndex = (series.columnIndex || 0) + (reversedXAxis ? 1 : 0), // #1251, #3737 pointXOffset = pointPadding + (groupPadding + colIndex * pointOffsetWidth - (categoryWidth / 2)) * (reversedXAxis ? -1 : 1); // Save it for reading in linked series (Error bars particularly) series.columnMetrics = { width: pointWidth, offset: pointXOffset }; return series.columnMetrics; }, /** * Make the columns crisp. The edges are rounded to the nearest full pixel. */ crispCol: function (x, y, w, h) { var chart = this.chart, borderWidth = this.borderWidth, xCrisp = -(borderWidth % 2 ? 0.5 : 0), yCrisp = borderWidth % 2 ? 0.5 : 1, right, bottom, fromTop; if (chart.inverted && chart.renderer.isVML) { yCrisp += 1; } // Horizontal. We need to first compute the exact right edge, then round it // and compute the width from there. right = Math.round(x + w) + xCrisp; x = Math.round(x) + xCrisp; w = right - x; // Vertical bottom = Math.round(y + h) + yCrisp; fromTop = mathAbs(y) <= 0.5 && bottom > 0.5; // #4504, #4656 y = Math.round(y) + yCrisp; h = bottom - y; // Top edges are exceptions if (fromTop && h) { // #5146 y -= 1; h += 1; } return { x: x, y: y, width: w, height: h }; }, /** * Translate each point to the plot area coordinate system and find shape positions */ translate: function () { var series = this, chart = series.chart, options = series.options, borderWidth = series.borderWidth = pick( options.borderWidth, series.closestPointRange * series.xAxis.transA < 2 ? 0 : 1 // #3635 ), yAxis = series.yAxis, threshold = options.threshold, translatedThreshold = series.translatedThreshold = yAxis.getThreshold(threshold), minPointLength = pick(options.minPointLength, 5), metrics = series.getColumnMetrics(), pointWidth = metrics.width, seriesBarW = series.barW = mathMax(pointWidth, 1 + 2 * borderWidth), // postprocessed for border width pointXOffset = series.pointXOffset = metrics.offset; if (chart.inverted) { translatedThreshold -= 0.5; // #3355 } // When the pointPadding is 0, we want the columns to be packed tightly, so we allow individual // columns to have individual sizes. When pointPadding is greater, we strive for equal-width // columns (#2694). if (options.pointPadding) { seriesBarW = mathCeil(seriesBarW); } Series.prototype.translate.apply(series); // Record the new values each(series.points, function (point) { var yBottom = mathMin(pick(point.yBottom, translatedThreshold), 9e4), // #3575 safeDistance = 999 + mathAbs(yBottom), plotY = mathMin(mathMax(-safeDistance, point.plotY), yAxis.len + safeDistance), // Don't draw too far outside plot area (#1303, #2241, #4264) barX = point.plotX + pointXOffset, barW = seriesBarW, barY = mathMin(plotY, yBottom), up, barH = mathMax(plotY, yBottom) - barY; // Handle options.minPointLength if (mathAbs(barH) < minPointLength) { if (minPointLength) { barH = minPointLength; up = (!yAxis.reversed && !point.negative) || (yAxis.reversed && point.negative); barY = mathAbs(barY - translatedThreshold) > minPointLength ? // stacked yBottom - minPointLength : // keep position translatedThreshold - (up ? minPointLength : 0); // #1485, #4051 } } // Cache for access in polar point.barX = barX; point.pointWidth = pointWidth; // Fix the tooltip on center of grouped columns (#1216, #424, #3648) point.tooltipPos = chart.inverted ? [yAxis.len + yAxis.pos - chart.plotLeft - plotY, series.xAxis.len - barX - barW / 2, barH] : [barX + barW / 2, plotY + yAxis.pos - chart.plotTop, barH]; // Register shape type and arguments to be used in drawPoints point.shapeType = 'rect'; point.shapeArgs = series.crispCol.apply( series, point.isNull ? [point.plotX, yAxis.len / 2, 0, 0] : // #3169, drilldown from null must have a position to work from [barX, barY, barW, barH] ); }); }, getSymbol: noop, /** * Use a solid rectangle like the area series types */ drawLegendSymbol: LegendSymbolMixin.drawRectangle, /** * Columns have no graph */ drawGraph: noop, /** * Draw the columns. For bars, the series.group is rotated, so the same coordinates * apply for columns and bars. This method is inherited by scatter series. * */ drawPoints: function () { var series = this, chart = this.chart, options = series.options, renderer = chart.renderer, animationLimit = options.animationLimit || 250, shapeArgs, pointAttr; // draw the columns each(series.points, function (point) { var plotY = point.plotY, graphic = point.graphic, borderAttr; if (isNumber(plotY) && point.y !== null) { shapeArgs = point.shapeArgs; borderAttr = defined(series.borderWidth) ? { 'stroke-width': series.borderWidth } : {}; pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || series.pointAttr[NORMAL_STATE]; if (graphic) { // update stop(graphic); graphic.attr(borderAttr).attr(pointAttr)[chart.pointCount < animationLimit ? 'animate' : 'attr'](merge(shapeArgs)); // #4267 } else { point.graphic = graphic = renderer[point.shapeType](shapeArgs) .attr(borderAttr) .attr(pointAttr) .add(point.group || series.group) .shadow(options.shadow, null, options.stacking && !options.borderRadius); } } else if (graphic) { point.graphic = graphic.destroy(); // #1269 } }); }, /** * Animate the column heights one by one from zero * @param {Boolean} init Whether to initialize the animation or run it */ animate: function (init) { var series = this, yAxis = this.yAxis, options = series.options, inverted = this.chart.inverted, attr = {}, translatedThreshold; if (hasSVG) { // VML is too slow anyway if (init) { attr.scaleY = 0.001; translatedThreshold = mathMin(yAxis.pos + yAxis.len, mathMax(yAxis.pos, yAxis.toPixels(options.threshold))); if (inverted) { attr.translateX = translatedThreshold - yAxis.len; } else { attr.translateY = translatedThreshold; } series.group.attr(attr); } else { // run the animation attr[inverted ? 'translateX' : 'translateY'] = yAxis.pos; series.group.animate(attr, extend(animObject(series.options.animation), { // Do the scale synchronously to ensure smooth updating (#5030) step: function (val, fx) { series.group.attr({ scaleY: mathMax(0.001, fx.pos) // #5250 }); } })); // delete this function to allow it only once series.animate = null; } } }, /** * Remove this series from the chart */ remove: function () { var series = this, chart = series.chart; // column and bar series affects other series of the same type // as they are either stacked or grouped if (chart.hasRendered) { each(chart.series, function (otherSeries) { if (otherSeries.type === series.type) { otherSeries.isDirty = true; } }); } Series.prototype.remove.apply(series, arguments); } }); seriesTypes.column = ColumnSeries; /** * Set the default options for bar */ defaultPlotOptions.bar = merge(defaultPlotOptions.column); /** * The Bar series class */ var BarSeries = extendClass(ColumnSeries, { type: 'bar', inverted: true }); seriesTypes.bar = BarSeries; /** * Set the default options for scatter */ defaultPlotOptions.scatter = merge(defaultSeriesOptions, { lineWidth: 0, marker: { enabled: true // Overrides auto-enabling in line series (#3647) }, tooltip: { headerFormat: '\u25CF {series.name}
          ', pointFormat: 'x: {point.x}
          y: {point.y}
          ' } }); /** * The scatter series class */ var ScatterSeries = extendClass(Series, { type: 'scatter', sorted: false, requireSorting: false, noSharedTooltip: true, trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'], takeOrdinalPosition: false, // #2342 kdDimensions: 2, drawGraph: function () { if (this.options.lineWidth) { Series.prototype.drawGraph.call(this); } } }); seriesTypes.scatter = ScatterSeries; /** * Set the default options for pie */ defaultPlotOptions.pie = merge(defaultSeriesOptions, { borderColor: '#FFFFFF', borderWidth: 1, center: [null, null], clip: false, colorByPoint: true, // always true for pies dataLabels: { // align: null, // connectorWidth: 1, // connectorColor: point.color, // connectorPadding: 5, distance: 30, enabled: true, formatter: function () { // #2945 return this.y === null ? undefined : this.point.name; }, // softConnector: true, x: 0 // y: 0 }, ignoreHiddenPoint: true, //innerSize: 0, legendType: 'point', marker: null, // point options are specified in the base options size: null, showInLegend: false, slicedOffset: 10, states: { hover: { brightness: 0.1, shadow: false } }, stickyTracking: false, tooltip: { followPointer: true } }); /** * Extended point object for pies */ var PiePoint = extendClass(Point, { /** * Initiate the pie slice */ init: function () { Point.prototype.init.apply(this, arguments); var point = this, toggleSlice; point.name = pick(point.name, 'Slice'); // add event listener for select toggleSlice = function (e) { point.slice(e.type === 'select'); }; addEvent(point, 'select', toggleSlice); addEvent(point, 'unselect', toggleSlice); return point; }, /** * Toggle the visibility of the pie slice * @param {Boolean} vis Whether to show the slice or not. If undefined, the * visibility is toggled */ setVisible: function (vis, redraw) { var point = this, series = point.series, chart = series.chart, ignoreHiddenPoint = series.options.ignoreHiddenPoint; redraw = pick(redraw, ignoreHiddenPoint); if (vis !== point.visible) { // If called without an argument, toggle visibility point.visible = point.options.visible = vis = vis === UNDEFINED ? !point.visible : vis; series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data // Show and hide associated elements. This is performed regardless of redraw or not, // because chart.redraw only handles full series. each(['graphic', 'dataLabel', 'connector', 'shadowGroup'], function (key) { if (point[key]) { point[key][vis ? 'show' : 'hide'](true); } }); if (point.legendItem) { chart.legend.colorizeItem(point, vis); } // #4170, hide halo after hiding point if (!vis && point.state === 'hover') { point.setState(''); } // Handle ignore hidden slices if (ignoreHiddenPoint) { series.isDirty = true; } if (redraw) { chart.redraw(); } } }, /** * Set or toggle whether the slice is cut out from the pie * @param {Boolean} sliced When undefined, the slice state is toggled * @param {Boolean} redraw Whether to redraw the chart. True by default. */ slice: function (sliced, redraw, animation) { var point = this, series = point.series, chart = series.chart, translation; setAnimation(animation, chart); // redraw is true by default redraw = pick(redraw, true); // if called without an argument, toggle point.sliced = point.options.sliced = sliced = defined(sliced) ? sliced : !point.sliced; series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data translation = sliced ? point.slicedTranslation : { translateX: 0, translateY: 0 }; point.graphic.animate(translation); if (point.shadowGroup) { point.shadowGroup.animate(translation); } }, haloPath: function (size) { var shapeArgs = this.shapeArgs, chart = this.series.chart; return this.sliced || !this.visible ? [] : this.series.chart.renderer.symbols.arc(chart.plotLeft + shapeArgs.x, chart.plotTop + shapeArgs.y, shapeArgs.r + size, shapeArgs.r + size, { innerR: this.shapeArgs.r, start: shapeArgs.start, end: shapeArgs.end }); } }); /** * The Pie series class */ var PieSeries = { type: 'pie', isCartesian: false, pointClass: PiePoint, requireSorting: false, directTouch: true, noSharedTooltip: true, trackerGroups: ['group', 'dataLabelsGroup'], axisTypes: [], pointAttrToOptions: { // mapping between SVG attributes and the corresponding options stroke: 'borderColor', 'stroke-width': 'borderWidth', fill: 'color' }, /** * Animate the pies in */ animate: function (init) { var series = this, points = series.points, startAngleRad = series.startAngleRad; if (!init) { each(points, function (point) { var graphic = point.graphic, args = point.shapeArgs; if (graphic) { // start values graphic.attr({ r: point.startR || (series.center[3] / 2), // animate from inner radius (#779) start: startAngleRad, end: startAngleRad }); // animate graphic.animate({ r: args.r, start: args.start, end: args.end }, series.options.animation); } }); // delete this function to allow it only once series.animate = null; } }, /** * Recompute total chart sum and update percentages of points. */ updateTotals: function () { var i, total = 0, points = this.points, len = points.length, point, ignoreHiddenPoint = this.options.ignoreHiddenPoint; // Get the total sum for (i = 0; i < len; i++) { point = points[i]; // Disallow negative values (#1530, #3623, #5322) if (point.y < 0) { point.y = null; } total += (ignoreHiddenPoint && !point.visible) ? 0 : point.y; } this.total = total; // Set each point's properties for (i = 0; i < len; i++) { point = points[i]; point.percentage = (total > 0 && (point.visible || !ignoreHiddenPoint)) ? point.y / total * 100 : 0; point.total = total; } }, /** * Extend the generatePoints method by adding total and percentage properties to each point */ generatePoints: function () { Series.prototype.generatePoints.call(this); this.updateTotals(); }, /** * Do translation for pie slices */ translate: function (positions) { this.generatePoints(); var series = this, cumulative = 0, precision = 1000, // issue #172 options = series.options, slicedOffset = options.slicedOffset, connectorOffset = slicedOffset + options.borderWidth, start, end, angle, startAngle = options.startAngle || 0, startAngleRad = series.startAngleRad = mathPI / 180 * (startAngle - 90), endAngleRad = series.endAngleRad = mathPI / 180 * ((pick(options.endAngle, startAngle + 360)) - 90), circ = endAngleRad - startAngleRad, //2 * mathPI, points = series.points, radiusX, // the x component of the radius vector for a given point radiusY, labelDistance = options.dataLabels.distance, ignoreHiddenPoint = options.ignoreHiddenPoint, i, len = points.length, point; // Get positions - either an integer or a percentage string must be given. // If positions are passed as a parameter, we're in a recursive loop for adjusting // space for data labels. if (!positions) { series.center = positions = series.getCenter(); } // utility for getting the x value from a given y, used for anticollision logic in data labels series.getX = function (y, left) { angle = math.asin(mathMin((y - positions[1]) / (positions[2] / 2 + labelDistance), 1)); return positions[0] + (left ? -1 : 1) * (mathCos(angle) * (positions[2] / 2 + labelDistance)); }; // Calculate the geometry for each point for (i = 0; i < len; i++) { point = points[i]; // set start and end angle start = startAngleRad + (cumulative * circ); if (!ignoreHiddenPoint || point.visible) { cumulative += point.percentage / 100; } end = startAngleRad + (cumulative * circ); // set the shape point.shapeType = 'arc'; point.shapeArgs = { x: positions[0], y: positions[1], r: positions[2] / 2, innerR: positions[3] / 2, start: mathRound(start * precision) / precision, end: mathRound(end * precision) / precision }; // The angle must stay within -90 and 270 (#2645) angle = (end + start) / 2; if (angle > 1.5 * mathPI) { angle -= 2 * mathPI; } else if (angle < -mathPI / 2) { angle += 2 * mathPI; } // Center for the sliced out slice point.slicedTranslation = { translateX: mathRound(mathCos(angle) * slicedOffset), translateY: mathRound(mathSin(angle) * slicedOffset) }; // set the anchor point for tooltips radiusX = mathCos(angle) * positions[2] / 2; radiusY = mathSin(angle) * positions[2] / 2; point.tooltipPos = [ positions[0] + radiusX * 0.7, positions[1] + radiusY * 0.7 ]; point.half = angle < -mathPI / 2 || angle > mathPI / 2 ? 1 : 0; point.angle = angle; // set the anchor point for data labels connectorOffset = mathMin(connectorOffset, labelDistance / 2); // #1678 point.labelPos = [ positions[0] + radiusX + mathCos(angle) * labelDistance, // first break of connector positions[1] + radiusY + mathSin(angle) * labelDistance, // a/a positions[0] + radiusX + mathCos(angle) * connectorOffset, // second break, right outside pie positions[1] + radiusY + mathSin(angle) * connectorOffset, // a/a positions[0] + radiusX, // landing point for connector positions[1] + radiusY, // a/a labelDistance < 0 ? // alignment 'center' : point.half ? 'right' : 'left', // alignment angle // center angle ]; } }, drawGraph: null, /** * Draw the data points */ drawPoints: function () { var series = this, chart = series.chart, renderer = chart.renderer, groupTranslation, //center, graphic, //group, shadow = series.options.shadow, shadowGroup, pointAttr, shapeArgs, attr; if (shadow && !series.shadowGroup) { series.shadowGroup = renderer.g('shadow') .add(series.group); } // draw the slices each(series.points, function (point) { if (point.y !== null) { graphic = point.graphic; shapeArgs = point.shapeArgs; shadowGroup = point.shadowGroup; pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE]; if (!pointAttr.stroke) { pointAttr.stroke = pointAttr.fill; } // put the shadow behind all points if (shadow && !shadowGroup) { shadowGroup = point.shadowGroup = renderer.g('shadow') .add(series.shadowGroup); } // if the point is sliced, use special translation, else use plot area traslation groupTranslation = point.sliced ? point.slicedTranslation : { translateX: 0, translateY: 0 }; //group.translate(groupTranslation[0], groupTranslation[1]); if (shadowGroup) { shadowGroup.attr(groupTranslation); } // draw the slice if (graphic) { graphic .setRadialReference(series.center) .attr(pointAttr) .animate(extend(shapeArgs, groupTranslation)); } else { attr = { 'stroke-linejoin': 'round' }; if (!point.visible) { attr.visibility = 'hidden'; } point.graphic = graphic = renderer[point.shapeType](shapeArgs) .setRadialReference(series.center) .attr(pointAttr) .attr(attr) .attr(groupTranslation) .add(series.group) .shadow(shadow, shadowGroup); } } }); }, searchPoint: noop, /** * Utility for sorting data labels */ sortByAngle: function (points, sign) { points.sort(function (a, b) { return a.angle !== undefined && (b.angle - a.angle) * sign; }); }, /** * Use a simple symbol from LegendSymbolMixin */ drawLegendSymbol: LegendSymbolMixin.drawRectangle, /** * Use the getCenter method from drawLegendSymbol */ getCenter: CenteredSeriesMixin.getCenter, /** * Pies don't have point marker symbols */ getSymbol: noop }; PieSeries = extendClass(Series, PieSeries); seriesTypes.pie = PieSeries; /** * Draw the data labels */ Series.prototype.drawDataLabels = function () { var series = this, seriesOptions = series.options, cursor = seriesOptions.cursor, options = seriesOptions.dataLabels, points = series.points, pointOptions, generalOptions, hasRendered = series.hasRendered || 0, str, dataLabelsGroup, defer = pick(options.defer, true), renderer = series.chart.renderer; if (options.enabled || series._hasPointLabels) { // Process default alignment of data labels for columns if (series.dlProcessOptions) { series.dlProcessOptions(options); } // Create a separate group for the data labels to avoid rotation dataLabelsGroup = series.plotGroup( 'dataLabelsGroup', 'data-labels', defer && !hasRendered ? 'hidden' : 'visible', // #5133 options.zIndex || 6 ); if (defer) { dataLabelsGroup.attr({ opacity: +hasRendered }); // #3300 if (!hasRendered) { addEvent(series, 'afterAnimate', function () { if (series.visible) { // #2597, #3023, #3024 dataLabelsGroup.show(true); } dataLabelsGroup[seriesOptions.animation ? 'animate' : 'attr']({ opacity: 1 }, { duration: 200 }); }); } } // Make the labels for each point generalOptions = options; each(points, function (point) { var enabled, dataLabel = point.dataLabel, labelConfig, attr, name, rotation, connector = point.connector, isNew = true, style, moreStyle = {}; // Determine if each data label is enabled pointOptions = point.dlOptions || (point.options && point.options.dataLabels); // dlOptions is used in treemaps enabled = pick(pointOptions && pointOptions.enabled, generalOptions.enabled) && point.y !== null; // #2282, #4641 // If the point is outside the plot area, destroy it. #678, #820 if (dataLabel && !enabled) { point.dataLabel = dataLabel.destroy(); // Individual labels are disabled if the are explicitly disabled // in the point options, or if they fall outside the plot area. } else if (enabled) { // Create individual options structure that can be extended without // affecting others options = merge(generalOptions, pointOptions); style = options.style; rotation = options.rotation; // Get the string labelConfig = point.getLabelConfig(); str = options.format ? format(options.format, labelConfig) : options.formatter.call(labelConfig, options); // Determine the color style.color = pick(options.color, style.color, series.color, 'black'); // update existing label if (dataLabel) { if (defined(str)) { dataLabel .attr({ text: str }); isNew = false; } else { // #1437 - the label is shown conditionally point.dataLabel = dataLabel = dataLabel.destroy(); if (connector) { point.connector = connector.destroy(); } } // create new label } else if (defined(str)) { attr = { //align: align, fill: options.backgroundColor, stroke: options.borderColor, 'stroke-width': options.borderWidth, r: options.borderRadius || 0, rotation: rotation, padding: options.padding, zIndex: 1 }; // Get automated contrast color if (style.color === 'contrast') { moreStyle.color = options.inside || options.distance < 0 || !!seriesOptions.stacking ? renderer.getContrast(point.color || series.color) : '#000000'; } if (cursor) { moreStyle.cursor = cursor; } // Remove unused attributes (#947) for (name in attr) { if (attr[name] === UNDEFINED) { delete attr[name]; } } dataLabel = point.dataLabel = renderer[rotation ? 'text' : 'label']( // labels don't support rotation str, 0, -9999, options.shape, null, null, options.useHTML ) .attr(attr) .css(extend(style, moreStyle)) .add(dataLabelsGroup) .shadow(options.shadow); } if (dataLabel) { // Now the data label is created and placed at 0,0, so we need to align it series.alignDataLabel(point, dataLabel, options, null, isNew); } } }); } }; /** * Align each individual data label */ Series.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) { var chart = this.chart, inverted = chart.inverted, plotX = pick(point.plotX, -9999), plotY = pick(point.plotY, -9999), bBox = dataLabel.getBBox(), baseline = chart.renderer.fontMetrics(options.style.fontSize).b, rotation = options.rotation, normRotation, negRotation, align = options.align, rotCorr, // rotation correction // Math.round for rounding errors (#2683), alignTo to allow column labels (#2700) visible = this.visible && (point.series.forceDL || chart.isInsidePlot(plotX, mathRound(plotY), inverted) || (alignTo && chart.isInsidePlot(plotX, inverted ? alignTo.x + 1 : alignTo.y + alignTo.height - 1, inverted))), alignAttr, // the final position; justify = pick(options.overflow, 'justify') === 'justify'; if (visible) { // The alignment box is a singular point alignTo = extend({ x: inverted ? chart.plotWidth - plotY : plotX, y: mathRound(inverted ? chart.plotHeight - plotX : plotY), width: 0, height: 0 }, alignTo); // Add the text size for alignment calculation extend(options, { width: bBox.width, height: bBox.height }); // Allow a hook for changing alignment in the last moment, then do the alignment if (rotation) { justify = false; // Not supported for rotated text rotCorr = chart.renderer.rotCorr(baseline, rotation); // #3723 alignAttr = { x: alignTo.x + options.x + alignTo.width / 2 + rotCorr.x, y: alignTo.y + options.y + { top: 0, middle: 0.5, bottom: 1 }[options.verticalAlign] * alignTo.height }; dataLabel[isNew ? 'attr' : 'animate'](alignAttr) .attr({ // #3003 align: align }); // Compensate for the rotated label sticking out on the sides normRotation = (rotation + 720) % 360; negRotation = normRotation > 180 && normRotation < 360; if (align === 'left') { alignAttr.y -= negRotation ? bBox.height : 0; } else if (align === 'center') { alignAttr.x -= bBox.width / 2; alignAttr.y -= bBox.height / 2; } else if (align === 'right') { alignAttr.x -= bBox.width; alignAttr.y -= negRotation ? 0 : bBox.height; } } else { dataLabel.align(options, null, alignTo); alignAttr = dataLabel.alignAttr; } // Handle justify or crop if (justify) { this.justifyDataLabel(dataLabel, options, alignAttr, bBox, alignTo, isNew); // Now check that the data label is within the plot area } else if (pick(options.crop, true)) { visible = chart.isInsidePlot(alignAttr.x, alignAttr.y) && chart.isInsidePlot(alignAttr.x + bBox.width, alignAttr.y + bBox.height); } // When we're using a shape, make it possible with a connector or an arrow pointing to thie point if (options.shape && !rotation) { dataLabel.attr({ anchorX: point.plotX, anchorY: point.plotY }); } } // Show or hide based on the final aligned position if (!visible) { stop(dataLabel); dataLabel.attr({ y: -9999 }); dataLabel.placed = false; // don't animate back in } }; /** * If data labels fall partly outside the plot area, align them back in, in a way that * doesn't hide the point. */ Series.prototype.justifyDataLabel = function (dataLabel, options, alignAttr, bBox, alignTo, isNew) { var chart = this.chart, align = options.align, verticalAlign = options.verticalAlign, off, justified, padding = dataLabel.box ? 0 : (dataLabel.padding || 0); // Off left off = alignAttr.x + padding; if (off < 0) { if (align === 'right') { options.align = 'left'; } else { options.x = -off; } justified = true; } // Off right off = alignAttr.x + bBox.width - padding; if (off > chart.plotWidth) { if (align === 'left') { options.align = 'right'; } else { options.x = chart.plotWidth - off; } justified = true; } // Off top off = alignAttr.y + padding; if (off < 0) { if (verticalAlign === 'bottom') { options.verticalAlign = 'top'; } else { options.y = -off; } justified = true; } // Off bottom off = alignAttr.y + bBox.height - padding; if (off > chart.plotHeight) { if (verticalAlign === 'top') { options.verticalAlign = 'bottom'; } else { options.y = chart.plotHeight - off; } justified = true; } if (justified) { dataLabel.placed = !isNew; dataLabel.align(options, null, alignTo); } }; /** * Override the base drawDataLabels method by pie specific functionality */ if (seriesTypes.pie) { seriesTypes.pie.prototype.drawDataLabels = function () { var series = this, data = series.data, point, chart = series.chart, options = series.options.dataLabels, connectorPadding = pick(options.connectorPadding, 10), connectorWidth = pick(options.connectorWidth, 1), plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, connector, connectorPath, softConnector = pick(options.softConnector, true), distanceOption = options.distance, seriesCenter = series.center, radius = seriesCenter[2] / 2, centerY = seriesCenter[1], outside = distanceOption > 0, dataLabel, dataLabelWidth, labelPos, labelHeight, halves = [// divide the points into right and left halves for anti collision [], // right [] // left ], x, y, visibility, rankArr, i, j, overflow = [0, 0, 0, 0], // top, right, bottom, left sort = function (a, b) { return b.y - a.y; }; // get out if not enabled if (!series.visible || (!options.enabled && !series._hasPointLabels)) { return; } // run parent method Series.prototype.drawDataLabels.apply(series); each(data, function (point) { if (point.dataLabel && point.visible) { // #407, #2510 // Arrange points for detection collision halves[point.half].push(point); // Reset positions (#4905) point.dataLabel._pos = null; } }); /* Loop over the points in each half, starting from the top and bottom * of the pie to detect overlapping labels. */ i = 2; while (i--) { var slots = [], slotsLength, usedSlots = [], points = halves[i], pos, bottom, length = points.length, slotIndex; if (!length) { continue; } // Sort by angle series.sortByAngle(points, i - 0.5); // Assume equal label heights on either hemisphere (#2630) j = labelHeight = 0; while (!labelHeight && points[j]) { // #1569 labelHeight = points[j] && points[j].dataLabel && (points[j].dataLabel.getBBox().height || 21); // 21 is for #968 j++; } // Only do anti-collision when we are outside the pie and have connectors (#856) if (distanceOption > 0) { // Build the slots bottom = mathMin(centerY + radius + distanceOption, chart.plotHeight); for (pos = mathMax(0, centerY - radius - distanceOption); pos <= bottom; pos += labelHeight) { slots.push(pos); } slotsLength = slots.length; /* Visualize the slots if (!series.slotElements) { series.slotElements = []; } if (i === 1) { series.slotElements.forEach(function (elem) { elem.destroy(); }); series.slotElements.length = 0; } slots.forEach(function (pos, no) { var slotX = series.getX(pos, i) + chart.plotLeft - (i ? 100 : 0), slotY = pos + chart.plotTop; if (isNumber(slotX)) { series.slotElements.push(chart.renderer.rect(slotX, slotY - 7, 100, labelHeight, 1) .attr({ 'stroke-width': 1, stroke: 'silver', fill: 'rgba(0,0,255,0.1)' }) .add()); series.slotElements.push(chart.renderer.text('Slot '+ no, slotX, slotY + 4) .attr({ fill: 'silver' }).add()); } }); // */ // if there are more values than available slots, remove lowest values if (length > slotsLength) { // create an array for sorting and ranking the points within each quarter rankArr = [].concat(points); rankArr.sort(sort); j = length; while (j--) { rankArr[j].rank = j; } j = length; while (j--) { if (points[j].rank >= slotsLength) { points.splice(j, 1); } } length = points.length; } // The label goes to the nearest open slot, but not closer to the edge than // the label's index. for (j = 0; j < length; j++) { point = points[j]; labelPos = point.labelPos; var closest = 9999, distance, slotI; // find the closest slot index for (slotI = 0; slotI < slotsLength; slotI++) { distance = mathAbs(slots[slotI] - labelPos[1]); if (distance < closest) { closest = distance; slotIndex = slotI; } } // if that slot index is closer to the edges of the slots, move it // to the closest appropriate slot if (slotIndex < j && slots[j] !== null) { // cluster at the top slotIndex = j; } else if (slotsLength < length - j + slotIndex && slots[j] !== null) { // cluster at the bottom slotIndex = slotsLength - length + j; while (slots[slotIndex] === null) { // make sure it is not taken slotIndex++; } } else { // Slot is taken, find next free slot below. In the next run, the next slice will find the // slot above these, because it is the closest one while (slots[slotIndex] === null) { // make sure it is not taken slotIndex++; } } usedSlots.push({ i: slotIndex, y: slots[slotIndex] }); slots[slotIndex] = null; // mark as taken } // sort them in order to fill in from the top usedSlots.sort(sort); } // now the used slots are sorted, fill them up sequentially for (j = 0; j < length; j++) { var slot, naturalY; point = points[j]; labelPos = point.labelPos; dataLabel = point.dataLabel; visibility = point.visible === false ? HIDDEN : 'inherit'; naturalY = labelPos[1]; if (distanceOption > 0) { slot = usedSlots.pop(); slotIndex = slot.i; // if the slot next to currrent slot is free, the y value is allowed // to fall back to the natural position y = slot.y; if ((naturalY > y && slots[slotIndex + 1] !== null) || (naturalY < y && slots[slotIndex - 1] !== null)) { y = mathMin(mathMax(0, naturalY), chart.plotHeight); } } else { y = naturalY; } // get the x - use the natural x position for first and last slot, to prevent the top // and botton slice connectors from touching each other on either side x = options.justify ? seriesCenter[0] + (i ? -1 : 1) * (radius + distanceOption) : series.getX(y === centerY - radius - distanceOption || y === centerY + radius + distanceOption ? naturalY : y, i); // Record the placement and visibility dataLabel._attr = { visibility: visibility, align: labelPos[6] }; dataLabel._pos = { x: x + options.x + ({ left: connectorPadding, right: -connectorPadding }[labelPos[6]] || 0), y: y + options.y - 10 // 10 is for the baseline (label vs text) }; dataLabel.connX = x; dataLabel.connY = y; // Detect overflowing data labels if (this.options.size === null) { dataLabelWidth = dataLabel.width; // Overflow left if (x - dataLabelWidth < connectorPadding) { overflow[3] = mathMax(mathRound(dataLabelWidth - x + connectorPadding), overflow[3]); // Overflow right } else if (x + dataLabelWidth > plotWidth - connectorPadding) { overflow[1] = mathMax(mathRound(x + dataLabelWidth - plotWidth + connectorPadding), overflow[1]); } // Overflow top if (y - labelHeight / 2 < 0) { overflow[0] = mathMax(mathRound(-y + labelHeight / 2), overflow[0]); // Overflow left } else if (y + labelHeight / 2 > plotHeight) { overflow[2] = mathMax(mathRound(y + labelHeight / 2 - plotHeight), overflow[2]); } } } // for each point } // for each half // Do not apply the final placement and draw the connectors until we have verified // that labels are not spilling over. if (arrayMax(overflow) === 0 || this.verifyDataLabelOverflow(overflow)) { // Place the labels in the final position this.placeDataLabels(); // Draw the connectors if (outside && connectorWidth) { each(this.points, function (point) { connector = point.connector; labelPos = point.labelPos; dataLabel = point.dataLabel; if (dataLabel && dataLabel._pos && point.visible) { visibility = dataLabel._attr.visibility; x = dataLabel.connX; y = dataLabel.connY; connectorPath = softConnector ? [ M, x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label 'C', x, y, // first break, next to the label 2 * labelPos[2] - labelPos[4], 2 * labelPos[3] - labelPos[5], labelPos[2], labelPos[3], // second break L, labelPos[4], labelPos[5] // base ] : [ M, x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label L, labelPos[2], labelPos[3], // second break L, labelPos[4], labelPos[5] // base ]; if (connector) { connector.animate({ d: connectorPath }); connector.attr('visibility', visibility); } else { point.connector = connector = series.chart.renderer.path(connectorPath).attr({ 'stroke-width': connectorWidth, stroke: options.connectorColor || point.color || '#606060', visibility: visibility //zIndex: 0 // #2722 (reversed) }) .add(series.dataLabelsGroup); } } else if (connector) { point.connector = connector.destroy(); } }); } } }; /** * Perform the final placement of the data labels after we have verified that they * fall within the plot area. */ seriesTypes.pie.prototype.placeDataLabels = function () { each(this.points, function (point) { var dataLabel = point.dataLabel, _pos; if (dataLabel && point.visible) { _pos = dataLabel._pos; if (_pos) { dataLabel.attr(dataLabel._attr); dataLabel[dataLabel.moved ? 'animate' : 'attr'](_pos); dataLabel.moved = true; } else if (dataLabel) { dataLabel.attr({ y: -9999 }); } } }); }; seriesTypes.pie.prototype.alignDataLabel = noop; /** * Verify whether the data labels are allowed to draw, or we should run more translation and data * label positioning to keep them inside the plot area. Returns true when data labels are ready * to draw. */ seriesTypes.pie.prototype.verifyDataLabelOverflow = function (overflow) { var center = this.center, options = this.options, centerOption = options.center, minSize = options.minSize || 80, newSize = minSize, ret; // Handle horizontal size and center if (centerOption[0] !== null) { // Fixed center newSize = mathMax(center[2] - mathMax(overflow[1], overflow[3]), minSize); } else { // Auto center newSize = mathMax( center[2] - overflow[1] - overflow[3], // horizontal overflow minSize ); center[0] += (overflow[3] - overflow[1]) / 2; // horizontal center } // Handle vertical size and center if (centerOption[1] !== null) { // Fixed center newSize = mathMax(mathMin(newSize, center[2] - mathMax(overflow[0], overflow[2])), minSize); } else { // Auto center newSize = mathMax( mathMin( newSize, center[2] - overflow[0] - overflow[2] // vertical overflow ), minSize ); center[1] += (overflow[0] - overflow[2]) / 2; // vertical center } // If the size must be decreased, we need to run translate and drawDataLabels again if (newSize < center[2]) { center[2] = newSize; center[3] = Math.min(relativeLength(options.innerSize || 0, newSize), newSize); // #3632 this.translate(center); if (this.drawDataLabels) { this.drawDataLabels(); } // Else, return true to indicate that the pie and its labels is within the plot area } else { ret = true; } return ret; }; } if (seriesTypes.column) { /** * Override the basic data label alignment by adjusting for the position of the column */ seriesTypes.column.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) { var inverted = this.chart.inverted, series = point.series, dlBox = point.dlBox || point.shapeArgs, // data label box for alignment below = pick(point.below, point.plotY > pick(this.translatedThreshold, series.yAxis.len)), // point.below is used in range series inside = pick(options.inside, !!this.options.stacking), // draw it inside the box? overshoot; // Align to the column itself, or the top of it if (dlBox) { // Area range uses this method but not alignTo alignTo = merge(dlBox); if (alignTo.y < 0) { alignTo.height += alignTo.y; alignTo.y = 0; } overshoot = alignTo.y + alignTo.height - series.yAxis.len; if (overshoot > 0) { alignTo.height -= overshoot; } if (inverted) { alignTo = { x: series.yAxis.len - alignTo.y - alignTo.height, y: series.xAxis.len - alignTo.x - alignTo.width, width: alignTo.height, height: alignTo.width }; } // Compute the alignment box if (!inside) { if (inverted) { alignTo.x += below ? 0 : alignTo.width; alignTo.width = 0; } else { alignTo.y += below ? alignTo.height : 0; alignTo.height = 0; } } } // When alignment is undefined (typically columns and bars), display the individual // point below or above the point depending on the threshold options.align = pick( options.align, !inverted || inside ? 'center' : below ? 'right' : 'left' ); options.verticalAlign = pick( options.verticalAlign, inverted || inside ? 'middle' : below ? 'top' : 'bottom' ); // Call the parent method Series.prototype.alignDataLabel.call(this, point, dataLabel, options, alignTo, isNew); }; } /** * Highcharts module to hide overlapping data labels. This module is included in Highcharts. */ (function (H) { var Chart = H.Chart, each = H.each, pick = H.pick, addEvent = H.addEvent; // Collect potensial overlapping data labels. Stack labels probably don't need to be // considered because they are usually accompanied by data labels that lie inside the columns. Chart.prototype.callbacks.push(function (chart) { function collectAndHide() { var labels = []; each(chart.series, function (series) { var dlOptions = series.options.dataLabels, collections = series.dataLabelCollections || ['dataLabel']; // Range series have two collections if ((dlOptions.enabled || series._hasPointLabels) && !dlOptions.allowOverlap && series.visible) { // #3866 each(collections, function (coll) { each(series.points, function (point) { if (point[coll]) { point[coll].labelrank = pick(point.labelrank, point.shapeArgs && point.shapeArgs.height); // #4118 labels.push(point[coll]); } }); }); } }); chart.hideOverlappingLabels(labels); } // Do it now ... collectAndHide(); // ... and after each chart redraw addEvent(chart, 'redraw', collectAndHide); }); /** * Hide overlapping labels. Labels are moved and faded in and out on zoom to provide a smooth * visual imression. */ Chart.prototype.hideOverlappingLabels = function (labels) { var len = labels.length, label, i, j, label1, label2, isIntersecting, pos1, pos2, parent1, parent2, padding, intersectRect = function (x1, y1, w1, h1, x2, y2, w2, h2) { return !( x2 > x1 + w1 || x2 + w2 < x1 || y2 > y1 + h1 || y2 + h2 < y1 ); }; // Mark with initial opacity for (i = 0; i < len; i++) { label = labels[i]; if (label) { label.oldOpacity = label.opacity; label.newOpacity = 1; } } // Prevent a situation in a gradually rising slope, that each label // will hide the previous one because the previous one always has // lower rank. labels.sort(function (a, b) { return (b.labelrank || 0) - (a.labelrank || 0); }); // Detect overlapping labels for (i = 0; i < len; i++) { label1 = labels[i]; for (j = i + 1; j < len; ++j) { label2 = labels[j]; if (label1 && label2 && label1.placed && label2.placed && label1.newOpacity !== 0 && label2.newOpacity !== 0) { pos1 = label1.alignAttr; pos2 = label2.alignAttr; parent1 = label1.parentGroup; // Different panes have different positions parent2 = label2.parentGroup; padding = 2 * (label1.box ? 0 : label1.padding); // Substract the padding if no background or border (#4333) isIntersecting = intersectRect( pos1.x + parent1.translateX, pos1.y + parent1.translateY, label1.width - padding, label1.height - padding, pos2.x + parent2.translateX, pos2.y + parent2.translateY, label2.width - padding, label2.height - padding ); if (isIntersecting) { (label1.labelrank < label2.labelrank ? label1 : label2).newOpacity = 0; } } } } // Hide or show each(labels, function (label) { var complete, newOpacity; if (label) { newOpacity = label.newOpacity; if (label.oldOpacity !== newOpacity && label.placed) { // Make sure the label is completely hidden to avoid catching clicks (#4362) if (newOpacity) { label.show(true); } else { complete = function () { label.hide(); }; } // Animate or set the opacity label.alignAttr.opacity = newOpacity; label[label.isOld ? 'animate' : 'attr'](label.alignAttr, null, complete); } label.isOld = true; } }); }; }(Highcharts)); /** * TrackerMixin for points and graphs */ var TrackerMixin = Highcharts.TrackerMixin = { drawTrackerPoint: function () { var series = this, chart = series.chart, pointer = chart.pointer, cursor = series.options.cursor, css = cursor && { cursor: cursor }, onMouseOver = function (e) { var target = e.target, point; while (target && !point) { point = target.point; target = target.parentNode; } if (point !== UNDEFINED && point !== chart.hoverPoint) { // undefined on graph in scatterchart point.onMouseOver(e); } }; // Add reference to the point each(series.points, function (point) { if (point.graphic) { point.graphic.element.point = point; } if (point.dataLabel) { point.dataLabel.element.point = point; } }); // Add the event listeners, we need to do this only once if (!series._hasTracking) { each(series.trackerGroups, function (key) { if (series[key]) { // we don't always have dataLabelsGroup series[key] .addClass(PREFIX + 'tracker') .on('mouseover', onMouseOver) .on('mouseout', function (e) { pointer.onTrackerMouseOut(e); }) .css(css); if (hasTouch) { series[key].on('touchstart', onMouseOver); } } }); series._hasTracking = true; } }, /** * Draw the tracker object that sits above all data labels and markers to * track mouse events on the graph or points. For the line type charts * the tracker uses the same graphPath, but with a greater stroke width * for better control. */ drawTrackerGraph: function () { var series = this, options = series.options, trackByArea = options.trackByArea, trackerPath = [].concat(trackByArea ? series.areaPath : series.graphPath), trackerPathLength = trackerPath.length, chart = series.chart, pointer = chart.pointer, renderer = chart.renderer, snap = chart.options.tooltip.snap, tracker = series.tracker, cursor = options.cursor, css = cursor && { cursor: cursor }, i, onMouseOver = function () { if (chart.hoverSeries !== series) { series.onMouseOver(); } }, /* * Empirical lowest possible opacities for TRACKER_FILL for an element to stay invisible but clickable * IE6: 0.002 * IE7: 0.002 * IE8: 0.002 * IE9: 0.00000000001 (unlimited) * IE10: 0.0001 (exporting only) * FF: 0.00000000001 (unlimited) * Chrome: 0.000001 * Safari: 0.000001 * Opera: 0.00000000001 (unlimited) */ TRACKER_FILL = 'rgba(192,192,192,' + (hasSVG ? 0.0001 : 0.002) + ')'; // Extend end points. A better way would be to use round linecaps, // but those are not clickable in VML. if (trackerPathLength && !trackByArea) { i = trackerPathLength + 1; while (i--) { if (trackerPath[i] === M) { // extend left side trackerPath.splice(i + 1, 0, trackerPath[i + 1] - snap, trackerPath[i + 2], L); } if ((i && trackerPath[i] === M) || i === trackerPathLength) { // extend right side trackerPath.splice(i, 0, L, trackerPath[i - 2] + snap, trackerPath[i - 1]); } } } // handle single points /*for (i = 0; i < singlePoints.length; i++) { singlePoint = singlePoints[i]; trackerPath.push(M, singlePoint.plotX - snap, singlePoint.plotY, L, singlePoint.plotX + snap, singlePoint.plotY); }*/ // draw the tracker if (tracker) { tracker.attr({ d: trackerPath }); } else { // create series.tracker = renderer.path(trackerPath) .attr({ 'stroke-linejoin': 'round', // #1225 visibility: series.visible ? VISIBLE : HIDDEN, stroke: TRACKER_FILL, fill: trackByArea ? TRACKER_FILL : NONE, 'stroke-width': options.lineWidth + (trackByArea ? 0 : 2 * snap), zIndex: 2 }) .add(series.group); // The tracker is added to the series group, which is clipped, but is covered // by the marker group. So the marker group also needs to capture events. each([series.tracker, series.markerGroup], function (tracker) { tracker.addClass(PREFIX + 'tracker') .on('mouseover', onMouseOver) .on('mouseout', function (e) { pointer.onTrackerMouseOut(e); }) .css(css); if (hasTouch) { tracker.on('touchstart', onMouseOver); } }); } } }; /* End TrackerMixin */ /** * Add tracking event listener to the series group, so the point graphics * themselves act as trackers */ if (seriesTypes.column) { ColumnSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint; } if (seriesTypes.pie) { seriesTypes.pie.prototype.drawTracker = TrackerMixin.drawTrackerPoint; } if (seriesTypes.scatter) { ScatterSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint; } /* * Extend Legend for item events */ extend(Legend.prototype, { setItemEvents: function (item, legendItem, useHTML, itemStyle, itemHiddenStyle) { var legend = this; // Set the events on the item group, or in case of useHTML, the item itself (#1249) (useHTML ? legendItem : item.legendGroup).on('mouseover', function () { item.setState(HOVER_STATE); legendItem.css(legend.options.itemHoverStyle); }) .on('mouseout', function () { legendItem.css(item.visible ? itemStyle : itemHiddenStyle); item.setState(); }) .on('click', function (event) { var strLegendItemClick = 'legendItemClick', fnLegendItemClick = function () { if (item.setVisible) { item.setVisible(); } }; // Pass over the click/touch event. #4. event = { browserEvent: event }; // click the name or symbol if (item.firePointEvent) { // point item.firePointEvent(strLegendItemClick, event, fnLegendItemClick); } else { fireEvent(item, strLegendItemClick, event, fnLegendItemClick); } }); }, createCheckboxForItem: function (item) { var legend = this; item.checkbox = createElement('input', { type: 'checkbox', checked: item.selected, defaultChecked: item.selected // required by IE7 }, legend.options.itemCheckboxStyle, legend.chart.container); addEvent(item.checkbox, 'click', function (event) { var target = event.target; fireEvent( item.series || item, 'checkboxClick', { // #3712 checked: target.checked, item: item }, function () { item.select(); } ); }); } }); /* * Add pointer cursor to legend itemstyle in defaultOptions */ defaultOptions.legend.itemStyle.cursor = 'pointer'; /* * Extend the Chart object with interaction */ extend(Chart.prototype, { /** * Display the zoom button */ showResetZoom: function () { var chart = this, lang = defaultOptions.lang, btnOptions = chart.options.chart.resetZoomButton, theme = btnOptions.theme, states = theme.states, alignTo = btnOptions.relativeTo === 'chart' ? null : 'plotBox'; function zoomOut() { chart.zoomOut(); } this.resetZoomButton = chart.renderer.button(lang.resetZoom, null, null, zoomOut, theme, states && states.hover) .attr({ align: btnOptions.position.align, title: lang.resetZoomTitle }) .add() .align(btnOptions.position, false, alignTo); }, /** * Zoom out to 1:1 */ zoomOut: function () { var chart = this; fireEvent(chart, 'selection', { resetSelection: true }, function () { chart.zoom(); }); }, /** * Zoom into a given portion of the chart given by axis coordinates * @param {Object} event */ zoom: function (event) { var chart = this, hasZoomed, pointer = chart.pointer, displayButton = false, resetZoomButton; // If zoom is called with no arguments, reset the axes if (!event || event.resetSelection) { each(chart.axes, function (axis) { hasZoomed = axis.zoom(); }); } else { // else, zoom in on all axes each(event.xAxis.concat(event.yAxis), function (axisData) { var axis = axisData.axis, isXAxis = axis.isXAxis; // don't zoom more than minRange if (pointer[isXAxis ? 'zoomX' : 'zoomY'] || pointer[isXAxis ? 'pinchX' : 'pinchY']) { hasZoomed = axis.zoom(axisData.min, axisData.max); if (axis.displayBtn) { displayButton = true; } } }); } // Show or hide the Reset zoom button resetZoomButton = chart.resetZoomButton; if (displayButton && !resetZoomButton) { chart.showResetZoom(); } else if (!displayButton && isObject(resetZoomButton)) { chart.resetZoomButton = resetZoomButton.destroy(); } // Redraw if (hasZoomed) { chart.redraw( pick(chart.options.chart.animation, event && event.animation, chart.pointCount < 100) // animation ); } }, /** * Pan the chart by dragging the mouse across the pane. This function is called * on mouse move, and the distance to pan is computed from chartX compared to * the first chartX position in the dragging operation. */ pan: function (e, panning) { var chart = this, hoverPoints = chart.hoverPoints, doRedraw; // remove active points for shared tooltip if (hoverPoints) { each(hoverPoints, function (point) { point.setState(); }); } each(panning === 'xy' ? [1, 0] : [1], function (isX) { // xy is used in maps var axis = chart[isX ? 'xAxis' : 'yAxis'][0], horiz = axis.horiz, mousePos = e[horiz ? 'chartX' : 'chartY'], mouseDown = horiz ? 'mouseDownX' : 'mouseDownY', startPos = chart[mouseDown], halfPointRange = (axis.pointRange || 0) / 2, extremes = axis.getExtremes(), newMin = axis.toValue(startPos - mousePos, true) + halfPointRange, newMax = axis.toValue(startPos + axis.len - mousePos, true) - halfPointRange, goingLeft = startPos > mousePos; // #3613 if (axis.series.length && (goingLeft || newMin > mathMin(extremes.dataMin, extremes.min)) && (!goingLeft || newMax < mathMax(extremes.dataMax, extremes.max))) { axis.setExtremes(newMin, newMax, false, false, { trigger: 'pan' }); doRedraw = true; } chart[mouseDown] = mousePos; // set new reference for next run }); if (doRedraw) { chart.redraw(false); } css(chart.container, { cursor: 'move' }); } }); /* * Extend the Point object with interaction */ extend(Point.prototype, { /** * Toggle the selection status of a point * @param {Boolean} selected Whether to select or unselect the point. * @param {Boolean} accumulate Whether to add to the previous selection. By default, * this happens if the control key (Cmd on Mac) was pressed during clicking. */ select: function (selected, accumulate) { var point = this, series = point.series, chart = series.chart; selected = pick(selected, !point.selected); // fire the event with the default handler point.firePointEvent(selected ? 'select' : 'unselect', { accumulate: accumulate }, function () { point.selected = point.options.selected = selected; series.options.data[inArray(point, series.data)] = point.options; point.setState(selected && SELECT_STATE); // unselect all other points unless Ctrl or Cmd + click if (!accumulate) { each(chart.getSelectedPoints(), function (loopPoint) { if (loopPoint.selected && loopPoint !== point) { loopPoint.selected = loopPoint.options.selected = false; series.options.data[inArray(loopPoint, series.data)] = loopPoint.options; loopPoint.setState(NORMAL_STATE); loopPoint.firePointEvent('unselect'); } }); } }); }, /** * Runs on mouse over the point * * @param {Object} e The event arguments * @param {Boolean} byProximity Falsy for kd points that are closest to the mouse, or to * actually hovered points. True for other points in shared tooltip. */ onMouseOver: function (e, byProximity) { var point = this, series = point.series, chart = series.chart, tooltip = chart.tooltip, hoverPoint = chart.hoverPoint; if (chart.hoverSeries !== series) { series.onMouseOver(); } // set normal state to previous series if (hoverPoint && hoverPoint !== point) { hoverPoint.onMouseOut(); } if (point.series) { // It may have been destroyed, #4130 // trigger the event point.firePointEvent('mouseOver'); // update the tooltip if (tooltip && (!tooltip.shared || series.noSharedTooltip)) { tooltip.refresh(point, e); } // hover this point.setState(HOVER_STATE); if (!byProximity) { chart.hoverPoint = point; } } }, /** * Runs on mouse out from the point */ onMouseOut: function () { var chart = this.series.chart, hoverPoints = chart.hoverPoints; this.firePointEvent('mouseOut'); if (!hoverPoints || inArray(this, hoverPoints) === -1) { // #887, #2240 this.setState(); chart.hoverPoint = null; } }, /** * Import events from the series' and point's options. Only do it on * demand, to save processing time on hovering. */ importEvents: function () { if (!this.hasImportedEvents) { var point = this, options = merge(point.series.options.point, point.options), events = options.events, eventType; point.events = events; for (eventType in events) { addEvent(point, eventType, events[eventType]); } this.hasImportedEvents = true; } }, /** * Set the point's state * @param {String} state */ setState: function (state, move) { var point = this, plotX = mathFloor(point.plotX), // #4586 plotY = point.plotY, series = point.series, stateOptions = series.options.states, markerOptions = defaultPlotOptions[series.type].marker && series.options.marker, normalDisabled = markerOptions && !markerOptions.enabled, markerStateOptions = markerOptions && markerOptions.states[state], stateDisabled = markerStateOptions && markerStateOptions.enabled === false, stateMarkerGraphic = series.stateMarkerGraphic, pointMarker = point.marker || {}, chart = series.chart, radius, halo = series.halo, haloOptions, newSymbol, pointAttr; state = state || NORMAL_STATE; // empty string pointAttr = point.pointAttr[state] || series.pointAttr[state]; if ( // already has this state (state === point.state && !move) || // selected points don't respond to hover (point.selected && state !== SELECT_STATE) || // series' state options is disabled (stateOptions[state] && stateOptions[state].enabled === false) || // general point marker's state options is disabled (state && (stateDisabled || (normalDisabled && markerStateOptions.enabled === false))) || // individual point marker's state options is disabled (state && pointMarker.states && pointMarker.states[state] && pointMarker.states[state].enabled === false) // #1610 ) { return; } // apply hover styles to the existing point if (point.graphic) { radius = markerOptions && point.graphic.symbolName && pointAttr.r; point.graphic.attr(merge( pointAttr, radius ? { // new symbol attributes (#507, #612) x: plotX - radius, y: plotY - radius, width: 2 * radius, height: 2 * radius } : {} )); // Zooming in from a range with no markers to a range with markers if (stateMarkerGraphic) { stateMarkerGraphic.hide(); } } else { // if a graphic is not applied to each point in the normal state, create a shared // graphic for the hover state if (state && markerStateOptions) { radius = markerStateOptions.radius; newSymbol = pointMarker.symbol || series.symbol; // If the point has another symbol than the previous one, throw away the // state marker graphic and force a new one (#1459) if (stateMarkerGraphic && stateMarkerGraphic.currentSymbol !== newSymbol) { stateMarkerGraphic = stateMarkerGraphic.destroy(); } // Add a new state marker graphic if (!stateMarkerGraphic) { if (newSymbol) { series.stateMarkerGraphic = stateMarkerGraphic = chart.renderer.symbol( newSymbol, plotX - radius, plotY - radius, 2 * radius, 2 * radius ) .attr(pointAttr) .add(series.markerGroup); stateMarkerGraphic.currentSymbol = newSymbol; } // Move the existing graphic } else { stateMarkerGraphic[move ? 'animate' : 'attr']({ // #1054 x: plotX - radius, y: plotY - radius }); } } if (stateMarkerGraphic) { stateMarkerGraphic[state && chart.isInsidePlot(plotX, plotY, chart.inverted) ? 'show' : 'hide'](); // #2450 stateMarkerGraphic.element.point = point; // #4310 } } // Show me your halo haloOptions = stateOptions[state] && stateOptions[state].halo; if (haloOptions && haloOptions.size) { if (!halo) { series.halo = halo = chart.renderer.path() .add(chart.seriesGroup); } halo.attr(extend({ 'fill': point.color || series.color, 'fill-opacity': haloOptions.opacity, 'zIndex': -1 // #4929, IE8 added halo above everything }, haloOptions.attributes))[move ? 'animate' : 'attr']({ d: point.haloPath(haloOptions.size) }); } else if (halo) { halo.attr({ d: [] }); } point.state = state; }, /** * Get the circular path definition for the halo * @param {Number} size The radius of the circular halo * @returns {Array} The path definition */ haloPath: function (size) { var series = this.series, chart = series.chart, plotBox = series.getPlotBox(), inverted = chart.inverted, plotX = Math.floor(this.plotX); return chart.renderer.symbols.circle( plotBox.translateX + (inverted ? series.yAxis.len - this.plotY : plotX) - size, plotBox.translateY + (inverted ? series.xAxis.len - plotX : this.plotY) - size, size * 2, size * 2 ); } }); /* * Extend the Series object with interaction */ extend(Series.prototype, { /** * Series mouse over handler */ onMouseOver: function () { var series = this, chart = series.chart, hoverSeries = chart.hoverSeries; // set normal state to previous series if (hoverSeries && hoverSeries !== series) { hoverSeries.onMouseOut(); } // trigger the event, but to save processing time, // only if defined if (series.options.events.mouseOver) { fireEvent(series, 'mouseOver'); } // hover this series.setState(HOVER_STATE); chart.hoverSeries = series; }, /** * Series mouse out handler */ onMouseOut: function () { // trigger the event only if listeners exist var series = this, options = series.options, chart = series.chart, tooltip = chart.tooltip, hoverPoint = chart.hoverPoint; chart.hoverSeries = null; // #182, set to null before the mouseOut event fires // trigger mouse out on the point, which must be in this series if (hoverPoint) { hoverPoint.onMouseOut(); } // fire the mouse out event if (series && options.events.mouseOut) { fireEvent(series, 'mouseOut'); } // hide the tooltip if (tooltip && !options.stickyTracking && (!tooltip.shared || series.noSharedTooltip)) { tooltip.hide(); } // set normal state series.setState(); }, /** * Set the state of the graph */ setState: function (state) { var series = this, options = series.options, graph = series.graph, stateOptions = options.states, lineWidth = options.lineWidth, attribs, i = 0; state = state || NORMAL_STATE; if (series.state !== state) { series.state = state; if (stateOptions[state] && stateOptions[state].enabled === false) { return; } if (state) { lineWidth = stateOptions[state].lineWidth || lineWidth + (stateOptions[state].lineWidthPlus || 0); // #4035 } if (graph && !graph.dashstyle) { // hover is turned off for dashed lines in VML attribs = { 'stroke-width': lineWidth }; // use attr because animate will cause any other animation on the graph to stop graph.attr(attribs); while (series['zoneGraph' + i]) { series['zoneGraph' + i].attr(attribs); i = i + 1; } } } }, /** * Set the visibility of the graph * * @param vis {Boolean} True to show the series, false to hide. If UNDEFINED, * the visibility is toggled. */ setVisible: function (vis, redraw) { var series = this, chart = series.chart, legendItem = series.legendItem, showOrHide, ignoreHiddenSeries = chart.options.chart.ignoreHiddenSeries, oldVisibility = series.visible; // if called without an argument, toggle visibility series.visible = vis = series.options.visible = series.userOptions.visible = vis === undefined ? !oldVisibility : vis; // #5618 showOrHide = vis ? 'show' : 'hide'; // show or hide elements each(['group', 'dataLabelsGroup', 'markerGroup', 'tracker'], function (key) { if (series[key]) { series[key][showOrHide](); } }); // hide tooltip (#1361) if (chart.hoverSeries === series || (chart.hoverPoint && chart.hoverPoint.series) === series) { series.onMouseOut(); } if (legendItem) { chart.legend.colorizeItem(series, vis); } // rescale or adapt to resized chart series.isDirty = true; // in a stack, all other series are affected if (series.options.stacking) { each(chart.series, function (otherSeries) { if (otherSeries.options.stacking && otherSeries.visible) { otherSeries.isDirty = true; } }); } // show or hide linked series each(series.linkedSeries, function (otherSeries) { otherSeries.setVisible(vis, false); }); if (ignoreHiddenSeries) { chart.isDirtyBox = true; } if (redraw !== false) { chart.redraw(); } fireEvent(series, showOrHide); }, /** * Show the graph */ show: function () { this.setVisible(true); }, /** * Hide the graph */ hide: function () { this.setVisible(false); }, /** * Set the selected state of the graph * * @param selected {Boolean} True to select the series, false to unselect. If * UNDEFINED, the selection state is toggled. */ select: function (selected) { var series = this; // if called without an argument, toggle series.selected = selected = (selected === UNDEFINED) ? !series.selected : selected; if (series.checkbox) { series.checkbox.checked = selected; } fireEvent(series, selected ? 'select' : 'unselect'); }, drawTracker: TrackerMixin.drawTrackerGraph }); // global variables extend(Highcharts, { // Constructors Color: Color, Point: Point, Tick: Tick, Renderer: Renderer, SVGElement: SVGElement, SVGRenderer: SVGRenderer, // Various arrayMin: arrayMin, arrayMax: arrayMax, charts: charts, correctFloat: correctFloat, dateFormat: dateFormat, error: error, format: format, pathAnim: pathAnim, getOptions: getOptions, hasBidiBug: hasBidiBug, isTouchDevice: isTouchDevice, setOptions: setOptions, addEvent: addEvent, removeEvent: removeEvent, createElement: createElement, discardElement: discardElement, css: css, each: each, map: map, merge: merge, splat: splat, stableSort: stableSort, extendClass: extendClass, pInt: pInt, svg: hasSVG, canvas: useCanVG, vml: !hasSVG && !useCanVG, product: PRODUCT, version: VERSION }); return Highcharts; })); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/highcharts/modules/boost.js ================================================ (function(c){typeof module==="object"&&module.exports?module.exports=c:c(Highcharts)})(function(c){function A(a,b,d,f,h){for(var h=h||0,f=f||B,c=h+f,r=!0;r&&h(b.boostThreshold||Number.MAX_VALUE)&&m(f.min)&&m(f.max)&&(!a||m(d.min)&&m(d.max))},destroyGraphics:function(){var a=this,b=this.points,d,f;if(b)for(f=0;f99999)d.options.loading=V(i,{labelStyle:{backgroundColor:"rgba(255,255,255,0.75)",padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),clearTimeout(C),d.showLoading("Drawing..."), d.options.loading=i;A(M?a.data:j||l,function(b,c){var e,g,j,i,l=typeof d.index==="undefined",m=!0;if(!l){O?(e=b[0],g=b[1]):(e=b,g=k[c]);if(L)O&&(g=b.slice(1,3)),i=g[0],g=g[1];else if(M)e=b.x,g=b.stackY,i=g-b.y;j=g===null;ba||(m=g>=u&&g<=X);if(!j&&e>=p&&e<=s&&m)if(e=Math.round(f.toPixels(e,!0)),Y){if(o===void 0||e===v){L||(i=g);if(q===void 0||g>y)y=g,q=c;if(o===void 0||i (options.boostThreshold || Number.MAX_VALUE) && isNumber(yAxis.min) && isNumber(yAxis.max) && (!checkX || (isNumber(xAxis.min) && isNumber(xAxis.max))); }, /** * If implemented in the core, parts of this can probably be shared with other similar * methods in Highcharts. */ destroyGraphics: function () { var series = this, points = this.points, point, i; if (points) { for (i = 0; i < points.length; i = i + 1) { point = points[i]; if (point && point.graphic) { point.graphic = point.graphic.destroy(); } } } each(['graph', 'area', 'tracker'], function (prop) { if (series[prop]) { series[prop] = series[prop].destroy(); } }); }, /** * Create a hidden canvas to draw the graph on. The contents is later copied over * to an SVG image element. */ getContext: function () { var chart = this.chart, width = chart.plotWidth, height = chart.plotHeight, ctx = this.ctx, swapXY = function (proceed, x, y, a, b, c, d) { proceed.call(this, y, x, a, b, c, d); }; if (!this.canvas) { this.canvas = doc.createElement('canvas'); this.image = chart.renderer.image('', 0, 0, width, height).add(this.group); this.ctx = ctx = this.canvas.getContext('2d'); if (chart.inverted) { each(['moveTo', 'lineTo', 'rect', 'arc'], function (fn) { wrap(ctx, fn, swapXY); }); } } else { ctx.clearRect(0, 0, width, height); } this.canvas.width = width; this.canvas.height = height; this.image.attr({ width: width, height: height }); return ctx; }, /** * Draw the canvas image inside an SVG image */ canvasToSVG: function () { this.image.attr({ href: this.canvas.toDataURL('image/png') }); }, cvsLineTo: function (ctx, clientX, plotY) { ctx.lineTo(clientX, plotY); }, renderCanvas: function () { var series = this, options = series.options, chart = series.chart, xAxis = this.xAxis, yAxis = this.yAxis, ctx, c = 0, xData = series.processedXData, yData = series.processedYData, rawData = options.data, xExtremes = xAxis.getExtremes(), xMin = xExtremes.min, xMax = xExtremes.max, yExtremes = yAxis.getExtremes(), yMin = yExtremes.min, yMax = yExtremes.max, pointTaken = {}, lastClientX, sampling = !!series.sampling, points, r = options.marker && options.marker.radius, cvsDrawPoint = this.cvsDrawPoint, cvsLineTo = options.lineWidth ? this.cvsLineTo : false, cvsMarker = r <= 1 ? this.cvsMarkerSquare : this.cvsMarkerCircle, enableMouseTracking = options.enableMouseTracking !== false, lastPoint, threshold = options.threshold, yBottom = yAxis.getThreshold(threshold), hasThreshold = isNumber(threshold), translatedThreshold = yBottom, doFill = this.fill, isRange = series.pointArrayMap && series.pointArrayMap.join(',') === 'low,high', isStacked = !!options.stacking, cropStart = series.cropStart || 0, loadingOptions = chart.options.loading, requireSorting = series.requireSorting, wasNull, connectNulls = options.connectNulls, useRaw = !xData, minVal, maxVal, minI, maxI, fillColor = series.fillOpacity ? new Color(series.color).setOpacity(pick(options.fillOpacity, 0.75)).get() : series.color, stroke = function () { if (doFill) { ctx.fillStyle = fillColor; ctx.fill(); } else { ctx.strokeStyle = series.color; ctx.lineWidth = options.lineWidth; ctx.stroke(); } }, drawPoint = function (clientX, plotY, yBottom) { if (c === 0) { ctx.beginPath(); if (cvsLineTo) { ctx.lineJoin = 'round'; } } if (wasNull) { ctx.moveTo(clientX, plotY); } else { if (cvsDrawPoint) { cvsDrawPoint(ctx, clientX, plotY, yBottom, lastPoint); } else if (cvsLineTo) { cvsLineTo(ctx, clientX, plotY); } else if (cvsMarker) { cvsMarker(ctx, clientX, plotY, r); } } // We need to stroke the line for every 1000 pixels. It will crash the browser // memory use if we stroke too infrequently. c = c + 1; if (c === 1000) { stroke(); c = 0; } // Area charts need to keep track of the last point lastPoint = { clientX: clientX, plotY: plotY, yBottom: yBottom }; }, addKDPoint = function (clientX, plotY, i) { // The k-d tree requires series points. Reduce the amount of points, since the time to build the // tree increases exponentially. if (enableMouseTracking && !pointTaken[clientX + ',' + plotY]) { pointTaken[clientX + ',' + plotY] = true; if (chart.inverted) { clientX = xAxis.len - clientX; plotY = yAxis.len - plotY; } points.push({ clientX: clientX, plotX: clientX, plotY: plotY, i: cropStart + i }); } }; // If we are zooming out from SVG mode, destroy the graphics if (this.points || this.graph) { this.destroyGraphics(); } // The group series.plotGroup( 'group', 'series', series.visible ? 'visible' : 'hidden', options.zIndex, chart.seriesGroup ); series.getAttribs(); series.markerGroup = series.group; addEvent(series, 'destroy', function () { series.markerGroup = null; }); points = this.points = []; ctx = this.getContext(); series.buildKDTree = noop; // Do not start building while drawing // Display a loading indicator if (rawData.length > 99999) { chart.options.loading = merge(loadingOptions, { labelStyle: { backgroundColor: 'rgba(255,255,255,0.75)', padding: '1em', borderRadius: '0.5em' }, style: { backgroundColor: 'none', opacity: 1 } }); clearTimeout(destroyLoadingDiv); chart.showLoading('Drawing...'); chart.options.loading = loadingOptions; // reset } // Loop over the points eachAsync(isStacked ? series.data : (xData || rawData), function (d, i) { var x, y, clientX, plotY, isNull, low, chartDestroyed = typeof chart.index === 'undefined', isYInside = true; if (!chartDestroyed) { if (useRaw) { x = d[0]; y = d[1]; } else { x = d; y = yData[i]; } // Resolve low and high for range series if (isRange) { if (useRaw) { y = d.slice(1, 3); } low = y[0]; y = y[1]; } else if (isStacked) { x = d.x; y = d.stackY; low = y - d.y; } isNull = y === null; // Optimize for scatter zooming if (!requireSorting) { isYInside = y >= yMin && y <= yMax; } if (!isNull && x >= xMin && x <= xMax && isYInside) { clientX = Math.round(xAxis.toPixels(x, true)); if (sampling) { if (minI === undefined || clientX === lastClientX) { if (!isRange) { low = y; } if (maxI === undefined || y > maxVal) { maxVal = y; maxI = i; } if (minI === undefined || low < minVal) { minVal = low; minI = i; } } if (clientX !== lastClientX) { // Add points and reset if (minI !== undefined) { // then maxI is also a number plotY = yAxis.toPixels(maxVal, true); yBottom = yAxis.toPixels(minVal, true); drawPoint( clientX, hasThreshold ? Math.min(plotY, translatedThreshold) : plotY, hasThreshold ? Math.max(yBottom, translatedThreshold) : yBottom ); addKDPoint(clientX, plotY, maxI); if (yBottom !== plotY) { addKDPoint(clientX, yBottom, minI); } } minI = maxI = undefined; lastClientX = clientX; } } else { plotY = Math.round(yAxis.toPixels(y, true)); drawPoint(clientX, plotY, yBottom); addKDPoint(clientX, plotY, i); } } wasNull = isNull && !connectNulls; if (i % CHUNK_SIZE === 0) { series.canvasToSVG(); } } return !chartDestroyed; }, function () { var loadingDiv = chart.loadingDiv, loadingShown = chart.loadingShown; stroke(); series.canvasToSVG(); fireEvent(series, 'renderedCanvas'); // Do not use chart.hideLoading, as it runs JS animation and will be blocked by buildKDTree. // CSS animation looks good, but then it must be deleted in timeout. If we add the module to core, // change hideLoading so we can skip this block. if (loadingShown) { extend(loadingDiv.style, { transition: 'opacity 250ms', opacity: 0 }); chart.loadingShown = false; destroyLoadingDiv = setTimeout(function () { if (loadingDiv.parentNode) { // In exporting it is falsy loadingDiv.parentNode.removeChild(loadingDiv); } chart.loadingDiv = chart.loadingSpan = null; }, 250); } // Pass tests in Pointer. // Replace this with a single property, and replace when zooming in // below boostThreshold. series.directTouch = false; series.options.stickyTracking = true; delete series.buildKDTree; // Go back to prototype, ready to build series.buildKDTree(); // Don't do async on export, the exportChart, getSVGForExport and getSVG methods are not chained for it. }, chart.renderer.forExport ? Number.MAX_VALUE : undefined); } }); seriesTypes.scatter.prototype.cvsMarkerCircle = function (ctx, clientX, plotY, r) { ctx.moveTo(clientX, plotY); ctx.arc(clientX, plotY, r, 0, 2 * Math.PI, false); }; // Rect is twice as fast as arc, should be used for small markers seriesTypes.scatter.prototype.cvsMarkerSquare = function (ctx, clientX, plotY, r) { ctx.rect(clientX - r, plotY - r, r * 2, r * 2); }; seriesTypes.scatter.prototype.fill = true; extend(seriesTypes.area.prototype, { cvsDrawPoint: function (ctx, clientX, plotY, yBottom, lastPoint) { if (lastPoint && clientX !== lastPoint.clientX) { ctx.moveTo(lastPoint.clientX, lastPoint.yBottom); ctx.lineTo(lastPoint.clientX, lastPoint.plotY); ctx.lineTo(clientX, plotY); ctx.lineTo(clientX, yBottom); } }, fill: true, fillOpacity: true, sampling: true }); extend(seriesTypes.column.prototype, { cvsDrawPoint: function (ctx, clientX, plotY, yBottom) { ctx.rect(clientX - 1, plotY, 1, yBottom - plotY); }, fill: true, sampling: true }); /** * Return a full Point object based on the index. The boost module uses stripped point objects * for performance reasons. * @param {Number} boostPoint A stripped-down point object * @returns {Object} A Point object as per http://api.highcharts.com/highcharts#Point */ Series.prototype.getPoint = function (boostPoint) { var point = boostPoint; if (boostPoint && !(boostPoint instanceof this.pointClass)) { point = (new this.pointClass()).init(this, this.options.data[boostPoint.i]); point.category = point.x; point.dist = boostPoint.dist; point.distX = boostPoint.distX; point.plotX = boostPoint.plotX; point.plotY = boostPoint.plotY; } return point; }; /** * Extend series.destroy to also remove the fake k-d-tree points (#5137). Normally * this is handled by Series.destroy that calls Point.destroy, but the fake * search points are not registered like that. */ wrap(Series.prototype, 'destroy', function (proceed) { var series = this, chart = series.chart; if (chart.hoverPoints) { chart.hoverPoints = grep(chart.hoverPoints, function (point) { return point.series === series; }); } if (chart.hoverPoint && chart.hoverPoint.series === series) { chart.hoverPoint = null; } proceed.call(this); }); /** * Return a point instance from the k-d-tree */ wrap(Series.prototype, 'searchPoint', function (proceed) { return this.getPoint( proceed.apply(this, [].slice.call(arguments, 1)) ); }); })); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/highcharts/modules/broken-axis.js ================================================ (function(f){typeof module==="object"&&module.exports?module.exports=f:f(Highcharts)})(function(f){function t(){return Array.prototype.slice.call(arguments,1)}function r(g){g.apply(this);this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,p(this.pointArrayMap,["y"]))}var p=f.pick,n=f.wrap,q=f.each,u=f.extend,s=f.fireEvent,o=f.Axis,v=f.Series;u(o.prototype,{isInBreak:function(g,e){var b=g.repeat||Infinity,c=g.from,a=g.to-g.from,b=e>=c?(e-c)%b:b-(c-e)%b;return g.inclusive?b<=a:b=a)break;else if(c.isInBreak(k,a)){d-=a-k.from;break}return d};this.lin2val=function(a){var d,b;for(b=0;b=a)break;else d.tol;)i-=e;for(;i< l;)i+=e;for(;ia.to||d>a.from&&ja.from&&ja.from&&j>a.to&&j= from ? (val - from) % repeat : repeat - ((from - val) % repeat)); if (!brk.inclusive) { ret = test < length && test !== 0; } else { ret = test <= length; } return ret; }, isInAnyBreak: function (val, testKeep) { var breaks = this.options.breaks, i = breaks && breaks.length, inbrk, keep, ret; if (i) { while (i--) { if (this.isInBreak(breaks[i], val)) { inbrk = true; if (!keep) { keep = pick(breaks[i].showPoints, this.isXAxis ? false : true); } } } if (inbrk && testKeep) { ret = inbrk && !keep; } else { ret = inbrk; } } return ret; } }); wrap(Axis.prototype, 'setTickPositions', function (proceed) { proceed.apply(this, Array.prototype.slice.call(arguments, 1)); if (this.options.breaks) { var axis = this, tickPositions = this.tickPositions, info = this.tickPositions.info, newPositions = [], i; for (i = 0; i < tickPositions.length; i++) { if (!axis.isInAnyBreak(tickPositions[i])) { newPositions.push(tickPositions[i]); } } this.tickPositions = newPositions; this.tickPositions.info = info; } }); wrap(Axis.prototype, 'init', function (proceed, chart, userOptions) { // Force Axis to be not-ordinal when breaks are defined if (userOptions.breaks && userOptions.breaks.length) { userOptions.ordinal = false; } proceed.call(this, chart, userOptions); if (this.options.breaks) { var axis = this; axis.isBroken = true; this.val2lin = function (val) { var nval = val, brk, i; for (i = 0; i < axis.breakArray.length; i++) { brk = axis.breakArray[i]; if (brk.to <= val) { nval -= brk.len; } else if (brk.from >= val) { break; } else if (axis.isInBreak(brk, val)) { nval -= (val - brk.from); break; } } return nval; }; this.lin2val = function (val) { var nval = val, brk, i; for (i = 0; i < axis.breakArray.length; i++) { brk = axis.breakArray[i]; if (brk.from >= nval) { break; } else if (brk.to < nval) { nval += brk.len; } else if (axis.isInBreak(brk, nval)) { nval += brk.len; } } return nval; }; this.setExtremes = function (newMin, newMax, redraw, animation, eventArguments) { // If trying to set extremes inside a break, extend it to before and after the break ( #3857 ) while (this.isInAnyBreak(newMin)) { newMin -= this.closestPointRange; } while (this.isInAnyBreak(newMax)) { newMax -= this.closestPointRange; } Axis.prototype.setExtremes.call(this, newMin, newMax, redraw, animation, eventArguments); }; this.setAxisTranslation = function (saveOld) { Axis.prototype.setAxisTranslation.call(this, saveOld); var breaks = axis.options.breaks, breakArrayT = [], // Temporary one breakArray = [], length = 0, inBrk, repeat, brk, min = axis.userMin || axis.min, max = axis.userMax || axis.max, start, i, j; // Min & max check (#4247) for (i in breaks) { brk = breaks[i]; repeat = brk.repeat || Infinity; if (axis.isInBreak(brk, min)) { min += (brk.to % repeat) - (min % repeat); } if (axis.isInBreak(brk, max)) { max -= (max % repeat) - (brk.from % repeat); } } // Construct an array holding all breaks in the axis for (i in breaks) { brk = breaks[i]; start = brk.from; repeat = brk.repeat || Infinity; while (start - repeat > min) { start -= repeat; } while (start < min) { start += repeat; } for (j = start; j < max; j += repeat) { breakArrayT.push({ value: j, move: 'in' }); breakArrayT.push({ value: j + (brk.to - brk.from), move: 'out', size: brk.breakSize }); } } breakArrayT.sort(function (a, b) { var ret; if (a.value === b.value) { ret = (a.move === 'in' ? 0 : 1) - (b.move === 'in' ? 0 : 1); } else { ret = a.value - b.value; } return ret; }); // Simplify the breaks inBrk = 0; start = min; for (i in breakArrayT) { brk = breakArrayT[i]; inBrk += (brk.move === 'in' ? 1 : -1); if (inBrk === 1 && brk.move === 'in') { start = brk.value; } if (inBrk === 0) { breakArray.push({ from: start, to: brk.value, len: brk.value - start - (brk.size || 0) }); length += brk.value - start - (brk.size || 0); } } axis.breakArray = breakArray; fireEvent(axis, 'afterBreaks'); axis.transA *= ((max - axis.min) / (max - min - length)); axis.min = min; axis.max = max; }; } }); wrap(Series.prototype, 'generatePoints', function (proceed) { proceed.apply(this, stripArguments(arguments)); var series = this, xAxis = series.xAxis, yAxis = series.yAxis, points = series.points, point, i = points.length, connectNulls = series.options.connectNulls, nullGap; if (xAxis && yAxis && (xAxis.options.breaks || yAxis.options.breaks)) { while (i--) { point = points[i]; nullGap = point.y === null && connectNulls === false; // respect nulls inside the break (#4275) if (!nullGap && (xAxis.isInAnyBreak(point.x, true) || yAxis.isInAnyBreak(point.y, true))) { points.splice(i, 1); if (this.data[i]) { this.data[i].destroyElements(); // removes the graphics for this point if they exist } } } } }); function drawPointsWrapped(proceed) { proceed.apply(this); this.drawBreaks(this.xAxis, ['x']); this.drawBreaks(this.yAxis, pick(this.pointArrayMap, ['y'])); } H.Series.prototype.drawBreaks = function (axis, keys) { var series = this, points = series.points, breaks, threshold, eventName, y; each(keys, function (key) { breaks = axis.breakArray || []; threshold = axis.isXAxis ? axis.min : pick(series.options.threshold, axis.min); each(points, function (point) { y = pick(point['stack' + key.toUpperCase()], point[key]); each(breaks, function (brk) { eventName = false; if ((threshold < brk.from && y > brk.to) || (threshold > brk.from && y < brk.from)) { eventName = 'pointBreak'; } else if ((threshold < brk.from && y > brk.from && y < brk.to) || (threshold > brk.from && y > brk.to && y < brk.from)) { // point falls inside the break eventName = 'pointInBreak'; } if (eventName) { fireEvent(axis, eventName, { point: point, brk: brk }); } }); }); }); }; wrap(H.seriesTypes.column.prototype, 'drawPoints', drawPointsWrapped); wrap(H.Series.prototype, 'drawPoints', drawPointsWrapped); })); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/highcharts/modules/canvas-tools.js ================================================ /* A class to parse color values @author Stoyan Stefanov @link http://www.phpied.com/rgb-color-parser-in-javascript/ Use it if you like it canvg.js - Javascript SVG parser and renderer on Canvas MIT Licensed Gabe Lerner (gabelerner@gmail.com) http://code.google.com/p/canvg/ Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/ Highcharts JS v4.2.7 (2016-09-21) CanVGRenderer Extension module (c) 2011-2016 Torstein Honsi, Erik Olsson License: www.highcharts.com/license */ function RGBColor(m){this.ok=!1;m.charAt(0)=="#"&&(m=m.substr(1,6));var m=m.replace(/ /g,""),m=m.toLowerCase(),a={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b", darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff", gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa", lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080", oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd", slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},c;for(c in a)m==c&&(m=a[c]);var d=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(b){return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/, example:["#00ff00","336699"],process:function(b){return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(b){return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]}}];for(c=0;c255?255:this.r;this.g=this.g<0||isNaN(this.g)?0: this.g>255?255:this.g;this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b;this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.toHex=function(){var b=this.r.toString(16),a=this.g.toString(16),d=this.b.toString(16);b.length==1&&(b="0"+b);a.length==1&&(a="0"+a);d.length==1&&(d="0"+d);return"#"+b+a+d};this.getHelpXML=function(){for(var b=[],c=0;c "+o.toRGB()+" -> "+o.toHex());l.appendChild(n);l.appendChild(q);k.appendChild(l)}catch(p){}return k}} if(!window.console)window.console={},window.console.log=function(){},window.console.dir=function(){};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(m){for(var a=0;a]*>/,""),d=new ActiveXObject("Microsoft.XMLDOM");d.async="false";d.loadXML(a);return d}};a.Property=function(c,d){this.name=c;this.value=d;this.hasValue=function(){return this.value!=null&&this.value!==""};this.numValue=function(){if(!this.hasValue())return 0;var b=parseFloat(this.value);(this.value+"").match(/%$/)&& (b/=100);return b};this.valueOrDefault=function(b){return this.hasValue()?this.value:b};this.numValueOrDefault=function(b){return this.hasValue()?this.numValue():b};var b=this;this.Color={addOpacity:function(d){var c=b.value;if(d!=null&&d!=""){var f=new RGBColor(b.value);f.ok&&(c="rgba("+f.r+", "+f.g+", "+f.b+", "+d+")")}return new a.Property(b.name,c)}};this.Definition={getDefinition:function(){var d=b.value.replace(/^(url\()?#([^\)]+)\)?$/,"$2");return a.Definitions[d]},isUrl:function(){return b.value.indexOf("url(")== 0},getFillStyle:function(b){var d=this.getDefinition();return d!=null&&d.createGradient?d.createGradient(a.ctx,b):d!=null&&d.createPattern?d.createPattern(a.ctx,b):null}};this.Length={DPI:function(){return 96},EM:function(b){var d=12,c=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);c.hasValue()&&(d=c.Length.toPixels(b));return d},toPixels:function(d){if(!b.hasValue())return 0;var c=b.value+"";return c.match(/em$/)?b.numValue()*this.EM(d):c.match(/ex$/)?b.numValue()*this.EM(d)/2:c.match(/px$/)? b.numValue():c.match(/pt$/)?b.numValue()*1.25:c.match(/pc$/)?b.numValue()*15:c.match(/cm$/)?b.numValue()*this.DPI(d)/2.54:c.match(/mm$/)?b.numValue()*this.DPI(d)/25.4:c.match(/in$/)?b.numValue()*this.DPI(d):c.match(/%$/)?b.numValue()*a.ViewPort.ComputeSize(d):b.numValue()}};this.Time={toMilliseconds:function(){if(!b.hasValue())return 0;var a=b.value+"";if(a.match(/s$/))return b.numValue()*1E3;a.match(/ms$/);return b.numValue()}};this.Angle={toRadians:function(){if(!b.hasValue())return 0;var a=b.value+ "";return a.match(/deg$/)?b.numValue()*(Math.PI/180):a.match(/grad$/)?b.numValue()*(Math.PI/200):a.match(/rad$/)?b.numValue():b.numValue()*(Math.PI/180)}}};a.Font=new function(){this.Styles=["normal","italic","oblique","inherit"];this.Variants=["normal","small-caps","inherit"];this.Weights="normal,bold,bolder,lighter,100,200,300,400,500,600,700,800,900,inherit".split(",");this.CreateFont=function(d,b,c,e,f,g){g=g!=null?this.Parse(g):this.CreateFont("","","","","",a.ctx.font);return{fontFamily:f|| g.fontFamily,fontSize:e||g.fontSize,fontStyle:d||g.fontStyle,fontWeight:c||g.fontWeight,fontVariant:b||g.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var c=this;this.Parse=function(d){for(var b={},d=a.trim(a.compressSpaces(d||"")).split(" "),k=!1,e=!1,f=!1,g=!1,h="",j=0;jthis.x2)this.x2=b}if(a!=null){if(isNaN(this.y1)||isNaN(this.y2))this.y2=this.y1=a;if(athis.y2)this.y2=a}};this.addX=function(b){this.addPoint(b,null)};this.addY=function(b){this.addPoint(null,b)};this.addBoundingBox=function(b){this.addPoint(b.x1,b.y1);this.addPoint(b.x2,b.y2)};this.addQuadraticCurve=function(b,a,d,c,k,l){d=b+2/3*(d-b);c=a+2/3*(c- a);this.addBezierCurve(b,a,d,d+1/3*(k-b),c,c+1/3*(l-a),k,l)};this.addBezierCurve=function(b,a,d,c,k,l,o,n){var q=[b,a],p=[d,c],t=[k,l],m=[o,n];this.addPoint(q[0],q[1]);this.addPoint(m[0],m[1]);for(i=0;i<=1;i++)b=function(b){return Math.pow(1-b,3)*q[i]+3*Math.pow(1-b,2)*b*p[i]+3*(1-b)*Math.pow(b,2)*t[i]+Math.pow(b,3)*m[i]},a=6*q[i]-12*p[i]+6*t[i],d=-3*q[i]+9*p[i]-9*t[i]+3*m[i],c=3*p[i]-3*q[i],d==0?a!=0&&(a=-c/a,0=this.tokens.length-1};this.isCommandOrEnd=function(){return this.isEnd()? !0:this.tokens[this.i+1].match(/^[A-Za-z]$/)!=null};this.isRelativeCommand=function(){return this.command==this.command.toLowerCase()};this.getToken=function(){this.i+=1;return this.tokens[this.i]};this.getScalar=function(){return parseFloat(this.getToken())};this.nextCommand=function(){this.previousCommand=this.command;this.command=this.getToken()};this.getPoint=function(){return this.makeAbsolute(new a.Point(this.getScalar(),this.getScalar()))};this.getAsControlPoint=function(){var b=this.getPoint(); return this.control=b};this.getAsCurrentPoint=function(){var b=this.getPoint();return this.current=b};this.getReflectedControlPoint=function(){return this.previousCommand.toLowerCase()!="c"&&this.previousCommand.toLowerCase()!="s"?this.current:new a.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y)};this.makeAbsolute=function(b){if(this.isRelativeCommand())b.x=this.current.x+b.x,b.y=this.current.y+b.y;return b};this.addMarker=function(b,a,d){d!=null&&this.angles.length>0&&this.angles[this.angles.length- 1]==null&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(d));this.addMarkerAngle(b,a==null?null:a.angleTo(b))};this.addMarkerAngle=function(b,a){this.points.push(b);this.angles.push(a)};this.getMarkerPoints=function(){return this.points};this.getMarkerAngles=function(){for(var b=0;b1&&(j*=Math.sqrt(q),l*=Math.sqrt(q));o=(o==h?-1:1)*Math.sqrt((Math.pow(j,2)*Math.pow(l,2)-Math.pow(j,2)*Math.pow(n.y,2)-Math.pow(l,2)*Math.pow(n.x,2))/(Math.pow(j,2)*Math.pow(n.y,2)+Math.pow(l,2)*Math.pow(n.x,2)));isNaN(o)&&(o=0);var p=new a.Point(o*j*n.y/l,o*-l*n.x/j),g=new a.Point((g.x+e.x)/2+Math.cos(f)* p.x-Math.sin(f)*p.y,(g.y+e.y)/2+Math.sin(f)*p.x+Math.cos(f)*p.y),m=function(b,a){return(b[0]*a[0]+b[1]*a[1])/(Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2))*Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)))},s=function(b,a){return(b[0]*a[1]=1&&(n=0);h==0&&n>0&&(n-=2*Math.PI);h==1&&n<0&&(n+=2*Math.PI);q=new a.Point(g.x-j*Math.cos((o+n)/ 2),g.y-l*Math.sin((o+n)/2));b.addMarkerAngle(q,(o+n)/2+(h==0?1:-1)*Math.PI/2);b.addMarkerAngle(e,n+(h==0?1:-1)*Math.PI/2);c.addPoint(e.x,e.y);d!=null&&(m=j>l?j:l,e=j>l?1:j/l,j=j>l?l/j:1,d.translate(g.x,g.y),d.rotate(f),d.scale(e,j),d.arc(0,0,m,o,o+n,1-h),d.scale(1/e,1/j),d.rotate(-f),d.translate(-g.x,-g.y))}break;case "Z":d!=null&&d.closePath(),b.current=b.start}return c};this.getMarkers=function(){for(var a=this.PathParser.getMarkerPoints(),b=this.PathParser.getMarkerAngles(),c=[],e=0;ethis.maxDuration)if(this.attribute("repeatCount").value=="indefinite")this.duration=0;else return this.attribute("fill").valueOrDefault("remove")=="remove"&&!this.removed?(this.removed=!0,this.getProperty().value=this.initialValue,!0):!1;this.duration+=a;a=!1;if(this.begin0&&b[c-1]!=" "&&c0&&b[c-1]!=" "&&(c==b.length-1||b[c+1]==" "))g="initial";typeof a.glyphs[e]!="undefined"&&(f=a.glyphs[e][g],f==null&&a.glyphs[e].type=="glyph"&&(f=a.glyphs[e]))}else f=a.glyphs[e];if(f==null)f=a.missingGlyph;return f};this.renderChildren=function(c){var b=this.parent.style("font-family").Definition.getDefinition();if(b!=null){var k=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize), e=this.parent.style("font-style").valueOrDefault(a.Font.Parse(a.ctx.font).fontStyle),f=this.getText();b.isRTL&&(f=f.split("").reverse().join(""));for(var g=a.ToNumberArray(this.parent.attribute("dx").value),h=0;h0?c.childNodes[0].nodeValue:c.text;this.getText=function(){return this.text}};a.Element.tspan.prototype=new a.Element.TextElementBase;a.Element.tref=function(c){this.base=a.Element.TextElementBase;this.base(c);this.getText=function(){var a=this.attribute("xlink:href").Definition.getDefinition();if(a!=null)return a.children[0].getText()}};a.Element.tref.prototype=new a.Element.TextElementBase; a.Element.a=function(c){this.base=a.Element.TextElementBase;this.base(c);this.hasText=!0;for(var d=0;d1?c.childNodes[1].nodeValue: ""),c=c.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,""),c=a.compressSpaces(c),c=c.split("}"),d=0;d0){l=g[h].indexOf("url");j=g[h].indexOf(")",l);l=g[h].substr(l+5,j-l-6);l=a.parseXml(a.ajax(l)).getElementsByTagName("font");for(j=0;j * @link http://www.phpied.com/rgb-color-parser-in-javascript/ * Use it if you like it * */ function RGBColor(color_string) { this.ok = false; // strip any leading # if (color_string.charAt(0) == '#') { // remove # if any color_string = color_string.substr(1,6); } color_string = color_string.replace(/ /g,''); color_string = color_string.toLowerCase(); // before getting into regexps, try simple matches // and overwrite the input var simple_colors = { aliceblue: 'f0f8ff', antiquewhite: 'faebd7', aqua: '00ffff', aquamarine: '7fffd4', azure: 'f0ffff', beige: 'f5f5dc', bisque: 'ffe4c4', black: '000000', blanchedalmond: 'ffebcd', blue: '0000ff', blueviolet: '8a2be2', brown: 'a52a2a', burlywood: 'deb887', cadetblue: '5f9ea0', chartreuse: '7fff00', chocolate: 'd2691e', coral: 'ff7f50', cornflowerblue: '6495ed', cornsilk: 'fff8dc', crimson: 'dc143c', cyan: '00ffff', darkblue: '00008b', darkcyan: '008b8b', darkgoldenrod: 'b8860b', darkgray: 'a9a9a9', darkgreen: '006400', darkkhaki: 'bdb76b', darkmagenta: '8b008b', darkolivegreen: '556b2f', darkorange: 'ff8c00', darkorchid: '9932cc', darkred: '8b0000', darksalmon: 'e9967a', darkseagreen: '8fbc8f', darkslateblue: '483d8b', darkslategray: '2f4f4f', darkturquoise: '00ced1', darkviolet: '9400d3', deeppink: 'ff1493', deepskyblue: '00bfff', dimgray: '696969', dodgerblue: '1e90ff', feldspar: 'd19275', firebrick: 'b22222', floralwhite: 'fffaf0', forestgreen: '228b22', fuchsia: 'ff00ff', gainsboro: 'dcdcdc', ghostwhite: 'f8f8ff', gold: 'ffd700', goldenrod: 'daa520', gray: '808080', green: '008000', greenyellow: 'adff2f', honeydew: 'f0fff0', hotpink: 'ff69b4', indianred : 'cd5c5c', indigo : '4b0082', ivory: 'fffff0', khaki: 'f0e68c', lavender: 'e6e6fa', lavenderblush: 'fff0f5', lawngreen: '7cfc00', lemonchiffon: 'fffacd', lightblue: 'add8e6', lightcoral: 'f08080', lightcyan: 'e0ffff', lightgoldenrodyellow: 'fafad2', lightgrey: 'd3d3d3', lightgreen: '90ee90', lightpink: 'ffb6c1', lightsalmon: 'ffa07a', lightseagreen: '20b2aa', lightskyblue: '87cefa', lightslateblue: '8470ff', lightslategray: '778899', lightsteelblue: 'b0c4de', lightyellow: 'ffffe0', lime: '00ff00', limegreen: '32cd32', linen: 'faf0e6', magenta: 'ff00ff', maroon: '800000', mediumaquamarine: '66cdaa', mediumblue: '0000cd', mediumorchid: 'ba55d3', mediumpurple: '9370d8', mediumseagreen: '3cb371', mediumslateblue: '7b68ee', mediumspringgreen: '00fa9a', mediumturquoise: '48d1cc', mediumvioletred: 'c71585', midnightblue: '191970', mintcream: 'f5fffa', mistyrose: 'ffe4e1', moccasin: 'ffe4b5', navajowhite: 'ffdead', navy: '000080', oldlace: 'fdf5e6', olive: '808000', olivedrab: '6b8e23', orange: 'ffa500', orangered: 'ff4500', orchid: 'da70d6', palegoldenrod: 'eee8aa', palegreen: '98fb98', paleturquoise: 'afeeee', palevioletred: 'd87093', papayawhip: 'ffefd5', peachpuff: 'ffdab9', peru: 'cd853f', pink: 'ffc0cb', plum: 'dda0dd', powderblue: 'b0e0e6', purple: '800080', red: 'ff0000', rosybrown: 'bc8f8f', royalblue: '4169e1', saddlebrown: '8b4513', salmon: 'fa8072', sandybrown: 'f4a460', seagreen: '2e8b57', seashell: 'fff5ee', sienna: 'a0522d', silver: 'c0c0c0', skyblue: '87ceeb', slateblue: '6a5acd', slategray: '708090', snow: 'fffafa', springgreen: '00ff7f', steelblue: '4682b4', tan: 'd2b48c', teal: '008080', thistle: 'd8bfd8', tomato: 'ff6347', turquoise: '40e0d0', violet: 'ee82ee', violetred: 'd02090', wheat: 'f5deb3', white: 'ffffff', whitesmoke: 'f5f5f5', yellow: 'ffff00', yellowgreen: '9acd32' }; for (var key in simple_colors) { if (color_string == key) { color_string = simple_colors[key]; } } // emd of simple type-in colors // array of color definition objects var color_defs = [ { re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'], process: function (bits){ return [ parseInt(bits[1]), parseInt(bits[2]), parseInt(bits[3]) ]; } }, { re: /^(\w{2})(\w{2})(\w{2})$/, example: ['#00ff00', '336699'], process: function (bits){ return [ parseInt(bits[1], 16), parseInt(bits[2], 16), parseInt(bits[3], 16) ]; } }, { re: /^(\w{1})(\w{1})(\w{1})$/, example: ['#fb0', 'f0f'], process: function (bits){ return [ parseInt(bits[1] + bits[1], 16), parseInt(bits[2] + bits[2], 16), parseInt(bits[3] + bits[3], 16) ]; } } ]; // search through the definitions to find a match for (var i = 0; i < color_defs.length; i++) { var re = color_defs[i].re; var processor = color_defs[i].process; var bits = re.exec(color_string); if (bits) { channels = processor(bits); this.r = channels[0]; this.g = channels[1]; this.b = channels[2]; this.ok = true; } } // validate/cleanup values this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r); this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g); this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b); // some getters this.toRGB = function () { return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')'; } this.toHex = function () { var r = this.r.toString(16); var g = this.g.toString(16); var b = this.b.toString(16); if (r.length == 1) r = '0' + r; if (g.length == 1) g = '0' + g; if (b.length == 1) b = '0' + b; return '#' + r + g + b; } // help this.getHelpXML = function () { var examples = new Array(); // add regexps for (var i = 0; i < color_defs.length; i++) { var example = color_defs[i].example; for (var j = 0; j < example.length; j++) { examples[examples.length] = example[j]; } } // add type-in colors for (var sc in simple_colors) { examples[examples.length] = sc; } var xml = document.createElement('ul'); xml.setAttribute('id', 'rgbcolor-examples'); for (var i = 0; i < examples.length; i++) { try { var list_item = document.createElement('li'); var list_color = new RGBColor(examples[i]); var example_div = document.createElement('div'); example_div.style.cssText = 'margin: 3px; ' + 'border: 1px solid black; ' + 'background:' + list_color.toHex() + '; ' + 'color:' + list_color.toHex() ; example_div.appendChild(document.createTextNode('test')); var list_item_value = document.createTextNode( ' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex() ); list_item.appendChild(example_div); list_item.appendChild(list_item_value); xml.appendChild(list_item); } catch(e){} } return xml; } } /** * @license canvg.js - Javascript SVG parser and renderer on Canvas * MIT Licensed * Gabe Lerner (gabelerner@gmail.com) * http://code.google.com/p/canvg/ * * Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/ * */ if(!window.console) { window.console = {}; window.console.log = function(str) {}; window.console.dir = function(str) {}; } if(!Array.prototype.indexOf){ Array.prototype.indexOf = function(obj){ for(var i=0; i ignore mouse events // ignoreAnimation: true => ignore animations // ignoreDimensions: true => does not try to resize canvas // ignoreClear: true => does not clear canvas // offsetX: int => draws at a x offset // offsetY: int => draws at a y offset // scaleWidth: int => scales horizontally to width // scaleHeight: int => scales vertically to height // renderCallback: function => will call the function after the first render is completed // forceRedraw: function => will call the function on every frame, if it returns true, will redraw this.canvg = function (target, s, opts) { // no parameters if (target == null && s == null && opts == null) { var svgTags = document.getElementsByTagName('svg'); for (var i=0; i]*>/, ''); var xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); xmlDoc.async = 'false'; xmlDoc.loadXML(xml); return xmlDoc; } } svg.Property = function(name, value) { this.name = name; this.value = value; this.hasValue = function() { return (this.value != null && this.value !== ''); } // return the numerical value of the property this.numValue = function() { if (!this.hasValue()) return 0; var n = parseFloat(this.value); if ((this.value + '').match(/%$/)) { n = n / 100.0; } return n; } this.valueOrDefault = function(def) { if (this.hasValue()) return this.value; return def; } this.numValueOrDefault = function(def) { if (this.hasValue()) return this.numValue(); return def; } /* EXTENSIONS */ var that = this; // color extensions this.Color = { // augment the current color value with the opacity addOpacity: function(opacity) { var newValue = that.value; if (opacity != null && opacity != '') { var color = new RGBColor(that.value); if (color.ok) { newValue = 'rgba(' + color.r + ', ' + color.g + ', ' + color.b + ', ' + opacity + ')'; } } return new svg.Property(that.name, newValue); } } // definition extensions this.Definition = { // get the definition from the definitions table getDefinition: function() { var name = that.value.replace(/^(url\()?#([^\)]+)\)?$/, '$2'); return svg.Definitions[name]; }, isUrl: function() { return that.value.indexOf('url(') == 0 }, getFillStyle: function(e) { var def = this.getDefinition(); // gradient if (def != null && def.createGradient) { return def.createGradient(svg.ctx, e); } // pattern if (def != null && def.createPattern) { return def.createPattern(svg.ctx, e); } return null; } } // length extensions this.Length = { DPI: function(viewPort) { return 96.0; // TODO: compute? }, EM: function(viewPort) { var em = 12; var fontSize = new svg.Property('fontSize', svg.Font.Parse(svg.ctx.font).fontSize); if (fontSize.hasValue()) em = fontSize.Length.toPixels(viewPort); return em; }, // get the length as pixels toPixels: function(viewPort) { if (!that.hasValue()) return 0; var s = that.value+''; if (s.match(/em$/)) return that.numValue() * this.EM(viewPort); if (s.match(/ex$/)) return that.numValue() * this.EM(viewPort) / 2.0; if (s.match(/px$/)) return that.numValue(); if (s.match(/pt$/)) return that.numValue() * 1.25; if (s.match(/pc$/)) return that.numValue() * 15; if (s.match(/cm$/)) return that.numValue() * this.DPI(viewPort) / 2.54; if (s.match(/mm$/)) return that.numValue() * this.DPI(viewPort) / 25.4; if (s.match(/in$/)) return that.numValue() * this.DPI(viewPort); if (s.match(/%$/)) return that.numValue() * svg.ViewPort.ComputeSize(viewPort); return that.numValue(); } } // time extensions this.Time = { // get the time as milliseconds toMilliseconds: function() { if (!that.hasValue()) return 0; var s = that.value+''; if (s.match(/s$/)) return that.numValue() * 1000; if (s.match(/ms$/)) return that.numValue(); return that.numValue(); } } // angle extensions this.Angle = { // get the angle as radians toRadians: function() { if (!that.hasValue()) return 0; var s = that.value+''; if (s.match(/deg$/)) return that.numValue() * (Math.PI / 180.0); if (s.match(/grad$/)) return that.numValue() * (Math.PI / 200.0); if (s.match(/rad$/)) return that.numValue(); return that.numValue() * (Math.PI / 180.0); } } } // fonts svg.Font = new (function() { this.Styles = ['normal','italic','oblique','inherit']; this.Variants = ['normal','small-caps','inherit']; this.Weights = ['normal','bold','bolder','lighter','100','200','300','400','500','600','700','800','900','inherit']; this.CreateFont = function(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) { var f = inherit != null ? this.Parse(inherit) : this.CreateFont('', '', '', '', '', svg.ctx.font); return { fontFamily: fontFamily || f.fontFamily, fontSize: fontSize || f.fontSize, fontStyle: fontStyle || f.fontStyle, fontWeight: fontWeight || f.fontWeight, fontVariant: fontVariant || f.fontVariant, toString: function () { return [this.fontStyle, this.fontVariant, this.fontWeight, this.fontSize, this.fontFamily].join(' ') } } } var that = this; this.Parse = function(s) { var f = {}; var d = svg.trim(svg.compressSpaces(s || '')).split(' '); var set = { fontSize: false, fontStyle: false, fontWeight: false, fontVariant: false } var ff = ''; for (var i=0; i this.x2) this.x2 = x; } if (y != null) { if (isNaN(this.y1) || isNaN(this.y2)) { this.y1 = y; this.y2 = y; } if (y < this.y1) this.y1 = y; if (y > this.y2) this.y2 = y; } } this.addX = function(x) { this.addPoint(x, null); } this.addY = function(y) { this.addPoint(null, y); } this.addBoundingBox = function(bb) { this.addPoint(bb.x1, bb.y1); this.addPoint(bb.x2, bb.y2); } this.addQuadraticCurve = function(p0x, p0y, p1x, p1y, p2x, p2y) { var cp1x = p0x + 2/3 * (p1x - p0x); // CP1 = QP0 + 2/3 *(QP1-QP0) var cp1y = p0y + 2/3 * (p1y - p0y); // CP1 = QP0 + 2/3 *(QP1-QP0) var cp2x = cp1x + 1/3 * (p2x - p0x); // CP2 = CP1 + 1/3 *(QP2-QP0) var cp2y = cp1y + 1/3 * (p2y - p0y); // CP2 = CP1 + 1/3 *(QP2-QP0) this.addBezierCurve(p0x, p0y, cp1x, cp2x, cp1y, cp2y, p2x, p2y); } this.addBezierCurve = function(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) { // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html var p0 = [p0x, p0y], p1 = [p1x, p1y], p2 = [p2x, p2y], p3 = [p3x, p3y]; this.addPoint(p0[0], p0[1]); this.addPoint(p3[0], p3[1]); for (i=0; i<=1; i++) { var f = function(t) { return Math.pow(1-t, 3) * p0[i] + 3 * Math.pow(1-t, 2) * t * p1[i] + 3 * (1-t) * Math.pow(t, 2) * p2[i] + Math.pow(t, 3) * p3[i]; } var b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i]; var a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i]; var c = 3 * p1[i] - 3 * p0[i]; if (a == 0) { if (b == 0) continue; var t = -c / b; if (0 < t && t < 1) { if (i == 0) this.addX(f(t)); if (i == 1) this.addY(f(t)); } continue; } var b2ac = Math.pow(b, 2) - 4 * c * a; if (b2ac < 0) continue; var t1 = (-b + Math.sqrt(b2ac)) / (2 * a); if (0 < t1 && t1 < 1) { if (i == 0) this.addX(f(t1)); if (i == 1) this.addY(f(t1)); } var t2 = (-b - Math.sqrt(b2ac)) / (2 * a); if (0 < t2 && t2 < 1) { if (i == 0) this.addX(f(t2)); if (i == 1) this.addY(f(t2)); } } } this.isPointInBox = function(x, y) { return (this.x1 <= x && x <= this.x2 && this.y1 <= y && y <= this.y2); } this.addPoint(x1, y1); this.addPoint(x2, y2); } // transforms svg.Transform = function(v) { var that = this; this.Type = {} // translate this.Type.translate = function(s) { this.p = svg.CreatePoint(s); this.apply = function(ctx) { ctx.translate(this.p.x || 0.0, this.p.y || 0.0); } this.applyToPoint = function(p) { p.applyTransform([1, 0, 0, 1, this.p.x || 0.0, this.p.y || 0.0]); } } // rotate this.Type.rotate = function(s) { var a = svg.ToNumberArray(s); this.angle = new svg.Property('angle', a[0]); this.cx = a[1] || 0; this.cy = a[2] || 0; this.apply = function(ctx) { ctx.translate(this.cx, this.cy); ctx.rotate(this.angle.Angle.toRadians()); ctx.translate(-this.cx, -this.cy); } this.applyToPoint = function(p) { var a = this.angle.Angle.toRadians(); p.applyTransform([1, 0, 0, 1, this.p.x || 0.0, this.p.y || 0.0]); p.applyTransform([Math.cos(a), Math.sin(a), -Math.sin(a), Math.cos(a), 0, 0]); p.applyTransform([1, 0, 0, 1, -this.p.x || 0.0, -this.p.y || 0.0]); } } this.Type.scale = function(s) { this.p = svg.CreatePoint(s); this.apply = function(ctx) { ctx.scale(this.p.x || 1.0, this.p.y || this.p.x || 1.0); } this.applyToPoint = function(p) { p.applyTransform([this.p.x || 0.0, 0, 0, this.p.y || 0.0, 0, 0]); } } this.Type.matrix = function(s) { this.m = svg.ToNumberArray(s); this.apply = function(ctx) { ctx.transform(this.m[0], this.m[1], this.m[2], this.m[3], this.m[4], this.m[5]); } this.applyToPoint = function(p) { p.applyTransform(this.m); } } this.Type.SkewBase = function(s) { this.base = that.Type.matrix; this.base(s); this.angle = new svg.Property('angle', s); } this.Type.SkewBase.prototype = new this.Type.matrix; this.Type.skewX = function(s) { this.base = that.Type.SkewBase; this.base(s); this.m = [1, 0, Math.tan(this.angle.Angle.toRadians()), 1, 0, 0]; } this.Type.skewX.prototype = new this.Type.SkewBase; this.Type.skewY = function(s) { this.base = that.Type.SkewBase; this.base(s); this.m = [1, Math.tan(this.angle.Angle.toRadians()), 0, 1, 0, 0]; } this.Type.skewY.prototype = new this.Type.SkewBase; this.transforms = []; this.apply = function(ctx) { for (var i=0; i= this.tokens.length - 1; } this.isCommandOrEnd = function() { if (this.isEnd()) return true; return this.tokens[this.i + 1].match(/^[A-Za-z]$/) != null; } this.isRelativeCommand = function() { return this.command == this.command.toLowerCase(); } this.getToken = function() { this.i = this.i + 1; return this.tokens[this.i]; } this.getScalar = function() { return parseFloat(this.getToken()); } this.nextCommand = function() { this.previousCommand = this.command; this.command = this.getToken(); } this.getPoint = function() { var p = new svg.Point(this.getScalar(), this.getScalar()); return this.makeAbsolute(p); } this.getAsControlPoint = function() { var p = this.getPoint(); this.control = p; return p; } this.getAsCurrentPoint = function() { var p = this.getPoint(); this.current = p; return p; } this.getReflectedControlPoint = function() { if (this.previousCommand.toLowerCase() != 'c' && this.previousCommand.toLowerCase() != 's') { return this.current; } // reflect point var p = new svg.Point(2 * this.current.x - this.control.x, 2 * this.current.y - this.control.y); return p; } this.makeAbsolute = function(p) { if (this.isRelativeCommand()) { p.x = this.current.x + p.x; p.y = this.current.y + p.y; } return p; } this.addMarker = function(p, from, priorTo) { // if the last angle isn't filled in because we didn't have this point yet ... if (priorTo != null && this.angles.length > 0 && this.angles[this.angles.length-1] == null) { this.angles[this.angles.length-1] = this.points[this.points.length-1].angleTo(priorTo); } this.addMarkerAngle(p, from == null ? null : from.angleTo(p)); } this.addMarkerAngle = function(p, a) { this.points.push(p); this.angles.push(a); } this.getMarkerPoints = function() { return this.points; } this.getMarkerAngles = function() { for (var i=0; i 1) { rx *= Math.sqrt(l); ry *= Math.sqrt(l); } // cx', cy' var s = (largeArcFlag == sweepFlag ? -1 : 1) * Math.sqrt( ((Math.pow(rx,2)*Math.pow(ry,2))-(Math.pow(rx,2)*Math.pow(currp.y,2))-(Math.pow(ry,2)*Math.pow(currp.x,2))) / (Math.pow(rx,2)*Math.pow(currp.y,2)+Math.pow(ry,2)*Math.pow(currp.x,2)) ); if (isNaN(s)) s = 0; var cpp = new svg.Point(s * rx * currp.y / ry, s * -ry * currp.x / rx); // cx, cy var centp = new svg.Point( (curr.x + cp.x) / 2.0 + Math.cos(xAxisRotation) * cpp.x - Math.sin(xAxisRotation) * cpp.y, (curr.y + cp.y) / 2.0 + Math.sin(xAxisRotation) * cpp.x + Math.cos(xAxisRotation) * cpp.y ); // vector magnitude var m = function(v) { return Math.sqrt(Math.pow(v[0],2) + Math.pow(v[1],2)); } // ratio between two vectors var r = function(u, v) { return (u[0]*v[0]+u[1]*v[1]) / (m(u)*m(v)) } // angle between two vectors var a = function(u, v) { return (u[0]*v[1] < u[1]*v[0] ? -1 : 1) * Math.acos(r(u,v)); } // initial angle var a1 = a([1,0], [(currp.x-cpp.x)/rx,(currp.y-cpp.y)/ry]); // angle delta var u = [(currp.x-cpp.x)/rx,(currp.y-cpp.y)/ry]; var v = [(-currp.x-cpp.x)/rx,(-currp.y-cpp.y)/ry]; var ad = a(u, v); if (r(u,v) <= -1) ad = Math.PI; if (r(u,v) >= 1) ad = 0; if (sweepFlag == 0 && ad > 0) ad = ad - 2 * Math.PI; if (sweepFlag == 1 && ad < 0) ad = ad + 2 * Math.PI; // for markers var halfWay = new svg.Point( centp.x - rx * Math.cos((a1 + ad) / 2), centp.y - ry * Math.sin((a1 + ad) / 2) ); pp.addMarkerAngle(halfWay, (a1 + ad) / 2 + (sweepFlag == 0 ? 1 : -1) * Math.PI / 2); pp.addMarkerAngle(cp, ad + (sweepFlag == 0 ? 1 : -1) * Math.PI / 2); bb.addPoint(cp.x, cp.y); // TODO: this is too naive, make it better if (ctx != null) { var r = rx > ry ? rx : ry; var sx = rx > ry ? 1 : rx / ry; var sy = rx > ry ? ry / rx : 1; ctx.translate(centp.x, centp.y); ctx.rotate(xAxisRotation); ctx.scale(sx, sy); ctx.arc(0, 0, r, a1, a1 + ad, 1 - sweepFlag); ctx.scale(1/sx, 1/sy); ctx.rotate(-xAxisRotation); ctx.translate(-centp.x, -centp.y); } } break; case 'Z': if (ctx != null) ctx.closePath(); pp.current = pp.start; } } return bb; } this.getMarkers = function() { var points = this.PathParser.getMarkerPoints(); var angles = this.PathParser.getMarkerAngles(); var markers = []; for (var i=0; i this.maxDuration) { // loop for indefinitely repeating animations if (this.attribute('repeatCount').value == 'indefinite') { this.duration = 0.0 } else if (this.attribute('fill').valueOrDefault('remove') == 'remove' && !this.removed) { this.removed = true; this.getProperty().value = this.initialValue; return true; } else { return false; // no updates made } } this.duration = this.duration + delta; // if we're past the begin time var updated = false; if (this.begin < this.duration) { var newValue = this.calcValue(); // tween if (this.attribute('type').hasValue()) { // for transform, etc. var type = this.attribute('type').value; newValue = type + '(' + newValue + ')'; } this.getProperty().value = newValue; updated = true; } return updated; } // fraction of duration we've covered this.progress = function() { return ((this.duration - this.begin) / (this.maxDuration - this.begin)); } } svg.Element.AnimateBase.prototype = new svg.Element.ElementBase; // animate element svg.Element.animate = function(node) { this.base = svg.Element.AnimateBase; this.base(node); this.calcValue = function() { var from = this.attribute('from').numValue(); var to = this.attribute('to').numValue(); // tween value linearly return from + (to - from) * this.progress(); }; } svg.Element.animate.prototype = new svg.Element.AnimateBase; // animate color element svg.Element.animateColor = function(node) { this.base = svg.Element.AnimateBase; this.base(node); this.calcValue = function() { var from = new RGBColor(this.attribute('from').value); var to = new RGBColor(this.attribute('to').value); if (from.ok && to.ok) { // tween color linearly var r = from.r + (to.r - from.r) * this.progress(); var g = from.g + (to.g - from.g) * this.progress(); var b = from.b + (to.b - from.b) * this.progress(); return 'rgb('+parseInt(r,10)+','+parseInt(g,10)+','+parseInt(b,10)+')'; } return this.attribute('from').value; }; } svg.Element.animateColor.prototype = new svg.Element.AnimateBase; // animate transform element svg.Element.animateTransform = function(node) { this.base = svg.Element.animate; this.base(node); } svg.Element.animateTransform.prototype = new svg.Element.animate; // font element svg.Element.font = function(node) { this.base = svg.Element.ElementBase; this.base(node); this.horizAdvX = this.attribute('horiz-adv-x').numValue(); this.isRTL = false; this.isArabic = false; this.fontFace = null; this.missingGlyph = null; this.glyphs = []; for (var i=0; i0 && text[i-1]!=' ' && i0 && text[i-1]!=' ' && (i == text.length-1 || text[i+1]==' ')) arabicForm = 'initial'; if (typeof(font.glyphs[c]) != 'undefined') { glyph = font.glyphs[c][arabicForm]; if (glyph == null && font.glyphs[c].type == 'glyph') glyph = font.glyphs[c]; } } else { glyph = font.glyphs[c]; } if (glyph == null) glyph = font.missingGlyph; return glyph; } this.renderChildren = function(ctx) { var customFont = this.parent.style('font-family').Definition.getDefinition(); if (customFont != null) { var fontSize = this.parent.style('font-size').numValueOrDefault(svg.Font.Parse(svg.ctx.font).fontSize); var fontStyle = this.parent.style('font-style').valueOrDefault(svg.Font.Parse(svg.ctx.font).fontStyle); var text = this.getText(); if (customFont.isRTL) text = text.split("").reverse().join(""); var dx = svg.ToNumberArray(this.parent.attribute('dx').value); for (var i=0; i 0 ? node.childNodes[0].nodeValue : // element node.text; this.getText = function() { return this.text; } } svg.Element.tspan.prototype = new svg.Element.TextElementBase; // tref svg.Element.tref = function(node) { this.base = svg.Element.TextElementBase; this.base(node); this.getText = function() { var element = this.attribute('xlink:href').Definition.getDefinition(); if (element != null) return element.children[0].getText(); } } svg.Element.tref.prototype = new svg.Element.TextElementBase; // a element svg.Element.a = function(node) { this.base = svg.Element.TextElementBase; this.base(node); this.hasText = true; for (var i=0; i 1 ? node.childNodes[1].nodeValue : ''); css = css.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, ''); // remove comments css = svg.compressSpaces(css); // replace whitespace var cssDefs = css.split('}'); for (var i=0; i 0) { var urlStart = srcs[s].indexOf('url'); var urlEnd = srcs[s].indexOf(')', urlStart); var url = srcs[s].substr(urlStart + 5, urlEnd - urlStart - 6); var doc = svg.parseXml(svg.ajax(url)); var fonts = doc.getElementsByTagName('font'); for (var f=0; f
        • ', '
          ', '', '
          ', '
          ', '
          ', '
          ', '
          ', '
           ', '
        • ' ].join(''); var $container, $imgWrap, $file; var files, fileCount = 0, uploadVerNo; function init() { options = $.extend({}, defaults, options); $container = $(container).addClass("up-container"); if (!$container.length) { return; } $imgWrap = $container.find("ul.up-pics"); if (!$imgWrap.length) { $imgWrap = $('
            ').appendTo($container); } $file = $('').appendTo($container); if (options.uploadLimit > 1) { $file.attr("multiple", "multiple"); } $file.wrap('
            ').change(function () { if (!this.files || !this.files.length) { return; } uploadVerNo = Math.random(); files = this.files; fileCount = files.length; asyncUpload(0); }); $imgWrap.on("tap", "a.up-del", function () { $(this).closest("li.up-pic").remove(); uploadCountCheck(); }); $imgWrap.on("click", "a.up-del", function () { $(this).closest("li.up-pic").remove(); uploadCountCheck(); }); uploadCountCheck(); var imgs = []; if (options.imgs) { var type = getType(options.imgs); switch (type) { case 'string': imgs = options.imgs.split(','); break; case 'array': imgs = options.imgs; break; default: break; } } imgs.forEach(function (url) { insertItem(url); }); } function asyncUpload(index) { if (index >= files.length) { $file.val(""); return; } uploadFile(files[index], function () { asyncUpload(++index); }); } //上传,可实现批量上传 function uploadFile(file, onUploadComplete) { if (!file.type.match(/image.*/)) { alert("只能选择图片文件."); fileCount--; if (onUploadComplete) { onUploadComplete.call(); } return; } if (file.size > options.sizeLimit * 1024 * 1024) { alert("图片最大不能超过" + options.sizeLimit + "M."); fileCount--; if (onUploadComplete) { onUploadComplete.call(); } return; } if (isOverUploadLimit()) { alert("最多只能上传" + options.uploadLimit + "个文件."); fileCount = options.uploadLimit; if (onUploadComplete) { onUploadComplete.call(); } return; } //获取照片方向角属性,用户旋转控制 var orientation = null; if (options.enableScale) { EXIF.getData(file, function () { EXIF.getAllTags(this); orientation = EXIF.getTag(this, 'Orientation'); }); } var fileName = file.name, $imgItem = $(imgItemHtml).appendTo($imgWrap); function readFile() { var reader = new FileReader(); reader.onloadend = function () { if (reader.error) { alert("文件获取失败!"); $imgItem.remove(); if (onUploadComplete) { onUploadComplete.call(); } return; } var fileData = reader.result; //"data:image/jpeg;base64,"开头 //第一段进度条 //$imgItem.find(".pos").animate({ width: "30%" }, 100, "linear"); $imgItem.find("img").attr({ "src": fileData, "onload": loadimg }); if (options.enableScale) { scaleAndUpload(fileData); } else { upload(fileData); } }; reader.readAsDataURL(file); } //缩放后上传 function scaleAndUpload(src) { var image = new Image(); //绑定 load 事件处理器,加载完成后执行 image.onload = function () { var scaleWidth = this.naturalWidth, scaleHeight = this.naturalHeight; // 如果高度超标 //if (scaleHeight > options.maxHeight) { // // 宽度等比例缩放 *= // scaleWidth *= options.maxHeight / scaleHeight; // scaleHeight = options.maxHeight; //} //if (scaleWidth > options.maxWidth) { // // 高度等比例缩放 *= // scaleHeight *= options.maxWidth / scaleWidth; // scaleWidth = options.maxWidth; //} this.width = scaleWidth, this.height = scaleHeight; var canvas = document.createElement("canvas"); var ctx = canvas.getContext("2d"); canvas.width = scaleWidth; canvas.height = scaleHeight; ctx.drawImage(this, 0, 0, scaleWidth, scaleHeight); var fileData = null; //修复ios if (navigator.userAgent.match(/iphone/i)) { //如果方向角不为1,都需要进行旋转 if (orientation != "" && orientation != 1) { switch (orientation) { case 6://需要顺时针(向右)90度旋转 rotateImage(this, 'right', canvas); break; case 8://需要逆时针(向左)90度旋转 rotateImage(this, 'left', canvas); break; case 3://需要180度旋转 rotateImage(this, 'left', canvas);//转两次 rotateImage(this, 'left', canvas); break; } } fileData = canvas.toDataURL("image/jpeg", 0.9); } else if (navigator.userAgent.match(/Android/i) && !true) {// 修复android var encoder = new JPEGEncoder(); fileData = encoder.encode(ctx.getImageData(0, 0, expectWidth, expectHeight), 80); } else { if (orientation != "" && orientation != 1) { switch (orientation) { case 6://需要顺时针(向右)90度旋转 rotateImage(this, 'right', canvas); break; case 8://需要逆时针(向左)90度旋转 rotateImage(this, 'left', canvas); break; case 3://需要180度旋转 rotateImage(this, 'left', canvas);//转两次 rotateImage(this, 'left', canvas); break; } } fileData = canvas.toDataURL("image/jpeg", 0.9); } upload(fileData); }; //必须先绑定事件,才能设置src属性,否则会出同步问题。 image.src = src; } //提交至服务器 function upload(fileData) { if (options.asyncUpload && options.uploadUrl) { var postData = $.extend(options.postData, { fileName: fileName, data: fileData, count: fileCount, uploadVerNo: uploadVerNo }); $.post(options.uploadUrl, postData, function (res) { if (!res.success) { alert(res.message); $imgItem.remove(); if (onUploadComplete) { onUploadComplete.call(); } return; } $imgItem.find("img").attr({ "src": res.src, "onload": loadimg }); // 播放剩下的进度条动画 $imgItem.find(".pos").animate({ width: "100%" }, 0, "linear", function () { $imgItem.addClass("up-over"); uploadCountCheck(); if (onUploadComplete) { onUploadComplete.call(); } }); }, "json"); } else { $imgItem.find("img").attr({ "src": fileData, "onload": loadimg }); //播放剩下的进度条动画 $imgItem.find(".pos").animate({ width: "100%" }, 500, "linear", function () { $imgItem.addClass("up-over"); uploadCountCheck(); if (onUploadComplete) { onUploadComplete.call(); } }); } } readFile(); } //旋转图片 function rotateImage(image, direction, canvas) { if (image == null) return; //最小与最大旋转方向,图片旋转4次后回到原方向 var min_step = 0, max_step = 3, step = 2, height = image.height, width = image.width; if (direction == 'left') { step++; step > max_step && (step = min_step); } else { step--; step < min_step && (step = max_step); } //旋转角度以弧度值为参数 var degree = step * 90 * Math.PI / 180; var ctx = canvas.getContext('2d'); switch (step) { case 0: canvas.width = width; canvas.height = height; ctx.drawImage(image, 0, 0, width, height); break; case 1: canvas.width = height; canvas.height = width; ctx.rotate(degree); ctx.drawImage(image, 0, -height, width, height); break; case 2: canvas.width = width; canvas.height = height; ctx.rotate(degree); ctx.drawImage(image, -width, -height, width, height); break; case 3: canvas.width = height; canvas.height = width; ctx.rotate(degree); ctx.drawImage(image, -width, 0, width, height); break; } } function loadimg() { var e = this.parentNode; if (e) { var t = this.offsetHeight - e.offsetHeight; var w = this.offsetWidth - e.offsetWidth; 0 > t && (this.style.width = "auto", this.style.height = "100%"); 0 > w && (this.style.height = "auto", this.style.width = "100%"); } } function uploadCountCheck() { if (isOverUploadLimit()) { $file.parent().hide(); } else { $file.parent().show(); } } function isOverUploadLimit() { return options.uploadLimit > 0 && $imgWrap.children().length >= options.uploadLimit; } //获得已上传图片路径 function getUploadFiles() { var files = []; $imgWrap.find(".up-over img").each(function () { files.push($(this).attr("src")); }); return files; } function insertItem(src) { var $imgItem = $(imgItemHtml).appendTo($imgWrap); $imgItem.addClass("up-over"); $imgItem.find("img") .attr({ "src": src, "onload": loadimg }); uploadCountCheck(); } function clear() { $imgWrap.empty(); } return init(), { "getUploadFiles": getUploadFiles, "insertItem": insertItem, "clear": clear }; } })(jQuery); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/css/layui.css ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ .layui-btn,.layui-inline,img{vertical-align:middle}.layui-btn,.layui-disabled,.layui-icon,.layui-unselect{-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none}blockquote,body,button,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,input,li,ol,p,pre,td,textarea,th,ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}a:active,a:hover{outline:0}img{display:inline-block;border:none}li{list-style:none}table{border-collapse:collapse;border-spacing:0}h1,h2,h3{font-size:14px;font-weight:400}h4,h5,h6{font-size:100%;font-weight:400}button,input,optgroup,option,select,textarea{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;outline:0}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}@font-face{font-family:layui-icon;src:url(../font/iconfont.eot?v=213);src:url(../font/iconfont.eot?v=213#iefix) format('embedded-opentype'),url(../font/iconfont.svg?v=213#iconfont) format('svg'),url(../font/iconfont.woff?v=213) format('woff'),url(../font/iconfont.ttf?v=213) format('truetype')}.layui-icon{font-family:layui-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{line-height:24px;font:14px Helvetica Neue,Helvetica,PingFang SC,\5FAE\8F6F\96C5\9ED1,Tahoma,Arial,sans-serif}hr{height:1px;margin:10px 0;border:0;background-color:#e2e2e2;clear:both}a{color:#333;text-decoration:none}a:hover{color:#777}a cite{font-style:normal;*cursor:pointer}.layui-border-box,.layui-border-box *{box-sizing:border-box}.layui-box,.layui-box *{box-sizing:content-box}.layui-clear{clear:both;*zoom:1}.layui-clear:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-inline{position:relative;display:inline-block;*display:inline;*zoom:1}.layui-edge{position:absolute;width:0;height:0;border-style:dashed;border-color:transparent;overflow:hidden}.layui-elip{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-disabled,.layui-disabled:hover{color:#d2d2d2!important;cursor:not-allowed!important}.layui-circle{border-radius:100%}.layui-show{display:block!important}.layui-hide{display:none!important}.layui-main{position:relative;width:1140px;margin:0 auto}.layui-header{position:relative;z-index:1000;height:60px}.layui-header a:hover{transition:all .5s;-webkit-transition:all .5s}.layui-side{position:fixed;top:0;bottom:0;z-index:999;width:200px;overflow-x:hidden}.layui-side-scroll{width:220px;height:100%;overflow-x:hidden}.layui-body{position:absolute;left:200px;right:0;top:0;bottom:0;z-index:998;width:auto;overflow:hidden;overflow-y:auto;box-sizing:border-box}.layui-layout-admin .layui-header{background-color:#23262E}.layui-layout-admin .layui-side{top:60px;width:200px;overflow-x:hidden}.layui-layout-admin .layui-body{top:60px;bottom:44px}.layui-layout-admin .layui-main{width:auto;margin:0 15px}.layui-layout-admin .layui-footer{position:fixed;left:200px;right:0;bottom:0;height:44px;line-height:44px;padding:0 15px;background-color:#eee}.layui-layout-admin .layui-logo{position:absolute;left:0;top:0;width:200px;height:100%;line-height:60px;text-align:center;color:#009688;font-size:16px}.layui-layout-admin .layui-header .layui-nav{background:0 0}.layui-layout-left{position:absolute!important;left:200px;top:0}.layui-layout-right{position:absolute!important;right:0;top:0}.layui-container{position:relative;margin:0 auto;padding:0 15px;box-sizing:border-box}.layui-fluid{position:relative;margin:0 auto;padding:0 15px}.layui-row:after,.layui-row:before{content:'';display:block;clear:both}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9,.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9,.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9,.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{position:relative;display:block;box-sizing:border-box}.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{float:left}.layui-col-xs1{width:8.33333333%}.layui-col-xs2{width:16.66666667%}.layui-col-xs3{width:25%}.layui-col-xs4{width:33.33333333%}.layui-col-xs5{width:41.66666667%}.layui-col-xs6{width:50%}.layui-col-xs7{width:58.33333333%}.layui-col-xs8{width:66.66666667%}.layui-col-xs9{width:75%}.layui-col-xs10{width:83.33333333%}.layui-col-xs11{width:91.66666667%}.layui-col-xs12{width:100%}.layui-col-xs-offset1{margin-left:8.33333333%}.layui-col-xs-offset2{margin-left:16.66666667%}.layui-col-xs-offset3{margin-left:25%}.layui-col-xs-offset4{margin-left:33.33333333%}.layui-col-xs-offset5{margin-left:41.66666667%}.layui-col-xs-offset6{margin-left:50%}.layui-col-xs-offset7{margin-left:58.33333333%}.layui-col-xs-offset8{margin-left:66.66666667%}.layui-col-xs-offset9{margin-left:75%}.layui-col-xs-offset10{margin-left:83.33333333%}.layui-col-xs-offset11{margin-left:91.66666667%}.layui-col-xs-offset12{margin-left:100%}@media screen and (max-width:768px){.layui-hide-xs{display:none!important}.layui-show-xs-block{display:block!important}.layui-show-xs-inline{display:inline!important}.layui-show-xs-inline-block{display:inline-block!important}}@media screen and (min-width:768px){.layui-container{width:750px}.layui-hide-sm{display:none!important}.layui-show-sm-block{display:block!important}.layui-show-sm-inline{display:inline!important}.layui-show-sm-inline-block{display:inline-block!important}.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9{float:left}.layui-col-sm1{width:8.33333333%}.layui-col-sm2{width:16.66666667%}.layui-col-sm3{width:25%}.layui-col-sm4{width:33.33333333%}.layui-col-sm5{width:41.66666667%}.layui-col-sm6{width:50%}.layui-col-sm7{width:58.33333333%}.layui-col-sm8{width:66.66666667%}.layui-col-sm9{width:75%}.layui-col-sm10{width:83.33333333%}.layui-col-sm11{width:91.66666667%}.layui-col-sm12{width:100%}.layui-col-sm-offset1{margin-left:8.33333333%}.layui-col-sm-offset2{margin-left:16.66666667%}.layui-col-sm-offset3{margin-left:25%}.layui-col-sm-offset4{margin-left:33.33333333%}.layui-col-sm-offset5{margin-left:41.66666667%}.layui-col-sm-offset6{margin-left:50%}.layui-col-sm-offset7{margin-left:58.33333333%}.layui-col-sm-offset8{margin-left:66.66666667%}.layui-col-sm-offset9{margin-left:75%}.layui-col-sm-offset10{margin-left:83.33333333%}.layui-col-sm-offset11{margin-left:91.66666667%}.layui-col-sm-offset12{margin-left:100%}}@media screen and (min-width:992px){.layui-container{width:970px}.layui-hide-md{display:none!important}.layui-show-md-block{display:block!important}.layui-show-md-inline{display:inline!important}.layui-show-md-inline-block{display:inline-block!important}.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9{float:left}.layui-col-md1{width:8.33333333%}.layui-col-md2{width:16.66666667%}.layui-col-md3{width:25%}.layui-col-md4{width:33.33333333%}.layui-col-md5{width:41.66666667%}.layui-col-md6{width:50%}.layui-col-md7{width:58.33333333%}.layui-col-md8{width:66.66666667%}.layui-col-md9{width:75%}.layui-col-md10{width:83.33333333%}.layui-col-md11{width:91.66666667%}.layui-col-md12{width:100%}.layui-col-md-offset1{margin-left:8.33333333%}.layui-col-md-offset2{margin-left:16.66666667%}.layui-col-md-offset3{margin-left:25%}.layui-col-md-offset4{margin-left:33.33333333%}.layui-col-md-offset5{margin-left:41.66666667%}.layui-col-md-offset6{margin-left:50%}.layui-col-md-offset7{margin-left:58.33333333%}.layui-col-md-offset8{margin-left:66.66666667%}.layui-col-md-offset9{margin-left:75%}.layui-col-md-offset10{margin-left:83.33333333%}.layui-col-md-offset11{margin-left:91.66666667%}.layui-col-md-offset12{margin-left:100%}}@media screen and (min-width:1200px){.layui-container{width:1170px}.layui-hide-lg{display:none!important}.layui-show-lg-block{display:block!important}.layui-show-lg-inline{display:inline!important}.layui-show-lg-inline-block{display:inline-block!important}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9{float:left}.layui-col-lg1{width:8.33333333%}.layui-col-lg2{width:16.66666667%}.layui-col-lg3{width:25%}.layui-col-lg4{width:33.33333333%}.layui-col-lg5{width:41.66666667%}.layui-col-lg6{width:50%}.layui-col-lg7{width:58.33333333%}.layui-col-lg8{width:66.66666667%}.layui-col-lg9{width:75%}.layui-col-lg10{width:83.33333333%}.layui-col-lg11{width:91.66666667%}.layui-col-lg12{width:100%}.layui-col-lg-offset1{margin-left:8.33333333%}.layui-col-lg-offset2{margin-left:16.66666667%}.layui-col-lg-offset3{margin-left:25%}.layui-col-lg-offset4{margin-left:33.33333333%}.layui-col-lg-offset5{margin-left:41.66666667%}.layui-col-lg-offset6{margin-left:50%}.layui-col-lg-offset7{margin-left:58.33333333%}.layui-col-lg-offset8{margin-left:66.66666667%}.layui-col-lg-offset9{margin-left:75%}.layui-col-lg-offset10{margin-left:83.33333333%}.layui-col-lg-offset11{margin-left:91.66666667%}.layui-col-lg-offset12{margin-left:100%}}.layui-col-space1{margin:-.5px}.layui-col-space1>*{padding:.5px}.layui-col-space3{margin:-1.5px}.layui-col-space3>*{padding:1.5px}.layui-col-space5{margin:-2.5px}.layui-col-space5>*{padding:2.5px}.layui-col-space8{margin:-3.5px}.layui-col-space8>*{padding:3.5px}.layui-col-space10{margin:-5px}.layui-col-space10>*{padding:5px}.layui-col-space12{margin:-6px}.layui-col-space12>*{padding:6px}.layui-col-space15{margin:-7.5px}.layui-col-space15>*{padding:7.5px}.layui-col-space18{margin:-9px}.layui-col-space18>*{padding:9px}.layui-col-space20{margin:-10px}.layui-col-space20>*{padding:10px}.layui-col-space22{margin:-11px}.layui-col-space22>*{padding:11px}.layui-col-space25{margin:-12.5px}.layui-col-space25>*{padding:12.5px}.layui-col-space30{margin:-15px}.layui-col-space30>*{padding:15px}.layui-btn,.layui-input,.layui-select,.layui-textarea,.layui-upload-button{outline:0;transition:all .3s;-webkit-transition:all .3s;box-sizing:border-box}.layui-elem-quote{margin-bottom:10px;padding:15px;line-height:22px;border-left:5px solid #009688;border-radius:0 2px 2px 0;background-color:#f2f2f2}.layui-quote-nm{border-color:#e2e2e2;border-style:solid;border-width:1px 1px 1px 5px;background:0 0}.layui-elem-field{margin-bottom:10px;padding:0;border:1px solid #e2e2e2}.layui-elem-field legend{margin-left:20px;padding:0 10px;font-size:20px;font-weight:300}.layui-field-title{margin:10px 0 20px;border:none;border-top:1px solid #e2e2e2}.layui-field-box{padding:10px 15px}.layui-field-title .layui-field-box{padding:10px 0}.layui-progress{position:relative;height:6px;border-radius:20px;background-color:#e2e2e2}.layui-progress-bar{position:absolute;width:0;max-width:100%;height:6px;border-radius:20px;text-align:right;background-color:#5FB878;transition:all .3s;-webkit-transition:all .3s}.layui-progress-big,.layui-progress-big .layui-progress-bar{height:18px;line-height:18px}.layui-progress-text{position:relative;top:-18px;line-height:18px;font-size:12px;color:#666}.layui-progress-big .layui-progress-text{position:static;padding:0 10px;color:#fff}.layui-collapse{border:1px solid #e2e2e2;border-radius:2px}.layui-colla-item{border-top:1px solid #e2e2e2}.layui-colla-item:first-child{border-top:none}.layui-colla-title{position:relative;height:42px;line-height:42px;padding:0 15px 0 35px;color:#333;background-color:#f2f2f2;cursor:pointer}.layui-colla-content{display:none;padding:10px 15px;line-height:22px;border-top:1px solid #e2e2e2;color:#666}.layui-bg-black,.layui-bg-blue,.layui-bg-cyan,.layui-bg-green,.layui-bg-orange,.layui-bg-red{color:#fff!important}.layui-colla-icon{position:absolute;left:15px;top:0;font-size:14px}.layui-bg-red{background-color:#FF5722!important}.layui-bg-orange{background-color:#FFB800!important}.layui-bg-green{background-color:#009688!important}.layui-bg-cyan{background-color:#2F4056!important}.layui-bg-blue{background-color:#1E9FFF!important}.layui-bg-black{background-color:#393D49!important}.layui-bg-gray{background-color:#eee!important;color:#666!important}.layui-text{line-height:22px;font-size:14px;color:#666}.layui-text h1,.layui-text h2,.layui-text h3{font-weight:500;color:#333}.layui-text h1{font-size:30px}.layui-text h2{font-size:24px}.layui-text h3{font-size:18px}.layui-text a{color:#01AAED}.layui-text a:hover{text-decoration:underline}.layui-text ul{padding:5px 0 5px 15px}.layui-text ul li{margin-top:5px;list-style-type:disc}.layui-text em,.layui-word-aux{color:#999!important;padding:0 5px!important}.layui-btn{display:inline-block;height:38px;line-height:38px;padding:0 18px;background-color:#009688;color:#fff;white-space:nowrap;text-align:center;font-size:14px;border:none;border-radius:2px;cursor:pointer;opacity:.9;filter:alpha(opacity=90)}.layui-btn:hover{opacity:.8;filter:alpha(opacity=80);color:#fff}.layui-btn:active{opacity:1;filter:alpha(opacity=100)}.layui-btn+.layui-btn{margin-left:10px}.layui-btn-radius{border-radius:100px}.layui-btn .layui-icon{margin-right:3px;font-size:18px;vertical-align:bottom;vertical-align:middle\9}.layui-btn-primary{border:1px solid #C9C9C9;background-color:#fff;color:#555}.layui-btn-primary:hover{border-color:#009688;color:#333}.layui-btn-normal{background-color:#1E9FFF}.layui-btn-warm{background-color:#FFB800}.layui-btn-danger{background-color:#FF5722}.layui-btn-disabled,.layui-btn-disabled:active,.layui-btn-disabled:hover{border:1px solid #e6e6e6;background-color:#FBFBFB;color:#C9C9C9;cursor:not-allowed;opacity:1}.layui-btn-big{height:44px;line-height:44px;padding:0 25px;font-size:16px}.layui-btn-small{height:30px;line-height:30px;padding:0 10px;font-size:12px}.layui-btn-small i{font-size:16px!important}.layui-btn-mini{height:22px;line-height:22px;padding:0 5px;font-size:12px}.layui-btn-mini i{font-size:14px!important}.layui-btn-group{display:inline-block;vertical-align:middle;font-size:0}.layui-btn-group .layui-btn{margin-left:0!important;margin-right:0!important;border-left:1px solid rgba(255,255,255,.5);border-radius:0}.layui-btn-group .layui-btn-primary{border-left:none}.layui-btn-group .layui-btn-primary:hover{border-color:#C9C9C9;color:#009688}.layui-btn-group .layui-btn:first-child{border-left:none;border-radius:2px 0 0 2px}.layui-btn-group .layui-btn-primary:first-child{border-left:1px solid #c9c9c9}.layui-btn-group .layui-btn:last-child{border-radius:0 2px 2px 0}.layui-btn-group .layui-btn+.layui-btn{margin-left:0}.layui-btn-group+.layui-btn-group{margin-left:10px}.layui-input,.layui-select,.layui-textarea{height:38px;line-height:36px\9;border:1px solid #e6e6e6;background-color:#fff;border-radius:2px}.layui-form-label,.layui-form-mid,.layui-textarea{line-height:20px;position:relative}.layui-input,.layui-textarea{display:block;width:100%;padding-left:10px}.layui-input:hover,.layui-textarea:hover{border-color:#D2D2D2!important}.layui-input:focus,.layui-textarea:focus{border-color:#C9C9C9!important}.layui-textarea{min-height:100px;height:auto;padding:6px 10px;resize:vertical}.layui-select{padding:0 10px}.layui-form input[type=checkbox],.layui-form input[type=radio],.layui-form select{display:none}.layui-form-item{margin-bottom:15px;clear:both;*zoom:1}.layui-form-item:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-form-label{float:left;display:block;padding:9px 15px;width:80px;font-weight:400;text-align:right}.layui-form-item .layui-inline{margin-bottom:5px;margin-right:10px}.layui-input-block,.layui-input-inline{position:relative}.layui-input-block{margin-left:110px;min-height:36px}.layui-input-inline{display:inline-block;vertical-align:middle}.layui-form-item .layui-input-inline{float:left;width:190px;margin-right:10px}.layui-form-text .layui-input-inline{width:auto}.layui-form-mid{float:left;display:block;padding:8px 0!important;margin-right:10px}.layui-form-danger+.layui-form-select .layui-input,.layui-form-danger:focus{border:1px solid #FF5722!important}.layui-form-select{position:relative}.layui-form-select .layui-input{padding-right:30px;cursor:pointer}.layui-form-select .layui-edge{position:absolute;right:10px;top:50%;margin-top:-3px;cursor:pointer;border-width:6px;border-top-color:#c2c2c2;border-top-style:solid;transition:all .3s;-webkit-transition:all .3s}.layui-form-select dl{display:none;position:absolute;left:0;top:42px;padding:5px 0;z-index:999;min-width:100%;border:1px solid #d2d2d2;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12);box-sizing:border-box}.layui-form-select dl dd,.layui-form-select dl dt{padding:0 10px;line-height:36px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-form-select dl dt{font-size:12px;color:#999}.layui-form-select dl dd{cursor:pointer}.layui-form-select dl dd:hover{background-color:#f2f2f2}.layui-form-select .layui-select-group dd{padding-left:20px}.layui-form-select dl dd.layui-select-tips{padding-left:10px!important;color:#999}.layui-form-select dl dd.layui-this{background-color:#5FB878;color:#fff}.layui-form-checkbox,.layui-form-select dl dd.layui-disabled{background-color:#fff}.layui-form-selected dl{display:block}.layui-form-checkbox,.layui-form-checkbox *,.layui-form-radio,.layui-form-radio *,.layui-form-switch{display:inline-block;vertical-align:middle}.layui-form-selected .layui-edge{margin-top:-9px;-webkit-transform:rotate(180deg);transform:rotate(180deg);margin-top:-3px\9}:root .layui-form-selected .layui-edge{margin-top:-9px\0/IE9}.layui-form-selectup dl{top:auto;bottom:42px}.layui-select-none{margin:5px 0;text-align:center;color:#999}.layui-select-disabled .layui-disabled{border-color:#eee!important}.layui-select-disabled .layui-edge{border-top-color:#d2d2d2}.layui-form-checkbox{position:relative;height:30px;line-height:28px;margin-right:10px;padding-right:30px;border:1px solid #d2d2d2;cursor:pointer;font-size:0;border-radius:2px;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox:hover{border:1px solid #c2c2c2}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;background-color:#d2d2d2;color:#fff;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.layui-form-checkbox:hover span{background-color:#c2c2c2}.layui-form-checkbox i{position:absolute;right:0;width:30px;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{color:#c2c2c2}.layui-form-checked,.layui-form-checked:hover{border-color:#5FB878}.layui-form-checked span,.layui-form-checked:hover span{background-color:#5FB878}.layui-form-checked i,.layui-form-checked:hover i{color:#5FB878}.layui-form-item .layui-form-checkbox{margin-top:4px}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;border:none!important;margin-right:0;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{float:right;padding-right:15px;line-height:18px;background:0 0;color:#666}.layui-form-checkbox[lay-skin=primary] i{position:relative;top:0;width:16px;height:16px;line-height:16px;border:1px solid #d2d2d2;font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:#5FB878;color:#fff}.layui-form-checked[lay-skin=primary] i{border-color:#5FB878;background-color:#5FB878;color:#fff}.layui-checkbox-disbaled[lay-skin=primary] span{background:0 0!important}.layui-checkbox-disbaled[lay-skin=primary]:hover i{border-color:#d2d2d2}.layui-form-item .layui-form-checkbox[lay-skin=primary]{margin-top:10px}.layui-form-switch{position:relative;height:22px;line-height:22px;width:42px;padding:0 5px;margin-top:8px;border:1px solid #d2d2d2;border-radius:20px;cursor:pointer;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch i{position:absolute;left:5px;top:3px;width:16px;height:16px;border-radius:20px;background-color:#d2d2d2;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch em{position:absolute;right:5px;top:0;width:25px;padding:0!important;text-align:center!important;color:#999!important;font-style:normal!important;font-size:12px}.layui-form-onswitch{border-color:#5FB878;background-color:#5FB878}.layui-form-onswitch i{left:32px;background-color:#fff}.layui-form-onswitch em{left:5px;right:auto;color:#fff!important}.layui-checkbox-disbaled{border-color:#e2e2e2!important}.layui-checkbox-disbaled span{background-color:#e2e2e2!important}.layui-checkbox-disbaled:hover i{color:#fff!important}.layui-form-radio{line-height:28px;margin:6px 10px 0 0;padding-right:10px;cursor:pointer;font-size:0}.layui-form-radio i{margin-right:8px;font-size:22px;color:#c2c2c2}.layui-form-radio span{font-size:14px}.layui-form-radio i:hover,.layui-form-radioed i{color:#5FB878}.layui-radio-disbaled i{color:#e2e2e2!important}.layui-form-pane .layui-form-label{width:110px;padding:8px 15px;height:38px;line-height:20px;border:1px solid #e6e6e6;border-radius:2px 0 0 2px;text-align:center;background-color:#FBFBFB;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box}.layui-form-pane .layui-input-inline{margin-left:-1px}.layui-form-pane .layui-input-block{margin-left:110px;left:-1px}.layui-form-pane .layui-input{border-radius:0 2px 2px 0}.layui-form-pane .layui-form-text .layui-form-label{float:none;width:100%;border-right:1px solid #e6e6e6;border-radius:2px;box-sizing:border-box;text-align:left}.layui-form-pane .layui-form-text .layui-input-inline{display:block;margin:0;top:-1px;clear:both}.layui-form-pane .layui-form-text .layui-input-block{margin:0;left:0;top:-1px}.layui-form-pane .layui-form-text .layui-textarea{min-height:100px;border-radius:0 0 2px 2px}.layui-form-pane .layui-form-checkbox{margin:4px 0 4px 10px}.layui-form-pane .layui-form-radio,.layui-form-pane .layui-form-switch{margin-top:6px;margin-left:10px}.layui-form-pane .layui-form-item[pane]{position:relative;border:1px solid #e6e6e6}.layui-form-pane .layui-form-item[pane] .layui-form-label{position:absolute;left:0;top:0;height:100%;border-width:0 1px 0 0}.layui-form-pane .layui-form-item[pane] .layui-input-inline{margin-left:110px}@media screen and (max-width:450px){.layui-form-item .layui-form-label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-form-item .layui-inline{display:block;margin-right:0;margin-bottom:20px;clear:both}.layui-form-item .layui-inline:after{content:'\20';clear:both;display:block;height:0}.layui-form-item .layui-input-inline{display:block;float:none;left:-3px;width:auto;margin:0 0 10px 112px}.layui-form-item .layui-input-inline+.layui-form-mid{margin-left:110px;top:-5px;padding:0}.layui-form-item .layui-form-checkbox{margin-right:5px;margin-bottom:5px}}.layui-layedit{border:1px solid #d2d2d2;border-radius:2px}.layui-layedit-tool{padding:3px 5px;border-bottom:1px solid #e2e2e2;font-size:0}.layedit-tool-fixed{position:fixed;top:0;border-top:1px solid #e2e2e2}.layui-layedit-tool .layedit-tool-mid,.layui-layedit-tool .layui-icon{display:inline-block;vertical-align:middle;text-align:center;font-size:14px}.layui-layedit-tool .layui-icon{position:relative;width:32px;height:30px;line-height:30px;margin:3px 5px;color:#777;cursor:pointer;border-radius:2px}.layui-layedit-tool .layui-icon:hover{color:#393D49}.layui-layedit-tool .layui-icon:active{color:#000}.layui-layedit-tool .layedit-tool-active{background-color:#e2e2e2;color:#000}.layui-layedit-tool .layui-disabled,.layui-layedit-tool .layui-disabled:hover{color:#d2d2d2;cursor:not-allowed}.layui-layedit-tool .layedit-tool-mid{width:1px;height:18px;margin:0 10px;background-color:#d2d2d2}.layedit-tool-html{width:50px!important;font-size:30px!important}.layedit-tool-b,.layedit-tool-code,.layedit-tool-help{font-size:16px!important}.layedit-tool-d,.layedit-tool-face,.layedit-tool-image,.layedit-tool-unlink{font-size:18px!important}.layedit-tool-image input{position:absolute;font-size:0;left:0;top:0;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-layedit-iframe iframe{display:block;width:100%}#LAY_layedit_code{overflow:hidden}.layui-laypage{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;margin:10px 0;font-size:0}.layui-laypage>a:first-child,.layui-laypage>a:first-child em{border-radius:2px 0 0 2px}.layui-laypage>a:last-child,.layui-laypage>a:last-child em{border-radius:0 2px 2px 0}.layui-laypage>:first-child{margin-left:0!important}.layui-laypage>:last-child{margin-right:0!important}.layui-laypage a,.layui-laypage button,.layui-laypage input,.layui-laypage select,.layui-laypage span{border:1px solid #e2e2e2}.layui-laypage a,.layui-laypage span{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding:0 15px;height:28px;line-height:28px;margin:0 -1px 5px 0;background-color:#fff;color:#333;font-size:12px}.layui-laypage a:hover{color:#009688}.layui-laypage em{font-style:normal}.layui-laypage .layui-laypage-spr{color:#999;font-weight:700}.layui-laypage a{text-decoration:none}.layui-laypage .layui-laypage-curr{position:relative}.layui-laypage .layui-laypage-curr em{position:relative;color:#fff}.layui-laypage .layui-laypage-curr .layui-laypage-em{position:absolute;left:-1px;top:-1px;padding:1px;width:100%;height:100%;background-color:#009688}.layui-laypage-em{border-radius:2px}.layui-laypage-next em,.layui-laypage-prev em{font-family:Sim sun;font-size:16px}.layui-laypage .layui-laypage-count,.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-skip{margin-left:10px;margin-right:10px;padding:0;border:none}.layui-laypage .layui-laypage-limits{vertical-align:top}.layui-laypage select{height:22px;padding:3px;border-radius:2px;cursor:pointer}.layui-laypage .layui-laypage-skip{height:30px;line-height:30px;color:#999}.layui-laypage button,.layui-laypage input{height:30px;line-height:30px;border:1px solid #e2e2e2;border-radius:2px;vertical-align:top;background-color:#fff;box-sizing:border-box}.layui-laypage input{display:inline-block;width:40px;margin:0 10px;padding:0 3px;text-align:center}.layui-laypage input:focus,.layui-laypage select:focus{border-color:#009688!important}.layui-laypage button{margin-left:10px;padding:0 10px;cursor:pointer}.layui-flow-more{margin:10px 0;text-align:center;color:#999;font-size:14px}.layui-flow-more a{height:32px;line-height:32px}.layui-flow-more a *{display:inline-block;vertical-align:top}.layui-flow-more a cite{padding:0 20px;border-radius:3px;background-color:#eee;color:#333;font-style:normal}.layui-flow-more a cite:hover{opacity:.8}.layui-flow-more a i{font-size:30px;color:#737383}.layui-table{width:100%;margin:10px 0;background-color:#fff}.layui-table tr{transition:all .3s;-webkit-transition:all .3s}.layui-table thead tr,.layui-table-fixed-l tr,.layui-table-header,.layui-table-mend,.layui-table-patch,.layui-table-tool{background-color:#f2f2f2}.layui-table th{text-align:left;font-weight:400}.layui-table td,.layui-table th,.layui-table-header,.layui-table-tool,.layui-table-view,.layui-table[lay-skin=row],.layui-table[lay-skin=line]{border:1px solid #e2e2e2}.layui-table td,.layui-table th{position:relative;padding:9px 15px;min-height:20px;line-height:20px;font-size:14px}.layui-table[lay-even] tr:nth-child(even){background-color:#f8f8f8}.layui-table tbody tr:hover,.layui-table-hover{background-color:#f2f2f2!important}.layui-table-click{background-color:#FFEEE8!important}.layui-table[lay-skin=line] td,.layui-table[lay-skin=line] th{border-width:0 0 1px}.layui-table[lay-skin=row] td,.layui-table[lay-skin=row] th{border-width:0 1px 0 0}.layui-table[lay-skin=nob] td,.layui-table[lay-skin=nob] th{border:none}.layui-table img{max-width:100px}.layui-table[lay-size=lg] td,.layui-table[lay-size=lg] th{padding:15px 30px}.layui-table-view .layui-table[lay-size=lg] .layui-table-cell{height:40px;line-height:40px}.layui-table[lay-size=sm] td,.layui-table[lay-size=sm] th{font-size:12px;padding:5px 10px}.layui-table-view .layui-table[lay-size=sm] .layui-table-cell{height:20px;line-height:20px}.layui-table[lay-data]{display:none}.layui-table-view{position:relative;margin:10px 0;overflow:hidden}.layui-table-view .layui-table{position:relative;width:auto;margin:0}.layui-table-body,.layui-table-header .layui-table,.layui-table-tool{margin-bottom:-1px}.layui-table-view .layui-table[lay-skin=line]{border-width:0 1px 0 0}.layui-table-view .layui-table[lay-skin=row]{border-width:0 0 1px}.layui-table-view .layui-table td,.layui-table-view .layui-table th{padding:5px 0;border-top:none;border-left:none}.layui-table-view .layui-table td{cursor:default}.layui-table-view .layui-form-checkbox[lay-skin=primary] i{width:18px;height:18px}.layui-table-header{border-width:0 0 1px;overflow:hidden}.layui-table-sort{width:20px;height:20px;margin-left:5px;cursor:pointer!important}.layui-table-sort .layui-edge{left:5px;border-width:5px}.layui-table-sort .layui-table-sort-asc{top:4px;border-top:none;border-bottom-style:solid;border-bottom-color:#b2b2b2}.layui-table-sort .layui-table-sort-asc:hover{border-bottom-color:#666}.layui-table-sort .layui-table-sort-desc{bottom:4px;border-bottom:none;border-top-style:solid;border-top-color:#b2b2b2}.layui-table-sort .layui-table-sort-desc:hover{border-top-color:#666}.layui-table-sort[lay-sort=asc] .layui-table-sort-asc{border-bottom-color:#000}.layui-table-sort[lay-sort=desc] .layui-table-sort-desc{border-top-color:#000}.layui-table-cell{height:28px;line-height:28px;padding:0 15px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box}.layui-table-cell .layui-form-checkbox{top:-1px}.layui-table-cell .layui-table-link{color:#01AAED}.laytable-cell-space{width:15px;padding:0;text-align:center}.layui-table-body{position:relative;overflow:auto;margin-right:-1px}.layui-table-body .layui-none{line-height:40px;text-align:center;color:#999}.layui-table-fixed{position:absolute;left:0;top:0}.layui-table-fixed .layui-table-body{overflow:hidden}.layui-table-fixed-r{left:auto;right:-1px;border-left:1px solid #e2e2e2;box-shadow:-1px 0 8px rgba(0,0,0,.1)}.layui-table-fixed-r .layui-table-header{position:relative;overflow:visible}.layui-table-mend{position:absolute;right:-49px;top:0;height:100%;width:50px}.layui-table-tool{position:relative;width:100%;padding:7px 10px 0 0;border-width:1px 0 0;height:41px;font-size:12px;white-space:nowrap}.layui-table-tool:hover{overflow-x:auto}.layui-table-page{height:26px}.layui-table-tool .layui-laypage{margin:0}.layui-table-tool .layui-laypage a,.layui-table-tool .layui-laypage span{height:26px;line-height:26px;border:none;background:0 0;padding:0 12px}.layui-table-tool .layui-laypage .layui-laypage-count,.layui-table-tool .layui-laypage .layui-laypage-limits,.layui-table-tool .layui-laypage .layui-laypage-skip{margin-left:0;padding:0}.layui-table-tool .layui-laypage .layui-laypage-total{padding:0 10px}.layui-table-tool .layui-laypage .layui-laypage-spr{padding:0}.layui-table-tool .layui-laypage button,.layui-table-tool .layui-laypage input{height:26px;line-height:26px}.layui-table-tool .layui-laypage input{width:40px}.layui-table-tool .layui-laypage button{padding:0 10px}.layui-table-view select[lay-ignore]{display:inline-block}.layui-table-tool select{height:18px}.layui-table-patch .layui-table-cell{padding:0;width:30px}.layui-table-edit{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 15px 1px;border:none}.layui-table-edit:focus{background-color:#F0F9F2}body .layui-table-tips .layui-layer-content{background:0 0;padding:0;box-shadow:0 1px 6px rgba(0,0,0,.1)}.layui-table-tips-main{margin:-44px 0 0 -1px;max-height:150px;padding:8px 15px;font-size:14px;overflow-y:scroll;background-color:#fff;color:#333;border:1px solid #e2e2e2}.layui-code,.layui-upload-list{margin:10px 0}.layui-table-tips-c{position:absolute;right:-3px;top:-12px;width:18px;height:18px;padding:3px;text-align:center;font-weight:700;border-radius:100%;font-size:14px;cursor:pointer;background-color:#666}.layui-table-tips-c:hover{background-color:#999}.layui-upload-file{display:none!important;opacity:.01;filter:Alpha(opacity=1)}.layui-upload-drag,.layui-upload-form,.layui-upload-wrap{display:inline-block}.layui-upload-choose{padding:0 10px;color:#999}.layui-upload-drag{position:relative;padding:30px;border:1px dashed #e2e2e2;background-color:#fff;text-align:center;cursor:pointer;color:#999}.layui-upload-drag .layui-icon{font-size:50px;color:#009688}.layui-upload-drag[lay-over]{border-color:#009688}.layui-upload-iframe{position:absolute;width:0;height:0;border:0;visibility:hidden}.layui-upload-wrap{position:relative;vertical-align:middle}.layui-upload-wrap .layui-upload-file{display:block!important;position:absolute;left:0;top:0;z-index:10;font-size:100px;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-code{position:relative;padding:15px;line-height:20px;border:1px solid #ddd;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New;font-size:12px}.layui-tree{line-height:26px}.layui-tree li{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-tree li .layui-tree-spread,.layui-tree li a{display:inline-block;vertical-align:top;height:26px;*display:inline;*zoom:1;cursor:pointer}.layui-tree li a{font-size:0}.layui-tree li a i{font-size:16px}.layui-tree li a cite{padding:0 6px;font-size:14px;font-style:normal}.layui-tree li i{padding-left:6px;color:#333;-moz-user-select:none}.layui-tree li .layui-tree-check{font-size:13px}.layui-tree li .layui-tree-check:hover{color:#009E94}.layui-tree li ul{display:none;margin-left:20px}.layui-tree li .layui-tree-enter{line-height:24px;border:1px dotted #000}.layui-tree-drag{display:none;position:absolute;left:-666px;top:-666px;background-color:#f2f2f2;padding:5px 10px;border:1px dotted #000;white-space:nowrap}.layui-tree-drag i{padding-right:5px}.layui-nav{position:relative;padding:0 20px;background-color:#393D49;color:#fff;border-radius:2px;font-size:0;box-sizing:border-box}.layui-nav *{font-size:14px}.layui-nav .layui-nav-item{position:relative;display:inline-block;*display:inline;*zoom:1;vertical-align:middle;line-height:60px}.layui-nav .layui-nav-item a{display:block;padding:0 20px;color:#fff;color:rgba(255,255,255,.7);transition:all .3s;-webkit-transition:all .3s}.layui-nav .layui-this:after,.layui-nav-bar,.layui-nav-tree .layui-nav-itemed:after{position:absolute;left:0;top:0;width:0;height:5px;background-color:#5FB878;transition:all .2s;-webkit-transition:all .2s}.layui-nav-bar{z-index:1000}.layui-nav .layui-nav-item a:hover,.layui-nav .layui-this a{color:#fff}.layui-nav .layui-this:after{content:'';top:auto;bottom:0;width:100%}.layui-nav-img{width:30px;height:30px;margin-right:10px;border-radius:50%}.layui-nav .layui-nav-more{content:'';width:0;height:0;border-style:solid dashed dashed;border-color:#fff transparent transparent;overflow:hidden;cursor:pointer;transition:all .2s;-webkit-transition:all .2s;position:absolute;top:28px;right:3px;border-width:6px;border-top-color:rgba(255,255,255,.7)}.layui-nav .layui-nav-mored,.layui-nav-itemed .layui-nav-more{top:22px;border-style:dashed dashed solid;border-color:transparent transparent #fff}.layui-nav-child{display:none;position:absolute;left:0;top:65px;min-width:100%;line-height:36px;padding:5px 0;box-shadow:0 2px 4px rgba(0,0,0,.12);border:1px solid #d2d2d2;background-color:#fff;z-index:100;border-radius:2px;white-space:nowrap}.layui-nav .layui-nav-child a{color:#333}.layui-nav .layui-nav-child a:hover{background-color:#f2f2f2;color:#000}.layui-nav-child dd{position:relative}.layui-nav .layui-nav-child dd.layui-this a,.layui-nav-child dd.layui-this{background-color:#5FB878;color:#fff}.layui-nav-child dd.layui-this:after{display:none}.layui-nav-tree{width:200px;padding:0}.layui-nav-tree .layui-nav-item{display:block;width:100%;line-height:45px}.layui-nav-tree .layui-nav-item a{height:45px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-nav-tree .layui-nav-item a:hover{background-color:#4E5465}.layui-nav-tree .layui-nav-bar{width:5px;height:0;background-color:#009688}.layui-nav-tree .layui-nav-child dd.layui-this,.layui-nav-tree .layui-nav-child dd.layui-this a,.layui-nav-tree .layui-this,.layui-nav-tree .layui-this>a,.layui-nav-tree .layui-this>a:hover{background-color:#009688;color:#fff}.layui-nav-tree .layui-this:after{display:none}.layui-nav-itemed>a,.layui-nav-tree .layui-nav-title a,.layui-nav-tree .layui-nav-title a:hover{color:#fff!important}.layui-nav-tree .layui-nav-child{position:relative;z-index:0;top:0;border:none;box-shadow:none}.layui-nav-tree .layui-nav-child a{height:40px;line-height:40px;color:#fff;color:rgba(255,255,255,.7)}.layui-nav-tree .layui-nav-child,.layui-nav-tree .layui-nav-child a:hover{background:0 0;color:#fff}.layui-nav-tree .layui-nav-more{top:20px;right:10px}.layui-nav-itemed .layui-nav-more{top:14px}.layui-nav-itemed .layui-nav-child{display:block;padding:0;background-color:rgba(0,0,0,.3)!important}.layui-nav-side{position:fixed;top:0;bottom:0;left:0;overflow-x:hidden;z-index:999}.layui-bg-blue .layui-nav-bar,.layui-bg-blue .layui-nav-itemed:after,.layui-bg-blue .layui-this:after{background-color:#93D1FF}.layui-bg-blue .layui-nav-child dd.layui-this{background-color:#1E9FFF}.layui-bg-blue .layui-nav-itemed>a,.layui-nav-tree.layui-bg-blue .layui-nav-title a,.layui-nav-tree.layui-bg-blue .layui-nav-title a:hover{background-color:#007DDB!important}.layui-breadcrumb{visibility:hidden;font-size:0}.layui-breadcrumb a{padding-right:8px;line-height:22px;font-size:14px;color:#333!important}.layui-breadcrumb a:hover{color:#01AAED!important}.layui-breadcrumb a cite,.layui-breadcrumb a span{color:#666;cursor:text;font-style:normal}.layui-breadcrumb a span{padding-left:8px;font-family:Sim sun}.layui-tab{margin:10px 0;text-align:left!important}.layui-tab[overflow]>.layui-tab-title{overflow:hidden}.layui-tab-title{position:relative;left:0;height:40px;white-space:nowrap;font-size:0;border-bottom:1px solid #e2e2e2;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;font-size:14px;transition:all .2s;-webkit-transition:all .2s;position:relative;line-height:40px;min-width:65px;padding:0 15px;text-align:center;cursor:pointer}.layui-tab-title li a{display:block}.layui-tab-title .layui-this{color:#000}.layui-tab-title .layui-this:after{position:absolute;left:0;top:0;content:'';width:100%;height:41px;border:1px solid #e2e2e2;border-bottom-color:#fff;border-radius:2px 2px 0 0;box-sizing:border-box;pointer-events:none}.layui-tab-bar{position:absolute;right:0;top:0;z-index:10;width:30px;height:39px;line-height:39px;border:1px solid #e2e2e2;border-radius:2px;text-align:center;background-color:#fff;cursor:pointer}.layui-tab-bar .layui-icon{position:relative;display:inline-block;top:3px;transition:all .3s;-webkit-transition:all .3s}.layui-tab-item{display:none}.layui-tab-more{padding-right:30px;height:auto!important;white-space:normal!important}.layui-tab-more li.layui-this:after{border-bottom-color:#e2e2e2;border-radius:2px}.layui-tab-more .layui-tab-bar .layui-icon{top:-2px;top:3px\9;-webkit-transform:rotate(180deg);transform:rotate(180deg)}:root .layui-tab-more .layui-tab-bar .layui-icon{top:-2px\0/IE9}.layui-tab-content{padding:10px}.layui-tab-title li .layui-tab-close{position:relative;display:inline-block;width:18px;height:18px;line-height:20px;margin-left:8px;top:1px;text-align:center;font-size:14px;color:#c2c2c2;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li .layui-tab-close:hover{border-radius:2px;background-color:#FF5722;color:#fff}.layui-tab-brief>.layui-tab-title .layui-this{color:#009688}.layui-tab-brief>.layui-tab-more li.layui-this:after,.layui-tab-brief>.layui-tab-title .layui-this:after{border:none;border-radius:0;border-bottom:2px solid #5FB878}.layui-tab-brief[overflow]>.layui-tab-title .layui-this:after{top:-1px}.layui-tab-card{border:1px solid #e2e2e2;border-radius:2px;box-shadow:0 2px 5px 0 rgba(0,0,0,.1)}.layui-tab-card>.layui-tab-title{background-color:#f2f2f2}.layui-tab-card>.layui-tab-title li{margin-right:-1px;margin-left:-1px}.layui-tab-card>.layui-tab-title .layui-this{background-color:#fff}.layui-tab-card>.layui-tab-title .layui-this:after{border-top:none;border-width:1px;border-bottom-color:#fff}.layui-tab-card>.layui-tab-title .layui-tab-bar{height:40px;line-height:40px;border-radius:0;border-top:none;border-right:none}.layui-tab-card>.layui-tab-more .layui-this{background:0 0;color:#5FB878}.layui-tab-card>.layui-tab-more .layui-this:after{border:none}.layui-timeline{padding-left:5px}.layui-timeline-item{position:relative;padding-bottom:20px}.layui-timeline-axis{position:absolute;left:-5px;top:0;z-index:10;width:20px;height:20px;line-height:20px;background-color:#fff;color:#5FB878;border-radius:50%;text-align:center;cursor:pointer}.layui-timeline-axis:hover{color:#FF5722}.layui-timeline-item:before{content:'';position:absolute;left:5px;top:0;z-index:0;width:1px;height:100%;background-color:#e2e2e2}.layui-timeline-item:last-child:before{display:none}.layui-timeline-item:first-child:before{display:block}.layui-timeline-content{padding-left:25px}.layui-badge,.layui-badge-rim{line-height:18px;padding:0 5px}.layui-timeline-title{position:relative;margin-bottom:10px}.layui-badge,.layui-badge-dot,.layui-badge-rim{position:relative;display:inline-block;font-size:12px;background-color:#FF5722;color:#fff}.layui-badge{min-width:8px;height:18px;text-align:center;border-radius:9px}.layui-badge-dot{width:8px;height:8px;border-radius:50%}.layui-badge-rim{height:18px;border:1px solid #e2e2e2;border-radius:3px;background-color:#fff;color:#666}.layui-btn .layui-badge,.layui-btn .layui-badge-dot{margin-left:5px}.layui-nav .layui-badge,.layui-nav .layui-badge-dot{position:absolute;top:50%;margin:-10px 6px 0}.layui-tab-title .layui-badge,.layui-tab-title .layui-badge-dot{left:5px;top:-2px}.layui-carousel{position:relative;left:0;top:0;background-color:#f2f2f2}.layui-carousel>[carousel-item]{position:relative;width:100%;height:100%;overflow:hidden}.layui-carousel>[carousel-item]:before{position:absolute;content:'\e63d';left:50%;top:50%;width:100px;line-height:20px;margin:-10px 0 0 -50px;text-align:center;color:#999;font-family:layui-icon!important;font-size:20px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-carousel>[carousel-item]>*{display:none;position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f2f2f2;transition-duration:.3s;-webkit-transition-duration:.3s}.layui-carousel-updown>*{-webkit-transition:.3s ease-in-out up;transition:.3s ease-in-out up}.layui-carousel-arrow{display:none\9;opacity:0;position:absolute;left:10px;top:50%;margin-top:-18px;width:36px;height:36px;line-height:36px;text-align:center;font-size:20px;border:0;border-radius:50%;background-color:rgba(0,0,0,.2);color:#fff;-webkit-transition-duration:.3s;transition-duration:.3s;cursor:pointer}.layui-carousel-arrow[lay-type=add]{left:auto!important;right:10px}.layui-carousel:hover .layui-carousel-arrow[lay-type=add],.layui-carousel[lay-arrow=always] .layui-carousel-arrow[lay-type=add]{right:20px}.layui-carousel[lay-arrow=always] .layui-carousel-arrow{opacity:1;left:20px}.layui-carousel[lay-arrow=none] .layui-carousel-arrow{display:none}.layui-carousel-arrow:hover,.layui-carousel-ind ul:hover{background-color:rgba(0,0,0,.35)}.layui-carousel:hover .layui-carousel-arrow{display:block\9;opacity:1;left:20px}.layui-carousel-ind{position:relative;top:-35px;width:100%;line-height:0!important;text-align:center;font-size:0}.layui-carousel[lay-indicator=outside]{margin-bottom:30px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind{top:10px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind ul{background-color:rgba(0,0,0,.5)}.layui-carousel[lay-indicator=none] .layui-carousel-ind{display:none}.layui-carousel-ind ul{display:inline-block;padding:5px;background-color:rgba(0,0,0,.2);border-radius:10px;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li{display:inline-block;width:10px;height:10px;margin:0 3px;font-size:14px;background-color:#e2e2e2;background-color:rgba(255,255,255,.5);border-radius:50%;cursor:pointer;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li:hover{background-color:rgba(255,255,255,.7)}.layui-carousel-ind li.layui-this{background-color:#fff}.layui-carousel>[carousel-item]>.layui-carousel-next,.layui-carousel>[carousel-item]>.layui-carousel-prev,.layui-carousel>[carousel-item]>.layui-this{display:block}.layui-carousel>[carousel-item]>.layui-this{left:0}.layui-carousel>[carousel-item]>.layui-carousel-prev{left:-100%}.layui-carousel>[carousel-item]>.layui-carousel-next{left:100%}.layui-carousel>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel>[carousel-item]>.layui-carousel-prev.layui-carousel-right{left:0}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-left{left:-100%}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-right{left:100%}.layui-carousel[lay-anim=updown] .layui-carousel-arrow{left:50%!important;top:20px;margin:0 0 0 -18px}.layui-carousel[lay-anim=updown]>[carousel-item]>*,.layui-carousel[lay-anim=fade]>[carousel-item]>*{left:0!important}.layui-carousel[lay-anim=updown] .layui-carousel-arrow[lay-type=add]{top:auto!important;bottom:20px}.layui-carousel[lay-anim=updown] .layui-carousel-ind{position:absolute;top:50%;right:20px;width:auto;height:auto}.layui-carousel[lay-anim=updown] .layui-carousel-ind ul{padding:3px 5px}.layui-carousel[lay-anim=updown] .layui-carousel-ind li{display:block;margin:6px 0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next{top:100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-left{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-right{top:100%}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev{opacity:0}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{opacity:1}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-right{opacity:0}.layui-fixbar{position:fixed;right:15px;bottom:15px;z-index:9999}.layui-fixbar li{width:50px;height:50px;line-height:50px;margin-bottom:1px;text-align:center;cursor:pointer;font-size:30px;background-color:#9F9F9F;color:#fff;border-radius:2px;opacity:.95}.layui-fixbar li:hover{opacity:.85}.layui-fixbar li:active{opacity:1}.layui-fixbar .layui-fixbar-top{display:none;font-size:40px}body .layui-util-face{border:none;background:0 0}body .layui-util-face .layui-layer-content{padding:0;background-color:#fff;color:#666;box-shadow:none}.layui-util-face .layui-layer-TipsG{display:none}.layui-util-face ul{position:relative;width:372px;padding:10px;border:1px solid #D9D9D9;background-color:#fff;box-shadow:0 0 20px rgba(0,0,0,.2)}.layui-util-face ul li{cursor:pointer;float:left;border:1px solid #e8e8e8;height:22px;width:26px;overflow:hidden;margin:-1px 0 0 -1px;padding:4px 2px;text-align:center}.layui-util-face ul li:hover{position:relative;z-index:2;border:1px solid #eb7350;background:#fff9ec}.layui-anim{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.layui-anim.layui-icon{display:inline-block}.layui-anim-loop{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}@-webkit-keyframes layui-rotate{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(360deg)}}@keyframes layui-rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}.layui-anim-rotate{-webkit-animation-name:layui-rotate;animation-name:layui-rotate;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes layui-up{from{-webkit-transform:translate3d(0,100%,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-up{from{transform:translate3d(0,100%,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-up{-webkit-animation-name:layui-up;animation-name:layui-up}@-webkit-keyframes layui-upbit{from{-webkit-transform:translate3d(0,30px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-upbit{from{transform:translate3d(0,30px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-upbit{-webkit-animation-name:layui-upbit;animation-name:layui-upbit}@-webkit-keyframes layui-scale{0%{opacity:.3;-webkit-transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale{0%{opacity:.3;-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-ms-transform:scale(1);transform:scale(1)}}.layui-anim-scale{-webkit-animation-name:layui-scale;animation-name:layui-scale}@-webkit-keyframes layui-scale-spring{0%{opacity:.5;-webkit-transform:scale(.5)}80%{opacity:.8;-webkit-transform:scale(1.1)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale-spring{0%{opacity:.5;transform:scale(.5)}80%{opacity:.8;transform:scale(1.1)}100%{opacity:1;transform:scale(1)}}.layui-anim-scaleSpring{-webkit-animation-name:layui-scale-spring;animation-name:layui-scale-spring}@-webkit-keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}@keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}.layui-anim-fadein{-webkit-animation-name:layui-fadein;animation-name:layui-fadein}@-webkit-keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}.layui-anim-fadeout{-webkit-animation-name:layui-fadeout;animation-name:layui-fadeout} ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/css/layui.mobile.css ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ blockquote,body,button,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,input,legend,li,ol,p,td,textarea,th,ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}html{font:12px 'Helvetica Neue','PingFang SC',STHeitiSC-Light,Helvetica,Arial,sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a,button,input{-webkit-tap-highlight-color:rgba(255,0,0,0)}a{text-decoration:none;background:0 0}a:active,a:hover{outline:0}table{border-collapse:collapse;border-spacing:0}li{list-style:none}b,strong{font-weight:700}h1,h2,h3,h4,h5,h6{font-weight:500}address,cite,dfn,em,var{font-style:normal}dfn{font-style:italic}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}img{border:0;vertical-align:bottom}.layui-inline,input,label{vertical-align:middle}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;outline:0}button,select{text-transform:none}select{-webkit-appearance:none;border:none}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}@font-face{font-family:layui-icon;src:url(../font/iconfont.eot?v=1.0.7);src:url(../font/iconfont.eot?v=1.0.7#iefix) format('embedded-opentype'),url(../font/iconfont.woff?v=1.0.7) format('woff'),url(../font/iconfont.ttf?v=1.0.7) format('truetype'),url(../font/iconfont.svg?v=1.0.7#iconfont) format('svg')}.layui-icon{font-family:layui-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-box,.layui-box *{-webkit-box-sizing:content-box!important;-moz-box-sizing:content-box!important;box-sizing:content-box!important}.layui-border-box,.layui-border-box *{-webkit-box-sizing:border-box!important;-moz-box-sizing:border-box!important;box-sizing:border-box!important}.layui-inline{position:relative;display:inline-block;*display:inline;*zoom:1}.layui-edge,.layui-upload-iframe{position:absolute;width:0;height:0}.layui-edge{border-style:dashed;border-color:transparent;overflow:hidden}.layui-elip{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-unselect{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-disabled,.layui-disabled:active{background-color:#d2d2d2!important;color:#fff!important;cursor:not-allowed!important}.layui-circle{border-radius:100%}.layui-show{display:block!important}.layui-hide{display:none!important}.layui-upload-iframe{border:0;visibility:hidden}.layui-upload-enter{border:1px solid #009E94;background-color:#009E94;color:#fff;-webkit-transform:scale(1.1);transform:scale(1.1)}@-webkit-keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}.layui-m-anim-scale{animation-name:layui-m-anim-scale;-webkit-animation-name:layui-m-anim-scale}@-webkit-keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.layui-m-anim-up{-webkit-animation-name:layui-m-anim-up;animation-name:layui-m-anim-up}@-webkit-keyframes layui-m-anim-left{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes layui-m-anim-left{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}.layui-m-anim-left{-webkit-animation-name:layui-m-anim-left;animation-name:layui-m-anim-left}@-webkit-keyframes layui-m-anim-right{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes layui-m-anim-right{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}100%{-webkit-transform:translateX(0);transform:translateX(0)}}.layui-m-anim-right{-webkit-animation-name:layui-m-anim-right;animation-name:layui-m-anim-right}@-webkit-keyframes layui-m-anim-lout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}@keyframes layui-m-anim-lout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}.layui-m-anim-lout{-webkit-animation-name:layui-m-anim-lout;animation-name:layui-m-anim-lout}@-webkit-keyframes layui-m-anim-rout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(100%);transform:translateX(100%)}}@keyframes layui-m-anim-rout{0%{-webkit-transform:translateX(0);transform:translateX(0)}100%{-webkit-transform:translateX(100%);transform:translateX(100%)}}.layui-m-anim-rout{-webkit-animation-name:layui-m-anim-rout;animation-name:layui-m-anim-rout}.layui-m-layer{position:relative;z-index:19891014}.layui-m-layer *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.layui-m-layermain,.layui-m-layershade{position:fixed;left:0;top:0;width:100%;height:100%}.layui-m-layershade{background-color:rgba(0,0,0,.7);pointer-events:auto}.layui-m-layermain{display:table;font-family:Helvetica,arial,sans-serif;pointer-events:none}.layui-m-layermain .layui-m-layersection{display:table-cell;vertical-align:middle;text-align:center}.layui-m-layerchild{position:relative;display:inline-block;text-align:left;background-color:#fff;font-size:14px;border-radius:5px;box-shadow:0 0 8px rgba(0,0,0,.1);pointer-events:auto;-webkit-overflow-scrolling:touch;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}.layui-m-layer0 .layui-m-layerchild{width:90%;max-width:640px}.layui-m-layer1 .layui-m-layerchild{border:none;border-radius:0}.layui-m-layer2 .layui-m-layerchild{width:auto;max-width:260px;min-width:40px;border:none;background:0 0;box-shadow:none;color:#fff}.layui-m-layerchild h3{padding:0 10px;height:60px;line-height:60px;font-size:16px;font-weight:400;border-radius:5px 5px 0 0;text-align:center}.layui-m-layerbtn span,.layui-m-layerchild h3{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-m-layercont{padding:50px 30px;line-height:22px;text-align:center}.layui-m-layer1 .layui-m-layercont{padding:0;text-align:left}.layui-m-layer2 .layui-m-layercont{text-align:center;padding:0;line-height:0}.layui-m-layer2 .layui-m-layercont i{width:25px;height:25px;margin-left:8px;display:inline-block;background-color:#fff;border-radius:100%;-webkit-animation:layui-m-anim-loading 1.4s infinite ease-in-out;animation:layui-m-anim-loading 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.layui-m-layerbtn,.layui-m-layerbtn span{position:relative;text-align:center;border-radius:0 0 5px 5px}.layui-m-layer2 .layui-m-layercont p{margin-top:20px}@-webkit-keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}@keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}.layui-m-layer2 .layui-m-layercont i:first-child{margin-left:0;-webkit-animation-delay:-.32s;animation-delay:-.32s}.layui-m-layer2 .layui-m-layercont i.layui-m-layerload{-webkit-animation-delay:-.16s;animation-delay:-.16s}.layui-m-layer2 .layui-m-layercont>div{line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px}.layui-m-layerbtn{display:box;display:-moz-box;display:-webkit-box;width:100%;height:50px;line-height:50px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2}.layui-m-layerbtn span{display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:14px;cursor:pointer}.layui-m-layerbtn span[yes]{color:#40AFFE}.layui-m-layerbtn span[no]{border-right:1px solid #D0D0D0;border-radius:0 0 0 5px}.layui-m-layerbtn span:active{background-color:#F6F6F6}.layui-m-layerend{position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px}.layui-m-layerend::after,.layui-m-layerend::before{position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px} ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/css/modules/code.css ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/css/modules/laydate/default/laydate.css ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ .laydate-set-ym,.layui-laydate,.layui-laydate *,.layui-laydate-list{box-sizing:border-box}html #layuicss-laydate{display:none;position:absolute;width:1989px}.layui-laydate *{margin:0;padding:0}.layui-laydate{position:absolute;z-index:66666666;margin:5px 0;border-radius:2px;font-size:14px;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:laydate-upbit;animation-name:laydate-upbit}.layui-laydate-main{width:272px}.layui-laydate-content td,.layui-laydate-header *,.layui-laydate-list li{transition-duration:.3s;-webkit-transition-duration:.3s}@-webkit-keyframes laydate-upbit{from{-webkit-transform:translate3d(0,20px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes laydate-upbit{from{transform:translate3d(0,20px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-laydate-static{position:relative;z-index:0;display:inline-block;margin:0;-webkit-animation:none;animation:none}.laydate-ym-show .laydate-next-m,.laydate-ym-show .laydate-prev-m{display:none!important}.laydate-ym-show .laydate-next-y,.laydate-ym-show .laydate-prev-y{display:inline-block!important}.laydate-time-show .laydate-set-ym span[lay-type=month],.laydate-time-show .laydate-set-ym span[lay-type=year],.laydate-time-show .layui-laydate-header .layui-icon,.laydate-ym-show .laydate-set-ym span[lay-type=month]{display:none!important}.layui-laydate-header{position:relative;line-height:30px;padding:10px 70px 5px}.laydate-set-ym span,.layui-laydate-header i{padding:0 5px;cursor:pointer}.layui-laydate-header *{display:inline-block;vertical-align:bottom}.layui-laydate-header i{position:absolute;top:10px;color:#999;font-size:18px}.layui-laydate-header i.laydate-prev-y{left:15px}.layui-laydate-header i.laydate-prev-m{left:45px}.layui-laydate-header i.laydate-next-y{right:15px}.layui-laydate-header i.laydate-next-m{right:45px}.laydate-set-ym{width:100%;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.laydate-time-text{cursor:default!important}.layui-laydate-content{position:relative;padding:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content table{border-collapse:collapse;border-spacing:0}.layui-laydate-content td,.layui-laydate-content th{width:36px;height:30px;padding:5px;text-align:center}.layui-laydate-content td{position:relative;cursor:pointer}.laydate-day-mark{position:absolute;left:0;top:0;width:100%;height:100%;line-height:30px;font-size:12px;overflow:hidden}.laydate-day-mark::after{position:absolute;content:'';right:2px;top:2px;width:5px;height:5px;border-radius:50%}.layui-laydate-footer{position:relative;height:46px;line-height:26px;padding:10px 20px}.layui-laydate-footer span{margin-right:15px;display:inline-block;cursor:pointer;font-size:12px}.layui-laydate-footer span:hover{color:#5FB878}.laydate-footer-btns{position:absolute;right:10px;top:10px}.laydate-footer-btns span{height:26px;line-height:26px;margin:0 0 0 -1px;padding:0 10px;border:1px solid #C9C9C9;background-color:#fff;white-space:nowrap;vertical-align:top;border-radius:2px}.layui-laydate-list>li,.layui-laydate-range .layui-laydate-main{display:inline-block;vertical-align:middle}.layui-laydate-list{position:absolute;left:0;top:0;width:100%;height:100%;padding:10px;background-color:#fff}.layui-laydate-list>li{position:relative;width:33.3%;height:36px;line-height:36px;margin:3px 0;text-align:center;cursor:pointer}.laydate-month-list>li{width:25%;margin:17px 0}.laydate-time-list>li{height:100%;margin:0;line-height:normal;cursor:default}.laydate-time-list p{position:relative;top:-4px;line-height:29px}.laydate-time-list ol{height:181px;overflow:hidden}.laydate-time-list>li:hover ol{overflow-y:auto}.laydate-time-list ol li{width:130%;padding-left:33px;line-height:30px;text-align:left;cursor:pointer}.layui-laydate-hint{position:absolute;top:115px;left:50%;width:250px;margin-left:-125px;line-height:20px;padding:15px;text-align:center;font-size:12px}.layui-laydate-range{width:546px}.layui-laydate-range .laydate-main-list-0 .laydate-next-m,.layui-laydate-range .laydate-main-list-0 .laydate-next-y,.layui-laydate-range .laydate-main-list-1 .laydate-prev-m,.layui-laydate-range .laydate-main-list-1 .laydate-prev-y{display:none}.layui-laydate-range .laydate-main-list-1 .layui-laydate-content{border-left:1px solid #e2e2e2}.layui-laydate,.layui-laydate-hint{border:1px solid #d2d2d2;box-shadow:0 2px 4px rgba(0,0,0,.12);background-color:#fff;color:#666}.layui-laydate-header{border-bottom:1px solid #e2e2e2}.layui-laydate-header i:hover,.layui-laydate-header span:hover{color:#5FB878}.layui-laydate-content{border-top:none 0;border-bottom:none 0}.layui-laydate-content th{font-weight:400;color:#333}.layui-laydate-content td{color:#666}.layui-laydate-content td.laydate-selected{background-color:#00F7DE}.laydate-selected:hover{background-color:#00F7DE!important}.layui-laydate-content td:hover,.layui-laydate-list li:hover{background-color:#eaeaea;color:#333}.laydate-time-list li ol{margin:0;padding:0;border:1px solid #e2e2e2;border-left-width:0}.laydate-time-list li:first-child ol{border-left-width:1px}.laydate-time-list>li:hover{background:0 0}.layui-laydate-content .laydate-day-next,.layui-laydate-content .laydate-day-prev{color:#d2d2d2}.laydate-selected.laydate-day-next,.laydate-selected.laydate-day-prev{color:#fff!important}.layui-laydate-footer{border-top:1px solid #e2e2e2}.layui-laydate-hint{color:#FF5722}.laydate-day-mark::after{background-color:#5FB878}.layui-laydate-content td.layui-this .laydate-day-mark::after{display:none}.layui-laydate-footer span[lay-type=date]{color:#5FB878}.layui-laydate .layui-this{background-color:#009688!important;color:#fff!important}.layui-laydate .laydate-disabled,.layui-laydate .laydate-disabled:hover{background:0 0!important;color:#d2d2d2!important;cursor:not-allowed!important;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.laydate-theme-molv{border:none}.laydate-theme-molv.layui-laydate-range{width:548px}.laydate-theme-molv .layui-laydate-main{width:274px}.laydate-theme-molv .layui-laydate-header{border:none;background-color:#009688}.laydate-theme-molv .layui-laydate-header i,.laydate-theme-molv .layui-laydate-header span{color:#f6f6f6}.laydate-theme-molv .layui-laydate-header i:hover,.laydate-theme-molv .layui-laydate-header span:hover{color:#fff}.laydate-theme-molv .layui-laydate-content{border:1px solid #e2e2e2;border-top:none;border-bottom:none}.laydate-theme-molv .laydate-main-list-1 .layui-laydate-content{border-left:none}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li,.laydate-theme-grid .layui-laydate-content td,.laydate-theme-grid .layui-laydate-content thead,.laydate-theme-molv .layui-laydate-footer{border:1px solid #e2e2e2}.laydate-theme-grid .laydate-selected,.laydate-theme-grid .laydate-selected:hover{background-color:#f2f2f2!important;color:#009688!important}.laydate-theme-grid .laydate-selected.laydate-day-next,.laydate-theme-grid .laydate-selected.laydate-day-prev{color:#d2d2d2!important}.laydate-theme-grid .laydate-month-list,.laydate-theme-grid .laydate-year-list{margin:1px 0 0 1px}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li{margin:0 -1px -1px 0}.laydate-theme-grid .laydate-year-list>li{height:43px;line-height:43px}.laydate-theme-grid .laydate-month-list>li{height:71px;line-height:71px} ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/css/modules/layer/default/layer.css ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ .layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span,.layui-layer-title{text-overflow:ellipsis;white-space:nowrap}html #layuicss-layer{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{-webkit-overflow-scrolling:touch;top:150px;left:0;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;border-radius:2px;box-shadow:1px 1px 50px rgba(0,0,0,.3)}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #B2B2B2;border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-load{background:url(loading-1.gif) center center no-repeat #eee}.layui-layer-ico{background:url(icon.png) no-repeat}.layui-layer-btn a,.layui-layer-dialog .layui-layer-ico,.layui-layer-setwin a{display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-move{display:none;position:fixed;*position:absolute;left:0;top:0;width:100%;height:100%;cursor:move;opacity:0;filter:alpha(opacity=0);background-color:#fff;z-index:2147483647}.layui-layer-resize{position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.layer-anim{-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-00{-webkit-animation-name:layer-bounceIn;animation-name:layer-bounceIn}@-webkit-keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:layer-zoomInDown;animation-name:layer-zoomInDown}@-webkit-keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:layer-fadeInUpBig;animation-name:layer-fadeInUpBig}@-webkit-keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:layer-zoomInLeft;animation-name:layer-zoomInLeft}@-webkit-keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layer-anim-04{-webkit-animation-name:layer-rollIn;animation-name:layer-rollIn}@keyframes layer-fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:layer-fadeIn;animation-name:layer-fadeIn}@-webkit-keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:layer-shake;animation-name:layer-shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-layer-title{padding:0 80px 0 20px;height:42px;line-height:42px;border-bottom:1px solid #eee;font-size:14px;color:#333;overflow:hidden;background-color:#F8F8F8;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:15px;font-size:0;line-height:initial}.layui-layer-setwin a{position:relative;width:16px;height:16px;margin-left:10px;font-size:12px;_overflow:hidden}.layui-layer-setwin .layui-layer-min cite{position:absolute;width:14px;height:2px;left:0;top:50%;margin-top:-1px;background-color:#2E2D3C;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA}.layui-layer-setwin .layui-layer-max{background-position:-32px -40px}.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px}.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px}.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px}.layui-layer-setwin .layui-layer-close1{background-position:1px -40px;cursor:pointer}.layui-layer-setwin .layui-layer-close1:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;width:30px;height:30px;margin-left:0;background-position:-149px -31px;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{background-position:-180px -31px}.layui-layer-btn{text-align:right;padding:0 15px 12px;pointer-events:auto;user-select:none;-webkit-user-select:none}.layui-layer-btn a{height:28px;line-height:28px;margin:5px 5px 0;padding:0 15px;border:1px solid #dedede;background-color:#fff;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.8}.layui-layer-btn .layui-layer-btn0{border-color:#1E9FFF;background-color:#1E9FFF;color:#fff}.layui-layer-btn-l{text-align:left}.layui-layer-btn-c{text-align:center}.layui-layer-dialog{min-width:260px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;overflow:hidden;font-size:14px;overflow-x:hidden;overflow-y:auto}.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute;top:16px;left:15px;_left:-40px;width:30px;height:30px}.layui-layer-ico1{background-position:-30px 0}.layui-layer-ico2{background-position:-60px 0}.layui-layer-ico3{background-position:-90px 0}.layui-layer-ico4{background-position:-120px 0}.layui-layer-ico5{background-position:-150px 0}.layui-layer-ico6{background-position:-180px 0}.layui-layer-rim{border:6px solid #8D8D8D;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #D3D4D3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-content{padding:12px 25px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:20px 20px 20px 55px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:60px;height:24px;background:url(loading-0.gif) no-repeat}.layui-layer-loading .layui-layer-loading1{width:37px;height:37px;background:url(loading-1.gif) no-repeat}.layui-layer-ico16,.layui-layer-loading .layui-layer-loading2{width:32px;height:32px;background:url(loading-2.gif) no-repeat}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:8px 15px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#000}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:5px;border-bottom-style:solid;border-bottom-color:#000}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476A7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:5px 10px 10px;text-align:right;border-top:1px solid #E9E7E7}.layui-layer-lan .layui-layer-btn a{background:#fff;border-color:#E9E7E7;color:#333}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95;border-color:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1}.layui-layer-iconext{background:url(icon-ext.png) no-repeat}.layui-layer-prompt .layui-layer-input{display:block;width:230px;height:36px;margin:0 auto;line-height:30px;padding-left:10px;border:1px solid #e6e6e6;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px;padding:6px 10px}.layui-layer-prompt .layui-layer-content{padding:20px}.layui-layer-prompt .layui-layer-btn{padding-top:0}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;overflow:hidden;cursor:pointer}.layui-layer-tab .layui-layer-title span.layui-this{height:43px;border-left:1px solid #eee;border-right:1px solid #eee;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.layui-this{display:block}.layui-layer-photos{-webkit-animation-duration:.8s;animation-duration:.8s}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}@-webkit-keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-close{-webkit-animation-name:layer-bounceOut;animation-name:layer-bounceOut;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}@media screen and (max-width:1100px){.layui-layer-iframe{overflow-y:auto;-webkit-overflow-scrolling:touch}} ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/carousel.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",o=">*[carousel-item]>*",l="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(o),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.indicator(),e.elemItem.length<=1||(e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
              ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
            "].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a/g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
            1. '+o.replace(/[\r\t\n]+/g,"
            2. ")+"
            "),c.find(">.layui-code-h3")[0]||c.prepend('

            '+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

            ");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/element.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;layui.define("jquery",function(i){"use strict";var a=layui.$,t=(layui.hint(),layui.device()),l="element",e="layui-this",n="layui-show",s=function(){this.config={}};s.prototype.set=function(i){var t=this;return a.extend(!0,t.config,i),t},s.prototype.on=function(i,a){return layui.onevent.call(this,l,i,a)},s.prototype.tabAdd=function(i,t){var l=".layui-tab-title",e=a(".layui-tab[lay-filter="+i+"]"),n=e.children(l),s=n.children(".layui-tab-bar"),o=e.children(".layui-tab-content"),c='
          • '+(t.title||"unnaming")+"
          • ";return s[0]?s.before(c):n.append(c),o.append('
            '+(t.content||"")+"
            "),y.hideTabMore(!0),y.tabAuto(),this},s.prototype.tabDelete=function(i,t){var l=".layui-tab-title",e=a(".layui-tab[lay-filter="+i+"]"),n=e.children(l),s=n.find('>li[lay-id="'+t+'"]');return y.tabDelete(null,s),this},s.prototype.tabChange=function(i,t){var l=".layui-tab-title",e=a(".layui-tab[lay-filter="+i+"]"),n=e.children(l),s=n.find('>li[lay-id="'+t+'"]');return y.tabClick(null,null,s),this},s.prototype.progress=function(i,t){var l="layui-progress",e=a("."+l+"[lay-filter="+i+"]"),n=e.find("."+l+"-bar"),s=n.find("."+l+"-text");return n.css("width",t),s.text(t),this};var o=".layui-nav",c="layui-nav-item",r="layui-nav-bar",u="layui-nav-tree",d="layui-nav-child",h="layui-nav-more",f="layui-anim layui-anim-upbit",y={tabClick:function(i,t,s){var o=s||a(this),t=t||o.parent().children("li").index(o),c=o.parents(".layui-tab").eq(0),r=c.children(".layui-tab-content").children(".layui-tab-item"),u=o.find("a"),d=c.attr("lay-filter");"javascript:;"!==u.attr("href")&&"_blank"===u.attr("target")||(o.addClass(e).siblings().removeClass(e),r.eq(t).addClass(n).siblings().removeClass(n)),layui.event.call(this,l,"tab("+d+")",{elem:c,index:t})},tabDelete:function(i,t){var l=t||a(this).parent(),n=l.index(),s=l.parents(".layui-tab").eq(0),o=s.children(".layui-tab-content").children(".layui-tab-item");l.hasClass(e)&&(l.next()[0]?y.tabClick.call(l.next()[0],null,n+1):l.prev()[0]&&y.tabClick.call(l.prev()[0],null,n-1)),l.remove(),o.eq(n).remove(),setTimeout(function(){y.tabAuto()},50)},tabAuto:function(){var i="layui-tab-more",l="layui-tab-bar",e="layui-tab-close",n=this;a(".layui-tab").each(function(){var s=a(this),o=s.children(".layui-tab-title"),c=(s.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),r=a('');if(n===window&&8!=t.ie&&y.hideTabMore(!0),s.attr("lay-allowClose")&&o.find("li").each(function(){var i=a(this);if(!i.find("."+e)[0]){var t=a('');t.on("click",y.tabDelete),i.append(t)}}),o.prop("scrollWidth")>o.outerWidth()+1){if(o.find("."+l)[0])return;o.append(r),s.attr("overflow",""),r.on("click",function(a){o[this.title?"removeClass":"addClass"](i),this.title=this.title?"":"收缩"})}else o.find("."+l).remove(),s.removeAttr("overflow")})},hideTabMore:function(i){var t=a(".layui-tab-title");i!==!0&&"tabmore"===a(i.target).attr("lay-stope")||(t.removeClass("layui-tab-more"),t.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var i=a(this),t=i.parents(o),n=t.attr("lay-filter"),s=i.find("a");i.find("."+d)[0]||("javascript:;"!==s.attr("href")&&"_blank"===s.attr("target")||(t.find("."+e).removeClass(e),i.addClass(e)),layui.event.call(this,l,"nav("+n+")",i))},clickChild:function(){var i=a(this),t=i.parents(o),n=t.attr("lay-filter");t.find("."+e).removeClass(e),i.addClass(e),layui.event.call(this,l,"nav("+n+")",i)},showChild:function(){var i=a(this),t=i.parents(o),l=i.parent(),e=i.siblings("."+d);t.hasClass(u)&&(e.removeClass(f),l["none"===e.css("display")?"addClass":"removeClass"](c+"ed"))},collapse:function(){var i=a(this),t=i.find(".layui-colla-icon"),e=i.siblings(".layui-colla-content"),s=i.parents(".layui-collapse").eq(0),o=s.attr("lay-filter"),c="none"===e.css("display");if("string"==typeof s.attr("lay-accordion")){var r=s.children(".layui-colla-item").children("."+n);r.siblings(".layui-colla-title").children(".layui-colla-icon").html(""),r.removeClass(n)}e[c?"addClass":"removeClass"](n),t.html(c?"":""),layui.event.call(this,l,"collapse("+o+")",{title:i,content:e,show:c})}};s.prototype.init=function(i){var l={tab:function(){y.tabAuto.call({})},nav:function(){var i=200,l={},e={},s={},p=function(o,c,r){var y=a(this),p=y.find("."+d);c.hasClass(u)?o.css({top:y.position().top,height:y.children("a").height(),opacity:1}):(p.addClass(f),o.css({left:y.position().left+parseFloat(y.css("marginLeft")),top:y.position().top+y.height()-5}),l[r]=setTimeout(function(){o.css({width:y.width(),opacity:1})},t.ie&&t.ie<10?0:i),clearTimeout(s[r]),"block"===p.css("display")&&clearTimeout(e[r]),e[r]=setTimeout(function(){p.addClass(n),y.find("."+h).addClass(h+"d")},300))};a(o).each(function(t){var o=a(this),f=a(''),v=o.find("."+c);o.find("."+r)[0]||(o.append(f),v.on("mouseenter",function(){p.call(this,f,o,t)}).on("mouseleave",function(){o.hasClass(u)||(clearTimeout(e[t]),e[t]=setTimeout(function(){o.find("."+d).removeClass(n),o.find("."+h).removeClass(h+"d")},300))}),o.on("mouseleave",function(){clearTimeout(l[t]),s[t]=setTimeout(function(){o.hasClass(u)?f.css({height:0,top:f.position().top+f.height()/2,opacity:0}):f.css({width:0,left:f.position().left+f.width()/2,opacity:0})},i)})),v.each(function(){var i=a(this),t=i.find("."+d);if(t[0]&&!i.find("."+h)[0]){var l=i.children("a");l.append('')}i.off("click",y.clickThis).on("click",y.clickThis),i.children("a").off("click",y.showChild).on("click",y.showChild),t.children("dd").off("click",y.clickChild).on("click",y.clickChild)})})},breadcrumb:function(){var i=".layui-breadcrumb";a(i).each(function(){var i=a(this),t=i.attr("lay-separator")||">",l=i.find("a");l.find(".layui-box")[0]||(l.each(function(i){i!==l.length-1&&a(this).append(''+t+"")}),i.css("visibility","visible"))})},progress:function(){var i="layui-progress";a("."+i).each(function(){var t=a(this),l=t.find(".layui-progress-bar"),e=l.attr("lay-percent");l.css("width",e),t.attr("lay-showPercent")&&setTimeout(function(){var a=Math.round(l.width()/t.width()*100);a>100&&(a=100),l.html(''+a+"%")},350)})},collapse:function(){var i="layui-collapse";a("."+i).each(function(){var i=a(this).find(".layui-colla-item");i.each(function(){var i=a(this),t=i.find(".layui-colla-title"),l=i.find(".layui-colla-content"),e="none"===l.css("display");t.find(".layui-colla-icon").remove(),t.append(''+(e?"":"")+""),t.off("click",y.collapse).on("click",y.collapse)})})}};return layui.each(l,function(i,a){a()})};var p=new s,v=a(document);p.init();var b=".layui-tab-title li";v.on("click",b,y.tabClick),v.on("click",y.hideTabMore),a(window).on("resize",y.tabAuto),i(l,p)}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/flow.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/form.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;layui.define("layer",function(e){"use strict";var i=layui.$,t=layui.layer,a=layui.hint(),n=layui.device(),l="form",s=".layui-form",r="layui-this",u="layui-hide",c="layui-disabled",o=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:function(e){if(!e||isNaN(e))return"只能填写数字"},date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};o.prototype.set=function(e){var t=this;return i.extend(!0,t.config,e),t},o.prototype.verify=function(e){var t=this;return i.extend(!0,t.config.verify,e),t},o.prototype.on=function(e,i){return layui.onevent.call(this,l,e,i)},o.prototype.render=function(e,t){var n=this,o=i(s+function(){return t?'[lay-filter="'+t+'"]':""}()),d={select:function(){var e,t="请选择",a="layui-form-select",n="layui-select-title",s="layui-select-none",d="",f=o.find("select"),y=function(t,l){i(t.target).parent().hasClass(n)&&!l||(i("."+a).removeClass(a+"ed "+a+"up"),e&&d&&e.val(d)),e=null},h=function(t,o,f){var h=i(this),p=t.find("."+n),m=p.find("input"),k=t.find("dl"),g=k.children("dd");if(!o){var b=function(){var e=t.offset().top+t.outerHeight()+5-v.scrollTop(),i=k.outerHeight();t.addClass(a+"ed"),g.removeClass(u),e+i>v.height()&&e>=i&&t.addClass(a+"up")},x=function(e){t.removeClass(a+"ed "+a+"up"),m.blur(),e||C(m.val(),function(e){e&&(d=k.find("."+r).html(),m&&m.val(d))})};p.on("click",function(e){t.hasClass(a+"ed")?x():(y(e,!0),b()),k.find("."+s).remove()}),p.find(".layui-edge").on("click",function(){m.focus()}),m.on("keyup",function(e){var i=e.keyCode;9===i&&b()}).on("keydown",function(e){var i=e.keyCode;9===i?x():13===i&&e.preventDefault()});var C=function(e,t,a){var n=0;layui.each(g,function(){var t=i(this),l=t.text(),s=l.indexOf(e)===-1;(""===e||"blur"===a?e!==l:s)&&n++,"keyup"===a&&t[s?"addClass":"removeClass"](u)});var l=n===g.length;return t(l),l},w=function(e){var i=this.value,t=e.keyCode;return 9!==t&&13!==t&&37!==t&&38!==t&&39!==t&&40!==t&&(C(i,function(e){e?k.find("."+s)[0]||k.append('

            无匹配项

            '):k.find("."+s).remove()},"keyup"),void(""===i&&k.find("."+s).remove()))};f&&m.on("keyup",w).on("blur",function(i){e=m,d=k.find("."+r).html(),setTimeout(function(){C(m.val(),function(e){e&&!d&&m.val("")},"blur")},200)}),g.on("click",function(){var e=i(this),a=e.attr("lay-value"),n=h.attr("lay-filter");return!e.hasClass(c)&&(e.hasClass("layui-select-tips")?m.val(""):(m.val(e.text()),e.addClass(r)),e.siblings().removeClass(r),h.val(a).removeClass("layui-form-danger"),layui.event.call(this,l,"select("+n+")",{elem:h[0],value:a,othis:t}),x(!0),!1)}),t.find("dl>dt").on("click",function(e){return!1}),i(document).off("click",y).on("click",y)}};f.each(function(e,l){var s=i(this),u=s.next("."+a),o=this.disabled,d=l.value,f=i(l.options[l.selectedIndex]),y=l.options[0];if("string"==typeof s.attr("lay-ignore"))return s.show();var v="string"==typeof s.attr("lay-search"),p=y?y.value?t:y.innerHTML||t:t,m=i(['
            ','
            ','
            ','
            '+function(e){var i=[];return layui.each(e,function(e,a){0!==e||a.value?"optgroup"===a.tagName.toLowerCase()?i.push("
            "+a.label+"
            "):i.push('
            '+a.innerHTML+"
            "):i.push('
            '+(a.innerHTML||t)+"
            ")}),0===i.length&&i.push('
            没有选项
            '),i.join("")}(s.find("*"))+"
            ","
            "].join(""));u[0]&&u.remove(),s.after(m),h.call(this,m,o,v)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},t=o.find("input[type=checkbox]"),a=function(e,t){var a=i(this);e.on("click",function(){var i=a.attr("lay-filter"),n=(a.attr("lay-text")||"").split("|");a[0].disabled||(a[0].checked?(a[0].checked=!1,e.removeClass(t[1]).find("em").text(n[1])):(a[0].checked=!0,e.addClass(t[1]).find("em").text(n[0])),layui.event.call(a[0],l,t[2]+"("+i+")",{elem:a[0],value:a[0].value,othis:e}))})};t.each(function(t,n){var l=i(this),s=l.attr("lay-skin"),r=(l.attr("lay-text")||"").split("|"),u=this.disabled;"switch"===s&&(s="_"+s);var o=e[s]||e.checkbox;if("string"==typeof l.attr("lay-ignore"))return l.show();var d=l.next("."+o[0]),f=i(['
            ',{_switch:""+((n.checked?r[0]:r[1])||"")+""}[s]||(n.title.replace(/\s/g,"")?""+n.title+"":"")+''+(s?"":"")+"","
            "].join(""));d[0]&&d.remove(),l.after(f),a.call(this,f,o)})},radio:function(){var e="layui-form-radio",t=["",""],a=o.find("input[type=radio]"),n=function(a){var n=i(this),r="layui-anim-scaleSpring";a.on("click",function(){var u=n[0].name,c=n.parents(s),o=n.attr("lay-filter"),d=c.find("input[name="+u.replace(/(\.|#|\[|\])/g,"\\$1")+"]");n[0].disabled||(layui.each(d,function(){var a=i(this).next("."+e);this.checked=!1,a.removeClass(e+"ed"),a.find(".layui-icon").removeClass(r).html(t[1])}),n[0].checked=!0,a.addClass(e+"ed"),a.find(".layui-icon").addClass(r).html(t[0]),layui.event.call(n[0],l,"radio("+o+")",{elem:n[0],value:n[0].value,othis:a}))})};a.each(function(a,l){var s=i(this),r=s.next("."+e),u=this.disabled;if("string"==typeof s.attr("lay-ignore"))return s.show();var o=i(['
            ',''+t[l.checked?0:1]+"",""+(l.title||"未命名")+"","
            "].join(""));r[0]&&r.remove(),s.after(o),n.call(this,o)})}};return e?d[e]?d[e]():a.error("不支持的"+e+"表单渲染"):layui.each(d,function(e,i){i()}),n};var d=function(){var e=i(this),a=f.config.verify,r=null,u="layui-form-danger",c={},o=e.parents(s),d=o.find("*[lay-verify]"),y=e.parents("form")[0],v=o.find("input,select,textarea"),h=e.attr("lay-filter");return layui.each(d,function(e,l){var s=i(this),c=s.attr("lay-verify").split("|"),o="",d=s.val();if(s.removeClass(u),layui.each(c,function(e,i){var c="function"==typeof a[i];if(a[i]&&(c?o=a[i](d,l):!a[i][0].test(d)))return t.msg(o||a[i][1],{icon:5,shift:6}),n.android||n.ios||l.focus(),s.addClass(u),r=!0}),r)return r}),!r&&(layui.each(v,function(e,i){i.name&&(/^checkbox|radio$/.test(i.type)&&!i.checked||(c[i.name]=i.value))}),layui.event.call(this,l,"submit("+h+")",{elem:this,form:y,field:c}))},f=new o,y=i(document),v=i(window);f.render(),y.on("reset",s,function(){var e=i(this).attr("lay-filter");setTimeout(function(){f.render(null,e)},50)}),y.on("submit",s,d).on("click","*[lay-submit]",d),e(l,f)}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/jquery.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=!!e&&"length"in e&&e.length,n=pe.type(e);return"function"!==n&&!pe.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ce.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(De)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(_e,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:qe.test(n)?pe.parseJSON(n):n)}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(He(e)){var i,o,a=pe.expando,s=e.nodeType,u=s?pe.cache:e,l=s?e[a]:e[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof t)return l||(l=s?e[a]=ne.pop()||pe.guid++:a),u[l]||(u[l]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?u[l]=pe.extend(u[l],t):u[l].data=pe.extend(u[l].data,t)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function f(e,t,n){if(He(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!l(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?pe.cleanData([e],!0):fe.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function d(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},u=s(),l=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==l&&+u)&&Me.exec(pe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,pe.style(e,t,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function p(e){var t=ze.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function g(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function m(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t,n,r,i){for(var o,a,s,u,l,c,f,d=e.length,y=p(t),v=[],x=0;x"!==f[1]||Ve.test(a)?0:u:u.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(v,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=y.lastChild}else v.push(t.createTextNode(a));for(u&&y.removeChild(u),fe.appendChecked||pe.grep(h(v,"input"),m),x=0;a=v[x++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),u=h(y.appendChild(a),"script"),s&&g(u),n)for(o=0;a=u[o++];)Ie.test(a.type||"")&&n.push(a);return u=null,y}function v(){return!0}function x(){return!1}function b(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=x;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function T(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function C(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function E(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function N(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r1&&"string"==typeof p&&!fe.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),S(o,t,n,r)});if(f&&(l=y(t,e[0].ownerDocument,!1,e,r),i=l.firstChild,1===l.childNodes.length&&(l=i),i||r)){for(s=pe.map(h(l,"script"),C),a=s.length;c")).appendTo(t.documentElement),t=(ut[0].contentWindow||ut[0].contentDocument).document,t.write(),t.close(),n=D(e,t),ut.detach()),lt[e]=n),n}function L(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function H(e){if(e in Et)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=Ct.length;n--;)if(e=Ct[n]+t,e in Et)return e}function q(e,t){for(var n,r,i,o=[],a=0,s=e.length;a=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!ce.call(e,"constructor")&&!ce.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(!fe.ownFirst)for(t in e)return ce.call(e,t);for(t in e);return void 0===t||ce.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ue[le.call(e)]||"object":typeof e},globalEval:function(t){t&&pe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ge,"ms-").replace(me,ye)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;iT.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[P]=!0,e}function i(e){var t=H.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(a[l]=f))}}else x=m(x===a?x.splice(h,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],a=o||T.relative[" "],s=o?1:0,u=p(function(e){return e===t},a,!0),l=p(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s1&&h(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",g=r&&[],y=[],v=A,x=r||o&&T.find.TAG("*",l),b=W+=null==v?1:Math.random()||.1,w=x.length;for(l&&(A=a===H||a||l);h!==w&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===H||(L(c),s=!_);d=e[f++];)if(d(c,a||H,s)){u.push(c);break}l&&(W=b)}i&&((c=!d&&c)&&p--,r&&g.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,y,a,s);if(r){if(p>0)for(;h--;)g[h]||y[h]||(y[h]=G.call(u));y=m(y)}Q.apply(u,y),l&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(W=b,A=v),g};return i?r(a):a}var b,w,T,C,E,N,k,S,A,D,j,L,H,q,_,F,M,O,R,P="sizzle"+1*new Date,B=e.document,W=0,I=0,$=n(),z=n(),X=n(),U=function(e,t){return e===t&&(j=!0),0},V=1<<31,Y={}.hasOwnProperty,J=[],G=J.pop,K=J.push,Q=J.push,Z=J.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,xe=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Te=function(){L()};try{Q.apply(J=Z.call(B.childNodes),B.childNodes),J[B.childNodes.length].nodeType}catch(Ce){Q={apply:J.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},E=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},L=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:B;return r!==H&&9===r.nodeType&&r.documentElement?(H=r,q=H.documentElement,_=!E(H),(n=H.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(H.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(H.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=P,!H.getElementsByName||!H.getElementsByName(P).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&_){var n=t.getElementById(e);return n?[n]:[]}},T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&_)return t.getElementsByClassName(e)},M=[],F=[],(w.qsa=me.test(H.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+P+"-]").length||F.push("~="),e.querySelectorAll(":checked").length||F.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||F.push(".#.+[+~]")}),i(function(e){var t=H.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&F.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),F.push(",.*:")})),(w.matchesSelector=me.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),M.push("!=",oe)}),F=F.length&&new RegExp(F.join("|")),M=M.length&&new RegExp(M.join("|")),t=me.test(q.compareDocumentPosition),R=t||me.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return j=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===H||e.ownerDocument===B&&R(B,e)?-1:t===H||t.ownerDocument===B&&R(B,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return j=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===H?-1:t===H?1:i?-1:o?1:D?ee(D,e)-ee(D,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===B?-1:u[r]===B?1:0},H):H},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==H&&L(e),n=n.replace(ce,"='$1']"),w.matchesSelector&&_&&!X[n+" "]&&(!M||!M.test(n))&&(!F||!F.test(n)))try{var r=O.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,H,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==H&&L(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==H&&L(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!_):void 0;return void 0!==r?r:w.attributes||!_?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!w.detectDuplicates,D=!w.sortStable&&e.slice(0),e.sort(U),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return D=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(d=m,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}), l=c[e]||[],p=l[0]===W&&l[1],x=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[W,p,x];break}}else if(v&&(d=t,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&(f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[P]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[P]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=_?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((u=T.find[s])&&(r=u(a.matches[0].replace(be,we),ve.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!_,n,!t||ve.test(e)&&c(t.parentNode)||t),n},w.sortStable=P.split("").sort(U).join("")===P,w.detectDuplicates=!!j,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var xe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&pe(e).is(n))break;r.push(e)}return r},be=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},we=pe.expr.match.needsContext,Te=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Ce=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?pe.find.matchesSelector(r,e)?[r]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t1?pe.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&we.test(e)?pe(e):e||[],!1).length}});var Ee,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ke=pe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ee,"string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Ne.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Te.test(r[1])&&pe.isPlainObject(t))for(r in t)pe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=re.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return Ee.find(e);this.length=1,this[0]=i}return this.context=re,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(pe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this))};ke.prototype=pe.fn,Ee=pe(re);var Se=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xe(e,"parentNode")},parentsUntil:function(e,t,n){return xe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return xe(e,"nextSibling")},prevAll:function(e){return xe(e,"previousSibling")},nextUntil:function(e,t,n){return xe(e,"nextSibling",n)},prevUntil:function(e,t,n){return xe(e,"previousSibling",n)},siblings:function(e){return be((e.parentNode||{}).firstChild,e)},children:function(e){return be(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},function(e,t){pe.fn[e]=function(n,r){var i=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=pe.filter(r,i)),this.length>1&&(Ae[e]||(i=pe.uniqueSort(i)),Se.test(e)&&(i=i.reverse())),this.pushStack(i)}});var De=/\S+/g;pe.Callbacks=function(e){e="string"==typeof e?o(e):pe.extend({},e);var t,n,r,i,a=[],s=[],u=-1,l=function(){for(i=e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?pe.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=!0,n||c.disable(),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(e){var t=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return pe.Deferred(function(n){pe.each(t,function(t,o){var a=pe.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?pe.extend(e,r):r}},i={};return r.pipe=r.then,pe.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=ie.call(arguments),a=o.length,s=1!==a||e&&pe.isFunction(e.promise)?a:0,u=1===s?e:pe.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?ie.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);i0||(je.resolveWith(re,[pe]),pe.fn.triggerHandler&&(pe(re).triggerHandler("ready"),pe(re).off("ready"))))}}),pe.ready.promise=function(t){if(!je)if(je=pe.Deferred(),"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll)e.setTimeout(pe.ready);else if(re.addEventListener)re.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s);else{re.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&re.documentElement}catch(r){}n&&n.doScroll&&!function i(){if(!pe.isReady){try{n.doScroll("left")}catch(t){return e.setTimeout(i,50)}a(),pe.ready()}}()}return je.promise(t)},pe.ready.promise();var Le;for(Le in pe(fe))break;fe.ownFirst="0"===Le,fe.inlineBlockNeedsLayout=!1,pe(function(){var e,t,n,r;n=re.getElementsByTagName("body")[0],n&&n.style&&(t=re.createElement("div"),r=re.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),"undefined"!=typeof t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",fe.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=re.createElement("div");fe.deleteExpando=!0;try{delete e.test}catch(t){fe.deleteExpando=!1}e=null}();var He=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)},qe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando],!!e&&!l(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=pe.data(o),1===o.nodeType&&!pe._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=pe.camelCase(r.slice(5)),u(o,r,i[r])));pe._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){pe.data(this,e)}):arguments.length>1?this.each(function(){pe.data(this,e,t)}):o?u(o,e,pe.data(o,e)):void 0},removeData:function(e){return this.each(function(){pe.removeData(this,e)})}}),pe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=pe._data(e,t),n&&(!r||pe.isArray(n)?r=pe._data(e,t,pe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),r=n.length,i=n.shift(),o=pe._queueHooks(e,t),a=function(){pe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add(function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
            a",fe.leadingWhitespace=3===e.firstChild.nodeType,fe.tbody=!e.getElementsByTagName("tbody").length,fe.htmlSerialize=!!e.getElementsByTagName("link").length,fe.html5Clone="<:nav>"!==re.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,t.appendChild(n),fe.appendChecked=n.checked,e.innerHTML="",fe.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,t.appendChild(e),n=re.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),fe.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.noCloneEvent=!!e.addEventListener,e[pe.expando]=1,fe.attributes=!e.getAttribute(pe.expando)}();var Xe={option:[1,""],legend:[1,"
            ","
            "],area:[1,"",""],param:[1,"",""],thead:[1,"","
            "],tr:[2,"","
            "],col:[2,"","
            "],td:[3,"","
            "],_default:fe.htmlSerialize?[0,"",""]:[1,"X
            ","
            "]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Ue=/<|&#?\w+;/,Ve=/-1&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:pe.makeArray(n,[t]),l=pe.event.special[p]||{},i||!l.trigger||l.trigger.apply(r,n)!==!1)){if(!i&&!l.noBubble&&!pe.isWindow(r)){for(u=l.delegateType||p,Ke.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),c=s;c===(r.ownerDocument||re)&&d.push(c.defaultView||c.parentWindow||e)}for(f=0;(s=d[f++])&&!t.isPropagationStopped();)t.type=f>1?u:l.bindType||p,o=(pe._data(s,"events")||{})[t.type]&&pe._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&He(s)&&(t.result=o.apply(s,n),t.result===!1&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&He(r)&&a&&r[p]&&!pe.isWindow(r)){c=r[a],c&&(r[a]=null),pe.event.triggered=p;try{r[p]()}catch(g){}pe.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,r,i,o,a=[],s=ie.call(arguments),u=(pe._data(this,"events")||{})[e.type]||[],l=pe.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(a=pe.event.handlers.call(this,e,u),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,r=((pe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n-1:pe.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s]","i"),tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,nt=/\s*$/g,at=p(re),st=at.appendChild(re.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(tt,"<$1>")},clone:function(e,t,n){var r,i,o,a,s,u=pe.contains(e.ownerDocument,e);if(fe.html5Clone||pe.isXMLDoc(e)||!et.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(st.innerHTML=e.outerHTML,st.removeChild(o=st.firstChild)),!(fe.noCloneEvent&&fe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(r=h(o),s=h(e),a=0;null!=(i=s[a]);++a)r[a]&&k(i,r[a]);if(t)if(n)for(s=s||h(e),r=r||h(o),a=0;null!=(i=s[a]);a++)N(i,r[a]);else N(e,o);return r=h(o,"script"),r.length>0&&g(r,!u&&h(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=pe.expando,u=pe.cache,l=fe.attributes,c=pe.event.special;null!=(n=e[a]);a++)if((t||He(n))&&(i=n[s],o=i&&u[i])){if(o.events)for(r in o.events)c[r]?pe.event.remove(n,r):pe.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=void 0:n.removeAttribute(s),ne.push(i))}}}),pe.fn.extend({domManip:S,detach:function(e){return A(this,e,!0)},remove:function(e){return A(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||re).createTextNode(e))},null,e,arguments.length)},append:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.appendChild(e)}})},prepend:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(h(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Ze,""):void 0;if("string"==typeof e&&!nt.test(e)&&(fe.htmlSerialize||!et.test(e))&&(fe.leadingWhitespace||!$e.test(e))&&!Xe[(We.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;nt",t=l.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===t[0].offsetHeight,o&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),f.removeChild(u)}var n,r,i,o,a,s,u=re.createElement("div"),l=re.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",fe.opacity="0.5"===l.style.opacity,fe.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",fe.clearCloneStyle="content-box"===l.style.backgroundClip,u=re.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),fe.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pe.extend(fe,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),i},pixelMarginRight:function(){return null==n&&t(),r},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),a},reliableMarginLeft:function(){return null==n&&t(),s}}))}();var ht,gt,mt=/^(top|right|bottom|left)$/;e.getComputedStyle?(ht=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||pe.contains(e.ownerDocument,e)||(a=pe.style(e,t)),n&&!fe.pixelMarginRight()&&ft.test(a)&&ct.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):pt.currentStyle&&(ht=function(e){return e.currentStyle},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),ft.test(a)&&!mt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var yt=/alpha\([^)]*\)/i,vt=/opacity\s*=\s*([^)]*)/i,xt=/^(none|table(?!-c[ea]).+)/,bt=new RegExp("^("+Fe+")(.*)$","i"),wt={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},Ct=["Webkit","O","Moz","ms"],Et=re.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":fe.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=pe.camelCase(t),u=e.style;if(t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];if(o=typeof n,"string"===o&&(i=Me.exec(n))&&i[1]&&(n=d(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(pe.cssNumber[s]?"":"px")),fe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{u[t]=n}catch(l){}}},css:function(e,t,n,r){var i,o,a,s=pe.camelCase(t);return t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=gt(e,t,r)),"normal"===o&&t in Tt&&(o=Tt[t]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),pe.each(["height","width"],function(e,t){pe.cssHooks[t]={get:function(e,n,r){if(n)return xt.test(pe.css(e,"display"))&&0===e.offsetWidth?dt(e,wt,function(){return M(e,t,r)}):M(e,t,r)},set:function(e,n,r){var i=r&&ht(e);return _(e,n,r?F(e,t,r,fe.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,i),i):0)}}}),fe.opacity||(pe.cssHooks.opacity={get:function(e,t){return vt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===pe.trim(o.replace(yt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=yt.test(o)?o.replace(yt,i):o+" "+i)}}),pe.cssHooks.marginRight=L(fe.reliableMarginRight,function(e,t){if(t)return dt(e,{display:"inline-block"},gt,[e,"marginRight"])}),pe.cssHooks.marginLeft=L(fe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(gt(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-dt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}):0))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Oe[r]+t]=o[r]||o[r-2]||o[0];return i}},ct.test(e)||(pe.cssHooks[e+t].set=_)}),pe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(pe.isArray(t)){for(r=ht(e),i=t.length;a1)},show:function(){return q(this,!0)},hide:function(){return q(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Re(this)?pe(this).show():pe(this).hide()})}}),pe.Tween=O,O.prototype={constructor:O,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=O.propHooks[this.prop];return e&&e.get?e.get(this):O.propHooks._default.get(this)},run:function(e){var t,n=O.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=O.prototype.init,pe.fx.step={};var Nt,kt,St=/^(?:toggle|show|hide)$/,At=/queueHooks$/;pe.Animation=pe.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return d(n.elem,e,Me.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,r=0,i=e.length;r
            a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),e=n.getElementsByTagName("a")[0],e.style.cssText="top:1px",fe.getSetAttribute="t"!==n.className,fe.style=/top/.test(e.getAttribute("style")),fe.hrefNormalized="/a"===e.getAttribute("href"),fe.checkOn=!!t.value,fe.optSelected=i.selected,fe.enctype=!!re.createElement("form").enctype,r.disabled=!0,fe.optDisabled=!i.disabled,t=re.createElement("input"),t.setAttribute("value",""),fe.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),fe.radioValue="t"===t.value}();var Dt=/\r/g,jt=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=pe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,pe(this).val()):e,null==i?i="":"number"==typeof i?i+="":pe.isArray(i)&&(i=pe.map(i,function(e){return null==e?"":e+""})),t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=pe.valHooks[i.type]||pe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Dt,""):null==n?"":n)}}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace(jt," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u-1)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},fe.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Lt,Ht,qt=pe.expr.attrHandle,_t=/^(?:checked|selected)$/i,Ft=fe.getSetAttribute,Mt=fe.input;pe.fn.extend({attr:function(e,t){return Pe(this,pe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(t=t.toLowerCase(),i=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?Ht:Lt)),void 0!==n?null===n?void pe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=pe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!fe.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(De);if(o&&1===e.nodeType)for(;n=o[i++];)r=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Mt&&Ft||!_t.test(n)?e[r]=!1:e[pe.camelCase("default-"+n)]=e[r]=!1:pe.attr(e,n,""),e.removeAttribute(Ft?n:r)}}),Ht={set:function(e,t,n){return t===!1?pe.removeAttr(e,n):Mt&&Ft||!_t.test(n)?e.setAttribute(!Ft&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=qt[t]||pe.find.attr;Mt&&Ft||!_t.test(t)?qt[t]=function(e,t,r){var i,o;return r||(o=qt[t],qt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,qt[t]=o),i}:qt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}}),Mt&&Ft||(pe.attrHooks.value={set:function(e,t,n){return pe.nodeName(e,"input")?void(e.defaultValue=t):Lt&&Lt.set(e,t,n)}}),Ft||(Lt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},qt.id=qt.name=qt.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:Lt.set},pe.attrHooks.contenteditable={set:function(e,t,n){Lt.set(e,""!==t&&t,n)}},pe.each(["width","height"],function(e,t){pe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),fe.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ot=/^(?:input|select|textarea|button|object)$/i,Rt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Pe(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=pe.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),pe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,i=pe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):Ot.test(e.nodeName)||Rt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),fe.hrefNormalized||pe.each(["href","src"],function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),fe.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),fe.enctype||(pe.propFix.enctype="encoding");var Pt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).addClass(e.call(this,t,z(this)))});if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=pe(this),o=e.match(De)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=z(this),t&&pe._data(this,"__className__",t),pe.attr(this,"class",t||e===!1?"":pe._data(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+z(n)+" ").replace(Pt," ").indexOf(t)>-1)return!0;return!1}}),pe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var Bt=e.location,Wt=pe.now(),It=/\?/,$t=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=pe.trim(t+"");return i&&!pe.trim(i.replace($t,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():pe.error("Invalid JSON: "+t)},pe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new e.DOMParser,n=r.parseFromString(t,"text/xml")):(n=new e.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var zt=/#.*$/,Xt=/([?&])_=[^&]*/,Ut=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Vt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Yt=/^(?:GET|HEAD)$/,Jt=/^\/\//,Gt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Kt={},Qt={},Zt="*/".concat("*"),en=Bt.href,tn=Gt.exec(en.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:en,type:"GET",isLocal:Vt.test(tn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?V(V(e,pe.ajaxSettings),t):V(pe.ajaxSettings,e)},ajaxPrefilter:X(Kt),ajaxTransport:X(Qt),ajax:function(t,n){function r(t,n,r,i){var o,f,v,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),c=void 0,s=i||"",T.readyState=t>0?4:0,o=t>=200&&t<300||304===t,r&&(x=Y(d,T,r)),x=J(d,x,T,o),o?(d.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(pe.lastModified[a]=w),w=T.getResponseHeader("etag"),w&&(pe.etag[a]=w)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,v=x.error,o=!v)):(v=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",o?g.resolveWith(p,[f,C,T]):g.rejectWith(p,[T,C,v]),T.statusCode(y),y=void 0,l&&h.trigger(o?"ajaxSuccess":"ajaxError",[T,d,o?f:v]),m.fireWith(p,[T,C]),l&&(h.trigger("ajaxComplete",[T,d]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,d=pe.ajaxSetup({},n),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?pe(p):pe.event,g=pe.Deferred(),m=pe.Callbacks("once memory"),y=d.statusCode||{},v={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!f)for(f={};t=Ut.exec(s);)f[t[1].toLowerCase()]=t[2];t=f[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)y[t]=[y[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return c&&c.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||en)+"").replace(zt,"").replace(Jt,tn[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=pe.trim(d.dataType||"*").toLowerCase().match(De)||[""],null==d.crossDomain&&(i=Gt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===tn[1]&&i[2]===tn[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(tn[3]||("http:"===tn[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=pe.param(d.data,d.traditional)),U(Kt,d,n,T),2===b)return T;l=pe.event&&d.global,l&&0===pe.active++&&pe.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Yt.test(d.type),a=d.url,d.hasContent||(d.data&&(a=d.url+=(It.test(a)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Xt.test(a)?a.replace(Xt,"$1_="+Wt++):a+(It.test(a)?"&":"?")+"_="+Wt++)),d.ifModified&&(pe.lastModified[a]&&T.setRequestHeader("If-Modified-Since",pe.lastModified[a]),pe.etag[a]&&T.setRequestHeader("If-None-Match",pe.etag[a])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Zt+"; q=0.01":""):d.accepts["*"]);for(o in d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(d.beforeSend.call(p,T,d)===!1||2===b))return T.abort();w="abort";for(o in{success:1,error:1,complete:1})T[o](d[o]);if(c=U(Qt,d,n,T)){if(T.readyState=1,l&&h.trigger("ajaxSend",[T,d]),2===b)return T;d.async&&d.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{b=1,c.send(v,r)}catch(C){if(!(b<2))throw C;r(-1,C)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,r,i){return pe.isFunction(n)&&(i=i||r,r=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:i,data:n,success:r},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pe.fn.extend({wrapAll:function(e){if(pe.isFunction(e))return this.each(function(t){pe(this).wrapAll(e.call(this,t))});if(this[0]){var t=pe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return pe.isFunction(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=pe.isFunction(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)}).end()}}),pe.expr.filters.hidden=function(e){return fe.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:K(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,an=/^(?:submit|button|image|reset|file)$/i,sn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)Q(n,e[n],t,i);return r.join("&").replace(nn,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&sn.test(this.nodeName)&&!an.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),pe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?ee():re.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||ee()}:Z;var un=0,ln={},cn=pe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in ln)ln[e](void 0,!0)}),fe.cors=!!cn&&"withCredentials"in cn,cn=fe.ajax=!!cn,cn&&pe.ajaxTransport(function(t){if(!t.crossDomain||fe.cors){var n;return{send:function(r,i){var o,a=t.xhr(),s=++un;if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)void 0!==r[o]&&a.setRequestHeader(o,r[o]+"");a.send(t.hasContent&&t.data||null),n=function(e,r){var o,u,l;if(n&&(r||4===a.readyState))if(delete ln[s],n=void 0,a.onreadystatechange=pe.noop,r)4!==a.readyState&&a.abort();else{l={},o=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{u=a.statusText}catch(c){u=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&i(o,u,l,a.getAllResponseHeaders())},t.async?4===a.readyState?e.setTimeout(n):a.onreadystatechange=ln[s]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),pe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=re.head||pe("head")[0]||re.documentElement;return{send:function(r,i){t=re.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var fn=[],dn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=fn.pop()||pe.expando+"_"+Wt++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=pe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||pe.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?pe(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,fn.push(i)),a&&pe.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||re;var r=Te.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=y([e],t,i),i&&i.length&&pe(i).remove(),pe.merge([],r.childNodes))};var pn=pe.fn.load;return pe.fn.load=function(e,t,n){if("string"!=typeof e&&pn)return pn.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=pe.trim(e.slice(s,e.length)),e=e.slice(0,s)),pe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&pe.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?pe("
            ").append(pe.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.expr.filters.animated=function(e){return pe.grep(pe.timers,function(t){return e===t.elem}).length},pe.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=pe.css(e,"position"),f=pe(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=pe.css(e,"top"),u=pe.css(e,"left"),l=("absolute"===c||"fixed"===c)&&pe.inArray("auto",[o,u])>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){pe.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return t=o.documentElement,pe.contains(t,i)?("undefined"!=typeof i.getBoundingClientRect&&(r=i.getBoundingClientRect()),n=te(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===pe.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(r,"marginTop",!0),left:t.left-n.left-pe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){ for(var e=this.offsetParent;e&&!pe.nodeName(e,"html")&&"static"===pe.css(e,"position");)e=e.offsetParent;return e||pt})}}),pe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);pe.fn[e]=function(r){return Pe(this,function(e,r,i){var o=te(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?pe(o).scrollLeft():i,n?i:pe(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),pe.each(["top","left"],function(e,t){pe.cssHooks[t]=L(fe.pixelPosition,function(e,n){if(n)return n=gt(e,t),ft.test(n)?pe(e).position()[t]+"px":n})}),pe.each({Height:"height",Width:"width"},function(e,t){pe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){pe.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Pe(this,function(t,n,r){var i;return pe.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?pe.css(t,n,a):pe.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),pe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),pe.fn.size=function(){return this.length},pe.fn.andSelf=pe.fn.addBack,layui.define(function(e){layui.$=pe,e("jquery",pe)}),pe}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/laydate.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;!function(){"use strict";var e=window.layui&&layui.define,t={getPath:function(){var e=document.scripts,t=e[e.length-1],n=t.src;if(!t.getAttribute("merge"))return n.substring(0,n.lastIndexOf("/")+1)}(),getStyle:function(e,t){var n=e.currentStyle?e.currentStyle:window.getComputedStyle(e,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(e,a,i){if(n.path){var r=document.getElementsByTagName("head")[0],o=document.createElement("link");"string"==typeof a&&(i=a);var s=(i||e).replace(/\.|\//g,""),l="layuicss-"+s,d=0;o.rel="stylesheet",o.href=n.path+e,o.id=l,document.getElementById(l)||r.appendChild(o),"function"==typeof a&&!function c(){return++d>80?window.console&&console.error("laydate.css: Invalid"):void(1989===parseInt(t.getStyle(document.getElementById(l),"width"))?a():setTimeout(c,100))}()}}},n={v:"5.0.6",config:{},index:window.laydate&&window.laydate.v?1e5:0,path:t.getPath,set:function(e){var n=this;return n.config=t.extend({},n.config,e),n},ready:function(a){var i="laydate",r="",o=(e?"modules/laydate/":"theme/")+"default/laydate.css?v="+n.v+r;return"function"==typeof define&&define.amd?a():(e?layui.addcss(o,a,i):t.link(o,a,i),this)}},a=function(){var e=this;return{hint:function(t){e.hint.call(e,t)},config:e.config}},i="laydate",r=".layui-laydate",o="layui-this",s="laydate-disabled",l="开始日期超出了结束日期
            建议重新选择",d=[100,2e5],c="layui-laydate-static",m="layui-laydate-list",u="laydate-selected",h="layui-laydate-hint",y="laydate-day-prev",f="laydate-day-next",p="layui-laydate-footer",g=".laydate-btns-confirm",v="laydate-time-text",D=".laydate-btns-time",T=function(e){var t=this;t.index=++n.index,t.config=w.extend({},t.config,n.config,e),n.ready(function(){t.init()})},w=function(e){return new C(e)},C=function(e){for(var t=0,n="object"==typeof e?[e]:(this.selector=e,document.querySelectorAll(e||null));t0)return n[0].getAttribute(e)}():n.each(function(n,a){a.setAttribute(e,t)})},C.prototype.removeAttr=function(e){return this.each(function(t,n){n.removeAttribute(e)})},C.prototype.html=function(e){return this.each(function(t,n){n.innerHTML=e})},C.prototype.val=function(e){return this.each(function(t,n){n.value=e})},C.prototype.append=function(e){return this.each(function(t,n){"object"==typeof e?n.appendChild(e):n.innerHTML=n.innerHTML+e})},C.prototype.remove=function(e){return this.each(function(t,n){e?n.removeChild(e):n.parentNode.removeChild(n)})},C.prototype.on=function(e,t){return this.each(function(n,a){a.attachEvent?a.attachEvent("on"+e,function(e){e.target=e.srcElement,t.call(a,e)}):a.addEventListener(e,t,!1)})},C.prototype.off=function(e,t){return this.each(function(n,a){a.detachEvent?a.detachEvent("on"+e,t):a.removeEventListener(e,t,!1)})},T.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},T.prototype.config={type:"date",range:!1,format:"yyyy-MM-dd",value:null,min:"1900-1-1",max:"2099-12-31",trigger:"focus",show:!1,showBottom:!0,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:!1,mark:{},zIndex:null,done:null,change:null},T.prototype.lang=function(){var e=this,t=e.config,n={cn:{weeks:["日","一","二","三","四","五","六"],time:["时","分","秒"],timeTips:"选择时间",startTime:"开始时间",endTime:"结束时间",dateTips:"返回日期",month:["一","二","三","四","五","六","七","八","九","十","十一","十二"],tools:{confirm:"确定",clear:"清空",now:"现在"}},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"}}};return n[t.lang]||n.cn},T.prototype.init=function(){var e=this,t=e.config,n="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s",a="static"===t.position,i={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};t.elem=w(t.elem),t.eventElem=w(t.eventElem),t.elem[0]&&(t.range===!0&&(t.range="-"),t.format===i.date&&(t.format=i[t.type]),e.format=t.format.match(new RegExp(n+"|.","g"))||[],e.EXP_IF="",e.EXP_SPLIT="",w.each(e.format,function(t,a){var i=new RegExp(n).test(a)?"\\d{"+function(){return new RegExp(n).test(e.format[0===t?t+1:t-1]||"")?/^yyyy|y$/.test(a)?4:a.length:/^yyyy$/.test(a)?"1,4":/^y$/.test(a)?"1,308":"1,2"}()+"}":"\\"+a;e.EXP_IF=e.EXP_IF+i,e.EXP_SPLIT=e.EXP_SPLIT+"("+i+")"}),e.EXP_IF=new RegExp("^"+(t.range?e.EXP_IF+"\\s\\"+t.range+"\\s"+e.EXP_IF:e.EXP_IF)+"$"),e.EXP_SPLIT=new RegExp("^"+e.EXP_SPLIT+"$",""),e.isInput(t.elem[0])||"focus"===t.trigger&&(t.trigger="click"),t.elem.attr("lay-key")||(t.elem.attr("lay-key",e.index),t.eventElem.attr("lay-key",e.index)),t.mark=w.extend({},t.calendar&&"cn"===t.lang?{"0-1-1":"元旦","0-2-14":"情人","0-3-8":"妇女","0-3-12":"植树","0-4-1":"愚人","0-5-1":"劳动","0-5-4":"青年","0-6-1":"儿童","0-9-10":"教师","0-9-18":"国耻","0-10-1":"国庆","0-12-25":"圣诞"}:{},t.mark),w.each(["min","max"],function(e,n){var a=[],i=[];if("number"==typeof t[n]){var r=t[n],o=(new Date).getTime(),s=864e5,l=new Date(r?r0)return!0;var a=w.elem("div",{"class":"layui-laydate-header"}),i=[function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-y"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-m"});return e.innerHTML="",e}(),function(){var e=w.elem("div",{"class":"laydate-set-ym"}),t=w.elem("span"),n=w.elem("span");return e.appendChild(t),e.appendChild(n),e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-m"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-y"});return e.innerHTML="",e}()],d=w.elem("div",{"class":"layui-laydate-content"}),c=w.elem("table"),m=w.elem("thead"),u=w.elem("tr");w.each(i,function(e,t){a.appendChild(t)}),m.appendChild(u),w.each(new Array(6),function(e){var t=c.insertRow(0);w.each(new Array(7),function(a){if(0===e){var i=w.elem("th");i.innerHTML=n.weeks[a],u.appendChild(i)}t.insertCell(a)})}),c.insertBefore(m,c.children[0]),d.appendChild(c),r[e]=w.elem("div",{"class":"layui-laydate-main laydate-main-list-"+e}),r[e].appendChild(a),r[e].appendChild(d),o.push(i),s.push(d),l.push(c)}),w(d).html(function(){var e=[],i=[];return"datetime"===t.type&&e.push(''+n.timeTips+""),w.each(t.btns,function(e,r){var o=n.tools[r]||"btn";t.range&&"now"===r||(a&&"clear"===r&&(o="cn"===t.lang?"重置":"Reset"),i.push(''+o+""))}),e.push('"),e.join("")}()),w.each(r,function(e,t){i.appendChild(t)}),t.showBottom&&i.appendChild(d),/^#/.test(t.theme)){var m=w.elem("style"),u=["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,e.elemID).replace(/{{theme}}/g,t.theme);"styleSheet"in m?(m.setAttribute("type","text/css"),m.styleSheet.cssText=u):m.innerHTML=u,w(i).addClass("laydate-theme-molv"),i.appendChild(m)}e.remove(T.thisElem),a?t.elem.append(i):(document.body.appendChild(i),e.position()),e.checkDate().calendar(),e.changeEvent(),T.thisElem=e.elemID,"function"==typeof t.ready&&t.ready(w.extend({},t.dateTime,{month:t.dateTime.month+1}))},T.prototype.remove=function(e){var t=this,n=(t.config,w("#"+(e||t.elemID)));return n[0]&&!n.hasClass(c)&&t.checkDate(function(){n.remove()}),t},T.prototype.position=function(){var e=this,t=e.config,n=e.bindElem||t.elem[0],a=n.getBoundingClientRect(),i=e.elem.offsetWidth,r=e.elem.offsetHeight,o=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},s=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},l=5,d=a.left,c=a.bottom;d+i+l>s("width")&&(d=s("width")-i-l),c+r+l>s()&&(c=a.top>r?a.top-r:s()-r,c-=2*l),t.position&&(e.elem.style.position=t.position),e.elem.style.left=d+("fixed"===t.position?0:o(1))+"px",e.elem.style.top=c+("fixed"===t.position?0:o())+"px"},T.prototype.hint=function(e){var t=this,n=(t.config,w.elem("div",{"class":h}));n.innerHTML=e||"",w(t.elem).find("."+h).remove(),t.elem.appendChild(n),clearTimeout(t.hinTimer),t.hinTimer=setTimeout(function(){w(t.elem).find("."+h).remove()},3e3)},T.prototype.getAsYM=function(e,t,n){return n?t--:t++,t<0&&(t=11,e--),t>11&&(t=0,e++),[e,t]},T.prototype.systemDate=function(e){var t=e||new Date;return{year:t.getFullYear(),month:t.getMonth(),date:t.getDate(),hours:e?e.getHours():0,minutes:e?e.getMinutes():0,seconds:e?e.getSeconds():0}},T.prototype.checkDate=function(e){var t,a,i=this,r=(new Date,i.config),o=r.dateTime=r.dateTime||i.systemDate(),s=i.bindElem||r.elem[0],l=(i.isInput(s)?"val":"html",i.isInput(s)?s.value:"static"===r.position?"":s.innerHTML),c=function(e){e.year>d[1]&&(e.year=d[1],a=!0),e.month>11&&(e.month=11,a=!0),e.hours>23&&(e.hours=0,a=!0),e.minutes>59&&(e.minutes=0,e.hours++,a=!0),e.seconds>59&&(e.seconds=0,e.minutes++,a=!0),t=n.getEndDate(e.month+1,e.year),e.date>t&&(e.date=t,a=!0)},m=function(e,t,n){var o=["startTime","endTime"];t=(t.match(i.EXP_SPLIT)||[]).slice(1),n=n||0,r.range&&(i[o[n]]=i[o[n]]||{}),w.each(i.format,function(s,l){var c=parseFloat(t[s]);t[s].length必须遵循下述格式:
            "+(r.range?r.format+" "+r.range+" "+r.format:r.format)+"
            已为你重置"),a=!0):l&&l.constructor===Date?r.dateTime=i.systemDate(l):(r.dateTime=i.systemDate(),delete i.startState,delete i.endState,delete i.startDate,delete i.endDate,delete i.startTime,delete i.endTime),c(o),a&&l&&i.setValue(r.range?i.endDate?i.parse():"":i.parse()),e&&e(),i)},T.prototype.mark=function(e,t){var n,a=this,i=a.config;return w.each(i.mark,function(e,a){var i=e.split("-");i[0]!=t[0]&&0!=i[0]||i[1]!=t[1]&&0!=i[1]||i[2]!=t[2]||(n=a||t[2])}),n&&e.html(''+n+""),a},T.prototype.limit=function(e,t,n,a){var i,r=this,o=r.config,l={},d=o[n>41?"endDate":"dateTime"],c=w.extend({},d,t||{});return w.each({now:c,min:o.min,max:o.max},function(e,t){l[e]=r.newDate(w.extend({year:t.year,month:t.month,date:t.date},function(){var e={};return w.each(a,function(n,a){e[a]=t[a]}),e}())).getTime()}),i=l.nowl.max,e&&e[i?"addClass":"removeClass"](s),i},T.prototype.calendar=function(e){var t,a,i,r=this,s=r.config,l=e||s.dateTime,c=new Date,m=r.lang(),u="date"!==s.type&&"datetime"!==s.type,h=e?1:0,y=w(r.table[h]).find("td"),f=w(r.elemHeader[h][2]).find("span");if(l.yeard[1]&&(l.year=d[1],r.hint("最高只能支持到公元"+d[1]+"年")),r.firstDate||(r.firstDate=w.extend({},l)),c.setFullYear(l.year,l.month,1),t=c.getDay(),a=n.getEndDate(l.month,l.year),i=n.getEndDate(l.month+1,l.year),w.each(y,function(e,n){var d=[l.year,l.month],c=0;n=w(n),n.removeAttr("class"),e=t&&e=n.firstDate.year&&(r.month=a.max.month,r.date=a.max.date),n.limit(w(i),r,t),M++}),w(u[f?0:1]).attr("lay-ym",M-8+"-"+T[1]).html(b+p+" - "+(M-1+p))}else if("month"===e)w.each(new Array(12),function(e){var i=w.elem("li",{"lay-ym":e}),s={year:T[0],month:e};e+1==T[1]&&w(i).addClass(o),i.innerHTML=r.month[e]+(f?"月":""),d.appendChild(i),T[0]=n.firstDate.year&&(s.date=a.max.date),n.limit(w(i),s,t)}),w(u[f?0:1]).attr("lay-ym",T[0]+"-"+T[1]).html(T[0]+p);else if("time"===e){var E=function(){w(d).find("ol").each(function(e,a){w(a).find("li").each(function(a,i){n.limit(w(i),[{hours:a},{hours:n[x].hours,minutes:a},{hours:n[x].hours,minutes:n[x].minutes,seconds:a}][e],t,[["hours"],["hours","minutes"],["hours","minutes","seconds"]][e])})}),a.range||n.limit(w(n.footer).find(g),n[x],0,["hours","minutes","seconds"])};a.range?n[x]||(n[x]={hours:0,minutes:0,seconds:0}):n[x]=i,w.each([24,60,60],function(e,t){var a=w.elem("li"),i=["

            "+r.time[e]+"

              "];w.each(new Array(t),function(t){i.push(""+w.digit(t,2)+"")}),a.innerHTML=i.join("")+"
            ",d.appendChild(a)}),E()}if(y&&h.removeChild(y),h.appendChild(d),"year"===e||"month"===e)w(n.elemMain[t]).addClass("laydate-ym-show"),w(d).find("li").on("click",function(){var r=0|w(this).attr("lay-ym");if(!w(this).hasClass(s)){if(0===t)i[e]=r,l&&(n.startDate[e]=r),n.limit(w(n.footer).find(g),null,0);else if(l)n.endDate[e]=r;else{var c="year"===e?n.getAsYM(r,T[1]-1,"sub"):n.getAsYM(T[0],r,"sub");w.extend(i,{year:c[0],month:c[1]})}"year"===a.type||"month"===a.type?(w(d).find("."+o).removeClass(o),w(this).addClass(o),"month"===a.type&&"year"===e&&(n.listYM[t][0]=r,l&&(n[["startDate","endDate"][t]].year=r),n.list("month",t))):(n.checkDate("limit").calendar(),n.closeList()),n.setBtnStatus(),a.range||n.done(null,"change"),w(n.footer).find(D).removeClass(s)}});else{var S=w.elem("span",{"class":v}),k=function(){w(d).find("ol").each(function(e){var t=this,a=w(t).find("li");t.scrollTop=30*(n[x][C[e]]-2),t.scrollTop<=0&&a.each(function(e,n){if(!w(this).hasClass(s))return t.scrollTop=30*(e-2),!0})})},H=w(c[2]).find("."+v);k(),S.innerHTML=a.range?[r.startTime,r.endTime][t]:r.timeTips,w(n.elemMain[t]).addClass("laydate-time-show"),H[0]&&H.remove(),c[2].appendChild(S),w(d).find("ol").each(function(e){var t=this;w(t).find("li").on("click",function(){var r=0|this.innerHTML;w(this).hasClass(s)||(a.range?n[x][C[e]]=r:i[C[e]]=r,w(t).find("."+o).removeClass(o),w(this).addClass(o),E(),k(),(n.endDate||"time"===a.type)&&n.done(null,"change"),n.setBtnStatus())})})}return n},T.prototype.listYM=[],T.prototype.closeList=function(){var e=this;e.config;w.each(e.elemCont,function(t,n){w(this).find("."+m).remove(),w(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show")}),w(e.elem).find("."+v).remove()},T.prototype.setBtnStatus=function(e,t,n){var a,i=this,r=i.config,o=w(i.footer).find(g),d=r.range&&"date"!==r.type&&"time"!==r.type;d&&(t=t||i.startDate,n=n||i.endDate,a=i.newDate(t).getTime()>i.newDate(n).getTime(),i.limit(null,t)||i.limit(null,n)?o.addClass(s):o[a?"addClass":"removeClass"](s),e&&a&&i.hint("string"==typeof e?l.replace(/日期/g,e):l))},T.prototype.parse=function(e,t){var n=this,a=n.config,i=t||(e?w.extend({},n.endDate,n.endTime):a.range?w.extend({},n.startDate,n.startTime):a.dateTime),r=n.format.concat();return w.each(r,function(e,t){/yyyy|y/.test(t)?r[e]=w.digit(i.year,t.length):/MM|M/.test(t)?r[e]=w.digit(i.month+1,t.length):/dd|d/.test(t)?r[e]=w.digit(i.date,t.length):/HH|H/.test(t)?r[e]=w.digit(i.hours,t.length):/mm|m/.test(t)?r[e]=w.digit(i.minutes,t.length):/ss|s/.test(t)&&(r[e]=w.digit(i.seconds,t.length))}),a.range&&!e?r.join("")+" "+a.range+" "+n.parse(1):r.join("")},T.prototype.newDate=function(e){return new Date(e.year||1,e.month||0,e.date||1,e.hours||0,e.minutes||0,e.seconds||0)},T.prototype.setValue=function(e){var t=this,n=t.config,a=t.bindElem||n.elem[0],i=t.isInput(a)?"val":"html";return"static"===n.position||w(a)[i](e||""),this},T.prototype.stampRange=function(){var e,t,n=this,a=n.config,i=w(n.elem).find("td");if(a.range&&!n.endDate&&w(n.footer).find(g).addClass(s),n.endDate)return e=n.newDate({year:n.startDate.year,month:n.startDate.month,date:n.startDate.date}).getTime(),t=n.newDate({year:n.endDate.year,month:n.endDate.month,date:n.endDate.date}).getTime(),e>t?n.hint(l):void w.each(i,function(a,i){var r=w(i).attr("lay-ymd").split("-"),s=n.newDate({year:r[0],month:r[1]-1,date:r[2]}).getTime();w(i).removeClass(u+" "+o),s!==e&&s!==t||w(i).addClass(w(i).hasClass(y)||w(i).hasClass(f)?u:o),s>e&&s','
            '+f+"
            ",'
            ','',"
            ","
            "].join(""));return l.ie&&l.ie<8?c.removeClass("layui-hide").addClass(o):(d[0]&&d.remove(),s.call(a,m,c[0],y),c.addClass("layui-hide").after(m),a.index)},c.prototype.getContent=function(t){var e=u(t);if(e[0])return d(e[0].document.body.innerHTML)},c.prototype.getText=function(t){var i=u(t);if(i[0])return e(i[0].document.body).text()},c.prototype.setContent=function(t,i,a){var l=u(t);l[0]&&(a?e(l[0].document.body).append(i):e(l[0].document.body).html(i),layedit.sync(t))},c.prototype.sync=function(t){var i=u(t);if(i[0]){var a=e("#"+i[1].attr("textarea"));a.val(d(i[0].document.body.innerHTML))}},c.prototype.getSelection=function(t){var e=u(t);if(e[0]){var i=m(e[0].document);return document.selection?i.text:i.toString()}};var s=function(t,i,a){var l=this,n=t.find("iframe");n.css({height:a.height}).on("load",function(){var o=n.contents(),r=n.prop("contentWindow"),c=o.find("head"),s=e([""].join("")),u=o.find("body");c.append(s),u.attr("contenteditable","true").css({"min-height":a.height}).html(i.value||""),y.apply(l,[r,n,i,a]),g.call(l,r,t,a)})},u=function(t){var i=e("#LAY_layedit_"+t),a=i.prop("contentWindow");return[a,i]},d=function(t){return 8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),t},y=function(t,a,n,o){var r=t.document,c=e(r.body);c.on("keydown",function(t){var e=t.keyCode;if(13===e){var a=m(r),l=p(a),n=l.parentNode;if("pre"===n.tagName.toLowerCase()){if(t.shiftKey)return;return i.msg("请暂时用shift+enter"),!1}r.execCommand("formatBlock",!1,"

            ")}}),e(n).parents("form").on("submit",function(){var t=c.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),c.on("paste",function(e){r.execCommand("formatBlock",!1,"

            "),setTimeout(function(){f.call(t,c),n.value=c.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),c={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},face:function(e){x.call(this,function(i){v.call(t,"img",{src:i.src,alt:i.alt},e)})},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"上传失败")}})})},code:function(e){k.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"帮助",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["http://www.layui.com/about/layedit/help.html","no"]})}},s=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"

            "),setTimeout(function(){o.focus()},10)):c[a]&&c[a].call(this,u),h.call(t,s,i)}},d=/image/;s.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,s),i.close(x.index)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"超链接",skin:"layui-layer-msg",content:['

              ','
            • ','','
              ','',"
              ","
            • ",'
            • ','','
              ','",'","
              ","
            • ",'
            • ','','',"
            • ","
            "].join(""),success:function(t,n){var o="submit(layedit-link-yes)";a.render("radio"),t.find(".layui-btn-primary").on("click",function(){i.close(n),l.focus()}),a.on(o,function(t){i.close(b.index),e&&e(t.field)})}});b.index=n},x=function(t){var a=function(){var t=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],e={};return layui.each(t,function(t,i){e[i]=layui.cache.dir+"images/face/"+t+".gif"}),e}();return x.hide=x.hide||function(t){"face"!==e(t.target).attr("layedit-event")&&i.close(x.index)},x.index=i.tips(function(){var t=[];return layui.each(a,function(e,i){t.push('
          • '+e+'
          • ')}),'
              '+t.join("")+"
            "}(),this,{tips:1,time:0,skin:"layui-box layui-util-face",maxWidth:500,success:function(l,n){l.css({marginTop:-4,marginLeft:-10}).find(".layui-clear>li").on("click",function(){t&&t({src:a[this.title],alt:this.title}),i.close(n)}),e(document).off("click",x.hide).on("click",x.hide)}})},k=function(t){var e=this,l=i.open({type:1,id:"LAY_layedit_code",area:"550px",shade:.05,shadeClose:!0,moveType:1,title:"插入代码",skin:"layui-layer-msg",content:['
              ','
            • ','','
              ','","
              ","
            • ",'
            • ','','
              ','',"
              ","
            • ",'
            • ','','',"
            • ","
            "].join(""),success:function(l,n){var o="submit(layedit-code-yes)";a.render("select"),l.find(".layui-btn-primary").on("click",function(){i.close(n),e.focus()}),a.on(o,function(e){i.close(k.index),t&&t(e.field)})}});k.index=l},C={html:'',strong:'',italic:'',underline:'',del:'',"|":'',left:'',center:'',right:'',link:'',unlink:'',face:'',image:'',code:'',help:''},w=new c;t(n,w)}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/layer.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.scripts,t=e[e.length-1],i=t.src;if(!t.getAttribute("merge"))return i.substring(0,i.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(e,t){var i=e.currentStyle?e.currentStyle:n.getComputedStyle(e,null);return i[i.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.0.3",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("skin/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
            '+(f?r.title[0]:r.title)+"
            ":"";return r.zIndex=s,t([r.shade?'
            ':"",'
            '+(e&&2!=r.type?"":u)+'
            '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
            '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
            '+e+"
            "}():"")+(r.resize?'':"")+"
            "],u,i('
            ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
              '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
            • '+(t[0].content||"no content")+"
            • ";i'+(t[i].content||"no content")+"";return a}()+"
            ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(u[d].alt||
            '+(u.length>1?'':"")+'
            '+(u[d].alt||"")+""+s.imgIndex+"/"+u.length+"
            ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
            是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/laypage.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),skip:function(){return['到第','','页',""].join("")}()};return['
            ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
            "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/laytpl.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},n={exp:function(e){return new RegExp(e,"g")},query:function(e,n,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return c((n||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var n="Laytpl Error:";return"object"==typeof console&&console.error(n+e+"\n"+(r||"")),n+e}},c=n.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=c("^"+r.open+"#",""),l=c(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(c(r.open+"#"),r.open+"# ").replace(c(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(/(?="|')/g,"\\").replace(n.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(n.query(1),function(e){var n='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(c(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),n='"+_escape_('),n+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,n.escape)}catch(u){return delete o.cache,n.error(u,p)}},t.pt.render=function(e,r){var c,t=this;return e?(c=t.cache?t.cache(e,n.escape):t.parse(t.tpl,e),r?void r(c):c):n.error("no data")};var o=function(e){return"string"!=typeof e?n.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var n in e)r[n]=e[n]},o.v="1.2.0",e("laytpl",o)}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/mobile.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;layui.define(function(i){i("layui.mobile",layui.v)});layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},n={exp:function(e){return new RegExp(e,"g")},query:function(e,n,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return c((n||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var n="Laytpl Error:";return"object"==typeof console&&console.error(n+e+"\n"+(r||"")),n+e}},c=n.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=c("^"+r.open+"#",""),l=c(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(c(r.open+"#"),r.open+"# ").replace(c(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(/(?="|')/g,"\\").replace(n.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(n.query(1),function(e){var n='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(c(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),n='"+_escape_('),n+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,n.escape)}catch(u){return delete o.cache,n.error(u,p)}},t.pt.render=function(e,r){var c,t=this;return e?(c=t.cache?t.cache(e,n.escape):t.parse(t.tpl,e),r?void r(c):c):n.error("no data")};var o=function(e){return"string"!=typeof e?n.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var n in e)r[n]=e[n]},o.v="1.2.0",e("laytpl",o)});layui.define(function(e){"use strict";var t=(window,document),i="querySelectorAll",n="getElementsByClassName",a=function(e){return t[i](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var i in e)t[i]=e[i];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var o=0,r=["layui-m-layer"],d=function(e){var t=this;t.config=l.extend(e),t.view()};d.prototype.view=function(){var e=this,i=e.config,s=t.createElement("div");e.id=s.id=r[0]+o,s.setAttribute("class",r[0]+" "+r[0]+(i.type||0)),s.setAttribute("index",o);var l=function(){var e="object"==typeof i.title;return i.title?'

            '+(e?i.title[0]:i.title)+"

            ":""}(),d=function(){"string"==typeof i.btn&&(i.btn=[i.btn]);var e,t=(i.btn||[]).length;return 0!==t&&i.btn?(e=''+i.btn[0]+"",2===t&&(e=''+i.btn[1]+""+e),'
            '+e+"
            "):""}();if(i.fixed||(i.top=i.hasOwnProperty("top")?i.top:100,i.style=i.style||"",i.style+=" top:"+(t.body.scrollTop+i.top)+"px"),2===i.type&&(i.content='

            '+(i.content||"")+"

            "),i.skin&&(i.anim="up"),"msg"===i.skin&&(i.shade=!1),s.innerHTML=(i.shade?"
            ':"")+'
            "+l+'
            '+i.content+"
            "+d+"
            ",!i.type||2===i.type){var y=t[n](r[0]+i.type),u=y.length;u>=1&&c.close(y[0].getAttribute("index"))}document.body.appendChild(s);var m=e.elem=a("#"+e.id)[0];i.success&&i.success(m),e.index=o++,e.action(i,m)},d.prototype.action=function(e,t){var i=this;e.time&&(l.timer[i.index]=setTimeout(function(){c.close(i.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),c.close(i.index)):e.yes?e.yes(i.index):c.close(i.index)};if(e.btn)for(var s=t[n]("layui-m-layerbtn")[0].children,o=s.length,r=0;r0&&e-1 in t)}function s(t){return A.call(t,function(t){return null!=t})}function u(t){return t.length>0?T.fn.concat.apply([],t):t}function c(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(t){return t in F?F[t]:F[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||k[c(t)]?e:e+"px"}function h(t){var e,n;return $[t]||(e=L.createElement(t),L.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),$[t]=n),$[t]}function p(t){return"children"in t?D.call(t.children):T.map(t.childNodes,function(t){if(1==t.nodeType)return t})}function d(t,e){var n,r=t?t.length:0;for(n=0;n]*>/,R=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Z=/^(?:body|html)$/i,q=/([A-Z])/g,H=["val","css","html","text","data","width","height","offset"],I=["after","prepend","before","append"],V=L.createElement("table"),_=L.createElement("tr"),B={tr:L.createElement("tbody"),tbody:V,thead:V,tfoot:V,td:_,th:_,"*":L.createElement("div")},U=/complete|loaded|interactive/,X=/^[\w-]*$/,J={},W=J.toString,Y={},G=L.createElement("div"),K={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Q=Array.isArray||function(t){return t instanceof Array};return Y.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var r,i=t.parentNode,o=!i;return o&&(i=G).appendChild(t),r=~Y.qsa(i,e).indexOf(t),o&&G.removeChild(t),r},C=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},N=function(t){return A.call(t,function(e,n){return t.indexOf(e)==n})},Y.fragment=function(t,e,n){var r,i,a;return R.test(t)&&(r=T(L.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(z,"<$1>")),e===E&&(e=M.test(t)&&RegExp.$1),e in B||(e="*"),a=B[e],a.innerHTML=""+t,r=T.each(D.call(a.childNodes),function(){a.removeChild(this)})),o(n)&&(i=T(r),T.each(n,function(t,e){H.indexOf(t)>-1?i[t](e):i.attr(t,e)})),r},Y.Z=function(t,e){return new d(t,e)},Y.isZ=function(t){return t instanceof Y.Z},Y.init=function(t,n){var r;if(!t)return Y.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&M.test(t))r=Y.fragment(t,RegExp.$1,n),t=null;else{if(n!==E)return T(n).find(t);r=Y.qsa(L,t)}else{if(e(t))return T(L).ready(t);if(Y.isZ(t))return t;if(Q(t))r=s(t);else if(i(t))r=[t],t=null;else if(M.test(t))r=Y.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==E)return T(n).find(t);r=Y.qsa(L,t)}}return Y.Z(r,t)},T=function(t,e){return Y.init(t,e)},T.extend=function(t){var e,n=D.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){m(t,n,e)}),t},Y.qsa=function(t,e){var n,r="#"==e[0],i=!r&&"."==e[0],o=r||i?e.slice(1):e,a=X.test(o);return t.getElementById&&a&&r?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:D.call(a&&!r&&t.getElementsByClassName?i?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},T.contains=L.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},T.type=t,T.isFunction=e,T.isWindow=n,T.isArray=Q,T.isPlainObject=o,T.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},T.isNumeric=function(t){var e=Number(t),n=typeof t;return null!=t&&"boolean"!=n&&("string"!=n||t.length)&&!isNaN(e)&&isFinite(e)||!1},T.inArray=function(t,e,n){return O.indexOf.call(e,t,n)},T.camelCase=C,T.trim=function(t){return null==t?"":String.prototype.trim.call(t)},T.uuid=0,T.support={},T.expr={},T.noop=function(){},T.map=function(t,e){var n,r,i,o=[];if(a(t))for(r=0;r=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return O.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):T(A.call(this,function(e){return Y.matches(e,t)}))},add:function(t,e){return T(N(this.concat(T(t,e))))},is:function(t){return this.length>0&&Y.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==E)this.each(function(e){t.call(this,e)||n.push(this)});else{var r="string"==typeof t?this.filter(t):a(t)&&e(t.item)?D.call(t):T(t);this.forEach(function(t){r.indexOf(t)<0&&n.push(t)})}return T(n)},has:function(t){return this.filter(function(){return i(t)?T.contains(this,t):T(this).find(t).size()})},eq:function(t){return t===-1?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!i(t)?t:T(t)},last:function(){var t=this[this.length-1];return t&&!i(t)?t:T(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?T(t).filter(function(){var t=this;return O.some.call(n,function(e){return T.contains(e,t)})}):1==this.length?T(Y.qsa(this[0],t)):this.map(function(){return Y.qsa(this,t)}):T()},closest:function(t,e){var n=[],i="object"==typeof t&&T(t);return this.each(function(o,a){for(;a&&!(i?i.indexOf(a)>=0:Y.matches(a,t));)a=a!==e&&!r(a)&&a.parentNode;a&&n.indexOf(a)<0&&n.push(a)}),T(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=T.map(n,function(t){if((t=t.parentNode)&&!r(t)&&e.indexOf(t)<0)return e.push(t),t});return v(e,t)},parent:function(t){return v(N(this.pluck("parentNode")),t)},children:function(t){return v(this.map(function(){return p(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||D.call(this.childNodes)})},siblings:function(t){return v(this.map(function(t,e){return A.call(p(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return T.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=h(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var n=e(t);if(this[0]&&!n)var r=T(t).get(0),i=r.parentNode||this.length>1;return this.each(function(e){T(this).wrapAll(n?t.call(this,e):i?r.cloneNode(!0):r)})},wrapAll:function(t){if(this[0]){T(this[0]).before(t=T(t));for(var e;(e=t.children()).length;)t=e.first();T(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var r=T(this),i=r.contents(),o=n?t.call(this,e):t;i.length?i.wrapAll(o):r.append(o)})},unwrap:function(){return this.parent().each(function(){T(this).replaceWith(T(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=T(this);(t===E?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return T(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return T(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;T(this).empty().append(g(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=g(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this.pluck("textContent").join(""):null},attr:function(t,e){var n;return"string"!=typeof t||1 in arguments?this.each(function(n){if(1===this.nodeType)if(i(t))for(j in t)y(this,j,t[j]);else y(this,t,g(this,e,n,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(n=this[0].getAttribute(t))?n:E},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){y(this,t)},this)})},prop:function(t,e){return t=K[t]||t,1 in arguments?this.each(function(n){this[t]=g(this,e,n,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=K[t]||t,this.each(function(){delete this[t]})},data:function(t,e){var n="data-"+t.replace(q,"-$1").toLowerCase(),r=1 in arguments?this.attr(n,e):this.attr(n);return null!==r?b(r):E},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=g(this,t,e,this.value)})):this[0]&&(this[0].multiple?T(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var n=T(this),r=g(this,t,e,n.offset()),i=n.offsetParent().offset(),o={top:r.top-i.top,left:r.left-i.left};"static"==n.css("position")&&(o.position="relative"),n.css(o)});if(!this.length)return null;if(L.documentElement!==this[0]&&!T.contains(L.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,n){if(arguments.length<2){var r=this[0];if("string"==typeof e){if(!r)return;return r.style[C(e)]||getComputedStyle(r,"").getPropertyValue(e)}if(Q(e)){if(!r)return;var i={},o=getComputedStyle(r,"");return T.each(e,function(t,e){i[e]=r.style[C(e)]||o.getPropertyValue(e)}),i}}var a="";if("string"==t(e))n||0===n?a=c(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(c(e))});else for(j in e)e[j]||0===e[j]?a+=c(j)+":"+f(j,e[j])+";":this.each(function(){this.style.removeProperty(c(j))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(T(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&O.some.call(this,function(t){return this.test(x(t))},l(t))},addClass:function(t){return t?this.each(function(e){if("className"in this){S=[];var n=x(this),r=g(this,t,e,n);r.split(/\s+/g).forEach(function(t){T(this).hasClass(t)||S.push(t)},this),S.length&&x(this,n+(n?" ":"")+S.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===E)return x(this,"");S=x(this),g(this,t,e,S).split(/\s+/g).forEach(function(t){S=S.replace(l(t)," ")}),x(this,S.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var r=T(this),i=g(this,t,n,x(this));i.split(/\s+/g).forEach(function(t){(e===E?!r.hasClass(t):e)?r.addClass(t):r.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===E?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===E?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),r=Z.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(T(t).css("margin-top"))||0,n.left-=parseFloat(T(t).css("margin-left"))||0,r.top+=parseFloat(T(e[0]).css("border-top-width"))||0,r.left+=parseFloat(T(e[0]).css("border-left-width"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||L.body;t&&!Z.test(t.nodeName)&&"static"==T(t).css("position");)t=t.offsetParent;return t})}},T.fn.detach=T.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});T.fn[t]=function(i){var o,a=this[0];return i===E?n(a)?a["inner"+e]:r(a)?a.documentElement["scroll"+e]:(o=this.offset())&&o[t]:this.each(function(e){a=T(this),a.css(t,g(this,i,e,a[t]()))})}}),I.forEach(function(e,n){var r=n%2;T.fn[e]=function(){var e,i,o=T.map(arguments,function(n){var r=[];return e=t(n),"array"==e?(n.forEach(function(t){return t.nodeType!==E?r.push(t):T.zepto.isZ(t)?r=r.concat(t.get()):void(r=r.concat(Y.fragment(t)))}),r):"object"==e||null==n?n:Y.fragment(n)}),a=this.length>1;return o.length<1?this:this.each(function(t,e){i=r?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null;var s=T.contains(L.documentElement,i);o.forEach(function(t){if(a)t=t.cloneNode(!0);else if(!i)return T(t).remove();i.insertBefore(t,e),s&&w(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var e=t.ownerDocument?t.ownerDocument.defaultView:window;e.eval.call(e,t.innerHTML)}})})})},T.fn[r?e+"To":"insert"+(n?"Before":"After")]=function(t){return T(t)[e](this),this}}),Y.Z.prototype=d.prototype=T.fn,Y.uniq=N,Y.deserializeValue=b,T.zepto=Y,T}();!function(t){function e(t){return t._zid||(t._zid=h++)}function n(t,n,o,a){if(n=r(n),n.ns)var s=i(n.ns);return(v[e(t)]||[]).filter(function(t){return t&&(!n.e||t.e==n.e)&&(!n.ns||s.test(t.ns))&&(!o||e(t.fn)===e(o))&&(!a||t.sel==a)})}function r(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function i(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function o(t,e){return t.del&&!y&&t.e in x||!!e}function a(t){return b[t]||y&&x[t]||t}function s(n,i,s,u,l,h,p){var d=e(n),m=v[d]||(v[d]=[]);i.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var i=r(e);i.fn=s,i.sel=l,i.e in b&&(s=function(e){var n=e.relatedTarget;if(!n||n!==this&&!t.contains(this,n))return i.fn.apply(this,arguments)}),i.del=h;var d=h||s;i.proxy=function(t){if(t=c(t),!t.isImmediatePropagationStopped()){t.data=u;var e=d.apply(n,t._args==f?[t]:[t].concat(t._args));return e===!1&&(t.preventDefault(),t.stopPropagation()),e}},i.i=m.length,m.push(i),"addEventListener"in n&&n.addEventListener(a(i.e),i.proxy,o(i,p))})}function u(t,r,i,s,u){var c=e(t);(r||"").split(/\s/).forEach(function(e){n(t,e,i,s).forEach(function(e){delete v[c][e.i],"removeEventListener"in t&&t.removeEventListener(a(e.e),e.proxy,o(e,u))})})}function c(e,n){return!n&&e.isDefaultPrevented||(n||(n=e),t.each(T,function(t,r){var i=n[t];e[t]=function(){return this[r]=w,i&&i.apply(n,arguments)},e[r]=E}),e.timeStamp||(e.timeStamp=Date.now()),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(e.isDefaultPrevented=w)),e}function l(t){var e,n={originalEvent:t};for(e in t)j.test(e)||t[e]===f||(n[e]=t[e]);return c(n,t)}var f,h=1,p=Array.prototype.slice,d=t.isFunction,m=function(t){return"string"==typeof t},v={},g={},y="onfocusin"in window,x={focus:"focusin",blur:"focusout"},b={mouseenter:"mouseover",mouseleave:"mouseout"};g.click=g.mousedown=g.mouseup=g.mousemove="MouseEvents",t.event={add:s,remove:u},t.proxy=function(n,r){var i=2 in arguments&&p.call(arguments,2);if(d(n)){var o=function(){return n.apply(r,i?i.concat(p.call(arguments)):arguments)};return o._zid=e(n),o}if(m(r))return i?(i.unshift(n[r],n),t.proxy.apply(null,i)):t.proxy(n[r],n);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,r){return this.on(t,e,n,r,1)};var w=function(){return!0},E=function(){return!1},j=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,T={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,n,r,i,o){var a,c,h=this;return e&&!m(e)?(t.each(e,function(t,e){h.on(t,n,r,e,o)}),h):(m(n)||d(i)||i===!1||(i=r,r=n,n=f),i!==f&&r!==!1||(i=r,r=f),i===!1&&(i=E),h.each(function(f,h){o&&(a=function(t){return u(h,t.type,i),i.apply(this,arguments)}),n&&(c=function(e){var r,o=t(e.target).closest(n,h).get(0);if(o&&o!==h)return r=t.extend(l(e),{currentTarget:o,liveFired:h}),(a||i).apply(o,[r].concat(p.call(arguments,1)))}),s(h,e,i,r,n,c||a)}))},t.fn.off=function(e,n,r){var i=this;return e&&!m(e)?(t.each(e,function(t,e){i.off(t,n,e)}),i):(m(n)||d(r)||r===!1||(r=n,n=f),r===!1&&(r=E),i.each(function(){u(this,e,r,n)}))},t.fn.trigger=function(e,n){return e=m(e)||t.isPlainObject(e)?t.Event(e):c(e),e._args=n,this.each(function(){e.type in x&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,r){var i,o;return this.each(function(a,s){i=l(m(e)?t.Event(e):e),i._args=r,i.target=s,t.each(n(s,e.type||e),function(t,e){if(o=e.proxy(i),i.isImmediatePropagationStopped())return!1})}),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){m(t)||(e=t,t=e.type);var n=document.createEvent(g[t]||"Events"),r=!0;if(e)for(var i in e)"bubbles"==i?r=!!e[i]:n[i]=e[i];return n.initEvent(t,r,!0),c(n)}}(e),function(t){function e(e,n,r){var i=t.Event(n);return t(e).trigger(i,r),!i.isDefaultPrevented()}function n(t,n,r,i){if(t.global)return e(n||x,r,i)}function r(e){e.global&&0===t.active++&&n(e,null,"ajaxStart")}function i(e){e.global&&!--t.active&&n(e,null,"ajaxStop")}function o(t,e){var r=e.context;return e.beforeSend.call(r,t,e)!==!1&&n(e,r,"ajaxBeforeSend",[t,e])!==!1&&void n(e,r,"ajaxSend",[t,e])}function a(t,e,r,i){var o=r.context,a="success";r.success.call(o,t,a,e),i&&i.resolveWith(o,[t,a,e]),n(r,o,"ajaxSuccess",[e,r,t]),u(a,e,r)}function s(t,e,r,i,o){var a=i.context;i.error.call(a,r,e,t),o&&o.rejectWith(a,[r,e,t]),n(i,a,"ajaxError",[r,i,t||e]),u(e,r,i)}function u(t,e,r){var o=r.context;r.complete.call(o,e,t),n(r,o,"ajaxComplete",[e,r]),i(r)}function c(t,e,n){if(n.dataFilter==l)return t;var r=n.context;return n.dataFilter.call(r,t,e)}function l(){}function f(t){return t&&(t=t.split(";",2)[0]),t&&(t==T?"html":t==j?"json":w.test(t)?"script":E.test(t)&&"xml")||"text"}function h(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function p(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()&&"jsonp"!=e.dataType||(e.url=h(e.url,e.data),e.data=void 0)}function d(e,n,r,i){return t.isFunction(n)&&(i=r,r=n,n=void 0),t.isFunction(r)||(i=r,r=void 0),{url:e,data:n,success:r,dataType:i}}function m(e,n,r,i){var o,a=t.isArray(n),s=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),i&&(n=r?i:i+"["+(s||"object"==o||"array"==o?n:"")+"]"),!i&&a?e.add(u.name,u.value):"array"==o||!r&&"object"==o?m(e,u,r,n):e.add(n,u)})}var v,g,y=+new Date,x=window.document,b=/)<[^<]*)*<\/script>/gi,w=/^(?:text|application)\/javascript/i,E=/^(?:text|application)\/xml/i,j="application/json",T="text/html",S=/^\s*$/,C=x.createElement("a");C.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,n){if(!("type"in e))return t.ajax(e);var r,i,u=e.jsonpCallback,c=(t.isFunction(u)?u():u)||"Zepto"+y++,l=x.createElement("script"),f=window[c],h=function(e){t(l).triggerHandler("error",e||"abort")},p={abort:h};return n&&n.promise(p),t(l).on("load error",function(o,u){clearTimeout(i),t(l).off().remove(),"error"!=o.type&&r?a(r[0],p,e,n):s(null,u||"error",p,e,n),window[c]=f,r&&t.isFunction(f)&&f(r[0]),f=r=void 0}),o(p,e)===!1?(h("abort"),p):(window[c]=function(){r=arguments},l.src=e.url.replace(/\?(.+)=\?/,"?$1="+c),x.head.appendChild(l),e.timeout>0&&(i=setTimeout(function(){h("timeout")},e.timeout)),p)},t.ajaxSettings={type:"GET",beforeSend:l,success:l,error:l,complete:l,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:j,xml:"application/xml, text/xml",html:T,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:l},t.ajax=function(e){var n,i,u=t.extend({},e||{}),d=t.Deferred&&t.Deferred();for(v in t.ajaxSettings)void 0===u[v]&&(u[v]=t.ajaxSettings[v]);r(u),u.crossDomain||(n=x.createElement("a"),n.href=u.url,n.href=n.href,u.crossDomain=C.protocol+"//"+C.host!=n.protocol+"//"+n.host),u.url||(u.url=window.location.toString()),(i=u.url.indexOf("#"))>-1&&(u.url=u.url.slice(0,i)),p(u);var m=u.dataType,y=/\?.+=\?/.test(u.url);if(y&&(m="jsonp"),u.cache!==!1&&(e&&e.cache===!0||"script"!=m&&"jsonp"!=m)||(u.url=h(u.url,"_="+Date.now())),"jsonp"==m)return y||(u.url=h(u.url,u.jsonp?u.jsonp+"=?":u.jsonp===!1?"":"callback=?")),t.ajaxJSONP(u,d);var b,w=u.accepts[m],E={},j=function(t,e){E[t.toLowerCase()]=[t,e]},T=/^([\w-]+:)\/\//.test(u.url)?RegExp.$1:window.location.protocol,N=u.xhr(),O=N.setRequestHeader;if(d&&d.promise(N),u.crossDomain||j("X-Requested-With","XMLHttpRequest"),j("Accept",w||"*/*"),(w=u.mimeType||w)&&(w.indexOf(",")>-1&&(w=w.split(",",2)[0]),N.overrideMimeType&&N.overrideMimeType(w)),(u.contentType||u.contentType!==!1&&u.data&&"GET"!=u.type.toUpperCase())&&j("Content-Type",u.contentType||"application/x-www-form-urlencoded"),u.headers)for(g in u.headers)j(g,u.headers[g]);if(N.setRequestHeader=j,N.onreadystatechange=function(){if(4==N.readyState){N.onreadystatechange=l,clearTimeout(b);var e,n=!1;if(N.status>=200&&N.status<300||304==N.status||0==N.status&&"file:"==T){if(m=m||f(u.mimeType||N.getResponseHeader("content-type")),"arraybuffer"==N.responseType||"blob"==N.responseType)e=N.response;else{e=N.responseText;try{e=c(e,m,u),"script"==m?(0,eval)(e):"xml"==m?e=N.responseXML:"json"==m&&(e=S.test(e)?null:t.parseJSON(e))}catch(r){n=r}if(n)return s(n,"parsererror",N,u,d)}a(e,N,u,d)}else s(N.statusText||null,N.status?"error":"abort",N,u,d)}},o(N,u)===!1)return N.abort(),s(null,"abort",N,u,d),N;var P=!("async"in u)||u.async;if(N.open(u.type,u.url,P,u.username,u.password),u.xhrFields)for(g in u.xhrFields)N[g]=u.xhrFields[g];for(g in E)O.apply(N,E[g]);return u.timeout>0&&(b=setTimeout(function(){N.onreadystatechange=l,N.abort(),s(null,"timeout",N,u,d)},u.timeout)),N.send(u.data?u.data:null),N},t.get=function(){return t.ajax(d.apply(null,arguments))},t.post=function(){var e=d.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=d.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,r){if(!this.length)return this;var i,o=this,a=e.split(/\s/),s=d(e,n,r),u=s.success;return a.length>1&&(s.url=a[0],i=a[1]),s.success=function(e){o.html(i?t("
            ").html(e.replace(b,"")).find(i):e),u&&u.apply(o,arguments)},t.ajax(s),this};var N=encodeURIComponent;t.param=function(e,n){var r=[];return r.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(N(e)+"="+N(n))},m(r,e,n),r.join("&").replace(/%20/g,"+")}}(e),function(t){t.fn.serializeArray=function(){var e,n,r=[],i=function(t){return t.forEach?t.forEach(i):void r.push({name:e,value:t})};return this[0]&&t.each(this[0].elements,function(r,o){n=o.type,e=o.name,e&&"fieldset"!=o.nodeName.toLowerCase()&&!o.disabled&&"submit"!=n&&"reset"!=n&&"button"!=n&&"file"!=n&&("radio"!=n&&"checkbox"!=n||o.checked)&&i(t(o).val())}),r},t.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")},t.fn.submit=function(e){if(0 in arguments)this.bind("submit",e);else if(this.length){var n=t.Event("submit");this.eq(0).trigger(n),n.isDefaultPrevented()||this.get(0).submit()}return this}}(e),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t,n){try{return e(t,n)}catch(r){return null}}}}(),t("zepto",e)});layui.define(["layer-mobile","zepto"],function(e){"use strict";var t=layui.zepto,a=layui["layer-mobile"],i=(layui.device(),"layui-upload-enter"),n="layui-upload-iframe",r={icon:2,shift:6},o={file:"文件",video:"视频",audio:"音频"};a.msg=function(e){return a.open({content:e||"",skin:"msg",time:2})};var s=function(e){this.options=e};s.prototype.init=function(){var e=this,a=e.options,r=t("body"),s=t(a.elem||".layui-upload-file"),u=t('');return t("#"+n)[0]||r.append(u),s.each(function(r,s){s=t(s);var u='
            ',l=s.attr("lay-type")||a.type;a.unwrap||(u='
            '+u+''+(s.attr("lay-title")||a.title||"上传"+(o[l]||"图片"))+"
            "),u=t(u),a.unwrap||u.on("dragover",function(e){e.preventDefault(),t(this).addClass(i)}).on("dragleave",function(){t(this).removeClass(i)}).on("drop",function(){t(this).removeClass(i)}),s.parent("form").attr("target")===n&&(a.unwrap?s.unwrap():(s.parent().next().remove(),s.unwrap().unwrap())),s.wrap(u),s.off("change").on("change",function(){e.action(this,l)})})},s.prototype.action=function(e,i){var o=this,s=o.options,u=e.value,l=t(e),p=l.attr("lay-ext")||s.ext||"";if(u){switch(i){case"file":if(p&&!RegExp("\\w\\.("+p+")$","i").test(escape(u)))return a.msg("不支持该文件格式",r),e.value="";break;case"video":if(!RegExp("\\w\\.("+(p||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(u)))return a.msg("不支持该视频格式",r),e.value="";break;case"audio":if(!RegExp("\\w\\.("+(p||"mp3|wav|mid")+")$","i").test(escape(u)))return a.msg("不支持该音频格式",r),e.value="";break;default:if(!RegExp("\\w\\.("+(p||"jpg|png|gif|bmp|jpeg")+")$","i").test(escape(u)))return a.msg("不支持该图片格式",r),e.value=""}s.before&&s.before(e),l.parent().submit();var c=t("#"+n),f=setInterval(function(){var t;try{t=c.contents().find("body").text()}catch(i){a.msg("上传接口存在跨域",r),clearInterval(f)}if(t){clearInterval(f),c.contents().find("body").html("");try{t=JSON.parse(t)}catch(i){return t={},a.msg("请对上传接口返回JSON字符",r)}"function"==typeof s.success&&s.success(t,e)}},30);e.value=""}},e("upload-mobile",function(e){var t=new s(e=e||{});t.init()})});layui.define(["laytpl","upload-mobile","layer-mobile","zepto"],function(i){var e="2.1.0",a=layui.zepto,t=layui.laytpl,n=layui["layer-mobile"],l=layui["upload-mobile"],s=layui.device(),o="layui-show",c="layim-this",d=20,r={},u=function(){this.v=e,m(a("body"),"*[layim-event]",function(i){var e=a(this),t=e.attr("layim-event");U[t]?U[t].call(this,e,i):""})},m=function(i,e,t){var n,l="function"==typeof e,s=function(i){var e=a(this);e.data("lock")||(n||t.call(this,i),n=!1,e.data("lock","true"),setTimeout(function(){e.removeAttr("data-lock")},e.data("locktime")||0))};return l&&(t=e),i="string"==typeof i?a(i):i,y?void(l?i.on("touchmove",function(){n=!0}).on("touchend",s):i.on("touchmove",e,function(){n=!0}).on("touchend",e,s)):void(l?i.on("click",s):i.on("click",e,s))},y=/Android|iPhone|SymbianOS|Windows Phone|iPad|iPod/.test(navigator.userAgent);n.popBottom=function(i){n.close(n.popBottom.index),n.popBottom.index=n.open(a.extend({type:1,content:i.content||"",shade:!1,className:"layim-layer"},i))},u.prototype.config=function(i){i=i||{},i=a.extend({title:"我的IM",isgroup:0,isNewFriend:!0,voice:"default.mp3",chatTitleColor:"#36373C"},i),k(i)},u.prototype.on=function(i,e){return"function"==typeof e&&(r[i]?r[i].push(e):r[i]=[e]),this},u.prototype.chat=function(i){if(window.JSON&&window.JSON.parse)return L(i,-1),this},u.prototype.panel=function(i){return N(i)},u.prototype.cache=function(){return C},u.prototype.getMessage=function(i){return M(i),this},u.prototype.addList=function(i){return O(i),this},u.prototype.removeList=function(i){return Y(i),this},u.prototype.setFriendStatus=function(i,e){var t=a(".layim-friend"+i);t["online"===e?"removeClass":"addClass"]("layim-list-gray")},u.prototype.setChatStatus=function(i){var e=A(),a=e.elem.find(".layim-chat-status");return a.html(i),this},u.prototype.showNew=function(i,e){I(i,e)},u.prototype.content=function(i){return layui.data.content(i)};var p=function(i){var e={friend:"该分组下暂无好友",group:"暂无群组",history:"暂无任何消息"};return i=i||{},"history"===i.type&&(i.item=i.item||"d.sortHistory"),["{{# var length = 0; layui.each("+i.item+", function(i, data){ length++; }}",'
          • {{ data.username||data.groupname||data.name||"佚名" }}

            {{ data.remark||data.sign||"" }}

            new
          • ',"{{# }); if(length === 0){ }}",'
          • '+(e[i.type]||"暂无数据")+"
          • ","{{# } }}"].join("")},f=function(i,e,a){return['
            ','
            ',"

            ",a?'':"",'{{ d.title || d.base.title }}',"{{# if(d.data){ }}",'{{# if(d.data.type === "group"){ }}','',"{{# } }}","{{# } }}","

            ","
            ",'
            ',i,"
            ","
            "].join("")},h=['
            ','
            ','
              ','
                ',p({type:"history"}),"
              ","
            ","
            ",'
            ','
              ',"{{# if(d.base.isNewFriend){ }}",'
            • 新的朋友
            • ',"{{# } if(d.base.isgroup){ }}",'
            • 群聊
            • ',"{{# } }}","
            ",'
              ','{{# layui.each(d.friend, function(index, item){ var spread = d.local["spread"+index]; }}',"
            • ",'
              {{# if(spread === "true"){ }}{{# } else { }}{{# } }}{{ item.groupname||"未命名分组"+index }}( {{ (item.list||[]).length }})
              ','
                ',p({type:"friend",item:"item.list",index:"index"}),"
              ","
            • ","{{# }); if(d.friend.length === 0){ }}",'
              • 暂无联系人
              ',"{{# } }}","
            ","
            ",'
            ','
              ',"{{# layui.each(d.base.moreList, function(index, item){ }}",'
            • ','{{item.iconUnicode||""}}{{item.title}}',"
            • ","{{# }); if(!d.base.copyright){ }}",'
            • 关于
            • ',"{{# } }}","
            ","
            ","
            ",'
              ','
            • 消息
            • ','
            • 联系人
            • ','
            • 更多
            • ',"
            "].join(""),v=['
            ','
            ',"
              ","
              ",'","
              "].join(""),g=function(i){return i<10?"0"+(0|i):i};layui.data.date=function(i){var e=new Date(i||new Date);return g(e.getMonth()+1)+"-"+g(e.getDate())+" "+g(e.getHours())+":"+g(e.getMinutes())},layui.data.content=function(i){var e=function(i){return new RegExp("\\n*\\["+(i||"")+"(pre|div|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)\\]\\n*","g")};return i=(i||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(/@(\S+)(\s+?|$)/g,'@$1$2').replace(/face\[([^\s\[\]]+?)\]/g,function(i){var e=i.replace(/^face/g,"");return''+e+''}).replace(/img\[([^\s]+?)\]/g,function(i){return''}).replace(/file\([\s\S]+?\)\[[\s\S]*?\]/g,function(i){var e=(i.match(/file\(([\s\S]+?)\)\[/)||[])[1],a=(i.match(/\)\[([\s\S]*?)\]/)||[])[1];return e?''+(a||e)+"":i}).replace(/audio\[([^\s]+?)\]/g,function(i){return'

              音频消息

              '}).replace(/video\[([^\s]+?)\]/g,function(i){return'
              '}).replace(/a\([\s\S]+?\)\[[\s\S]*?\]/g,function(i){var e=(i.match(/a\(([\s\S]+?)\)\[/)||[])[1],a=(i.match(/\)\[([\s\S]*?)\]/)||[])[1];return e?''+(a||e)+"":i}).replace(e(),"<$1 $2>").replace(e("/"),"").replace(/\n/g,"
              ")};var b,x,w=['
            • ','
              ','{{ d.username||"佚名" }}',"
              ",'
              {{ layui.data.content(d.content||" ") }}
              ',"
            • "].join(""),C={message:{},chat:[]},k=function(i){var e=i.init||{};return mine=e.mine||{},local=layui.data("layim-mobile")[mine.id]||{},obj={base:i,local:local,mine:mine,history:local.history||[]},create=function(e){var n=e.mine||{},l=layui.data("layim-mobile")[n.id]||{},s={base:i,local:l,mine:n,friend:e.friend||[],group:e.group||[],history:l.history||[]};s.sortHistory=j(s.history,"historyTime"),C=a.extend(C,s),S(t(f(h)).render(s)),layui.each(r.ready,function(i,e){e&&e(s)})},C=a.extend(C,obj),i.brief?layui.each(r.ready,function(i,e){e&&e(obj)}):void create(e)},S=function(i){return n.open({type:1,shade:!1,shadeClose:!1,anim:-1,content:i,success:function(i){b=a(i),T(b.find(".layui-layim")),C.base.tabIndex&&U.tab(a(".layui-layim-tab>li").eq(C.base.tabIndex))}})},N=function(i,e){i=i||{};var l=a.extend({},C,{title:i.title||"",data:i.data});return n.open({type:1,shade:!1,shadeClose:!1,anim:-1,content:t(f(i.tpl,e!==-1,!0)).render(l),success:function(e){var t=a(e);t.prev().find(".layim-panel").addClass("layui-m-anim-lout"),i.success&&i.success(e),i.isChat||T(t.find(".layim-content"))},end:i.end})},L=function(i,e,t){return i=i||{},i.id?(n.close(L.index),L.index=N({tpl:v,data:i,title:i.name,isChat:!0,success:function(e){x=a(e),B(),$(),delete C.message[i.type+i.id],I("Msg");var t=A(),n=t.elem.find(".layim-chat-main");layui.each(r.chatChange,function(i,e){e&&e(t)}),T(n),t.textarea.on("focus",function(){setTimeout(function(){n.scrollTop(n[0].scrollHeight+1e3)},500)})},end:function(){x=null,q.time=0}},e)):n.msg("非法用户")},T=function(i){s.ios&&i.on("touchmove",function(e){var a=i.scrollTop();a<=0&&(i.scrollTop(1),e.preventDefault(e)),this.scrollHeight-a-i.height()<=0&&(i.scrollTop(i.scrollTop()-1),e.preventDefault(e))})},A=function(){if(!x)return{};var i=x.find(".layim-chat"),e=JSON.parse(decodeURIComponent(i.find(".layim-chat-tool").data("json")));return{elem:i,data:e,textarea:i.find("input")}},j=function(i,e,a){var t=[],n=function(i,a){var t=i[e],n=a[e];return nt?1:0};return layui.each(i,function(i,e){t.push(e)}),t.sort(n),a&&t.reverse(),t},H=function(i){var e=layui.data("layim-mobile")[C.mine.id]||{},a={},n=e.history||{};n[i.type+i.id];if(b){var l=b.find(".layim-list-history");i.historyTime=(new Date).getTime(),i.sign=i.content,n[i.type+i.id]=i,e.history=n,layui.data("layim-mobile",{key:C.mine.id,value:e});var s=l.find(".layim-"+i.type+i.id),c=(C.message[i.type+i.id]||[]).length,d=function(){s=l.find(".layim-"+i.type+i.id),s.find("p").html(i.content),c>0&&s.find(".layim-msg-status").html(c).addClass(o)};if(s.length>0)d(),l.prepend(s.clone()),s.remove();else{a[i.type+i.id]=i;var r=t(p({type:"history",item:"d.data"})).render({data:a});l.prepend(r),d(),l.find(".layim-null").remove()}I("Msg")}},I=function(i,e){if(!e){var e;layui.each(C.message,function(){return e=!0,!1})}a("#LAY_layimNew"+i)[e?"addClass":"removeClass"](o)},q=function(){var i={username:C.mine?C.mine.username:"访客",avatar:C.mine?C.mine.avatar:layui.cache.dir+"css/pc/layim/skin/logo.jpg",id:C.mine?C.mine.id:null,mine:!0},e=A(),a=e.elem.find(".layim-chat-main ul"),l=e.data,s=C.base.maxLength||3e3,o=(new Date).getTime(),c=e.textarea;if(i.content=c.val(),""!==i.content){if(i.content.length>s)return n.msg("内容最长不能超过"+s+"个字符");o-(q.time||0)>6e4&&(a.append('
            • '+layui.data.date()+"
            • "),q.time=o),a.append(t(w).render(i));var d={mine:i,to:l},u={username:d.mine.username,avatar:d.mine.avatar,id:l.id,type:l.type,content:d.mine.content,timestamp:o,mine:!0};F(u),layui.each(r.sendMessage,function(i,e){e&&e(d)}),l.content=i.content,H(l),J(),c.val(""),c.next().addClass("layui-disabled")}},_=function(){var i=document.createElement("audio");i.src=layui.cache.dir+"css/modules/layim/voice/"+C.base.voice,i.play()},D={},M=function(i){i=i||{};var e={},n=A(),l=n.data||{},s=l.id==i.id&&l.type==i.type;i.timestamp=i.timestamp||(new Date).getTime(),i.system||F(i),D=JSON.parse(JSON.stringify(i)),C.base.voice&&_(),(!x&&i.content||!s)&&(C.message[i.type+i.id]?C.message[i.type+i.id].push(i):C.message[i.type+i.id]=[i]);var e={};if("friend"===i.type){var o;layui.each(C.friend,function(e,a){if(layui.each(a.list,function(e,a){if(a.id==i.id)return i.type="friend",i.name=a.username,o=!0}),o)return!0}),o||(i.temporary=!0)}else"group"===i.type?layui.each(C.group,function(a,t){if(t.id==i.id)return i.type="group",i.name=i.groupname=t.groupname,e.avatar=t.avatar,!0}):i.name=i.name||i.username||i.groupname;var c=a.extend({},i,{avatar:e.avatar||i.avatar});if("group"===i.type&&delete c.username,H(c),x&&s){var d=x.find(".layim-chat"),r=d.find(".layim-chat-main ul");i.system?r.append('
            • '+i.content+"
            • "):""!==i.content.replace(/\s/g,"")&&(i.timestamp-(q.time||0)>6e4&&(r.append('
            • '+layui.data.date(i.timestamp)+"
            • "),q.time=i.timestamp),r.append(t(w).render(i))),J()}},F=function(i){var e=layui.data("layim-mobile")[C.mine.id]||{},a=e.chatlog||{};a[i.type+i.id]?(a[i.type+i.id].push(i),a[i.type+i.id].length>d&&a[i.type+i.id].shift()):a[i.type+i.id]=[i],e.chatlog=a,layui.data("layim-mobile",{key:C.mine.id,value:e})},$=function(){var i=layui.data("layim-mobile")[C.mine.id]||{},e=A(),a=i.chatlog||{},n=e.elem.find(".layim-chat-main ul");layui.each(a[e.data.type+e.data.id],function(i,e){(new Date).getTime()>e.timestamp&&e.timestamp-(q.time||0)>6e4&&(n.append('
            • '+layui.data.date(e.timestamp)+"
            • "),q.time=e.timestamp),n.append(t(w).render(e))}),J()},O=function(i){var e,a={},l=b.find(".layim-list-"+i.type);if(C[i.type])if("friend"===i.type)layui.each(C.friend,function(t,l){if(i.groupid==l.id)return layui.each(C.friend[t].list,function(a,t){if(t.id==i.id)return e=!0}),e?n.msg("好友 ["+(i.username||"")+"] 已经存在列表中",{anim:6}):(C.friend[t].list=C.friend[t].list||[],a[C.friend[t].list.length]=i,i.groupIndex=t,C.friend[t].list.push(i),!0)});else if("group"===i.type){if(layui.each(C.group,function(a,t){if(t.id==i.id)return e=!0}),e)return n.msg("您已是 ["+(i.groupname||"")+"] 的群成员",{anim:6});a[C.group.length]=i,C.group.push(i)}if(!e){var s=t(p({type:i.type,item:"d.data",index:"friend"===i.type?"data.groupIndex":null})).render({data:a});if("friend"===i.type){var o=l.children("li").eq(i.groupIndex);o.find(".layui-layim-list").append(s),o.find(".layim-count").html(C.friend[i.groupIndex].list.length),o.find(".layim-null")[0]&&o.find(".layim-null").remove()}else"group"===i.type&&(l.append(s),l.find(".layim-null")[0]&&l.find(".layim-null").remove())}},Y=function(i){var e=b.find(".layim-list-"+i.type);C[i.type]&&("friend"===i.type?layui.each(C.friend,function(a,t){layui.each(t.list,function(t,n){if(i.id==n.id){var l=e.children("li").eq(a);l.find(".layui-layim-list").children("li");return l.find(".layui-layim-list").children("li").eq(t).remove(),C.friend[a].list.splice(t,1),l.find(".layim-count").html(C.friend[a].list.length),0===C.friend[a].list.length&&l.find(".layui-layim-list").html('
            • 该分组下已无好友了
            • '),!0}})}):"group"===i.type&&layui.each(C.group,function(a,t){if(i.id==t.id)return e.children("li").eq(a).remove(),C.group.splice(a,1),0===C.group.length&&e.html('
            • 暂无群组
            • '),!0}))},J=function(){var i=A(),e=i.elem.find(".layim-chat-main"),a=e.find("ul"),t=a.children(".layim-chat-li");if(t.length>=d){var n=t.eq(0);n.prev().remove(),a.prev().hasClass("layim-chat-system")||a.before('
              查看更多记录
              '),n.remove()}e.scrollTop(e[0].scrollHeight+1e3)},B=function(){var i=A(),e=i.textarea,a=e.next();e.off("keyup").on("keyup",function(i){var t=i.keyCode;13===t&&(i.preventDefault(),q()),a[""===e.val()?"addClass":"removeClass"]("layui-disabled")})},E=function(){var i=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],e={};return layui.each(i,function(i,a){e[a]=layui.cache.dir+"images/face/"+i+".gif"}),e}(),P=layui.stope,R=function(i,e,a){var t,n=i.value;a||i.focus(),document.selection?(t=document.selection.createRange(),document.selection.empty(),t.text=e):(t=[n.substring(0,i.selectionStart),e,n.substr(i.selectionEnd)],a||i.focus(),i.value=t.join(""))},U={chat:function(i){var e=layui.data("layim-mobile")[C.mine.id]||{},t=i.data("type"),n=i.data("index"),l=i.attr("data-list")||i.index(),s={};"friend"===t?s=C[t][n].list[l]:"group"===t?s=C[t][l]:"history"===t&&(s=(e.history||{})[n]||{}),s.name=s.name||s.username||s.groupname,"history"!==t&&(s.type=t),L(s,!0),a(".layim-"+s.type+s.id).find(".layim-msg-status").removeClass(o)},spread:function(i){var e=i.attr("lay-type"),a="true"===e?"false":"true",t=layui.data("layim-mobile")[C.mine.id]||{};i.next()["true"===e?"removeClass":"addClass"](o),t["spread"+i.parent().index()]=a,layui.data("layim-mobile",{key:C.mine.id,value:t}),i.attr("lay-type",a),i.find(".layui-icon").html("true"===a?"":"")},tab:function(i){var e=i.index(),a=".layim-tab-content";i.addClass(c).siblings().removeClass(c),b.find(a).eq(e).addClass(o).siblings(a).removeClass(o)},back:function(i){var e=i.parents(".layui-m-layer").eq(0),a=e.attr("index"),t=".layim-panel";setTimeout(function(){n.close(a)},300),i.parents(t).eq(0).removeClass("layui-m-anim-left").addClass("layui-m-anim-rout"),e.prev().find(t).eq(0).removeClass("layui-m-anim-lout").addClass("layui-m-anim-right"),layui.each(r.back,function(i,e){setTimeout(function(){e&&e()},200)})},send:function(){q()},face:function(i,e){var t="",l=A(),s=l.textarea;layui.each(E,function(i,e){t+='
            • '}),t='
                '+t+"
              ",n.popBottom({content:t,success:function(i){var e=a(i).find(".layui-layim-face").children("li");m(e,function(){return R(s[0],"face"+this.title+" ",!0),s.next()[""===s.val()?"addClass":"removeClass"]("layui-disabled"),!1})}});var o=a(document);y?o.off("touchend",U.faceHide).on("touchend",U.faceHide):o.off("click",U.faceHide).on("click",U.faceHide),P(e)},faceHide:function(){n.close(n.popBottom.index),a(document).off("touchend",U.faceHide).off("click",U.faceHide)},image:function(i){var e=i.data("type")||"images",a={images:"uploadImage",file:"uploadFile"},t=A(),s=C.base[a[e]]||{};l({url:s.url||"",method:s.type,elem:i.find("input")[0],unwrap:!0,type:e,success:function(i){0==i.code?(i.data=i.data||{},"images"===e?R(t.textarea[0],"img["+(i.data.src||"")+"]"):"file"===e&&R(t.textarea[0],"file("+(i.data.src||"")+")["+(i.data.name||"下载文件")+"]"),q()):n.msg(i.msg||"上传失败")}})},extend:function(i){var e=i.attr("lay-filter"),a=A();layui.each(r["tool("+e+")"],function(e,t){t&&t.call(i,function(i){R(a.textarea[0],i)},q,a)})},newFriend:function(){layui.each(r.newFriend,function(i,e){e&&e()})},group:function(){N({title:"群聊",tpl:['
              ',p({type:"group",item:"d.group"}),"
              "].join(""),data:{}})},detail:function(){var i=A();layui.each(r.detail,function(e,a){a&&a(i.data)})},playAudio:function(i){var e=i.data("audio"),a=e||document.createElement("audio"),t=function(){a.pause(),i.removeAttr("status"),i.find("i").html("")};return i.data("error")?n.msg("播放音频源异常"):a.play?void(i.attr("status")?t():(e||(a.src=i.data("src")),a.play(),i.attr("status","pause"),i.data("audio",a),i.find("i").html(""),a.onended=function(){t()},a.onerror=function(){n.msg("播放音频源异常"),i.data("error",!0),t()})):n.msg("您的浏览器不支持audio")},playVideo:function(i){var e=i.data("src"),a=document.createElement("video");return a.play?(n.close(U.playVideo.index),void(U.playVideo.index=n.open({type:1,anim:!1,style:"width: 100%; height: 50%;",content:'
              '}))):n.msg("您的浏览器不支持video")},chatLog:function(i){var e=A();layui.each(r.chatlog,function(i,a){a&&a(e.data,e.elem.find(".layim-chat-main>ul"))})},moreList:function(i){var e=i.attr("lay-filter");layui.each(r.moreList,function(i,a){a&&a({alias:e})})},about:function(){n.open({content:'

              LayIM属于付费产品,欢迎通过官网获得授权,促进良性发展!

              当前版本:layim mobile v'+e+'

              版权所有:layim.layui.com

              ',className:"layim-about",shadeClose:!1,btn:"我知道了"})}};i("layim-mobile",new u)}).addcss("modules/layim/mobile/layim.css?v=2.10","skinlayim-mobilecss");layui["layui.mobile"]||layui.config({base:layui.cache.dir+"lay/modules/mobile/"}).extend({"layer-mobile":"layer-mobile",zepto:"zepto","upload-mobile":"upload-mobile","layim-mobile":"layim-mobile"}),layui.define(["layer-mobile","zepto","layim-mobile"],function(l){l("mobile",{layer:layui["layer-mobile"],layim:layui["layim-mobile"]})}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/table.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;layui.define(["laytpl","laypage","layer","form"],function(e){"use strict";var t=layui.$,i=layui.laytpl,a=layui.laypage,l=layui.layer,n=layui.form,o=layui.hint(),r=layui.device(),d={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,s,e,t)}},c=function(){var e=this,t=e.config,i=t.id;return i&&(c.config[i]=t),{reload:function(t){e.reload.call(e,t)},config:t}},s="table",u=".layui-table",f="layui-hide",h="layui-table-view",y=".layui-table-header",p=".layui-table-body",m=".layui-table-main",v=".layui-table-fixed",g=".layui-table-fixed-l",x=".layui-table-fixed-r",b=".layui-table-tool",k=".layui-table-sort",w="layui-table-edit",C="layui-table-hover",z=function(e){return e=e||{},['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),"{{# if(item2.checkbox){ }}",'',"{{# } else if(item2.space){ }}",'',"{{# } else { }}",'","{{# }; }}",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
              ',"{{# if(item2.colspan > 1){ }}",'
              ','{{item2.title||""}}',"
              ","{{# } else { }}",'
              ','{{item2.title||""}}',"{{# if(item2.sort){ }}",'',"{{# } }}","
              ","{{# } }}","
              "].join("")},F=['',"","
              "].join(""),N=['
              ',"{{# var left, right; }}",'
              ',z(),"
              ",'
              ',F,"
              ","{{# if(left){ }}",'
              ','
              ',z({fixed:!0}),"
              ",'
              ',F,"
              ","
              ","{{# }; }}","{{# if(right){ }}",'
              ','
              ',z({fixed:"right"}),'
              ',"
              ",'
              ',F,"
              ","
              ","{{# }; }}","{{# if(d.data.page){ }}",'
              ','
              ',"
              ","{{# } }}","","
              "].join(""),T=t(window),S=t(document),A=function(e){var i=this;i.index=++d.index,i.config=t.extend({},i.config,d.config,e),i.render()};A.prototype.config={limit:30,loading:!0},A.prototype.render=function(e){var a,l=this;if(e&&(l.config=e),a=l.config,a.elem=t(a.elem),a.where=a.where||{},a.request=t.extend({pageName:"page",limitName:"limit"},a.request),a.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",countName:"count"},a.response),!a.elem[0])return l;var n=a.elem,o=n.next("."+h);a.height&&/^full-\d+$/.test(a.height)&&(l.fullHeightGap=a.height.split("-")[1],a.height=T.height()-l.fullHeightGap);var r=l.elem=t(i(N).render({VIEW_CLASS:h,data:a,index:l.index}));if(a.index=l.index,o[0]&&o.remove(),n.after(r),l.layHeader=r.find(y),l.layMain=r.find(m),l.layBody=r.find(p),l.layFixed=r.find(v),l.layFixLeft=r.find(g),l.layFixRight=r.find(x),l.layTool=r.find(b),a.height&&l.fullSize(),a.cols.length>1){var d=l.layFixed.find(y).find("th");d.height(l.layHeader.height()-1-parseFloat(d.css("padding-top"))-parseFloat(d.css("padding-bottom")))}l.pullData(1),l.events()},A.prototype.reload=function(e){var i=this;i.config=t.extend({},i.config,e),i.render()},A.prototype.pullData=function(e,i){var a=this,n=a.config,o=n.request,r=n.response,d=function(){"object"==typeof n.initSort&&a.sort(n.initSort.field,n.initSort.type)};if(n.url){var c={};c[o.pageName]=e,c[o.limitName]=n.limit,t.ajax({type:n.method||"get",url:n.url,data:t.extend(c,n.where),dataType:"json",success:function(t){return t[r.statusName]!=r.statusCode?(a.renderForm(),a.layMain.html('
              '+(t[r.msgName]||"返回的数据状态异常")+"
              ")):(a.renderData(t,e,t[r.countName]),d(),i&&l.close(i),void("function"==typeof n.done&&n.done(t,e,t[r.countName])))},error:function(e,t){a.layMain.html('
              数据接口请求异常
              '),a.renderForm(),i&&l.close(i)}})}else if(n.data&&n.data.constructor===Array){var s={},u=e*n.limit-n.limit;s[r.dataName]=n.data.concat().splice(u,n.limit),s[r.countName]=n.data.length,a.renderData(s,e,n.data.length),d(),"function"==typeof n.done&&n.done(s,e,s[r.countName])}},A.prototype.page=1,A.prototype.eachCols=function(e){layui.each(this.config.cols,function(t,i){layui.each(i,function(a,l){e(a,l,[t,i])})})},A.prototype.renderData=function(e,n,o,r){var c=this,s=c.config,u=e[s.response.dataName]||[],f=[],h=[],y=[],p=function(){return!r&&c.sortKey?c.sort(c.sortKey.field,c.sortKey.sort,!0):(layui.each(u,function(e,a){var l=[],n=[],o=[];0!==a.length&&(r||(a[d.config.indexName]=e),c.eachCols(function(e,r){var c=a[r.field||e];if(void 0!==c&&null!==c||(c=""),!(r.colspan>1)){var u=['",'
              '+function(){return r.checkbox?'":r.toolbar?i(t(r.toolbar).html()||"").render(a):r.templet?i(t(r.templet).html()||String(c)).render(a):c}(),"
              "].join("");l.push(u),r.fixed&&"right"!==r.fixed&&n.push(u),"right"===r.fixed&&o.push(u)}}),f.push(''+l.join("")+""),h.push(''+n.join("")+""),y.push(''+o.join("")+""))}),c.layBody.scrollTop(0),c.layMain.find("tbody").html(f.join("")),c.layFixLeft.find("tbody").html(h.join("")),c.layFixRight.find("tbody").html(y.join("")),c.renderForm(),c.syncCheckAll(),c.haveInit?c.scrollPatch():setTimeout(function(){c.scrollPatch()},50),c.haveInit=!0,void l.close(c.tipsIndex))};return c.key=s.id||s.index,d.cache[c.key]=u,r?p():0===u.length?(c.renderForm(),c.layFixed.remove(),c.layMain.html('
              无数据
              ')):(p(),void(s.page&&(c.page=n,c.count=o,a.render({elem:"layui-table-page"+s.index,count:o,groups:3,limits:s.limits||[10,20,30,40,50,60,70,80,90],limit:s.limit,curr:n,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(c.page=e.curr,s.limit=e.limit,c.pullData(e.curr,c.loading()))}}),c.layTool.find(".layui-table-count span").html(o))))},A.prototype.renderForm=function(e){n.render(e||"checkbox","LAY-table-"+this.index)},A.prototype.sort=function(e,i,a,n){var r,c,u=this,f=u.config,h=f.elem.attr("lay-filter"),y=d.cache[u.key];"string"==typeof e&&u.layHeader.find("th").each(function(i,a){var l=t(this),n=l.data("field");if(n===e)return e=l,r=n,!1});try{var r=r||e.data("field");if(u.sortKey&&!a&&r===u.sortKey.field&&i===u.sortKey.sort)return;var p=u.layHeader.find("th .laytable-cell-"+f.index+"-"+r).find(k);u.layHeader.find("th").find(k).removeAttr("lay-sort"),p.attr("lay-sort",i||null),u.layFixed.find("th")}catch(m){return o.error("Table modules: Did not match to field")}u.sortKey={field:r,sort:i},"asc"===i?c=layui.sort(y,r):"desc"===i?c=layui.sort(y,r,!0):(c=layui.sort(y,d.config.indexName),delete u.sortKey),u.renderData({data:c},u.page,u.count,!0),l.close(u.tipsIndex),n&&layui.event.call(e,s,"sort("+h+")",{field:r,type:i})},A.prototype.loading=function(){var e=this,t=e.config;if(t.loading&&t.url)return l.msg("数据请求中",{icon:16,offset:[e.elem.offset().top+e.elem.height()/2-35-T.scrollTop()+"px",e.elem.offset().left+e.elem.width()/2-90-T.scrollLeft()+"px"],anim:-1,fixed:!1})},A.prototype.setCheckData=function(e,t){var i=this,a=i.config,l=d.cache[i.key];l[e]&&(l[e][a.checkName]=t)},A.prototype.syncCheckAll=function(){var e=this,t=e.config,i=e.layHeader.find('input[name="layTableCheckbox"]'),a=function(i){return e.eachCols(function(e,a){a.checkbox&&(a[t.checkName]=i)}),i};i[0]&&(d.checkStatus(e.key).isAll?(i[0].checked||(i.prop("checked",!0),e.renderForm()),a(!0)):(i[0].checked&&(i.prop("checked",!1),e.renderForm()),a(!1)))},A.prototype.getCssRule=function(e,t){var i=this,a=i.elem.find("style")[0],l=a.sheet||a.styleSheet,n=l.cssRules||l.rules;layui.each(n,function(a,l){if(l.selectorText===".laytable-cell-"+i.index+"-"+e)return t(l),!0})},A.prototype.fullSize=function(){var e,t=this,i=t.config,a=i.height;t.fullHeightGap&&(a=T.height()-t.fullHeightGap,a<135&&(a=135),t.elem.css("height",a)),e=parseFloat(a)-parseFloat(t.layHeader.height())-1,i.page&&(e-=parseFloat(t.layTool.outerHeight()+1)),t.layMain.css("height",e)},A.prototype.scrollPatch=function(){var e=this,i=e.layMain.children("table"),a=e.layMain.width()-e.layMain.prop("clientWidth"),l=e.layMain.height()-e.layMain.prop("clientHeight");if(a&&l){if(!e.elem.find(".layui-table-patch")[0]){var n=t('
              ');n.find("div").css({width:a}),e.layHeader.eq(0).find("thead tr").append(n)}}else e.layHeader.eq(0).find(".layui-table-patch").remove();var o=e.layMain.height(),r=o-l;e.layFixed.find(p).css("height",i.height()>r?r:"auto"),e.layFixRight[i.width()>e.layMain.width()?"removeClass":"addClass"](f),e.layFixRight.css("right",a-1)},A.prototype.events=function(){var e,a=this,n=a.config,o=t("body"),c={},u=a.layHeader.find("th"),f=".layui-table-cell",h=n.elem.attr("lay-filter");u.on("mousemove",function(e){var i=t(this),a=i.offset().left,l=e.clientX-a;i.attr("colspan")>1||i.attr("unresize")||c.resizeStart||(c.allowResize=i.width()-l<=10,o.css("cursor",c.allowResize?"col-resize":""))}).on("mouseleave",function(){t(this);c.resizeStart||o.css("cursor","")}).on("mousedown",function(e){if(c.allowResize){var i=t(this).data("field");e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],a.getCssRule(i,function(e){c.rule=e,c.ruleWidth=parseFloat(e.style.width)})}}),S.on("mousemove",function(t){if(c.resizeStart){if(t.preventDefault(),c.rule){var i=c.ruleWidth+t.clientX-c.offset[0];c.rule.style.width=i+"px",l.close(a.tipsIndex)}e=1}}).on("mouseup",function(t){c.resizeStart&&(c={},o.css("cursor",""),a.scrollPatch()),2===e&&(e=null)}),u.on("click",function(){var i,l=t(this),n=l.find(k),o=n.attr("lay-sort");return n[0]&&1!==e?(i="asc"===o?"desc":"desc"===o?null:"asc",void a.sort(l,i,null,!0)):e=2}).find(k+" .layui-edge ").on("click",function(e){var i=t(this),l=i.index(),n=i.parents("th").eq(0).data("field");layui.stope(e),0===l?a.sort(n,"asc",null,!0):a.sort(n,"desc",null,!0)}),a.elem.on("click",'input[name="layTableCheckbox"]+',function(){var e=t(this).prev(),i=a.layBody.find('input[name="layTableCheckbox"]'),l=e.parents("tr").eq(0).data("index"),n=e[0].checked,o="layTableAllChoose"===e.attr("lay-filter");o?(i.each(function(e,t){t.checked=n,a.setCheckData(e,n)}),a.syncCheckAll(),a.renderForm()):(a.setCheckData(l,n),a.syncCheckAll()),layui.event.call(this,s,"checkbox("+h+")",{checked:n,data:d.cache[a.key][l],type:o?"all":"one"})}),a.layBody.on("mouseenter","tr",function(){var e=t(this),i=e.index();a.layBody.find("tr:eq("+i+")").addClass(C)}).on("mouseleave","tr",function(){var e=t(this),i=e.index();a.layBody.find("tr:eq("+i+")").removeClass(C)}),a.layBody.on("change","."+w,function(){var e=t(this),i=this.value,l=e.parent().data("field"),n=e.parents("tr").eq(0).data("index"),o=d.cache[a.key][n];o[l]=i,layui.event.call(this,s,"edit("+h+")",{value:i,data:o,field:l})}).on("blur","."+w,function(){var e,l=t(this),n=l.parent().data("field"),o=l.parents("tr").eq(0).data("index"),r=d.cache[a.key][o];a.eachCols(function(t,i){i.field==n&&i.templet&&(e=i.templet)}),l.siblings(f).html(e?i(t(e).html()||this.value).render(r):this.value),l.parent().data("content",this.value),l.remove()}),a.layBody.on("click","td",function(){var e=t(this),i=(e.data("field"),e.children(f));if(!e.data("off")){if(e.data("edit")){var o=t('');return o[0].value=e.data("content")||i.text(),e.find("."+w)[0]||e.append(o),o.focus()}i.prop("scrollWidth")>i.outerWidth()&&(a.tipsIndex=l.tips(['
              ',i.html(),"
              ",''].join(""),i[0],{tips:[3,""],time:-1,anim:-1,maxWidth:r.ios||r.android?300:600,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){l.close(t)})}}))}}),a.layBody.on("click","*[lay-event]",function(){var e=t(this),l=e.parents("tr").eq(0).data("index"),n=a.layBody.find('tr[data-index="'+l+'"]'),o="layui-table-click",r=d.cache[a.key][l];layui.event.call(this,s,"tool("+h+")",{data:d.clearCacheKey(r),event:e.attr("lay-event"),tr:n,del:function(){d.cache[a.key][l]=[],n.remove(),a.scrollPatch()},update:function(e){e=e||{},layui.each(e,function(e,l){if(e in r){var o,d=n.children('td[data-field="'+e+'"]');r[e]=l,a.eachCols(function(t,i){i.field==e&&i.templet&&(o=i.templet)}),d.children(f).html(o?i(t(o).html()||l).render(r):l),d.data("content",l)}})}}),n.addClass(o).siblings("tr").removeClass(o)}),a.layMain.on("scroll",function(){var e=t(this),i=e.scrollLeft(),n=e.scrollTop();a.layHeader.scrollLeft(i),a.layFixed.find(p).scrollTop(n),l.close(a.tipsIndex)}),T.on("resize",function(){a.fullSize(),a.scrollPatch()})},d.init=function(e,i){i=i||{};var a=this,l=t(e?'table[lay-filter="'+e+'"]':u+"[lay-data]"),n="Table element property lay-data configuration item has a syntax error: ";return l.each(function(){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){o.error(n+l)}var c=[],s=t.extend({elem:this,cols:[],data:[],skin:a.attr("lay-skin"),size:a.attr("lay-size"),even:"string"==typeof a.attr("lay-even")},d.config,i,l);e&&a.hide(),a.find("thead>tr").each(function(e){s.cols[e]=[],t(this).children().each(function(i){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){return o.error(n+l)}var d=t.extend({title:a.text(),colspan:a.attr("colspan")||null,rowspan:a.attr("rowspan")||null},l);d.field&&c.push(d),s.cols[e].push(d)})}),a.find("tbody>tr").each(function(e){var i=t(this),a={};i.children("td").each(function(e,i){var l=t(this),n=l.data("field");if(n)return a[n]=l.html()}),layui.each(c,function(e,t){var l=i.children("td").eq(e);a[t.field]=l.html()}),s.data[e]=a}),d.render(s)}),a},d.checkStatus=function(e){var t=0,i=[],a=d.cache[e];return a?(layui.each(a,function(e,a){a[d.config.checkName]&&(t++,i.push(d.clearCacheKey(a)))}),{data:i,isAll:t===a.length}):{}},c.config={},d.reload=function(e,i){var a=c.config[e];return a?d.render(t.extend({},a,i)):o.error("The ID option was not found in the table instance")},d.render=function(e){var t=new A(e);return c.call(t)},d.clearCacheKey=function(e){return e=t.extend({},e),delete e[d.config.checkName],delete e[d.config.indexName],e},d.init(),e(s,d)}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/tree.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('
                '),s=o(["
              • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
              • "].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('
                '));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/upload.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;layui.define("layer",function(e){"use strict";var i=layui.$,t=layui.layer,n=layui.hint(),a=layui.device(),o={config:{},set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,r,e,i)}},l=function(){var e=this;return{upload:function(i){e.upload.call(e,i)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",s="layui-upload-iframe",f="layui-upload-choose",p=function(e){var t=this;t.config=i.extend({},t.config,o.config,e),t.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",method:"post",data:{},drag:!0,size:0,multiple:!1},p.prototype.render=function(e){var t=this,e=t.config;e.elem=i(e.elem),e.bindAction=i(e.bindAction),t.file(),t.events()},p.prototype.file=function(){var e=this,t=e.config,n=e.elemFile=i(['"].join("")),o=t.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&t.elem.wrap('
                '),e.isFile()?(e.elemFile=t.elem,t.field=t.elem[0].name):t.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,t=e.config,n=i(''),a=i(['
                ',"
                "].join(""));i("#"+s)[0]||i("body").append(n),t.elem.next().hasClass(s)||(e.elemFile.wrap(a),t.elem.next("."+s).append(function(){var e=[];return layui.each(t.data,function(i,t){e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return t.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var i=this;window.FileReader&&layui.each(i.chooseFiles,function(i,t){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){e&&e(i,t,this.result)}})},p.prototype.upload=function(e,t){var n,o=this,l=o.config,r=o.elemFile[0],u=function(){layui.each(e||o.files||o.chooseFiles||r.files,function(e,t){var n=new FormData;n.append(l.field,t),layui.each(l.data,function(e,i){n.append(e,i)}),i.ajax({url:l.url,type:l.method,data:n,contentType:!1,processData:!1,dataType:"json",success:function(i){d(e,i)},error:function(){o.msg("请求上传接口出现异常"),m(e)}})})},c=function(){var e=i("#"+s);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var i,t=e.contents().find("body");try{i=t.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}i&&(clearInterval(p.timer),t.html(""),d(0,i))},30)},d=function(e,i){if(o.elemFile.next("."+f).remove(),r.value="","object"!=typeof i)try{i=JSON.parse(i)}catch(t){return i={},o.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(i,e||0,function(e){o.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){o.upload(e)})},v=l.exts,h=function(){var i=[];return layui.each(e||o.chooseFiles,function(e,t){i.push(t.name)}),i}(),g={preview:function(e){o.preview(e)},upload:function(e,i){var t={};t[e]=i,o.upload(t)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,i){o.files[e]=i}),o.files}},y=function(){return"choose"===t?l.choose&&l.choose(g):(l.before&&l.before(g),a.ie?a.ie>9?u():c():void u())};switch(h=0===h.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":h,l.accept){case"file":if(v&&!RegExp("\\w\\.("+v+")$","i").test(escape(h)))return o.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(v||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(h)))return o.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(v||"mp3|wav|mid")+")$","i").test(escape(h)))return o.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(h,function(e,i){RegExp("\\w\\.("+(v||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(i))||(n=!0)}),n)return o.msg("选择的图片中包含不支持的格式"),r.value=""}if(l.size>0&&!(a.ie&&a.ie<10)){var F;if(layui.each(o.chooseFiles,function(e,i){if(i.size>1024*l.size){var t=l.size/1024;t=t>=1?Math.floor(t)+(t%1>0?t.toFixed(1):0)+"MB":l.size+"KB",r.value="",F=t}}),F)return o.msg("文件不能超过"+F)}y()},p.prototype.events=function(){var e=this,t=e.config,o=function(i){e.chooseFiles={},layui.each(i,function(i,t){var n=(new Date).getTime();e.chooseFiles[n+"-"+i]=t})},l=function(i,n){var a=e.elemFile,o=i.length>1?i.length+"个文件":(i[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(f)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||t.choose||a.after(''+o+"")};t.elem.off("upload.start").on("upload.start",function(){var a=i(this),o=a.attr("lay-data");if(o)try{o=new Function("return "+o)(),e.config=i.extend({},t,o)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+o)}e.config.item=a,e.elemFile[0].click()}),a.ie&&a.ie<10||t.elem.off("upload.over").on("upload.over",function(){var e=i(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=i(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,a){var r=i(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),t.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var i=this.files||[];o(i),t.auto?e.upload():l(i)}),t.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),t.elem.data("haveEvents")||(e.elemFile.on("change",function(){i(this).trigger("upload.change")}),t.elem.on("click",function(){e.isFile()||i(this).trigger("upload.start")}),t.drag&&t.elem.on("dragover",function(e){e.preventDefault(),i(this).trigger("upload.over")}).on("dragleave",function(e){i(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),i(this).trigger("upload.drop",e)}),t.bindAction.on("click",function(){i(this).trigger("upload.action")}),t.elem.data("haveEvents",!0))},o.render=function(e){var i=new p(e);return l.call(i)},e(r,o)}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/lay/modules/util.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;layui.define("jquery",function(e){"use strict";var o=layui.$,t={fixbar:function(e){var t,a,i="layui-fixbar",l="layui-fixbar-top",r=o(document),c=o("body");e=o.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var n=[e.bar1,e.bar2,""],u=o(['
                  ',e.bar1?'
                • '+n[0]+"
                • ":"",e.bar2?'
                • '+n[1]+"
                • ":"",'
                • '+n[2]+"
                • ","
                "].join("")),s=u.find("."+l),b=function(){var o=r.scrollTop();o>=e.showHeight?t||(s.show(),t=1):t&&(s.hide(),t=0)};o("."+i)[0]||("object"==typeof e.css&&u.css(e.css),c.append(u),b(),u.find("li").on("click",function(){var t=o(this),a=t.attr("lay-type");"top"===a&&o("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,a)}),r.on("scroll",function(){clearTimeout(a),a=setTimeout(function(){b()},100)}))},countdown:function(e,o,t){var a=this,i="function"==typeof o,l=new Date(e).getTime(),r=new Date(!o||i?(new Date).getTime():o).getTime(),c=l-r,n=[Math.floor(c/864e5),Math.floor(c/36e5)%24,Math.floor(c/6e4)%60,Math.floor(c/1e3)%60];i&&(t=o);var u=setTimeout(function(){a.countdown(e,r+1e3,t)},1e3);return t&&t(c>0?n:[0,0,0,0],o,u),c<=0&&clearTimeout(u),u},timeAgo:function(e,o){var t=(new Date).getTime()-new Date(e).getTime();return t>2592e6?(t=new Date(e).toLocaleString(),o&&(t=t.replace(/\s[\S]+$/g,"")),t):t>=864e5?(t/1e3/60/60/24|0)+"天前":t>=36e5?(t/1e3/60/60|0)+"小时前":t>=18e4?(t/1e3/60|0)+"分钟前":t<0?"未来":"刚刚"}};e("util",t)}); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/layui.all.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.1.3"},r=function(){var e=t.scripts,o=e[e.length-1].src;return o.substring(0,o.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",util:"modules/util",flow:"modules/flow",carousel:"modules/carousel",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};n.prototype.cache=o,n.prototype.define=function(e,t){var n=this,r="function"==typeof e,a=function(){return"function"==typeof t&&t(function(e,t){layui[e]=t,o.status[e]=!0}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?a.call(n):(n.use(e,a),n)},n.prototype.use=function(e,n,l){function s(e,t){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||n.test((e.currentTarget||e.srcElement).readyState))&&(o.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*o.timeout/4?a(f+" is not a valid module"):void(o.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),n,l):"function"==typeof n&&n.apply(layui,l)}var y=this,p=o.dir=o.dir?o.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,o){"jquery"===o&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],o.host=o.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(o.modules[f])!function g(){return++m>1e3*o.timeout/4?a(f+" is not a valid module"):void("string"==typeof o.modules[f]&&o.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":o.base||"")+(y.modules[f]||f)+".js";v.async=!0,v.charset="utf-8",v.src=h+function(){var e=o.version===!0?o.v||(new Date).getTime():o.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||i?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),o.modules[f]=h}return y},n.prototype.getStyle=function(t,o){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](o)},n.prototype.link=function(e,n,r){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof n&&(r=n);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(o.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof n?i:(function p(){return++y>1e3*o.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(c),"width"))?function(){n()}():setTimeout(p,100))}(),i)},n.prototype.addcss=function(e,t,n){return layui.link(o.dir+"css/"+e,t,n)},n.prototype.img=function(e,t,o){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,o(e)}))},n.prototype.config=function(e){e=e||{};for(var t in e)o[t]=e[t];return this},n.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),n.prototype.extend=function(e){var t=this;e=e||{};for(var o in e)t[o]||t.modules[o]?a("模块名 "+o+" 已被占用"):t.modules[o]=e[o];return t},n.prototype.router=function(e){var t=this,e=e||location.hash,o={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,"").replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),o.search[t[0]]=t[1]}():o.path.push(t)}),o):o},n.prototype.data=function(t,o){if(t=t||"layui",e.JSON&&e.JSON.parse){if(null===o)return delete localStorage[t];o="object"==typeof o?o:{key:o};try{var n=JSON.parse(localStorage[t])}catch(r){var n={}}return o.value&&(n[o.key]=o.value),o.remove&&delete n[o.key],localStorage[t]=JSON.stringify(n),o.key?n[o.key]:n}},n.prototype.device=function(t){var o=navigator.userAgent.toLowerCase(),n=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(o.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(o)?"windows":/linux/.test(o)?"linux":/iphone|ipod|ipad|ios/.test(o)?"ios":/mac/.test(o)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((o.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:n("micromessenger")};return t&&!r[t]&&(r[t]=n(t)),r.android=/android/.test(o),r.ios="ios"===r.os,r},n.prototype.hint=function(){return{error:a}},n.prototype.each=function(e,t){var o,n=this;if("function"!=typeof t)return n;if(e=e||[],e.constructor===Object){for(o in e)if(t.call(e[o],o,e[o]))break}else for(o=0;oa?1:r/g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var n="Laytpl Error:";return"object"==typeof console&&console.error(n+e+"\n"+(r||"")),n+e}},c=n.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=c("^"+r.open+"#",""),l=c(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(c(r.open+"#"),r.open+"# ").replace(c(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(/(?="|')/g,"\\").replace(n.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(n.query(1),function(e){var n='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(c(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),n='"+_escape_('),n+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,n.escape)}catch(u){return delete o.cache,n.error(u,p)}},t.pt.render=function(e,r){var c,t=this;return e?(c=t.cache?t.cache(e,n.escape):t.parse(t.tpl,e),r?void r(c):c):n.error("no data")};var o=function(e){return"string"!=typeof e?n.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var n in e)r[n]=e[n]},o.v="1.2.0",e("laytpl",o)});layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),skip:function(){return['到第','','页',""].join("")}()};return['
                ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
                "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});!function(){"use strict";var e=window.layui&&layui.define,t={getPath:function(){var e=document.scripts,t=e[e.length-1],n=t.src;if(!t.getAttribute("merge"))return n.substring(0,n.lastIndexOf("/")+1)}(),getStyle:function(e,t){var n=e.currentStyle?e.currentStyle:window.getComputedStyle(e,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(e,a,i){if(n.path){var r=document.getElementsByTagName("head")[0],o=document.createElement("link");"string"==typeof a&&(i=a);var s=(i||e).replace(/\.|\//g,""),l="layuicss-"+s,d=0;o.rel="stylesheet",o.href=n.path+e,o.id=l,document.getElementById(l)||r.appendChild(o),"function"==typeof a&&!function c(){return++d>80?window.console&&console.error("laydate.css: Invalid"):void(1989===parseInt(t.getStyle(document.getElementById(l),"width"))?a():setTimeout(c,100))}()}}},n={v:"5.0.6",config:{},index:window.laydate&&window.laydate.v?1e5:0,path:t.getPath,set:function(e){var n=this;return n.config=t.extend({},n.config,e),n},ready:function(a){var i="laydate",r="",o=(e?"modules/laydate/":"theme/")+"default/laydate.css?v="+n.v+r;return"function"==typeof define&&define.amd?a():(e?layui.addcss(o,a,i):t.link(o,a,i),this)}},a=function(){var e=this;return{hint:function(t){e.hint.call(e,t)},config:e.config}},i="laydate",r=".layui-laydate",o="layui-this",s="laydate-disabled",l="开始日期超出了结束日期
                建议重新选择",d=[100,2e5],c="layui-laydate-static",m="layui-laydate-list",u="laydate-selected",h="layui-laydate-hint",y="laydate-day-prev",f="laydate-day-next",p="layui-laydate-footer",g=".laydate-btns-confirm",v="laydate-time-text",D=".laydate-btns-time",T=function(e){var t=this;t.index=++n.index,t.config=w.extend({},t.config,n.config,e),n.ready(function(){t.init()})},w=function(e){return new C(e)},C=function(e){for(var t=0,n="object"==typeof e?[e]:(this.selector=e,document.querySelectorAll(e||null));t0)return n[0].getAttribute(e)}():n.each(function(n,a){a.setAttribute(e,t)})},C.prototype.removeAttr=function(e){return this.each(function(t,n){n.removeAttribute(e)})},C.prototype.html=function(e){return this.each(function(t,n){n.innerHTML=e})},C.prototype.val=function(e){return this.each(function(t,n){n.value=e})},C.prototype.append=function(e){return this.each(function(t,n){"object"==typeof e?n.appendChild(e):n.innerHTML=n.innerHTML+e})},C.prototype.remove=function(e){return this.each(function(t,n){e?n.removeChild(e):n.parentNode.removeChild(n)})},C.prototype.on=function(e,t){return this.each(function(n,a){a.attachEvent?a.attachEvent("on"+e,function(e){e.target=e.srcElement,t.call(a,e)}):a.addEventListener(e,t,!1)})},C.prototype.off=function(e,t){return this.each(function(n,a){a.detachEvent?a.detachEvent("on"+e,t):a.removeEventListener(e,t,!1)})},T.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},T.prototype.config={type:"date",range:!1,format:"yyyy-MM-dd",value:null,min:"1900-1-1",max:"2099-12-31",trigger:"focus",show:!1,showBottom:!0,btns:["clear","now","confirm"],lang:"cn",theme:"default",position:null,calendar:!1,mark:{},zIndex:null,done:null,change:null},T.prototype.lang=function(){var e=this,t=e.config,n={cn:{weeks:["日","一","二","三","四","五","六"],time:["时","分","秒"],timeTips:"选择时间",startTime:"开始时间",endTime:"结束时间",dateTips:"返回日期",month:["一","二","三","四","五","六","七","八","九","十","十一","十二"],tools:{confirm:"确定",clear:"清空",now:"现在"}},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"}}};return n[t.lang]||n.cn},T.prototype.init=function(){var e=this,t=e.config,n="yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s",a="static"===t.position,i={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};t.elem=w(t.elem),t.eventElem=w(t.eventElem),t.elem[0]&&(t.range===!0&&(t.range="-"),t.format===i.date&&(t.format=i[t.type]),e.format=t.format.match(new RegExp(n+"|.","g"))||[],e.EXP_IF="",e.EXP_SPLIT="",w.each(e.format,function(t,a){var i=new RegExp(n).test(a)?"\\d{"+function(){return new RegExp(n).test(e.format[0===t?t+1:t-1]||"")?/^yyyy|y$/.test(a)?4:a.length:/^yyyy$/.test(a)?"1,4":/^y$/.test(a)?"1,308":"1,2"}()+"}":"\\"+a;e.EXP_IF=e.EXP_IF+i,e.EXP_SPLIT=e.EXP_SPLIT+"("+i+")"}),e.EXP_IF=new RegExp("^"+(t.range?e.EXP_IF+"\\s\\"+t.range+"\\s"+e.EXP_IF:e.EXP_IF)+"$"),e.EXP_SPLIT=new RegExp("^"+e.EXP_SPLIT+"$",""),e.isInput(t.elem[0])||"focus"===t.trigger&&(t.trigger="click"),t.elem.attr("lay-key")||(t.elem.attr("lay-key",e.index),t.eventElem.attr("lay-key",e.index)),t.mark=w.extend({},t.calendar&&"cn"===t.lang?{"0-1-1":"元旦","0-2-14":"情人","0-3-8":"妇女","0-3-12":"植树","0-4-1":"愚人","0-5-1":"劳动","0-5-4":"青年","0-6-1":"儿童","0-9-10":"教师","0-9-18":"国耻","0-10-1":"国庆","0-12-25":"圣诞"}:{},t.mark),w.each(["min","max"],function(e,n){var a=[],i=[];if("number"==typeof t[n]){var r=t[n],o=(new Date).getTime(),s=864e5,l=new Date(r?r0)return!0;var a=w.elem("div",{"class":"layui-laydate-header"}),i=[function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-y"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-prev-m"});return e.innerHTML="",e}(),function(){var e=w.elem("div",{"class":"laydate-set-ym"}),t=w.elem("span"),n=w.elem("span");return e.appendChild(t),e.appendChild(n),e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-m"});return e.innerHTML="",e}(),function(){var e=w.elem("i",{"class":"layui-icon laydate-icon laydate-next-y"});return e.innerHTML="",e}()],d=w.elem("div",{"class":"layui-laydate-content"}),c=w.elem("table"),m=w.elem("thead"),u=w.elem("tr");w.each(i,function(e,t){a.appendChild(t)}),m.appendChild(u),w.each(new Array(6),function(e){var t=c.insertRow(0);w.each(new Array(7),function(a){if(0===e){var i=w.elem("th");i.innerHTML=n.weeks[a],u.appendChild(i)}t.insertCell(a)})}),c.insertBefore(m,c.children[0]),d.appendChild(c),r[e]=w.elem("div",{"class":"layui-laydate-main laydate-main-list-"+e}),r[e].appendChild(a),r[e].appendChild(d),o.push(i),s.push(d),l.push(c)}),w(d).html(function(){var e=[],i=[];return"datetime"===t.type&&e.push(''+n.timeTips+""),w.each(t.btns,function(e,r){var o=n.tools[r]||"btn";t.range&&"now"===r||(a&&"clear"===r&&(o="cn"===t.lang?"重置":"Reset"),i.push(''+o+""))}),e.push('"),e.join("")}()),w.each(r,function(e,t){i.appendChild(t)}),t.showBottom&&i.appendChild(d),/^#/.test(t.theme)){var m=w.elem("style"),u=["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,e.elemID).replace(/{{theme}}/g,t.theme);"styleSheet"in m?(m.setAttribute("type","text/css"),m.styleSheet.cssText=u):m.innerHTML=u,w(i).addClass("laydate-theme-molv"),i.appendChild(m)}e.remove(T.thisElem),a?t.elem.append(i):(document.body.appendChild(i),e.position()),e.checkDate().calendar(),e.changeEvent(),T.thisElem=e.elemID,"function"==typeof t.ready&&t.ready(w.extend({},t.dateTime,{month:t.dateTime.month+1}))},T.prototype.remove=function(e){var t=this,n=(t.config,w("#"+(e||t.elemID)));return n[0]&&!n.hasClass(c)&&t.checkDate(function(){n.remove()}),t},T.prototype.position=function(){var e=this,t=e.config,n=e.bindElem||t.elem[0],a=n.getBoundingClientRect(),i=e.elem.offsetWidth,r=e.elem.offsetHeight,o=function(e){return e=e?"scrollLeft":"scrollTop",document.body[e]|document.documentElement[e]},s=function(e){return document.documentElement[e?"clientWidth":"clientHeight"]},l=5,d=a.left,c=a.bottom;d+i+l>s("width")&&(d=s("width")-i-l),c+r+l>s()&&(c=a.top>r?a.top-r:s()-r,c-=2*l),t.position&&(e.elem.style.position=t.position),e.elem.style.left=d+("fixed"===t.position?0:o(1))+"px",e.elem.style.top=c+("fixed"===t.position?0:o())+"px"},T.prototype.hint=function(e){var t=this,n=(t.config,w.elem("div",{"class":h}));n.innerHTML=e||"",w(t.elem).find("."+h).remove(),t.elem.appendChild(n),clearTimeout(t.hinTimer),t.hinTimer=setTimeout(function(){w(t.elem).find("."+h).remove()},3e3)},T.prototype.getAsYM=function(e,t,n){return n?t--:t++,t<0&&(t=11,e--),t>11&&(t=0,e++),[e,t]},T.prototype.systemDate=function(e){var t=e||new Date;return{year:t.getFullYear(),month:t.getMonth(),date:t.getDate(),hours:e?e.getHours():0,minutes:e?e.getMinutes():0,seconds:e?e.getSeconds():0}},T.prototype.checkDate=function(e){var t,a,i=this,r=(new Date,i.config),o=r.dateTime=r.dateTime||i.systemDate(),s=i.bindElem||r.elem[0],l=(i.isInput(s)?"val":"html",i.isInput(s)?s.value:"static"===r.position?"":s.innerHTML),c=function(e){e.year>d[1]&&(e.year=d[1],a=!0),e.month>11&&(e.month=11,a=!0),e.hours>23&&(e.hours=0,a=!0),e.minutes>59&&(e.minutes=0,e.hours++,a=!0),e.seconds>59&&(e.seconds=0,e.minutes++,a=!0),t=n.getEndDate(e.month+1,e.year),e.date>t&&(e.date=t,a=!0)},m=function(e,t,n){var o=["startTime","endTime"];t=(t.match(i.EXP_SPLIT)||[]).slice(1),n=n||0,r.range&&(i[o[n]]=i[o[n]]||{}),w.each(i.format,function(s,l){var c=parseFloat(t[s]);t[s].length必须遵循下述格式:
                "+(r.range?r.format+" "+r.range+" "+r.format:r.format)+"
                已为你重置"),a=!0):l&&l.constructor===Date?r.dateTime=i.systemDate(l):(r.dateTime=i.systemDate(),delete i.startState,delete i.endState,delete i.startDate,delete i.endDate,delete i.startTime,delete i.endTime),c(o),a&&l&&i.setValue(r.range?i.endDate?i.parse():"":i.parse()),e&&e(),i)},T.prototype.mark=function(e,t){var n,a=this,i=a.config;return w.each(i.mark,function(e,a){var i=e.split("-");i[0]!=t[0]&&0!=i[0]||i[1]!=t[1]&&0!=i[1]||i[2]!=t[2]||(n=a||t[2])}),n&&e.html(''+n+""),a},T.prototype.limit=function(e,t,n,a){var i,r=this,o=r.config,l={},d=o[n>41?"endDate":"dateTime"],c=w.extend({},d,t||{});return w.each({now:c,min:o.min,max:o.max},function(e,t){l[e]=r.newDate(w.extend({year:t.year,month:t.month,date:t.date},function(){var e={};return w.each(a,function(n,a){e[a]=t[a]}),e}())).getTime()}),i=l.nowl.max,e&&e[i?"addClass":"removeClass"](s),i},T.prototype.calendar=function(e){var t,a,i,r=this,s=r.config,l=e||s.dateTime,c=new Date,m=r.lang(),u="date"!==s.type&&"datetime"!==s.type,h=e?1:0,y=w(r.table[h]).find("td"),f=w(r.elemHeader[h][2]).find("span");if(l.yeard[1]&&(l.year=d[1],r.hint("最高只能支持到公元"+d[1]+"年")),r.firstDate||(r.firstDate=w.extend({},l)),c.setFullYear(l.year,l.month,1),t=c.getDay(),a=n.getEndDate(l.month,l.year),i=n.getEndDate(l.month+1,l.year),w.each(y,function(e,n){var d=[l.year,l.month],c=0;n=w(n),n.removeAttr("class"),e=t&&e=n.firstDate.year&&(r.month=a.max.month,r.date=a.max.date),n.limit(w(i),r,t),M++}),w(u[f?0:1]).attr("lay-ym",M-8+"-"+T[1]).html(b+p+" - "+(M-1+p))}else if("month"===e)w.each(new Array(12),function(e){var i=w.elem("li",{"lay-ym":e}),s={year:T[0],month:e};e+1==T[1]&&w(i).addClass(o),i.innerHTML=r.month[e]+(f?"月":""),d.appendChild(i),T[0]=n.firstDate.year&&(s.date=a.max.date),n.limit(w(i),s,t)}),w(u[f?0:1]).attr("lay-ym",T[0]+"-"+T[1]).html(T[0]+p);else if("time"===e){var E=function(){w(d).find("ol").each(function(e,a){w(a).find("li").each(function(a,i){n.limit(w(i),[{hours:a},{hours:n[x].hours,minutes:a},{hours:n[x].hours,minutes:n[x].minutes,seconds:a}][e],t,[["hours"],["hours","minutes"],["hours","minutes","seconds"]][e])})}),a.range||n.limit(w(n.footer).find(g),n[x],0,["hours","minutes","seconds"])};a.range?n[x]||(n[x]={hours:0,minutes:0,seconds:0}):n[x]=i,w.each([24,60,60],function(e,t){var a=w.elem("li"),i=["

                "+r.time[e]+"

                  "];w.each(new Array(t),function(t){i.push(""+w.digit(t,2)+"")}),a.innerHTML=i.join("")+"
                ",d.appendChild(a)}),E()}if(y&&h.removeChild(y),h.appendChild(d),"year"===e||"month"===e)w(n.elemMain[t]).addClass("laydate-ym-show"),w(d).find("li").on("click",function(){var r=0|w(this).attr("lay-ym");if(!w(this).hasClass(s)){if(0===t)i[e]=r,l&&(n.startDate[e]=r),n.limit(w(n.footer).find(g),null,0);else if(l)n.endDate[e]=r;else{var c="year"===e?n.getAsYM(r,T[1]-1,"sub"):n.getAsYM(T[0],r,"sub");w.extend(i,{year:c[0],month:c[1]})}"year"===a.type||"month"===a.type?(w(d).find("."+o).removeClass(o),w(this).addClass(o),"month"===a.type&&"year"===e&&(n.listYM[t][0]=r,l&&(n[["startDate","endDate"][t]].year=r),n.list("month",t))):(n.checkDate("limit").calendar(),n.closeList()),n.setBtnStatus(),a.range||n.done(null,"change"),w(n.footer).find(D).removeClass(s)}});else{var S=w.elem("span",{"class":v}),k=function(){w(d).find("ol").each(function(e){var t=this,a=w(t).find("li");t.scrollTop=30*(n[x][C[e]]-2),t.scrollTop<=0&&a.each(function(e,n){if(!w(this).hasClass(s))return t.scrollTop=30*(e-2),!0})})},H=w(c[2]).find("."+v);k(),S.innerHTML=a.range?[r.startTime,r.endTime][t]:r.timeTips,w(n.elemMain[t]).addClass("laydate-time-show"),H[0]&&H.remove(),c[2].appendChild(S),w(d).find("ol").each(function(e){var t=this;w(t).find("li").on("click",function(){var r=0|this.innerHTML;w(this).hasClass(s)||(a.range?n[x][C[e]]=r:i[C[e]]=r,w(t).find("."+o).removeClass(o),w(this).addClass(o),E(),k(),(n.endDate||"time"===a.type)&&n.done(null,"change"),n.setBtnStatus())})})}return n},T.prototype.listYM=[],T.prototype.closeList=function(){var e=this;e.config;w.each(e.elemCont,function(t,n){w(this).find("."+m).remove(),w(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show")}),w(e.elem).find("."+v).remove()},T.prototype.setBtnStatus=function(e,t,n){var a,i=this,r=i.config,o=w(i.footer).find(g),d=r.range&&"date"!==r.type&&"time"!==r.type;d&&(t=t||i.startDate,n=n||i.endDate,a=i.newDate(t).getTime()>i.newDate(n).getTime(),i.limit(null,t)||i.limit(null,n)?o.addClass(s):o[a?"addClass":"removeClass"](s),e&&a&&i.hint("string"==typeof e?l.replace(/日期/g,e):l))},T.prototype.parse=function(e,t){var n=this,a=n.config,i=t||(e?w.extend({},n.endDate,n.endTime):a.range?w.extend({},n.startDate,n.startTime):a.dateTime),r=n.format.concat();return w.each(r,function(e,t){/yyyy|y/.test(t)?r[e]=w.digit(i.year,t.length):/MM|M/.test(t)?r[e]=w.digit(i.month+1,t.length):/dd|d/.test(t)?r[e]=w.digit(i.date,t.length):/HH|H/.test(t)?r[e]=w.digit(i.hours,t.length):/mm|m/.test(t)?r[e]=w.digit(i.minutes,t.length):/ss|s/.test(t)&&(r[e]=w.digit(i.seconds,t.length))}),a.range&&!e?r.join("")+" "+a.range+" "+n.parse(1):r.join("")},T.prototype.newDate=function(e){return new Date(e.year||1,e.month||0,e.date||1,e.hours||0,e.minutes||0,e.seconds||0)},T.prototype.setValue=function(e){var t=this,n=t.config,a=t.bindElem||n.elem[0],i=t.isInput(a)?"val":"html";return"static"===n.position||w(a)[i](e||""),this},T.prototype.stampRange=function(){var e,t,n=this,a=n.config,i=w(n.elem).find("td");if(a.range&&!n.endDate&&w(n.footer).find(g).addClass(s),n.endDate)return e=n.newDate({year:n.startDate.year,month:n.startDate.month,date:n.startDate.date}).getTime(),t=n.newDate({year:n.endDate.year,month:n.endDate.month,date:n.endDate.date}).getTime(),e>t?n.hint(l):void w.each(i,function(a,i){var r=w(i).attr("lay-ymd").split("-"),s=n.newDate({year:r[0],month:r[1]-1,date:r[2]}).getTime();w(i).removeClass(u+" "+o),s!==e&&s!==t||w(i).addClass(w(i).hasClass(y)||w(i).hasClass(f)?u:o),s>e&&s0&&t-1 in e)}function r(e,t,n){if(pe.isFunction(t))return pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return pe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Ce.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,function(e){return pe.inArray(e,t)>-1!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(De)||[],function(e,n){t[n]=!0}),t}function a(){re.addEventListener?(re.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s)):(re.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(re.addEventListener||"load"===e.event.type||"complete"===re.readyState)&&(a(),pe.ready())}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(_e,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:qe.test(n)?pe.parseJSON(n):n)}catch(i){}pe.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(He(e)){var i,o,a=pe.expando,s=e.nodeType,u=s?pe.cache:e,l=s?e[a]:e[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof t)return l||(l=s?e[a]=ne.pop()||pe.guid++:a),u[l]||(u[l]=s?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(r?u[l]=pe.extend(u[l],t):u[l].data=pe.extend(u[l].data,t)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[pe.camelCase(t)])):i=o,i}}function f(e,t,n){if(He(e)){var r,i,o=e.nodeType,a=o?pe.cache:e,s=o?e[pe.expando]:pe.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){pe.isArray(t)?t=t.concat(pe.map(t,pe.camelCase)):t in r?t=[t]:(t=pe.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!l(r):!pe.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?pe.cleanData([e],!0):fe.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function d(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},u=s(),l=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==l&&+u)&&Me.exec(pe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,pe.style(e,t,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function p(e){var t=ze.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||pe.nodeName(r,t)?o.push(r):pe.merge(o,h(r,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function g(e,t){for(var n,r=0;null!=(n=e[r]);r++)pe._data(n,"globalEval",!t||pe._data(t[r],"globalEval"))}function m(e){Be.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t,n,r,i){for(var o,a,s,u,l,c,f,d=e.length,y=p(t),v=[],x=0;x"!==f[1]||Ve.test(a)?0:u:u.firstChild,o=a&&a.childNodes.length;o--;)pe.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(pe.merge(v,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=y.lastChild}else v.push(t.createTextNode(a));for(u&&y.removeChild(u),fe.appendChecked||pe.grep(h(v,"input"),m),x=0;a=v[x++];)if(r&&pe.inArray(a,r)>-1)i&&i.push(a);else if(s=pe.contains(a.ownerDocument,a),u=h(y.appendChild(a),"script"),s&&g(u),n)for(o=0;a=u[o++];)Ie.test(a.type||"")&&n.push(a);return u=null,y}function v(){return!0}function x(){return!1}function b(){try{return re.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=x;else if(!i)return e;return 1===o&&(a=i,i=function(e){return pe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function T(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function C(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function E(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function N(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,r,i,o=pe._data(e),a=pe._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r1&&"string"==typeof p&&!fe.checkClone&&rt.test(p))return e.each(function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),S(o,t,n,r)});if(f&&(l=y(t,e[0].ownerDocument,!1,e,r),i=l.firstChild,1===l.childNodes.length&&(l=i),i||r)){for(s=pe.map(h(l,"script"),C),a=s.length;c")).appendTo(t.documentElement),t=(ut[0].contentWindow||ut[0].contentDocument).document,t.write(),t.close(),n=D(e,t),ut.detach()),lt[e]=n),n}function L(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function H(e){if(e in Et)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=Ct.length;n--;)if(e=Ct[n]+t,e in Et)return e}function q(e,t){for(var n,r,i,o=[],a=0,s=e.length;a=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!ce.call(e,"constructor")&&!ce.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(!fe.ownFirst)for(t in e)return ce.call(e,t);for(t in e);return void 0===t||ce.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ue[le.call(e)]||"object":typeof e},globalEval:function(t){t&&pe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ge,"ms-").replace(me,ye)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var r,i=0;if(n(e))for(r=e.length;iT.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[P]=!0,e}function i(e){var t=H.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function d(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(a[l]=f))}}else x=m(x===a?x.splice(h,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=T.relative[e[0].type],a=o||T.relative[" "],s=o?1:0,u=p(function(e){return e===t},a,!0),l=p(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s1&&h(c),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,s0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",g=r&&[],y=[],v=A,x=r||o&&T.find.TAG("*",l),b=W+=null==v?1:Math.random()||.1,w=x.length;for(l&&(A=a===H||a||l);h!==w&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===H||(L(c),s=!_);d=e[f++];)if(d(c,a||H,s)){u.push(c);break}l&&(W=b)}i&&((c=!d&&c)&&p--,r&&g.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,y,a,s);if(r){if(p>0)for(;h--;)g[h]||y[h]||(y[h]=G.call(u));y=m(y)}Q.apply(u,y),l&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(W=b,A=v),g};return i?r(a):a}var b,w,T,C,E,N,k,S,A,D,j,L,H,q,_,F,M,O,R,P="sizzle"+1*new Date,B=e.document,W=0,I=0,$=n(),z=n(),X=n(),U=function(e,t){return e===t&&(j=!0),0},V=1<<31,Y={}.hasOwnProperty,J=[],G=J.pop,K=J.push,Q=J.push,Z=J.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,xe=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Te=function(){L()};try{Q.apply(J=Z.call(B.childNodes),B.childNodes),J[B.childNodes.length].nodeType}catch(Ce){Q={apply:J.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},E=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},L=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:B;return r!==H&&9===r.nodeType&&r.documentElement?(H=r,q=H.documentElement,_=!E(H),(n=H.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),w.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=i(function(e){return e.appendChild(H.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(H.getElementsByClassName),w.getById=i(function(e){return q.appendChild(e).id=P,!H.getElementsByName||!H.getElementsByName(P).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&_){var n=t.getElementById(e);return n?[n]:[]}},T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},T.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&_)return t.getElementsByClassName(e)},M=[],F=[],(w.qsa=me.test(H.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&F.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||F.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+P+"-]").length||F.push("~="),e.querySelectorAll(":checked").length||F.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||F.push(".#.+[+~]")}),i(function(e){var t=H.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&F.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||F.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),F.push(",.*:")})),(w.matchesSelector=me.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){w.disconnectedMatch=O.call(e,"div"),O.call(e,"[s!='']:x"),M.push("!=",oe)}),F=F.length&&new RegExp(F.join("|")),M=M.length&&new RegExp(M.join("|")),t=me.test(q.compareDocumentPosition),R=t||me.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return j=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===H||e.ownerDocument===B&&R(B,e)?-1:t===H||t.ownerDocument===B&&R(B,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return j=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===H?-1:t===H?1:i?-1:o?1:D?ee(D,e)-ee(D,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===B?-1:u[r]===B?1:0},H):H},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==H&&L(e),n=n.replace(ce,"='$1']"),w.matchesSelector&&_&&!X[n+" "]&&(!M||!M.test(n))&&(!F||!F.test(n)))try{var r=O.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,H,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==H&&L(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==H&&L(e);var n=T.attrHandle[t.toLowerCase()],r=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!_):void 0;return void 0!==r?r:w.attributes||!_?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!w.detectDuplicates,D=!w.sortStable&&e.slice(0),e.sort(U),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return D=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(d=m,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}), l=c[e]||[],p=l[0]===W&&l[1],x=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[W,p,x];break}}else if(v&&(d=t,f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===W&&l[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++x||(v&&(f=d[P]||(d[P]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[P]?o(n):o.length>1?(i=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=k(e.replace(se,"$1"));return i[P]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=_?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&w.getById&&9===t.nodeType&&_&&T.relative[o[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!T.relative[s=a.type]);)if((u=T.find[s])&&(r=u(a.matches[0].replace(be,we),ve.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Q.apply(n,r),n;break}}return(l||k(e,f))(r,t,!_,n,!t||ve.test(e)&&c(t.parentNode)||t),n},w.sortStable=P.split("").sort(U).join("")===P,w.detectDuplicates=!!j,L(),w.sortDetached=i(function(e){return 1&e.compareDocumentPosition(H.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var xe=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&pe(e).is(n))break;r.push(e)}return r},be=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},we=pe.expr.match.needsContext,Te=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Ce=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?pe.find.matchesSelector(r,e)?[r]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t1?pe.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&we.test(e)?pe(e):e||[],!1).length}});var Ee,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ke=pe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ee,"string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Ne.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:re,!0)),Te.test(r[1])&&pe.isPlainObject(t))for(r in t)pe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(i=re.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return Ee.find(e);this.length=1,this[0]=i}return this.context=re,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(pe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this))};ke.prototype=pe.fn,Ee=pe(re);var Se=/^(?:parents|prev(?:Until|All))/,Ae={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),r=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xe(e,"parentNode")},parentsUntil:function(e,t,n){return xe(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return xe(e,"nextSibling")},prevAll:function(e){return xe(e,"previousSibling")},nextUntil:function(e,t,n){return xe(e,"nextSibling",n)},prevUntil:function(e,t,n){return xe(e,"previousSibling",n)},siblings:function(e){return be((e.parentNode||{}).firstChild,e)},children:function(e){return be(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},function(e,t){pe.fn[e]=function(n,r){var i=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=pe.filter(r,i)),this.length>1&&(Ae[e]||(i=pe.uniqueSort(i)),Se.test(e)&&(i=i.reverse())),this.pushStack(i)}});var De=/\S+/g;pe.Callbacks=function(e){e="string"==typeof e?o(e):pe.extend({},e);var t,n,r,i,a=[],s=[],u=-1,l=function(){for(i=e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?pe.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=!0,n||c.disable(),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(e){var t=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return pe.Deferred(function(n){pe.each(t,function(t,o){var a=pe.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?pe.extend(e,r):r}},i={};return r.pipe=r.then,pe.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=ie.call(arguments),a=o.length,s=1!==a||e&&pe.isFunction(e.promise)?a:0,u=1===s?e:pe.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?ie.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);i0||(je.resolveWith(re,[pe]),pe.fn.triggerHandler&&(pe(re).triggerHandler("ready"),pe(re).off("ready"))))}}),pe.ready.promise=function(t){if(!je)if(je=pe.Deferred(),"complete"===re.readyState||"loading"!==re.readyState&&!re.documentElement.doScroll)e.setTimeout(pe.ready);else if(re.addEventListener)re.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s);else{re.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&re.documentElement}catch(r){}n&&n.doScroll&&!function i(){if(!pe.isReady){try{n.doScroll("left")}catch(t){return e.setTimeout(i,50)}a(),pe.ready()}}()}return je.promise(t)},pe.ready.promise();var Le;for(Le in pe(fe))break;fe.ownFirst="0"===Le,fe.inlineBlockNeedsLayout=!1,pe(function(){var e,t,n,r;n=re.getElementsByTagName("body")[0],n&&n.style&&(t=re.createElement("div"),r=re.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),"undefined"!=typeof t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",fe.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=re.createElement("div");fe.deleteExpando=!0;try{delete e.test}catch(t){fe.deleteExpando=!1}e=null}();var He=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)},qe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando],!!e&&!l(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=pe.data(o),1===o.nodeType&&!pe._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=pe.camelCase(r.slice(5)),u(o,r,i[r])));pe._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){pe.data(this,e)}):arguments.length>1?this.each(function(){pe.data(this,e,t)}):o?u(o,e,pe.data(o,e)):void 0},removeData:function(e){return this.each(function(){pe.removeData(this,e)})}}),pe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=pe._data(e,t),n&&(!r||pe.isArray(n)?r=pe._data(e,t,pe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),r=n.length,i=n.shift(),o=pe._queueHooks(e,t),a=function(){pe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add(function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
                a",fe.leadingWhitespace=3===e.firstChild.nodeType,fe.tbody=!e.getElementsByTagName("tbody").length,fe.htmlSerialize=!!e.getElementsByTagName("link").length,fe.html5Clone="<:nav>"!==re.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,t.appendChild(n),fe.appendChecked=n.checked,e.innerHTML="",fe.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,t.appendChild(e),n=re.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),fe.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.noCloneEvent=!!e.addEventListener,e[pe.expando]=1,fe.attributes=!e.getAttribute(pe.expando)}();var Xe={option:[1,""],legend:[1,"
                ","
                "],area:[1,"",""],param:[1,"",""],thead:[1,"","
                "],tr:[2,"","
                "],col:[2,"","
                "],td:[3,"","
                "],_default:fe.htmlSerialize?[0,"",""]:[1,"X
                ","
                "]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Ue=/<|&#?\w+;/,Ve=/-1&&(h=p.split("."),p=h.shift(),h.sort()),a=p.indexOf(":")<0&&"on"+p,t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:pe.makeArray(n,[t]),l=pe.event.special[p]||{},i||!l.trigger||l.trigger.apply(r,n)!==!1)){if(!i&&!l.noBubble&&!pe.isWindow(r)){for(u=l.delegateType||p,Ke.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),c=s;c===(r.ownerDocument||re)&&d.push(c.defaultView||c.parentWindow||e)}for(f=0;(s=d[f++])&&!t.isPropagationStopped();)t.type=f>1?u:l.bindType||p,o=(pe._data(s,"events")||{})[t.type]&&pe._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&He(s)&&(t.result=o.apply(s,n),t.result===!1&&t.preventDefault());if(t.type=p,!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&He(r)&&a&&r[p]&&!pe.isWindow(r)){c=r[a],c&&(r[a]=null),pe.event.triggered=p;try{r[p]()}catch(g){}pe.event.triggered=void 0,c&&(r[a]=c)}return t.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,r,i,o,a=[],s=ie.call(arguments),u=(pe._data(this,"events")||{})[e.type]||[],l=pe.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(a=pe.event.handlers.call(this,e,u),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,r=((pe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n-1:pe.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s]","i"),tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,nt=/\s*$/g,at=p(re),st=at.appendChild(re.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(tt,"<$1>")},clone:function(e,t,n){var r,i,o,a,s,u=pe.contains(e.ownerDocument,e);if(fe.html5Clone||pe.isXMLDoc(e)||!et.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(st.innerHTML=e.outerHTML,st.removeChild(o=st.firstChild)),!(fe.noCloneEvent&&fe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(r=h(o),s=h(e),a=0;null!=(i=s[a]);++a)r[a]&&k(i,r[a]);if(t)if(n)for(s=s||h(e),r=r||h(o),a=0;null!=(i=s[a]);a++)N(i,r[a]);else N(e,o);return r=h(o,"script"),r.length>0&&g(r,!u&&h(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=pe.expando,u=pe.cache,l=fe.attributes,c=pe.event.special;null!=(n=e[a]);a++)if((t||He(n))&&(i=n[s],o=i&&u[i])){if(o.events)for(r in o.events)c[r]?pe.event.remove(n,r):pe.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=void 0:n.removeAttribute(s),ne.push(i))}}}),pe.fn.extend({domManip:S,detach:function(e){return A(this,e,!0)},remove:function(e){return A(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||re).createTextNode(e))},null,e,arguments.length)},append:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.appendChild(e)}})},prepend:function(){return S(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=T(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return S(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(h(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Ze,""):void 0;if("string"==typeof e&&!nt.test(e)&&(fe.htmlSerialize||!et.test(e))&&(fe.leadingWhitespace||!$e.test(e))&&!Xe[(We.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;nt",t=l.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===t[0].offsetHeight,o&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),f.removeChild(u)}var n,r,i,o,a,s,u=re.createElement("div"),l=re.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",fe.opacity="0.5"===l.style.opacity,fe.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",fe.clearCloneStyle="content-box"===l.style.backgroundClip,u=re.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),fe.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pe.extend(fe,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),i},pixelMarginRight:function(){return null==n&&t(),r},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),a},reliableMarginLeft:function(){return null==n&&t(),s}}))}();var ht,gt,mt=/^(top|right|bottom|left)$/;e.getComputedStyle?(ht=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n.getPropertyValue(t)||n[t]:void 0,""!==a&&void 0!==a||pe.contains(e.ownerDocument,e)||(a=pe.style(e,t)),n&&!fe.pixelMarginRight()&&ft.test(a)&&ct.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):pt.currentStyle&&(ht=function(e){return e.currentStyle},gt=function(e,t,n){var r,i,o,a,s=e.style;return n=n||ht(e),a=n?n[t]:void 0,null==a&&s&&s[t]&&(a=s[t]),ft.test(a)&&!mt.test(t)&&(r=s.left,i=e.runtimeStyle,o=i&&i.left,o&&(i.left=e.currentStyle.left),s.left="fontSize"===t?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var yt=/alpha\([^)]*\)/i,vt=/opacity\s*=\s*([^)]*)/i,xt=/^(none|table(?!-c[ea]).+)/,bt=new RegExp("^("+Fe+")(.*)$","i"),wt={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},Ct=["Webkit","O","Moz","ms"],Et=re.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":fe.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=pe.camelCase(t),u=e.style;if(t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];if(o=typeof n,"string"===o&&(i=Me.exec(n))&&i[1]&&(n=d(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(pe.cssNumber[s]?"":"px")),fe.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(e,n,r)))))try{u[t]=n}catch(l){}}},css:function(e,t,n,r){var i,o,a,s=pe.camelCase(t);return t=pe.cssProps[s]||(pe.cssProps[s]=H(s)||s),a=pe.cssHooks[t]||pe.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=gt(e,t,r)),"normal"===o&&t in Tt&&(o=Tt[t]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),pe.each(["height","width"],function(e,t){pe.cssHooks[t]={get:function(e,n,r){if(n)return xt.test(pe.css(e,"display"))&&0===e.offsetWidth?dt(e,wt,function(){return M(e,t,r)}):M(e,t,r)},set:function(e,n,r){var i=r&&ht(e);return _(e,n,r?F(e,t,r,fe.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,i),i):0)}}}),fe.opacity||(pe.cssHooks.opacity={get:function(e,t){return vt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===pe.trim(o.replace(yt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=yt.test(o)?o.replace(yt,i):o+" "+i)}}),pe.cssHooks.marginRight=L(fe.reliableMarginRight,function(e,t){if(t)return dt(e,{display:"inline-block"},gt,[e,"marginRight"])}),pe.cssHooks.marginLeft=L(fe.reliableMarginLeft,function(e,t){if(t)return(parseFloat(gt(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-dt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}):0))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Oe[r]+t]=o[r]||o[r-2]||o[0];return i}},ct.test(e)||(pe.cssHooks[e+t].set=_)}),pe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(pe.isArray(t)){for(r=ht(e),i=t.length;a1)},show:function(){return q(this,!0)},hide:function(){return q(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Re(this)?pe(this).show():pe(this).hide()})}}),pe.Tween=O,O.prototype={constructor:O,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=O.propHooks[this.prop];return e&&e.get?e.get(this):O.propHooks._default.get(this)},run:function(e){var t,n=O.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=O.prototype.init,pe.fx.step={};var Nt,kt,St=/^(?:toggle|show|hide)$/,At=/queueHooks$/;pe.Animation=pe.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return d(n.elem,e,Me.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,r=0,i=e.length;r
                a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),e=n.getElementsByTagName("a")[0],e.style.cssText="top:1px",fe.getSetAttribute="t"!==n.className,fe.style=/top/.test(e.getAttribute("style")),fe.hrefNormalized="/a"===e.getAttribute("href"),fe.checkOn=!!t.value,fe.optSelected=i.selected,fe.enctype=!!re.createElement("form").enctype,r.disabled=!0,fe.optDisabled=!i.disabled,t=re.createElement("input"),t.setAttribute("value",""),fe.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),fe.radioValue="t"===t.value}();var Dt=/\r/g,jt=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=pe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,pe(this).val()):e,null==i?i="":"number"==typeof i?i+="":pe.isArray(i)&&(i=pe.map(i,function(e){return null==e?"":e+""})),t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=pe.valHooks[i.type]||pe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Dt,""):null==n?"":n)}}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace(jt," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u-1)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1;return n||(e.selectedIndex=-1),i}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},fe.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Lt,Ht,qt=pe.expr.attrHandle,_t=/^(?:checked|selected)$/i,Ft=fe.getSetAttribute,Mt=fe.input;pe.fn.extend({attr:function(e,t){return Pe(this,pe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(t=t.toLowerCase(),i=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?Ht:Lt)),void 0!==n?null===n?void pe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=pe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!fe.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(De);if(o&&1===e.nodeType)for(;n=o[i++];)r=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Mt&&Ft||!_t.test(n)?e[r]=!1:e[pe.camelCase("default-"+n)]=e[r]=!1:pe.attr(e,n,""),e.removeAttribute(Ft?n:r)}}),Ht={set:function(e,t,n){return t===!1?pe.removeAttr(e,n):Mt&&Ft||!_t.test(n)?e.setAttribute(!Ft&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=qt[t]||pe.find.attr;Mt&&Ft||!_t.test(t)?qt[t]=function(e,t,r){var i,o;return r||(o=qt[t],qt[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,qt[t]=o),i}:qt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}}),Mt&&Ft||(pe.attrHooks.value={set:function(e,t,n){return pe.nodeName(e,"input")?void(e.defaultValue=t):Lt&&Lt.set(e,t,n)}}),Ft||(Lt={set:function(e,t,n){var r=e.getAttributeNode(n);if(r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n))return t}},qt.id=qt.name=qt.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&""!==r.value?r.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:Lt.set},pe.attrHooks.contenteditable={set:function(e,t,n){Lt.set(e,""!==t&&t,n)}},pe.each(["width","height"],function(e,t){pe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),fe.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ot=/^(?:input|select|textarea|button|object)$/i,Rt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Pe(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=pe.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),pe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,i=pe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):Ot.test(e.nodeName)||Rt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),fe.hrefNormalized||pe.each(["href","src"],function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),fe.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),fe.enctype||(pe.propFix.enctype="encoding");var Pt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).addClass(e.call(this,t,z(this)))});if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=z(n),r=1===n.nodeType&&(" "+i+" ").replace(Pt," ")){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=pe.trim(r),i!==s&&pe.attr(n,"class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=pe(this),o=e.match(De)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=z(this),t&&pe._data(this,"__className__",t),pe.attr(this,"class",t||e===!1?"":pe._data(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+z(n)+" ").replace(Pt," ").indexOf(t)>-1)return!0;return!1}}),pe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var Bt=e.location,Wt=pe.now(),It=/\?/,$t=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=pe.trim(t+"");return i&&!pe.trim(i.replace($t,function(e,t,i,o){return n&&t&&(r=0),0===r?e:(n=i||t,r+=!o-!i,"")}))?Function("return "+i)():pe.error("Invalid JSON: "+t)},pe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(r=new e.DOMParser,n=r.parseFromString(t,"text/xml")):(n=new e.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var zt=/#.*$/,Xt=/([?&])_=[^&]*/,Ut=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Vt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Yt=/^(?:GET|HEAD)$/,Jt=/^\/\//,Gt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Kt={},Qt={},Zt="*/".concat("*"),en=Bt.href,tn=Gt.exec(en.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:en,type:"GET",isLocal:Vt.test(tn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?V(V(e,pe.ajaxSettings),t):V(pe.ajaxSettings,e)},ajaxPrefilter:X(Kt),ajaxTransport:X(Qt),ajax:function(t,n){function r(t,n,r,i){var o,f,v,x,w,C=n;2!==b&&(b=2,u&&e.clearTimeout(u),c=void 0,s=i||"",T.readyState=t>0?4:0,o=t>=200&&t<300||304===t,r&&(x=Y(d,T,r)),x=J(d,x,T,o),o?(d.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(pe.lastModified[a]=w),w=T.getResponseHeader("etag"),w&&(pe.etag[a]=w)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=x.state,f=x.data,v=x.error,o=!v)):(v=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",o?g.resolveWith(p,[f,C,T]):g.rejectWith(p,[T,C,v]),T.statusCode(y),y=void 0,l&&h.trigger(o?"ajaxSuccess":"ajaxError",[T,d,o?f:v]),m.fireWith(p,[T,C]),l&&(h.trigger("ajaxComplete",[T,d]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,d=pe.ajaxSetup({},n),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?pe(p):pe.event,g=pe.Deferred(),m=pe.Callbacks("once memory"),y=d.statusCode||{},v={},x={},b=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!f)for(f={};t=Ut.exec(s);)f[t[1].toLowerCase()]=t[2];t=f[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=x[n]=x[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)y[t]=[y[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return c&&c.abort(t),r(0,t),this}};if(g.promise(T).complete=m.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||en)+"").replace(zt,"").replace(Jt,tn[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=pe.trim(d.dataType||"*").toLowerCase().match(De)||[""],null==d.crossDomain&&(i=Gt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===tn[1]&&i[2]===tn[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(tn[3]||("http:"===tn[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=pe.param(d.data,d.traditional)),U(Kt,d,n,T),2===b)return T;l=pe.event&&d.global,l&&0===pe.active++&&pe.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Yt.test(d.type),a=d.url,d.hasContent||(d.data&&(a=d.url+=(It.test(a)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Xt.test(a)?a.replace(Xt,"$1_="+Wt++):a+(It.test(a)?"&":"?")+"_="+Wt++)),d.ifModified&&(pe.lastModified[a]&&T.setRequestHeader("If-Modified-Since",pe.lastModified[a]),pe.etag[a]&&T.setRequestHeader("If-None-Match",pe.etag[a])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Zt+"; q=0.01":""):d.accepts["*"]);for(o in d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(d.beforeSend.call(p,T,d)===!1||2===b))return T.abort();w="abort";for(o in{success:1,error:1,complete:1})T[o](d[o]);if(c=U(Qt,d,n,T)){if(T.readyState=1,l&&h.trigger("ajaxSend",[T,d]),2===b)return T;d.async&&d.timeout>0&&(u=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{b=1,c.send(v,r)}catch(C){if(!(b<2))throw C;r(-1,C)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,r,i){return pe.isFunction(n)&&(i=i||r,r=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:i,data:n,success:r},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pe.fn.extend({wrapAll:function(e){if(pe.isFunction(e))return this.each(function(t){pe(this).wrapAll(e.call(this,t))});if(this[0]){var t=pe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return pe.isFunction(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=pe.isFunction(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)}).end()}}),pe.expr.filters.hidden=function(e){return fe.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:K(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,an=/^(?:submit|button|image|reset|file)$/i,sn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)Q(n,e[n],t,i);return r.join("&").replace(nn,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&sn.test(this.nodeName)&&!an.test(e)&&(this.checked||!Be.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),pe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?ee():re.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||ee()}:Z;var un=0,ln={},cn=pe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in ln)ln[e](void 0,!0)}),fe.cors=!!cn&&"withCredentials"in cn,cn=fe.ajax=!!cn,cn&&pe.ajaxTransport(function(t){if(!t.crossDomain||fe.cors){var n;return{send:function(r,i){var o,a=t.xhr(),s=++un;if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)void 0!==r[o]&&a.setRequestHeader(o,r[o]+"");a.send(t.hasContent&&t.data||null),n=function(e,r){var o,u,l;if(n&&(r||4===a.readyState))if(delete ln[s],n=void 0,a.onreadystatechange=pe.noop,r)4!==a.readyState&&a.abort();else{l={},o=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{u=a.statusText}catch(c){u=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&i(o,u,l,a.getAllResponseHeaders())},t.async?4===a.readyState?e.setTimeout(n):a.onreadystatechange=ln[s]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),pe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=re.head||pe("head")[0]||re.documentElement;return{send:function(r,i){t=re.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var fn=[],dn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=fn.pop()||pe.expando+"_"+Wt++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=pe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||pe.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?pe(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,fn.push(i)),a&&pe.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||re;var r=Te.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=y([e],t,i),i&&i.length&&pe(i).remove(),pe.merge([],r.childNodes))};var pn=pe.fn.load;return pe.fn.load=function(e,t,n){if("string"!=typeof e&&pn)return pn.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=pe.trim(e.slice(s,e.length)),e=e.slice(0,s)),pe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&pe.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?pe("
                ").append(pe.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.expr.filters.animated=function(e){return pe.grep(pe.timers,function(t){return e===t.elem}).length},pe.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=pe.css(e,"position"),f=pe(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=pe.css(e,"top"),u=pe.css(e,"left"),l=("absolute"===c||"fixed"===c)&&pe.inArray("auto",[o,u])>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){pe.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return t=o.documentElement,pe.contains(t,i)?("undefined"!=typeof i.getBoundingClientRect&&(r=i.getBoundingClientRect()),n=te(o),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===pe.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(r,"marginTop",!0),left:t.left-n.left-pe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){ for(var e=this.offsetParent;e&&!pe.nodeName(e,"html")&&"static"===pe.css(e,"position");)e=e.offsetParent;return e||pt})}}),pe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);pe.fn[e]=function(r){return Pe(this,function(e,r,i){var o=te(e);return void 0===i?o?t in o?o[t]:o.document.documentElement[r]:e[r]:void(o?o.scrollTo(n?pe(o).scrollLeft():i,n?i:pe(o).scrollTop()):e[r]=i)},e,r,arguments.length,null)}}),pe.each(["top","left"],function(e,t){pe.cssHooks[t]=L(fe.pixelPosition,function(e,n){if(n)return n=gt(e,t),ft.test(n)?pe(e).position()[t]+"px":n})}),pe.each({Height:"height",Width:"width"},function(e,t){pe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){pe.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Pe(this,function(t,n,r){var i;return pe.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?pe.css(t,n,a):pe.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),pe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),pe.fn.size=function(){return this.length},pe.fn.andSelf=pe.fn.addBack,layui.define(function(e){layui.$=pe,e("jquery",pe)}),pe});!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.scripts,t=e[e.length-1],i=t.src;if(!t.getAttribute("merge"))return i.substring(0,i.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(e,t){var i=e.currentStyle?e.currentStyle:n.getComputedStyle(e,null);return i[i.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.0.3",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("skin/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'
                '+(f?r.title[0]:r.title)+"
                ":"";return r.zIndex=s,t([r.shade?'
                ':"",'
                '+(e&&2!=r.type?"":u)+'
                '+(0==r.type&&r.icon!==-1?'':"")+(1==r.type&&e?"":r.content||"")+'
                '+function(){var e=c?'':"";return r.closeBtn&&(e+=''),e}()+""+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t'+r.btn[t]+"";return'
                '+e+"
                "}():"")+(r.resize?'':"")+"
                "],u,i('
                ')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return''}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a=''+t[0].title+"";i"+t[i].title+"";return a}(),content:'
                  '+function(){var e=t.length,i=1,a="";if(e>0)for(a='
                • '+(t[0].content||"no content")+"
                • ";i'+(t[i].content||"no content")+"";return a}()+"
                ",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(u[d].alt||
                '+(u.length>1?'':"")+'
                '+(u[d].alt||"")+""+s.imgIndex+"/"+u.length+"
                ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
                是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);layui.define("jquery",function(i){"use strict";var a=layui.$,t=(layui.hint(),layui.device()),l="element",e="layui-this",n="layui-show",s=function(){this.config={}};s.prototype.set=function(i){var t=this;return a.extend(!0,t.config,i),t},s.prototype.on=function(i,a){return layui.onevent.call(this,l,i,a)},s.prototype.tabAdd=function(i,t){var l=".layui-tab-title",e=a(".layui-tab[lay-filter="+i+"]"),n=e.children(l),s=n.children(".layui-tab-bar"),o=e.children(".layui-tab-content"),c='
              • '+(t.title||"unnaming")+"
              • ";return s[0]?s.before(c):n.append(c),o.append('
                '+(t.content||"")+"
                "),y.hideTabMore(!0),y.tabAuto(),this},s.prototype.tabDelete=function(i,t){var l=".layui-tab-title",e=a(".layui-tab[lay-filter="+i+"]"),n=e.children(l),s=n.find('>li[lay-id="'+t+'"]');return y.tabDelete(null,s),this},s.prototype.tabChange=function(i,t){var l=".layui-tab-title",e=a(".layui-tab[lay-filter="+i+"]"),n=e.children(l),s=n.find('>li[lay-id="'+t+'"]');return y.tabClick(null,null,s),this},s.prototype.progress=function(i,t){var l="layui-progress",e=a("."+l+"[lay-filter="+i+"]"),n=e.find("."+l+"-bar"),s=n.find("."+l+"-text");return n.css("width",t),s.text(t),this};var o=".layui-nav",c="layui-nav-item",r="layui-nav-bar",u="layui-nav-tree",d="layui-nav-child",h="layui-nav-more",f="layui-anim layui-anim-upbit",y={tabClick:function(i,t,s){var o=s||a(this),t=t||o.parent().children("li").index(o),c=o.parents(".layui-tab").eq(0),r=c.children(".layui-tab-content").children(".layui-tab-item"),u=o.find("a"),d=c.attr("lay-filter");"javascript:;"!==u.attr("href")&&"_blank"===u.attr("target")||(o.addClass(e).siblings().removeClass(e),r.eq(t).addClass(n).siblings().removeClass(n)),layui.event.call(this,l,"tab("+d+")",{elem:c,index:t})},tabDelete:function(i,t){var l=t||a(this).parent(),n=l.index(),s=l.parents(".layui-tab").eq(0),o=s.children(".layui-tab-content").children(".layui-tab-item");l.hasClass(e)&&(l.next()[0]?y.tabClick.call(l.next()[0],null,n+1):l.prev()[0]&&y.tabClick.call(l.prev()[0],null,n-1)),l.remove(),o.eq(n).remove(),setTimeout(function(){y.tabAuto()},50)},tabAuto:function(){var i="layui-tab-more",l="layui-tab-bar",e="layui-tab-close",n=this;a(".layui-tab").each(function(){var s=a(this),o=s.children(".layui-tab-title"),c=(s.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),r=a('');if(n===window&&8!=t.ie&&y.hideTabMore(!0),s.attr("lay-allowClose")&&o.find("li").each(function(){var i=a(this);if(!i.find("."+e)[0]){var t=a('');t.on("click",y.tabDelete),i.append(t)}}),o.prop("scrollWidth")>o.outerWidth()+1){if(o.find("."+l)[0])return;o.append(r),s.attr("overflow",""),r.on("click",function(a){o[this.title?"removeClass":"addClass"](i),this.title=this.title?"":"收缩"})}else o.find("."+l).remove(),s.removeAttr("overflow")})},hideTabMore:function(i){var t=a(".layui-tab-title");i!==!0&&"tabmore"===a(i.target).attr("lay-stope")||(t.removeClass("layui-tab-more"),t.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var i=a(this),t=i.parents(o),n=t.attr("lay-filter"),s=i.find("a");i.find("."+d)[0]||("javascript:;"!==s.attr("href")&&"_blank"===s.attr("target")||(t.find("."+e).removeClass(e),i.addClass(e)),layui.event.call(this,l,"nav("+n+")",i))},clickChild:function(){var i=a(this),t=i.parents(o),n=t.attr("lay-filter");t.find("."+e).removeClass(e),i.addClass(e),layui.event.call(this,l,"nav("+n+")",i)},showChild:function(){var i=a(this),t=i.parents(o),l=i.parent(),e=i.siblings("."+d);t.hasClass(u)&&(e.removeClass(f),l["none"===e.css("display")?"addClass":"removeClass"](c+"ed"))},collapse:function(){var i=a(this),t=i.find(".layui-colla-icon"),e=i.siblings(".layui-colla-content"),s=i.parents(".layui-collapse").eq(0),o=s.attr("lay-filter"),c="none"===e.css("display");if("string"==typeof s.attr("lay-accordion")){var r=s.children(".layui-colla-item").children("."+n);r.siblings(".layui-colla-title").children(".layui-colla-icon").html(""),r.removeClass(n)}e[c?"addClass":"removeClass"](n),t.html(c?"":""),layui.event.call(this,l,"collapse("+o+")",{title:i,content:e,show:c})}};s.prototype.init=function(i){var l={tab:function(){y.tabAuto.call({})},nav:function(){var i=200,l={},e={},s={},p=function(o,c,r){var y=a(this),p=y.find("."+d);c.hasClass(u)?o.css({top:y.position().top,height:y.children("a").height(),opacity:1}):(p.addClass(f),o.css({left:y.position().left+parseFloat(y.css("marginLeft")),top:y.position().top+y.height()-5}),l[r]=setTimeout(function(){o.css({width:y.width(),opacity:1})},t.ie&&t.ie<10?0:i),clearTimeout(s[r]),"block"===p.css("display")&&clearTimeout(e[r]),e[r]=setTimeout(function(){p.addClass(n),y.find("."+h).addClass(h+"d")},300))};a(o).each(function(t){var o=a(this),f=a(''),v=o.find("."+c);o.find("."+r)[0]||(o.append(f),v.on("mouseenter",function(){p.call(this,f,o,t)}).on("mouseleave",function(){o.hasClass(u)||(clearTimeout(e[t]),e[t]=setTimeout(function(){o.find("."+d).removeClass(n),o.find("."+h).removeClass(h+"d")},300))}),o.on("mouseleave",function(){clearTimeout(l[t]),s[t]=setTimeout(function(){o.hasClass(u)?f.css({height:0,top:f.position().top+f.height()/2,opacity:0}):f.css({width:0,left:f.position().left+f.width()/2,opacity:0})},i)})),v.each(function(){var i=a(this),t=i.find("."+d);if(t[0]&&!i.find("."+h)[0]){var l=i.children("a");l.append('')}i.off("click",y.clickThis).on("click",y.clickThis),i.children("a").off("click",y.showChild).on("click",y.showChild),t.children("dd").off("click",y.clickChild).on("click",y.clickChild)})})},breadcrumb:function(){var i=".layui-breadcrumb";a(i).each(function(){var i=a(this),t=i.attr("lay-separator")||">",l=i.find("a");l.find(".layui-box")[0]||(l.each(function(i){i!==l.length-1&&a(this).append(''+t+"")}),i.css("visibility","visible"))})},progress:function(){var i="layui-progress";a("."+i).each(function(){var t=a(this),l=t.find(".layui-progress-bar"),e=l.attr("lay-percent");l.css("width",e),t.attr("lay-showPercent")&&setTimeout(function(){var a=Math.round(l.width()/t.width()*100);a>100&&(a=100),l.html(''+a+"%")},350)})},collapse:function(){var i="layui-collapse";a("."+i).each(function(){var i=a(this).find(".layui-colla-item");i.each(function(){var i=a(this),t=i.find(".layui-colla-title"),l=i.find(".layui-colla-content"),e="none"===l.css("display");t.find(".layui-colla-icon").remove(),t.append(''+(e?"":"")+""),t.off("click",y.collapse).on("click",y.collapse)})})}};return layui.each(l,function(i,a){a()})};var p=new s,v=a(document);p.init();var b=".layui-tab-title li";v.on("click",b,y.tabClick),v.on("click",y.hideTabMore),a(window).on("resize",y.tabAuto),i(l,p)});layui.define("layer",function(e){"use strict";var i=layui.$,t=layui.layer,n=layui.hint(),a=layui.device(),o={config:{},set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,r,e,i)}},l=function(){var e=this;return{upload:function(i){e.upload.call(e,i)},config:e.config}},r="upload",u="layui-upload-file",c="layui-upload-form",s="layui-upload-iframe",f="layui-upload-choose",p=function(e){var t=this;t.config=i.extend({},t.config,o.config,e),t.render()};p.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",field:"file",method:"post",data:{},drag:!0,size:0,multiple:!1},p.prototype.render=function(e){var t=this,e=t.config;e.elem=i(e.elem),e.bindAction=i(e.bindAction),t.file(),t.events()},p.prototype.file=function(){var e=this,t=e.config,n=e.elemFile=i(['"].join("")),o=t.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&t.elem.wrap('
                '),e.isFile()?(e.elemFile=t.elem,t.field=t.elem[0].name):t.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,t=e.config,n=i(''),a=i(['
                ',"
                "].join(""));i("#"+s)[0]||i("body").append(n),t.elem.next().hasClass(s)||(e.elemFile.wrap(a),t.elem.next("."+s).append(function(){var e=[];return layui.each(t.data,function(i,t){e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return t.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var i=this;window.FileReader&&layui.each(i.chooseFiles,function(i,t){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){e&&e(i,t,this.result)}})},p.prototype.upload=function(e,t){var n,o=this,l=o.config,r=o.elemFile[0],u=function(){layui.each(e||o.files||o.chooseFiles||r.files,function(e,t){var n=new FormData;n.append(l.field,t),layui.each(l.data,function(e,i){n.append(e,i)}),i.ajax({url:l.url,type:l.method,data:n,contentType:!1,processData:!1,dataType:"json",success:function(i){d(e,i)},error:function(){o.msg("请求上传接口出现异常"),m(e)}})})},c=function(){var e=i("#"+s);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var i,t=e.contents().find("body");try{i=t.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}i&&(clearInterval(p.timer),t.html(""),d(0,i))},30)},d=function(e,i){if(o.elemFile.next("."+f).remove(),r.value="","object"!=typeof i)try{i=JSON.parse(i)}catch(t){return i={},o.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(i,e||0,function(e){o.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){o.upload(e)})},v=l.exts,h=function(){var i=[];return layui.each(e||o.chooseFiles,function(e,t){i.push(t.name)}),i}(),g={preview:function(e){o.preview(e)},upload:function(e,i){var t={};t[e]=i,o.upload(t)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,i){o.files[e]=i}),o.files}},y=function(){return"choose"===t?l.choose&&l.choose(g):(l.before&&l.before(g),a.ie?a.ie>9?u():c():void u())};switch(h=0===h.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":h,l.accept){case"file":if(v&&!RegExp("\\w\\.("+v+")$","i").test(escape(h)))return o.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(v||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(h)))return o.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(v||"mp3|wav|mid")+")$","i").test(escape(h)))return o.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(h,function(e,i){RegExp("\\w\\.("+(v||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(i))||(n=!0)}),n)return o.msg("选择的图片中包含不支持的格式"),r.value=""}if(l.size>0&&!(a.ie&&a.ie<10)){var F;if(layui.each(o.chooseFiles,function(e,i){if(i.size>1024*l.size){var t=l.size/1024;t=t>=1?Math.floor(t)+(t%1>0?t.toFixed(1):0)+"MB":l.size+"KB",r.value="",F=t}}),F)return o.msg("文件不能超过"+F)}y()},p.prototype.events=function(){var e=this,t=e.config,o=function(i){e.chooseFiles={},layui.each(i,function(i,t){var n=(new Date).getTime();e.chooseFiles[n+"-"+i]=t})},l=function(i,n){var a=e.elemFile,o=i.length>1?i.length+"个文件":(i[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(f)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||t.choose||a.after(''+o+"")};t.elem.off("upload.start").on("upload.start",function(){var a=i(this),o=a.attr("lay-data");if(o)try{o=new Function("return "+o)(),e.config=i.extend({},t,o)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+o)}e.config.item=a,e.elemFile[0].click()}),a.ie&&a.ie<10||t.elem.off("upload.over").on("upload.over",function(){var e=i(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=i(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,a){var r=i(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),t.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var i=this.files||[];o(i),t.auto?e.upload():l(i)}),t.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),t.elem.data("haveEvents")||(e.elemFile.on("change",function(){i(this).trigger("upload.change")}),t.elem.on("click",function(){e.isFile()||i(this).trigger("upload.start")}),t.drag&&t.elem.on("dragover",function(e){e.preventDefault(),i(this).trigger("upload.over")}).on("dragleave",function(e){i(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),i(this).trigger("upload.drop",e)}),t.bindAction.on("click",function(){i(this).trigger("upload.action")}),t.elem.data("haveEvents",!0))},o.render=function(e){var i=new p(e);return l.call(i)},e(r,o)});layui.define("layer",function(e){"use strict";var i=layui.$,t=layui.layer,a=layui.hint(),n=layui.device(),l="form",s=".layui-form",r="layui-this",u="layui-hide",c="layui-disabled",o=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:function(e){if(!e||isNaN(e))return"只能填写数字"},date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};o.prototype.set=function(e){var t=this;return i.extend(!0,t.config,e),t},o.prototype.verify=function(e){var t=this;return i.extend(!0,t.config.verify,e),t},o.prototype.on=function(e,i){return layui.onevent.call(this,l,e,i)},o.prototype.render=function(e,t){var n=this,o=i(s+function(){return t?'[lay-filter="'+t+'"]':""}()),d={select:function(){var e,t="请选择",a="layui-form-select",n="layui-select-title",s="layui-select-none",d="",f=o.find("select"),y=function(t,l){i(t.target).parent().hasClass(n)&&!l||(i("."+a).removeClass(a+"ed "+a+"up"),e&&d&&e.val(d)),e=null},h=function(t,o,f){var h=i(this),p=t.find("."+n),m=p.find("input"),k=t.find("dl"),g=k.children("dd");if(!o){var b=function(){var e=t.offset().top+t.outerHeight()+5-v.scrollTop(),i=k.outerHeight();t.addClass(a+"ed"),g.removeClass(u),e+i>v.height()&&e>=i&&t.addClass(a+"up")},x=function(e){t.removeClass(a+"ed "+a+"up"),m.blur(),e||C(m.val(),function(e){e&&(d=k.find("."+r).html(),m&&m.val(d))})};p.on("click",function(e){t.hasClass(a+"ed")?x():(y(e,!0),b()),k.find("."+s).remove()}),p.find(".layui-edge").on("click",function(){m.focus()}),m.on("keyup",function(e){var i=e.keyCode;9===i&&b()}).on("keydown",function(e){var i=e.keyCode;9===i?x():13===i&&e.preventDefault()});var C=function(e,t,a){var n=0;layui.each(g,function(){var t=i(this),l=t.text(),s=l.indexOf(e)===-1;(""===e||"blur"===a?e!==l:s)&&n++,"keyup"===a&&t[s?"addClass":"removeClass"](u)});var l=n===g.length;return t(l),l},w=function(e){var i=this.value,t=e.keyCode;return 9!==t&&13!==t&&37!==t&&38!==t&&39!==t&&40!==t&&(C(i,function(e){e?k.find("."+s)[0]||k.append('

                无匹配项

                '):k.find("."+s).remove()},"keyup"),void(""===i&&k.find("."+s).remove()))};f&&m.on("keyup",w).on("blur",function(i){e=m,d=k.find("."+r).html(),setTimeout(function(){C(m.val(),function(e){e&&!d&&m.val("")},"blur")},200)}),g.on("click",function(){var e=i(this),a=e.attr("lay-value"),n=h.attr("lay-filter");return!e.hasClass(c)&&(e.hasClass("layui-select-tips")?m.val(""):(m.val(e.text()),e.addClass(r)),e.siblings().removeClass(r),h.val(a).removeClass("layui-form-danger"),layui.event.call(this,l,"select("+n+")",{elem:h[0],value:a,othis:t}),x(!0),!1)}),t.find("dl>dt").on("click",function(e){return!1}),i(document).off("click",y).on("click",y)}};f.each(function(e,l){var s=i(this),u=s.next("."+a),o=this.disabled,d=l.value,f=i(l.options[l.selectedIndex]),y=l.options[0];if("string"==typeof s.attr("lay-ignore"))return s.show();var v="string"==typeof s.attr("lay-search"),p=y?y.value?t:y.innerHTML||t:t,m=i(['
                ','
                ','
                ','
                '+function(e){var i=[];return layui.each(e,function(e,a){0!==e||a.value?"optgroup"===a.tagName.toLowerCase()?i.push("
                "+a.label+"
                "):i.push('
                '+a.innerHTML+"
                "):i.push('
                '+(a.innerHTML||t)+"
                ")}),0===i.length&&i.push('
                没有选项
                '),i.join("")}(s.find("*"))+"
                ","
                "].join(""));u[0]&&u.remove(),s.after(m),h.call(this,m,o,v)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},t=o.find("input[type=checkbox]"),a=function(e,t){var a=i(this);e.on("click",function(){var i=a.attr("lay-filter"),n=(a.attr("lay-text")||"").split("|");a[0].disabled||(a[0].checked?(a[0].checked=!1,e.removeClass(t[1]).find("em").text(n[1])):(a[0].checked=!0,e.addClass(t[1]).find("em").text(n[0])),layui.event.call(a[0],l,t[2]+"("+i+")",{elem:a[0],value:a[0].value,othis:e}))})};t.each(function(t,n){var l=i(this),s=l.attr("lay-skin"),r=(l.attr("lay-text")||"").split("|"),u=this.disabled;"switch"===s&&(s="_"+s);var o=e[s]||e.checkbox;if("string"==typeof l.attr("lay-ignore"))return l.show();var d=l.next("."+o[0]),f=i(['
                ',{_switch:""+((n.checked?r[0]:r[1])||"")+""}[s]||(n.title.replace(/\s/g,"")?""+n.title+"":"")+''+(s?"":"")+"","
                "].join(""));d[0]&&d.remove(),l.after(f),a.call(this,f,o)})},radio:function(){var e="layui-form-radio",t=["",""],a=o.find("input[type=radio]"),n=function(a){var n=i(this),r="layui-anim-scaleSpring";a.on("click",function(){var u=n[0].name,c=n.parents(s),o=n.attr("lay-filter"),d=c.find("input[name="+u.replace(/(\.|#|\[|\])/g,"\\$1")+"]");n[0].disabled||(layui.each(d,function(){var a=i(this).next("."+e);this.checked=!1,a.removeClass(e+"ed"),a.find(".layui-icon").removeClass(r).html(t[1])}),n[0].checked=!0,a.addClass(e+"ed"),a.find(".layui-icon").addClass(r).html(t[0]),layui.event.call(n[0],l,"radio("+o+")",{elem:n[0],value:n[0].value,othis:a}))})};a.each(function(a,l){var s=i(this),r=s.next("."+e),u=this.disabled;if("string"==typeof s.attr("lay-ignore"))return s.show();var o=i(['
                ',''+t[l.checked?0:1]+"",""+(l.title||"未命名")+"","
                "].join(""));r[0]&&r.remove(),s.after(o),n.call(this,o)})}};return e?d[e]?d[e]():a.error("不支持的"+e+"表单渲染"):layui.each(d,function(e,i){i()}),n};var d=function(){var e=i(this),a=f.config.verify,r=null,u="layui-form-danger",c={},o=e.parents(s),d=o.find("*[lay-verify]"),y=e.parents("form")[0],v=o.find("input,select,textarea"),h=e.attr("lay-filter");return layui.each(d,function(e,l){var s=i(this),c=s.attr("lay-verify").split("|"),o="",d=s.val();if(s.removeClass(u),layui.each(c,function(e,i){var c="function"==typeof a[i];if(a[i]&&(c?o=a[i](d,l):!a[i][0].test(d)))return t.msg(o||a[i][1],{icon:5,shift:6}),n.android||n.ios||l.focus(),s.addClass(u),r=!0}),r)return r}),!r&&(layui.each(v,function(e,i){i.name&&(/^checkbox|radio$/.test(i.type)&&!i.checked||(c[i.name]=i.value))}),layui.event.call(this,l,"submit("+h+")",{elem:this,form:y,field:c}))},f=new o,y=i(document),v=i(window);f.render(),y.on("reset",s,function(){var e=i(this).attr("lay-filter");setTimeout(function(){f.render(null,e)},50)}),y.on("submit",s,d).on("click","*[lay-submit]",d),e(l,f)});layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('
                  '),s=o(["
                • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
                • "].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('
                  '));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})});layui.define(["laytpl","laypage","layer","form"],function(e){"use strict";var t=layui.$,i=layui.laytpl,a=layui.laypage,l=layui.layer,n=layui.form,o=layui.hint(),r=layui.device(),d={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,s,e,t)}},c=function(){var e=this,t=e.config,i=t.id;return i&&(c.config[i]=t),{reload:function(t){e.reload.call(e,t)},config:t}},s="table",u=".layui-table",f="layui-hide",h="layui-table-view",y=".layui-table-header",p=".layui-table-body",m=".layui-table-main",v=".layui-table-fixed",g=".layui-table-fixed-l",x=".layui-table-fixed-r",b=".layui-table-tool",k=".layui-table-sort",w="layui-table-edit",C="layui-table-hover",z=function(e){return e=e||{},['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),"{{# if(item2.checkbox){ }}",'',"{{# } else if(item2.space){ }}",'',"{{# } else { }}",'","{{# }; }}",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
                  ',"{{# if(item2.colspan > 1){ }}",'
                  ','{{item2.title||""}}',"
                  ","{{# } else { }}",'
                  ','{{item2.title||""}}',"{{# if(item2.sort){ }}",'',"{{# } }}","
                  ","{{# } }}","
                  "].join("")},F=['',"","
                  "].join(""),N=['
                  ',"{{# var left, right; }}",'
                  ',z(),"
                  ",'
                  ',F,"
                  ","{{# if(left){ }}",'
                  ','
                  ',z({fixed:!0}),"
                  ",'
                  ',F,"
                  ","
                  ","{{# }; }}","{{# if(right){ }}",'
                  ','
                  ',z({fixed:"right"}),'
                  ',"
                  ",'
                  ',F,"
                  ","
                  ","{{# }; }}","{{# if(d.data.page){ }}",'
                  ','
                  ',"
                  ","{{# } }}","","
                  "].join(""),T=t(window),S=t(document),A=function(e){var i=this;i.index=++d.index,i.config=t.extend({},i.config,d.config,e),i.render()};A.prototype.config={limit:30,loading:!0},A.prototype.render=function(e){var a,l=this;if(e&&(l.config=e),a=l.config,a.elem=t(a.elem),a.where=a.where||{},a.request=t.extend({pageName:"page",limitName:"limit"},a.request),a.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",countName:"count"},a.response),!a.elem[0])return l;var n=a.elem,o=n.next("."+h);a.height&&/^full-\d+$/.test(a.height)&&(l.fullHeightGap=a.height.split("-")[1],a.height=T.height()-l.fullHeightGap);var r=l.elem=t(i(N).render({VIEW_CLASS:h,data:a,index:l.index}));if(a.index=l.index,o[0]&&o.remove(),n.after(r),l.layHeader=r.find(y),l.layMain=r.find(m),l.layBody=r.find(p),l.layFixed=r.find(v),l.layFixLeft=r.find(g),l.layFixRight=r.find(x),l.layTool=r.find(b),a.height&&l.fullSize(),a.cols.length>1){var d=l.layFixed.find(y).find("th");d.height(l.layHeader.height()-1-parseFloat(d.css("padding-top"))-parseFloat(d.css("padding-bottom")))}l.pullData(1),l.events()},A.prototype.reload=function(e){var i=this;i.config=t.extend({},i.config,e),i.render()},A.prototype.pullData=function(e,i){var a=this,n=a.config,o=n.request,r=n.response,d=function(){"object"==typeof n.initSort&&a.sort(n.initSort.field,n.initSort.type)};if(n.url){var c={};c[o.pageName]=e,c[o.limitName]=n.limit,t.ajax({type:n.method||"get",url:n.url,data:t.extend(c,n.where),dataType:"json",success:function(t){return t[r.statusName]!=r.statusCode?(a.renderForm(),a.layMain.html('
                  '+(t[r.msgName]||"返回的数据状态异常")+"
                  ")):(a.renderData(t,e,t[r.countName]),d(),i&&l.close(i),void("function"==typeof n.done&&n.done(t,e,t[r.countName])))},error:function(e,t){a.layMain.html('
                  数据接口请求异常
                  '),a.renderForm(),i&&l.close(i)}})}else if(n.data&&n.data.constructor===Array){var s={},u=e*n.limit-n.limit;s[r.dataName]=n.data.concat().splice(u,n.limit),s[r.countName]=n.data.length,a.renderData(s,e,n.data.length),d(),"function"==typeof n.done&&n.done(s,e,s[r.countName])}},A.prototype.page=1,A.prototype.eachCols=function(e){layui.each(this.config.cols,function(t,i){layui.each(i,function(a,l){e(a,l,[t,i])})})},A.prototype.renderData=function(e,n,o,r){var c=this,s=c.config,u=e[s.response.dataName]||[],f=[],h=[],y=[],p=function(){return!r&&c.sortKey?c.sort(c.sortKey.field,c.sortKey.sort,!0):(layui.each(u,function(e,a){var l=[],n=[],o=[];0!==a.length&&(r||(a[d.config.indexName]=e),c.eachCols(function(e,r){var c=a[r.field||e];if(void 0!==c&&null!==c||(c=""),!(r.colspan>1)){var u=['",'
                  '+function(){return r.checkbox?'":r.toolbar?i(t(r.toolbar).html()||"").render(a):r.templet?i(t(r.templet).html()||String(c)).render(a):c}(),"
                  "].join("");l.push(u),r.fixed&&"right"!==r.fixed&&n.push(u),"right"===r.fixed&&o.push(u)}}),f.push(''+l.join("")+""),h.push(''+n.join("")+""),y.push(''+o.join("")+""))}),c.layBody.scrollTop(0),c.layMain.find("tbody").html(f.join("")),c.layFixLeft.find("tbody").html(h.join("")),c.layFixRight.find("tbody").html(y.join("")),c.renderForm(),c.syncCheckAll(),c.haveInit?c.scrollPatch():setTimeout(function(){c.scrollPatch()},50),c.haveInit=!0,void l.close(c.tipsIndex))};return c.key=s.id||s.index,d.cache[c.key]=u,r?p():0===u.length?(c.renderForm(),c.layFixed.remove(),c.layMain.html('
                  无数据
                  ')):(p(),void(s.page&&(c.page=n,c.count=o,a.render({elem:"layui-table-page"+s.index,count:o,groups:3,limits:s.limits||[10,20,30,40,50,60,70,80,90],limit:s.limit,curr:n,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(c.page=e.curr,s.limit=e.limit,c.pullData(e.curr,c.loading()))}}),c.layTool.find(".layui-table-count span").html(o))))},A.prototype.renderForm=function(e){n.render(e||"checkbox","LAY-table-"+this.index)},A.prototype.sort=function(e,i,a,n){var r,c,u=this,f=u.config,h=f.elem.attr("lay-filter"),y=d.cache[u.key];"string"==typeof e&&u.layHeader.find("th").each(function(i,a){var l=t(this),n=l.data("field");if(n===e)return e=l,r=n,!1});try{var r=r||e.data("field");if(u.sortKey&&!a&&r===u.sortKey.field&&i===u.sortKey.sort)return;var p=u.layHeader.find("th .laytable-cell-"+f.index+"-"+r).find(k);u.layHeader.find("th").find(k).removeAttr("lay-sort"),p.attr("lay-sort",i||null),u.layFixed.find("th")}catch(m){return o.error("Table modules: Did not match to field")}u.sortKey={field:r,sort:i},"asc"===i?c=layui.sort(y,r):"desc"===i?c=layui.sort(y,r,!0):(c=layui.sort(y,d.config.indexName),delete u.sortKey),u.renderData({data:c},u.page,u.count,!0),l.close(u.tipsIndex),n&&layui.event.call(e,s,"sort("+h+")",{field:r,type:i})},A.prototype.loading=function(){var e=this,t=e.config;if(t.loading&&t.url)return l.msg("数据请求中",{icon:16,offset:[e.elem.offset().top+e.elem.height()/2-35-T.scrollTop()+"px",e.elem.offset().left+e.elem.width()/2-90-T.scrollLeft()+"px"],anim:-1,fixed:!1})},A.prototype.setCheckData=function(e,t){var i=this,a=i.config,l=d.cache[i.key];l[e]&&(l[e][a.checkName]=t)},A.prototype.syncCheckAll=function(){var e=this,t=e.config,i=e.layHeader.find('input[name="layTableCheckbox"]'),a=function(i){return e.eachCols(function(e,a){a.checkbox&&(a[t.checkName]=i)}),i};i[0]&&(d.checkStatus(e.key).isAll?(i[0].checked||(i.prop("checked",!0),e.renderForm()),a(!0)):(i[0].checked&&(i.prop("checked",!1),e.renderForm()),a(!1)))},A.prototype.getCssRule=function(e,t){var i=this,a=i.elem.find("style")[0],l=a.sheet||a.styleSheet,n=l.cssRules||l.rules;layui.each(n,function(a,l){if(l.selectorText===".laytable-cell-"+i.index+"-"+e)return t(l),!0})},A.prototype.fullSize=function(){var e,t=this,i=t.config,a=i.height;t.fullHeightGap&&(a=T.height()-t.fullHeightGap,a<135&&(a=135),t.elem.css("height",a)),e=parseFloat(a)-parseFloat(t.layHeader.height())-1,i.page&&(e-=parseFloat(t.layTool.outerHeight()+1)),t.layMain.css("height",e)},A.prototype.scrollPatch=function(){var e=this,i=e.layMain.children("table"),a=e.layMain.width()-e.layMain.prop("clientWidth"),l=e.layMain.height()-e.layMain.prop("clientHeight");if(a&&l){if(!e.elem.find(".layui-table-patch")[0]){var n=t('
                  ');n.find("div").css({width:a}),e.layHeader.eq(0).find("thead tr").append(n)}}else e.layHeader.eq(0).find(".layui-table-patch").remove();var o=e.layMain.height(),r=o-l;e.layFixed.find(p).css("height",i.height()>r?r:"auto"),e.layFixRight[i.width()>e.layMain.width()?"removeClass":"addClass"](f),e.layFixRight.css("right",a-1)},A.prototype.events=function(){var e,a=this,n=a.config,o=t("body"),c={},u=a.layHeader.find("th"),f=".layui-table-cell",h=n.elem.attr("lay-filter");u.on("mousemove",function(e){var i=t(this),a=i.offset().left,l=e.clientX-a;i.attr("colspan")>1||i.attr("unresize")||c.resizeStart||(c.allowResize=i.width()-l<=10,o.css("cursor",c.allowResize?"col-resize":""))}).on("mouseleave",function(){t(this);c.resizeStart||o.css("cursor","")}).on("mousedown",function(e){if(c.allowResize){var i=t(this).data("field");e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],a.getCssRule(i,function(e){c.rule=e,c.ruleWidth=parseFloat(e.style.width)})}}),S.on("mousemove",function(t){if(c.resizeStart){if(t.preventDefault(),c.rule){var i=c.ruleWidth+t.clientX-c.offset[0];c.rule.style.width=i+"px",l.close(a.tipsIndex)}e=1}}).on("mouseup",function(t){c.resizeStart&&(c={},o.css("cursor",""),a.scrollPatch()),2===e&&(e=null)}),u.on("click",function(){var i,l=t(this),n=l.find(k),o=n.attr("lay-sort");return n[0]&&1!==e?(i="asc"===o?"desc":"desc"===o?null:"asc",void a.sort(l,i,null,!0)):e=2}).find(k+" .layui-edge ").on("click",function(e){var i=t(this),l=i.index(),n=i.parents("th").eq(0).data("field");layui.stope(e),0===l?a.sort(n,"asc",null,!0):a.sort(n,"desc",null,!0)}),a.elem.on("click",'input[name="layTableCheckbox"]+',function(){var e=t(this).prev(),i=a.layBody.find('input[name="layTableCheckbox"]'),l=e.parents("tr").eq(0).data("index"),n=e[0].checked,o="layTableAllChoose"===e.attr("lay-filter");o?(i.each(function(e,t){t.checked=n,a.setCheckData(e,n)}),a.syncCheckAll(),a.renderForm()):(a.setCheckData(l,n),a.syncCheckAll()),layui.event.call(this,s,"checkbox("+h+")",{checked:n,data:d.cache[a.key][l],type:o?"all":"one"})}),a.layBody.on("mouseenter","tr",function(){var e=t(this),i=e.index();a.layBody.find("tr:eq("+i+")").addClass(C)}).on("mouseleave","tr",function(){var e=t(this),i=e.index();a.layBody.find("tr:eq("+i+")").removeClass(C)}),a.layBody.on("change","."+w,function(){var e=t(this),i=this.value,l=e.parent().data("field"),n=e.parents("tr").eq(0).data("index"),o=d.cache[a.key][n];o[l]=i,layui.event.call(this,s,"edit("+h+")",{value:i,data:o,field:l})}).on("blur","."+w,function(){var e,l=t(this),n=l.parent().data("field"),o=l.parents("tr").eq(0).data("index"),r=d.cache[a.key][o];a.eachCols(function(t,i){i.field==n&&i.templet&&(e=i.templet)}),l.siblings(f).html(e?i(t(e).html()||this.value).render(r):this.value),l.parent().data("content",this.value),l.remove()}),a.layBody.on("click","td",function(){var e=t(this),i=(e.data("field"),e.children(f));if(!e.data("off")){if(e.data("edit")){var o=t('');return o[0].value=e.data("content")||i.text(),e.find("."+w)[0]||e.append(o),o.focus()}i.prop("scrollWidth")>i.outerWidth()&&(a.tipsIndex=l.tips(['
                  ',i.html(),"
                  ",''].join(""),i[0],{tips:[3,""],time:-1,anim:-1,maxWidth:r.ios||r.android?300:600,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){l.close(t)})}}))}}),a.layBody.on("click","*[lay-event]",function(){var e=t(this),l=e.parents("tr").eq(0).data("index"),n=a.layBody.find('tr[data-index="'+l+'"]'),o="layui-table-click",r=d.cache[a.key][l];layui.event.call(this,s,"tool("+h+")",{data:d.clearCacheKey(r),event:e.attr("lay-event"),tr:n,del:function(){d.cache[a.key][l]=[],n.remove(),a.scrollPatch()},update:function(e){e=e||{},layui.each(e,function(e,l){if(e in r){var o,d=n.children('td[data-field="'+e+'"]');r[e]=l,a.eachCols(function(t,i){i.field==e&&i.templet&&(o=i.templet)}),d.children(f).html(o?i(t(o).html()||l).render(r):l),d.data("content",l)}})}}),n.addClass(o).siblings("tr").removeClass(o)}),a.layMain.on("scroll",function(){var e=t(this),i=e.scrollLeft(),n=e.scrollTop();a.layHeader.scrollLeft(i),a.layFixed.find(p).scrollTop(n),l.close(a.tipsIndex)}),T.on("resize",function(){a.fullSize(),a.scrollPatch()})},d.init=function(e,i){i=i||{};var a=this,l=t(e?'table[lay-filter="'+e+'"]':u+"[lay-data]"),n="Table element property lay-data configuration item has a syntax error: ";return l.each(function(){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){o.error(n+l)}var c=[],s=t.extend({elem:this,cols:[],data:[],skin:a.attr("lay-skin"),size:a.attr("lay-size"),even:"string"==typeof a.attr("lay-even")},d.config,i,l);e&&a.hide(),a.find("thead>tr").each(function(e){s.cols[e]=[],t(this).children().each(function(i){var a=t(this),l=a.attr("lay-data");try{l=new Function("return "+l)()}catch(r){return o.error(n+l)}var d=t.extend({title:a.text(),colspan:a.attr("colspan")||null,rowspan:a.attr("rowspan")||null},l);d.field&&c.push(d),s.cols[e].push(d)})}),a.find("tbody>tr").each(function(e){var i=t(this),a={};i.children("td").each(function(e,i){var l=t(this),n=l.data("field");if(n)return a[n]=l.html()}),layui.each(c,function(e,t){var l=i.children("td").eq(e);a[t.field]=l.html()}),s.data[e]=a}),d.render(s)}),a},d.checkStatus=function(e){var t=0,i=[],a=d.cache[e];return a?(layui.each(a,function(e,a){a[d.config.checkName]&&(t++,i.push(d.clearCacheKey(a)))}),{data:i,isAll:t===a.length}):{}},c.config={},d.reload=function(e,i){var a=c.config[e];return a?d.render(t.extend({},a,i)):o.error("The ID option was not found in the table instance")},d.render=function(e){var t=new A(e);return c.call(t)},d.clearCacheKey=function(e){return e=t.extend({},e),delete e[d.config.checkName],delete e[d.config.indexName],e},d.init(),e(s,d)});layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",o=">*[carousel-item]>*",l="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(o),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.indicator(),e.elemItem.length<=1||(e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
                    ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
                  "].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a',e.bar1?'
                • '+n[0]+"
                • ":"",e.bar2?'
                • '+n[1]+"
                • ":"",'
                • '+n[2]+"
                • ",""].join("")),s=u.find("."+l),b=function(){var o=r.scrollTop();o>=e.showHeight?t||(s.show(),t=1):t&&(s.hide(),t=0)};o("."+i)[0]||("object"==typeof e.css&&u.css(e.css),c.append(u),b(),u.find("li").on("click",function(){var t=o(this),a=t.attr("lay-type");"top"===a&&o("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,a)}),r.on("scroll",function(){clearTimeout(a),a=setTimeout(function(){b()},100)}))},countdown:function(e,o,t){var a=this,i="function"==typeof o,l=new Date(e).getTime(),r=new Date(!o||i?(new Date).getTime():o).getTime(),c=l-r,n=[Math.floor(c/864e5),Math.floor(c/36e5)%24,Math.floor(c/6e4)%60,Math.floor(c/1e3)%60];i&&(t=o);var u=setTimeout(function(){a.countdown(e,r+1e3,t)},1e3);return t&&t(c>0?n:[0,0,0,0],o,u),c<=0&&clearTimeout(u),u},timeAgo:function(e,o){var t=(new Date).getTime()-new Date(e).getTime();return t>2592e6?(t=new Date(e).toLocaleString(),o&&(t=t.replace(/\s[\S]+$/g,"")),t):t>=864e5?(t/1e3/60/60/24|0)+"天前":t>=36e5?(t/1e3/60/60|0)+"小时前":t>=18e4?(t/1e3/60|0)+"分钟前":t<0?"未来":"刚刚"}};e("util",t)});layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)});layui.define(["layer","form"],function(t){"use strict";var e=layui.$,i=layui.layer,a=layui.form,l=(layui.hint(),layui.device()),n="layedit",o="layui-show",r="layui-disabled",c=function(){var t=this;t.index=0,t.config={tool:["strong","italic","underline","del","|","left","center","right","|","link","unlink","face","image"],hideTool:[],height:280}};c.prototype.set=function(t){var i=this;return e.extend(!0,i.config,t),i},c.prototype.on=function(t,e){return layui.onevent(n,t,e)},c.prototype.build=function(t,i){i=i||{};var a=this,n=a.config,r="layui-layedit",c=e("#"+t),u="LAY_layedit_"+ ++a.index,d=c.next("."+r),y=e.extend({},n,i),f=function(){var t=[],e={};return layui.each(y.hideTool,function(t,i){e[i]=!0}),layui.each(y.tool,function(i,a){C[a]&&!e[a]&&t.push(C[a])}),t.join("")}(),m=e(['
                  ','
                  '+f+"
                  ",'
                  ','',"
                  ","
                  "].join(""));return l.ie&&l.ie<8?c.removeClass("layui-hide").addClass(o):(d[0]&&d.remove(),s.call(a,m,c[0],y),c.addClass("layui-hide").after(m),a.index)},c.prototype.getContent=function(t){var e=u(t);if(e[0])return d(e[0].document.body.innerHTML)},c.prototype.getText=function(t){var i=u(t);if(i[0])return e(i[0].document.body).text()},c.prototype.setContent=function(t,i,a){var l=u(t);l[0]&&(a?e(l[0].document.body).append(i):e(l[0].document.body).html(i),layedit.sync(t))},c.prototype.sync=function(t){var i=u(t);if(i[0]){var a=e("#"+i[1].attr("textarea"));a.val(d(i[0].document.body.innerHTML))}},c.prototype.getSelection=function(t){var e=u(t);if(e[0]){var i=m(e[0].document);return document.selection?i.text:i.toString()}};var s=function(t,i,a){var l=this,n=t.find("iframe");n.css({height:a.height}).on("load",function(){var o=n.contents(),r=n.prop("contentWindow"),c=o.find("head"),s=e([""].join("")),u=o.find("body");c.append(s),u.attr("contenteditable","true").css({"min-height":a.height}).html(i.value||""),y.apply(l,[r,n,i,a]),g.call(l,r,t,a)})},u=function(t){var i=e("#LAY_layedit_"+t),a=i.prop("contentWindow");return[a,i]},d=function(t){return 8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),t},y=function(t,a,n,o){var r=t.document,c=e(r.body);c.on("keydown",function(t){var e=t.keyCode;if(13===e){var a=m(r),l=p(a),n=l.parentNode;if("pre"===n.tagName.toLowerCase()){if(t.shiftKey)return;return i.msg("请暂时用shift+enter"),!1}r.execCommand("formatBlock",!1,"

                  ")}}),e(n).parents("form").on("submit",function(){var t=c.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),c.on("paste",function(e){r.execCommand("formatBlock",!1,"

                  "),setTimeout(function(){f.call(t,c),n.value=c.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),c={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},face:function(e){x.call(this,function(i){v.call(t,"img",{src:i.src,alt:i.alt},e)})},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"上传失败")}})})},code:function(e){k.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"帮助",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["http://www.layui.com/about/layedit/help.html","no"]})}},s=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"

                  "),setTimeout(function(){o.focus()},10)):c[a]&&c[a].call(this,u),h.call(t,s,i)}},d=/image/;s.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,s),i.close(x.index)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"超链接",skin:"layui-layer-msg",content:['

                    ','
                  • ','','
                    ','',"
                    ","
                  • ",'
                  • ','','
                    ','",'","
                    ","
                  • ",'
                  • ','','',"
                  • ","
                  "].join(""),success:function(t,n){var o="submit(layedit-link-yes)";a.render("radio"),t.find(".layui-btn-primary").on("click",function(){i.close(n),l.focus()}),a.on(o,function(t){i.close(b.index),e&&e(t.field)})}});b.index=n},x=function(t){var a=function(){var t=["[微笑]","[嘻嘻]","[哈哈]","[可爱]","[可怜]","[挖鼻]","[吃惊]","[害羞]","[挤眼]","[闭嘴]","[鄙视]","[爱你]","[泪]","[偷笑]","[亲亲]","[生病]","[太开心]","[白眼]","[右哼哼]","[左哼哼]","[嘘]","[衰]","[委屈]","[吐]","[哈欠]","[抱抱]","[怒]","[疑问]","[馋嘴]","[拜拜]","[思考]","[汗]","[困]","[睡]","[钱]","[失望]","[酷]","[色]","[哼]","[鼓掌]","[晕]","[悲伤]","[抓狂]","[黑线]","[阴险]","[怒骂]","[互粉]","[心]","[伤心]","[猪头]","[熊猫]","[兔子]","[ok]","[耶]","[good]","[NO]","[赞]","[来]","[弱]","[草泥马]","[神马]","[囧]","[浮云]","[给力]","[围观]","[威武]","[奥特曼]","[礼物]","[钟]","[话筒]","[蜡烛]","[蛋糕]"],e={};return layui.each(t,function(t,i){e[i]=layui.cache.dir+"images/face/"+t+".gif"}),e}();return x.hide=x.hide||function(t){"face"!==e(t.target).attr("layedit-event")&&i.close(x.index)},x.index=i.tips(function(){var t=[];return layui.each(a,function(e,i){t.push('
                • '+e+'
                • ')}),'
                    '+t.join("")+"
                  "}(),this,{tips:1,time:0,skin:"layui-box layui-util-face",maxWidth:500,success:function(l,n){l.css({marginTop:-4,marginLeft:-10}).find(".layui-clear>li").on("click",function(){t&&t({src:a[this.title],alt:this.title}),i.close(n)}),e(document).off("click",x.hide).on("click",x.hide)}})},k=function(t){var e=this,l=i.open({type:1,id:"LAY_layedit_code",area:"550px",shade:.05,shadeClose:!0,moveType:1,title:"插入代码",skin:"layui-layer-msg",content:['
                    ','
                  • ','','
                    ','","
                    ","
                  • ",'
                  • ','','
                    ','',"
                    ","
                  • ",'
                  • ','','',"
                  • ","
                  "].join(""),success:function(l,n){var o="submit(layedit-code-yes)";a.render("select"),l.find(".layui-btn-primary").on("click",function(){i.close(n),e.focus()}),a.on(o,function(e){i.close(k.index),t&&t(e.field)})}});k.index=l},C={html:'',strong:'',italic:'',underline:'',del:'',"|":'',left:'',center:'',right:'',link:'',unlink:'',face:'',image:'',code:'',help:''},w=new c;t(n,w)});layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
                  1. '+o.replace(/[\r\t\n]+/g,"
                  2. ")+"
                  "),c.find(">.layui-code-h3")[0]||c.prepend('

                  '+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

                  ");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/layui/layui.js ================================================ /** layui-v2.1.3 MIT License By http://www.layui.com */ ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.1.3"},r=function(){var e=t.scripts,o=e[e.length-1].src;return o.substring(0,o.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",util:"modules/util",flow:"modules/flow",carousel:"modules/carousel",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};n.prototype.cache=o,n.prototype.define=function(e,t){var n=this,r="function"==typeof e,a=function(){return"function"==typeof t&&t(function(e,t){layui[e]=t,o.status[e]=!0}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?a.call(n):(n.use(e,a),n)},n.prototype.use=function(e,n,l){function s(e,t){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||n.test((e.currentTarget||e.srcElement).readyState))&&(o.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*o.timeout/4?a(f+" is not a valid module"):void(o.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),n,l):"function"==typeof n&&n.apply(layui,l)}var y=this,p=o.dir=o.dir?o.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,o){"jquery"===o&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],o.host=o.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(o.modules[f])!function g(){return++m>1e3*o.timeout/4?a(f+" is not a valid module"):void("string"==typeof o.modules[f]&&o.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":o.base||"")+(y.modules[f]||f)+".js";v.async=!0,v.charset="utf-8",v.src=h+function(){var e=o.version===!0?o.v||(new Date).getTime():o.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||i?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),o.modules[f]=h}return y},n.prototype.getStyle=function(t,o){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](o)},n.prototype.link=function(e,n,r){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof n&&(r=n);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(o.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof n?i:(function p(){return++y>1e3*o.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(c),"width"))?function(){n()}():setTimeout(p,100))}(),i)},n.prototype.addcss=function(e,t,n){return layui.link(o.dir+"css/"+e,t,n)},n.prototype.img=function(e,t,o){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,o(e)}))},n.prototype.config=function(e){e=e||{};for(var t in e)o[t]=e[t];return this},n.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),n.prototype.extend=function(e){var t=this;e=e||{};for(var o in e)t[o]||t.modules[o]?a("模块名 "+o+" 已被占用"):t.modules[o]=e[o];return t},n.prototype.router=function(e){var t=this,e=e||location.hash,o={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,"").replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),o.search[t[0]]=t[1]}():o.path.push(t)}),o):o},n.prototype.data=function(t,o){if(t=t||"layui",e.JSON&&e.JSON.parse){if(null===o)return delete localStorage[t];o="object"==typeof o?o:{key:o};try{var n=JSON.parse(localStorage[t])}catch(r){var n={}}return o.value&&(n[o.key]=o.value),o.remove&&delete n[o.key],localStorage[t]=JSON.stringify(n),o.key?n[o.key]:n}},n.prototype.device=function(t){var o=navigator.userAgent.toLowerCase(),n=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(o.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(o)?"windows":/linux/.test(o)?"linux":/iphone|ipod|ipad|ios/.test(o)?"ios":/mac/.test(o)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((o.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:n("micromessenger")};return t&&!r[t]&&(r[t]=n(t)),r.android=/android/.test(o),r.ios="ios"===r.os,r},n.prototype.hint=function(){return{error:a}},n.prototype.each=function(e,t){var o,n=this;if("function"!=typeof t)return n;if(e=e||[],e.constructor===Object){for(o in e)if(t.call(e[o],o,e[o]))break}else for(o=0;oa?1:r/g, "")), a && (a = s[1] + b(a) + s[2] + "\n"), a } function f(b) { var c = m; if (j ? b = j(b, d) : g && (b = b.replace(/\n/g, function () { return m++ , "$line=" + m + ";" })), 0 === b.indexOf("=")) { var e = l && !/^=[=#]/.test(b); if (b = b.replace(/^=[=#]?|[\s;]*$/g, ""), e) { var f = b.replace(/\s*\([^\)]+\)/, ""); n[f] || /^(include|print)$/.test(f) || (b = "$escape(" + b + ")") } else b = "$string(" + b + ")"; b = s[1] + b + s[2] } return g && (b = "$line=" + c + ";" + b), r(a(b), function (a) { if (a && !p[a]) { var b; b = "print" === a ? u : "include" === a ? v : n[a] ? "$utils." + a : o[a] ? "$helpers." + a : "$data." + a, w += a + "=" + b + ",", p[a] = !0 } }), b + "\n" } var g = d.debug, h = d.openTag, i = d.closeTag, j = d.parser, k = d.compress, l = d.escape, m = 1, p = { $data: 1, $filename: 1, $utils: 1, $helpers: 1, $out: 1, $line: 1 }, q = "".trim, s = q ? ["$out='';", "$out+=", ";", "$out"] : ["$out=[];", "$out.push(", ");", "$out.join('')"], t = q ? "$out+=text;return $out;" : "$out.push(text);", u = "function(){var text=''.concat.apply('',arguments);" + t + "}", v = "function(filename,data){data=data||$data;var text=$utils.$include(filename,data,$filename);" + t + "}", w = "'use strict';var $utils=this,$helpers=$utils.$helpers," + (g ? "$line=0," : ""), x = s[0], y = "return new String(" + s[3] + ");"; r(c.split(h), function (a) { a = a.split(i); var b = a[0], c = a[1]; 1 === a.length ? x += e(b) : (x += f(b), c && (x += e(c))) }); var z = w + x + y; g && (z = "try{" + z + "}catch(e){throw {filename:$filename,name:'Render Error',message:e.message,line:$line,source:" + b(c) + ".split(/\\n/)[$line-1].replace(/^\\s+/,'')};}"); try { var A = new Function("$data", "$filename", z); return A.prototype = n, A } catch (B) { throw B.temp = "function anonymous($data,$filename) {" + z + "}", B } } var d = function (a, b) { return "string" == typeof b ? q(b, { filename: a }) : g(a, b) }; d.version = "3.0.0", d.config = function (a, b) { e[a] = b }; var e = d.defaults = { openTag: "<%", closeTag: "%>", escape: !0, cache: !0, compress: !1, parser: null }, f = d.cache = {}; d.render = function (a, b) { return q(a, b) }; var g = d.renderFile = function (a, b) { var c = d.get(a) || p({ filename: a, name: "Render Error", message: "Template not found" }); return b ? c(b) : c }; d.get = function (a) { var b; if (f[a]) b = f[a]; else if ("object" == typeof document) { var c = document.getElementById(a); if (c) { var d = (c.value || c.innerHTML).replace(/^\s*|\s*$/g, ""); b = q(d, { filename: a }) } } return b }; var h = function (a, b) { return "string" != typeof a && (b = typeof a, "number" === b ? a += "" : a = "function" === b ? h(a.call(a)) : ""), a }, i = { "<": "<", ">": ">", '"': """, "'": "'", "&": "&" }, j = function (a) { return i[a] }, k = function (a) { return h(a).replace(/&(?![\w#]+;)|[<>"']/g, j) }, l = Array.isArray || function (a) { return "[object Array]" === {}.toString.call(a) }, m = function (a, b) { var c, d; if (l(a)) for (c = 0, d = a.length; d > c; c++)b.call(a, a[c], c, a); else for (c in a) b.call(a, a[c], c) }, n = d.utils = { $helpers: {}, $include: g, $string: h, $escape: k, $each: m }; d.helper = function (a, b) { o[a] = b }; var o = d.helpers = n.$helpers; d.onerror = function (a) { var b = "Template Error\n\n"; for (var c in a) b += "<" + c + ">\n" + a[c] + "\n\n"; "object" == typeof console && console.error(b) }; var p = function (a) { return d.onerror(a), function () { return "{Template Error}" } }, q = d.compile = function (a, b) { function d(c) { try { return new i(c, h) + "" } catch (d) { return b.debug ? p(d)() : (b.debug = !0, q(a, b)(c)) } } b = b || {}; for (var g in e) void 0 === b[g] && (b[g] = e[g]); var h = b.filename; try { var i = c(a, b) } catch (j) { return j.filename = h || "anonymous", j.name = "Syntax Error", p(j) } return d.prototype = i.prototype, d.toString = function () { return i.toString() }, h && b.cache && (f[h] = d), d }, r = n.$each, s = "break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined", t = /\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|\s*\.\s*[$\w\.]+/g, u = /[^\w$]+/g, v = new RegExp(["\\b" + s.replace(/,/g, "\\b|\\b") + "\\b"].join("|"), "g"), w = /^\d[^,]*|,\d[^,]*/g, x = /^,+|,+$/g, y = /^$|,+/; e.openTag = "{{", e.closeTag = "}}"; var z = function (a, b) { var c = b.split(":"), d = c.shift(), e = c.join(":") || ""; return e && (e = ", " + e), "$helpers." + d + "(" + a + e + ")" }; e.parser = function (a) { a = a.replace(/^\s/, ""); var b = a.split(" "), c = b.shift(), e = b.join(" "); switch (c) { case "if": a = "if(" + e + "){"; break; case "else": b = "if" === b.shift() ? " if(" + b.join(" ") + ")" : "", a = "}else" + b + "{"; break; case "/if": a = "}"; break; case "each": var f = b[0] || "$data", g = b[1] || "as", h = b[2] || "$value", i = b[3] || "$index", j = h + "," + i; "as" !== g && (f = "[]"), a = "$each(" + f + ",function(" + j + "){"; break; case "/each": a = "});"; break; case "echo": a = "print(" + e + ");"; break; case "print": case "include": a = c + "(" + b.join(",") + ");"; break; default: if (/^\s*\|\s*[\w\$]/.test(e)) { var k = !0; 0 === a.indexOf("#") && (a = a.substr(1), k = !1); for (var l = 0, m = a.split("|"), n = m.length, o = m[l++]; n > l; l++)o = z(o, m[l]); a = (k ? "=" : "=#") + o } else a = d.helpers[c] ? "=#" + c + "(" + b.join(",") + ");" : "=" + a }return a }, "function" == typeof define ? define(function () { return d }) : "undefined" != typeof exports ? module.exports = d : this.template = d }(); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/emotion/emotion.css ================================================ .edui-popup-emotion .edui-emotion-jd img{ background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top; cursor:pointer;width:35px;height:35px;display:block; } .edui-popup-emotion .edui-emotion-pp img{ background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top; cursor:pointer;width:25px;height:25px;display:block; } .edui-popup-emotion .edui-emotion-ldw img{ background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top; cursor:pointer;width:35px;height:35px;display:block; } .edui-popup-emotion .edui-emotion-tsj img{ background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top; cursor:pointer;width:35px;height:35px;display:block; } .edui-popup-emotion .edui-emotion-cat img{ background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top; cursor:pointer;width:35px;height:35px;display:block; } .edui-popup-emotion .edui-emotion-bb img{ background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top; cursor:pointer;width:35px;height:35px;display:block; } .edui-popup-emotion .edui-emotion-youa img{ background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top; cursor:pointer;width:35px;height:35px;display:block; } .edui-popup-emotion .edui-emotion-smileytable { width: 100%; border-spacing: 0; border-collapse: collapse; table-layout: fixed; } .edui-popup-emotion .edui-emotion-wrapper { padding: 15px; } .edui-popup-emotion .edui-tab-nav{ height: auto; *height: 31px; } .edui-popup-emotion .edui-emotion-tabs{ clear: both; width: 0; height: 0; } .edui-popup-emotion .edui-tab-content { padding: 15px 0; } .edui-popup-emotion .edui-emotion-preview-box { width:90px; height:76px; border:2px solid #9cb945; background:#FFFFFF; background-position:center; background-repeat:no-repeat; position: absolute; top: 67px; left: 494px; display: none; } .edui-popup-emotion .edui-tab-text { font-size: 12px; } .edui-popup-emotion .edui-emotion-preview-left { left: 15px; } .edui-popup-emotion .edui-emotion-preview-img { width: 100%; height: 100%; display: block; background-repeat: no-repeat; background-position: center center; } ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/emotion/emotion.js ================================================ (function(){ var editor = null; UM.registerWidget('emotion',{ tpl: "emotion.css\">" + "
                  " + "" + "
                  " + "
                  " + "
                  " + "
                  " + "
                  " + "
                  " + "
                  " + "
                  " + "
                  " + "
                  " + "\" class=\'edui-emotion-JfaceReview edui-emotion-preview-img\'/>" + "
                  ", sourceData: { emotion: { tabNum:7, //切换面板数量 SmilmgName:{ 'edui-emotion-Jtab0':['j_00', 84], 'edui-emotion-Jtab1':['t_00', 40], 'edui-emotion-Jtab2':['w_00', 52], 'edui-emotion-Jtab3':['B_00', 63], 'edui-emotion-Jtab4':['C_00', 20], 'edui-emotion-Jtab5':['i_f', 50], 'edui-emotion-Jtab6':['y_00', 40] }, //图片前缀名 imageFolders:{ 'edui-emotion-Jtab0':'jx2/', 'edui-emotion-Jtab1':'tsj/', 'edui-emotion-Jtab2':'ldw/', 'edui-emotion-Jtab3':'bobo/', 'edui-emotion-Jtab4':'babycat/', 'edui-emotion-Jtab5':'face/', 'edui-emotion-Jtab6':'youa/'}, //图片对应文件夹路径 imageCss:{'edui-emotion-Jtab0':'jd', 'edui-emotion-Jtab1':'tsj', 'edui-emotion-Jtab2':'ldw', 'edui-emotion-Jtab3':'bb', 'edui-emotion-Jtab4':'cat', 'edui-emotion-Jtab5':'pp', 'edui-emotion-Jtab6':'youa'}, //图片css类名 imageCssOffset:{'edui-emotion-Jtab0':35, 'edui-emotion-Jtab1':35, 'edui-emotion-Jtab2':35, 'edui-emotion-Jtab3':35, 'edui-emotion-Jtab4':35, 'edui-emotion-Jtab5':25, 'edui-emotion-Jtab6':35}, //图片偏移 SmileyInfor:{ 'edui-emotion-Jtab0':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '打酱油', '俯卧撑', '气愤', '?', '吻', '怒', '胜利', 'HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '微笑', '亲吻', '调皮', '惊恐', '耍酷', '发火', '害羞', '汗水', '大哭', '', '加油', '困', '你NB', '晕倒', '开心', '偷笑', '大哭', '滴汗', '叹气', '超赞', '??', '飞吻', '天使', '撒花', '生气', '被砸', '吓傻', '随意吐'], 'edui-emotion-Jtab1':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '摊手', '睡觉', '瘫坐', '无聊', '星星闪', '旋转', '也不行', '郁闷', '正Music', '抓墙', '撞墙至死', '歪头', '戳眼', '飘过', '互相拍砖', '砍死你', '扔桌子', '少林寺', '什么?', '转头', '我爱牛奶', '我踢', '摇晃', '晕厥', '在笼子里', '震荡'], 'edui-emotion-Jtab2':['大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '我错了', 'money', '气愤', '挑逗', '吻', '怒', '胜利', '委屈', '受伤', '说啥呢?', '闭嘴', '不', '逗你玩儿', '飞吻', '眩晕', '魔法', '我来了', '睡了', '我打', '闭嘴', '打', '打晕了', '刷牙', '爆揍', '炸弹', '倒立', '刮胡子', '邪恶的笑', '不要不要', '爱恋中', '放大仔细看', '偷窥', '超高兴', '晕', '松口气', '我跑', '享受', '修养', '哭', '汗', '啊~', '热烈欢迎', '打酱油', '俯卧撑', '?'], 'edui-emotion-Jtab3':['HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '泪眼', '流泪', '生气', '吐舌', '喜欢', '旋转', '再见', '抓狂', '汗', '鄙视', '拜', '吐血', '嘘', '打人', '蹦跳', '变脸', '扯肉', '吃To', '吃花', '吹泡泡糖', '大变身', '飞天舞', '回眸', '可怜', '猛抽', '泡泡', '苹果', '亲', '', '骚舞', '烧香', '睡', '套娃娃', '捅捅', '舞倒', '西红柿', '爱慕', '摇', '摇摆', '杂耍', '招财', '被殴', '被球闷', '大惊', '理想', '欧打', '呕吐', '碎', '吐痰'], 'edui-emotion-Jtab4':['发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '顶', '幸运', '爱心', '躲', '送花', '选择'], 'edui-emotion-Jtab5':['微笑', '亲吻', '调皮', '惊讶', '耍酷', '发火', '害羞', '汗水', '大哭', '得意', '鄙视', '困', '夸奖', '晕倒', '疑问', '媒婆', '狂吐', '青蛙', '发愁', '亲吻', '', '爱心', '心碎', '玫瑰', '礼物', '哭', '奸笑', '可爱', '得意', '呲牙', '暴汗', '楚楚可怜', '困', '哭', '生气', '惊讶', '口水', '彩虹', '夜空', '太阳', '钱钱', '灯泡', '咖啡', '蛋糕', '音乐', '爱', '胜利', '赞', '鄙视', 'OK'], 'edui-emotion-Jtab6':['男兜', '女兜', '开心', '乖乖', '偷笑', '大笑', '抽泣', '大哭', '无奈', '滴汗', '叹气', '狂晕', '委屈', '超赞', '??', '疑问', '飞吻', '天使', '撒花', '生气', '被砸', '口水', '泪奔', '吓傻', '吐舌头', '点头', '随意吐', '旋转', '困困', '鄙视', '狂顶', '篮球', '再见', '欢迎光临', '恭喜发财', '稍等', '我在线', '恕不议价', '库房有货', '货在路上'] } } }, initContent:function( _editor, $widget ){ var me = this, emotion = me.sourceData.emotion, lang = _editor.getLang( 'emotion' )['static'], emotionUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/emotion/', options = $.extend( {}, lang, { emotion_url: emotionUrl }), $root = me.root(); if( me.inited ) { me.preventDefault(); this.switchToFirst(); return; } me.inited = true; editor = _editor; this.widget = $widget; emotion.SmileyPath = _editor.options.emotionLocalization === true ? emotionUrl + 'images/' : "http://img.baidu.com/hi/"; emotion.SmileyBox = me.createTabList( emotion.tabNum ); emotion.tabExist = me.createArr( emotion.tabNum ); options['cover_img'] = emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif' : 'default/0.gif'); $root.html( $.parseTmpl( me.tpl, options ) ); me.tabs = $.eduitab({selector:".edui-emotion-tab-Jpanel"}); //缓存预览对象 me.previewBox = $root.find(".edui-emotion-JtabIconReview"); me.previewImg = $root.find(".edui-emotion-JfaceReview"); me.initImgName(); }, initEvent:function(){ var me = this; //防止点击过后关闭popup me.root().on('click', function(e){ return false; }); //移动预览 me.root().delegate( 'td', 'mouseover mouseout', function( evt ){ var $td = $( this), url = $td.attr('data-surl') || null; if( url ) { me[evt.type]( this, url , $td.attr('data-posflag') ); } return false; } ); //点击选中 me.root().delegate( 'td', 'click', function( evt ){ var $td = $( this), realUrl = $td.attr('data-realurl') || null; if( realUrl ) { me.insertSmiley( realUrl.replace( /'/g, "\\'" ), evt ); } return false; } ); //更新模板 me.tabs.edui().on("beforeshow", function( evt ){ var contentId = $(evt.target).attr('data-context').replace( /^.*\.(?=[^\s]*$)/, '' ); evt.stopPropagation(); me.updateTab( contentId ); }); this.switchToFirst(); }, initImgName: function() { var emotion = this.sourceData.emotion; for ( var pro in emotion.SmilmgName ) { var tempName = emotion.SmilmgName[pro], tempBox = emotion.SmileyBox[pro], tempStr = ""; if ( tempBox.length ) return; for ( var i = 1; i <= tempName[1]; i++ ) { tempStr = tempName[0]; if ( i < 10 ) tempStr = tempStr + '0'; tempStr = tempStr + i + '.gif'; tempBox.push( tempStr ); } } }, /** * 切换到第一个tab */ switchToFirst: function(){ this.root().find(".edui-emotion-Jtabnav .edui-tab-text:first").trigger('click'); }, updateTab: function( contentBoxId ) { var me = this, emotion = me.sourceData.emotion; me.autoHeight( contentBoxId ); if ( !emotion.tabExist[ contentBoxId ] ) { emotion.tabExist[ contentBoxId ] = true; me.createTab( contentBoxId ); } }, autoHeight: function( ) { this.widget.height(this.root() + 2); }, createTabList: function( tabNum ) { var obj = {}; for ( var i = 0; i < tabNum; i++ ) { obj["edui-emotion-Jtab" + i] = []; } return obj; }, mouseover: function( td, srcPath, posFlag ) { posFlag -= 0; $(td).css( 'backgroundColor', '#ACCD3C' ); this.previewImg.css( "backgroundImage", "url(" + srcPath + ")" ); posFlag && this.previewBox.addClass('edui-emotion-preview-left'); this.previewBox.show(); }, mouseout: function( td ) { $(td).css( 'backgroundColor', 'transparent' ); this.previewBox.removeClass('edui-emotion-preview-left').hide(); }, insertSmiley: function( url, evt ) { var obj = { src: url }; obj._src = obj.src; editor.execCommand( 'insertimage', obj ); if ( !evt.ctrlKey ) { //关闭预览 this.previewBox.removeClass('edui-emotion-preview-left').hide(); this.widget.edui().hide(); } }, createTab: function( contentBoxId ) { var faceVersion = "?v=1.1", //版本号 me = this, $contentBox = this.root().find("."+contentBoxId), emotion = me.sourceData.emotion, imagePath = emotion.SmileyPath + emotion.imageFolders[ contentBoxId ], //获取显示表情和预览表情的路径 positionLine = 11 / 2, //中间数 iWidth = iHeight = 35, //图片长宽 iColWidth = 3, //表格剩余空间的显示比例 tableCss = emotion.imageCss[ contentBoxId ], cssOffset = emotion.imageCssOffset[ contentBoxId ], textHTML = [''], i = 0, imgNum = emotion.SmileyBox[ contentBoxId ].length, imgColNum = 11, faceImage, sUrl, realUrl, posflag, offset, infor; for ( ; i < imgNum; ) { textHTML.push( '' ); for ( var j = 0; j < imgColNum; j++, i++ ) { faceImage = emotion.SmileyBox[ contentBoxId ][i]; if ( faceImage ) { sUrl = imagePath + faceImage + faceVersion; realUrl = imagePath + faceImage; posflag = j < positionLine ? 0 : 1; offset = cssOffset * i * (-1) - 1; infor = emotion.SmileyInfor[ contentBoxId ][i]; textHTML.push( '' ); } textHTML.push( '' ); } textHTML.push( '
                  ' ); textHTML.push( '' ); textHTML.push( '' ); textHTML.push( '' ); } else { textHTML.push( '' ); } textHTML.push( '
                  ' ); textHTML = textHTML.join( "" ); $contentBox.html( textHTML ); }, createArr: function( tabNum ) { var arr = []; for ( var i = 0; i < tabNum; i++ ) { arr[i] = 0; } return arr; }, width:603, height:400 }); })(); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/formula/formula.css ================================================ .edui-popup-formula .edui-formula-wrapper { padding: 15px; } .edui-popup-formula .edui-formula-wrapper .edui-tab-nav{ height: auto; *height: 31px; } .edui-popup-formula .edui-formula-wrapper .edui-tab-text { font-size: 12px; } .edui-popup-formula .edui-formula-wrapper .edui-formula-clearboth { clear: both; width: 0; height: 0; } .edui-popup-formula .edui-formula-wrapper .edui-tab-pane ul { margin: 0px; padding: 0px; } .edui-popup-formula .edui-formula-wrapper .edui-tab-content { padding: 5px 0px 0px 0px; } .edui-popup-formula .edui-formula-wrapper .edui-tab-pane .edui-formula-latex-item { display: block; float: left; margin: 0px 3px 3px 0px; width: 30px; height: 30px; border:1px solid #cccccc; background-image: url("images/formula.png"); cursor: pointer; } ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/formula/formula.html ================================================ Document
                  ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/formula/formula.js ================================================ (function () { var editor = null; UM.registerWidget('formula', { tpl: "formula.css\">" + "
                  " + "
                    " + "
                    " + "
                    ", sourceData: { formula: { 'common': [ "{/}frac{ }{ }", "^{ }/_{ }", "x^{ }", "x_{ }", "x^{ }_{ }", "{/}bar{ }", "{/}sqrt{ }", "{/}nthroot{ }{ }", "{/}sum^{ }_{n=}", "{/}sum", "{/}log_{ }", "{/}ln", "{/}int_{ }^{ }", "{/}oint_{ }^{ }" ], 'symbol': [ "+", "-", "{/}pm", "{/}times", "{/}ast", "{/}div", "/", "{/}bigtriangleup", "=", "{/}ne", "{/}approx", ">", "<", "{/}ge", "{/}le", "{/}infty", "{/}cap", "{/}cup", "{/}because", "{/}therefore", "{/}subset", "{/}supset", "{/}subseteq", "{/}supseteq", "{/}nsubseteq", "{/}nsupseteq", "{/}in", "{/}ni", "{/}notin", "{/}mapsto", "{/}leftarrow", "{/}rightarrow", "{/}Leftarrow", "{/}Rightarrow", "{/}leftrightarrow", "{/}Leftrightarrow" ], 'letter': [ "{/}alpha", "{/}beta", "{/}gamma", "{/}delta", "{/}varepsilon", "{/}varphi", "{/}lambda", "{/}mu", "{/}rho", "{/}sigma", "{/}omega", "{/}Gamma", "{/}Delta", "{/}Theta", "{/}Lambda", "{/}Xi", "{/}Pi", "{/}Sigma", "{/}Upsilon", "{/}Phi", "{/}Psi", "{/}Omega" ] } }, initContent: function (_editor, $widget) { var me = this, formula = me.sourceData.formula, lang = _editor.getLang('formula').static, formulaUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/formula/', options = $.extend({}, lang, { 'formula_url': formulaUrl }), $root = me.root(); if (me.inited) { me.preventDefault(); return; } me.inited = true; editor = _editor; me.$widget = $widget; $root.html($.parseTmpl(me.tpl, options)); me.tabs = $.eduitab({selector: "#edui-formula-tab-Jpanel"}); /* 初始化popup的内容 */ var headHtml = [], xMax = 0, yMax = 0, $tabContent = me.root().find('.edui-tab-content'); $.each(formula, function (k, v) { var contentHtml = []; $.each(v, function (i, f) { contentHtml.push('
                  • '); if (++xMax >=8) { ++yMax; xMax = 0; } }); yMax++; xMax = 0; $tabContent.append('
                      ' + contentHtml.join('') + '
                    '); headHtml.push('
                  • ' + lang['lang_tab_' + k] + '
                  • '); }); headHtml.push('
                  • '); $root.find('.edui-tab-nav').html(headHtml.join('')); $root.find('.edui-tab-content').append('
                    '); /* 选中第一个tab */ me.switchTab(0); }, initEvent: function () { var me = this; //防止点击过后关闭popup me.root().on('click', function (e) { return false; }); //点击tab切换菜单 me.root().find('.edui-tab-nav').delegate('.edui-tab-item', 'click', function (evt) { me.switchTab(this); return false; }); //点击选中公式 me.root().find('.edui-tab-pane').delegate('.edui-formula-latex-item', 'click', function (evt) { var $item = $(this), latex = $item.attr('data-latex') || ''; if (latex) { me.insertLatex(latex.replace("{/}", "\\")); } me.$widget.edui().hide(); return false; }); }, switchTab:function(index){ var me = this, $root = me.root(), index = $.isNumeric(index) ? index:$.inArray(index, $root.find('.edui-tab-nav .edui-tab-item')); $root.find('.edui-tab-nav .edui-tab-item').removeClass('edui-active').eq(index).addClass('edui-active'); $root.find('.edui-tab-content .edui-tab-pane').removeClass('edui-active').eq(index).addClass('edui-active'); /* 自动长高 */ me.autoHeight(0); }, autoHeight: function () { this.$widget.height(this.root() + 2); }, insertLatex: function (latex) { editor.execCommand('formula', latex ); }, width: 350, height: 400 }); })(); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/image/image.css ================================================ .edui-dialog-image .edui-image-wrapper{font-size: 12px;margin: 15px;} /*upload*/ .edui-dialog-image .edui-image-upload1{position: absolute;top:50%;left:50%;width:44px;height:38px;margin-top:-19px; margin-left: -22px;} .edui-dialog-image .edui-image-upload2{position:relative;float:left;width:120px;height:120px;margin:5px 0 0 5px;} .edui-dialog-image .edui-image-form{position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;opacity: 0;cursor: pointer;} .edui-dialog-image .edui-image-form .edui-image-file{width: 100%;height:100%;filter: alpha(opacity=0)} .edui-dialog-image .edui-image-upload1 .edui-image-icon{display: inline-block;width:44px;height:38px;background-image: url('images/upload1.png')} .edui-dialog-image .edui-image-upload1 .edui-image-icon.hover{background-position: -50px 0;} .edui-dialog-image .edui-image-upload2 .edui-image-icon{display: inline-block;width:120px;height:120px;background-image: url('images/upload2.png')} .edui-dialog-image .edui-image-dragTip{position: absolute;display:none;top:50%;left:50%;margin-top:30px;margin-left: -60px; color: #222;font-size:14px;text-shadow: 0px 2px 3px #555;} .edui-dialog-image .edui-image-content{height:330px;width:100%;position: relative;} .edui-dialog-image .edui-image-mask{display: none;position: absolute;top:0;left:0;width: 100%; height: 100%;background-color:#fff; text-align: center;line-height:300px;color:#000;font-size:14px;font-weight:bold;opacity: 0.6;filter: alpha(opacity=60);} .edui-dialog-image .edui-image-mask.edui-active{display: block;} /*network*/ .edui-dialog-image .edui-image-searchBar{margin: 10px;} .edui-dialog-image .edui-image-searchBar .edui-image-searchTxt{display: inline-block !important;*display: inline !important;*zoom:1;width:400px; border: 1px solid #c5d2ff; height: 20px; line-height: 18px; font-size: 14px; padding: 3px; margin: 0;outline:0;} .edui-dialog-image .edui-image-searchBar .edui-image-searchAdd{display: inline-block !important;*display: inline !important;*zoom:1; width:60px; text-align:center;height: 25px;text-align: center;line-height: 25px; background-color: #ffffff;padding: 0; border: 1px solid #ababab;margin-left: 20px;cursor: pointer; } .edui-dialog-image .edui-image-searchBar .edui-image-searchAdd.hover{ background-color: #d5e1f2; padding: 0; border: 1px solid #a3bde3; } .edui-dialog-image .edui-image-searchRes{height:280px;overflow:auto;} /*common*/ .edui-dialog-image .edui-image-item{position:relative;float:left;width:120px;height:120px;border: 1px solid #CCC;cursor: default;margin: 5px 0 0 5px;} .edui-dialog-image .edui-image-item .edui-image-pic{position: absolute;left:-9999px;} .edui-dialog-image .edui-image-item .edui-image-close{position:absolute;right:0;background: url('images/close.png');width:17px;height:17px;cursor:pointer;z-index:1} .edui-dialog-image .edui-image-item.hover .edui-image-close{display: block;} ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/image/image.js ================================================ (function () { var utils = UM.utils, browser = UM.browser, Base = { checkURL: function (url) { if(!url) return false; url = utils.trim(url); if (url.length <= 0) { return false; } if (url.search(/http:\/\/|https:\/\//) !== 0) { url += 'http://'; } url=url.replace(/\?[\s\S]*$/,""); if (!/(.gif|.jpg|.jpeg|.png)$/i.test(url)) { return false; } return url; }, getAllPic: function (sel, $w, editor) { var me = this, arr = [], $imgs = $(sel, $w); $.each($imgs, function (index, node) { $(node).removeAttr("width").removeAttr("height"); // if (node.width > editor.options.initialFrameWidth) { // me.scale(node, editor.options.initialFrameWidth - // parseInt($(editor.body).css("padding-left")) - // parseInt($(editor.body).css("padding-right"))); // } return arr.push({ _src: node.src, src: node.src }); }); return arr; }, scale: function (img, max, oWidth, oHeight) { var width = 0, height = 0, percent, ow = img.width || oWidth, oh = img.height || oHeight; if (ow > max || oh > max) { if (ow >= oh) { if (width = ow - max) { percent = (width / ow).toFixed(2); img.height = oh - oh * percent; img.width = max; } } else { if (height = oh - max) { percent = (height / oh).toFixed(2); img.width = ow - ow * percent; img.height = max; } } } return this; }, close: function ($img) { $img.css({ top: ($img.parent().height() - $img.height()) / 2, left: ($img.parent().width()-$img.width())/2 }).prev().on("click",function () { if ( $(this).parent().remove().hasClass("edui-image-upload-item") ) { //显示图片计数-1 Upload.showCount--; Upload.updateView(); } }); return this; }, createImgBase64: function (img, file, $w) { if (browser.webkit) { //Chrome8+ img.src = window.webkitURL.createObjectURL(file); } else if (browser.gecko) { //FF4+ img.src = window.URL.createObjectURL(file); } else { //实例化file reader对象 var reader = new FileReader(); reader.onload = function (e) { img.src = this.result; $w.append(img); }; reader.readAsDataURL(file); } }, callback: function (editor, $w, url, state) { if (state == "SUCCESS") { //显示图片计数+1 Upload.showCount++; var $img = $(""), $item = $("
                    ").append($img); if ($(".edui-image-upload2", $w).length < 1) { $(".edui-image-content", $w).append($item); Upload.render(".edui-image-content", 2) .config(".edui-image-upload2"); } else { $(".edui-image-upload2", $w).before($item).show(); } $img.on("load", function () { Base.scale(this, 120); Base.close($(this)); $(".edui-image-content", $w).focus(); }); } else { currentDialog.showTip( state ); window.setTimeout( function () { currentDialog.hideTip(); }, 3000 ); } Upload.toggleMask(); } }; /* * 本地上传 * */ var Upload = { showCount: 0, uploadTpl: '
                    ' + '' + '
                    ' + '' + '
                    ' + '
                    ', init: function (editor, $w) { var me = this; me.editor = editor; me.dialog = $w; me.render(".edui-image-local", 1); me.config(".edui-image-upload1"); me.submit(); me.drag(); $(".edui-image-upload1").hover(function () { $(".edui-image-icon", this).toggleClass("hover"); }); if (!(UM.browser.ie && UM.browser.version <= 9)) { $(".edui-image-dragTip", me.dialog).css("display", "block"); } return me; }, render: function (sel, t) { var me = this; $(sel, me.dialog).append($(me.uploadTpl.replace(/%%/g, t))); return me; }, config: function (sel) { var me = this, url=me.editor.options.imageUrl; url=url + (url.indexOf("?") == -1 ? "?" : "&") + "editorid="+me.editor.id;//初始form提交地址; $("form", $(sel, me.dialog)).attr("action", url); return me; }, uploadComplete: function(r){ var me = this; try{ var json = eval('('+r+')'); Base.callback(me.editor, me.dialog, json.url, json.state); }catch (e){ var lang = me.editor.getLang('image'); Base.callback(me.editor, me.dialog, '', (lang && lang.uploadError) || 'Error!'); } }, submit: function (callback) { var me = this, input = $( ''), input = input[0]; $(me.dialog).delegate( ".edui-image-file", "change", function ( e ) { if ( !this.parentNode ) { return; } $('').insertBefore(me.dialog).on('load', function(){ var r = this.contentWindow.document.body.innerHTML; if(r == '')return; me.uploadComplete(r); $(this).unbind('load'); $(this).remove(); }); $(this).parent()[0].submit(); Upload.updateInput( input ); me.toggleMask("Loading...."); callback && callback(); }); return me; }, //更新input updateInput: function ( inputField ) { $( ".edui-image-file", this.dialog ).each( function ( index, ele ) { ele.parentNode.replaceChild( inputField.cloneNode( true ), ele ); } ); }, //更新上传框 updateView: function () { if ( Upload.showCount !== 0 ) { return; } $(".edui-image-upload2", this.dialog).hide(); $(".edui-image-dragTip", this.dialog).show(); $(".edui-image-upload1", this.dialog).show(); }, drag: function () { var me = this; //做拽上传的支持 if (!UM.browser.ie9below) { me.dialog.find('.edui-image-content').on('drop',function (e) { //获取文件列表 var fileList = e.originalEvent.dataTransfer.files; var img = document.createElement('img'); var hasImg = false; $.each(fileList, function (i, f) { if (/^image/.test(f.type)) { //创建图片的base64 Base.createImgBase64(img, f, me.dialog); var xhr = new XMLHttpRequest(); xhr.open("post", me.editor.getOpt('imageUrl') + "?type=ajax", true); xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); //模拟数据 var fd = new FormData(); fd.append(me.editor.getOpt('imageFieldName'), f); xhr.send(fd); xhr.addEventListener('load', function (e) { var r = e.target.response, json; me.uploadComplete(r); if (i == fileList.length - 1) { $(img).remove() } }); hasImg = true; } }); if (hasImg) { e.preventDefault(); me.toggleMask("Loading...."); } }).on('dragover', function (e) { e.preventDefault(); }); } }, toggleMask: function (html) { var me = this; var $mask = $(".edui-image-mask", me.dialog); if (html) { if (!(UM.browser.ie && UM.browser.version <= 9)) { $(".edui-image-dragTip", me.dialog).css( "display", "none" ); } $(".edui-image-upload1", me.dialog).css( "display", "none" ); $mask.addClass("edui-active").html(html); } else { $mask.removeClass("edui-active").html(); if ( Upload.showCount > 0 ) { return me; } if (!(UM.browser.ie && UM.browser.version <= 9) ){ $(".edui-image-dragTip", me.dialog).css("display", "block"); } $(".edui-image-upload1", me.dialog).css( "display", "block" ); } return me; } }; /* * 网络图片 * */ var NetWork = { init: function (editor, $w) { var me = this; me.editor = editor; me.dialog = $w; me.initEvt(); }, initEvt: function () { var me = this, url, $ele = $(".edui-image-searchTxt", me.dialog); $(".edui-image-searchAdd", me.dialog).on("click", function () { url = Base.checkURL($ele.val()); if (url) { $("").on("load", function () { var $item = $("
                    ").append(this); $(".edui-image-searchRes", me.dialog).append($item); Base.scale(this, 120); $item.width($(this).width()); Base.close($(this)); $ele.val(""); }); } }) .hover(function () { $(this).toggleClass("hover"); }); } }; var $tab = null, currentDialog = null; UM.registerWidget('image', { tpl: "image.css\">" + "
                    " + "" + "
                    " + "
                    " + "
                    " + "
                    " + "
                    <%=lang_input_dragTip%>
                    " + "
                    " + "
                    " + "
                    " + "" + "
                    <%=lang_btn_add%>
                    " + "
                    " + "
                    " + "
                    " + "
                    " + "
                    ", initContent: function (editor, $dialog) { var lang = editor.getLang('image')["static"], opt = $.extend({}, lang, { image_url: UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/image/' }); Upload.showCount = 0; if (lang) { var html = $.parseTmpl(this.tpl, opt); } currentDialog = $dialog.edui(); this.root().html(html); }, initEvent: function (editor, $w) { $tab = $.eduitab({selector: ".edui-image-wrapper"}) .edui().on("beforeshow", function (e) { e.stopPropagation(); }); Upload.init(editor, $w); NetWork.init(editor, $w); }, buttons: { 'ok': { exec: function (editor, $w) { var sel = "", index = $tab.activate(); if (index == 0) { sel = ".edui-image-content .edui-image-pic"; } else if (index == 1) { sel = ".edui-image-searchRes .edui-image-pic"; } var list = Base.getAllPic(sel, $w, editor); if (index != -1) { editor.execCommand('insertimage', list); } } }, 'cancel': {} }, width: 700, height: 408 }, function (editor, $w, url, state) { Base.callback(editor, $w, url, state) }) })(); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/link/link.js ================================================ (function(){ var utils = UM.utils; function hrefStartWith(href, arr) { href = href.replace(/^\s+|\s+$/g, ''); for (var i = 0, ai; ai = arr[i++];) { if (href.indexOf(ai) == 0) { return true; } } return false; } UM.registerWidget('link', { tpl: "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + // "" + // "" + // "" + "", initContent: function (editor) { var lang = editor.getLang('link'); if (lang) { var html = $.parseTmpl(this.tpl, lang.static); } this.root().html(html); }, initEvent: function (editor, $w) { var link = editor.queryCommandValue('link'); if(link){ $('#edui-link-Jhref',$w).val(utils.html($(link).attr('href'))); $('#edui-link-Jtitle',$w).val($(link).attr('title')); $(link).attr('target') == '_blank' && $('#edui-link-Jtarget').attr('checked',true) } $('#edui-link-Jhref',$w).focus(); }, buttons: { 'ok': { exec: function (editor, $w) { var href = $('#edui-link-Jhref').val().replace(/^\s+|\s+$/g, ''); if (href) { editor.execCommand('link', { 'href': href, 'target': $("#edui-link-Jtarget:checked").length ? "_blank" : '_self', 'title': $("#edui-link-Jtitle").val().replace(/^\s+|\s+$/g, ''), '_href': href }); } } }, 'cancel':{} }, width: 400 }) })(); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/map/map.html ================================================ 百度地图API自定义地图
                    ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/map/map.js ================================================ (function () { var widgetName = 'map'; UM.registerWidget(widgetName, { tpl: "" + "
                    " + "" + "" + "" + "" + "" + "" + "" + ""+ "" + "
                    <%=lang_city%>:\"/><%=lang_address%>:<%=lang_search%>
                    " + "
                    " + "
                    " + "", initContent: function (editor, $widget) { var me = this, lang = editor.getLang(widgetName), theme_url = editor.options.themePath + editor.options.theme; if( me.inited ) { me.preventDefault(); return false; } me.inited = true; me.lang = lang; me.editor = editor; me.root().html($.parseTmpl(me.tpl, $.extend({}, lang['static'], { 'theme_url': theme_url }))); me.initRequestApi(); }, /** * 初始化请求API */ initRequestApi: function () { var $ifr = null; //已经初始化过, 不用再次初始化 if (window.BMap && window.BMap.Map) { this.initBaiduMap(); } else { $ifr = $(''); $ifr.appendTo( this.root() ); $ifr = $ifr[ 0 ].contentWindow.document; $ifr.open(); $ifr.write( this.root().find(".edui-tpl-container").html().replace( /scr_ipt/g, 'script').replace('<>',"'" + this.editor.id + "'") ); } }, requestMapApi: function (src) { var me = this; if (src.length) { var _src = src[0]; src = src.slice(1); if (_src) { $.getScript(_src, function () { me.requestMapApi(src); }); } else { me.requestMapApi(src); } } else { me.initBaiduMap(); } }, initBaiduMap: function () { var $root = this.root(), map = new BMap.Map($root.find(".edui-map-container")[0]), me = this, marker, point, imgcss, img = $(me.editor.selection.getRange().getClosedNode()); map.enableInertialDragging(); map.enableScrollWheelZoom(); map.enableContinuousZoom(); if (img.length && /api[.]map[.]baidu[.]com/ig.test(img.attr("src"))) { var url = img.attr("src"), centerPos = me.getPars(url, "center").split(","), markerPos = me.getPars(url, "markers").split(","); point = new BMap.Point(Number(centerPos[0]), Number(centerPos[1])); marker = new BMap.Marker(new BMap.Point(Number(markerPos[0]), Number(markerPos[1]))); map.addControl(new BMap.NavigationControl()); map.centerAndZoom(point, Number(me.getPars(url, "zoom"))); imgcss = img.attr('style'); } else { point = new BMap.Point(116.404, 39.915); // 创建点坐标 marker = new BMap.Marker(point); map.addControl(new BMap.NavigationControl()); map.centerAndZoom(point, 10); // 初始化地图,设置中心点坐标和地图级别。 } marker.enableDragging(); map.addOverlay(marker); me.map = map; me.marker = marker; me.imgcss = imgcss; }, doSearch: function () { var me = this, city = me.root().find('.edui-map-city').val(), address = me.root().find('.edui-map-address').val(); if (!city) { alert(me.lang.cityMsg); return; } var search = new BMap.LocalSearch(city, { onSearchComplete: function (results) { if (results && results.getNumPois()) { var points = []; for (var i = 0; i < results.getCurrentNumPois(); i++) { points.push(results.getPoi(i).point); } if (points.length > 1) { me.map.setViewport(points); } else { me.map.centerAndZoom(points[0], 13); } point = me.map.getCenter(); me.marker.setPoint(point); } else { alert(me.lang.errorMsg); } } }); search.search(address || city); }, getPars: function (str, par) { var reg = new RegExp(par + "=((\\d+|[.,])*)", "g"); return reg.exec(str)[1]; }, reset: function(){ this.map && this.map.reset(); }, initEvent: function () { var me = this, $root = me.root(); $root.find('.edui-map-address').on('keydown', function (evt) { evt = evt || event; if (evt.keyCode == 13) { me.doSearch(); return false; } }); $root.find(".edui-map-button").on('click', function (evt) { me.doSearch(); }); $root.find(".edui-map-address").focus(); $root.on( "mousewheel DOMMouseScroll", function ( e ) { return false; } ); }, width: 580, height: 408, buttons: { ok: { exec: function (editor) { var widget = editor.getWidgetData(widgetName), center = widget.map.getCenter(), zoom = widget.map.getZoom(), size = widget.map.getSize(), point = widget.marker.P; if (widget.root().find(".edui-map-dynamic")[0].checked) { var URL = editor.getOpt('UMEDITOR_HOME_URL'), url = [URL + (/\/$/.test(URL) ? '':'/') + "dialogs/map/map.html" + '#center=' + center.lng + ',' + center.lat, '&zoom=' + zoom, '&width=' + size.width, '&height=' + size.height, '&markers=' + point.lng + ',' + point.lat].join(''); editor.execCommand('inserthtml', ''); } else { url = "http://api.map.baidu.com/staticimage?center=" + center.lng + ',' + center.lat + "&zoom=" + zoom + "&width=" + size.width + '&height=' + size.height + "&markers=" + point.lng + ',' + point.lat; editor.execCommand('inserthtml', '', true); } widget.reset(); } }, cancel: { exec: function(editor){ editor.getWidgetData(widgetName).reset(); } } } }); })(); ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/video/video.css ================================================ @charset "utf-8"; .edui-dialog-video .edui-video-wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative} .edui-dialog-video .edui-video-tabbody{height:335px;} .edui-dialog-video .edui-video-panel { position: absolute;width:100%; height:100%;background: #fff;} .edui-dialog-video .edui-video-panel table td{vertical-align: middle;} .edui-dialog-video #eduiVideoUrl { width: 470px; height: 21px; line-height: 21px; margin: 8px 5px; background: #FFF; border: 1px solid #d7d7d7; } .edui-dialog-video #eduiVideoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;} .edui-dialog-video #searchList{width: 570px;overflow: auto;zoom:1;height: 270px;} .edui-dialog-video #searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;} .edui-dialog-video #searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/ .edui-dialog-video #searchList p{margin-left: 10px;} .edui-dialog-video #eduiVideoType{ width: 65px; height: 23px; line-height: 22px; border: 1px solid #d7d7d7; } .edui-dialog-video #eduiVideoSearchBtn,.edui-dialog-video #eduiVideoSearchReset{ /*width: 80px;*/ height: 25px; line-height: 25px; background: #eee; border: 1px solid #d7d7d7; cursor: pointer; padding: 0 5px; } .edui-dialog-video #eduiVideoPreview{width: 420px; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left} .edui-dialog-video #eduiVideoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;} .edui-dialog-video .edui-video-wrapper fieldset{ border: 1px solid #ddd; padding-left: 5px; margin-bottom: 20px; padding-bottom: 5px; width: 115px; } .edui-dialog-video .edui-video-wrapper fieldset legend{font-weight: bold;} .edui-dialog-video .edui-video-wrapper fieldset p{line-height: 30px;} .edui-dialog-video .edui-video-wrapper fieldset input.edui-video-txt{ width: 65px; height: 21px; line-height: 21px; margin: 8px 5px; background: #FFF; border: 1px solid #d7d7d7; } .edui-dialog-video .edui-video-wrapper label.edui-video-url{font-weight: bold;margin-left: 5px;color: #06c;} .edui-dialog-video #eduiVideoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} .edui-dialog-video #eduiVideoFloat .edui-video-focus{opacity: 1;filter: alpha(opacity = 100)} .edui-dialog-video .edui-video-wrapper span.edui-video-view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue} ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/dialogs/video/video.js ================================================ (function(){ var domUtils = UM.dom.domUtils; var widgetName = 'video'; UM.registerWidget( widgetName,{ tpl: "video.css\" />" + "
                    " + "
                    " + "
                    " + "<%=lang_tab_insertV%>" + "
                    " + "
                    " + "
                    " + "
                    " + "
                    " + "
                    " + "
                    " + "<%=lang_video_size%>" + "" + "" + "" + "
                    " + "
                    " + "
                    " + "<%=lang_alignment%>" + "
                    " + "
                    " + "
                    " + "
                    " + "
                    " + "
                    " + "
                    ", initContent:function( editor, $widget ){ var me = this, lang = editor.getLang( widgetName), video_url = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/video/'; me.lang = lang; me.editor = editor; me.$widget = $widget; me.root().html( $.parseTmpl( me.tpl, $.extend( { video_url: video_url }, lang['static'] ) ) ); me.initController( lang ); }, initEvent:function(){ var me = this, url = $("#eduiVideoUrl", me.$widget)[0]; if( 'oninput' in url ) { url.oninput = function(){ me.createPreviewVideo( this.value ); }; } else { url.onpropertychange = function () { me.createPreviewVideo( this.value ); } } }, initController: function( lang ){ var me = this, img = me.editor.selection.getRange().getClosedNode(), url; me.createAlignButton( ["eduiVideoFloat"] ); //编辑视频时初始化相关信息 if(img && img.className == "edui-faked-video"){ $("#eduiVideoUrl", me.$widget)[0].value = url = img.getAttribute("_url"); $("#eduiVideoWidth", me.$widget)[0].value = img.width; $("#eduiVideoHeight", me.$widget)[0].value = img.height; var align = domUtils.getComputedStyle(img,"float"), parentAlign = domUtils.getComputedStyle(img.parentNode,"text-align"); me.updateAlignButton(parentAlign==="center"?"center":align); } me.createPreviewVideo(url); }, /** * 根据url生成视频预览 */ createPreviewVideo: function(url){ if ( !url )return; var me = this, lang = me.lang, conUrl = me.convert_url(url); if(!me.endWith(conUrl,[".swf",".flv",".wmv"])){ $("#eduiVideoPreview", me.$widget).html( lang.urlError ); return; } $("#eduiVideoPreview", me.$widget)[0].innerHTML = ''; }, /** * 将单个视频信息插入编辑器中 */ insertSingle: function(){ var me = this, width = $("#eduiVideoWidth", me.$widget)[0], height = $("#eduiVideoHeight", me.$widget)[0], url=$('#eduiVideoUrl', me.$widget)[0].value, align = this.findFocus("eduiVideoFloat","name"); if(!url) return false; if ( !me.checkNum( [width, height] ) ) return false; this.editor.execCommand('insertvideo', { url: me.convert_url(url), width: width.value, height: height.value, align: align }); }, /** * URL转换 */ convert_url: function(url){ if ( !url ) return ''; var matches = url.match(/youtu.be\/(\w+)$/) || url.match(/youtube\.com\/watch\?v=(\w+)/) || url.match(/youtube.com\/v\/(\w+)/), youku = url.match(/youku\.com\/v_show\/id_(\w+)/), youkuPlay = /player\.youku\.com/ig.test(url); if(youkuPlay){ url = url.replace(/\?f=.*/, ""); } else if (matches){ url = "https://www.youtube.com/v/" + matches[1] + "?version=3&feature=player_embedded"; }else if(youku){ url = "http://player.youku.com/player.php/sid/"+youku[1]+"/v.swf" } else { url = url.replace(/http:\/\/www\.tudou\.com\/programs\/view\/([\w\-]+)\/?/i, "http://www.tudou.com/v/$1") .replace(/http:\/\/www\.youtube\.com\/watch\?v=([\w\-]+)/i, "http://www.youtube.com/v/$1") .replace(/http:\/\/v\.youku\.com\/v_show\/id_([\w\-=]+)\.html/i, "http://player.youku.com/player.php/sid/$1") .replace(/http:\/\/www\.56\.com\/u\d+\/v_([\w\-]+)\.html/i, "http://player.56.com/v_$1.swf") .replace(/http:\/\/www.56.com\/w\d+\/play_album\-aid\-\d+_vid\-([^.]+)\.html/i, "http://player.56.com/v_$1.swf") .replace(/http:\/\/v\.ku6\.com\/.+\/([^.]+)\.html/i, "http://player.ku6.com/refer/$1/v.swf") .replace(/\?f=.*/, ""); } return url; }, /** * 检测传入的所有input框中输入的长宽是否是正数 */ checkNum: function checkNum( nodes ) { var me = this; for ( var i = 0, ci; ci = nodes[i++]; ) { var value = ci.value; if ( !me.isNumber( value ) && value) { alert( me.lang.numError ); ci.value = ""; ci.focus(); return false; } } return true; }, /** * 数字判断 * @param value */ isNumber: function( value ) { return /(0|^[1-9]\d*$)/.test( value ); }, updateAlignButton: function( align ) { var aligns = $( "#eduiVideoFloat", this.$widget )[0].children; for ( var i = 0, ci; ci = aligns[i++]; ) { if ( ci.getAttribute( "name" ) == align ) { if ( ci.className !="edui-video-focus" ) { ci.className = "edui-video-focus"; } } else { if ( ci.className =="edui-video-focus" ) { ci.className = ""; } } } }, /** * 创建图片浮动选择按钮 * @param ids */ createAlignButton: function( ids ) { var lang = this.lang, vidoe_home = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/video/'; for ( var i = 0, ci; ci = ids[i++]; ) { var floatContainer = $( "#" + ci, this.$widget ) [0], nameMaps = {"none":lang['default'], "left":lang.floatLeft, "right":lang.floatRight}; for ( var j in nameMaps ) { var div = document.createElement( "div" ); div.setAttribute( "name", j ); if ( j == "none" ) div.className="edui-video-focus"; div.style.cssText = "background:url("+ vidoe_home +"images/" + j + "_focus.jpg);"; div.setAttribute( "title", nameMaps[j] ); floatContainer.appendChild( div ); } this.switchSelect( ci ); } }, /** * 选择切换 */ switchSelect: function( selectParentId ) { var selects = $( "#" + selectParentId, this.$widget )[0].children; for ( var i = 0, ci; ci = selects[i++]; ) { $(ci).on("click", function () { for ( var j = 0, cj; cj = selects[j++]; ) { cj.className = ""; cj.removeAttribute && cj.removeAttribute( "class" ); } this.className = "edui-video-focus"; } ) } }, /** * 找到id下具有focus类的节点并返回该节点下的某个属性 * @param id * @param returnProperty */ findFocus: function( id, returnProperty ) { var tabs = $( "#" + id , this.$widget)[0].children, property; for ( var i = 0, ci; ci = tabs[i++]; ) { if ( ci.className=="edui-video-focus" ) { property = ci.getAttribute( returnProperty ); break; } } return property; }, /** * 末尾字符检测 */ endWith: function(str,endStrArr){ for(var i=0,len = endStrArr.length;i UMEDITOR 完整demo

                    UMEDITOR 完整demo

                               
                               
                         

                    ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/lang/en/en.js ================================================ /** * English language package */ UM.I18N['en'] = { 'labelMap':{ 'anchor':'Anchor', 'undo':'Undo', 'redo':'Redo', 'bold':'Bold', 'indent':'Indent', 'snapscreen':'SnapScreen', 'italic':'Italic', 'underline':'Underline', 'strikethrough':'Strikethrough', 'subscript':'SubScript','fontborder':'text border', 'superscript':'SuperScript', 'formatmatch':'Format Match', 'source':'Source', 'blockquote':'BlockQuote', 'pasteplain':'PastePlain', 'selectall':'SelectAll', 'print':'Print', 'preview':'Preview', 'horizontal':'Horizontal', 'removeformat':'RemoveFormat', 'time':'Time', 'date':'Date', 'unlink':'Unlink', 'insertrow':'InsertRow', 'insertcol':'InsertCol', 'mergeright':'MergeRight', 'mergedown':'MergeDown', 'deleterow':'DeleteRow', 'deletecol':'DeleteCol', 'splittorows':'SplitToRows','insertcode':'insert code', 'splittocols':'SplitToCols', 'splittocells':'SplitToCells','deletecaption':'DeleteCaption','inserttitle':'InsertTitle', 'mergecells':'MergeCells', 'deletetable':'DeleteTable', 'cleardoc':'Clear', 'insertparagraphbeforetable':"InsertParagraphBeforeTable", 'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph', 'image':'Image','edittable':'Edit Table', 'edittd':'Edit Td','link':'Link', 'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap', 'video':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter', 'justifyjustify':'Justify', 'forecolor':'FontColor', 'backcolor':'BackColor', 'insertorderedlist':'OL', 'insertunorderedlist':'UL', 'fullscreen':'FullScreen', 'directionalityltr':'EnterFromLeft', 'directionalityrtl':'EnterFromRight', 'rowspacingtop':'RowSpacingTop', 'rowspacingbottom':'RowSpacingBottom', 'highlightcode':'Code', 'pagebreak':'PageBreak', 'insertframe':'Iframe', 'imagenone':'Default', 'imageleft':'ImageLeft', 'imageright':'ImageRight', 'attachment':'Attachment', 'imagecenter':'ImageCenter', 'wordimage':'WordImage', 'lineheight':'LineHeight','edittip':'EditTip','customstyle':'CustomStyle', 'scrawl':'Scrawl', 'autotypeset':'AutoTypeset', 'webapp':'WebAPP', 'touppercase':'UpperCase', 'tolowercase':'LowerCase','template':'Template','background':'Background','inserttable':'InsertTable', 'drafts': 'drafts', 'formula':'formula' }, 'paragraph':{'p':'Paragraph', 'h1':'Title 1', 'h2':'Title 2', 'h3':'Title 3', 'h4':'Title 4', 'h5':'Title 5', 'h6':'Title 6'}, 'fontfamily':{ 'songti':'Sim sun', 'kaiti':'Sim kai', 'heiti':'Sim hei', 'lishu':'Sim li', 'yahei': 'Microsoft yahei', 'andaleMono':'Andale mono', 'arial': 'Arial', 'arialBlack':'Arial black', 'comicSansMs':'Comic sans ms', 'impact':'Impact', 'timesNewRoman':'Times new roman' }, 'ok':"OK", 'cancel':"Cancel", 'closeDialog':"closeDialog", 'tableDrag':"You must import the file uiUtils.js before drag! ", 'autofloatMsg':"The plugin AutoFloat depends on EditorUI!", 'anthorMsg':"Link", 'clearColor':'Clear', 'standardColor':'Standard color', 'themeColor':'Theme color', 'property':'Property', 'default':'Default', 'modify':'Modify', 'justifyleft':'Justify Left', 'justifyright':'Justify Right', 'justifycenter':'Justify Center', 'justify':'Default', 'clear':'Clear', 'anchorMsg':'Anchor', 'delete':'Delete', 'clickToUpload':"Click to upload", 'unset':"Language hasn't been set!", 't_row':'row', 't_col':'col', 'more':'More', 'pasteOpt':'Paste Option', 'pasteSourceFormat':"Keep Source Formatting", 'tagFormat':'Keep tag', 'pasteTextFormat':'Keep Text only', //===============dialog i18N======================= 'image':{ 'static':{ 'lang_tab_local':"Local Upload", 'lang_tab_imgSearch':"Network Pictures", 'lang_input_dragTip':"Support drag upload", 'lang_btn_add':"Add" }, 'uploadError': 'Upload Error' }, 'emotion':{ 'static':{ 'lang_input_choice':'Choice', 'lang_input_Tuzki':'Tuzki', 'lang_input_lvdouwa':'LvDouWa', 'lang_input_BOBO':'BOBO', 'lang_input_babyCat':'BabyCat', 'lang_input_bubble':'Bubble', 'lang_input_youa':'YouA' } }, 'gmap':{ 'static':{ 'lang_input_address':'Address:', 'lang_input_search':'Search', 'address':{'value':"Beijing"} }, 'searchError':'Unable to locate the address!' }, 'link':{ 'static':{ 'lang_input_text':'Text:', 'lang_input_url':'URL:', 'lang_input_title':'Title:', 'lang_input_target':'open in new window:' }, 'validLink':'Supports only effective when a link is selected', 'httpPrompt':'The hyperlink you enter should start with "http|https|ftp://"!' }, 'map':{ 'static':{ 'lang_city':"City", 'lang_address':"Address", 'city':{'value':"Beijing"}, 'lang_search':"Search", 'lang_dynamicmap':"Dynamic map" }, 'cityMsg':"Please enter the city name!", 'errorMsg':"Can't find the place!" }, 'video':{ 'static':{ 'lang_tab_insertV':"Video", 'lang_video_url':" URL ", 'lang_video_size':"Video Size", 'lang_videoW':"Width", 'lang_videoH':"Height", 'lang_alignment':"Alignment", 'videoSearchTxt':{'value':"Enter the search keyword!"}, 'videoType':{'options':["All", "Hot", "Entertainment", "Funny", "Sports", "Science", "variety"]}, 'videoSearchBtn':{'value':"Search in Baidu"}, 'videoSearchReset':{'value':"Clear result"} }, 'numError':"Please enter the correct Num. e.g 123,400", 'floatLeft':"Float left", 'floatRight':"Float right", 'default':"Default", 'block':"Display in block", 'urlError':"The video url format may be wrong!", 'loading':"  The video is loading, please wait…", 'clickToSelect':"Click to select", 'goToSource':'Visit source video ', 'noVideo':"    Sorry,can't find the video,please try again!" }, 'formula':{ 'static':{ 'lang_tab_common':'Common', 'lang_tab_symbol':'Symbol', 'lang_tab_letter':'Letter' } } }; ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/lang/zh-cn/zh-cn.js ================================================ /** * 中文语言包 */ UM.I18N['zh-cn'] = { 'labelMap':{ 'anchor':'锚点', 'undo':'撤销', 'redo':'重做', 'bold':'加粗', 'indent':'首行缩进', 'snapscreen':'截图', 'italic':'斜体', 'underline':'下划线', 'strikethrough':'删除线', 'subscript':'下标','fontborder':'字符边框', 'superscript':'上标', 'formatmatch':'格式刷', 'source':'源代码', 'blockquote':'引用', 'pasteplain':'纯文本粘贴模式', 'selectall':'全选', 'print':'打印', 'preview':'预览', 'horizontal':'分隔线', 'removeformat':'清除格式', 'time':'时间', 'date':'日期', 'unlink':'取消链接', 'insertrow':'前插入行', 'insertcol':'前插入列', 'mergeright':'右合并单元格', 'mergedown':'下合并单元格', 'deleterow':'删除行', 'deletecol':'删除列', 'splittorows':'拆分成行', 'splittocols':'拆分成列', 'splittocells':'完全拆分单元格', 'mergecells':'合并多个单元格', 'deletetable':'删除表格', 'cleardoc':'清空文档','insertparagraphbeforetable':"表格前插入行",'insertcode':'代码语言','fontfamily':'字体', 'fontsize':'字号', 'paragraph':'段落格式', 'image':'图片', 'edittable':'表格属性','edittd':'单元格属性', 'link':'超链接','emotion':'表情', 'spechars':'特殊字符', 'searchreplace':'查询替换', 'map':'百度地图', 'gmap':'Google地图', 'video':'视频', 'help':'帮助', 'justifyleft':'居左对齐', 'justifyright':'居右对齐', 'justifycenter':'居中对齐', 'justifyjustify':'两端对齐', 'forecolor':'字体颜色', 'backcolor':'背景色', 'insertorderedlist':'有序列表', 'insertunorderedlist':'无序列表', 'fullscreen':'全屏', 'directionalityltr':'从左向右输入', 'directionalityrtl':'从右向左输入', 'rowspacingtop':'段前距', 'rowspacingbottom':'段后距', 'highlightcode':'插入代码', 'pagebreak':'分页', 'insertframe':'插入Iframe', 'imagenone':'默认', 'imageleft':'左浮动', 'imageright':'右浮动', 'attachment':'附件', 'imagecenter':'居中', 'wordimage':'图片转存', 'lineheight':'行间距','edittip' :'编辑提示','customstyle':'自定义标题', 'autotypeset':'自动排版', 'webapp':'百度应用', 'touppercase':'字母大写', 'tolowercase':'字母小写','background':'背景','template':'模板','scrawl':'涂鸦','music':'音乐','inserttable':'插入表格', 'drafts': '草稿箱', 'formula':'数学公式' }, 'paragraph':{'p':'段落', 'h1':'标题 1', 'h2':'标题 2', 'h3':'标题 3', 'h4':'标题 4', 'h5':'标题 5', 'h6':'标题 6'}, 'fontfamily':{ 'songti':'宋体', 'kaiti':'楷体', 'heiti':'黑体', 'lishu':'隶书', 'yahei':'微软雅黑', 'andaleMono':'andale mono', 'arial': 'arial', 'arialBlack':'arial black', 'comicSansMs':'comic sans ms', 'impact':'impact', 'timesNewRoman':'times new roman' }, 'ok':"确认", 'cancel':"取消", 'closeDialog':"关闭对话框", 'tableDrag':"表格拖动必须引入uiUtils.js文件!", 'autofloatMsg':"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!", 'anthorMsg':"链接", 'clearColor':'清空颜色', 'standardColor':'标准颜色', 'themeColor':'主题颜色', 'property':'属性', 'default':'默认', 'modify':'修改', 'justifyleft':'左对齐', 'justifyright':'右对齐', 'justifycenter':'居中', 'justify':'默认', 'clear':'清除', 'anchorMsg':'锚点', 'delete':'删除', 'clickToUpload':"点击上传", 'unset':'尚未设置语言文件', 't_row':'行', 't_col':'列', 'more':'更多', 'pasteOpt':'粘贴选项', 'pasteSourceFormat':"保留源格式", 'tagFormat':'只保留标签', 'pasteTextFormat':'只保留文本', //===============dialog i18N======================= 'image':{ 'static':{ 'lang_tab_local':"本地上传", 'lang_tab_imgSearch':"网络图片", 'lang_input_dragTip':"支持图片拖拽上传", 'lang_btn_add':"添加" }, 'uploadError': '上传出错' }, 'emotion':{ 'static':{ 'lang_input_choice':'精选', 'lang_input_Tuzki':'兔斯基', 'lang_input_BOBO':'BOBO', 'lang_input_lvdouwa':'绿豆蛙', 'lang_input_babyCat':'baby猫', 'lang_input_bubble':'泡泡', 'lang_input_youa':'有啊' } }, 'gmap':{ 'static':{ 'lang_input_address':'地址', 'lang_input_search':'搜索', 'address':{'value':"北京"} }, 'searchError':'无法定位到该地址!' }, 'link':{ 'static':{ 'lang_input_text':'文本内容:', 'lang_input_url':'链接地址:', 'lang_input_title':'标题:', 'lang_input_target':'是否在新窗口打开:' }, 'validLink':'只支持选中一个链接时生效', 'httpPrompt':'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀' }, 'map':{ 'static':{ 'lang_city':"城市", 'lang_address':"地址", 'city':{'value':"北京"}, 'lang_search':"搜索", 'lang_dynamicmap':"插入动态地图" }, 'cityMsg':"请选择城市", 'errorMsg':"抱歉,找不到该位置!" }, 'video':{ 'static':{ 'lang_tab_insertV':"插入视频", 'lang_video_url':"视频网址", 'lang_video_size':"视频尺寸", 'lang_videoW':"宽度", 'lang_videoH':"高度", 'lang_alignment':"对齐方式", 'videoSearchTxt':{'value':"请输入搜索关键字!"}, 'videoType':{'options':["全部", "热门", "娱乐", "搞笑", "体育", "科技", "综艺"]}, 'videoSearchBtn':{'value':"百度一下"}, 'videoSearchReset':{'value':"清空结果"} }, 'numError':"请输入正确的数值,如123,400", 'floatLeft':"左浮动", 'floatRight':"右浮动", 'default':"默认", 'block':"独占一行", 'urlError':"输入的视频地址有误,请检查后再试!", 'loading':"  视频加载中,请等待……", 'clickToSelect':"点击选中", 'goToSource':'访问源视频', 'noVideo':"    抱歉,找不到对应的视频,请重试!" }, 'formula':{ 'static':{ 'lang_tab_common':'常用公式', 'lang_tab_symbol':'符号', 'lang_tab_letter':'字母' } } }; ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/net/Uploader.cs ================================================ using Coldairarrow.Util; using System; using System.Collections; using System.IO; using System.Web; namespace Baidu { /// /// UEditor编辑器通用上传类 /// public class Uploader { string state = "SUCCESS"; string _webRootUrl { get; } = GlobalSwitch.WebRootUrl; string URL { get; set; } = null; string currentType = null; string uploadpath = null; string filename = null; string originalName = null; HttpPostedFile uploadFile = null; /** * 上传文件的主处理方法 * @param HttpContext * @param string * @param string[] *@param int * @return Hashtable */ public Hashtable upFile(HttpContext cxt, string pathbase, string[] filetype, int size) { pathbase = pathbase + DateTime.Now.ToString("yyyy-MM-dd") + "/"; uploadpath = cxt.Server.MapPath(pathbase);//获取文件上传路径 try { uploadFile = cxt.Request.Files[0]; originalName = uploadFile.FileName; //目录创建 createFolder(); //格式验证 if (checkType(filetype)) { state = "不允许的文件类型"; } //大小验证 if (checkSize(size)) { state = "文件大小超出网站限制"; } //保存图片 if (state == "SUCCESS") { filename = reName(); uploadFile.SaveAs(uploadpath + filename); URL = _webRootUrl + pathbase + filename; } } catch { state = "未知错误"; URL = ""; } return getUploadInfo(); } /** * 上传涂鸦的主处理方法 * @param HttpContext * @param string * @param string[] *@param string * @return Hashtable */ public Hashtable upScrawl(HttpContext cxt, string pathbase, string tmppath, string base64Data) { pathbase = pathbase + DateTime.Now.ToString("yyyy-MM-dd") + "/"; uploadpath = cxt.Server.MapPath(pathbase);//获取文件上传路径 FileStream fs = null; try { //创建目录 createFolder(); //生成图片 filename = System.Guid.NewGuid() + ".png"; fs = File.Create(uploadpath + filename); byte[] bytes = Convert.FromBase64String(base64Data); fs.Write(bytes, 0, bytes.Length); URL = pathbase + filename; } catch { state = "未知错误"; URL = ""; } finally { fs.Close(); deleteFolder(cxt.Server.MapPath(tmppath)); } return getUploadInfo(); } /** * 获取文件信息 * @param context * @param string * @return string */ public string getOtherInfo(HttpContext cxt, string field) { string info = null; if (cxt.Request.Form[field] != null && !String.IsNullOrEmpty(cxt.Request.Form[field])) { info = field == "fileName" ? cxt.Request.Form[field].Split(',')[1] : cxt.Request.Form[field]; } return info; } /** * 获取上传信息 * @return Hashtable */ private Hashtable getUploadInfo() { Hashtable infoList = new Hashtable(); infoList.Add("state", state); infoList.Add("url", URL); infoList.Add("originalName", originalName); infoList.Add("name", Path.GetFileName(URL)); infoList.Add("size", uploadFile.ContentLength); infoList.Add("type", Path.GetExtension(originalName)); return infoList; } /** * 重命名文件 * @return string */ private string reName() { return System.Guid.NewGuid() + getFileExt(); } /** * 文件类型检测 * @return bool */ private bool checkType(string[] filetype) { currentType = getFileExt(); return Array.IndexOf(filetype, currentType) == -1; } /** * 文件大小检测 * @param int * @return bool */ private bool checkSize(int size) { return uploadFile.ContentLength >= (size * 1024 * 1024); } /** * 获取文件扩展名 * @return string */ private string getFileExt() { string[] temp = uploadFile.FileName.Split('.'); return "." + temp[temp.Length - 1].ToLower(); } /** * 按照日期自动创建存储文件夹 */ private void createFolder() { if (!Directory.Exists(uploadpath)) { Directory.CreateDirectory(uploadpath); } } /** * 删除存储文件夹 * @param string */ public void deleteFolder(string path) { //if (Directory.Exists(path)) //{ // Directory.Delete(path, true); //} } } } ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/net/getContent.ashx ================================================ <%@ WebHandler Language="C#" CodeBehind="getContent.ashx.cs" Class="Baidu.getContent" %> ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/net/getContent.ashx.cs ================================================ using System.Web; namespace Baidu { /// /// getContent 的摘要说明 /// public class getContent : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; //获取数据 string content = context.Request.Form["myEditor"]; //存入数据库或者其他操作 //------------- //显示 context.Response.Write(""); context.Response.Write(""); context.Response.Write(""); context.Response.Write("
                    " + content + "
                    "); } public bool IsReusable { get { return false; } } } } ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/net/imageUp.ashx ================================================ <%@ WebHandler Language="C#" CodeBehind="imageUp.ashx.cs" Class="Baidu.imageUp" %> ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/net/imageUp.ashx.cs ================================================ using System; using System.Collections; using System.Collections.Generic; using System.Web; namespace Baidu { /// /// imageUp 的摘要说明 /// public class imageUp : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.ContentEncoding = System.Text.Encoding.UTF8; //上传配置 string pathbase = "/Upload/Img/"; //保存路径 int size = 10; //文件大小限制,单位mb //文件大小限制,单位KB string[] filetype = { ".gif", ".png", ".jpg", ".jpeg", ".bmp" }; //文件允许格式 string callback = context.Request["callback"]; string editorId = context.Request["editorid"]; //上传图片 Hashtable info; Uploader up = new Uploader(); info = up.upFile(context, pathbase, filetype, size); //获取上传状态 string json = BuildJson(info); context.Response.ContentType = "text/html"; if (callback != null) { context.Response.Write(String.Format("", callback, json)); } else { context.Response.Write(json); } } public bool IsReusable { get { return false; } } private string BuildJson(Hashtable info) { List fields = new List(); string[] keys = new string[] { "originalName", "name", "url", "size", "state", "type" }; for (int i = 0; i < keys.Length; i++) { fields.Add(String.Format("\"{0}\": \"{1}\"", keys[i], info[keys[i]])); } return "{" + String.Join(",", fields) + "}"; } } } ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/themes/default/css/umeditor.css ================================================ .edui-container{ position: relative; border: 1px solid #d4d4d4; box-shadow: 2px 2px 5px #d3d6da; background-color: #fff; } .edui-container .edui-toolbar{ position: relative; width:auto; border-bottom: 1px solid #e1e1e1; box-shadow: 2px 2px 5px #d3d6da; background-color: #fafafa; z-index: 99999; } .edui-toolbar .edui-btn-toolbar{ position: relative; padding: 5px; } .edui-container .edui-editor-body{ background-color: #fff; } .edui-editor-body .edui-body-container{ } .edui-editor-body .edui-body-container p{margin:5px 0;} .edui-editor-body .edui-body-container{ border:0; outline:none; cursor:text; padding:0 10px 0; overflow:auto; display:block; word-wrap:break-word; font-size:16px; font-family:sans-serif; } .edui-editor-body.focus{border:1px solid #5c9dff} .edui-editor-body table{margin:10px 0 10px;border-collapse:collapse;display:table;} .edui-editor-body td{padding: 5px 10px;border: 1px solid #DDD;} .edui-editor-body iframe.mathquill-embedded-latex{ border: 0px; padding: 0px; display: inline; margin: 0px; background: none; vertical-align: middle; width: 0px; height: 0px; } /*普通按钮*/ .edui-btn-toolbar .edui-btn{ position: relative; display: inline-block; vertical-align: top; *display: inline; *zoom:1; width:auto; margin: 0 1px; padding:1px; border:none; background: none; } .edui-btn-toolbar .edui-btn .edui-icon{ width: 20px; height: 20px; margin: 0; padding:0; background-repeat: no-repeat; background-image: url(../images/icons.png); background-image: url(../images/icons.gif) \9; } /*状态反射*/ .edui-btn-toolbar .edui-btn.edui-hover, .edui-btn-toolbar .edui-btn.edui-active{ background-color: #d5e1f2; padding: 0; border: 1px solid #a3bde3; _z-index: 1; } .edui-btn-toolbar .edui-btn.edui-disabled{ opacity: 0.3; filter: alpha(opacity = 30); } .edui-btn-toolbar .edui-btn .edui-icon-source { background-position:-260px -0px; } .edui-btn-toolbar .edui-btn .edui-icon-undo { background-position: -160px 0; } .edui-btn-toolbar .edui-btn .edui-icon-redo { background-position: -100px 0; } .edui-btn-toolbar .edui-btn .edui-icon-bold{ background-position: 0 0; } .edui-btn-toolbar .edui-btn .edui-icon-italic { background-position: -60px 0; } .edui-btn-toolbar .edui-btn .edui-icon-underline { background-position: -140px 0 } .edui-btn-toolbar .edui-btn .edui-icon-strikethrough { background-position: -120px 0; } .edui-btn-toolbar .edui-btn .edui-icon-superscript { background-position: -620px 0; } .edui-btn-toolbar .edui-btn .edui-icon-subscript { background-position: -600px 0; } .edui-btn-toolbar .edui-btn .edui-icon-font, .edui-btn-toolbar .edui-btn .edui-icon-forecolor { background-position: -720px 0; } .edui-btn-toolbar .edui-btn .edui-icon-backcolor { background-position: -760px 0; } .edui-btn-toolbar .edui-btn .edui-icon-insertorderedlist { background-position: -80px 0; } .edui-btn-toolbar .edui-btn .edui-icon-insertunorderedlist { background-position: -20px 0; } .edui-btn-toolbar .edui-btn .edui-icon-selectall { background-position: -400px -20px; } .edui-btn-toolbar .edui-btn .edui-icon-cleardoc { background-position: -520px 0; } .edui-btn-toolbar .edui-btn .edui-icon-paragraph { background-position: -140px 0; } .edui-btn-toolbar .edui-btn .edui-icon-fontfamily { background-position: -140px 0; } .edui-btn-toolbar .edui-btn .edui-icon-fontsize { background-position: -140px 0; } .edui-btn-toolbar .edui-btn .edui-icon-justifyleft { background-position: -460px 0; } .edui-btn-toolbar .edui-btn .edui-icon-justifycenter { background-position: -420px 0; } .edui-btn-toolbar .edui-btn .edui-icon-justifyright { background-position:-480px 0; } .edui-btn-toolbar .edui-btn .edui-icon-justifyjustify { background-position: -440px 0; } .edui-btn-toolbar .edui-btn .edui-icon-link { background-position: -500px 0; } .edui-btn-toolbar .edui-btn .edui-icon-unlink { background-position: -640px 0; } .edui-btn-toolbar .edui-btn .edui-icon-image { background-position: -380px 0; } .edui-btn-toolbar .edui-btn .edui-icon-emotion { background-position: -60px -20px; } .edui-btn-toolbar .edui-btn .edui-icon-video { background-position: -320px -20px; } .edui-btn-toolbar .edui-btn .edui-icon-map { background-position: -40px -40px; } .edui-btn-toolbar .edui-btn .edui-icon-gmap { background-position: -260px -40px; } .edui-btn-toolbar .edui-btn .edui-icon-horizontal { background-position: -360px 0; } .edui-btn-toolbar .edui-btn .edui-icon-print { background-position: -440px -20px; } .edui-btn-toolbar .edui-btn .edui-icon-preview { background-position: -420px -20px; } .edui-btn-toolbar .edui-btn-fullscreen{ float:right; } .edui-btn-toolbar .edui-btn .edui-icon-fullscreen { background-position: -100px -20px; } .edui-btn-toolbar .edui-btn .edui-icon-removeformat { background-position: -580px 0; } .edui-btn-toolbar .edui-btn .edui-icon-drafts { background-position: -560px 0; } .edui-btn-toolbar .edui-btn .edui-icon-formula { background-position: -80px -20px; } .edui-btn-toolbar .edui-splitbutton{ position: relative; display: inline-block ; vertical-align: top; *display: inline ; *zoom:1; margin:0 2px; } .edui-splitbutton .edui-btn{ margin: 0; } .edui-splitbutton .edui-caret{ position: relative; display: inline-block ; vertical-align: top; *display: inline ; *zoom:1; width: 8px; height: 20px; background: url(../images/icons.png) -741px 0; _background: url(../images/icons.gif) -741px 0; } .edui-btn-toolbar .edui-splitbutton, .edui-btn-toolbar .edui-splitbutton{ _border: none; } /*状态反射*/ .edui-btn-toolbar .edui-splitbutton.edui-hover .edui-btn{ background-color: #d5e1f2; } .edui-btn-toolbar .edui-splitbutton.edui-disabled{ opacity: 0.3; filter: alpha(opacity = 30); } .edui-btn-toolbar .edui-splitbutton.edui-disabled .edui-caret{ opacity: 0.3 \0; filter: alpha(opacity = 30)\0; } .edui-btn-toolbar .edui-combobox{ border: 1px solid #CCC; padding:0; margin:0 2px; line-height: 20px; } .edui-combobox .edui-button-label{ position: relative; display: inline-block; vertical-align: top; *display: inline ; *zoom:1; width:60px; height:20px; line-height: 20px; padding: 2px; margin: 0; font-size: 12px; text-align: center; cursor: default; } .edui-combobox .edui-button-spacing{ position: relative; display: inline-block ; vertical-align: top; *display: inline ; *zoom:1; height:20px; margin: 0; padding:0 3px; } .edui-combobox .edui-caret{ position: relative; display: inline-block ; vertical-align: top; *display: inline ; *zoom:1; height:20px; width: 12px; margin: 0; padding: 0; background: url(../images/icons.png) -741px 0; _background: url(../images/icons.gif) -741px 0; } .edui-btn-toolbar .edui-combobox.edui-disabled{ opacity: 0.2; filter: alpha(opacity = 20); } .edui-btn-toolbar .edui-combobox.edui-disabled .edui-button-label, .edui-btn-toolbar .edui-combobox.edui-disabled .edui-caret{ opacity: 0.2 \0; filter: alpha(opacity = 20)\0; } .edui-combobox-menu{ position: absolute; top: 100%; left: 0; display: none; list-style: none; text-decoration: none; margin: 0; padding:5px; background-color: #ffffff; border: 1px solid #ccc; font-size: 12px; box-shadow: 2px 2px 5px #d3d6da; min-width: 160px; _width: 160px; } .edui-combobox-menu .edui-combobox-item { display: block; border: 1px solid white; } .edui-combobox-menu .edui-combobox-item-label { height: 25px; line-height: 25px; display: inline-block; _display: inline; _zoom: 1; margin-left: 10px; } .edui-combobox-menu .edui-combobox-item:hover, .edui-combobox-menu .edui-combobox-stack-item:hover, .edui-combobox-menu .edui-combobox-item-hover { background-color: #d5e1f2; padding: 0; border: 1px solid #a3bde3; } .edui-combobox-menu .edui-combobox-item .edui-combobox-icon { display: inline-block; *zoom: 1; *display: inline; width: 24px; height: 25px; background: red; vertical-align: bottom; background: url(../images/ok.gif) no-repeat 1000px 1000px; } .edui-combobox-menu .edui-combobox-checked .edui-combobox-icon { background-position: 10px 7px; } .edui-combobox-menu .edui-combobox-item-separator { min-width: 160px; height: 1px; line-height: 1px; overflow: hidden; background: #d3d3d3; margin: 5px 0; *margin-top: -8px; } /* 字体样式校正 */ .edui-combobox-fontsize .edui-combobox-item-0.edui-combobox-checked .edui-combobox-icon { background-position: 10px 7px; } .edui-combobox-fontsize .edui-combobox-item-1.edui-combobox-checked .edui-combobox-icon { background-position: 10px 7px; } .edui-combobox-fontsize .edui-combobox-item-2.edui-combobox-checked .edui-combobox-icon { background-position: 10px 7px; } .edui-combobox-fontsize .edui-combobox-item-3.edui-combobox-checked .edui-combobox-icon { background-position: 10px 7px; } /* 24 */ .edui-combobox-fontsize .edui-combobox-item-4 .edui-combobox-item-label { height: 27px; line-height: 27px; } .edui-combobox-fontsize .edui-combobox-item-4.edui-combobox-checked .edui-combobox-icon { background-position: 10px 5px; } /* 32 */ .edui-combobox-fontsize .edui-combobox-item-5 .edui-combobox-item-label { height: 31px; line-height: 31px; } .edui-combobox-fontsize .edui-combobox-item-5.edui-combobox-checked .edui-combobox-icon { background-position: 10px 4px; } /* 48 */ .edui-combobox-fontsize .edui-combobox-item-6 .edui-combobox-item-label { height: 47px; line-height: 47px; } /*.edui-combobox-fontsize .edui-combobox-item-6 .edui-combobox-icon {*/ /*height: 25px;*/ /*margin-bottom: 11px;*/ /*}*/ /*.edui-combobox-fontsize .edui-combobox-item-6.edui-combobox-checked .edui-combobox-icon {*/ /*background-position: 10px 7px;*/ /*}*/ /* 段落样式校正 */ /* h1 */ .edui-combobox-paragraph .edui-combobox-item-1 .edui-combobox-item-label { font-size: 32px; height: 36px; line-height: 36px; } .edui-combobox-paragraph .edui-combobox-item-1 .edui-combobox-icon { height: 25px; margin-bottom: 5px; } .edui-combobox-paragraph .edui-combobox-item-1.edui-combobox-checked .edui-combobox-icon { background-position: 10px 7px; } /* h2 */ .edui-combobox-paragraph .edui-combobox-item-2 .edui-combobox-item-label { font-size: 28px; height: 27px; line-height: 27px; } .edui-combobox-paragraph .edui-combobox-item-2 .edui-combobox-icon { margin-bottom: 5px; } .edui-combobox-paragraph .edui-combobox-item-2.edui-combobox-checked .edui-combobox-icon { background-position: 10px 10px; } /* h3 */ .edui-combobox-paragraph .edui-combobox-item-3 .edui-combobox-item-label { font-size: 24px; height: 25px; line-height: 25px; } .edui-combobox-paragraph .edui-combobox-item-3 .edui-combobox-icon { height: 25px; margin-bottom: 5px; } .edui-combobox-paragraph .edui-combobox-item-3.edui-combobox-checked .edui-combobox-icon { background-position: 10px 11px; } /* h4 */ .edui-combobox-paragraph .edui-combobox-item-4 .edui-combobox-item-label { font-size: 18px; height: 25px; line-height: 25px; } .edui-combobox-paragraph .edui-combobox-item-4.edui-combobox-checked .edui-combobox-icon { background-position: 10px 6px; } /* h5 */ .edui-combobox-paragraph .edui-combobox-item-5 .edui-combobox-item-label { font-size: 16px; } /* h6 */ .edui-combobox-paragraph .edui-combobox-item-6 .edui-combobox-item-label { font-size: 12px; } .edui-modal { position: fixed; _position: absolute; top: 10%; left: 50%; border: 1px solid #acacac; box-shadow: 2px 2px 5px #d3d6da; background-color: #ffffff; outline: 0; } .edui-modal-header { padding: 5px 10px; border-bottom: 1px solid #eee; } .edui-modal-header .edui-close { float: right; width:20px; height:20px; margin-top: 2px; padding: 1px; border: 0; background: url("../images/close.png") no-repeat center center; cursor: pointer; } .edui-modal-header .edui-close.edui-hover { background-color: #d5e1f2; padding:0; border: 1px solid #a3bde3; } .edui-modal-header .edui-title { margin: 0; line-height: 25px; font-size: 20px; } .edui-modal-body { position: relative; max-height: 400px; font-size: 12px; overflow-y: auto; } .edui-modal-footer { float: right; padding: 5px 15px 15px; overflow: hidden; } .edui-modal-footer .edui-btn { float: left; height: 24px; width: 96px; margin: 0 10px; background-color: #ffffff; padding: 0; border: 1px solid #ababab; font-size: 12px; line-height: 24px; text-align: center; cursor: pointer; } .edui-modal-footer .edui-btn.edui-hover{ background-color: #d5e1f2; border: 1px solid #a3bde3; } .edui-modal-backdrop{ opacity: 0.5; filter: alpha(opacity=50); position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color: #c6c6c6; } .edui-modal .edui-modal-tip { color: red; position: absolute; bottom: 10px; left: 10px; height: 30px; line-height: 30px; display: none; } /*图片上传*/ .edui-dialog-image-body { width: 700px; height: 400px; } /*插入视频*/ .edui-dialog-video-body{ width: 600px; height: 350px; } /*谷歌地图*/ .edui-dialog-gmap-body{ width:550px; height: 400px; } /*百度地图*/ .edui-dialog-map-body{ width:580px; height: 400px; } /*链接*/ .edui-dialog-link-body{ width:400px; height:200px; } .edui-popup{ display: none; background: url('../images/pop-bg.png') repeat #fff; padding: 2px; } .edui-popup .edui-popup-body{ border: 1px solid #bfbfbf; background-color: #fff; } .edui-popup .edui-popup-caret{ width: 21px; height: 11px; } .edui-popup .edui-popup-caret.up{ background:url('../images/caret.png') no-repeat 0 0; } .edui-popup .edui-popup-caret.down{ background:url('../images/caret.png') no-repeat 0 0; } .edui-tab-nav { margin: 0; padding:0; border-bottom: 1px solid #ddd; list-style: none; height:30px; } .edui-tab-nav .edui-tab-item { float:left; margin-bottom: -1px; margin-top: 1px; margin-top: 0\9; } .edui-tab-nav .edui-tab-item .edui-tab-text{ display: block; padding:8px 12px; border: 1px solid transparent; color: #0088cc; text-decoration: none; outline: 0; _border:1px solid #fff ; cursor: pointer; } .edui-tab-nav .edui-tab-item .edui-tab-text:FOCUS { outline: none; } .edui-tab-nav .edui-tab-item.edui-active .edui-tab-text{ border: 1px solid #ddd; border-bottom-color: transparent; background-color: #fff; padding:8px 12px; color: #555555; cursor: default; } .edui-tab-content .edui-tab-pane{ padding: 1px; position: relative; display: none; background-color: #fff; clear: both; } .edui-tab-content .edui-tab-pane.edui-active{ display: block; } .edui-btn-toolbar .edui-tooltip{ position: absolute; padding: 5px 0; display: none; /*opacity: 0.8;*/ /*filter: alpha(opacity=80);*/ z-index: 99999; } .edui-tooltip .edui-tooltip-arrow{ position: absolute; top: 0; _top: -2px; left: 50%; width: 0; height: 0; padding: 0; font-size:0; margin-left: -5px; border-color: transparent; border-style: dashed dashed solid dashed; border-bottom-color: #000000; border-width: 0 5px 5px; background: transparent; } .edui-tooltip .edui-tooltip-inner{ padding: 6px; color: #ffffff; text-align: center; text-decoration: none; font-size: 10px; background-color: #000000; white-space: nowrap; line-height: 12px; } .edui-splitbutton-color-label { width: 16px; height: 3px; position: absolute; bottom: 2px; left: 50%; margin-left: -8px; overflow: hidden; line-height: 3px; } .edui-popup .edui-colorpicker { margin: 10px; font-size: 12px; } .edui-colorpicker .edui-colorpicker-topbar{ height: 27px; width: 200px; overflow: hidden; } .edui-colorpicker .edui-colorpicker-topbar .edui-colorpicker-preview{ height: 20px; border: 1px inset black; margin-left: 1px; width: 128px; float: left; } .edui-colorpicker .edui-colorpicker-topbar .edui-colorpicker-nocolor{ float: right; margin-right: 1px; font-size: 12px; line-height: 14px; height: 14px; border: 1px solid #333; padding: 3px 5px; cursor: pointer; } .edui-colorpicker table{ border-collapse: collapse; border-spacing: 2px; } .edui-colorpicker tr.edui-colorpicker-firstrow{ height: 30px; } .edui-colorpicker table td{ padding: 0 2px; } .edui-colorpicker table td .edui-colorpicker-colorcell{ display: block; text-decoration: none; color: black; width: 14px; height: 14px; margin: 0; cursor: pointer; } .edui-toolbar .edui-separator{ width: 2px; height: 20px; padding: 1px 2px; background: url(../images/icons.png) -179px 1px; background: url(../images/icons.gif) -179px 1px \9; display: inline-block ; vertical-align: top; *display: inline ; *zoom:1; border:none; } ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/third-party/mathquill/font/stixgeneral-bundle/STIXFontLicense2010.txt ================================================ STIX Font License 24 May 2010 Copyright (c) 2001-2010 by the STI Pub Companies, consisting of the American Institute of Physics, the American Chemical Society, the American Mathematical Society, the American Physical Society, Elsevier, Inc., and The Institute of Electrical and Electronic Engineers, Inc. (www.stixfonts.org), with Reserved Font Name STIX Fonts, STIX Fonts (TM) is a trademark of The Institute of Electrical and Electronics Engineers, Inc. Portions copyright (c) 1998-2003 by MicroPress, Inc. (www.micropress-inc.com), with Reserved Font Name TM Math. To obtain additional mathematical fonts, please contact MicroPress, Inc., 68-30 Harrow Street, Forest Hills, NY 11375, USA, Phone: (718) 575-1816. Portions copyright (c) 1990 by Elsevier, Inc. This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL --------------------------------------------------------------------------- SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 --------------------------------------------------------------------------- PREAMBLE The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. DEFINITIONS "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. "Reserved Font Name" refers to any names specified as such after the copyright statement(s). "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. PERMISSION & CONDITIONS Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. TERMINATION This license becomes null and void if any of the above conditions are not met. DISCLAIMER THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/third-party/mathquill/mathquill.css ================================================ /* * LaTeX Math in pure HTML and CSS -- No images whatsoever * v0.xa * by Jay and Han * Lesser GPL Licensed: http: //www.gnu.org/licenses/lgpl.html * * This file is automatically included by mathquill.js * */ @font-face { font-family: Symbola; src: url(font/Symbola.eot); src: local("Symbola Regular"), local("Symbola"), url(font/Symbola.ttf) format("truetype"), url(font/Symbola.otf) format("opentype"), url(font/Symbola.svg#Symbola) format("svg"); } .mathquill-editable { display: -moz-inline-box; display: inline-block; white-space: pre-wrap; } .mathquill-editable .cursor { border-left: 1px solid black; margin-right: -1px; position: relative; z-index: 1; padding: 0; display: -moz-inline-box; display: inline-block; } .mathquill-editable .cursor.blink { visibility: hidden; } .mathquill-editable, .mathquill-embedded-latex .mathquill-editable { border: 1px solid gray; padding: 2px; } .mathquill-embedded-latex .mathquill-editable { margin: 1px; } .mathquill-editable.hasCursor, .mathquill-editable .hasCursor { -webkit-box-shadow: #68b4df 0 0 3px 2px; -moz-box-shadow: #68b4df 0 0 3px 2px; box-shadow: #68b4df 0 0 3px 2px; } .mathquill-editable .latex-command-input { color: inherit; font-family: "Courier New", monospace; border: 1px solid gray; padding-right: 1px; margin-right: 1px; margin-left: 2px; } .mathquill-editable .latex-command-input.empty { background: transparent; } .mathquill-editable .latex-command-input.hasCursor { border-color: ActiveBorder; } .mathquill-editable.empty:after, .mathquill-textbox:after, .mathquill-rendered-math .empty:after { visibility: hidden; content: 'c'; } .mathquill-editable .cursor:only-child:after, .mathquill-editable .textarea + .cursor:last-child:after { visibility: hidden; content: 'c'; } .mathquill-textbox { overflow-x: auto; overflow-y: hidden; } .mathquill-rendered-math { font-variant: normal; font-weight: normal; font-style: normal; font-size: 115%; line-height: 1; display: -moz-inline-box; display: inline-block; } .mathquill-rendered-math .non-leaf, .mathquill-rendered-math .scaled { display: -moz-inline-box; display: inline-block; } .mathquill-rendered-math var, .mathquill-rendered-math .text, .mathquill-rendered-math .nonSymbola { font-family: "Times New Roman", Symbola, serif; line-height: .9; } .mathquill-rendered-math * { font-size: inherit; line-height: inherit; margin: 0; padding: 0; border-color: black; -webkit-user-select: none; -moz-user-select: none; user-select: none; } .mathquill-rendered-math .empty { background: #ccc; } .mathquill-rendered-math.empty { background: transparent; } .mathquill-rendered-math .text { font-size: 87%; } .mathquill-rendered-math .font { font: 1em "Times New Roman", Symbola, serif; } .mathquill-rendered-math .font * { font-family: inherit; font-style: inherit; } .mathquill-rendered-math b, .mathquill-rendered-math b.font { font-weight: bolder; } .mathquill-rendered-math var, .mathquill-rendered-math i, .mathquill-rendered-math i.font { font-syle: italic; } .mathquill-rendered-math var.florin { margin: 0 -0.1em; } .mathquill-rendered-math big { font-size: 125%; } .mathquill-rendered-math .roman { font-style: normal; } .mathquill-rendered-math .sans-serif { font-family: sans-serif, Symbola, serif; } .mathquill-rendered-math .monospace { font-family: monospace, Symbola, serif; } .mathquill-rendered-math .overline { border-top: 1px solid black; margin-top: 1px; } .mathquill-rendered-math .underline { border-bottom: 1px solid black; margin-bottom: 1px; } .mathquill-rendered-math .binary-operator { padding: 0 0.2em; display: -moz-inline-box; display: inline-block; } .mathquill-rendered-math .unary-operator { padding-left: 0.2em; } .mathquill-rendered-math sup, .mathquill-rendered-math sub { position: relative; font-size: 90%; } .mathquill-rendered-math sup .binary-operator, .mathquill-rendered-math sub .binary-operator { padding: 0 .1em; } .mathquill-rendered-math sup .unary-operator, .mathquill-rendered-math sub .unary-operator { padding-left: .1em; } .mathquill-rendered-math sup.limit, .mathquill-rendered-math sub.limit, .mathquill-rendered-math sup.nthroot, .mathquill-rendered-math sub.nthroot { font-size: 80%; } .mathquill-rendered-math sup .fraction, .mathquill-rendered-math sub .fraction { font-size: 70%; vertical-align: -0.4em; } .mathquill-rendered-math sup .numerator, .mathquill-rendered-math sub .numerator { padding-bottom: 0; } .mathquill-rendered-math sup .denominator, .mathquill-rendered-math sub .denominator { padding-top: 0; } .mathquill-rendered-math sup { vertical-align: .5em; } .mathquill-rendered-math sup.limit, .mathquill-rendered-math sup.nthroot { vertical-align: 0.8em; } .mathquill-rendered-math sup.nthroot { margin-right: -0.6em; margin-left: .2em; min-width: .5em; } .mathquill-rendered-math sub { vertical-align: -0.4em; } .mathquill-rendered-math sub.limit { vertical-align: -0.6em; } .mathquill-rendered-math .paren { padding: 0 .1em; vertical-align: bottom; -webkit-transform-origin: bottom center; -moz-transform-origin: bottom center; -ms-transform-origin: bottom center; -o-transform-origin: bottom center; transform-origin: bottom center; } .mathquill-rendered-math .array { vertical-align: middle; text-align: center; } .mathquill-rendered-math .array > span { display: block; } .mathquill-rendered-math .non-italicized-function { font-family: Symbola, "Times New Roman", serif; line-height: .9; font-style: normal; padding-right: .2em; } .mathquill-rendered-math .fraction { font-size: 90%; text-align: center; vertical-align: -0.5em; padding: 0 .2em; } .mathquill-rendered-math .fraction, .mathquill-rendered-math x:-moz-any-link { display: -moz-groupbox; } .mathquill-rendered-math .fraction, .mathquill-rendered-math x:-moz-any-link, .mathquill-rendered-math x:default { display: inline-block; } .mathquill-rendered-math .numerator, .mathquill-rendered-math .denominator { display: block; } .mathquill-rendered-math .numerator { padding: 0 0.1em; margin-bottom: -0.1em; } .mathquill-rendered-math .denominator { border-top: 1px solid; float: right; width: 100%; padding: .1em .1em 0 .1em; margin-right: -0.1em; margin-left: -0.1em; } .mathquill-rendered-math .sqrt-prefix { padding-top: 0; position: relative; top: .1em; vertical-align: top; -webkit-transform-origin: top; -moz-transform-origin: top; -ms-transform-origin: top; -o-transform-origin: top; transform-origin: top; } .mathquill-rendered-math .sqrt-stem { border-top: 1px solid; margin-top: 1px; padding-left: .15em; padding-right: .2em; margin-right: .1em; } .mathquill-rendered-math .vector-prefix { display: block; text-align: center; line-height: .25em; margin-bottom: -0.1em; font-size: 0.75em; } .mathquill-rendered-math .vector-stem { display: block; } .mathquill-rendered-math, .mathquill-rendered-math .mathquill-editable { cursor: text; font-family: Symbola, "Times New Roman", serif; } .mathquill-rendered-math .selection, .mathquill-editable .selection, .mathquill-rendered-math .selection .non-leaf, .mathquill-editable .selection .non-leaf, .mathquill-rendered-math .selection .scaled, .mathquill-editable .selection .scaled { background: #B4D5FE !important; background: Highlight !important; color: HighlightText; border-color: HighlightText; } .mathquill-rendered-math .selection .matrixed, .mathquill-editable .selection .matrixed { background: #39F !important; } .mathquill-rendered-math .selection .matrixed-container, .mathquill-editable .selection .matrixed-container { filter: progid:DXImageTransform.Microsoft.Chroma(color='#3399FF') !important; } .mathquill-rendered-math .selection.blur, .mathquill-editable .selection.blur, .mathquill-rendered-math .selection.blur .non-leaf, .mathquill-editable .selection.blur .non-leaf, .mathquill-rendered-math .selection.blur .scaled, .mathquill-editable .selection.blur .scaled, .mathquill-rendered-math .selection.blur .matrixed, .mathquill-editable .selection.blur .matrixed { background: #D4D4D4 !important; color: black; border-color: black; } .mathquill-rendered-math .selection.blur .matrixed-container, .mathquill-editable .selection.blur .matrixed-container { filter: progid:DXImageTransform.Microsoft.Chroma(color='#D4D4D4') !important; } .mathquill-editable .textarea, .mathquill-rendered-math .textarea { position: relative; -webkit-user-select: text; -moz-user-select: text; user-select: text; } .mathquill-editable .textarea textarea, .mathquill-rendered-math .textarea textarea, .mathquill-editable .selectable, .mathquill-rendered-math .selectable { -webkit-user-select: text; -moz-user-select: text; user-select: text; position: absolute; clip: rect(1em 1em 1em 1em); } .mathquill-rendered-math .matrixed { background: white; display: -moz-inline-box; display: inline-block; } .mathquill-rendered-math .matrixed-container { filter: progid:DXImageTransform.Microsoft.Chroma(color='white'); margin-top: -0.1em; } ================================================ FILE: src/Coldairarrow.Web/Scripts/vendor/umeditor/third-party/mathquill/mathquill.js ================================================ /** * Copyleft 2010-2011 Jay and Han (laughinghan@gmail.com) * under the GNU Lesser General Public License * http://www.gnu.org/licenses/lgpl.html * Project Website: http://mathquill.com */ (function() { var jQuery = window.jQuery, undefined, _, //temp variable of prototypes mqCmdId = 'mathquill-command-id', mqBlockId = 'mathquill-block-id', min = Math.min, max = Math.max; var __slice = [].slice; function noop() {} /** * sugar to make defining lots of commands easier. * TODO: rethink this. */ function bind(cons /*, args... */) { var args = __slice.call(arguments, 1); return function() { return cons.apply(this, args); }; } /** * a development-only debug method. This definition and all * calls to `pray` will be stripped from the minified * build of mathquill. * * This function must be called by name to be removed * at compile time. Do not define another function * with the same name, and only call this function by * name. */ function pray(message, cond) { if (!cond) throw new Error('prayer failed: '+message); } var P = (function(prototype, ownProperty, undefined) { // helper functions that also help minification function isObject(o) { return typeof o === 'object'; } function isFunction(f) { return typeof f === 'function'; } // a function that gets reused to make uninitialized objects function BareConstructor() {} function P(_superclass /* = Object */, definition) { // handle the case where no superclass is given if (definition === undefined) { definition = _superclass; _superclass = Object; } // C is the class to be returned. // // It delegates to instantiating an instance of `Bare`, so that it // will always return a new instance regardless of the calling // context. // // TODO: the Chrome inspector shows all created objects as `C` // rather than `Object`. Setting the .name property seems to // have no effect. Is there a way to override this behavior? function C() { var self = new Bare; if (isFunction(self.init)) self.init.apply(self, arguments); return self; } // C.Bare is a class with a noop constructor. Its prototype is the // same as C, so that instances of C.Bare are also instances of C. // New objects can be allocated without initialization by calling // `new MyClass.Bare`. function Bare() {} C.Bare = Bare; // Set up the prototype of the new class. var _super = BareConstructor[prototype] = _superclass[prototype]; var proto = Bare[prototype] = C[prototype] = new BareConstructor; // other variables, as a minifier optimization var extensions; // set the constructor property on the prototype, for convenience proto.constructor = C; C.mixin = function(def) { Bare[prototype] = C[prototype] = P(C, def)[prototype]; return C; } return (C.open = function(def) { extensions = {}; if (isFunction(def)) { // call the defining function with all the arguments you need // extensions captures the return value. extensions = def.call(C, proto, _super, C, _superclass); } else if (isObject(def)) { // if you passed an object instead, we'll take it extensions = def; } // ...and extend it if (isObject(extensions)) { for (var ext in extensions) { if (ownProperty.call(extensions, ext)) { proto[ext] = extensions[ext]; } } } // if there's no init, we assume we're inheriting a non-pjs class, so // we default to applying the superclass's constructor. if (!isFunction(proto.init)) { proto.init = _superclass; } return C; })(definition); } // ship it return P; // as a minifier optimization, we've closured in a few helper functions // and the string 'prototype' (C[p] is much shorter than C.prototype) })('prototype', ({}).hasOwnProperty); /************************************************* * Textarea Manager * * An abstraction layer wrapping the textarea in * an object with methods to manipulate and listen * to events on, that hides all the nasty cross- * browser incompatibilities behind a uniform API. * * Design goal: This is a *HARD* internal * abstraction barrier. Cross-browser * inconsistencies are not allowed to leak through * and be dealt with by event handlers. All future * cross-browser issues that arise must be dealt * with here, and if necessary, the API updated. * * Organization: * - key values map and stringify() * - manageTextarea() * + defer() and flush() * + event handler logic * + attach event handlers and export methods ************************************************/ var manageTextarea = (function() { // The following [key values][1] map was compiled from the // [DOM3 Events appendix section on key codes][2] and // [a widely cited report on cross-browser tests of key codes][3], // except for 10: 'Enter', which I've empirically observed in Safari on iOS // and doesn't appear to conflict with any other known key codes. // // [1]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#keys-keyvalues // [2]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#fixed-virtual-key-codes // [3]: http://unixpapa.com/js/key.html var KEY_VALUES = { 8: 'Backspace', 9: 'Tab', 10: 'Enter', // for Safari on iOS 13: 'Enter', 16: 'Shift', 17: 'Control', 18: 'Alt', 20: 'CapsLock', 27: 'Esc', 32: 'Spacebar', 33: 'PageUp', 34: 'PageDown', 35: 'End', 36: 'Home', 37: 'Left', 38: 'Up', 39: 'Right', 40: 'Down', 45: 'Insert', 46: 'Del', 144: 'NumLock' }; // To the extent possible, create a normalized string representation // of the key combo (i.e., key code and modifier keys). function stringify(evt) { var which = evt.which || evt.keyCode; var keyVal = KEY_VALUES[which]; var key; var modifiers = []; if (evt.ctrlKey) modifiers.push('Ctrl'); if (evt.originalEvent && evt.originalEvent.metaKey) modifiers.push('Meta'); if (evt.altKey) modifiers.push('Alt'); if (evt.shiftKey) modifiers.push('Shift'); key = keyVal || String.fromCharCode(which); if (!modifiers.length && !keyVal) return key; modifiers.push(key); return modifiers.join('-'); } // create a textarea manager that calls callbacks at useful times // and exports useful public methods return function manageTextarea(el, opts) { var keydown = null; var keypress = null; if (!opts) opts = {}; var textCallback = opts.text || noop; var keyCallback = opts.key || noop; var pasteCallback = opts.paste || noop; var onCut = opts.cut || noop; var textarea = jQuery(el); var target = jQuery(opts.container || textarea); // checkTextareaFor() is called after keypress or paste events to // say "Hey, I think something was just typed" or "pasted" (resp.), // so that at all subsequent opportune times (next event or timeout), // will check for expected typed or pasted text. // Need to check repeatedly because #135: in Safari 5.1 (at least), // after selecting something and then typing, the textarea is // incorrectly reported as selected during the input event (but not // subsequently). var checkTextarea = noop, timeoutId; function checkTextareaFor(checker) { checkTextarea = checker; clearTimeout(timeoutId); timeoutId = setTimeout(checker); } target.bind('keydown keypress input keyup focusout paste', function() { checkTextarea(); }); // -*- public methods -*- // function select(text) { // check textarea at least once/one last time before munging (so // no race condition if selection happens after keypress/paste but // before checkTextarea), then never again ('cos it's been munged) checkTextarea(); checkTextarea = noop; clearTimeout(timeoutId); textarea.val(text); if (text) textarea[0].select(); } // -*- helper subroutines -*- // // Determine whether there's a selection in the textarea. // This will always return false in IE < 9, which don't support // HTMLTextareaElement::selection{Start,End}. function hasSelection() { var dom = textarea[0]; if (!('selectionStart' in dom)) return false; return dom.selectionStart !== dom.selectionEnd; } function popText(callback) { var text = textarea.val(); textarea.val(''); if (text) callback(text); } function handleKey() { keyCallback(stringify(keydown), keydown); } // -*- event handlers -*- // function onKeydown(e) { keydown = e; keypress = null; handleKey(); } function onKeypress(e) { // call the key handler for repeated keypresses. // This excludes keypresses that happen directly // after keydown. In that case, there will be // no previous keypress, so we skip it here if (keydown && keypress) handleKey(); keypress = e; checkTextareaFor(typedText); } function typedText() { // If there is a selection, the contents of the textarea couldn't // possibly have just been typed in. // This happens in browsers like Firefox and Opera that fire // keypress for keystrokes that are not text entry and leave the // selection in the textarea alone, such as Ctrl-C. // Note: we assume that browsers that don't support hasSelection() // also never fire keypress on keystrokes that are not text entry. // This seems reasonably safe because: // - all modern browsers including IE 9+ support hasSelection(), // making it extremely unlikely any browser besides IE < 9 won't // - as far as we know IE < 9 never fires keypress on keystrokes // that aren't text entry, which is only as reliable as our // tests are comprehensive, but the IE < 9 way to do // hasSelection() is poorly documented and is also only as // reliable as our tests are comprehensive // If anything like #40 or #71 is reported in IE < 9, see // b1318e5349160b665003e36d4eedd64101ceacd8 if (hasSelection()) return; popText(textCallback); } function onBlur() { keydown = keypress = null; } function onPaste(e) { // browsers are dumb. // // In Linux, middle-click pasting causes onPaste to be called, // when the textarea is not necessarily focused. We focus it // here to ensure that the pasted text actually ends up in the // textarea. // // It's pretty nifty that by changing focus in this handler, // we can change the target of the default action. (This works // on keydown too, FWIW). // // And by nifty, we mean dumb (but useful sometimes). textarea.focus(); checkTextareaFor(pastedText); } function pastedText() { popText(pasteCallback); } // -*- attach event handlers -*- // target.bind({ keydown: onKeydown, keypress: onKeypress, focusout: onBlur, cut: onCut, paste: onPaste }); // -*- export public methods -*- // return { select: select }; }; }()); var Parser = P(function(_, _super, Parser) { // The Parser object is a wrapper for a parser function. // Externally, you use one to parse a string by calling // var result = SomeParser.parse('Me Me Me! Parse Me!'); // You should never call the constructor, rather you should // construct your Parser from the base parsers and the // parser combinator methods. function parseError(stream, message) { if (stream) { stream = "'"+stream+"'"; } else { stream = 'EOF'; } throw 'Parse Error: '+message+' at '+stream; } _.init = function(body) { this._ = body; }; _.parse = function(stream) { return this.skip(eof)._(stream, success, parseError); function success(stream, result) { return result; } }; // -*- primitive combinators -*- // _.or = function(alternative) { pray('or is passed a parser', alternative instanceof Parser); var self = this; return Parser(function(stream, onSuccess, onFailure) { return self._(stream, onSuccess, failure); function failure(newStream) { return alternative._(stream, onSuccess, onFailure); } }); }; _.then = function(next) { var self = this; return Parser(function(stream, onSuccess, onFailure) { return self._(stream, success, onFailure); function success(newStream, result) { var nextParser = (next instanceof Parser ? next : next(result)); pray('a parser is returned', nextParser instanceof Parser); return nextParser._(newStream, onSuccess, onFailure); } }); }; // -*- optimized iterative combinators -*- // _.many = function() { var self = this; return Parser(function(stream, onSuccess, onFailure) { var xs = []; while (self._(stream, success, failure)); return onSuccess(stream, xs); function success(newStream, x) { stream = newStream; xs.push(x); return true; } function failure() { return false; } }); }; _.times = function(min, max) { if (arguments.length < 2) max = min; var self = this; return Parser(function(stream, onSuccess, onFailure) { var xs = []; var result = true; var failure; for (var i = 0; i < min; i += 1) { result = self._(stream, success, firstFailure); if (!result) return onFailure(stream, failure); } for (; i < max && result; i += 1) { result = self._(stream, success, secondFailure); } return onSuccess(stream, xs); function success(newStream, x) { xs.push(x); stream = newStream; return true; } function firstFailure(newStream, msg) { failure = msg; stream = newStream; return false; } function secondFailure(newStream, msg) { return false; } }); }; // -*- higher-level combinators -*- // _.result = function(res) { return this.then(succeed(res)); }; _.atMost = function(n) { return this.times(0, n); }; _.atLeast = function(n) { var self = this; return self.times(n).then(function(start) { return self.many().map(function(end) { return start.concat(end); }); }); }; _.map = function(fn) { return this.then(function(result) { return succeed(fn(result)); }); }; _.skip = function(two) { return this.then(function(result) { return two.result(result); }); }; // -*- primitive parsers -*- // var string = this.string = function(str) { var len = str.length; var expected = "expected '"+str+"'"; return Parser(function(stream, onSuccess, onFailure) { var head = stream.slice(0, len); if (head === str) { return onSuccess(stream.slice(len), head); } else { return onFailure(stream, expected); } }); }; var regex = this.regex = function(re) { pray('regexp parser is anchored', re.toString().charAt(1) === '^'); var expected = 'expected '+re; return Parser(function(stream, onSuccess, onFailure) { var match = re.exec(stream); if (match) { var result = match[0]; return onSuccess(stream.slice(result.length), result); } else { return onFailure(stream, expected); } }); }; var succeed = Parser.succeed = function(result) { return Parser(function(stream, onSuccess) { return onSuccess(stream, result); }); }; var fail = Parser.fail = function(msg) { return Parser(function(stream, _, onFailure) { return onFailure(stream, msg); }); }; var letter = Parser.letter = regex(/^[a-z]/i); var letters = Parser.letters = regex(/^[a-z]*/i); var digit = Parser.digit = regex(/^[0-9]/); var digits = Parser.digits = regex(/^[0-9]*/); var whitespace = Parser.whitespace = regex(/^\s+/); var optWhitespace = Parser.optWhitespace = regex(/^\s*/); var any = Parser.any = Parser(function(stream, onSuccess, onFailure) { if (!stream) return onFailure(stream, 'expected any character'); return onSuccess(stream.slice(1), stream.charAt(0)); }); var all = Parser.all = Parser(function(stream, onSuccess, onFailure) { return onSuccess('', stream); }); var eof = Parser.eof = Parser(function(stream, onSuccess, onFailure) { if (stream) return onFailure(stream, 'expected EOF'); return onSuccess(stream, stream); }); }); /************************************************* * Base classes of the MathQuill virtual DOM tree * * Only doing tree node manipulation via these * adopt/ disown methods guarantees well-formedness * of the tree. ************************************************/ // L = 'left' // R = 'right' // // the contract is that they can be used as object properties // and (-L) === R, and (-R) === L. var L = -1; var R = 1; function prayDirection(dir) { pray('a direction was passed', dir === L || dir === R); } /** * Tiny extension of jQuery adding directionalized DOM manipulation methods. * * Funny how Pjs v3 almost just works with `jQuery.fn.init`. * * jQuery features that don't work on $: * - jQuery.*, like jQuery.ajax, obviously (Pjs doesn't and shouldn't * copy constructor properties) * * - jQuery(function), the shortcut for `jQuery(document).ready(function)`, * because `jQuery.fn.init` is idiosyncratic and Pjs doing, essentially, * `jQuery.fn.init.apply(this, arguments)` isn't quite right, you need: * * _.init = function(s, c) { jQuery.fn.init.call(this, s, c, $(document)); }; * * if you actually give a shit (really, don't bother), * see https://github.com/jquery/jquery/blob/1.7.2/src/core.js#L889 * * - jQuery(selector), because jQuery translates that to * `jQuery(document).find(selector)`, but Pjs doesn't (should it?) let * you override the result of a constructor call * + note that because of the jQuery(document) shortcut-ness, there's also * the 3rd-argument-needs-to-be-`$(document)` thing above, but the fix * for that (as can be seen above) is really easy. This problem requires * a way more intrusive fix * * And that's it! Everything else just magically works because jQuery internally * uses `this.constructor()` everywhere (hence calling `$`), but never ever does * `this.constructor.find` or anything like that, always doing `jQuery.find`. */ var $ = P(jQuery, function(_) { _.insDirOf = function(dir, el) { return dir === L ? this.insertBefore(el.first()) : this.insertAfter(el.last()); }; _.insAtDirEnd = function(dir, el) { return dir === L ? this.prependTo(el) : this.appendTo(el); }; }); var Point = P(function(_) { _.parent = 0; _[L] = 0; _[R] = 0; _.init = function(parent, leftward, rightward) { this.parent = parent; this[L] = leftward; this[R] = rightward; }; }); /** * MathQuill virtual-DOM tree-node abstract base class */ var Node = P(function(_) { _[L] = 0; _[R] = 0 _.parent = 0; _.init = function() { this.ends = {}; this.ends[L] = 0; this.ends[R] = 0; }; _.children = function() { return Fragment(this.ends[L], this.ends[R]); }; _.eachChild = function(fn) { return this.children().each(fn); }; _.foldChildren = function(fold, fn) { return this.children().fold(fold, fn); }; _.adopt = function(parent, leftward, rightward) { Fragment(this, this).adopt(parent, leftward, rightward); return this; }; _.disown = function() { Fragment(this, this).disown(); return this; }; }); /** * An entity outside the virtual tree with one-way pointers (so it's only a * "view" of part of the tree, not an actual node/entity in the tree) that * delimits a doubly-linked list of sibling nodes. * It's like a fanfic love-child between HTML DOM DocumentFragment and the Range * classes: like DocumentFragment, its contents must be sibling nodes * (unlike Range, whose contents are arbitrary contiguous pieces of subtrees), * but like Range, it has only one-way pointers to its contents, its contents * have no reference to it and in fact may still be in the visible tree (unlike * DocumentFragment, whose contents must be detached from the visible tree * and have their 'parent' pointers set to the DocumentFragment). */ var Fragment = P(function(_) { _.init = function(leftEnd, rightEnd) { pray('no half-empty fragments', !leftEnd === !rightEnd); this.ends = {}; if (!leftEnd) return; pray('left end node is passed to Fragment', leftEnd instanceof Node); pray('right end node is passed to Fragment', rightEnd instanceof Node); pray('leftEnd and rightEnd have the same parent', leftEnd.parent === rightEnd.parent); this.ends[L] = leftEnd; this.ends[R] = rightEnd; }; function prayWellFormed(parent, leftward, rightward) { pray('a parent is always present', parent); pray('leftward is properly set up', (function() { // either it's empty and `rightward` is the left end child (possibly empty) if (!leftward) return parent.ends[L] === rightward; // or it's there and its [R] and .parent are properly set up return leftward[R] === rightward && leftward.parent === parent; })()); pray('rightward is properly set up', (function() { // either it's empty and `leftward` is the right end child (possibly empty) if (!rightward) return parent.ends[R] === leftward; // or it's there and its [L] and .parent are properly set up return rightward[L] === leftward && rightward.parent === parent; })()); } _.adopt = function(parent, leftward, rightward) { prayWellFormed(parent, leftward, rightward); var self = this; self.disowned = false; var leftEnd = self.ends[L]; if (!leftEnd) return this; var rightEnd = self.ends[R]; if (leftward) { // NB: this is handled in the ::each() block // leftward[R] = leftEnd } else { parent.ends[L] = leftEnd; } if (rightward) { rightward[L] = rightEnd; } else { parent.ends[R] = rightEnd; } self.ends[R][R] = rightward; self.each(function(el) { el[L] = leftward; el.parent = parent; if (leftward) leftward[R] = el; leftward = el; }); return self; }; _.disown = function() { var self = this; var leftEnd = self.ends[L]; // guard for empty and already-disowned fragments if (!leftEnd || self.disowned) return self; self.disowned = true; var rightEnd = self.ends[R] var parent = leftEnd.parent; prayWellFormed(parent, leftEnd[L], leftEnd); prayWellFormed(parent, rightEnd, rightEnd[R]); if (leftEnd[L]) { leftEnd[L][R] = rightEnd[R]; } else { parent.ends[L] = rightEnd[R]; } if (rightEnd[R]) { rightEnd[R][L] = leftEnd[L]; } else { parent.ends[R] = leftEnd[L]; } return self; }; _.each = function(fn) { var self = this; var el = self.ends[L]; if (!el) return self; for (;el !== self.ends[R][R]; el = el[R]) { if (fn.call(self, el) === false) break; } return self; }; _.fold = function(fold, fn) { this.each(function(el) { fold = fn.call(this, fold, el); }); return fold; }; }); /************************************************* * Abstract classes of math blocks and commands. ************************************************/ var uuid = (function() { var id = 0; return function() { return id += 1; }; })(); /** * Math tree node base class. * Some math-tree-specific extensions to Node. * Both MathBlock's and MathCommand's descend from it. */ var MathElement = P(Node, function(_, _super) { _.init = function(obj) { _super.init.call(this); this.id = uuid(); MathElement[this.id] = this; }; _.toString = function() { return '[MathElement '+this.id+']'; }; _.bubble = function(event /*, args... */) { var args = __slice.call(arguments, 1); for (var ancestor = this; ancestor; ancestor = ancestor.parent) { var res = ancestor[event] && ancestor[event].apply(ancestor, args); if (res === false) break; } return this; }; _.postOrder = function(fn /*, args... */) { var args = __slice.call(arguments, 1); if (typeof fn === 'string') { var methodName = fn; fn = function(el) { if (methodName in el) el[methodName].apply(el, args); }; } (function recurse(desc) { desc.eachChild(recurse); fn(desc); })(this); }; _.jQ = $(); _.jQadd = function(jQ) { this.jQ = this.jQ.add(jQ); }; this.jQize = function(html) { // Sets the .jQ of the entire math subtree rooted at this command. // Expects .createBlocks() to have been called already, since it // calls .html(). var jQ = $(html); jQ.find('*').andSelf().each(function() { var jQ = $(this), cmdId = jQ.attr('mathquill-command-id'), blockId = jQ.attr('mathquill-block-id'); if (cmdId) MathElement[cmdId].jQadd(jQ); if (blockId) MathElement[blockId].jQadd(jQ); }); return jQ; }; _.finalizeInsert = function() { var self = this; self.postOrder('finalizeTree'); // note: this order is important. // empty elements need the empty box provided by blur to // be present in order for their dimensions to be measured // correctly in redraw. self.postOrder('blur'); // adjust context-sensitive spacing self.postOrder('respace'); if (self[R].respace) self[R].respace(); if (self[L].respace) self[L].respace(); self.postOrder('redraw'); self.bubble('redraw'); }; }); /** * Commands and operators, like subscripts, exponents, or fractions. * Descendant commands are organized into blocks. */ var MathCommand = P(MathElement, function(_, _super) { _.init = function(ctrlSeq, htmlTemplate, textTemplate) { var cmd = this; _super.init.call(cmd); if (!cmd.ctrlSeq) cmd.ctrlSeq = ctrlSeq; if (htmlTemplate) cmd.htmlTemplate = htmlTemplate; if (textTemplate) cmd.textTemplate = textTemplate; }; // obvious methods _.replaces = function(replacedFragment) { replacedFragment.disown(); this.replacedFragment = replacedFragment; }; _.isEmpty = function() { return this.foldChildren(true, function(isEmpty, child) { return isEmpty && child.isEmpty(); }); }; _.parser = function() { var block = latexMathParser.block; var self = this; return block.times(self.numBlocks()).map(function(blocks) { self.blocks = blocks; for (var i = 0; i < blocks.length; i += 1) { blocks[i].adopt(self, self.ends[R], 0); } return self; }); }; // createLeftOf(cursor) and the methods it calls _.createLeftOf = function(cursor) { var cmd = this; var replacedFragment = cmd.replacedFragment; cmd.createBlocks(); MathElement.jQize(cmd.html()); if (replacedFragment) { replacedFragment.adopt(cmd.ends[L], 0, 0); replacedFragment.jQ.appendTo(cmd.ends[L].jQ); } cursor.jQ.before(cmd.jQ); cursor[L] = cmd.adopt(cursor.parent, cursor[L], cursor[R]); cmd.finalizeInsert(cursor); cmd.placeCursor(cursor); }; _.createBlocks = function() { var cmd = this, numBlocks = cmd.numBlocks(), blocks = cmd.blocks = Array(numBlocks); for (var i = 0; i < numBlocks; i += 1) { var newBlock = blocks[i] = MathBlock(); newBlock.adopt(cmd, cmd.ends[R], 0); } }; _.respace = noop; //placeholder for context-sensitive spacing _.placeCursor = function(cursor) { //insert the cursor at the right end of the first empty child, searching //left-to-right, or if none empty, the right end child cursor.insAtRightEnd(this.foldChildren(this.ends[L], function(leftward, child) { return leftward.isEmpty() ? leftward : child; })); }; // remove() _.remove = function() { this.disown(); this.jQ.remove(); this.postOrder(function(el) { delete MathElement[el.id]; }); return this; }; // methods involved in creating and cross-linking with HTML DOM nodes /* They all expect an .htmlTemplate like '&0' or '&0&1' See html.test.js for more examples. Requirements: - For each block of the command, there must be exactly one "block content marker" of the form '&' where is the 0-based index of the block. (Like the LaTeX \newcommand syntax, but with a 0-based rather than 1-based index, because JavaScript because C because Dijkstra.) - The block content marker must be the sole contents of the containing element, there can't even be surrounding whitespace, or else we can't guarantee sticking to within the bounds of the block content marker when mucking with the HTML DOM. - The HTML not only must be well-formed HTML (of course), but also must conform to the XHTML requirements on tags, specifically all tags must either be self-closing (like '
                    ') or come in matching pairs. Close tags are never optional. Note that & isn't well-formed HTML; if you wanted a literal '&123', your HTML template would have to have '&123'. */ _.numBlocks = function() { var matches = this.htmlTemplate.match(/&\d+/g); return matches ? matches.length : 0; }; _.html = function() { // Render the entire math subtree rooted at this command, as HTML. // Expects .createBlocks() to have been called already, since it uses the // .blocks array of child blocks. // // See html.test.js for example templates and intended outputs. // // Given an .htmlTemplate as described above, // - insert the mathquill-command-id attribute into all top-level tags, // which will be used to set this.jQ in .jQize(). // This is straightforward: // * tokenize into tags and non-tags // * loop through top-level tokens: // * add #cmdId attribute macro to top-level self-closing tags // * else add #cmdId attribute macro to top-level open tags // * skip the matching top-level close tag and all tag pairs // in between // - for each block content marker, // + replace it with the contents of the corresponding block, // rendered as HTML // + insert the mathquill-block-id attribute into the containing tag // This is even easier, a quick regex replace, since block tags cannot // contain anything besides the block content marker. // // Two notes: // - The outermost loop through top-level tokens should never encounter any // top-level close tags, because we should have first encountered a // matching top-level open tag, all inner tags should have appeared in // matching pairs and been skipped, and then we should have skipped the // close tag in question. // - All open tags should have matching close tags, which means our inner // loop should always encounter a close tag and drop nesting to 0. If // a close tag is missing, the loop will continue until i >= tokens.length // and token becomes undefined. This will not infinite loop, even in // production without pray(), because it will then TypeError on .slice(). var cmd = this; var blocks = cmd.blocks; var cmdId = ' mathquill-command-id=' + cmd.id; var tokens = cmd.htmlTemplate.match(/<[^<>]+>|[^<>]+/g); pray('no unmatched angle brackets', tokens.join('') === this.htmlTemplate); // add cmdId to all top-level tags for (var i = 0, token = tokens[0]; token; i += 1, token = tokens[i]) { // top-level self-closing tags if (token.slice(-2) === '/>') { tokens[i] = token.slice(0,-2) + cmdId + '/>'; } // top-level open tags else if (token.charAt(0) === '<') { pray('not an unmatched top-level close tag', token.charAt(1) !== '/'); tokens[i] = token.slice(0,-1) + cmdId + '>'; // skip matching top-level close tag and all tag pairs in between var nesting = 1; do { i += 1, token = tokens[i]; pray('no missing close tags', token); // close tags if (token.slice(0,2) === '') { nesting += 1; } } while (nesting > 0); } } return tokens.join('').replace(/>&(\d+)/g, function($0, $1) { return ' mathquill-block-id=' + blocks[$1].id + '>' + blocks[$1].join('html'); }); }; // methods to export a string representation of the math tree _.latex = function() { return this.foldChildren(this.ctrlSeq, function(latex, child) { return latex + '{' + (child.latex() || ' ') + '}'; }); }; _.textTemplate = ['']; _.text = function() { var cmd = this, i = 0; return cmd.foldChildren(cmd.textTemplate[i], function(text, child) { i += 1; var child_text = child.text(); if (text && cmd.textTemplate[i] === '(' && child_text[0] === '(' && child_text.slice(-1) === ')') return text + child_text.slice(1, -1) + cmd.textTemplate[i]; return text + child.text() + (cmd.textTemplate[i] || ''); }); }; }); /** * Lightweight command without blocks or children. */ var Symbol = P(MathCommand, function(_, _super) { _.init = function(ctrlSeq, html, text) { if (!text) text = ctrlSeq && ctrlSeq.length > 1 ? ctrlSeq.slice(1) : ctrlSeq; _super.init.call(this, ctrlSeq, html, [ text ]); }; _.parser = function() { return Parser.succeed(this); }; _.numBlocks = function() { return 0; }; _.replaces = function(replacedFragment) { replacedFragment.remove(); }; _.createBlocks = noop; _.latex = function(){ return this.ctrlSeq; }; _.text = function(){ return this.textTemplate; }; _.placeCursor = noop; _.isEmpty = function(){ return true; }; }); /** * Children and parent of MathCommand's. Basically partitions all the * symbols and operators that descend (in the Math DOM tree) from * ancestor operators. */ var MathBlock = P(MathElement, function(_) { _.join = function(methodName) { return this.foldChildren('', function(fold, child) { return fold + child[methodName](); }); }; _.latex = function() { return this.join('latex'); }; _.text = function() { return this.ends[L] === this.ends[R] ? this.ends[L].text() : '(' + this.join('text') + ')' ; }; _.isEmpty = function() { return this.ends[L] === 0 && this.ends[R] === 0; }; _.write = function(cursor, ch, replacedFragment) { var cmd; if (ch.match(/^[a-eg-zA-Z]$/)) //exclude f because want florin cmd = Variable(ch); else if (cmd = CharCmds[ch] || LatexCmds[ch]) cmd = cmd(ch); else cmd = VanillaSymbol(ch); if (replacedFragment) cmd.replaces(replacedFragment); cmd.createLeftOf(cursor); }; _.focus = function() { this.jQ.addClass('hasCursor'); this.jQ.removeClass('empty'); return this; }; _.blur = function() { this.jQ.removeClass('hasCursor'); if (this.isEmpty()) this.jQ.addClass('empty'); return this; }; }); /** * Math tree fragment base class. * Some math-tree-specific extensions to Fragment. */ var MathFragment = P(Fragment, function(_, _super) { _.init = function(leftEnd, rightEnd) { // just select one thing if only one argument _super.init.call(this, leftEnd, rightEnd || leftEnd); this.jQ = this.fold($(), function(jQ, child){ return child.jQ.add(jQ); }); }; _.latex = function() { return this.fold('', function(latex, el){ return latex + el.latex(); }); }; _.remove = function() { this.jQ.remove(); this.each(function(el) { el.postOrder(function(desc) { delete MathElement[desc.id]; }); }); return this.disown(); }; }); /********************************************* * Root math elements with event delegation. ********************************************/ function createRoot(jQ, root, textbox, editable) { var contents = jQ.contents().detach(); if (!textbox) { jQ.addClass('mathquill-rendered-math'); } root.jQ = jQ.attr(mqBlockId, root.id); root.revert = function() { jQ.empty().unbind('.mathquill') .removeClass('mathquill-rendered-math mathquill-editable mathquill-textbox') .append(contents); }; var cursor = root.cursor = Cursor(root); root.renderLatex(contents.text()); //textarea stuff var textareaSpan = root.textarea = $(''), textarea = textareaSpan.children(); /****** * TODO [Han]: Document this */ var textareaSelectionTimeout; root.selectionChanged = function() { if (textareaSelectionTimeout === undefined) { textareaSelectionTimeout = setTimeout(setTextareaSelection); } forceIERedraw(jQ[0]); }; function setTextareaSelection() { textareaSelectionTimeout = undefined; var latex = cursor.selection ? '$'+cursor.selection.latex()+'$' : ''; textareaManager.select(latex); } //prevent native selection except textarea jQ.bind('selectstart.mathquill', function(e) { if (e.target !== textarea[0]) e.preventDefault(); e.stopPropagation(); }); //drag-to-select event handling var anticursor, blink = cursor.blink; jQ.bind('mousedown.mathquill', function(e) { function mousemove(e) { cursor.seek($(e.target), e.pageX, e.pageY); if (cursor[L] !== anticursor[L] || cursor.parent !== anticursor.parent) { cursor.selectFrom(anticursor); } return false; } // docmousemove is attached to the document, so that // selection still works when the mouse leaves the window. function docmousemove(e) { // [Han]: i delete the target because of the way seek works. // it will not move the mouse to the target, but will instead // just seek those X and Y coordinates. If there is a target, // it will try to move the cursor to document, which will not work. // cursor.seek needs to be refactored. delete e.target; return mousemove(e); } function mouseup(e) { anticursor = undefined; cursor.blink = blink; if (!cursor.selection) { if (editable) { cursor.show(); } else { textareaSpan.detach(); } } // delete the mouse handlers now that we're not dragging anymore jQ.unbind('mousemove', mousemove); $(e.target.ownerDocument).unbind('mousemove', docmousemove).unbind('mouseup', mouseup); } setTimeout(function() { textarea.focus(); }); // preventDefault won't prevent focus on mousedown in IE<9 // that means immediately after this mousedown, whatever was // mousedown-ed will receive focus // http://bugs.jquery.com/ticket/10345 cursor.blink = noop; cursor.seek($(e.target), e.pageX, e.pageY); anticursor = Point(cursor.parent, cursor[L], cursor[R]); if (!editable) jQ.prepend(textareaSpan); jQ.mousemove(mousemove); $(e.target.ownerDocument).mousemove(docmousemove).mouseup(mouseup); return false; }); if (!editable) { var textareaManager = manageTextarea(textarea, { container: jQ }); jQ.bind('cut paste', false).bind('copy', setTextareaSelection) .prepend('$'+root.latex()+'$'); textarea.blur(function() { cursor.clearSelection(); setTimeout(detach); //detaching during blur explodes in WebKit }); function detach() { textareaSpan.detach(); } return; } var textareaManager = manageTextarea(textarea, { container: jQ, key: function(key, evt) { cursor.parent.bubble('onKey', key, evt); }, text: function(text) { cursor.parent.bubble('onText', text); }, cut: function(e) { if (cursor.selection) { setTimeout(function() { cursor.prepareEdit(); cursor.parent.bubble('redraw'); }); } e.stopPropagation(); }, paste: function(text) { // FIXME HACK the parser in RootTextBlock needs to be moved to // Cursor::writeLatex or something so this'll work with // MathQuill textboxes if (text.slice(0,1) === '$' && text.slice(-1) === '$') { text = text.slice(1, -1); } else { text = '\\text{' + text + '}'; } cursor.writeLatex(text).show(); } }); jQ.prepend(textareaSpan); //root CSS classes jQ.addClass('mathquill-editable'); if (textbox) jQ.addClass('mathquill-textbox'); //focus and blur handling textarea.focus(function(e) { if (!cursor.parent) cursor.insAtRightEnd(root); cursor.parent.jQ.addClass('hasCursor'); if (cursor.selection) { cursor.selection.jQ.removeClass('blur'); setTimeout(root.selectionChanged); //re-select textarea contents after tabbing away and back } else cursor.show(); e.stopPropagation(); }).blur(function(e) { cursor.hide().parent.blur(); if (cursor.selection) cursor.selection.jQ.addClass('blur'); e.stopPropagation(); }); jQ.bind('focus.mathquill blur.mathquill', function(e) { textarea.trigger(e); }).blur(); } var RootMathBlock = P(MathBlock, function(_, _super) { _.latex = function() { return _super.latex.call(this).replace(/(\\[a-z]+) (?![a-z])/ig,'$1'); }; _.text = function() { return this.foldChildren('', function(text, child) { return text + child.text(); }); }; _.renderLatex = function(latex) { var jQ = this.jQ; jQ.children().slice(1).remove(); this.ends[L] = this.ends[R] = 0; delete this.cursor.selection; this.cursor.insAtRightEnd(this).writeLatex(latex); }; _.onKey = function(key, e) { switch (key) { case 'Ctrl-Shift-Backspace': case 'Ctrl-Backspace': while (this.cursor[L] || this.cursor.selection) { this.cursor.backspace(); } break; case 'Shift-Backspace': case 'Backspace': this.cursor.backspace(); break; // Tab or Esc -> go one block right if it exists, else escape right. case 'Esc': case 'Tab': case 'Spacebar': var parent = this.cursor.parent; // cursor is in root editable, continue default if (parent === this.cursor.root) { if (key === 'Spacebar') e.preventDefault(); return; } this.cursor.prepareMove(); if (parent[R]) { // go one block right this.cursor.insAtLeftEnd(parent[R]); } else { // get out of the block this.cursor.insRightOf(parent.parent); } break; // Shift-Tab -> go one block left if it exists, else escape left. case 'Shift-Tab': case 'Shift-Esc': case 'Shift-Spacebar': var parent = this.cursor.parent; //cursor is in root editable, continue default if (parent === this.cursor.root) { if (key === 'Shift-Spacebar') e.preventDefault(); return; } this.cursor.prepareMove(); if (parent[L]) { // go one block left this.cursor.insAtRightEnd(parent[L]); } else { //get out of the block this.cursor.insLeftOf(parent.parent); } break; // Prevent newlines from showing up case 'Enter': break; // End -> move to the end of the current block. case 'End': this.cursor.prepareMove().insAtRightEnd(this.cursor.parent); break; // Ctrl-End -> move all the way to the end of the root block. case 'Ctrl-End': this.cursor.prepareMove().insAtRightEnd(this); break; // Shift-End -> select to the end of the current block. case 'Shift-End': while (this.cursor[R]) { this.cursor.selectRight(); } break; // Ctrl-Shift-End -> select to the end of the root block. case 'Ctrl-Shift-End': while (this.cursor[R] || this.cursor.parent !== this) { this.cursor.selectRight(); } break; // Home -> move to the start of the root block or the current block. case 'Home': this.cursor.prepareMove().insAtLeftEnd(this.cursor.parent); break; // Ctrl-Home -> move to the start of the current block. case 'Ctrl-Home': this.cursor.prepareMove().insAtLeftEnd(this); break; // Shift-Home -> select to the start of the current block. case 'Shift-Home': while (this.cursor[L]) { this.cursor.selectLeft(); } break; // Ctrl-Shift-Home -> move to the start of the root block. case 'Ctrl-Shift-Home': while (this.cursor[L] || this.cursor.parent !== this) { this.cursor.selectLeft(); } break; case 'Left': this.cursor.moveLeft(); break; case 'Shift-Left': this.cursor.selectLeft(); break; case 'Ctrl-Left': break; case 'Right': this.cursor.moveRight(); break; case 'Shift-Right': this.cursor.selectRight(); break; case 'Ctrl-Right': break; case 'Up': this.cursor.moveUp(); break; case 'Down': this.cursor.moveDown(); break; case 'Shift-Up': if (this.cursor[L]) { while (this.cursor[L]) this.cursor.selectLeft(); } else { this.cursor.selectLeft(); } case 'Shift-Down': if (this.cursor[R]) { while (this.cursor[R]) this.cursor.selectRight(); } else { this.cursor.selectRight(); } case 'Ctrl-Up': break; case 'Ctrl-Down': break; case 'Ctrl-Shift-Del': case 'Ctrl-Del': while (this.cursor[R] || this.cursor.selection) { this.cursor.deleteForward(); } break; case 'Shift-Del': case 'Del': this.cursor.deleteForward(); break; case 'Meta-A': case 'Ctrl-A': //so not stopPropagation'd at RootMathCommand if (this !== this.cursor.root) return; this.cursor.prepareMove().insAtRightEnd(this); while (this.cursor[L]) this.cursor.selectLeft(); break; default: return false; } e.preventDefault(); return false; }; _.onText = function(ch) { this.cursor.write(ch); return false; }; }); var RootMathCommand = P(MathCommand, function(_, _super) { _.init = function(cursor) { _super.init.call(this, '$'); this.cursor = cursor; }; _.htmlTemplate = '&0'; _.createBlocks = function() { this.ends[L] = this.ends[R] = RootMathBlock(); this.blocks = [ this.ends[L] ]; this.ends[L].parent = this; this.ends[L].cursor = this.cursor; this.ends[L].write = function(cursor, ch, replacedFragment) { if (ch !== '$') MathBlock.prototype.write.call(this, cursor, ch, replacedFragment); else if (this.isEmpty()) { cursor.insRightOf(this.parent).backspace().show(); VanillaSymbol('\\$','$').createLeftOf(cursor); } else if (!cursor[R]) cursor.insRightOf(this.parent); else if (!cursor[L]) cursor.insLeftOf(this.parent); else MathBlock.prototype.write.call(this, cursor, ch, replacedFragment); }; }; _.latex = function() { return '$' + this.ends[L].latex() + '$'; }; }); var RootTextBlock = P(MathBlock, function(_) { _.renderLatex = function(latex) { var self = this; var cursor = self.cursor; self.jQ.children().slice(1).remove(); self.ends[L] = self.ends[R] = 0; delete cursor.selection; cursor.show().insAtRightEnd(self); var regex = Parser.regex; var string = Parser.string; var eof = Parser.eof; var all = Parser.all; // Parser RootMathCommand var mathMode = string('$').then(latexMathParser) // because TeX is insane, math mode doesn't necessarily // have to end. So we allow for the case that math mode // continues to the end of the stream. .skip(string('$').or(eof)) .map(function(block) { // HACK FIXME: this shouldn't have to have access to cursor var rootMathCommand = RootMathCommand(cursor); rootMathCommand.createBlocks(); var rootMathBlock = rootMathCommand.ends[L]; block.children().adopt(rootMathBlock, 0, 0); return rootMathCommand; }) ; var escapedDollar = string('\\$').result('$'); var textChar = escapedDollar.or(regex(/^[^$]/)).map(VanillaSymbol); var latexText = mathMode.or(textChar).many(); var commands = latexText.skip(eof).or(all.result(false)).parse(latex); if (commands) { for (var i = 0; i < commands.length; i += 1) { commands[i].adopt(self, self.ends[R], 0); } var html = self.join('html'); MathElement.jQize(html).appendTo(self.jQ); this.finalizeInsert(); } }; _.onKey = function(key) { if (key === 'Spacebar' || key === 'Shift-Spacebar') return; RootMathBlock.prototype.onKey.apply(this, arguments); }; _.onText = RootMathBlock.prototype.onText; _.write = function(cursor, ch, replacedFragment) { if (replacedFragment) replacedFragment.remove(); if (ch === '$') RootMathCommand(cursor).createLeftOf(cursor); else { var html; if (ch === '<') html = '<'; else if (ch === '>') html = '>'; VanillaSymbol(ch, html).createLeftOf(cursor); } }; }); /*************************** * Commands and Operators. **************************/ var CharCmds = {}, LatexCmds = {}; //single character commands, LaTeX commands var scale, // = function(jQ, x, y) { ... } //will use a CSS 2D transform to scale the jQuery-wrapped HTML elements, //or the filter matrix transform fallback for IE 5.5-8, or gracefully degrade to //increasing the fontSize to match the vertical Y scaling factor. //ideas from http://github.com/louisremi/jquery.transform.js //see also http://msdn.microsoft.com/en-us/library/ms533014(v=vs.85).aspx forceIERedraw = noop, div = document.createElement('div'), div_style = div.style, transformPropNames = { transform:1, WebkitTransform:1, MozTransform:1, OTransform:1, msTransform:1 }, transformPropName; for (var prop in transformPropNames) { if (prop in div_style) { transformPropName = prop; break; } } if (transformPropName) { scale = function(jQ, x, y) { jQ.css(transformPropName, 'scale('+x+','+y+')'); }; } else if ('filter' in div_style) { //IE 6, 7, & 8 fallback, see https://github.com/laughinghan/mathquill/wiki/Transforms forceIERedraw = function(el){ el.className = el.className; }; scale = function(jQ, x, y) { //NOTE: assumes y > x x /= (1+(y-1)/2); jQ.css('fontSize', y + 'em'); if (!jQ.hasClass('matrixed-container')) { jQ.addClass('matrixed-container') .wrapInner(''); } var innerjQ = jQ.children() .css('filter', 'progid:DXImageTransform.Microsoft' + '.Matrix(M11=' + x + ",SizingMethod='auto expand')" ); function calculateMarginRight() { jQ.css('marginRight', (innerjQ.width()-1)*(x-1)/x + 'px'); } calculateMarginRight(); var intervalId = setInterval(calculateMarginRight); $(window).load(function() { clearTimeout(intervalId); calculateMarginRight(); }); }; } else { scale = function(jQ, x, y) { jQ.css('fontSize', y + 'em'); }; } var Style = P(MathCommand, function(_, _super) { _.init = function(ctrlSeq, tagName, attrs) { _super.init.call(this, ctrlSeq, '<'+tagName+' '+attrs+'>&0'); }; }); //fonts LatexCmds.mathrm = bind(Style, '\\mathrm', 'span', 'class="roman font"'); LatexCmds.mathit = bind(Style, '\\mathit', 'i', 'class="font"'); LatexCmds.mathbf = bind(Style, '\\mathbf', 'b', 'class="font"'); LatexCmds.mathsf = bind(Style, '\\mathsf', 'span', 'class="sans-serif font"'); LatexCmds.mathtt = bind(Style, '\\mathtt', 'span', 'class="monospace font"'); //text-decoration LatexCmds.underline = bind(Style, '\\underline', 'span', 'class="non-leaf underline"'); LatexCmds.overline = LatexCmds.bar = bind(Style, '\\overline', 'span', 'class="non-leaf overline"'); var SupSub = P(MathCommand, function(_, _super) { _.init = function(ctrlSeq, tag, text) { _super.init.call(this, ctrlSeq, '<'+tag+' class="non-leaf">&0', [ text ]); }; _.finalizeTree = function() { //TODO: use inheritance pray('SupSub is only _ and ^', this.ctrlSeq === '^' || this.ctrlSeq === '_' ); if (this.ctrlSeq === '_') { this.down = this.ends[L]; this.ends[L].up = insLeftOfMeUnlessAtEnd; } else { this.up = this.ends[L]; this.ends[L].down = insLeftOfMeUnlessAtEnd; } function insLeftOfMeUnlessAtEnd(cursor) { // cursor.insLeftOf(cmd), unless cursor at the end of block, and every // ancestor cmd is at the end of every ancestor block var cmd = this.parent, ancestorCmd = cursor; do { if (ancestorCmd[R]) { cursor.insLeftOf(cmd); return false; } ancestorCmd = ancestorCmd.parent.parent; } while (ancestorCmd !== cmd); cursor.insRightOf(cmd); return false; } }; _.latex = function() { var latex = this.ends[L].latex(); if (latex.length === 1) return this.ctrlSeq + latex; else return this.ctrlSeq + '{' + (latex || ' ') + '}'; }; _.redraw = function() { if (this[L]) this[L].respace(); //SupSub::respace recursively calls respace on all the following SupSubs //so if leftward is a SupSub, no need to call respace on this or following nodes if (!(this[L] instanceof SupSub)) { this.respace(); //and if rightward is a SupSub, then this.respace() will have already called //this[R].respace() if (this[R] && !(this[R] instanceof SupSub)) this[R].respace(); } }; _.respace = function() { if ( this[L].ctrlSeq === '\\int ' || ( this[L] instanceof SupSub && this[L].ctrlSeq != this.ctrlSeq && this[L][L] && this[L][L].ctrlSeq === '\\int ' ) ) { if (!this.limit) { this.limit = true; this.jQ.addClass('limit'); } } else { if (this.limit) { this.limit = false; this.jQ.removeClass('limit'); } } this.respaced = this[L] instanceof SupSub && this[L].ctrlSeq != this.ctrlSeq && !this[L].respaced; if (this.respaced) { var fontSize = +this.jQ.css('fontSize').slice(0,-2), leftWidth = this[L].jQ.outerWidth(), thisWidth = this.jQ.outerWidth(); this.jQ.css({ left: (this.limit && this.ctrlSeq === '_' ? -.25 : 0) - leftWidth/fontSize + 'em', marginRight: .1 - min(thisWidth, leftWidth)/fontSize + 'em' //1px extra so it doesn't wrap in retarded browsers (Firefox 2, I think) }); } else if (this.limit && this.ctrlSeq === '_') { this.jQ.css({ left: '-.25em', marginRight: '' }); } else { this.jQ.css({ left: '', marginRight: '' }); } if (this[R] instanceof SupSub) this[R].respace(); return this; }; }); LatexCmds.subscript = LatexCmds._ = bind(SupSub, '_', 'sub', '_'); LatexCmds.superscript = LatexCmds.supscript = LatexCmds['^'] = bind(SupSub, '^', 'sup', '**'); var Fraction = LatexCmds.frac = LatexCmds.dfrac = LatexCmds.cfrac = LatexCmds.fraction = P(MathCommand, function(_, _super) { _.ctrlSeq = '\\frac'; _.htmlTemplate = '' + '&0' + '&1' + ' ' + '' ; _.textTemplate = ['(', '/', ')']; _.finalizeTree = function() { this.up = this.ends[R].up = this.ends[L]; this.down = this.ends[L].down = this.ends[R]; }; }); var LiveFraction = LatexCmds.over = CharCmds['/'] = P(Fraction, function(_, _super) { _.createLeftOf = function(cursor) { if (!this.replacedFragment) { var leftward = cursor[L]; while (leftward && !( leftward instanceof BinaryOperator || leftward instanceof TextBlock || leftward instanceof BigSymbol || ',;:'.split('').indexOf(leftward.ctrlSeq) > -1 ) //lookbehind for operator ) leftward = leftward[L]; if (leftward instanceof BigSymbol && leftward[R] instanceof SupSub) { leftward = leftward[R]; if (leftward[R] instanceof SupSub && leftward[R].ctrlSeq != leftward.ctrlSeq) leftward = leftward[R]; } if (leftward !== cursor[L]) { this.replaces(MathFragment(leftward[R] || cursor.parent.ends[L], cursor[L])); cursor[L] = leftward; } } _super.createLeftOf.call(this, cursor); }; }); var SquareRoot = LatexCmds.sqrt = LatexCmds['√'] = P(MathCommand, function(_, _super) { _.ctrlSeq = '\\sqrt'; _.htmlTemplate = '' + '' + '&0' + '' ; _.textTemplate = ['sqrt(', ')']; _.parser = function() { return latexMathParser.optBlock.then(function(optBlock) { return latexMathParser.block.map(function(block) { var nthroot = NthRoot(); nthroot.blocks = [ optBlock, block ]; optBlock.adopt(nthroot, 0, 0); block.adopt(nthroot, optBlock, 0); return nthroot; }); }).or(_super.parser.call(this)); }; _.redraw = function() { var block = this.ends[R].jQ; scale(block.prev(), 1, block.innerHeight()/+block.css('fontSize').slice(0,-2) - .1); }; }); var Vec = LatexCmds.vec = P(MathCommand, function(_, _super) { _.ctrlSeq = '\\vec'; _.htmlTemplate = '' + '' + '&0' + '' ; _.textTemplate = ['vec(', ')']; }); var NthRoot = LatexCmds.nthroot = P(SquareRoot, function(_, _super) { _.htmlTemplate = '&0' + '' + '' + '&1' + '' ; _.textTemplate = ['sqrt[', '](', ')']; _.latex = function() { return '\\sqrt['+this.ends[L].latex()+']{'+this.ends[R].latex()+'}'; }; }); // Round/Square/Curly/Angle Brackets (aka Parens/Brackets/Braces) var Bracket = P(MathCommand, function(_, _super) { _.init = function(open, close, ctrlSeq, end) { _super.init.call(this, '\\left'+ctrlSeq, '' + ''+open+'' + '&0' + ''+close+'' + '', [open, close]); this.end = '\\right'+end; }; _.jQadd = function() { _super.jQadd.apply(this, arguments); var jQ = this.jQ; this.bracketjQs = jQ.children(':first').add(jQ.children(':last')); }; _.latex = function() { return this.ctrlSeq + this.ends[L].latex() + this.end; }; _.redraw = function() { var blockjQ = this.ends[L].jQ; var height = blockjQ.outerHeight()/+blockjQ.css('fontSize').slice(0,-2); scale(this.bracketjQs, min(1 + .2*(height - 1), 1.2), 1.05*height); }; }); LatexCmds.left = P(MathCommand, function(_) { _.parser = function() { var regex = Parser.regex; var string = Parser.string; var succeed = Parser.succeed; var optWhitespace = Parser.optWhitespace; return optWhitespace.then(regex(/^(?:[([|]|\\\{)/)) .then(function(open) { if (open.charAt(0) === '\\') open = open.slice(1); var cmd = CharCmds[open](); return latexMathParser .map(function (block) { cmd.blocks = [ block ]; block.adopt(cmd, 0, 0); }) .then(string('\\right')) .skip(optWhitespace) .then(regex(/^(?:[\])|]|\\\})/)) .then(function(close) { if (close.slice(-1) !== cmd.end.slice(-1)) { return Parser.fail('open doesn\'t match close'); } return succeed(cmd); }) ; }) ; }; }); LatexCmds.right = P(MathCommand, function(_) { _.parser = function() { return Parser.fail('unmatched \\right'); }; }); LatexCmds.lbrace = CharCmds['{'] = bind(Bracket, '{', '}', '\\{', '\\}'); LatexCmds.langle = LatexCmds.lang = bind(Bracket, '⟨','⟩','\\langle ','\\rangle '); // Closing bracket matching opening bracket above var CloseBracket = P(Bracket, function(_, _super) { _.createLeftOf = function(cursor) { // if I'm at the end of my parent who is a matching open-paren, // and I am not replacing a selection fragment, don't create me, // just put cursor after my parent if (!cursor[R] && cursor.parent.parent && cursor.parent.parent.end === this.end && !this.replacedFragment) cursor.insRightOf(cursor.parent.parent); else _super.createLeftOf.call(this, cursor); }; _.placeCursor = function(cursor) { this.ends[L].blur(); cursor.insRightOf(this); }; }); LatexCmds.rbrace = CharCmds['}'] = bind(CloseBracket, '{','}','\\{','\\}'); LatexCmds.rangle = LatexCmds.rang = bind(CloseBracket, '⟨','⟩','\\langle ','\\rangle '); var parenMixin = function(_, _super) { _.init = function(open, close) { _super.init.call(this, open, close, open, close); }; }; var Paren = P(Bracket, parenMixin); LatexCmds.lparen = CharCmds['('] = bind(Paren, '(', ')'); LatexCmds.lbrack = LatexCmds.lbracket = CharCmds['['] = bind(Paren, '[', ']'); var CloseParen = P(CloseBracket, parenMixin); LatexCmds.rparen = CharCmds[')'] = bind(CloseParen, '(', ')'); LatexCmds.rbrack = LatexCmds.rbracket = CharCmds[']'] = bind(CloseParen, '[', ']'); var Pipes = LatexCmds.lpipe = LatexCmds.rpipe = CharCmds['|'] = P(Paren, function(_, _super) { _.init = function() { _super.init.call(this, '|', '|'); }; _.createLeftOf = CloseBracket.prototype.createLeftOf; }); var TextBlock = CharCmds.$ = LatexCmds.text = LatexCmds.textnormal = LatexCmds.textrm = LatexCmds.textup = LatexCmds.textmd = P(MathCommand, function(_, _super) { _.ctrlSeq = '\\text'; _.htmlTemplate = '&0'; _.replaces = function(replacedText) { if (replacedText instanceof MathFragment) this.replacedText = replacedText.remove().jQ.text(); else if (typeof replacedText === 'string') this.replacedText = replacedText; }; _.textTemplate = ['"', '"']; _.parser = function() { var self = this; // TODO: correctly parse text mode var string = Parser.string; var regex = Parser.regex; var optWhitespace = Parser.optWhitespace; return optWhitespace .then(string('{')).then(regex(/^[^}]*/)).skip(string('}')) .map(function(text) { self.createBlocks(); var block = self.ends[L]; for (var i = 0; i < text.length; i += 1) { var ch = VanillaSymbol(text.charAt(i)); ch.adopt(block, block.ends[R], 0); } return self; }) ; }; _.createBlocks = function() { //FIXME: another possible Law of Demeter violation, but this seems much cleaner, like it was supposed to be done this way this.ends[L] = this.ends[R] = InnerTextBlock(); this.blocks = [ this.ends[L] ]; this.ends[L].parent = this; }; _.finalizeInsert = function() { //FIXME HACK blur removes the TextBlock this.ends[L].blur = function() { delete this.blur; return this; }; _super.finalizeInsert.call(this); }; _.createLeftOf = function(cursor) { _super.createLeftOf.call(this, this.cursor = cursor); if (this.replacedText) for (var i = 0; i < this.replacedText.length; i += 1) this.ends[L].write(cursor, this.replacedText.charAt(i)); }; }); var InnerTextBlock = P(MathBlock, function(_, _super) { _.onKey = function(key, e) { if (key === 'Spacebar' || key === 'Shift-Spacebar') return false; }; // backspace and delete at ends of block don't unwrap _.deleteOutOf = function(dir, cursor) { if (this.isEmpty()) cursor.insRightOf(this.parent); }; _.write = function(cursor, ch, replacedFragment) { if (replacedFragment) replacedFragment.remove(); if (ch !== '$') { var html; if (ch === '<') html = '<'; else if (ch === '>') html = '>'; VanillaSymbol(ch, html).createLeftOf(cursor); } else if (this.isEmpty()) { cursor.insRightOf(this.parent).backspace(); VanillaSymbol('\\$','$').createLeftOf(cursor); } else if (!cursor[R]) cursor.insRightOf(this.parent); else if (!cursor[L]) cursor.insLeftOf(this.parent); else { //split apart var rightward = TextBlock(); rightward.replaces(MathFragment(cursor[R], this.ends[R])); cursor.insRightOf(this.parent); // FIXME HACK: pretend no prev so they don't get merged when // .createLeftOf() calls blur on the InnerTextBlock rightward.adopt = function() { delete this.adopt; this.adopt.apply(this, arguments); this[L] = 0; }; rightward.createLeftOf(cursor); rightward[L] = this.parent; cursor.insLeftOf(rightward); } return false; }; _.blur = function() { this.jQ.removeClass('hasCursor'); if (this.isEmpty()) { var textblock = this.parent, cursor = textblock.cursor; if (cursor.parent === this) this.jQ.addClass('empty'); else { cursor.hide(); textblock.remove(); if (cursor[R] === textblock) cursor[R] = textblock[R]; else if (cursor[L] === textblock) cursor[L] = textblock[L]; cursor.show().parent.bubble('redraw'); } } return this; }; _.focus = function() { _super.focus.call(this); var textblock = this.parent; if (textblock[R].ctrlSeq === textblock.ctrlSeq) { //TODO: seems like there should be a better way to move MathElements around var innerblock = this, cursor = textblock.cursor, rightward = textblock[R].ends[L]; rightward.eachChild(function(child){ child.parent = innerblock; child.jQ.appendTo(innerblock.jQ); }); if (this.ends[R]) this.ends[R][R] = rightward.ends[L]; else this.ends[L] = rightward.ends[L]; rightward.ends[L][L] = this.ends[R]; this.ends[R] = rightward.ends[R]; rightward.parent.remove(); if (cursor[L]) cursor.insRightOf(cursor[L]); else cursor.insAtLeftEnd(this); cursor.parent.bubble('redraw'); } else if (textblock[L].ctrlSeq === textblock.ctrlSeq) { var cursor = textblock.cursor; if (cursor[L]) textblock[L].ends[L].focus(); else cursor.insAtRightEnd(textblock[L].ends[L]); } return this; }; }); function makeTextBlock(latex, tagName, attrs) { return P(TextBlock, { ctrlSeq: latex, htmlTemplate: '<'+tagName+' '+attrs+'>&0' }); } LatexCmds.em = LatexCmds.italic = LatexCmds.italics = LatexCmds.emph = LatexCmds.textit = LatexCmds.textsl = makeTextBlock('\\textit', 'i', 'class="text"'); LatexCmds.strong = LatexCmds.bold = LatexCmds.textbf = makeTextBlock('\\textbf', 'b', 'class="text"'); LatexCmds.sf = LatexCmds.textsf = makeTextBlock('\\textsf', 'span', 'class="sans-serif text"'); LatexCmds.tt = LatexCmds.texttt = makeTextBlock('\\texttt', 'span', 'class="monospace text"'); LatexCmds.textsc = makeTextBlock('\\textsc', 'span', 'style="font-variant:small-caps" class="text"'); LatexCmds.uppercase = makeTextBlock('\\uppercase', 'span', 'style="text-transform:uppercase" class="text"'); LatexCmds.lowercase = makeTextBlock('\\lowercase', 'span', 'style="text-transform:lowercase" class="text"'); // input box to type a variety of LaTeX commands beginning with a backslash var LatexCommandInput = CharCmds['\\'] = P(MathCommand, function(_, _super) { _.ctrlSeq = '\\'; _.replaces = function(replacedFragment) { this._replacedFragment = replacedFragment.disown(); this.isEmpty = function() { return false; }; }; _.htmlTemplate = '\\&0'; _.textTemplate = ['\\']; _.createBlocks = function() { _super.createBlocks.call(this); this.ends[L].focus = function() { this.parent.jQ.addClass('hasCursor'); if (this.isEmpty()) this.parent.jQ.removeClass('empty'); return this; }; this.ends[L].blur = function() { this.parent.jQ.removeClass('hasCursor'); if (this.isEmpty()) this.parent.jQ.addClass('empty'); return this; }; }; _.createLeftOf = function(cursor) { _super.createLeftOf.call(this, cursor); this.cursor = cursor.insAtRightEnd(this.ends[L]); if (this._replacedFragment) { var el = this.jQ[0]; this.jQ = this._replacedFragment.jQ.addClass('blur').bind( 'mousedown mousemove', //FIXME: is monkey-patching the mousedown and mousemove handlers the right way to do this? function(e) { $(e.target = el).trigger(e); return false; } ).insertBefore(this.jQ).add(this.jQ); } this.ends[L].write = function(cursor, ch, replacedFragment) { if (replacedFragment) replacedFragment.remove(); if (ch.match(/[a-z]/i)) VanillaSymbol(ch).createLeftOf(cursor); else { this.parent.renderCommand(); if (ch !== '\\' || !this.isEmpty()) this.parent.parent.write(cursor, ch); } }; }; _.latex = function() { return '\\' + this.ends[L].latex() + ' '; }; _.onKey = function(key, e) { if (key === 'Tab' || key === 'Enter' || key === 'Spacebar') { this.renderCommand(); e.preventDefault(); return false; } }; _.renderCommand = function() { this.jQ = this.jQ.last(); this.remove(); if (this[R]) { this.cursor.insLeftOf(this[R]); } else { this.cursor.insAtRightEnd(this.parent); } var latex = this.ends[L].latex(), cmd; if (!latex) latex = 'backslash'; this.cursor.insertCmd(latex, this._replacedFragment); }; }); var Binomial = LatexCmds.binom = LatexCmds.binomial = P(MathCommand, function(_, _super) { _.ctrlSeq = '\\binom'; _.htmlTemplate = '(' + '' + '' + '&0' + '&1' + '' + '' + ')' ; _.textTemplate = ['choose(',',',')']; _.redraw = function() { var blockjQ = this.jQ.eq(1); var height = blockjQ.outerHeight()/+blockjQ.css('fontSize').slice(0,-2); var parens = this.jQ.filter('.paren'); scale(parens, min(1 + .2*(height - 1), 1.2), 1.05*height); }; }); var Choose = LatexCmds.choose = P(Binomial, function(_) { _.createLeftOf = LiveFraction.prototype.createLeftOf; }); var Vector = LatexCmds.vector = P(MathCommand, function(_, _super) { _.ctrlSeq = '\\vector'; _.htmlTemplate = '&0'; _.latex = function() { return '\\begin{matrix}' + this.foldChildren([], function(latex, child) { latex.push(child.latex()); return latex; }).join('\\\\') + '\\end{matrix}'; }; _.text = function() { return '[' + this.foldChildren([], function(text, child) { text.push(child.text()); return text; }).join() + ']'; }; _.createLeftOf = function(cursor) { _super.createLeftOf.call(this, this.cursor = cursor); }; _.onKey = function(key, e) { var currentBlock = this.cursor.parent; if (currentBlock.parent === this) { if (key === 'Enter') { //enter var newBlock = MathBlock(); newBlock.parent = this; newBlock.jQ = $('') .attr(mqBlockId, newBlock.id) .insertAfter(currentBlock.jQ); if (currentBlock[R]) currentBlock[R][L] = newBlock; else this.ends[R] = newBlock; newBlock[R] = currentBlock[R]; currentBlock[R] = newBlock; newBlock[L] = currentBlock; this.bubble('redraw').cursor.insAtRightEnd(newBlock); e.preventDefault(); return false; } else if (key === 'Tab' && !currentBlock[R]) { if (currentBlock.isEmpty()) { if (currentBlock[L]) { this.cursor.insRightOf(this); delete currentBlock[L][R]; this.ends[R] = currentBlock[L]; currentBlock.jQ.remove(); this.bubble('redraw'); e.preventDefault(); return false; } else return; } var newBlock = MathBlock(); newBlock.parent = this; newBlock.jQ = $('').attr(mqBlockId, newBlock.id).appendTo(this.jQ); this.ends[R] = newBlock; currentBlock[R] = newBlock; newBlock[L] = currentBlock; this.bubble('redraw').cursor.insAtRightEnd(newBlock); e.preventDefault(); return false; } else if (e.which === 8) { //backspace if (currentBlock.isEmpty()) { if (currentBlock[L]) { this.cursor.insAtRightEnd(currentBlock[L]) currentBlock[L][R] = currentBlock[R]; } else { this.cursor.insLeftOf(this); this.ends[L] = currentBlock[R]; } if (currentBlock[R]) currentBlock[R][L] = currentBlock[L]; else this.ends[R] = currentBlock[L]; currentBlock.jQ.remove(); if (this.isEmpty()) this.cursor.deleteForward(); else this.bubble('redraw'); e.preventDefault(); return false; } else if (!this.cursor[L]) { e.preventDefault(); return false; } } } }; }); LatexCmds.editable = P(RootMathCommand, function(_, _super) { _.init = function() { MathCommand.prototype.init.call(this, '\\editable'); }; _.jQadd = function() { var self = this; // FIXME: this entire method is a giant hack to get around // having to call createBlocks, and createRoot expecting to // render the contents' LaTeX. Both need to be refactored. _super.jQadd.apply(self, arguments); var block = self.ends[L].disown(); var blockjQ = self.jQ.children().detach(); self.ends[L] = self.ends[R] = RootMathBlock(); self.blocks = [ self.ends[L] ]; self.ends[L].parent = self; createRoot(self.jQ, self.ends[L], false, true); self.cursor = self.ends[L].cursor; block.children().adopt(self.ends[L], 0, 0); blockjQ.appendTo(self.ends[L].jQ); self.ends[L].cursor.insAtRightEnd(self.ends[L]); }; _.latex = function(){ return this.ends[L].latex(); }; _.text = function(){ return this.ends[L].text(); }; }); /********************************** * Symbols and Special Characters *********************************/ LatexCmds.f = bind(Symbol, 'f', 'ƒ '); var Variable = P(Symbol, function(_, _super) { _.init = function(ch, html) { _super.init.call(this, ch, ''+(html || ch)+''); }; _.text = function() { var text = this.ctrlSeq; if (this[L] && !(this[L] instanceof Variable) && !(this[L] instanceof BinaryOperator)) text = '*' + text; if (this[R] && !(this[R] instanceof BinaryOperator) && !(this[R].ctrlSeq === '^')) text += '*'; return text; }; }); var VanillaSymbol = P(Symbol, function(_, _super) { _.init = function(ch, html) { _super.init.call(this, ch, ''+(html || ch)+''); }; }); CharCmds[' '] = bind(VanillaSymbol, '\\:', ' '); LatexCmds.prime = CharCmds["'"] = bind(VanillaSymbol, "'", '′'); // does not use Symbola font var NonSymbolaSymbol = P(Symbol, function(_, _super) { _.init = function(ch, html) { _super.init.call(this, ch, ''+(html || ch)+''); }; }); LatexCmds['@'] = NonSymbolaSymbol; LatexCmds['&'] = bind(NonSymbolaSymbol, '\\&', '&'); LatexCmds['%'] = bind(NonSymbolaSymbol, '\\%', '%'); //the following are all Greek to me, but this helped a lot: http://www.ams.org/STIX/ion/stixsig03.html //lowercase Greek letter variables LatexCmds.alpha = LatexCmds.beta = LatexCmds.gamma = LatexCmds.delta = LatexCmds.zeta = LatexCmds.eta = LatexCmds.theta = LatexCmds.iota = LatexCmds.kappa = LatexCmds.mu = LatexCmds.nu = LatexCmds.xi = LatexCmds.rho = LatexCmds.sigma = LatexCmds.tau = LatexCmds.chi = LatexCmds.psi = LatexCmds.omega = P(Variable, function(_, _super) { _.init = function(latex) { _super.init.call(this,'\\'+latex+' ','&'+latex+';'); }; }); //why can't anybody FUCKING agree on these LatexCmds.phi = //W3C or Unicode? bind(Variable,'\\phi ','ϕ'); LatexCmds.phiv = //Elsevier and 9573-13 LatexCmds.varphi = //AMS and LaTeX bind(Variable,'\\varphi ','φ'); LatexCmds.epsilon = //W3C or Unicode? bind(Variable,'\\epsilon ','ϵ'); LatexCmds.epsiv = //Elsevier and 9573-13 LatexCmds.varepsilon = //AMS and LaTeX bind(Variable,'\\varepsilon ','ε'); LatexCmds.piv = //W3C/Unicode and Elsevier and 9573-13 LatexCmds.varpi = //AMS and LaTeX bind(Variable,'\\varpi ','ϖ'); LatexCmds.sigmaf = //W3C/Unicode LatexCmds.sigmav = //Elsevier LatexCmds.varsigma = //LaTeX bind(Variable,'\\varsigma ','ς'); LatexCmds.thetav = //Elsevier and 9573-13 LatexCmds.vartheta = //AMS and LaTeX LatexCmds.thetasym = //W3C/Unicode bind(Variable,'\\vartheta ','ϑ'); LatexCmds.upsilon = //AMS and LaTeX and W3C/Unicode LatexCmds.upsi = //Elsevier and 9573-13 bind(Variable,'\\upsilon ','υ'); //these aren't even mentioned in the HTML character entity references LatexCmds.gammad = //Elsevier LatexCmds.Gammad = //9573-13 -- WTF, right? I dunno if this was a typo in the reference (see above) LatexCmds.digamma = //LaTeX bind(Variable,'\\digamma ','ϝ'); LatexCmds.kappav = //Elsevier LatexCmds.varkappa = //AMS and LaTeX bind(Variable,'\\varkappa ','ϰ'); LatexCmds.rhov = //Elsevier and 9573-13 LatexCmds.varrho = //AMS and LaTeX bind(Variable,'\\varrho ','ϱ'); //Greek constants, look best in un-italicised Times New Roman LatexCmds.pi = LatexCmds['π'] = bind(NonSymbolaSymbol,'\\pi ','π'); LatexCmds.lambda = bind(NonSymbolaSymbol,'\\lambda ','λ'); //uppercase greek letters LatexCmds.Upsilon = //LaTeX LatexCmds.Upsi = //Elsevier and 9573-13 LatexCmds.upsih = //W3C/Unicode "upsilon with hook" LatexCmds.Upsih = //'cos it makes sense to me bind(Symbol,'\\Upsilon ','ϒ'); //Symbola's 'upsilon with a hook' is a capital Y without hooks :( //other symbols with the same LaTeX command and HTML character entity reference LatexCmds.Gamma = LatexCmds.Delta = LatexCmds.Theta = LatexCmds.Lambda = LatexCmds.Xi = LatexCmds.Pi = LatexCmds.Sigma = LatexCmds.Phi = LatexCmds.Psi = LatexCmds.Omega = LatexCmds.forall = P(VanillaSymbol, function(_, _super) { _.init = function(latex) { _super.init.call(this,'\\'+latex+' ','&'+latex+';'); }; }); // symbols that aren't a single MathCommand, but are instead a whole // Fragment. Creates the Fragment from a LaTeX string var LatexFragment = P(MathCommand, function(_) { _.init = function(latex) { this.latex = latex; }; _.createLeftOf = function(cursor) { cursor.writeLatex(this.latex); }; _.parser = function() { var frag = latexMathParser.parse(this.latex).children(); return Parser.succeed(frag); }; }); // for what seems to me like [stupid reasons][1], Unicode provides // subscripted and superscripted versions of all ten Arabic numerals, // as well as [so-called "vulgar fractions"][2]. // Nobody really cares about most of them, but some of them actually // predate Unicode, dating back to [ISO-8859-1][3], apparently also // known as "Latin-1", which among other things [Windows-1252][4] // largely coincides with, so Microsoft Word sometimes inserts them // and they get copy-pasted into MathQuill. // // (Irrelevant but funny story: Windows-1252 is actually a strict // superset of the "closely related but distinct"[3] "ISO 8859-1" -- // see the lack of a dash after "ISO"? Completely different character // set, like elephants vs elephant seals, or "Zombies" vs "Zombie // Redneck Torture Family". What kind of idiot would get them confused. // People in fact got them confused so much, it was so common to // mislabel Windows-1252 text as ISO-8859-1, that most modern web // browsers and email clients treat the MIME charset of ISO-8859-1 // as actually Windows-1252, behavior now standard in the HTML5 spec.) // // [1]: http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts // [2]: http://en.wikipedia.org/wiki/Number_Forms // [3]: http://en.wikipedia.org/wiki/ISO/IEC_8859-1 // [4]: http://en.wikipedia.org/wiki/Windows-1252 LatexCmds['¹'] = bind(LatexFragment, '^1'); LatexCmds['²'] = bind(LatexFragment, '^2'); LatexCmds['³'] = bind(LatexFragment, '^3'); LatexCmds['¼'] = bind(LatexFragment, '\\frac14'); LatexCmds['½'] = bind(LatexFragment, '\\frac12'); LatexCmds['¾'] = bind(LatexFragment, '\\frac34'); var BinaryOperator = P(Symbol, function(_, _super) { _.init = function(ctrlSeq, html, text) { _super.init.call(this, ctrlSeq, ''+html+'', text ); }; }); var PlusMinus = P(BinaryOperator, function(_) { _.init = VanillaSymbol.prototype.init; _.respace = function() { if (!this[L]) { this.jQ[0].className = ''; } else if ( this[L] instanceof BinaryOperator && this[R] && !(this[R] instanceof BinaryOperator) ) { this.jQ[0].className = 'unary-operator'; } else { this.jQ[0].className = 'binary-operator'; } return this; }; }); LatexCmds['+'] = bind(PlusMinus, '+', '+'); //yes, these are different dashes, I think one is an en dash and the other is a hyphen LatexCmds['–'] = LatexCmds['-'] = bind(PlusMinus, '-', '−'); LatexCmds['±'] = LatexCmds.pm = LatexCmds.plusmn = LatexCmds.plusminus = bind(PlusMinus,'\\pm ','±'); LatexCmds.mp = LatexCmds.mnplus = LatexCmds.minusplus = bind(PlusMinus,'\\mp ','∓'); CharCmds['*'] = LatexCmds.sdot = LatexCmds.cdot = bind(BinaryOperator, '\\cdot ', '·'); //semantically should be ⋅, but · looks better LatexCmds['='] = bind(BinaryOperator, '=', '='); LatexCmds['<'] = bind(BinaryOperator, '<', '<'); LatexCmds['>'] = bind(BinaryOperator, '>', '>'); LatexCmds.notin = LatexCmds.sim = LatexCmds.cong = LatexCmds.equiv = LatexCmds.oplus = LatexCmds.otimes = P(BinaryOperator, function(_, _super) { _.init = function(latex) { _super.init.call(this, '\\'+latex+' ', '&'+latex+';'); }; }); LatexCmds.times = bind(BinaryOperator, '\\times ', '×', '[x]'); LatexCmds['÷'] = LatexCmds.div = LatexCmds.divide = LatexCmds.divides = bind(BinaryOperator,'\\div ','÷', '[/]'); LatexCmds['≠'] = LatexCmds.ne = LatexCmds.neq = bind(BinaryOperator,'\\ne ','≠'); LatexCmds.ast = LatexCmds.star = LatexCmds.loast = LatexCmds.lowast = bind(BinaryOperator,'\\ast ','∗'); //case 'there4 = // a special exception for this one, perhaps? LatexCmds.therefor = LatexCmds.therefore = bind(BinaryOperator,'\\therefore ','∴'); LatexCmds.cuz = // l33t LatexCmds.because = bind(BinaryOperator,'\\because ','∵'); LatexCmds.prop = LatexCmds.propto = bind(BinaryOperator,'\\propto ','∝'); LatexCmds['≈'] = LatexCmds.asymp = LatexCmds.approx = bind(BinaryOperator,'\\approx ','≈'); LatexCmds.lt = bind(BinaryOperator,'<','<'); LatexCmds.gt = bind(BinaryOperator,'>','>'); LatexCmds['≤'] = LatexCmds.le = LatexCmds.leq = bind(BinaryOperator,'\\le ','≤'); LatexCmds['≥'] = LatexCmds.ge = LatexCmds.geq = bind(BinaryOperator,'\\ge ','≥'); LatexCmds.isin = LatexCmds['in'] = bind(BinaryOperator,'\\in ','∈'); LatexCmds.ni = LatexCmds.contains = bind(BinaryOperator,'\\ni ','∋'); LatexCmds.notni = LatexCmds.niton = LatexCmds.notcontains = LatexCmds.doesnotcontain = bind(BinaryOperator,'\\not\\ni ','∌'); LatexCmds.sub = LatexCmds.subset = bind(BinaryOperator,'\\subset ','⊂'); LatexCmds.sup = LatexCmds.supset = LatexCmds.superset = bind(BinaryOperator,'\\supset ','⊃'); LatexCmds.nsub = LatexCmds.notsub = LatexCmds.nsubset = LatexCmds.notsubset = bind(BinaryOperator,'\\not\\subset ','⊄'); LatexCmds.nsup = LatexCmds.notsup = LatexCmds.nsupset = LatexCmds.notsupset = LatexCmds.nsuperset = LatexCmds.notsuperset = bind(BinaryOperator,'\\not\\supset ','⊅'); LatexCmds.sube = LatexCmds.subeq = LatexCmds.subsete = LatexCmds.subseteq = bind(BinaryOperator,'\\subseteq ','⊆'); LatexCmds.supe = LatexCmds.supeq = LatexCmds.supsete = LatexCmds.supseteq = LatexCmds.supersete = LatexCmds.superseteq = bind(BinaryOperator,'\\supseteq ','⊇'); LatexCmds.nsube = LatexCmds.nsubeq = LatexCmds.notsube = LatexCmds.notsubeq = LatexCmds.nsubsete = LatexCmds.nsubseteq = LatexCmds.notsubsete = LatexCmds.notsubseteq = bind(BinaryOperator,'\\not\\subseteq ','⊈'); LatexCmds.nsupe = LatexCmds.nsupeq = LatexCmds.notsupe = LatexCmds.notsupeq = LatexCmds.nsupsete = LatexCmds.nsupseteq = LatexCmds.notsupsete = LatexCmds.notsupseteq = LatexCmds.nsupersete = LatexCmds.nsuperseteq = LatexCmds.notsupersete = LatexCmds.notsuperseteq = bind(BinaryOperator,'\\not\\supseteq ','⊉'); //sum, product, coproduct, integral var BigSymbol = P(Symbol, function(_, _super) { _.init = function(ch, html) { _super.init.call(this, ch, ''+html+''); }; }); LatexCmds['∑'] = LatexCmds.sum = LatexCmds.summation = bind(BigSymbol,'\\sum ','∑'); LatexCmds['∏'] = LatexCmds.prod = LatexCmds.product = bind(BigSymbol,'\\prod ','∏'); LatexCmds.coprod = LatexCmds.coproduct = bind(BigSymbol,'\\coprod ','∐'); LatexCmds['∫'] = LatexCmds['int'] = LatexCmds.integral = bind(BigSymbol,'\\int ','∫'); //the canonical sets of numbers LatexCmds.N = LatexCmds.naturals = LatexCmds.Naturals = bind(VanillaSymbol,'\\mathbb{N}','ℕ'); LatexCmds.P = LatexCmds.primes = LatexCmds.Primes = LatexCmds.projective = LatexCmds.Projective = LatexCmds.probability = LatexCmds.Probability = bind(VanillaSymbol,'\\mathbb{P}','ℙ'); LatexCmds.Z = LatexCmds.integers = LatexCmds.Integers = bind(VanillaSymbol,'\\mathbb{Z}','ℤ'); LatexCmds.Q = LatexCmds.rationals = LatexCmds.Rationals = bind(VanillaSymbol,'\\mathbb{Q}','ℚ'); LatexCmds.R = LatexCmds.reals = LatexCmds.Reals = bind(VanillaSymbol,'\\mathbb{R}','ℝ'); LatexCmds.C = LatexCmds.complex = LatexCmds.Complex = LatexCmds.complexes = LatexCmds.Complexes = LatexCmds.complexplane = LatexCmds.Complexplane = LatexCmds.ComplexPlane = bind(VanillaSymbol,'\\mathbb{C}','ℂ'); LatexCmds.H = LatexCmds.Hamiltonian = LatexCmds.quaternions = LatexCmds.Quaternions = bind(VanillaSymbol,'\\mathbb{H}','ℍ'); //spacing LatexCmds.quad = LatexCmds.emsp = bind(VanillaSymbol,'\\quad ',' '); LatexCmds.qquad = bind(VanillaSymbol,'\\qquad ',' '); /* spacing special characters, gonna have to implement this in LatexCommandInput::onText somehow case ',': return VanillaSymbol('\\, ',' '); case ':': return VanillaSymbol('\\: ',' '); case ';': return VanillaSymbol('\\; ',' '); case '!': return Symbol('\\! ',''); */ //binary operators LatexCmds.diamond = bind(VanillaSymbol, '\\diamond ', '◇'); LatexCmds.bigtriangleup = bind(VanillaSymbol, '\\bigtriangleup ', '△'); LatexCmds.ominus = bind(VanillaSymbol, '\\ominus ', '⊖'); LatexCmds.uplus = bind(VanillaSymbol, '\\uplus ', '⊎'); LatexCmds.bigtriangledown = bind(VanillaSymbol, '\\bigtriangledown ', '▽'); LatexCmds.sqcap = bind(VanillaSymbol, '\\sqcap ', '⊓'); LatexCmds.triangleleft = bind(VanillaSymbol, '\\triangleleft ', '⊲'); LatexCmds.sqcup = bind(VanillaSymbol, '\\sqcup ', '⊔'); LatexCmds.triangleright = bind(VanillaSymbol, '\\triangleright ', '⊳'); LatexCmds.odot = bind(VanillaSymbol, '\\odot ', '⊙'); LatexCmds.bigcirc = bind(VanillaSymbol, '\\bigcirc ', '◯'); LatexCmds.dagger = bind(VanillaSymbol, '\\dagger ', '†'); LatexCmds.ddagger = bind(VanillaSymbol, '\\ddagger ', '‡'); LatexCmds.wr = bind(VanillaSymbol, '\\wr ', '≀'); LatexCmds.amalg = bind(VanillaSymbol, '\\amalg ', '∐'); //relationship symbols LatexCmds.models = bind(VanillaSymbol, '\\models ', '⊨'); LatexCmds.prec = bind(VanillaSymbol, '\\prec ', '≺'); LatexCmds.succ = bind(VanillaSymbol, '\\succ ', '≻'); LatexCmds.preceq = bind(VanillaSymbol, '\\preceq ', '≼'); LatexCmds.succeq = bind(VanillaSymbol, '\\succeq ', '≽'); LatexCmds.simeq = bind(VanillaSymbol, '\\simeq ', '≃'); LatexCmds.mid = bind(VanillaSymbol, '\\mid ', '∣'); LatexCmds.ll = bind(VanillaSymbol, '\\ll ', '≪'); LatexCmds.gg = bind(VanillaSymbol, '\\gg ', '≫'); LatexCmds.parallel = bind(VanillaSymbol, '\\parallel ', '∥'); LatexCmds.bowtie = bind(VanillaSymbol, '\\bowtie ', '⋈'); LatexCmds.sqsubset = bind(VanillaSymbol, '\\sqsubset ', '⊏'); LatexCmds.sqsupset = bind(VanillaSymbol, '\\sqsupset ', '⊐'); LatexCmds.smile = bind(VanillaSymbol, '\\smile ', '⌣'); LatexCmds.sqsubseteq = bind(VanillaSymbol, '\\sqsubseteq ', '⊑'); LatexCmds.sqsupseteq = bind(VanillaSymbol, '\\sqsupseteq ', '⊒'); LatexCmds.doteq = bind(VanillaSymbol, '\\doteq ', '≐'); LatexCmds.frown = bind(VanillaSymbol, '\\frown ', '⌢'); LatexCmds.vdash = bind(VanillaSymbol, '\\vdash ', '⊦'); LatexCmds.dashv = bind(VanillaSymbol, '\\dashv ', '⊣'); //arrows LatexCmds.longleftarrow = bind(VanillaSymbol, '\\longleftarrow ', '←'); LatexCmds.longrightarrow = bind(VanillaSymbol, '\\longrightarrow ', '→'); LatexCmds.Longleftarrow = bind(VanillaSymbol, '\\Longleftarrow ', '⇐'); LatexCmds.Longrightarrow = bind(VanillaSymbol, '\\Longrightarrow ', '⇒'); LatexCmds.longleftrightarrow = bind(VanillaSymbol, '\\longleftrightarrow ', '↔'); LatexCmds.updownarrow = bind(VanillaSymbol, '\\updownarrow ', '↕'); LatexCmds.Longleftrightarrow = bind(VanillaSymbol, '\\Longleftrightarrow ', '⇔'); LatexCmds.Updownarrow = bind(VanillaSymbol, '\\Updownarrow ', '⇕'); LatexCmds.mapsto = bind(VanillaSymbol, '\\mapsto ', '↦'); LatexCmds.nearrow = bind(VanillaSymbol, '\\nearrow ', '↗'); LatexCmds.hookleftarrow = bind(VanillaSymbol, '\\hookleftarrow ', '↩'); LatexCmds.hookrightarrow = bind(VanillaSymbol, '\\hookrightarrow ', '↪'); LatexCmds.searrow = bind(VanillaSymbol, '\\searrow ', '↘'); LatexCmds.leftharpoonup = bind(VanillaSymbol, '\\leftharpoonup ', '↼'); LatexCmds.rightharpoonup = bind(VanillaSymbol, '\\rightharpoonup ', '⇀'); LatexCmds.swarrow = bind(VanillaSymbol, '\\swarrow ', '↙'); LatexCmds.leftharpoondown = bind(VanillaSymbol, '\\leftharpoondown ', '↽'); LatexCmds.rightharpoondown = bind(VanillaSymbol, '\\rightharpoondown ', '⇁'); LatexCmds.nwarrow = bind(VanillaSymbol, '\\nwarrow ', '↖'); //Misc LatexCmds.ldots = bind(VanillaSymbol, '\\ldots ', '…'); LatexCmds.cdots = bind(VanillaSymbol, '\\cdots ', '⋯'); LatexCmds.vdots = bind(VanillaSymbol, '\\vdots ', '⋮'); LatexCmds.ddots = bind(VanillaSymbol, '\\ddots ', '⋰'); LatexCmds.surd = bind(VanillaSymbol, '\\surd ', '√'); LatexCmds.triangle = bind(VanillaSymbol, '\\triangle ', '▵'); LatexCmds.ell = bind(VanillaSymbol, '\\ell ', 'ℓ'); LatexCmds.top = bind(VanillaSymbol, '\\top ', '⊤'); LatexCmds.flat = bind(VanillaSymbol, '\\flat ', '♭'); LatexCmds.natural = bind(VanillaSymbol, '\\natural ', '♮'); LatexCmds.sharp = bind(VanillaSymbol, '\\sharp ', '♯'); LatexCmds.wp = bind(VanillaSymbol, '\\wp ', '℘'); LatexCmds.bot = bind(VanillaSymbol, '\\bot ', '⊥'); LatexCmds.clubsuit = bind(VanillaSymbol, '\\clubsuit ', '♣'); LatexCmds.diamondsuit = bind(VanillaSymbol, '\\diamondsuit ', '♢'); LatexCmds.heartsuit = bind(VanillaSymbol, '\\heartsuit ', '♡'); LatexCmds.spadesuit = bind(VanillaSymbol, '\\spadesuit ', '♠'); //variable-sized LatexCmds.oint = bind(VanillaSymbol, '\\oint ', '∮'); LatexCmds.bigcap = bind(VanillaSymbol, '\\bigcap ', '∩'); LatexCmds.bigcup = bind(VanillaSymbol, '\\bigcup ', '∪'); LatexCmds.bigsqcup = bind(VanillaSymbol, '\\bigsqcup ', '⊔'); LatexCmds.bigvee = bind(VanillaSymbol, '\\bigvee ', '∨'); LatexCmds.bigwedge = bind(VanillaSymbol, '\\bigwedge ', '∧'); LatexCmds.bigodot = bind(VanillaSymbol, '\\bigodot ', '⊙'); LatexCmds.bigotimes = bind(VanillaSymbol, '\\bigotimes ', '⊗'); LatexCmds.bigoplus = bind(VanillaSymbol, '\\bigoplus ', '⊕'); LatexCmds.biguplus = bind(VanillaSymbol, '\\biguplus ', '⊎'); //delimiters LatexCmds.lfloor = bind(VanillaSymbol, '\\lfloor ', '⌊'); LatexCmds.rfloor = bind(VanillaSymbol, '\\rfloor ', '⌋'); LatexCmds.lceil = bind(VanillaSymbol, '\\lceil ', '⌈'); LatexCmds.rceil = bind(VanillaSymbol, '\\rceil ', '⌉'); LatexCmds.slash = bind(VanillaSymbol, '\\slash ', '/'); LatexCmds.opencurlybrace = bind(VanillaSymbol, '\\opencurlybrace ', '{'); LatexCmds.closecurlybrace = bind(VanillaSymbol, '\\closecurlybrace ', '}'); //various symbols LatexCmds.caret = bind(VanillaSymbol,'\\caret ','^'); LatexCmds.underscore = bind(VanillaSymbol,'\\underscore ','_'); LatexCmds.backslash = bind(VanillaSymbol,'\\backslash ','\\'); LatexCmds.vert = bind(VanillaSymbol,'|'); LatexCmds.perp = LatexCmds.perpendicular = bind(VanillaSymbol,'\\perp ','⊥'); LatexCmds.nabla = LatexCmds.del = bind(VanillaSymbol,'\\nabla ','∇'); LatexCmds.hbar = bind(VanillaSymbol,'\\hbar ','ℏ'); LatexCmds.AA = LatexCmds.Angstrom = LatexCmds.angstrom = bind(VanillaSymbol,'\\text\\AA ','Å'); LatexCmds.ring = LatexCmds.circ = LatexCmds.circle = bind(VanillaSymbol,'\\circ ','∘'); LatexCmds.bull = LatexCmds.bullet = bind(VanillaSymbol,'\\bullet ','•'); LatexCmds.setminus = LatexCmds.smallsetminus = bind(VanillaSymbol,'\\setminus ','∖'); LatexCmds.not = //bind(Symbol,'\\not ','/'); LatexCmds['¬'] = LatexCmds.neg = bind(VanillaSymbol,'\\neg ','¬'); LatexCmds['…'] = LatexCmds.dots = LatexCmds.ellip = LatexCmds.hellip = LatexCmds.ellipsis = LatexCmds.hellipsis = bind(VanillaSymbol,'\\dots ','…'); LatexCmds.converges = LatexCmds.darr = LatexCmds.dnarr = LatexCmds.dnarrow = LatexCmds.downarrow = bind(VanillaSymbol,'\\downarrow ','↓'); LatexCmds.dArr = LatexCmds.dnArr = LatexCmds.dnArrow = LatexCmds.Downarrow = bind(VanillaSymbol,'\\Downarrow ','⇓'); LatexCmds.diverges = LatexCmds.uarr = LatexCmds.uparrow = bind(VanillaSymbol,'\\uparrow ','↑'); LatexCmds.uArr = LatexCmds.Uparrow = bind(VanillaSymbol,'\\Uparrow ','⇑'); LatexCmds.to = bind(BinaryOperator,'\\to ','→'); LatexCmds.rarr = LatexCmds.rightarrow = bind(VanillaSymbol,'\\rightarrow ','→'); LatexCmds.implies = bind(BinaryOperator,'\\Rightarrow ','⇒'); LatexCmds.rArr = LatexCmds.Rightarrow = bind(VanillaSymbol,'\\Rightarrow ','⇒'); LatexCmds.gets = bind(BinaryOperator,'\\gets ','←'); LatexCmds.larr = LatexCmds.leftarrow = bind(VanillaSymbol,'\\leftarrow ','←'); LatexCmds.impliedby = bind(BinaryOperator,'\\Leftarrow ','⇐'); LatexCmds.lArr = LatexCmds.Leftarrow = bind(VanillaSymbol,'\\Leftarrow ','⇐'); LatexCmds.harr = LatexCmds.lrarr = LatexCmds.leftrightarrow = bind(VanillaSymbol,'\\leftrightarrow ','↔'); LatexCmds.iff = bind(BinaryOperator,'\\Leftrightarrow ','⇔'); LatexCmds.hArr = LatexCmds.lrArr = LatexCmds.Leftrightarrow = bind(VanillaSymbol,'\\Leftrightarrow ','⇔'); LatexCmds.Re = LatexCmds.Real = LatexCmds.real = bind(VanillaSymbol,'\\Re ','ℜ'); LatexCmds.Im = LatexCmds.imag = LatexCmds.image = LatexCmds.imagin = LatexCmds.imaginary = LatexCmds.Imaginary = bind(VanillaSymbol,'\\Im ','ℑ'); LatexCmds.part = LatexCmds.partial = bind(VanillaSymbol,'\\partial ','∂'); LatexCmds.inf = LatexCmds.infin = LatexCmds.infty = LatexCmds.infinity = bind(VanillaSymbol,'\\infty ','∞'); LatexCmds.alef = LatexCmds.alefsym = LatexCmds.aleph = LatexCmds.alephsym = bind(VanillaSymbol,'\\aleph ','ℵ'); LatexCmds.xist = //LOL LatexCmds.xists = LatexCmds.exist = LatexCmds.exists = bind(VanillaSymbol,'\\exists ','∃'); LatexCmds.and = LatexCmds.land = LatexCmds.wedge = bind(VanillaSymbol,'\\wedge ','∧'); LatexCmds.or = LatexCmds.lor = LatexCmds.vee = bind(VanillaSymbol,'\\vee ','∨'); LatexCmds.o = LatexCmds.O = LatexCmds.empty = LatexCmds.emptyset = LatexCmds.oslash = LatexCmds.Oslash = LatexCmds.nothing = LatexCmds.varnothing = bind(BinaryOperator,'\\varnothing ','∅'); LatexCmds.cup = LatexCmds.union = bind(BinaryOperator,'\\cup ','∪'); LatexCmds.cap = LatexCmds.intersect = LatexCmds.intersection = bind(BinaryOperator,'\\cap ','∩'); LatexCmds.deg = LatexCmds.degree = bind(VanillaSymbol,'^\\circ ','°'); LatexCmds.ang = LatexCmds.angle = bind(VanillaSymbol,'\\angle ','∠'); var NonItalicizedFunction = P(Symbol, function(_, _super) { _.init = function(fn) { _super.init.call(this, '\\'+fn+' ', ''+fn+''); }; _.respace = function() { this.jQ[0].className = (this[R] instanceof SupSub || this[R] instanceof Bracket) ? '' : 'non-italicized-function'; }; }); LatexCmds.ln = LatexCmds.lg = LatexCmds.log = LatexCmds.span = LatexCmds.proj = LatexCmds.det = LatexCmds.dim = LatexCmds.min = LatexCmds.max = LatexCmds.mod = LatexCmds.lcm = LatexCmds.gcd = LatexCmds.gcf = LatexCmds.hcf = LatexCmds.lim = NonItalicizedFunction; (function() { var trig = ['sin', 'cos', 'tan', 'sec', 'cosec', 'csc', 'cotan', 'cot']; for (var i in trig) { LatexCmds[trig[i]] = LatexCmds[trig[i]+'h'] = LatexCmds['a'+trig[i]] = LatexCmds['arc'+trig[i]] = LatexCmds['a'+trig[i]+'h'] = LatexCmds['arc'+trig[i]+'h'] = NonItalicizedFunction; } }()); // Parser MathCommand var latexMathParser = (function() { function commandToBlock(cmd) { var block = MathBlock(); cmd.adopt(block, 0, 0); return block; } function joinBlocks(blocks) { var firstBlock = blocks[0] || MathBlock(); for (var i = 1; i < blocks.length; i += 1) { blocks[i].children().adopt(firstBlock, firstBlock.ends[R], 0); } return firstBlock; } var string = Parser.string; var regex = Parser.regex; var letter = Parser.letter; var any = Parser.any; var optWhitespace = Parser.optWhitespace; var succeed = Parser.succeed; var fail = Parser.fail; // Parsers yielding MathCommands var variable = letter.map(Variable); var symbol = regex(/^[^${}\\_^]/).map(VanillaSymbol); var controlSequence = regex(/^[^\\a-eg-zA-Z]/) // hotfix #164; match MathBlock::write .or(string('\\').then( regex(/^[a-z]+/i) .or(regex(/^\s+/).result(' ')) .or(any) )).then(function(ctrlSeq) { var cmdKlass = LatexCmds[ctrlSeq]; if (cmdKlass) { return cmdKlass(ctrlSeq).parser(); } else { return fail('unknown command: \\'+ctrlSeq); } }) ; var command = controlSequence .or(variable) .or(symbol) ; // Parsers yielding MathBlocks var mathGroup = string('{').then(function() { return mathSequence; }).skip(string('}')); var mathBlock = optWhitespace.then(mathGroup.or(command.map(commandToBlock))); var mathSequence = mathBlock.many().map(joinBlocks).skip(optWhitespace); var optMathBlock = string('[').then( mathBlock.then(function(block) { return block.join('latex') !== ']' ? succeed(block) : fail(); }) .many().map(joinBlocks).skip(optWhitespace) ).skip(string(']')) ; var latexMath = mathSequence; latexMath.block = mathBlock; latexMath.optBlock = optMathBlock; return latexMath; })(); /******************************************** * Cursor and Selection "singleton" classes *******************************************/ /* The main thing that manipulates the Math DOM. Makes sure to manipulate the HTML DOM to match. */ /* Sort of singletons, since there should only be one per editable math textbox, but any one HTML document can contain many such textboxes, so any one JS environment could actually contain many instances. */ //A fake cursor in the fake textbox that the math is rendered in. var Cursor = P(Point, function(_) { _.init = function(root) { this.parent = this.root = root; var jQ = this.jQ = this._jQ = $(''); //closured for setInterval this.blink = function(){ jQ.toggleClass('blink'); }; this.upDownCache = {}; }; _.show = function() { this.jQ = this._jQ.removeClass('blink'); if ('intervalId' in this) //already was shown, just restart interval clearInterval(this.intervalId); else { //was hidden and detached, insert this.jQ back into HTML DOM if (this[R]) { if (this.selection && this.selection.ends[L][L] === this[L]) this.jQ.insertBefore(this.selection.jQ); else this.jQ.insertBefore(this[R].jQ.first()); } else this.jQ.appendTo(this.parent.jQ); this.parent.focus(); } this.intervalId = setInterval(this.blink, 500); return this; }; _.hide = function() { if ('intervalId' in this) clearInterval(this.intervalId); delete this.intervalId; this.jQ.detach(); this.jQ = $(); return this; }; _.withDirInsertAt = function(dir, parent, withDir, oppDir) { var oldParent = this.parent; this.parent = parent; this[dir] = withDir; this[-dir] = oppDir; oldParent.blur(); }; _.insDirOf = function(dir, el) { prayDirection(dir); this.withDirInsertAt(dir, el.parent, el[dir], el); this.parent.jQ.addClass('hasCursor'); this.jQ.insDirOf(dir, el.jQ); return this; }; _.insLeftOf = function(el) { return this.insDirOf(L, el); }; _.insRightOf = function(el) { return this.insDirOf(R, el); }; _.insAtDirEnd = function(dir, el) { prayDirection(dir); this.withDirInsertAt(dir, el, 0, el.ends[dir]); // never insert before textarea if (dir === L && el.textarea) { this.jQ.insDirOf(-dir, el.textarea); } else { this.jQ.insAtDirEnd(dir, el.jQ); } el.focus(); return this; }; _.insAtLeftEnd = function(el) { return this.insAtDirEnd(L, el); }; _.insAtRightEnd = function(el) { return this.insAtDirEnd(R, el); }; _.hopDir = function(dir) { prayDirection(dir); this.jQ.insDirOf(dir, this[dir].jQ); this[-dir] = this[dir]; this[dir] = this[dir][dir]; return this; }; _.hopLeft = function() { return this.hopDir(L); }; _.hopRight = function() { return this.hopDir(R); }; _.moveDirWithin = function(dir, block) { prayDirection(dir); if (this[dir]) { if (this[dir].ends[-dir]) this.insAtDirEnd(-dir, this[dir].ends[-dir]); else this.hopDir(dir); } else { // we're at the beginning/end of the containing block, so do nothing if (this.parent === block) return; if (this.parent[dir]) this.insAtDirEnd(-dir, this.parent[dir]); else this.insDirOf(dir, this.parent.parent); } }; _.moveLeftWithin = function(block) { return this.moveDirWithin(L, block); }; _.moveRightWithin = function(block) { return this.moveDirWithin(R, block); }; _.moveDir = function(dir) { prayDirection(dir); clearUpDownCache(this); if (this.selection) { this.insDirOf(dir, this.selection.ends[dir]).clearSelection(); } else { this.moveDirWithin(dir, this.root); } return this.show(); }; _.moveLeft = function() { return this.moveDir(L); }; _.moveRight = function() { return this.moveDir(R); }; /** * moveUp and moveDown have almost identical algorithms: * - first check left and right, if so insAtLeft/RightEnd of them * - else check the parent's 'up'/'down' property - if it's a function, * call it with the cursor as the sole argument and use the return value. * * Given undefined, will bubble up to the next ancestor block. * Given false, will stop bubbling. * Given a MathBlock, * + moveUp will insAtRightEnd of it * + moveDown will insAtLeftEnd of it * */ _.moveUp = function() { return moveUpDown(this, 'up'); }; _.moveDown = function() { return moveUpDown(this, 'down'); }; function moveUpDown(self, dir) { if (self[R][dir]) self.insAtLeftEnd(self[R][dir]); else if (self[L][dir]) self.insAtRightEnd(self[L][dir]); else { var ancestorBlock = self.parent; do { var prop = ancestorBlock[dir]; if (prop) { if (typeof prop === 'function') prop = ancestorBlock[dir](self); if (prop === false || prop instanceof MathBlock) { self.upDownCache[ancestorBlock.id] = Point(self.parent, self[L], self[R]); if (prop instanceof MathBlock) { var cached = self.upDownCache[prop.id]; if (cached) { if (cached[R]) { self.insLeftOf(cached[R]); } else { self.insAtRightEnd(cached.parent); } } else { var pageX = offset(self).left; self.insAtRightEnd(prop); self.seekHoriz(pageX, prop); } } break; } } ancestorBlock = ancestorBlock.parent.parent; } while (ancestorBlock); } return self.clearSelection().show(); } _.seek = function(target, pageX, pageY) { clearUpDownCache(this); var cmd, block, cursor = this.clearSelection().show(); if (target.hasClass('empty')) { cursor.insAtLeftEnd(MathElement[target.attr(mqBlockId)]); return cursor; } cmd = MathElement[target.attr(mqCmdId)]; if (cmd instanceof Symbol) { //insert at whichever side is closer if (target.outerWidth() > 2*(pageX - target.offset().left)) cursor.insLeftOf(cmd); else cursor.insRightOf(cmd); return cursor; } if (!cmd) { block = MathElement[target.attr(mqBlockId)]; if (!block) { //if no MathQuill data, try parent, if still no, just start from the root target = target.parent(); cmd = MathElement[target.attr(mqCmdId)]; if (!cmd) { block = MathElement[target.attr(mqBlockId)]; if (!block) block = cursor.root; } } } if (cmd) cursor.insRightOf(cmd); else cursor.insAtRightEnd(block); return cursor.seekHoriz(pageX, cursor.root); }; _.seekHoriz = function(pageX, block) { //move cursor to position closest to click var cursor = this; var dist = offset(cursor).left - pageX; var leftDist; do { cursor.moveLeftWithin(block); leftDist = dist; dist = offset(cursor).left - pageX; } while (dist > 0 && (cursor[L] || cursor.parent !== block)); if (-dist > leftDist) cursor.moveRightWithin(block); return cursor; }; function offset(self) { //in Opera 11.62, .getBoundingClientRect() and hence jQuery::offset() //returns all 0's on inline elements with negative margin-right (like //the cursor) at the end of their parent, so temporarily remove the //negative margin-right when calling jQuery::offset() //Opera bug DSK-360043 //http://bugs.jquery.com/ticket/11523 //https://github.com/jquery/jquery/pull/717 var offset = self.jQ.removeClass('cursor').offset(); self.jQ.addClass('cursor'); return offset; } _.writeLatex = function(latex) { var self = this; clearUpDownCache(self); self.show().deleteSelection(); var all = Parser.all; var eof = Parser.eof; var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); if (block) { block.children().adopt(self.parent, self[L], self[R]); MathElement.jQize(block.join('html')).insertBefore(self.jQ); self[L] = block.ends[R]; block.finalizeInsert(); self.parent.bubble('redraw'); } return this.hide(); }; _.write = function(ch) { var seln = this.prepareWrite(); return this.insertCh(ch, seln); }; _.insertCh = function(ch, replacedFragment) { this.parent.write(this, ch, replacedFragment); return this; }; _.insertCmd = function(latexCmd, replacedFragment) { var cmd = LatexCmds[latexCmd]; if (cmd) { cmd = cmd(latexCmd); if (replacedFragment) cmd.replaces(replacedFragment); cmd.createLeftOf(this); } else { cmd = TextBlock(); cmd.replaces(latexCmd); cmd.ends[L].focus = function(){ delete this.focus; return this; }; cmd.createLeftOf(this); this.insRightOf(cmd); if (replacedFragment) replacedFragment.remove(); } return this; }; _.unwrapGramp = function() { var gramp = this.parent.parent; var greatgramp = gramp.parent; var rightward = gramp[R]; var cursor = this; var leftward = gramp[L]; gramp.disown().eachChild(function(uncle) { if (uncle.isEmpty()) return; uncle.children() .adopt(greatgramp, leftward, rightward) .each(function(cousin) { cousin.jQ.insertBefore(gramp.jQ.first()); }) ; leftward = uncle.ends[R]; }); if (!this[R]) { //then find something to be rightward to insLeftOf if (this[L]) this[R] = this[L][R]; else { while (!this[R]) { this.parent = this.parent[R]; if (this.parent) this[R] = this.parent.ends[L]; else { this[R] = gramp[R]; this.parent = greatgramp; break; } } } } if (this[R]) this.insLeftOf(this[R]); else this.insAtRightEnd(greatgramp); gramp.jQ.remove(); if (gramp[L]) gramp[L].respace(); if (gramp[R]) gramp[R].respace(); }; _.deleteDir = function(dir) { prayDirection(dir); clearUpDownCache(this); this.show(); if (this.deleteSelection()); // pass else if (this[dir]) { if (this[dir].isEmpty()) this[dir] = this[dir].remove()[dir]; else this.selectDir(dir); } else if (this.parent !== this.root) { if (this.parent.parent.isEmpty()) return this.insDirOf(-dir, this.parent.parent).deleteDir(dir); else this.unwrapGramp(); } if (this[L]) this[L].respace(); if (this[R]) this[R].respace(); this.parent.bubble('redraw'); return this; }; _.backspace = function() { return this.deleteDir(L); }; _.deleteForward = function() { return this.deleteDir(R); }; _.selectFrom = function(anticursor) { //find ancestors of each with common parent var oneA = this, otherA = anticursor; //one ancestor, the other ancestor loopThroughAncestors: while (true) { for (var oneI = this; oneI !== oneA.parent.parent; oneI = oneI.parent.parent) //one intermediate, the other intermediate if (oneI.parent === otherA.parent) { left = oneI; right = otherA; break loopThroughAncestors; } for (var otherI = anticursor; otherI !== otherA.parent.parent; otherI = otherI.parent.parent) if (oneA.parent === otherI.parent) { left = oneA; right = otherI; break loopThroughAncestors; } if (oneA.parent.parent) oneA = oneA.parent.parent; if (otherA.parent.parent) otherA = otherA.parent.parent; } //figure out which is leftward and which is rightward var left, right, leftRight; if (left[R] !== right) { for (var rightward = left; rightward; rightward = rightward[R]) { if (rightward === right[L]) { leftRight = true; break; } } if (!leftRight) { leftRight = right; right = left; left = leftRight; } } this.hide().selection = Selection(left[L][R] || left.parent.ends[L], right[R][L] || right.parent.ends[R]); this.insRightOf(right[R][L] || right.parent.ends[R]); this.root.selectionChanged(); }; _.selectDir = function(dir) { prayDirection(dir); clearUpDownCache(this); if (this.selection) { // if cursor is at the (dir) edge of selection if (this.selection.ends[dir] === this[-dir]) { // then extend (dir) if possible if (this[dir]) this.hopDir(dir).selection.extendDir(dir); // else level up if possible else if (this.parent !== this.root) { this.insDirOf(dir, this.parent.parent).selection.levelUp(); } } // else cursor is at the (-dir) edge of selection, retract if possible else { this.hopDir(dir); // clear the selection if we only have one thing selected if (this.selection.ends[dir] === this.selection.ends[-dir]) { this.clearSelection().show(); return; } this.selection.retractDir(dir); } } // no selection, create one else { if (this[dir]) this.hopDir(dir); // else edge of a block else { if (this.parent === this.root) return; this.insDirOf(dir, this.parent.parent); } this.hide().selection = Selection(this[-dir]); } this.root.selectionChanged(); }; _.selectLeft = function() { return this.selectDir(L); }; _.selectRight = function() { return this.selectDir(R); }; function clearUpDownCache(self) { self.upDownCache = {}; } _.prepareMove = function() { clearUpDownCache(this); return this.show().clearSelection(); }; _.prepareEdit = function() { clearUpDownCache(this); return this.show().deleteSelection(); }; _.prepareWrite = function() { clearUpDownCache(this); return this.show().replaceSelection(); }; _.clearSelection = function() { if (this.selection) { this.selection.clear(); delete this.selection; this.root.selectionChanged(); } return this; }; _.deleteSelection = function() { if (!this.selection) return false; this[L] = this.selection.ends[L][L]; this[R] = this.selection.ends[R][R]; this.selection.remove(); this.root.selectionChanged(); return delete this.selection; }; _.replaceSelection = function() { var seln = this.selection; if (seln) { this[L] = seln.ends[L][L]; this[R] = seln.ends[R][R]; delete this.selection; } return seln; }; }); var Selection = P(MathFragment, function(_, _super) { _.init = function() { var frag = this; _super.init.apply(frag, arguments); frag.jQwrap(frag.jQ); }; _.jQwrap = function(children) { this.jQ = children.wrapAll('').parent(); //can't do wrapAll(this.jQ = $(...)) because wrapAll will clone it }; _.adopt = function() { this.jQ.replaceWith(this.jQ = this.jQ.children()); return _super.adopt.apply(this, arguments); }; _.clear = function() { this.jQ.replaceWith(this.jQ.children()); return this; }; _.levelUp = function() { var seln = this, gramp = seln.ends[L] = seln.ends[R] = seln.ends[R].parent.parent; seln.clear().jQwrap(gramp.jQ); return seln; }; _.extendDir = function(dir) { prayDirection(dir); this.ends[dir] = this.ends[dir][dir]; this.ends[dir].jQ.insAtDirEnd(dir, this.jQ); return this; }; _.extendLeft = function() { return this.extendDir(L); }; _.extendRight = function() { return this.extendDir(R); }; _.retractDir = function(dir) { prayDirection(dir); this.ends[-dir].jQ.insDirOf(-dir, this.jQ); this.ends[-dir] = this.ends[-dir][dir]; }; _.retractRight = function() { return this.retractDir(R); }; _.retractLeft = function() { return this.retractDir(L); }; }); /********************************************************* * The actual jQuery plugin and document ready handlers. ********************************************************/ //The publicy exposed method of jQuery.prototype, available (and meant to be //called) on jQuery-wrapped HTML DOM elements. jQuery.fn.mathquill = function(cmd, latex) { switch (cmd) { case 'redraw': return this.each(function() { var blockId = $(this).attr(mqBlockId), rootBlock = blockId && MathElement[blockId]; if (rootBlock) { (function postOrderRedraw(el) { el.eachChild(postOrderRedraw); if (el.redraw) el.redraw(); }(rootBlock)); } }); case 'revert': return this.each(function() { var blockId = $(this).attr(mqBlockId), block = blockId && MathElement[blockId]; if (block && block.revert) block.revert(); }); case 'latex': if (arguments.length > 1) { return this.each(function() { var blockId = $(this).attr(mqBlockId), block = blockId && MathElement[blockId]; if (block) block.renderLatex(latex); }); } var blockId = $(this).attr(mqBlockId), block = blockId && MathElement[blockId]; return block && block.latex(); case 'text': var blockId = $(this).attr(mqBlockId), block = blockId && MathElement[blockId]; return block && block.text(); case 'html': return this.html().replace(/ ?hasCursor|hasCursor /, '') .replace(/ class=(""|(?= |>))/g, '') .replace(/<\/span>/i, '') .replace(/