Showing preview only (2,108K chars total). Download the full file or copy to clipboard to get everything.
Repository: yigger/jiezhang
Branch: master
Commit: 91d3882506cd
Files: 179
Total size: 2.0 MB
Directory structure:
gitextract_a_7sud7x/
├── .editorconfig
├── .eslintrc.js
├── .gitignore
├── .vscode/
│ └── settings.json
├── README.md
├── babel.config.js
├── config/
│ ├── dev.js
│ ├── index.js
│ └── prod.js
├── package.json
├── plugins/
│ └── view-data-plugin.js
├── project.config.json
├── src/
│ ├── api/
│ │ ├── http-result.ts
│ │ ├── index.ts
│ │ ├── logic/
│ │ │ ├── account_book.ts
│ │ │ ├── asset.ts
│ │ │ ├── budget.ts
│ │ │ ├── category.ts
│ │ │ ├── chaos.ts
│ │ │ ├── finance.ts
│ │ │ ├── friend.ts
│ │ │ ├── main.ts
│ │ │ ├── message.ts
│ │ │ ├── payee.ts
│ │ │ ├── statement.ts
│ │ │ ├── statistic.ts
│ │ │ ├── superChart.ts
│ │ │ ├── superStatement.ts
│ │ │ └── user.ts
│ │ ├── request.ts
│ │ └── types.ts
│ ├── app.config.ts
│ ├── app.ts
│ ├── assets/
│ │ ├── echarts.js
│ │ ├── fonts/
│ │ │ ├── iconfont.css
│ │ │ └── index.styl
│ │ └── styl/
│ │ ├── common/
│ │ │ ├── border.styl
│ │ │ ├── calculator.styl
│ │ │ ├── common.styl
│ │ │ ├── flex.styl
│ │ │ ├── header.styl
│ │ │ ├── image.styl
│ │ │ ├── index.styl
│ │ │ ├── input.styl
│ │ │ ├── mask.styl
│ │ │ └── text.styl
│ │ ├── components/
│ │ │ ├── asset_banner.styl
│ │ │ ├── select_component.styl
│ │ │ ├── slide_sidebar.styl
│ │ │ ├── statement.styl
│ │ │ └── statement_form.styl
│ │ ├── index.styl
│ │ ├── pages/
│ │ │ ├── budget/
│ │ │ │ └── index.styl
│ │ │ ├── finance/
│ │ │ │ ├── asset_flow.styl
│ │ │ │ └── index.styl
│ │ │ ├── friends/
│ │ │ │ └── invite_info.styl
│ │ │ ├── home/
│ │ │ │ └── index.styl
│ │ │ ├── profile/
│ │ │ │ ├── category-form.styl
│ │ │ │ └── index.styl
│ │ │ ├── settings/
│ │ │ │ ├── category_manager.styl
│ │ │ │ ├── chart.styl
│ │ │ │ ├── export_page.styl
│ │ │ │ ├── statement_imgs.styl
│ │ │ │ └── user_info.styl
│ │ │ ├── statements/
│ │ │ │ └── detail.styl
│ │ │ └── statistic/
│ │ │ ├── calendar.styl
│ │ │ └── index.styl
│ │ ├── shift.styl
│ │ ├── themes/
│ │ │ ├── components/
│ │ │ │ ├── button.styl
│ │ │ │ ├── form.styl
│ │ │ │ ├── loading.styl
│ │ │ │ └── tab.styl
│ │ │ ├── index.styl
│ │ │ └── root.styl
│ │ └── vars.styl
│ ├── components/
│ │ ├── AssetBanner/
│ │ │ └── index.jsx
│ │ ├── AssetList/
│ │ │ └── index.tsx
│ │ ├── Avatar/
│ │ │ └── index.jsx
│ │ ├── BasePage/
│ │ │ └── index.tsx
│ │ ├── Calculator/
│ │ │ ├── index.scss
│ │ │ └── index.tsx
│ │ ├── CategoryList/
│ │ │ └── index.tsx
│ │ ├── EmptyTips/
│ │ │ └── index.tsx
│ │ ├── Home/
│ │ │ ├── FinancePage/
│ │ │ │ └── index.tsx
│ │ │ ├── IndexPage/
│ │ │ │ └── index.tsx
│ │ │ ├── ProfilePage/
│ │ │ │ └── index.tsx
│ │ │ ├── StatisticPage/
│ │ │ │ └── index.tsx
│ │ │ └── index.js
│ │ ├── Select/
│ │ │ └── index.jsx
│ │ ├── SlideSetting/
│ │ │ └── index.tsx
│ │ ├── Statement/
│ │ │ └── index.jsx
│ │ ├── Statements/
│ │ │ └── index.jsx
│ │ ├── Statistic/
│ │ │ ├── CalendarStatistic.tsx
│ │ │ ├── ExpendCategory.tsx
│ │ │ ├── ExpendList.tsx
│ │ │ ├── ExpendTrend.tsx
│ │ │ └── Summary.tsx
│ │ ├── UiComponents/
│ │ │ ├── Button/
│ │ │ │ └── index.tsx
│ │ │ ├── Calculator/
│ │ │ │ └── index.tsx
│ │ │ ├── Form/
│ │ │ │ └── index.tsx
│ │ │ ├── Loading/
│ │ │ │ └── index.tsx
│ │ │ ├── Tabs/
│ │ │ │ └── index.tsx
│ │ │ └── index.js
│ │ └── statementForm/
│ │ ├── CategorySelect.tsx
│ │ ├── PayeeSelect.tsx
│ │ └── baseForm.tsx
│ ├── config/
│ │ ├── config.ts.example
│ │ └── index.ts
│ ├── index.html
│ ├── jz.ts
│ ├── pages/
│ │ ├── account_books/
│ │ │ ├── create.config.ts
│ │ │ ├── create.styl
│ │ │ ├── create.tsx
│ │ │ ├── edit.config.ts
│ │ │ ├── edit.tsx
│ │ │ ├── list.config.ts
│ │ │ ├── list.styl
│ │ │ └── list.tsx
│ │ ├── assets_flow/
│ │ │ ├── index.config.ts
│ │ │ └── index.tsx
│ │ ├── friends/
│ │ │ ├── index.config.ts
│ │ │ ├── index.scss
│ │ │ ├── index.tsx
│ │ │ ├── invite_info.config.ts
│ │ │ └── invite_info.tsx
│ │ ├── home/
│ │ │ ├── index.config.ts
│ │ │ └── index.tsx
│ │ ├── payee/
│ │ │ ├── list.config.ts
│ │ │ ├── list.scss
│ │ │ └── list.tsx
│ │ ├── setting/
│ │ │ ├── asset/
│ │ │ │ ├── form.tsx
│ │ │ │ ├── index.config.ts
│ │ │ │ └── index.tsx
│ │ │ ├── budget/
│ │ │ │ ├── index.config.ts
│ │ │ │ └── index.tsx
│ │ │ ├── category/
│ │ │ │ ├── form.tsx
│ │ │ │ ├── index.config.ts
│ │ │ │ └── index.tsx
│ │ │ ├── chart/
│ │ │ │ ├── category_statement.config.ts
│ │ │ │ └── category_statement.tsx
│ │ │ ├── child_budget/
│ │ │ │ ├── index.config.ts
│ │ │ │ └── index.tsx
│ │ │ ├── feedback/
│ │ │ │ ├── index.config.ts
│ │ │ │ └── index.tsx
│ │ │ ├── messages/
│ │ │ │ ├── detail.config.ts
│ │ │ │ ├── detail.tsx
│ │ │ │ ├── index.config.ts
│ │ │ │ └── index.tsx
│ │ │ ├── search/
│ │ │ │ ├── search.config.ts
│ │ │ │ └── search.tsx
│ │ │ ├── statement_imgs/
│ │ │ │ ├── index.config.ts
│ │ │ │ └── index.tsx
│ │ │ ├── statements_flow/
│ │ │ │ ├── index.config.ts
│ │ │ │ ├── index.scss
│ │ │ │ └── index.tsx
│ │ │ ├── statements_manage/
│ │ │ │ ├── data_in.config.ts
│ │ │ │ ├── data_in.tsx
│ │ │ │ ├── data_out.config.ts
│ │ │ │ └── data_out.tsx
│ │ │ └── user_info/
│ │ │ ├── index.config.ts
│ │ │ └── index.tsx
│ │ ├── share/
│ │ │ ├── index.config.ts
│ │ │ ├── index.tsx
│ │ │ ├── public.config.ts
│ │ │ └── public.tsx
│ │ ├── statement/
│ │ │ ├── form.config.ts
│ │ │ └── form.tsx
│ │ ├── statement_detail/
│ │ │ ├── index.config.ts
│ │ │ └── index.tsx
│ │ └── sub/
│ │ └── chart/
│ │ ├── index.config.ts
│ │ └── index.tsx
│ ├── router/
│ │ └── index.ts
│ ├── storage/
│ │ └── index.ts
│ ├── stores/
│ │ ├── home_store.ts
│ │ ├── index.ts
│ │ └── theme_store.ts
│ └── utils/
│ ├── echart_option.ts
│ └── event.ts
└── tsconfig.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
================================================
FILE: .eslintrc.js
================================================
// module.exports = {
// "extends": ["taro/react"],
// "rules": {
// "react/jsx-uses-react": "off",
// "react/react-in-jsx-scope": "off"
// }
// }
================================================
FILE: .gitignore
================================================
dist/
deploy_versions/
.temp/
.rn_temp/
node_modules/
.DS_Store
.swc/
src/config/config.ts
================================================
FILE: .vscode/settings.json
================================================
{
"compile-hero.disable-compile-files-on-did-save-code": true
}
================================================
FILE: README.md
================================================
# 洁账小程序
重要:基于 wepy 的老版本已经不维护了,请切换到 Taro 最新版本!!
一款简单易用的记账小程序,帮助用户轻松管理个人财务。
后端代码请切换到旧版本-配合 wepy 前端使用:https://github.com/yigger/jiezhang/tree/old-version-wepy
新版(此版本)的后端暂未开源,敬请期待!
### 体验二维码

## 功能特点
- 📝 快速记账:支持收入、支出、转账等多种记账类型
- 👥 多人协作:支持添加好友共同记账
- 📊 数据统计:直观的图表展示收支情况
- 💰 预算管理:设置预算,控制支出
- 📱 跨端同步:数据云端同步,随时随地记账
- 🔍 账单搜索:快速查找历史账单
## 技术栈
- Taro v3.6.32
- React
- TypeScript
- Taro UI
- 微信小程序原生能力
## 环境要求
- Node.js 16.14.0
- Taro CLI 3.6.32
## 开始使用
1. 克隆项目
```bash
git clone git@github.com:yigger/jiezhang.git jiezhang-miniapp
cd jiezhang-miniapp
```
2. 安装依赖
```bash
npm install
```
3. 配置
```bash
// 配置小程序 appid, 服务端地址
cp src/config/config.ts.example src/config/config.ts
// 开发环境构建
npm run dev:weapp
// 生产环境构建
npm run build:weapp
```
## 项目结构
```
src/
├── api/ # API 接口
├── assets/ # 静态资源
├── components/ # 公共组件
├── config/ # 配置文件
├── pages/ # 页面文件
├── router/ # 路由组件
├── store/ # 状态管理
├── utils/ # 工具函数
└── app.tsx # 应用入口
└── app.config.ts # 小程序配置文件
└── jz.ts # 全局变量
```
## 贡献
欢迎贡献代码,提交 issue,或者提供反馈。
## 许可证
MIT
================================================
FILE: babel.config.js
================================================
// babel-preset-taro 更多选项和默认值:
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
module.exports = {
presets: [
['taro', {
framework: 'react',
ts: true
}]
]
}
================================================
FILE: config/dev.js
================================================
module.exports = {
projectname: "jz-taro-development",
outputRoot: 'dist/development',
env: {
NODE_ENV: '"development"'
},
defineConstants: {
},
mini: {},
h5: {
esnextModules: ['taro-ui']
}
}
================================================
FILE: config/index.js
================================================
const path = require('path');
const config = {
projectName: 'jz-taro',
date: '2021-4-4',
designWidth: 750,
deviceRatio: {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2
},
sourceRoot: 'src',
outputRoot: 'dist',
plugins: [
path.resolve(__dirname, '../plugins/view-data-plugin.js')
],
defineConstants: {
},
copy: {
patterns: [
],
options: {
}
},
framework: 'react',
mini: {
postcss: {
pxtransform: {
enable: true,
config: {
}
},
url: {
enable: true,
config: {
limit: 1024 // 设定转换尺寸上限
}
},
cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
}
},
h5: {
publicPath: '/',
staticDirectory: 'static',
postcss: {
autoprefixer: {
enable: true,
config: {
}
},
cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
}
},
alias: {
'@/src': path.resolve(__dirname, '..', 'src'),
'@/jz': path.resolve(__dirname, '..', 'src/jz'),
'@/api': path.resolve(__dirname, '..', 'src/api'),
'@/components': path.resolve(__dirname, '..', 'src/components'),
'@/assets': path.resolve(__dirname, '..', 'src/assets'),
'@/utils': path.resolve(__dirname, '..', 'src/utils')
}
}
module.exports = function (merge) {
if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev'))
}
return merge({}, config, require('./prod'))
}
================================================
FILE: config/prod.js
================================================
module.exports = {
projectname: "jz-taro-production",
outputRoot: 'dist/production',
env: {
NODE_ENV: '"production"'
},
defineConstants: {
},
mini: {},
h5: {
/**
* 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。
* 参考代码如下:
* webpackChain (chain) {
* chain.plugin('analyzer')
* .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
* }
*/
}
}
================================================
FILE: package.json
================================================
{
"name": "jz-taro",
"version": "4.0.0",
"private": true,
"description": "jiezhang",
"templateInfo": {
"name": "taro-ui",
"typescript": true,
"css": "stylus"
},
"scripts": {
"build:weapp": "set NODE_ENV=production && taro build --type weapp",
"build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
"build:h5": "taro build --type h5",
"build:rn": "taro build --type rn",
"build:qq": "taro build --type qq",
"build:jd": "taro build --type jd",
"build:quickapp": "taro build --type quickapp",
"pro:weapp": "set NODE_ENV=production && taro build --type weapp --watch",
"dev:weapp": "taro build --type weapp --watch",
"dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"dev:rn": "npm run build:rn -- --watch",
"dev:qq": "npm run build:qq -- --watch",
"dev:jd": "npm run build:jd -- --watch",
"dev:quickapp": "npm run build:quickapp -- --watch"
},
"browserslist": [
"last 3 versions",
"Android >= 4.1",
"ios >= 8"
],
"author": "",
"dependencies": {
"@babel/runtime": "^7.7.7",
"@tarojs/cli": "3.6.32",
"@tarojs/components": "3.6.32",
"@tarojs/plugin-framework-react": "3.6.32",
"@tarojs/plugin-platform-weapp": "^3.6.32",
"@tarojs/react": "3.6.32",
"@tarojs/runtime": "3.6.32",
"@tarojs/taro": "3.6.32",
"date-fns": "^2.21.3",
"lodash": "4.17.15",
"mobx": "5.15.7",
"mobx-react": "6.3.1",
"react": "^16.8.0",
"react-dom": "^16.8.0",
"taro-react-echarts": "^1.2.2",
"taro-ui": "^3.3.0"
},
"devDependencies": {
"@babel/core": "^7.8.0",
"@tarojs/mini-runner": "3.6.32",
"@tarojs/webpack-runner": "3.6.32",
"@types/react": "^17.0.2",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^4.15.1",
"@typescript-eslint/parser": "^4.15.1",
"babel-preset-taro": "3.2.0",
"eslint": "^6.8.0",
"eslint-config-taro": "3.2.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-react-hooks": "^4.2.0",
"node-sass": "^9.0.0",
"stylelint": "9.3.0",
"typescript": "^4.1.0"
}
}
================================================
FILE: plugins/view-data-plugin.js
================================================
// NOTE:Taro 的 View 不支持自定义属性,比如 <View theme='test'></View>,编译会过滤掉 theme 属性
// https://github.com/NervJS/taro/issues/11530#issuecomment-2196396686
export default ctx => {
ctx.registerMethod({
name: 'onSetupClose',
fn(platform) {
const template = platform.template
template.mergeComponents(ctx, {
View: {
'data-theme-name': 'i.dataThemeName'
}
})
}
})
}
================================================
FILE: project.config.json
================================================
{
"miniprogramRoot": "dist/",
"projectname": "jz-taro",
"description": "jiezhang",
"appid": "wx414689c547b71ab0",
"setting": {
"urlCheck": false,
"es6": false,
"postcss": false,
"preloadBackgroundData": false,
"minified": false,
"newFeature": true,
"autoAudits": false,
"coverView": true,
"showShadowRootInWxmlPanel": false,
"scopeDataCheck": false,
"useCompilerModule": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"miniprogram": {
"list": [
]
}
}
}
================================================
FILE: src/api/http-result.ts
================================================
export default class HttpResult {
public data: any
public message: string
public status: number
public header: any
public st: any
constructor (st) {
this.st = st
this.data = st.data
this.status = st.statusCode
this.header = st.header
}
get isSuccess(): boolean {
return this.status === 200
}
}
================================================
FILE: src/api/index.ts
================================================
import Request from './request'
import Statement from './logic/statement'
import Main from './logic/main'
import User from './logic/user'
import Category from './logic/category'
import Asset from './logic/asset'
import AccountBook from './logic/account_book'
import Finance from './logic/finance'
import SuperStatement from './logic/superStatement'
import SuperChart from './logic/superChart'
import Budget from './logic/budget'
import Chaos from './logic/chaos'
import Statistic from './logic/statistic'
import Message from './logic/message'
import Payee from './logic/payee'
import Friend from './logic/friend'
export class Api extends Request {
private createLazyService<T>(key: string, Constructor: new (api: Api) => T): T {
if (!this[key]) {
this[key] = new Constructor(this)
}
return this[key]
}
get main(): Main {
return this.createLazyService('_main', Main)
}
get statements(): Statement {
return this.createLazyService('_statement', Statement)
}
get users(): User {
return this.createLazyService('_user', User)
}
get categories(): Category {
return this.createLazyService('_category', Category)
}
get assets(): Asset {
return this.createLazyService('_asset', Asset)
}
get account_books(): AccountBook {
return this.createLazyService('_account_book', AccountBook)
}
get finances(): Finance {
return this.createLazyService('_finance', Finance)
}
get superStatements(): SuperStatement {
return this.createLazyService('_super_statement', SuperStatement)
}
get superCharts(): SuperChart {
return this.createLazyService('_super_chart', SuperChart)
}
get budgets(): Budget {
return this.createLazyService('_budget', Budget)
}
get chaos(): Chaos {
return this.createLazyService('_chaos', Chaos)
}
get statistics(): Statistic {
return this.createLazyService('_statistic', Statistic)
}
get messages(): Message {
return this.createLazyService('_message', Message)
}
get payees(): Payee {
return this.createLazyService('_payee', Payee)
}
get friends(): Friend {
return this.createLazyService('_friend', Friend)
}
}
================================================
FILE: src/api/logic/account_book.ts
================================================
import Request from '../request'
export default class AccountBook {
private _request: Request
constructor (request: Request) {
this._request = request
}
getAccountBooks() {
return this._request.get('account_books')
}
getAccountBook(id) {
return this._request.get(`account_books/${id}`)
}
getAccountBookTypes() {
return this._request.get('account_books/types')
}
getCategoriesList({ accountType }) {
return this._request.get('account_books/preset_categories', { account_type: accountType })
}
updateDefaultAccount(accountBook) {
return this._request.put(`account_books/${accountBook.id}/switch`, {})
}
create(data) {
return this._request.post('account_books', data)
}
update(id, data) {
return this._request.put(`account_books/${id}`, data)
}
destroy(id) {
return this._request.delete(`account_books/${id}`)
}
}
================================================
FILE: src/api/logic/asset.ts
================================================
import Request from '../request'
export default class Asset {
private _request: Request
constructor (request: Request) {
this._request = request
}
getSettingList({ parentId }) {
return this._request.get('assets', { parent_id: parentId })
}
getAssetDetail(id) {
return this._request.get(`assets/${id}`)
}
deleteAsset(id) {
return this._request.delete(`assets/${id}`, {})
}
getAssetIcon() {
return this._request.get('icons/assets_with_url')
}
updateAsset(id, data) {
return this._request.put(`assets/${id}`, { wallet: data })
}
create(data) {
return this._request.post('assets', { wallet: data })
}
updateAssetAmount(id, amount) {
return this._request.put(`wallet/surplus`, { asset_id: id, amount: amount })
}
}
================================================
FILE: src/api/logic/budget.ts
================================================
import Request from '../request'
export default class Budget {
private _request: Request
constructor (request: Request) {
this._request = request
}
getSummary({
year: year,
month: month
}) {
return this._request.get('budgets', { year, month })
}
getParentList({
year: year,
month: month
}) {
return this._request.get('budgets/parent', { year, month })
}
getCategoryBudget({category_id, year, month}) {
return this._request.get('budgets/' + category_id, { year, month })
}
updateRootAmount({amount}) {
return this._request.put('budgets/0', { type: 'user', amount: amount})
}
updateCategoryAmount({amount, category_id}) {
return this._request.put('budgets/0', { type: 'category', category_id: category_id, amount: amount})
}
}
================================================
FILE: src/api/logic/category.ts
================================================
import Request from '../request'
export default class Category {
private _request: Request
constructor (request: Request) {
this._request = request
}
getSettingList({ type = 'expend', parent_id = 0 }) {
return this._request.get('categories/category_list', {
type: type,
parent_id: parent_id
})
}
getCategoryDetail(id) {
return this._request.get(`categories/${id}`)
}
deleteCategory(id) {
return this._request.delete(`categories/${id}`, {})
}
getCategoryIcon() {
return this._request.get('icons/categories_with_url')
}
updateCategory(id, data) {
return this._request.put(`categories/${id}`, data)
}
create(data) {
return this._request.post('categories', data)
}
}
================================================
FILE: src/api/logic/chaos.ts
================================================
import Request from '../request'
export default class Chaos {
private _request: Request
constructor (request: Request) {
this._request = request
}
async submitFeedback({ content }) {
return await this._request.post('settings/feedback', {
content: content,
type: 0
})
}
}
================================================
FILE: src/api/logic/finance.ts
================================================
import Request from '../request'
type AssetStatementParams = {
asset_id: number;
year: number;
month: number;
}
export default class Finance {
private _request: Request
constructor (request: Request) {
this._request = request
}
async index () {
return await this._request.get('wallet')
}
async getAssetDetail(assetId: number) {
return await this._request.get('wallet/information', { asset_id: assetId })
}
async getAssetTimeline(assetId: number) {
return await this._request.get('wallet/time_line', { asset_id: assetId })
}
async getAssetStatements(params: AssetStatementParams) {
return await this._request.get('wallet/statement_list', params)
}
async updateAmountVisible({visible}) {
return await this._request.put('users/update_user', { user: { hidden_asset_money: visible } })
}
}
================================================
FILE: src/api/logic/friend.ts
================================================
import jz from '@/jz'
import Request from '../request'
import { FriendInviteRequest, FriendInviteResponse } from '../types'
export default class Friend {
private readonly _request: Request
constructor(request: Request) {
this._request = request
}
public async list({
account_book_id
}) {
const st = await this._request.get('friends', { account_book_id: account_book_id })
return st
}
public async invite(data: FriendInviteRequest) {
const st = await this._request.post<FriendInviteResponse>('friends/invite', data)
return st
}
public async information(token: string) {
const st = await this._request.get('friends/invite_information', { invite_token: token })
return st
}
public async accept(token: string, nickname: string) {
const st = await this._request.post('friends/accept_apply', { invite_token: token, nickname: nickname })
return st
}
public async remove(data) {
const st = await this._request.delete(`friends/${data.collaborator_id}`, { account_book_id: data.account_book_id })
return st
}
public async update(data) {
const st = await this._request.put(`friends/${data.collaborator_id}`, data)
return st
}
}
================================================
FILE: src/api/logic/main.ts
================================================
import Request from '../request'
import { HeaderResponse, StatementsResponse } from '../types'
export default class Main {
private readonly _request: Request
constructor(request: Request) {
this._request = request
}
public async header(): Promise<HeaderResponse> {
const st = await this._request.get<HeaderResponse>('header')
return st
}
public async statements(range: string): Promise<StatementsResponse> {
const st = await this._request.get<StatementsResponse>('index', {range})
return st
}
}
================================================
FILE: src/api/logic/message.ts
================================================
import Request from '../request'
export default class Message {
private _request: Request
constructor (request: Request) {
this._request = request
}
async getList () {
return await this._request.get('message')
}
async getMessage (id) {
return await this._request.get(`message/${id}`)
}
}
================================================
FILE: src/api/logic/payee.ts
================================================
import Request from '../request'
import jz from '../../jz'
export interface PayeeType {
id: number
name: string
}
export default class Payee {
private _request: Request
constructor (request: Request) {
this._request = request
}
async list(): Promise<PayeeType[]> {
const currentAccountBook = jz.storage.getCurrentAccountBook()
const res = await this._request.get('payees', { account_book_id: currentAccountBook.id })
return res.data
}
async create(payee: PayeeType): Promise<PayeeType> {
const currentAccountBook = jz.storage.getCurrentAccountBook()
const res = await this._request.post('payees', { account_book_id: currentAccountBook.id, payee })
return res.data
}
async update(payeeId: string, payee: PayeeType): Promise<PayeeType> {
const currentAccountBook = jz.storage.getCurrentAccountBook()
const res = await this._request.put(`payees/${payeeId}`, { account_book_id: currentAccountBook.id, payee })
return res.data
}
async delete(payee: PayeeType): Promise<boolean> {
const currentAccountBook = jz.storage.getCurrentAccountBook()
const res = await this._request.delete(`payees/${payee.id}`, { account_book_id: currentAccountBook.id })
return res.data
}
}
================================================
FILE: src/api/logic/statement.ts
================================================
import Request from '../request'
import jz from '@/jz'
import Taro from '@tarojs/taro'
export default class Statement {
private _request: Request
constructor (request: Request) {
this._request = request
}
// 获取创建账单时的分类列表
async categoriesWithForm(type: 'income' | 'expend') {
const cacheCategories = jz.storage.getStatementCategories(type)
if (cacheCategories) {
return cacheCategories
}
const st = await this._request.get('statements/categories', {type: type})
if (st.isSuccess) {
const data = { frequent: st.data.frequent, data: st.data.categories }
jz.storage.setStatementCategories(type, data)
return data
} else {
return null
}
}
// 获取创建账单时的资产列表
async assetsWithForm(params={}) {
const cache = jz.storage.getStatementAssets()
if (cache) {
return cache
}
const st = await this._request.get('statements/assets', params)
if (st.isSuccess) {
const data = { frequent: st.data.frequent, data: st.data.categories }
jz.storage.setStatementAssets(data)
return data
} else {
return null
}
}
// 获取最近常用的三个分类
categoryFrequent(type: 'income' | 'expend') {
return this._request.get('statements/category_frequent', {
type: type
})
}
// 获取最近常用的三个资产
assetFrequent() {
return this._request.get('statements/asset_frequent')
}
// 获取账单列表
list(params) {
return this._request.get('statements', params)
}
getListByToken(token, orderBy) {
return this._request.get('statements/list_by_token', {token: token, order_by: orderBy})
}
// 创建账单
create(data) {
return this._request.post('statements', { statement: data })
}
// 更新账单
update(statementId, data) {
return this._request.put(`statements/${statementId}`, { statement: data })
}
// 获取账单详情
getStatement(statementId: number) {
return this._request.get(`statements/${statementId}`)
}
// 删除账单
deleteStatement(statementId: number) {
return this._request.delete(`statements/${statementId}`)
}
// 搜索账单
searchStatements(keyword: string) {
return this._request.get('search', {keyword: keyword})
}
// 账单的详情
getStatementImages() {
return this._request.get('statements/images')
}
generateShareToken(params) {
return this._request.post('statements/generate_share_key', params)
}
pre_check_export() {
return this._request.post('statements/export_check', {})
}
async export_excel (timeRange: string) {
const accessToken = await this._request.getAccessToken()
const header = {
'content-type': 'application/json',
'X-WX-APP-ID': jz.appId,
'X-WX-Skey': accessToken,
}
return Taro.downloadFile({
url: `${this._request._endpoint}/statements/export_excel?range=${timeRange}`,
header: header
})
}
targetObjects(statementType: string) {
return this._request.get('statements/target_objects', {type: statementType})
}
removeAvatar(statementId: number, avatar_id: number) {
return this._request.delete(`statements/${statementId}/avatar`, {avatar_id: avatar_id})
}
defaultCategoryAsset(statementType: string) {
return this._request.get('statements/default_category_asset', {type: statementType})
}
}
================================================
FILE: src/api/logic/statistic.ts
================================================
import Request from '../request'
export default class Statistic {
private _request: Request
constructor (request: Request) {
this._request = request
}
getCalendarData(date: string) {
return this._request.get('chart/calendar_data', {
date: date
})
}
getOverviewHeader(date: string) {
return this._request.get('chart/overview_header', {
date: date
})
}
getOverviewStatements(date: string) {
return this._request.get('chart/overview_statements', {
date: date
})
}
getRate(date: string, type: string) {
return this._request.get('chart/rate', {
date: date,
type: type
})
}
}
================================================
FILE: src/api/logic/superChart.ts
================================================
import Request from '../request'
export default class SuperChart {
private _request: Request
constructor (request: Request) {
this._request = request
}
getHeader(params) {
return this._request.get('super_chart/header', params)
}
getPieData(params) {
return this._request.get("super_chart/get_pie_data", params)
}
getWeekData(params) {
return this._request.get("super_chart/week_data", params)
}
getLineData({ year }) {
return this._request.get("super_chart/line_chart", { year: year })
}
getCategoriesTop({ year, month }) {
return this._request.get("super_chart/categories_list", { year: year, month: month })
}
getTableSumary({ year, month }) {
return this._request.get("super_chart/table_sumary", { year: year, month: month })
}
}
================================================
FILE: src/api/logic/superStatement.ts
================================================
import Request from '../request'
export default class SuperStatement {
private _request: Request
constructor (request: Request) {
this._request = request
}
getTime() {
return this._request.get('super_statements/time')
}
getStatements(params) {
return this._request.get('super_statements/list', params)
}
}
================================================
FILE: src/api/logic/user.ts
================================================
import Request from '../request'
export default class User {
private _request: Request
constructor (request: Request) {
this._request = request
}
getSettingsData() {
return this._request.get('settings')
}
getUserInfo() {
return this._request.get('users')
}
updateUserInfo(params) {
return this._request.put('users/update_user', { user: params })
}
loginPc(code) {
return this._request.post('users/scan_login', { qr_code: code })
}
}
================================================
FILE: src/api/request.ts
================================================
import Taro from "@tarojs/taro"
import HttpResult from './http-result'
import jz from '../jz'
class RequestManager {
private static cache: { [key: string]: Promise<any> } = {};
private static getStoredToken() {
const tokenData = Taro.getStorageSync('access_token_data')
if (!tokenData) return null
const { token, expireTime } = JSON.parse(tokenData)
if (Date.now() > expireTime) {
Taro.removeStorageSync('access_token_data')
return null
}
return token
}
private static setStoredToken(token: string) {
const expireTime = Date.now() + 2 * 60 * 60 * 1000 // 2小时过期
Taro.setStorageSync('access_token_data', JSON.stringify({
token,
expireTime
}))
}
static async get(url, endpoint, code): Promise<any> {
// 先检查本地存储的 token
const storedToken = this.getStoredToken()
if (storedToken) {
return {
statusCode: 200,
data: { session: storedToken }
}
}
// 如果没有有效的缓存 token,则发起请求
if (this.cache[url]) {
return this.cache[url];
}
const checkOpenId = Taro.request({
method: 'POST',
url: `${endpoint}/check_openid`,
header: {
'X-WX-Code': code,
'X-WX-APP-ID': jz.appId,
}
}).then(res => {
if (res.statusCode === 200 && res.data.session) {
this.setStoredToken(res.data.session)
}
return res
})
this.cache[url] = checkOpenId
return this.cache[url];
}
static async delCache() {
this.cache = {}
Taro.removeStorageSync('access_token_data')
}
}
class Request {
public _endpoint: string
constructor (endpoint: string) {
this._endpoint = endpoint
}
get (path, data?, options = {}) {
return this.request('GET', path, data, options)
}
post (path, data, options = {}): Promise<HttpResult> {
return this.request('POST', path, data, options)
}
put (path, data, options = {}): Promise<HttpResult> {
return this.request('PUT', path, data, options)
}
delete (path, data={}, options = {}): Promise<HttpResult> {
return this.request('DELETE', path, data, options)
}
async upload (file_path, formData) {
const accessToken = await this.getAccessToken()
const header = {
'content-type': 'application/json',
'X-WX-APP-ID': jz.appId,
'X-WX-Skey': accessToken,
}
return Taro.uploadFile({
url: `${this._endpoint}/upload`,
header: header,
filePath: file_path,
formData: formData,
name: 'file'
})
}
async getAccessToken(): Promise<string> {
const loginCode = await Taro.login()
const res = await RequestManager.get('check_openid', this._endpoint, loginCode.code)
if (res.statusCode === 200) {
return res.data.session
}
RequestManager.delCache()
return ''
}
async request (method, path, data, options = {}): Promise<HttpResult> {
let retryCount = 5
let lastResult: HttpResult | null = null
// 处理路径,确保endpoint和path之间只有一个/
const normalizedPath = path.startsWith('/') ? path.substring(1) : path
const requestUrl = `${this._endpoint}/${normalizedPath}`
const header = Object.assign({
'content-type': 'application/json',
'X-WX-APP-ID': jz.appId
}, options['header'])
while (retryCount >= 0) {
const accessToken = await this.getAccessToken()
header['X-WX-Skey'] = accessToken
try {
const res = await Taro.request({
method: method,
url: requestUrl,
data: data,
header: header,
})
const result = new HttpResult(res);
if (result['data'] && result['data']['status'] === 301) {
RequestManager.delCache()
retryCount--
continue
} else {
lastResult = result
break
}
} catch (error) {
RequestManager.delCache()
retryCount--
if (retryCount < 0) {
throw error
}
}
}
return lastResult
}
}
export default Request
================================================
FILE: src/api/types.ts
================================================
export interface User {
id: number
nickname: string
avatar_path: string
}
// 请求失败的响应通用
type FailureResponse = {
status: Exclude<number, 200>
data?: never
msg: string
}
// AccountBook 通用格式
export interface AccountBook {
id: number
name: string
}
export interface HeaderMessage {
id: number
title: string
}
export interface HeaderResponse {
message: HeaderMessage
month_budget: string
month_expend: string
today_expend: string
use_pencentage: number
}
export interface Statement {
id: number
type: 'expend' | 'income' | 'transfer'
description: string
title: string | null
amount: string
money: string
asset: string
category: string
city: string | null
date: string
icon_path: string
location: string | null
month_day: string
province: string | null
street: string | null
time: string
timeStr: string
week: string
}
export interface StatementsResponse {
statements: Statement[]
}
// 邀请好友的请求
export interface FriendInviteRequest {
account_book_id: number
role: string
}
// 邀请好友成功的响应
type FriendInviteSuccessResponse = {
status: 200
data: string
msg?: never
}
export type FriendInviteResponse = FriendInviteSuccessResponse | FailureResponse
// 邀请成功的邀请信息的响应
// 包含了被邀请人的信息和被邀请的账簿的信息
export interface InviteInfo {
account_book: AccountBook
invite_user: User
role_name: string
}
interface InviteInfoSuccessResponse {
status: 200
data: InviteInfo
msg?: never
}
export type InviteInfoResponse = InviteInfoSuccessResponse | FailureResponse
================================================
FILE: src/app.config.ts
================================================
export default {
pages: [
// 首页
'pages/home/index',
// 创建账单的表单
'pages/statement/form',
'pages/statement_detail/index',
// 分类管理
'pages/setting/category/index',
'pages/setting/category/form',
// 资产管理
'pages/setting/asset/index',
'pages/setting/asset/form',
// 预算管理
'pages/setting/budget/index',
'pages/setting/child_budget/index',
// 账簿管理
"pages/account_books/create",
"pages/account_books/edit",
"pages/account_books/list",
// 设置的相关页面
'pages/setting/search/search',
'pages/setting/statements_flow/index',
'pages/assets_flow/index',
"pages/setting/feedback/index",
"pages/setting/messages/index",
"pages/setting/messages/detail",
"pages/setting/user_info/index",
'pages/setting/chart/category_statement',
'pages/setting/statement_imgs/index',
// 导出
'pages/setting/statements_manage/data_out',
// 登录网页端
'pages/setting/statements_manage/data_in',
// 账单的分享页面
'pages/share/index',
'pages/share/public',
// 商家管理界面
'pages/payee/list',
// 好友管理界面
'pages/friends/index',
'pages/friends/invite_info',
],
subPackages: [
{
root: 'pages/sub',
pages: ['chart/index'],
independent: true,
},
],
requiredPrivateInfos: [
'chooseLocation'
],
window: {
navigationBarTitleText: 'WeChat',
backgroundTextStyle : 'light',
navigationBarBackgroundColor: '#fff',
navigationBarTextStyle : 'white',
navigationStyle : 'custom',
}
}
================================================
FILE: src/app.ts
================================================
import { Component } from 'react'
import Taro from "@tarojs/taro"
import jz from './jz'
class App extends Component {
onLaunch () {
const updateManager = Taro.getUpdateManager()
updateManager.onCheckForUpdate(function () {
})
updateManager.onUpdateReady(function () {
Taro.showModal({
title: '洁账版本升级',
content: '版本已更新,请重启应用后使用',
success(res) {
if (res.confirm) {
updateManager.applyUpdate()
}
}
})
})
jz.initialize()
}
// this.props.children 是将要会渲染的页面
render () {
return this.props.children
}
}
export default App
================================================
FILE: src/assets/echarts.js
================================================
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.echarts = {}));
})(this, function (exports) {
'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
};
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var Browser = function () {
function Browser() {
this.firefox = false;
this.ie = false;
this.edge = false;
this.newEdge = false;
this.weChat = false;
}
return Browser;
}();
var Env = function () {
function Env() {
this.browser = new Browser();
this.node = false;
this.wxa = false;
this.worker = false;
this.svgSupported = false;
this.touchEventsSupported = false;
this.pointerEventsSupported = false;
this.domSupported = false;
this.transformSupported = false;
this.transform3dSupported = false;
this.hasGlobalWindow = typeof window !== 'undefined';
}
return Env;
}();
var env = new Env();
if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {
env.wxa = true;
env.touchEventsSupported = true;
} else if (typeof document === 'undefined' && typeof self !== 'undefined') {
env.worker = true;
} else if (typeof navigator === 'undefined') {
env.node = true;
env.svgSupported = true;
} else {
detect(navigator.userAgent, env);
}
function detect(ua, env) {
var browser = env.browser;
var firefox = ua.match(/Firefox\/([\d.]+)/);
var ie = ua.match(/MSIE\s([\d.]+)/) || ua.match(/Trident\/.+?rv:(([\d.]+))/);
var edge = ua.match(/Edge?\/([\d.]+)/);
var weChat = /micromessenger/i.test(ua);
if (firefox) {
browser.firefox = true;
browser.version = firefox[1];
}
if (ie) {
browser.ie = true;
browser.version = ie[1];
}
if (edge) {
browser.edge = true;
browser.version = edge[1];
browser.newEdge = +edge[1].split('.')[0] > 18;
}
if (weChat) {
browser.weChat = true;
}
env.svgSupported = typeof SVGRect !== 'undefined';
env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;
env.pointerEventsSupported = 'onpointerdown' in window && (browser.edge || browser.ie && +browser.version >= 11);
env.domSupported = typeof document !== 'undefined';
var style = document.documentElement.style;
env.transform3dSupported = (browser.ie && 'transition' in style || browser.edge || 'WebKitCSSMatrix' in window && 'm11' in new WebKitCSSMatrix() || 'MozPerspective' in style) && !('OTransition' in style);
env.transformSupported = env.transform3dSupported || browser.ie && +browser.version >= 9;
}
var DEFAULT_FONT_SIZE = 12;
var DEFAULT_FONT_FAMILY = 'sans-serif';
var DEFAULT_FONT = DEFAULT_FONT_SIZE + "px " + DEFAULT_FONT_FAMILY;
var OFFSET = 20;
var SCALE = 100;
var defaultWidthMapStr = "007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";
function getTextWidthMap(mapStr) {
var map = {};
if (typeof JSON === 'undefined') {
return map;
}
for (var i = 0; i < mapStr.length; i++) {
var char = String.fromCharCode(i + 32);
var size = (mapStr.charCodeAt(i) - OFFSET) / SCALE;
map[char] = size;
}
return map;
}
var DEFAULT_TEXT_WIDTH_MAP = getTextWidthMap(defaultWidthMapStr);
var platformApi = {
createCanvas: function () {
return typeof document !== 'undefined' && document.createElement('canvas');
},
measureText: function () {
var _ctx;
var _cachedFont;
return function (text, font) {
if (!_ctx) {
var canvas = platformApi.createCanvas();
_ctx = canvas && canvas.getContext('2d');
}
if (_ctx) {
if (_cachedFont !== font) {
_cachedFont = _ctx.font = font || DEFAULT_FONT;
}
return _ctx.measureText(text);
} else {
text = text || '';
font = font || DEFAULT_FONT;
var res = /(\d+)px/.exec(font);
var fontSize = res && +res[1] || DEFAULT_FONT_SIZE;
var width = 0;
if (font.indexOf('mono') >= 0) {
width = fontSize * text.length;
} else {
for (var i = 0; i < text.length; i++) {
var preCalcWidth = DEFAULT_TEXT_WIDTH_MAP[text[i]];
width += preCalcWidth == null ? fontSize : preCalcWidth * fontSize;
}
}
return {
width: width
};
}
};
}(),
loadImage: function (src, onload, onerror) {
var image = new Image();
image.onload = onload;
image.onerror = onerror;
image.src = src;
return image;
}
};
function setPlatformAPI(newPlatformApis) {
for (var key in platformApi) {
if (newPlatformApis[key]) {
platformApi[key] = newPlatformApis[key];
}
}
}
var BUILTIN_OBJECT = reduce(['Function', 'RegExp', 'Date', 'Error', 'CanvasGradient', 'CanvasPattern', 'Image', 'Canvas'], function (obj, val) {
obj['[object ' + val + ']'] = true;
return obj;
}, {});
var TYPED_ARRAY = reduce(['Int8', 'Uint8', 'Uint8Clamped', 'Int16', 'Uint16', 'Int32', 'Uint32', 'Float32', 'Float64'], function (obj, val) {
obj['[object ' + val + 'Array]'] = true;
return obj;
}, {});
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 ctorFunction = function () {}.constructor;
var protoFunction = ctorFunction ? ctorFunction.prototype : null;
var protoKey = '__proto__';
var idStart = 0x0907;
function guid() {
return idStart++;
}
function logError() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (typeof console !== 'undefined') {
console.error.apply(console, args);
}
}
function clone$3(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$3(source[i]);
}
}
} else if (TYPED_ARRAY[typeStr]) {
if (!isPrimitive(source)) {
var Ctor = source.constructor;
if (Ctor.from) {
result = Ctor.from(source);
} else {
result = new Ctor(source.length);
for (var i = 0, len = source.length; i < len; i++) {
result[i] = source[i];
}
}
}
} else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {
result = {};
for (var key in source) {
if (source.hasOwnProperty(key) && key !== protoKey) {
result[key] = clone$3(source[key]);
}
}
}
return result;
}
function merge(target, source, overwrite) {
if (!isObject$2(source) || !isObject$2(target)) {
return overwrite ? clone$3(source) : target;
}
for (var key in source) {
if (source.hasOwnProperty(key) && key !== protoKey) {
var targetProp = target[key];
var sourceProp = source[key];
if (isObject$2(sourceProp) && isObject$2(targetProp) && !isArray(sourceProp) && !isArray(targetProp) && !isDom(sourceProp) && !isDom(targetProp) && !isBuiltInObject(sourceProp) && !isBuiltInObject(targetProp) && !isPrimitive(sourceProp) && !isPrimitive(targetProp)) {
merge(targetProp, sourceProp, overwrite);
} else if (overwrite || !(key in target)) {
target[key] = clone$3(source[key]);
}
}
}
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;
}
function extend(target, source) {
if (Object.assign) {
Object.assign(target, source);
} else {
for (var key in source) {
if (source.hasOwnProperty(key) && key !== protoKey) {
target[key] = source[key];
}
}
}
return target;
}
function defaults(target, source, overlay) {
var keysArr = keys(source);
for (var i = 0; i < keysArr.length; i++) {
var key = keysArr[i];
if (overlay ? source[key] != null : target[key] == null) {
target[key] = source[key];
}
}
return target;
}
var createCanvas = platformApi.createCanvas;
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;
}
function inherits(clazz, baseClazz) {
var clazzPrototype = clazz.prototype;
function F() {}
F.prototype = baseClazz.prototype;
clazz.prototype = new F();
for (var prop in clazzPrototype) {
if (clazzPrototype.hasOwnProperty(prop)) {
clazz.prototype[prop] = clazzPrototype[prop];
}
}
clazz.prototype.constructor = clazz;
clazz.superClass = baseClazz;
}
function mixin(target, source, override) {
target = 'prototype' in target ? target.prototype : target;
source = 'prototype' in source ? source.prototype : source;
if (Object.getOwnPropertyNames) {
var keyList = Object.getOwnPropertyNames(source);
for (var i = 0; i < keyList.length; i++) {
var key = keyList[i];
if (key !== 'constructor') {
if (override ? source[key] != null : target[key] == null) {
target[key] = source[key];
}
}
}
} else {
defaults(target, source, override);
}
}
function isArrayLike(data) {
if (!data) {
return false;
}
if (typeof data === 'string') {
return false;
}
return typeof data.length === 'number';
}
function each$4(arr, cb, context) {
if (!(arr && cb)) {
return;
}
if (arr.forEach && arr.forEach === nativeForEach) {
arr.forEach(cb, context);
} else if (arr.length === +arr.length) {
for (var i = 0, len = arr.length; i < len; i++) {
cb.call(context, arr[i], i, arr);
}
} else {
for (var key in arr) {
if (arr.hasOwnProperty(key)) {
cb.call(context, arr[key], key, arr);
}
}
}
}
function map$1(arr, cb, context) {
if (!arr) {
return [];
}
if (!cb) {
return slice(arr);
}
if (arr.map && arr.map === nativeMap) {
return arr.map(cb, context);
} else {
var result = [];
for (var i = 0, len = arr.length; i < len; i++) {
result.push(cb.call(context, arr[i], i, arr));
}
return result;
}
}
function reduce(arr, cb, memo, context) {
if (!(arr && cb)) {
return;
}
for (var i = 0, len = arr.length; i < len; i++) {
memo = cb.call(context, memo, arr[i], i, arr);
}
return memo;
}
function filter(arr, cb, context) {
if (!arr) {
return [];
}
if (!cb) {
return slice(arr);
}
if (arr.filter && arr.filter === nativeFilter) {
return arr.filter(cb, context);
} else {
var result = [];
for (var i = 0, len = arr.length; i < len; i++) {
if (cb.call(context, arr[i], i, arr)) {
result.push(arr[i]);
}
}
return result;
}
}
function find(arr, cb, context) {
if (!(arr && cb)) {
return;
}
for (var i = 0, len = arr.length; i < len; i++) {
if (cb.call(context, arr[i], i, arr)) {
return arr[i];
}
}
}
function keys(obj) {
if (!obj) {
return [];
}
if (Object.keys) {
return Object.keys(obj);
}
var keyList = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
keyList.push(key);
}
}
return keyList;
}
function bindPolyfill(func, context) {
var args = [];
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
return function () {
return func.apply(context, args.concat(nativeSlice.call(arguments)));
};
}
var bind$1 = protoFunction && isFunction(protoFunction.bind) ? protoFunction.call.bind(protoFunction.bind) : bindPolyfill;
function curry$1(func) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
return function () {
return func.apply(this, args.concat(nativeSlice.call(arguments)));
};
}
function isArray(value) {
if (Array.isArray) {
return Array.isArray(value);
}
return objToString.call(value) === '[object Array]';
}
function isFunction(value) {
return typeof value === 'function';
}
function isString(value) {
return typeof value === 'string';
}
function isStringSafe(value) {
return objToString.call(value) === '[object String]';
}
function isNumber(value) {
return typeof value === 'number';
}
function isObject$2(value) {
var type = typeof value;
return type === 'function' || !!value && type === 'object';
}
function isBuiltInObject(value) {
return !!BUILTIN_OBJECT[objToString.call(value)];
}
function isTypedArray(value) {
return !!TYPED_ARRAY[objToString.call(value)];
}
function isDom(value) {
return typeof value === 'object' && typeof value.nodeType === 'number' && typeof value.ownerDocument === 'object';
}
function isGradientObject(value) {
return value.colorStops != null;
}
function isImagePatternObject(value) {
return value.image != null;
}
function isRegExp(value) {
return objToString.call(value) === '[object RegExp]';
}
function eqNaN(value) {
return value !== value;
}
function retrieve() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
for (var i = 0, len = args.length; i < len; i++) {
if (args[i] != null) {
return args[i];
}
}
}
function retrieve2(value0, value1) {
return value0 != null ? value0 : value1;
}
function retrieve3(value0, value1, value2) {
return value0 != null ? value0 : value1 != null ? value1 : value2;
}
function slice(arr) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
return nativeSlice.apply(arr, args);
}
function normalizeCssArray$1(val) {
if (typeof val === 'number') {
return [val, val, val, val];
}
var len = val.length;
if (len === 2) {
return [val[0], val[1], val[0], val[1]];
} else if (len === 3) {
return [val[0], val[1], val[2], val[1]];
}
return val;
}
function assert(condition, message) {
if (!condition) {
throw new Error(message);
}
}
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__';
function setAsPrimitive(obj) {
obj[primitiveKey] = true;
}
function isPrimitive(obj) {
return obj[primitiveKey];
}
var MapPolyfill = function () {
function MapPolyfill() {
this.data = {};
}
MapPolyfill.prototype["delete"] = function (key) {
var existed = this.has(key);
if (existed) {
delete this.data[key];
}
return existed;
};
MapPolyfill.prototype.has = function (key) {
return this.data.hasOwnProperty(key);
};
MapPolyfill.prototype.get = function (key) {
return this.data[key];
};
MapPolyfill.prototype.set = function (key, value) {
this.data[key] = value;
return this;
};
MapPolyfill.prototype.keys = function () {
return keys(this.data);
};
MapPolyfill.prototype.forEach = function (callback) {
var data = this.data;
for (var key in data) {
if (data.hasOwnProperty(key)) {
callback(data[key], key);
}
}
};
return MapPolyfill;
}();
var isNativeMapSupported = typeof Map === 'function';
function maybeNativeMap() {
return isNativeMapSupported ? new Map() : new MapPolyfill();
}
var HashMap = function () {
function HashMap(obj) {
var isArr = isArray(obj);
this.data = maybeNativeMap();
var thisMap = this;
obj instanceof HashMap ? obj.each(visit) : obj && each$4(obj, visit);
function visit(value, key) {
isArr ? thisMap.set(value, key) : thisMap.set(key, value);
}
}
HashMap.prototype.hasKey = function (key) {
return this.data.has(key);
};
HashMap.prototype.get = function (key) {
return this.data.get(key);
};
HashMap.prototype.set = function (key, value) {
this.data.set(key, value);
return value;
};
HashMap.prototype.each = function (cb, context) {
this.data.forEach(function (value, key) {
cb.call(context, value, key);
});
};
HashMap.prototype.keys = function () {
var keys = this.data.keys();
return isNativeMapSupported ? Array.from(keys) : keys;
};
HashMap.prototype.removeKey = function (key) {
this.data["delete"](key);
};
return HashMap;
}();
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 (var i = 0; i < b.length; i++) {
newArray[i + offset] = b[i];
}
return newArray;
}
function createObject(proto, properties) {
var obj;
if (Object.create) {
obj = Object.create(proto);
} else {
var StyleCtor = function () {};
StyleCtor.prototype = proto;
obj = new StyleCtor();
}
if (properties) {
extend(obj, properties);
}
return obj;
}
function disableUserSelect(dom) {
var domStyle = dom.style;
domStyle.webkitUserSelect = 'none';
domStyle.userSelect = 'none';
domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';
domStyle['-webkit-touch-callout'] = 'none';
}
function hasOwn(own, prop) {
return own.hasOwnProperty(prop);
}
function noop() {}
var RADIAN_TO_DEGREE = 180 / Math.PI;
var util$1 = /*#__PURE__*/Object.freeze({
__proto__: null,
HashMap: HashMap,
RADIAN_TO_DEGREE: RADIAN_TO_DEGREE,
assert: assert,
bind: bind$1,
clone: clone$3,
concatArray: concatArray,
createCanvas: createCanvas,
createHashMap: createHashMap,
createObject: createObject,
curry: curry$1,
defaults: defaults,
disableUserSelect: disableUserSelect,
each: each$4,
eqNaN: eqNaN,
extend: extend,
filter: filter,
find: find,
guid: guid,
hasOwn: hasOwn,
indexOf: indexOf,
inherits: inherits,
isArray: isArray,
isArrayLike: isArrayLike,
isBuiltInObject: isBuiltInObject,
isDom: isDom,
isFunction: isFunction,
isGradientObject: isGradientObject,
isImagePatternObject: isImagePatternObject,
isNumber: isNumber,
isObject: isObject$2,
isPrimitive: isPrimitive,
isRegExp: isRegExp,
isString: isString,
isStringSafe: isStringSafe,
isTypedArray: isTypedArray,
keys: keys,
logError: logError,
map: map$1,
merge: merge,
mergeAll: mergeAll,
mixin: mixin,
noop: noop,
normalizeCssArray: normalizeCssArray$1,
reduce: reduce,
retrieve: retrieve,
retrieve2: retrieve2,
retrieve3: retrieve3,
setAsPrimitive: setAsPrimitive,
slice: slice,
trim: trim
});
function create$1(x, y) {
if (x == null) {
x = 0;
}
if (y == null) {
y = 0;
}
return [x, y];
}
function copy$1(out, v) {
out[0] = v[0];
out[1] = v[1];
return out;
}
function clone$2(v) {
return [v[0], v[1]];
}
function set$1(out, a, b) {
out[0] = a;
out[1] = b;
return out;
}
function add(out, v1, v2) {
out[0] = v1[0] + v2[0];
out[1] = v1[1] + v2[1];
return out;
}
function scaleAndAdd(out, v1, v2, a) {
out[0] = v1[0] + v2[0] * a;
out[1] = v1[1] + v2[1] * a;
return out;
}
function sub(out, v1, v2) {
out[0] = v1[0] - v2[0];
out[1] = v1[1] - v2[1];
return out;
}
function len(v) {
return Math.sqrt(lenSquare(v));
}
var length = len;
function lenSquare(v) {
return v[0] * v[0] + v[1] * v[1];
}
var lengthSquare = lenSquare;
function mul$1(out, v1, v2) {
out[0] = v1[0] * v2[0];
out[1] = v1[1] * v2[1];
return out;
}
function div(out, v1, v2) {
out[0] = v1[0] / v2[0];
out[1] = v1[1] / v2[1];
return out;
}
function dot(v1, v2) {
return v1[0] * v2[0] + v1[1] * v2[1];
}
function scale$2(out, v, s) {
out[0] = v[0] * s;
out[1] = v[1] * s;
return out;
}
function normalize$1(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;
}
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$1 = distance;
function distanceSquare(v1, v2) {
return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);
}
var distSquare = distanceSquare;
function negate(out, v) {
out[0] = -v[0];
out[1] = -v[1];
return out;
}
function lerp$1(out, v1, v2, t) {
out[0] = v1[0] + t * (v2[0] - v1[0]);
out[1] = v1[1] + t * (v2[1] - v1[1]);
return out;
}
function applyTransform$1(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;
}
function min$1(out, v1, v2) {
out[0] = Math.min(v1[0], v2[0]);
out[1] = Math.min(v1[1], v2[1]);
return out;
}
function max$1(out, v1, v2) {
out[0] = Math.max(v1[0], v2[0]);
out[1] = Math.max(v1[1], v2[1]);
return out;
}
var vector = /*#__PURE__*/Object.freeze({
__proto__: null,
add: add,
applyTransform: applyTransform$1,
clone: clone$2,
copy: copy$1,
create: create$1,
dist: dist$1,
distSquare: distSquare,
distance: distance,
distanceSquare: distanceSquare,
div: div,
dot: dot,
len: len,
lenSquare: lenSquare,
length: length,
lengthSquare: lengthSquare,
lerp: lerp$1,
max: max$1,
min: min$1,
mul: mul$1,
negate: negate,
normalize: normalize$1,
scale: scale$2,
scaleAndAdd: scaleAndAdd,
set: set$1,
sub: sub
});
var Param = function () {
function Param(target, e) {
this.target = target;
this.topTarget = e && e.topTarget;
}
return Param;
}();
var Draggable = function () {
function Draggable(handler) {
this.handler = handler;
handler.on('mousedown', this._dragStart, this);
handler.on('mousemove', this._drag, this);
handler.on('mouseup', this._dragEnd, this);
}
Draggable.prototype._dragStart = function (e) {
var draggingTarget = e.target;
while (draggingTarget && !draggingTarget.draggable) {
draggingTarget = draggingTarget.parent || draggingTarget.__hostTarget;
}
if (draggingTarget) {
this._draggingTarget = draggingTarget;
draggingTarget.dragging = true;
this._x = e.offsetX;
this._y = e.offsetY;
this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);
}
};
Draggable.prototype._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.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);
var dropTarget = this.handler.findHover(x, y, draggingTarget).target;
var lastDropTarget = this._dropTarget;
this._dropTarget = dropTarget;
if (draggingTarget !== dropTarget) {
if (lastDropTarget && dropTarget !== lastDropTarget) {
this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);
}
if (dropTarget && dropTarget !== lastDropTarget) {
this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);
}
}
}
};
Draggable.prototype._dragEnd = function (e) {
var draggingTarget = this._draggingTarget;
if (draggingTarget) {
draggingTarget.dragging = false;
}
this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);
if (this._dropTarget) {
this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);
}
this._draggingTarget = null;
this._dropTarget = null;
};
return Draggable;
}();
var Eventful = function () {
function Eventful(eventProcessors) {
if (eventProcessors) {
this._$eventProcessor = eventProcessors;
}
}
Eventful.prototype.on = function (event, query, handler, context) {
if (!this._$handlers) {
this._$handlers = {};
}
var _h = this._$handlers;
if (typeof query === 'function') {
context = handler;
handler = query;
query = null;
}
if (!handler || !event) {
return this;
}
var eventProcessor = this._$eventProcessor;
if (query != null && eventProcessor && eventProcessor.normalizeQuery) {
query = eventProcessor.normalizeQuery(query);
}
if (!_h[event]) {
_h[event] = [];
}
for (var i = 0; i < _h[event].length; i++) {
if (_h[event][i].h === handler) {
return this;
}
}
var wrap = {
h: handler,
query: query,
ctx: context || this,
callAtLast: handler.zrEventfulCallAtLast
};
var lastIndex = _h[event].length - 1;
var lastWrap = _h[event][lastIndex];
lastWrap && lastWrap.callAtLast ? _h[event].splice(lastIndex, 0, wrap) : _h[event].push(wrap);
return this;
};
Eventful.prototype.isSilent = function (eventName) {
var _h = this._$handlers;
return !_h || !_h[eventName] || !_h[eventName].length;
};
Eventful.prototype.off = function (eventType, handler) {
var _h = this._$handlers;
if (!_h) {
return this;
}
if (!eventType) {
this._$handlers = {};
return this;
}
if (handler) {
if (_h[eventType]) {
var newList = [];
for (var i = 0, l = _h[eventType].length; i < l; i++) {
if (_h[eventType][i].h !== handler) {
newList.push(_h[eventType][i]);
}
}
_h[eventType] = newList;
}
if (_h[eventType] && _h[eventType].length === 0) {
delete _h[eventType];
}
} else {
delete _h[eventType];
}
return this;
};
Eventful.prototype.trigger = function (eventType) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
if (!this._$handlers) {
return this;
}
var _h = this._$handlers[eventType];
var eventProcessor = this._$eventProcessor;
if (_h) {
var argLen = args.length;
var len = _h.length;
for (var i = 0; i < len; i++) {
var hItem = _h[i];
if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(eventType, hItem.query)) {
continue;
}
switch (argLen) {
case 0:
hItem.h.call(hItem.ctx);
break;
case 1:
hItem.h.call(hItem.ctx, args[0]);
break;
case 2:
hItem.h.call(hItem.ctx, args[0], args[1]);
break;
default:
hItem.h.apply(hItem.ctx, args);
break;
}
}
}
eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(eventType);
return this;
};
Eventful.prototype.triggerWithContext = function (type) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
if (!this._$handlers) {
return this;
}
var _h = this._$handlers[type];
var eventProcessor = this._$eventProcessor;
if (_h) {
var argLen = args.length;
var ctx = args[argLen - 1];
var len = _h.length;
for (var i = 0; i < len; i++) {
var hItem = _h[i];
if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) {
continue;
}
switch (argLen) {
case 0:
hItem.h.call(ctx);
break;
case 1:
hItem.h.call(ctx, args[0]);
break;
case 2:
hItem.h.call(ctx, args[0], args[1]);
break;
default:
hItem.h.apply(ctx, args.slice(1, argLen - 1));
break;
}
}
}
eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type);
return this;
};
return Eventful;
}();
var LN2 = Math.log(2);
function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {
var cacheKey = rowMask + '-' + colMask;
var fullRank = rows.length;
if (detCache.hasOwnProperty(cacheKey)) {
return detCache[cacheKey];
}
if (rank === 1) {
var colStart = Math.round(Math.log((1 << fullRank) - 1 & ~colMask) / LN2);
return rows[rowStart][colStart];
}
var subRowMask = rowMask | 1 << rowStart;
var subRowStart = rowStart + 1;
while (rowMask & 1 << subRowStart) {
subRowStart++;
}
var sum = 0;
for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {
var colTag = 1 << j;
if (!(colTag & colMask)) {
sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j] * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);
colLocalIdx++;
}
}
detCache[cacheKey] = sum;
return sum;
}
function buildTransformer(src, dest) {
var mA = [[src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]], [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]], [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]], [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]], [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]], [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]], [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]], [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]];
var detCache = {};
var det = determinant(mA, 8, 0, 0, 0, detCache);
if (det === 0) {
return;
}
var vh = [];
for (var i = 0; i < 8; i++) {
for (var j = 0; j < 8; j++) {
vh[j] == null && (vh[j] = 0);
vh[j] += ((i + j) % 2 ? -1 : 1) * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache) / det * dest[i];
}
}
return function (out, srcPointX, srcPointY) {
var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;
out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;
out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;
};
}
var EVENT_SAVED_PROP = '___zrEVENTSAVED';
var _calcOut$1 = [];
function transformLocalCoord(out, elFrom, elTarget, inX, inY) {
return transformCoordWithViewport(_calcOut$1, elFrom, inX, inY, true) && transformCoordWithViewport(out, elTarget, _calcOut$1[0], _calcOut$1[1]);
}
function transformCoordWithViewport(out, el, inX, inY, inverse) {
if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {
var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});
var markers = prepareCoordMarkers(el, saved);
var transformer = preparePointerTransformer(markers, saved, inverse);
if (transformer) {
transformer(out, inX, inY);
return true;
}
}
return false;
}
function prepareCoordMarkers(el, saved) {
var markers = saved.markers;
if (markers) {
return markers;
}
markers = saved.markers = [];
var propLR = ['left', 'right'];
var propTB = ['top', 'bottom'];
for (var i = 0; i < 4; i++) {
var marker = document.createElement('div');
var stl = marker.style;
var idxLR = i % 2;
var idxTB = (i >> 1) % 2;
stl.cssText = ['position: absolute', 'visibility: hidden', 'padding: 0', 'margin: 0', 'border-width: 0', 'user-select: none', 'width:0', 'height:0', propLR[idxLR] + ':0', propTB[idxTB] + ':0', propLR[1 - idxLR] + ':auto', propTB[1 - idxTB] + ':auto', ''].join('!important;');
el.appendChild(marker);
markers.push(marker);
}
return markers;
}
function preparePointerTransformer(markers, saved, inverse) {
var transformerName = inverse ? 'invTrans' : 'trans';
var transformer = saved[transformerName];
var oldSrcCoords = saved.srcCoords;
var srcCoords = [];
var destCoords = [];
var oldCoordTheSame = true;
for (var i = 0; i < 4; i++) {
var rect = markers[i].getBoundingClientRect();
var ii = 2 * i;
var x = rect.left;
var y = rect.top;
srcCoords.push(x, y);
oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];
destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);
}
return oldCoordTheSame && transformer ? transformer : (saved.srcCoords = srcCoords, saved[transformerName] = inverse ? buildTransformer(destCoords, srcCoords) : buildTransformer(srcCoords, destCoords));
}
function isCanvasEl(el) {
return el.nodeName.toUpperCase() === 'CANVAS';
}
var replaceReg = /([&<>"'])/g;
var replaceMap = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
'\'': '''
};
function encodeHTML(source) {
return source == null ? '' : (source + '').replace(replaceReg, function (str, c) {
return replaceMap[c];
});
}
var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
var _calcOut = [];
var firefoxNotSupportOffsetXY = env.browser.firefox && +env.browser.version.split('.')[0] < 39;
function clientToLocal(el, e, out, calculate) {
out = out || {};
if (calculate) {
calculateZrXY(el, e, out);
} else if (firefoxNotSupportOffsetXY && e.layerX != null && e.layerX !== e.offsetX) {
out.zrX = e.layerX;
out.zrY = e.layerY;
} else if (e.offsetX != null) {
out.zrX = e.offsetX;
out.zrY = e.offsetY;
} else {
calculateZrXY(el, e, out);
}
return out;
}
function calculateZrXY(el, e, out) {
if (env.domSupported && el.getBoundingClientRect) {
var ex = e.clientX;
var ey = e.clientY;
if (isCanvasEl(el)) {
var box = el.getBoundingClientRect();
out.zrX = ex - box.left;
out.zrY = ey - box.top;
return;
} else {
if (transformCoordWithViewport(_calcOut, el, ex, ey)) {
out.zrX = _calcOut[0];
out.zrY = _calcOut[1];
return;
}
}
}
out.zrX = out.zrY = 0;
}
function getNativeEvent(e) {
return e || window.event;
}
function normalizeEvent(el, e, calculate) {
e = getNativeEvent(e);
if (e.zrX != null) {
return e;
}
var eventType = e.type;
var isTouch = eventType && eventType.indexOf('touch') >= 0;
if (!isTouch) {
clientToLocal(el, e, e, calculate);
var wheelDelta = getWheelDeltaMayPolyfill(e);
e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;
} else {
var touch = eventType !== 'touchend' ? e.targetTouches[0] : e.changedTouches[0];
touch && clientToLocal(el, touch, e, calculate);
}
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;
}
function getWheelDeltaMayPolyfill(e) {
var rawWheelDelta = e.wheelDelta;
if (rawWheelDelta) {
return rawWheelDelta;
}
var deltaX = e.deltaX;
var deltaY = e.deltaY;
if (deltaX == null || deltaY == null) {
return rawWheelDelta;
}
var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);
var sign = deltaY > 0 ? -1 : deltaY < 0 ? 1 : deltaX > 0 ? -1 : 1;
return 3 * delta * sign;
}
function addEventListener(el, name, handler, opt) {
el.addEventListener(name, handler, opt);
}
function removeEventListener(el, name, handler, opt) {
el.removeEventListener(name, handler, opt);
}
var stop = function (e) {
e.preventDefault();
e.stopPropagation();
e.cancelBubble = true;
};
var GestureMgr = function () {
function GestureMgr() {
this._track = [];
}
GestureMgr.prototype.recognize = function (event, target, root) {
this._doTrack(event, target, root);
return this._recognize(event);
};
GestureMgr.prototype.clear = function () {
this._track.length = 0;
return this;
};
GestureMgr.prototype._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);
};
GestureMgr.prototype._recognize = function (event) {
for (var eventName in recognizers) {
if (recognizers.hasOwnProperty(eventName)) {
var gestureInfo = recognizers[eventName](this._track, event);
if (gestureInfo) {
return gestureInfo;
}
}
}
};
return GestureMgr;
}();
function dist(pointPair) {
var dx = pointPair[1][0] - pointPair[0][0];
var dy = pointPair[1][1] - pointPair[0][1];
return Math.sqrt(dx * dx + dy * dy);
}
function center(pointPair) {
return [(pointPair[0][0] + pointPair[1][0]) / 2, (pointPair[0][1] + pointPair[1][1]) / 2];
}
var recognizers = {
pinch: function (tracks, event) {
var trackLen = tracks.length;
if (!trackLen) {
return;
}
var pinchEnd = (tracks[trackLen - 1] || {}).points;
var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;
if (pinchPre && pinchPre.length > 1 && pinchEnd && pinchEnd.length > 1) {
var pinchScale = dist(pinchEnd) / dist(pinchPre);
!isFinite(pinchScale) && (pinchScale = 1);
event.pinchScale = pinchScale;
var pinchCenter = center(pinchEnd);
event.pinchX = pinchCenter[0];
event.pinchY = pinchCenter[1];
return {
type: 'pinch',
target: tracks[0].target,
event: event
};
}
}
};
function create() {
return [1, 0, 0, 1, 0, 0];
}
function identity(out) {
out[0] = 1;
out[1] = 0;
out[2] = 0;
out[3] = 1;
out[4] = 0;
out[5] = 0;
return out;
}
function copy(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;
}
function mul(out, m1, m2) {
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;
}
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;
}
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;
}
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;
}
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;
}
function clone$1(a) {
var b = create();
copy(b, a);
return b;
}
var matrix = /*#__PURE__*/Object.freeze({
__proto__: null,
clone: clone$1,
copy: copy,
create: create,
identity: identity,
invert: invert,
mul: mul,
rotate: rotate,
scale: scale$1,
translate: translate
});
var Point = function () {
function Point(x, y) {
this.x = x || 0;
this.y = y || 0;
}
Point.prototype.copy = function (other) {
this.x = other.x;
this.y = other.y;
return this;
};
Point.prototype.clone = function () {
return new Point(this.x, this.y);
};
Point.prototype.set = function (x, y) {
this.x = x;
this.y = y;
return this;
};
Point.prototype.equal = function (other) {
return other.x === this.x && other.y === this.y;
};
Point.prototype.add = function (other) {
this.x += other.x;
this.y += other.y;
return this;
};
Point.prototype.scale = function (scalar) {
this.x *= scalar;
this.y *= scalar;
};
Point.prototype.scaleAndAdd = function (other, scalar) {
this.x += other.x * scalar;
this.y += other.y * scalar;
};
Point.prototype.sub = function (other) {
this.x -= other.x;
this.y -= other.y;
return this;
};
Point.prototype.dot = function (other) {
return this.x * other.x + this.y * other.y;
};
Point.prototype.len = function () {
return Math.sqrt(this.x * this.x + this.y * this.y);
};
Point.prototype.lenSquare = function () {
return this.x * this.x + this.y * this.y;
};
Point.prototype.normalize = function () {
var len = this.len();
this.x /= len;
this.y /= len;
return this;
};
Point.prototype.distance = function (other) {
var dx = this.x - other.x;
var dy = this.y - other.y;
return Math.sqrt(dx * dx + dy * dy);
};
Point.prototype.distanceSquare = function (other) {
var dx = this.x - other.x;
var dy = this.y - other.y;
return dx * dx + dy * dy;
};
Point.prototype.negate = function () {
this.x = -this.x;
this.y = -this.y;
return this;
};
Point.prototype.transform = function (m) {
if (!m) {
return;
}
var x = this.x;
var y = this.y;
this.x = m[0] * x + m[2] * y + m[4];
this.y = m[1] * x + m[3] * y + m[5];
return this;
};
Point.prototype.toArray = function (out) {
out[0] = this.x;
out[1] = this.y;
return out;
};
Point.prototype.fromArray = function (input) {
this.x = input[0];
this.y = input[1];
};
Point.set = function (p, x, y) {
p.x = x;
p.y = y;
};
Point.copy = function (p, p2) {
p.x = p2.x;
p.y = p2.y;
};
Point.len = function (p) {
return Math.sqrt(p.x * p.x + p.y * p.y);
};
Point.lenSquare = function (p) {
return p.x * p.x + p.y * p.y;
};
Point.dot = function (p0, p1) {
return p0.x * p1.x + p0.y * p1.y;
};
Point.add = function (out, p0, p1) {
out.x = p0.x + p1.x;
out.y = p0.y + p1.y;
};
Point.sub = function (out, p0, p1) {
out.x = p0.x - p1.x;
out.y = p0.y - p1.y;
};
Point.scale = function (out, p0, scalar) {
out.x = p0.x * scalar;
out.y = p0.y * scalar;
};
Point.scaleAndAdd = function (out, p0, p1, scalar) {
out.x = p0.x + p1.x * scalar;
out.y = p0.y + p1.y * scalar;
};
Point.lerp = function (out, p0, p1, t) {
var onet = 1 - t;
out.x = onet * p0.x + t * p1.x;
out.y = onet * p0.y + t * p1.y;
};
return Point;
}();
var mathMin$6 = Math.min;
var mathMax$6 = Math.max;
var lt = new Point();
var rb = new Point();
var lb = new Point();
var rt = new Point();
var minTv$1 = new Point();
var maxTv$1 = new Point();
var BoundingRect = function () {
function BoundingRect(x, y, width, height) {
if (width < 0) {
x = x + width;
width = -width;
}
if (height < 0) {
y = y + height;
height = -height;
}
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
BoundingRect.prototype.union = function (other) {
var x = mathMin$6(other.x, this.x);
var y = mathMin$6(other.y, this.y);
if (isFinite(this.x) && isFinite(this.width)) {
this.width = mathMax$6(other.x + other.width, this.x + this.width) - x;
} else {
this.width = other.width;
}
if (isFinite(this.y) && isFinite(this.height)) {
this.height = mathMax$6(other.y + other.height, this.y + this.height) - y;
} else {
this.height = other.height;
}
this.x = x;
this.y = y;
};
BoundingRect.prototype.applyTransform = function (m) {
BoundingRect.applyTransform(this, this, m);
};
BoundingRect.prototype.calculateTransform = function (b) {
var a = this;
var sx = b.width / a.width;
var sy = b.height / a.height;
var m = create();
translate(m, m, [-a.x, -a.y]);
scale$1(m, m, [sx, sy]);
translate(m, m, [b.x, b.y]);
return m;
};
BoundingRect.prototype.intersect = function (b, mtv) {
if (!b) {
return false;
}
if (!(b instanceof BoundingRect)) {
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;
var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);
if (mtv) {
var dMin = Infinity;
var dMax = 0;
var d0 = Math.abs(ax1 - bx0);
var d1 = Math.abs(bx1 - ax0);
var d2 = Math.abs(ay1 - by0);
var d3 = Math.abs(by1 - ay0);
var dx = Math.min(d0, d1);
var dy = Math.min(d2, d3);
if (ax1 < bx0 || bx1 < ax0) {
if (dx > dMax) {
dMax = dx;
if (d0 < d1) {
Point.set(maxTv$1, -d0, 0);
} else {
Point.set(maxTv$1, d1, 0);
}
}
} else {
if (dx < dMin) {
dMin = dx;
if (d0 < d1) {
Point.set(minTv$1, d0, 0);
} else {
Point.set(minTv$1, -d1, 0);
}
}
}
if (ay1 < by0 || by1 < ay0) {
if (dy > dMax) {
dMax = dy;
if (d2 < d3) {
Point.set(maxTv$1, 0, -d2);
} else {
Point.set(maxTv$1, 0, d3);
}
}
} else {
if (dx < dMin) {
dMin = dx;
if (d2 < d3) {
Point.set(minTv$1, 0, d2);
} else {
Point.set(minTv$1, 0, -d3);
}
}
}
}
if (mtv) {
Point.copy(mtv, overlap ? minTv$1 : maxTv$1);
}
return overlap;
};
BoundingRect.prototype.contain = function (x, y) {
var rect = this;
return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;
};
BoundingRect.prototype.clone = function () {
return new BoundingRect(this.x, this.y, this.width, this.height);
};
BoundingRect.prototype.copy = function (other) {
BoundingRect.copy(this, other);
};
BoundingRect.prototype.plain = function () {
return {
x: this.x,
y: this.y,
width: this.width,
height: this.height
};
};
BoundingRect.prototype.isFinite = function () {
return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height);
};
BoundingRect.prototype.isZero = function () {
return this.width === 0 || this.height === 0;
};
BoundingRect.create = function (rect) {
return new BoundingRect(rect.x, rect.y, rect.width, rect.height);
};
BoundingRect.copy = function (target, source) {
target.x = source.x;
target.y = source.y;
target.width = source.width;
target.height = source.height;
};
BoundingRect.applyTransform = function (target, source, m) {
if (!m) {
if (target !== source) {
BoundingRect.copy(target, source);
}
return;
}
if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {
var sx = m[0];
var sy = m[3];
var tx = m[4];
var ty = m[5];
target.x = source.x * sx + tx;
target.y = source.y * sy + ty;
target.width = source.width * sx;
target.height = source.height * sy;
if (target.width < 0) {
target.x += target.width;
target.width = -target.width;
}
if (target.height < 0) {
target.y += target.height;
target.height = -target.height;
}
return;
}
lt.x = lb.x = source.x;
lt.y = rt.y = source.y;
rb.x = rt.x = source.x + source.width;
rb.y = lb.y = source.y + source.height;
lt.transform(m);
rt.transform(m);
rb.transform(m);
lb.transform(m);
target.x = mathMin$6(lt.x, rb.x, lb.x, rt.x);
target.y = mathMin$6(lt.y, rb.y, lb.y, rt.y);
var maxX = mathMax$6(lt.x, rb.x, lb.x, rt.x);
var maxY = mathMax$6(lt.y, rb.y, lb.y, rt.y);
target.width = maxX - target.x;
target.height = maxY - target.y;
};
return BoundingRect;
}();
var SILENT = 'silent';
function makeEventPacket(eveType, targetInfo, event) {
return {
type: eveType,
event: event,
target: targetInfo.target,
topTarget: targetInfo.topTarget,
cancelBubble: false,
offsetX: event.zrX,
offsetY: event.zrY,
gestureEvent: event.gestureEvent,
pinchX: event.pinchX,
pinchY: event.pinchY,
pinchScale: event.pinchScale,
wheelDelta: event.zrDelta,
zrByTouch: event.zrByTouch,
which: event.which,
stop: stopEvent
};
}
function stopEvent() {
stop(this.event);
}
var EmptyProxy = function (_super) {
__extends(EmptyProxy, _super);
function EmptyProxy() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.handler = null;
return _this;
}
EmptyProxy.prototype.dispose = function () {};
EmptyProxy.prototype.setCursor = function () {};
return EmptyProxy;
}(Eventful);
var HoveredResult = function () {
function HoveredResult(x, y) {
this.x = x;
this.y = y;
}
return HoveredResult;
}();
var handlerNames = ['click', 'dblclick', 'mousewheel', 'mouseout', 'mouseup', 'mousedown', 'mousemove', 'contextmenu'];
var tmpRect$1 = new BoundingRect(0, 0, 0, 0);
var Handler = function (_super) {
__extends(Handler, _super);
function Handler(storage, painter, proxy, painterRoot, pointerSize) {
var _this = _super.call(this) || this;
_this._hovered = new HoveredResult(0, 0);
_this.storage = storage;
_this.painter = painter;
_this.painterRoot = painterRoot;
_this._pointerSize = pointerSize;
proxy = proxy || new EmptyProxy();
_this.proxy = null;
_this.setHandlerProxy(proxy);
_this._draggingMgr = new Draggable(_this);
return _this;
}
Handler.prototype.setHandlerProxy = function (proxy) {
if (this.proxy) {
this.proxy.dispose();
}
if (proxy) {
each$4(handlerNames, function (name) {
proxy.on && proxy.on(name, this[name], this);
}, this);
proxy.handler = this;
}
this.proxy = proxy;
};
Handler.prototype.mousemove = function (event) {
var x = event.zrX;
var y = event.zrY;
var isOutside = isOutsideBoundary(this, x, y);
var lastHovered = this._hovered;
var lastHoveredTarget = lastHovered.target;
if (lastHoveredTarget && !lastHoveredTarget.__zr) {
lastHovered = this.findHover(lastHovered.x, lastHovered.y);
lastHoveredTarget = lastHovered.target;
}
var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);
var hoveredTarget = hovered.target;
var proxy = this.proxy;
proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');
if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {
this.dispatchToElement(lastHovered, 'mouseout', event);
}
this.dispatchToElement(hovered, 'mousemove', event);
if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {
this.dispatchToElement(hovered, 'mouseover', event);
}
};
Handler.prototype.mouseout = function (event) {
var eventControl = event.zrEventControl;
if (eventControl !== 'only_globalout') {
this.dispatchToElement(this._hovered, 'mouseout', event);
}
if (eventControl !== 'no_globalout') {
this.trigger('globalout', {
type: 'globalout',
event: event
});
}
};
Handler.prototype.resize = function () {
this._hovered = new HoveredResult(0, 0);
};
Handler.prototype.dispatch = function (eventName, eventArgs) {
var handler = this[eventName];
handler && handler.call(this, eventArgs);
};
Handler.prototype.dispose = function () {
this.proxy.dispose();
this.storage = null;
this.proxy = null;
this.painter = null;
};
Handler.prototype.setCursorStyle = function (cursorStyle) {
var proxy = this.proxy;
proxy.setCursor && proxy.setCursor(cursorStyle);
};
Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {
targetInfo = targetInfo || {};
var el = targetInfo.target;
if (el && el.silent) {
return;
}
var eventKey = 'on' + eventName;
var eventPacket = makeEventPacket(eventName, targetInfo, event);
while (el) {
el[eventKey] && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));
el.trigger(eventName, eventPacket);
el = el.__hostTarget ? el.__hostTarget : el.parent;
if (eventPacket.cancelBubble) {
break;
}
}
if (!eventPacket.cancelBubble) {
this.trigger(eventName, eventPacket);
if (this.painter && this.painter.eachOtherLayer) {
this.painter.eachOtherLayer(function (layer) {
if (typeof layer[eventKey] === 'function') {
layer[eventKey].call(layer, eventPacket);
}
if (layer.trigger) {
layer.trigger(eventName, eventPacket);
}
});
}
}
};
Handler.prototype.findHover = function (x, y, exclude) {
var list = this.storage.getDisplayList();
var out = new HoveredResult(x, y);
setHoverTarget(list, out, x, y, exclude);
if (this._pointerSize && !out.target) {
var candidates = [];
var pointerSize = this._pointerSize;
var targetSizeHalf = pointerSize / 2;
var pointerRect = new BoundingRect(x - targetSizeHalf, y - targetSizeHalf, pointerSize, pointerSize);
for (var i = list.length - 1; i >= 0; i--) {
var el = list[i];
if (el !== exclude && !el.ignore && !el.ignoreCoarsePointer && (!el.parent || !el.parent.ignoreCoarsePointer)) {
tmpRect$1.copy(el.getBoundingRect());
if (el.transform) {
tmpRect$1.applyTransform(el.transform);
}
if (tmpRect$1.intersect(pointerRect)) {
candidates.push(el);
}
}
}
if (candidates.length) {
var rStep = 4;
var thetaStep = Math.PI / 12;
var PI2 = Math.PI * 2;
for (var r = 0; r < targetSizeHalf; r += rStep) {
for (var theta = 0; theta < PI2; theta += thetaStep) {
var x1 = x + r * Math.cos(theta);
var y1 = y + r * Math.sin(theta);
setHoverTarget(candidates, out, x1, y1, exclude);
if (out.target) {
return out;
}
}
}
}
}
return out;
};
Handler.prototype.processGesture = function (event, stage) {
if (!this._gestureMgr) {
this._gestureMgr = new GestureMgr();
}
var gestureMgr = this._gestureMgr;
stage === 'start' && gestureMgr.clear();
var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);
stage === 'end' && gestureMgr.clear();
if (gestureInfo) {
var type = gestureInfo.type;
event.gestureEvent = type;
var res = new HoveredResult();
res.target = gestureInfo.target;
this.dispatchToElement(res, type, gestureInfo.event);
}
};
return Handler;
}(Eventful);
each$4(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {
Handler.prototype[name] = function (event) {
var x = event.zrX;
var y = event.zrY;
var isOutside = isOutsideBoundary(this, x, y);
var hovered;
var hoveredTarget;
if (name !== 'mouseup' || !isOutside) {
hovered = this.findHover(x, y);
hoveredTarget = hovered.target;
}
if (name === 'mousedown') {
this._downEl = hoveredTarget;
this._downPoint = [event.zrX, event.zrY];
this._upEl = hoveredTarget;
} else if (name === 'mouseup') {
this._upEl = hoveredTarget;
} else if (name === 'click') {
if (this._downEl !== this._upEl || !this._downPoint || dist$1(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 = void 0;
var ignoreClip = false;
while (el) {
if (el.ignoreClip) {
ignoreClip = true;
}
if (!ignoreClip) {
var clipPath = el.getClipPath();
if (clipPath && !clipPath.contain(x, y)) {
return false;
}
if (el.silent) {
isSilent = true;
}
}
var hostEl = el.__hostTarget;
el = hostEl ? hostEl : el.parent;
}
return isSilent ? SILENT : true;
}
return false;
}
function setHoverTarget(list, out, x, y, exclude) {
for (var i = list.length - 1; i >= 0; i--) {
var el = list[i];
var hoverCheckResult = void 0;
if (el !== exclude && !el.ignore && (hoverCheckResult = isHover(el, x, y))) {
!out.topTarget && (out.topTarget = el);
if (hoverCheckResult !== SILENT) {
out.target = el;
break;
}
}
}
}
function isOutsideBoundary(handlerInstance, x, y) {
var painter = handlerInstance.painter;
return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();
}
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;
array.length;
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;
var count2;
var 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();
} 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();
} else {
customCursor = dest - (length2 - 1);
for (i = 0; i < length2; i++) {
array[customCursor + i] = tmp[i];
}
}
}
return {
mergeRuns: mergeRuns,
forceMergeRuns: forceMergeRuns,
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 = 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();
}
var REDRAW_BIT = 1;
var STYLE_CHANGED_BIT = 2;
var SHAPE_CHANGED_BIT = 4;
var invalidZErrorLogged = false;
function logInvalidZError() {
if (invalidZErrorLogged) {
return;
}
invalidZErrorLogged = true;
console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');
}
function shapeCompareFunc(a, b) {
if (a.zlevel === b.zlevel) {
if (a.z === b.z) {
return a.z2 - b.z2;
}
return a.z - b.z;
}
return a.zlevel - b.zlevel;
}
var Storage = function () {
function Storage() {
this._roots = [];
this._displayList = [];
this._displayListLen = 0;
this.displayableSortFunc = shapeCompareFunc;
}
Storage.prototype.traverse = function (cb, context) {
for (var i = 0; i < this._roots.length; i++) {
this._roots[i].traverse(cb, context);
}
};
Storage.prototype.getDisplayList = function (update, includeIgnore) {
includeIgnore = includeIgnore || false;
var displayList = this._displayList;
if (update || !displayList.length) {
this.updateDisplayList(includeIgnore);
}
return displayList;
};
Storage.prototype.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;
sort(displayList, shapeCompareFunc);
};
Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {
if (el.ignore && !includeIgnore) {
return;
}
el.beforeUpdate();
el.update();
el.afterUpdate();
var userSetClipPath = el.getClipPath();
if (el.ignoreClip) {
clipPaths = null;
} else if (userSetClipPath) {
if (clipPaths) {
clipPaths = clipPaths.slice();
} else {
clipPaths = [];
}
var currentClipPath = userSetClipPath;
var parentClipPath = el;
while (currentClipPath) {
currentClipPath.parent = parentClipPath;
currentClipPath.updateTransform();
clipPaths.push(currentClipPath);
parentClipPath = currentClipPath;
currentClipPath = currentClipPath.getClipPath();
}
}
if (el.childrenRef) {
var children = el.childrenRef();
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (el.__dirty) {
child.__dirty |= REDRAW_BIT;
}
this._updateAndAddDisplayable(child, clipPaths, includeIgnore);
}
el.__dirty = 0;
} else {
var disp = el;
if (clipPaths && clipPaths.length) {
disp.__clipPaths = clipPaths;
} else if (disp.__clipPaths && disp.__clipPaths.length > 0) {
disp.__clipPaths = [];
}
if (isNaN(disp.z)) {
logInvalidZError();
disp.z = 0;
}
if (isNaN(disp.z2)) {
logInvalidZError();
disp.z2 = 0;
}
if (isNaN(disp.zlevel)) {
logInvalidZError();
disp.zlevel = 0;
}
this._displayList[this._displayListLen++] = disp;
}
var decalEl = el.getDecalElement && el.getDecalElement();
if (decalEl) {
this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);
}
var textGuide = el.getTextGuideLine();
if (textGuide) {
this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);
}
var textEl = el.getTextContent();
if (textEl) {
this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);
}
};
Storage.prototype.addRoot = function (el) {
if (el.__zr && el.__zr.storage === this) {
return;
}
this._roots.push(el);
};
Storage.prototype.delRoot = function (el) {
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._roots.splice(idx, 1);
}
};
Storage.prototype.delAllRoots = function () {
this._roots = [];
this._displayList = [];
this._displayListLen = 0;
return;
};
Storage.prototype.getRoots = function () {
return this._roots;
};
Storage.prototype.dispose = function () {
this._displayList = null;
this._roots = null;
};
return Storage;
}();
var requestAnimationFrame;
requestAnimationFrame = env.hasGlobalWindow && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function (func) {
return setTimeout(func, 16);
};
var requestAnimationFrame$1 = requestAnimationFrame;
var easingFuncs = {
linear: function (k) {
return k;
},
quadraticIn: function (k) {
return k * k;
},
quadraticOut: function (k) {
return k * (2 - k);
},
quadraticInOut: function (k) {
if ((k *= 2) < 1) {
return 0.5 * k * k;
}
return -0.5 * (--k * (k - 2) - 1);
},
cubicIn: function (k) {
return k * k * k;
},
cubicOut: function (k) {
return --k * k * k + 1;
},
cubicInOut: function (k) {
if ((k *= 2) < 1) {
return 0.5 * k * k * k;
}
return 0.5 * ((k -= 2) * k * k + 2);
},
quarticIn: function (k) {
return k * k * k * k;
},
quarticOut: function (k) {
return 1 - --k * k * k * k;
},
quarticInOut: function (k) {
if ((k *= 2) < 1) {
return 0.5 * k * k * k * k;
}
return -0.5 * ((k -= 2) * k * k * k - 2);
},
quinticIn: function (k) {
return k * k * k * k * k;
},
quinticOut: function (k) {
return --k * k * k * k * k + 1;
},
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);
},
sinusoidalIn: function (k) {
return 1 - Math.cos(k * Math.PI / 2);
},
sinusoidalOut: function (k) {
return Math.sin(k * Math.PI / 2);
},
sinusoidalInOut: function (k) {
return 0.5 * (1 - Math.cos(Math.PI * k));
},
exponentialIn: function (k) {
return k === 0 ? 0 : Math.pow(1024, k - 1);
},
exponentialOut: function (k) {
return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
},
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);
},
circularIn: function (k) {
return 1 - Math.sqrt(1 - k * k);
},
circularOut: function (k) {
return Math.sqrt(1 - --k * k);
},
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);
},
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));
},
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;
},
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;
},
backIn: function (k) {
var s = 1.70158;
return k * k * ((s + 1) * k - s);
},
backOut: function (k) {
var s = 1.70158;
return --k * k * ((s + 1) * k + s) + 1;
},
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);
},
bounceIn: function (k) {
return 1 - easingFuncs.bounceOut(1 - k);
},
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;
}
},
bounceInOut: function (k) {
if (k < 0.5) {
return easingFuncs.bounceIn(k * 2) * 0.5;
}
return easingFuncs.bounceOut(k * 2 - 1) * 0.5 + 0.5;
}
};
var mathPow$1 = Math.pow;
var mathSqrt$3 = Math.sqrt;
var EPSILON$3 = 1e-8;
var EPSILON_NUMERIC = 1e-4;
var THREE_SQRT = mathSqrt$3(3);
var ONE_THIRD = 1 / 3;
var _v0 = create$1();
var _v1 = create$1();
var _v2 = create$1();
function isAroundZero(val) {
return val > -EPSILON$3 && val < EPSILON$3;
}
function isNotAroundZero$1(val) {
return val > EPSILON$3 || val < -EPSILON$3;
}
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);
}
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);
}
function cubicRootAt(p0, p1, p2, p3, val, roots) {
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;
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;
var t2 = -K / 2;
if (t1 >= 0 && t1 <= 1) {
roots[n++] = t1;
}
if (t2 >= 0 && t2 <= 1) {
roots[n++] = t2;
}
} else if (disc > 0) {
var discSqrt = mathSqrt$3(disc);
var Y1 = A * b + 1.5 * a * (-B + discSqrt);
var Y2 = A * b + 1.5 * a * (-B - discSqrt);
if (Y1 < 0) {
Y1 = -mathPow$1(-Y1, ONE_THIRD);
} else {
Y1 = mathPow$1(Y1, ONE_THIRD);
}
if (Y2 < 0) {
Y2 = -mathPow$1(-Y2, ONE_THIRD);
} else {
Y2 = mathPow$1(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$3(A * A * A));
var theta = Math.acos(T) / 3;
var ASqrt = mathSqrt$3(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;
}
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$3(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;
}
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;
out[0] = p0;
out[1] = p01;
out[2] = p012;
out[3] = p0123;
out[4] = p0123;
out[5] = p123;
out[6] = p23;
out[7] = p3;
}
function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {
var t;
var interval = 0.005;
var d = Infinity;
var prev;
var next;
var d1;
var d2;
_v0[0] = x;
_v0[1] = y;
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;
for (var i = 0; i < 32; i++) {
if (interval < EPSILON_NUMERIC) {
break;
}
prev = t - interval;
next = 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 {
_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;
}
}
}
if (out) {
out[0] = cubicAt(x0, x1, x2, x3, t);
out[1] = cubicAt(y0, y1, y2, y3, t);
}
return mathSqrt$3(d);
}
function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {
var px = x0;
var py = y0;
var d = 0;
var step = 1 / iteration;
for (var i = 1; i <= iteration; i++) {
var t = i * step;
var x = cubicAt(x0, x1, x2, x3, t);
var y = cubicAt(y0, y1, y2, y3, t);
var dx = x - px;
var dy = y - py;
d += Math.sqrt(dx * dx + dy * dy);
px = x;
py = y;
}
return d;
}
function quadraticAt(p0, p1, p2, t) {
var onet = 1 - t;
return onet * (onet * p0 + 2 * t * p1) + t * t * p2;
}
function quadraticDerivativeAt(p0, p1, p2, t) {
return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));
}
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$3(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;
}
function quadraticExtremum(p0, p1, p2) {
var divider = p0 + p2 - 2 * p1;
if (divider === 0) {
return 0.5;
} else {
return (p0 - p1) / divider;
}
}
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;
out[0] = p0;
out[1] = p01;
out[2] = p012;
out[3] = p012;
out[4] = p12;
out[5] = p2;
}
function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {
var t;
var interval = 0.005;
var d = Infinity;
_v0[0] = x;
_v0[1] = y;
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;
for (var i = 0; i < 32; i++) {
if (interval < EPSILON_NUMERIC) {
break;
}
var prev = t - interval;
var next = 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 {
_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;
}
}
}
if (out) {
out[0] = quadraticAt(x0, x1, x2, t);
out[1] = quadraticAt(y0, y1, y2, t);
}
return mathSqrt$3(d);
}
function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {
var px = x0;
var py = y0;
var d = 0;
var step = 1 / iteration;
for (var i = 1; i <= iteration; i++) {
var t = i * step;
var x = quadraticAt(x0, x1, x2, t);
var y = quadraticAt(y0, y1, y2, t);
var dx = x - px;
var dy = y - py;
d += Math.sqrt(dx * dx + dy * dy);
px = x;
py = y;
}
return d;
}
var regexp = /cubic-bezier\(([0-9,\.e ]+)\)/;
function createCubicEasingFunc(cubicEasingStr) {
var cubic = cubicEasingStr && regexp.exec(cubicEasingStr);
if (cubic) {
var points = cubic[1].split(',');
var a_1 = +trim(points[0]);
var b_1 = +trim(points[1]);
var c_1 = +trim(points[2]);
var d_1 = +trim(points[3]);
if (isNaN(a_1 + b_1 + c_1 + d_1)) {
return;
}
var roots_1 = [];
return function (p) {
return p <= 0 ? 0 : p >= 1 ? 1 : cubicRootAt(0, a_1, c_1, 1, p, roots_1) && cubicAt(0, b_1, d_1, 1, roots_1[0]);
};
}
}
var Clip = function () {
function Clip(opts) {
this._inited = false;
this._startTime = 0;
this._pausedTime = 0;
this._paused = false;
this._life = opts.life || 1000;
this._delay = opts.delay || 0;
this.loop = opts.loop || false;
this.onframe = opts.onframe || noop;
this.ondestroy = opts.ondestroy || noop;
this.onrestart = opts.onrestart || noop;
opts.easing && this.setEasing(opts.easing);
}
Clip.prototype.step = function (globalTime, deltaTime) {
if (!this._inited) {
this._startTime = globalTime + this._delay;
this._inited = true;
}
if (this._paused) {
this._pausedTime += deltaTime;
return;
}
var life = this._life;
var elapsedTime = globalTime - this._startTime - this._pausedTime;
var percent = elapsedTime / life;
if (percent < 0) {
percent = 0;
}
percent = Math.min(percent, 1);
var easingFunc = this.easingFunc;
var schedule = easingFunc ? easingFunc(percent) : percent;
this.onframe(schedule);
if (percent === 1) {
if (this.loop) {
var remainder = elapsedTime % life;
this._startTime = globalTime - remainder;
this._pausedTime = 0;
this.onrestart();
} else {
return true;
}
}
return false;
};
Clip.prototype.pause = function () {
this._paused = true;
};
Clip.prototype.resume = function () {
this._paused = false;
};
Clip.prototype.setEasing = function (easing) {
this.easing = easing;
this.easingFunc = isFunction(easing) ? easing : easingFuncs[easing] || createCubicEasingFunc(easing);
};
return Clip;
}();
var Entry = function () {
function Entry(val) {
this.value = val;
}
return Entry;
}();
var LinkedList = function () {
function LinkedList() {
this._len = 0;
}
LinkedList.prototype.insert = function (val) {
var entry = new Entry(val);
this.insertEntry(entry);
return entry;
};
LinkedList.prototype.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++;
};
LinkedList.prototype.remove = function (entry) {
var prev = entry.prev;
var next = entry.next;
if (prev) {
prev.next = next;
} else {
this.head = next;
}
if (next) {
next.prev = prev;
} else {
this.tail = prev;
}
entry.next = entry.prev = null;
this._len--;
};
LinkedList.prototype.len = function () {
return this._len;
};
LinkedList.prototype.clear = function () {
this.head = this.tail = null;
this._len = 0;
};
return LinkedList;
}();
var LRU = function () {
function LRU(maxSize) {
this._list = new LinkedList();
this._maxSize = 10;
this._map = {};
this._maxSize = maxSize;
}
LRU.prototype.put = function (key, value) {
var list = this._list;
var map = this._map;
var removed = null;
if (map[key] == null) {
var len = list.len();
var entry = this._lastRemovedEntry;
if (len >= this._maxSize && len > 0) {
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;
};
LRU.prototype.get = function (key) {
var entry = this._map[key];
var list = this._list;
if (entry != null) {
if (entry !== list.tail) {
list.remove(entry);
list.insertEntry(entry);
}
return entry.value;
}
};
LRU.prototype.clear = function () {
this._list.clear();
this._map = {};
};
LRU.prototype.len = function () {
return this._list.len();
};
return LRU;
}();
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) {
i = Math.round(i);
return i < 0 ? 0 : i > 255 ? 255 : i;
}
function clampCssAngle(i) {
i = Math.round(i);
return i < 0 ? 0 : i > 360 ? 360 : i;
}
function clampCssFloat(f) {
return f < 0 ? 0 : f > 1 ? 1 : f;
}
function parseCssInt(val) {
var str = val;
if (str.length && str.charAt(str.length - 1) === '%') {
return clampCssByte(parseFloat(str) / 100 * 255);
}
return clampCssByte(parseInt(str, 10));
}
function parseCssFloat(val) {
var str = val;
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) {
if (lastRemovedArr) {
copyRgba(lastRemovedArr, rgbaArr);
}
lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || rgbaArr.slice());
}
function parse(colorStr, rgbaArr) {
if (!colorStr) {
return;
}
rgbaArr = rgbaArr || [];
var cached = colorCache.get(colorStr);
if (cached) {
return copyRgba(rgbaArr, cached);
}
colorStr = colorStr + '';
var str = colorStr.replace(/ /g, '').toLowerCase();
if (str in kCSSColorTable) {
copyRgba(rgbaArr, kCSSColorTable[str]);
putToCache(colorStr, rgbaArr);
return rgbaArr;
}
var strLen = str.length;
if (str.charAt(0) === '#') {
if (strLen === 4 || strLen === 5) {
var iv = parseInt(str.slice(1, 4), 16);
if (!(iv >= 0 && iv <= 0xfff)) {
setRgba(rgbaArr, 0, 0, 0, 1);
return;
}
setRgba(rgbaArr, (iv & 0xf00) >> 4 | (iv & 0xf00) >> 8, iv & 0xf0 | (iv & 0xf0) >> 4, iv & 0xf | (iv & 0xf) << 4, strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);
putToCache(colorStr, rgbaArr);
return rgbaArr;
} else if (strLen === 7 || strLen === 9) {
var iv = parseInt(str.slice(1, 7), 16);
if (!(iv >= 0 && iv <= 0xffffff)) {
setRgba(rgbaArr, 0, 0, 0, 1);
return;
}
setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);
putToCache(colorStr, rgbaArr);
return rgbaArr;
}
return;
}
var op = str.indexOf('(');
var ep = str.indexOf(')');
if (op !== -1 && ep + 1 === strLen) {
var fname = str.substr(0, op);
var params = str.substr(op + 1, ep - (op + 1)).split(',');
var alpha = 1;
switch (fname) {
case 'rgba':
if (params.length !== 4) {
return params.length === 3 ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1) : setRgba(rgbaArr, 0, 0, 0, 1);
}
alpha = parseCssFloat(params.pop());
case 'rgb':
if (params.length >= 3) {
setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), params.length === 3 ? alpha : parseCssFloat(params[3]));
putToCache(colorStr, rgbaArr);
return rgbaArr;
} else {
setRgba(rgbaArr, 0, 0, 0, 1);
return;
}
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;
}
function hsla2rgba(hsla, rgba) {
var h = (parseFloat(hsla[0]) % 360 + 360) % 360 / 360;
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;
}
function rgba2hsla(rgba) {
if (!rgba) {
return;
}
var R = rgba[0] / 255;
var G = rgba[1] / 255;
var B = rgba[2] / 255;
var vMin = Math.min(R, G, B);
var vMax = Math.max(R, G, B);
var delta = vMax - vMin;
var L = (vMax + vMin) / 2;
var H;
var S;
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;
}
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 (colorArr[i] < 0) {
colorArr[i] = 0;
}
}
return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');
}
}
function toHex(color) {
var colorArr = parse(color);
if (colorArr) {
return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + +colorArr[2]).toString(16).slice(1);
}
}
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;
}
var fastMapToColor = fastLerp;
function lerp(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;
}
var mapToColor = lerp;
function modifyHSL(color, h, s, l) {
var colorArr = parse(color);
if (color) {
colorArr = rgba2hsla(colorArr);
h != null && (colorArr[0] = clampCssAngle(h));
s != null && (colorArr[1] = parseCssFloat(s));
l != null && (colorArr[2] = parseCssFloat(l));
return stringify(hsla2rgba(colorArr), 'rgba');
}
}
function modifyAlpha(color, alpha) {
var colorArr = parse(color);
if (colorArr && alpha != null) {
colorArr[3] = clampCssFloat(alpha);
return stringify(colorArr, 'rgba');
}
}
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 + ')';
}
function lum(color, backgroundLum) {
var arr = parse(color);
return arr ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255 + (1 - arr[3]) * backgroundLum : 0;
}
function random() {
return stringify([Math.round(Math.random() * 255), Math.round(Math.random() * 255), Math.round(Math.random() * 255)], 'rgb');
}
var color = /*#__PURE__*/Object.freeze({
__proto__: null,
fastLerp: fastLerp,
fastMapToColor: fastMapToColor,
lerp: lerp,
lift: lift,
lum: lum,
mapToColor: mapToColor,
modifyAlpha: modifyAlpha,
modifyHSL: modifyHSL,
parse: parse,
random: random,
stringify: stringify,
toHex: toHex
});
function isLinearGradient(val) {
return val.type === 'linear';
}
function isRadialGradient(val) {
return val.type === 'radial';
}
(function () {
if (env.hasGlobalWindow && isFunction(window.btoa)) {
return function (str) {
return window.btoa(unescape(encodeURIComponent(str)));
};
}
if (typeof Buffer !== 'undefined') {
return function (str) {
return Buffer.from(str).toString('base64');
};
}
return function (str) {
{
logError('Base64 isn\'t natively supported in the current environment.');
}
return null;
};
})();
var arraySlice = Array.prototype.slice;
function interpolateNumber$1(p0, p1, percent) {
return (p1 - p0) * percent + p0;
}
function interpolate1DArray(out, p0, p1, percent) {
var len = p0.length;
for (var i = 0; i < len; i++) {
out[i] = interpolateNumber$1(p0[i], p1[i], percent);
}
return out;
}
function interpolate2DArray(out, p0, p1, percent) {
var len = p0.length;
var len2 = len && p0[0].length;
for (var i = 0; i < len; i++) {
if (!out[i]) {
out[i] = [];
}
for (var j = 0; j < len2; j++) {
out[i][j] = interpolateNumber$1(p0[i][j], p1[i][j], percent);
}
}
return out;
}
function add1DArray(out, p0, p1, sign) {
var len = p0.length;
for (var i = 0; i < len; i++) {
out[i] = p0[i] + p1[i] * sign;
}
return out;
}
function add2DArray(out, p0, p1, sign) {
var len = p0.length;
var len2 = len && p0[0].length;
for (var i = 0; i < len; i++) {
if (!out[i]) {
out[i] = [];
}
for (var j = 0; j < len2; j++) {
out[i][j] = p0[i][j] + p1[i][j] * sign;
}
}
return out;
}
function fillColorStops(val0, val1) {
var len0 = val0.length;
var len1 = val1.length;
var shorterArr = len0 > len1 ? val1 : val0;
var shorterLen = Math.min(len0, len1);
var last = shorterArr[shorterLen - 1] || {
color: [0, 0, 0, 0],
offset: 0
};
for (var i = shorterLen; i < Math.max(len0, len1); i++) {
shorterArr.push({
offset: last.offset,
color: last.color.slice()
});
}
}
function fillArray(val0, val1, arrDim) {
var arr0 = val0;
var arr1 = val1;
if (!arr0.push || !arr1.push) {
return;
}
var arr0Len = arr0.length;
var arr1Len = arr1.length;
if (arr0Len !== arr1Len) {
var isPreviousLarger = arr0Len > arr1Len;
if (isPreviousLarger) {
arr0.length = arr1Len;
} else {
for (var i = arr0Len; i < arr1Len; i++) {
arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));
}
}
}
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];
}
}
}
}
}
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]) || 0;
rgba[1] = Math.floor(rgba[1]) || 0;
rgba[2] = Math.floor(rgba[2]) || 0;
rgba[3] = rgba[3] == null ? 1 : rgba[3];
return 'rgba(' + rgba.join(',') + ')';
}
function guessArrayDim(value) {
return isArrayLike(value && value[0]) ? 2 : 1;
}
var VALUE_TYPE_NUMBER = 0;
var VALUE_TYPE_1D_ARRAY = 1;
var VALUE_TYPE_2D_ARRAY = 2;
var VALUE_TYPE_COLOR = 3;
var VALUE_TYPE_LINEAR_GRADIENT = 4;
var VALUE_TYPE_RADIAL_GRADIENT = 5;
var VALUE_TYPE_UNKOWN = 6;
function isGradientValueType(valType) {
return valType === VALUE_TYPE_LINEAR_GRADIENT || valType === VALUE_TYPE_RADIAL_GRADIENT;
}
function isArrayValueType(valType) {
return valType === VALUE_TYPE_1D_ARRAY || valType === VALUE_TYPE_2D_ARRAY;
}
var tmpRgba = [0, 0, 0, 0];
var Track = function () {
function Track(propName) {
this.keyframes = [];
this.discrete = false;
this._invalid = false;
this._needsSort = false;
this._lastFr = 0;
this._lastFrP = 0;
this.propName = propName;
}
Track.prototype.isFinished = function () {
return this._finished;
};
Track.prototype.setFinished = function () {
this._finished = true;
if (this._additiveTrack) {
this._additiveTrack.setFinished();
}
};
Track.prototype.needsAnimate = function () {
return this.keyframes.length >= 1;
};
Track.prototype.getAdditiveTrack = function () {
return this._additiveTrack;
};
Track.prototype.addKeyframe = function (time, rawValue, easing) {
this._needsSort = true;
var keyframes = this.keyframes;
var len = keyframes.length;
var discrete = false;
var valType = VALUE_TYPE_UNKOWN;
var value = rawValue;
if (isArrayLike(rawValue)) {
var arrayDim = guessArrayDim(rawValue);
valType = arrayDim;
if (arrayDim === 1 && !isNumber(rawValue[0]) || arrayDim === 2 && !isNumber(rawValue[0][0])) {
discrete = true;
}
} else {
if (isNumber(rawValue) && !eqNaN(rawValue)) {
valType = VALUE_TYPE_NUMBER;
} else if (isString(rawValue)) {
if (!isNaN(+rawValue)) {
valType = VALUE_TYPE_NUMBER;
} else {
var colorArray = parse(rawValue);
if (colorArray) {
value = colorArray;
valType = VALUE_TYPE_COLOR;
}
}
} else if (isGradientObject(rawValue)) {
var parsedGradient = extend({}, value);
parsedGradient.colorStops = map$1(rawValue.colorStops, function (colorStop) {
return {
offset: colorStop.offset,
color: parse(colorStop.color)
};
});
if (isLinearGradient(rawValue)) {
valType = VALUE_TYPE_LINEAR_GRADIENT;
} else if (isRadialGradient(rawValue)) {
valType = VALUE_TYPE_RADIAL_GRADIENT;
}
value = parsedGradient;
}
}
if (len === 0) {
this.valType = valType;
} else if (valType !== this.valType || valType === VALUE_TYPE_UNKOWN) {
discrete = true;
}
this.discrete = this.discrete || discrete;
var kf = {
time: time,
value: value,
rawValue: rawValue,
percent: 0
};
if (easing) {
kf.easing = easing;
kf.easingFunc = isFunction(easing) ? easing : easingFuncs[easing] || createCubicEasingFunc(easing);
}
keyframes.push(kf);
return kf;
};
Track.prototype.prepare = function (maxTime, additiveTrack) {
var kfs = this.keyframes;
if (this._needsSort) {
kfs.sort(function (a, b) {
return a.time - b.time;
});
}
var valType = this.valType;
var kfsLen = kfs.length;
var lastKf = kfs[kfsLen - 1];
var isDiscrete = this.discrete;
var isArr = isArrayValueType(valType);
var isGradient = isGradientValueType(valType);
for (var i = 0; i < kfsLen; i++) {
var kf = kfs[i];
var value = kf.value;
var lastValue = lastKf.value;
kf.percent = kf.time / maxTime;
if (!isDiscrete) {
if (isArr && i !== kfsLen - 1) {
fillArray(value, lastValue, valType);
} else if (isGradient) {
fillColorStops(value.colorStops, lastValue.colorStops);
}
}
}
if (!isDiscrete && valType !== VALUE_TYPE_RADIAL_GRADIENT && additiveTrack && this.needsAnimate() && additiveTrack.needsAnimate() && valType === additiveTrack.valType && !additiveTrack._finished) {
this._additiveTrack = additiveTrack;
var startValue = kfs[0].value;
for (var i = 0; i < kfsLen; i++) {
if (valType === VALUE_TYPE_NUMBER) {
kfs[i].additiveValue = kfs[i].value - startValue;
} else if (valType === VALUE_TYPE_COLOR) {
kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);
} else if (isArrayValueType(valType)) {
kfs[i].additiveValue = valType === VALUE_TYPE_1D_ARRAY ? add1DArray([], kfs[i].value, startValue, -1) : add2DArray([], kfs[i].value, startValue, -1);
}
}
}
};
Track.prototype.step = function (target, percent) {
if (this._finished) {
return;
}
if (this._additiveTrack && this._additiveTrack._finished) {
this._additiveTrack = null;
}
var isAdditive = this._additiveTrack != null;
var valueKey = isAdditive ? 'additiveValue' : 'value';
var valType = this.valType;
var keyframes = this.keyframes;
var kfsNum = keyframes.length;
var propName = this.propName;
var isValueColor = valType === VALUE_TYPE_COLOR;
var frameIdx;
var lastFrame = this._lastFr;
var mathMin = Math.min;
var frame;
var nextFrame;
if (kfsNum === 1) {
frame = nextFrame = keyframes[0];
} else {
if (percent < 0) {
frameIdx = 0;
} else if (percent < this._lastFrP) {
var start = mathMin(lastFrame + 1, kfsNum - 1);
for (frameIdx = start; frameIdx >= 0; frameIdx--) {
if (keyframes[frameIdx].percent <= percent) {
break;
}
}
frameIdx = mathMin(frameIdx, kfsNum - 2);
} else {
for (frameIdx = lastFrame; frameIdx < kfsNum; frameIdx++) {
if (keyframes[frameIdx].percent > percent) {
break;
}
}
frameIdx = mathMin(frameIdx - 1, kfsNum - 2);
}
nextFrame = keyframes[frameIdx + 1];
frame = keyframes[frameIdx];
}
if (!(frame && nextFrame)) {
return;
}
this._lastFr = frameIdx;
this._lastFrP = percent;
var interval = nextFrame.percent - frame.percent;
var w = interval === 0 ? 1 : mathMin((percent - frame.percent) / interval, 1);
if (nextFrame.easingFunc) {
w = nextFrame.easingFunc(w);
}
var targetArr = isAdditive ? this._additiveValue : isValueColor ? tmpRgba : target[propName];
if ((isArrayValueType(valType) || isValueColor) && !targetArr) {
targetArr = this._additiveValue = [];
}
if (this.discrete) {
target[propName] = w < 1 ? frame.rawValue : nextFrame.rawValue;
} else if (isArrayValueType(valType)) {
valType === VALUE_TYPE_1D_ARRAY ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w) : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);
} else if (isGradientValueType(valType)) {
var val = frame[valueKey];
var nextVal_1 = nextFrame[valueKey];
var isLinearGradient_1 = valType === VALUE_TYPE_LINEAR_GRADIENT;
target[propName] = {
type: isLinearGradient_1 ? 'linear' : 'radial',
x: interpolateNumber$1(val.x, nextVal_1.x, w),
y: interpolateNumber$1(val.y, nextVal_1.y, w),
colorStops: map$1(val.colorStops, function (colorStop, idx) {
var nextColorStop = nextVal_1.colorStops[idx];
return {
offset: interpolateNumber$1(colorStop.offset, nextColorStop.offset, w),
color: rgba2String(interpolate1DArray([], colorStop.color, nextColorStop.color, w))
};
}),
global: nextVal_1.global
};
if (isLinearGradient_1) {
target[propName].x2 = interpolateNumber$1(val.x2, nextVal_1.x2, w);
target[propName].y2 = interpolateNumber$1(val.y2, nextVal_1.y2, w);
} else {
target[propName].r = interpolateNumber$1(val.r, nextVal_1.r, w);
}
} else if (isValueColor) {
interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);
if (!isAdditive) {
target[propName] = rgba2String(targetArr);
}
} else {
var value = interpolateNumber$1(frame[valueKey], nextFrame[valueKey], w);
if (isAdditive) {
this._additiveValue = value;
} else {
target[propName] = value;
}
}
if (isAdditive) {
this._addToTarget(target);
}
};
Track.prototype._addToTarget = function (target) {
var valType = this.valType;
var propName = this.propName;
var additiveValue = this._additiveValue;
if (valType === VALUE_TYPE_NUMBER) {
target[propName] = target[propName] + additiveValue;
} else if (valType === VALUE_TYPE_COLOR) {
parse(target[propName], tmpRgba);
add1DArray(tmpRgba, tmpRgba, additiveValue, 1);
target[propName] = rgba2String(tmpRgba);
} else if (valType === VALUE_TYPE_1D_ARRAY) {
add1DArray(target[propName], target[propName], additiveValue, 1);
} else if (valType === VALUE_TYPE_2D_ARRAY) {
add2DArray(target[propName], target[propName], additiveValue, 1);
}
};
return Track;
}();
var Animator = function () {
function Animator(target, loop, allowDiscreteAnimation, additiveTo) {
this._tracks = {};
this._trackKeys = [];
this._maxTime = 0;
this._started = 0;
this._clip = null;
this._target = target;
this._loop = loop;
if (loop && additiveTo) {
logError('Can\' use additive animation on looped animation.');
return;
}
this._additiveAnimators = additiveTo;
this._allowDiscrete = allowDiscreteAnimation;
}
Animator.prototype.getMaxTime = function () {
return this._maxTime;
};
Animator.prototype.getDelay = function () {
return this._delay;
};
Animator.prototype.getLoop = function () {
return this._loop;
};
Animator.prototype.getTarget = function () {
return this._target;
};
Animator.prototype.changeTarget = function (target) {
this._target = target;
};
Animator.prototype.when = function (time, props, easing) {
return this.whenWithKeys(time, props, keys(props), easing);
};
Animator.prototype.whenWithKeys = function (time, props, propNames, easing) {
var tracks = this._tracks;
for (var i = 0; i < propNames.length; i++) {
var propName = propNames[i];
var track = tracks[propName];
if (!track) {
track = tracks[propName] = new Track(propName);
var initialValue = void 0;
var additiveTrack = this._getAdditiveTrack(propName);
if (additiveTrack) {
var addtiveTrackKfs = additiveTrack.keyframes;
var lastFinalKf = addtiveTrackKfs[addtiveTrackKfs.length - 1];
initialValue = lastFinalKf && lastFinalKf.value;
if (additiveTrack.valType === VALUE_TYPE_COLOR && initialValue) {
initialValue = rgba2String(initialValue);
}
} else {
initialValue = this._target[propName];
}
if (initialValue == null) {
continue;
}
if (time > 0) {
track.addKeyframe(0, cloneValue(initialValue), easing);
}
this._trackKeys.push(propName);
}
track.addKeyframe(time, cloneValue(props[propName]), easing);
}
this._maxTime = Math.max(this._maxTime, time);
return this;
};
Animator.prototype.pause = function () {
this._clip.pause();
this._paused = true;
};
Animator.prototype.resume = function () {
this._clip.resume();
this._paused = false;
};
Animator.prototype.isPaused = function () {
return !!this._paused;
};
Animator.prototype.duration = function (duration) {
this._maxTime = duration;
this._force = true;
return this;
};
Animator.prototype._doneCallback = function () {
this._setTracksFinished();
this._clip = null;
var doneList = this._doneCbs;
if (doneList) {
var len = doneList.length;
for (var i = 0; i < len; i++) {
doneList[i].call(this);
}
}
};
Animator.prototype._abortedCallback = function () {
this._setTracksFinished();
var animation = this.animation;
var abortedList = this._abortedCbs;
if (animation) {
animation.removeClip(this._clip);
}
this._clip = null;
if (abortedList) {
for (var i = 0; i < abortedList.length; i++) {
abortedList[i].call(this);
}
}
};
Animator.prototype._setTracksFinished = function () {
var tracks = this._tracks;
var tracksKeys = this._trackKeys;
for (var i = 0; i < tracksKeys.length; i++) {
tracks[tracksKeys[i]].setFinished();
}
};
Animator.prototype._getAdditiveTrack = function (trackName) {
var additiveTrack;
var additiveAnimators = this._additiveAnimators;
if (additiveAnimators) {
for (var i = 0; i < additiveAnimators.length; i++) {
var track = additiveAnimators[i].getTrack(trackName);
if (track) {
additiveTrack = track;
}
}
}
return additiveTrack;
};
Animator.prototype.start = function (easing) {
if (this._started > 0) {
return;
}
this._started = 1;
var self = this;
var tracks = [];
var maxTime = this._maxTime || 0;
for (var i = 0; i < this._trackKeys.length; i++) {
var propName = this._trackKeys[i];
var track = this._tracks[propName];
var additiveTrack = this._getAdditiveTrack(propName);
var kfs = track.keyframes;
var kfsNum = kfs.length;
track.prepare(maxTime, additiveTrack);
if (track.needsAnimate()) {
if (!this._allowDiscrete && track.discrete) {
var lastKf = kfs[kfsNum - 1];
if (lastKf) {
self._target[track.propName] = lastKf.rawValue;
}
track.setFinished();
} else {
tracks.push(track);
}
}
}
if (tracks.length || this._force) {
var clip = new Clip({
life: maxTime,
loop: this._loop,
delay: this._delay || 0,
onframe: function (percent) {
self._started = 2;
var additiveAnimators = self._additiveAnimators;
if (additiveAnimators) {
var stillHasAdditiveAnimator = false;
for (var i = 0; i < additiveAnimators.length; i++) {
if (additiveAnimators[i]._clip) {
stillHasAdditiveAnimator = true;
break;
}
}
if (!stillHasAdditiveAnimator) {
self._additiveAnimators = null;
}
}
for (var i = 0; i < tracks.length; i++) {
tracks[i].step(self._target, percent);
}
var onframeList = self._onframeCbs;
if (onframeList) {
for (var i = 0; i < onframeList.length; i++) {
onframeList[i](self._target, percent);
}
}
},
ondestroy: function () {
self._doneCallback();
}
});
this._clip = clip;
if (this.animation) {
this.animation.addClip(clip);
}
if (easing) {
clip.setEasing(easing);
}
} else {
this._doneCallback();
}
return this;
};
Animator.prototype.stop = function (forwardToLast) {
if (!this._clip) {
return;
}
var clip = this._clip;
if (forwardToLast) {
clip.onframe(1);
}
this._abortedCallback();
};
Animator.prototype.delay = function (time) {
this._delay = time;
return this;
};
Animator.prototype.during = function (cb) {
if (cb) {
if (!this._onframeCbs) {
this._onframeCbs = [];
}
this._onframeCbs.push(cb);
}
return this;
};
Animator.prototype.done = function (cb) {
if (cb) {
if (!this._doneCbs) {
this._doneCbs = [];
}
this._doneCbs.push(cb);
}
return this;
};
Animator.prototype.aborted = function (cb) {
if (cb) {
if (!this._abortedCbs) {
this._abortedCbs = [];
}
this._abortedCbs.push(cb);
}
return this;
};
Animator.prototype.getClip = function () {
return this._clip;
};
Animator.prototype.getTrack = function (propName) {
return this._tracks[propName];
};
Animator.prototype.getTracks = function () {
var _this = this;
return map$1(this._trackKeys, function (key) {
return _this._tracks[key];
});
};
Animator.prototype.stopTracks = function (propNames, forwardToLast) {
if (!propNames.length || !this._clip) {
return true;
}
var tracks = this._tracks;
var tracksKeys = this._trackKeys;
for (var i = 0; i < propNames.length; i++) {
var track = tracks[propNames[i]];
if (track && !track.isFinished()) {
if (forwardToLast) {
track.step(this._target, 1);
} else if (this._started === 1) {
track.step(this._target, 0);
}
track.setFinished();
}
}
var allAborted = true;
for (var i = 0; i < tracksKeys.length; i++) {
if (!tracks[tracksKeys[i]].isFinished()) {
allAborted = false;
break;
}
}
if (allAborted) {
this._abortedCallback();
}
return allAborted;
};
Animator.prototype.saveTo = function (target, trackKeys, firstOrLast) {
if (!target) {
return;
}
trackKeys = trackKeys || this._trackKeys;
for (var i = 0; i < trackKeys.length; i++) {
var propName = trackKeys[i];
var track = this._tracks[propName];
if (!track || track.isFinished()) {
continue;
}
var kfs = track.keyframes;
var kf = kfs[firstOrLast ? 0 : kfs.length - 1];
if (kf) {
target[propName] = cloneValue(kf.rawValue);
}
}
};
Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {
trackKeys = trackKeys || keys(finalProps);
for (var i = 0; i < trackKeys.length; i++) {
var propName = trackKeys[i];
var track = this._tracks[propName];
if (!track) {
continue;
}
var kfs = track.keyframes;
if (kfs.length > 1) {
var lastKf = kfs.pop();
track.addKeyframe(lastKf.time, finalProps[propName]);
track.prepare(this._maxTime, track.getAdditiveTrack());
}
}
};
return Animator;
}();
function getTime() {
return new Date().getTime();
}
var Animation = function (_super) {
__extends(Animation, _super);
function Animation(opts) {
var _this = _super.call(this) || this;
_this._running = false;
_this._time = 0;
_this._pausedTime = 0;
_this._pauseStart = 0;
_this._paused = false;
opts = opts || {};
_this.stage = opts.stage || {};
return _this;
}
Animation.prototype.addClip = function (clip) {
if (clip.animation) {
this.removeClip(clip);
}
if (!this._head) {
this._head = this._tail = clip;
} else {
this._tail.next = clip;
clip.prev = this._tail;
clip.next = null;
this._tail = clip;
}
clip.animation = this;
};
Animation.prototype.addAnimator = function (animator) {
animator.animation = this;
var clip = animator.getClip();
if (clip) {
this.addClip(clip);
}
};
Animation.prototype.removeClip = function (clip) {
if (!clip.animation) {
return;
}
var prev = clip.prev;
var next = clip.next;
if (prev) {
prev.next = next;
} else {
this._head = next;
}
if (next) {
next.prev = prev;
} else {
this._tail = prev;
}
clip.next = clip.prev = clip.animation = null;
};
Animation.prototype.removeAnimator = function (animator) {
var clip = animator.getClip();
if (clip) {
this.removeClip(clip);
}
animator.animation = null;
};
Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {
var time = getTime() - this._pausedTime;
var delta = time - this._time;
var clip = this._head;
while (clip) {
var nextClip = clip.next;
var finished = clip.step(time, delta);
if (finished) {
clip.ondestroy();
this.removeClip(clip);
clip = nextClip;
} else {
clip = nextClip;
}
}
this._time = time;
if (!notTriggerFrameAndStageUpdate) {
this.trigger('frame', delta);
this.stage.update && this.stage.update();
}
};
Animation.prototype._startLoop = function () {
var self = this;
this._running = true;
function step() {
if (self._running) {
requestAnimationFrame$1(step);
!self._paused && self.update();
}
}
requestAnimationFrame$1(step);
};
Animation.prototype.start = function () {
if (this._running) {
return;
}
this._time = getTime();
this._pausedTime = 0;
this._startLoop();
};
Animation.prototype.stop = function () {
this._running = false;
};
Animation.prototype.pause = function () {
if (!this._paused) {
this._pauseStart = getTime();
this._paused = true;
}
};
Animation.prototype.resume = function () {
if (this._paused) {
this._pausedTime += getTime() - this._pauseStart;
this._paused = false;
}
};
Animation.prototype.clear = function () {
var clip = this._head;
while (clip) {
var nextClip = clip.next;
clip.prev = clip.next = clip.animation = null;
clip = nextClip;
}
this._head = this._tail = null;
};
Animation.prototype.isFinished = function () {
return this._head == null;
};
Animation.prototype.animate = function (target, options) {
options = options || {};
this.start();
var animator = new Animator(target, options.loop);
this.addAnimator(animator);
return animator;
};
return Animation;
}(Eventful);
var TOUCH_CLICK_DELAY = 300;
var globalEventSupported = env.domSupported;
var localNativeListenerNames = function () {
var mouseHandlerNames = ['click', 'dblclick', 'mousewheel', 'wheel', 'mouseout', 'mouseup', 'mousedown', 'mousemove', 'contextmenu'];
var touchHandlerNames = ['touchstart', 'touchend', 'touchmove'];
var pointerEventNameMap = {
pointerdown: 1,
pointerup: 1,
pointermove: 1,
pointerout: 1
};
var pointerHandlerNames = map$1(mouseHandlerNames, function (name) {
var nm = name.replace('mouse', 'pointer');
return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;
});
return {
mouse: mouseHandlerNames,
touch: touchHandlerNames,
pointer: pointerHandlerNames
};
}();
var globalNativeListenerNames = {
mouse: ['mousemove', 'mouseup'],
pointer: ['pointermove', 'pointerup']
};
var wheelEventSupported = false;
function isPointerFromTouch(event) {
var pointerType = event.pointerType;
return pointerType === 'pen' || pointerType === 'touch';
}
function setTouchTimer(scope) {
scope.touching = true;
if (scope.touchTimer != null) {
clearTimeout(scope.touchTimer);
scope.touchTimer = null;
}
scope.touchTimer = setTimeout(function () {
scope.touching = false;
scope.touchTimer = null;
}, 700);
}
function markTouch(event) {
event && (event.zrByTouch = true);
}
function normalizeGlobalEvent(instance, event) {
return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);
}
function isLocalEl(instance, el) {
var elTmp = el;
var isLocal = false;
while (elTmp && elTmp.nodeType !== 9 && !(isLocal = elTmp.domBelongToZr || elTmp !== el && elTmp === instance.painterRoot)) {
elTmp = elTmp.parentNode;
}
return isLocal;
}
var FakeGlobalEvent = function () {
function FakeGlobalEvent(instance, event) {
this.stopPropagation = noop;
this.stopImmediatePropagation = noop;
this.preventDefault = noop;
this.type = event.type;
this.target = this.currentTarget = instance.dom;
this.pointerType = event.pointerType;
this.clientX = event.clientX;
this.clientY = event.clientY;
}
return FakeGlobalEvent;
}();
var localDOMHandlers = {
mousedown: function (event) {
event = normalizeEvent(this.dom, event);
this.__mayPointerCapture = [event.zrX, event.zrY];
this.trigger('mousedown', event);
},
mousemove: function (event) {
event = normalizeEvent(this.dom, event);
var downPoint = this.__mayPointerCapture;
if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {
this.__togglePointerCapture(true);
}
this.trigger('mousemove', event);
},
mouseup: function (event) {
event = normalizeEvent(this.dom, event);
this.__togglePointerCapture(false);
this.trigger('mouseup', event);
},
mouseout: function (event) {
event = normalizeEvent(this.dom, event);
var element = event.toElement || event.relatedTarget;
if (!isLocalEl(this, element)) {
if (this.__pointerCapturing) {
event.zrEventControl = 'no_globalout';
}
this.trigger('mouseout', event);
}
},
wheel: function (event) {
wheelEventSupported = true;
event = normalizeEvent(this.dom, event);
this.trigger('mousewheel', event);
},
mousewheel: function (event) {
if (wheelEventSupported) {
return;
}
event = normalizeEvent(this.dom, event);
this.trigger('mousewheel', event);
},
touchstart: function (event) {
event = normalizeEvent(this.dom, event);
markTouch(event);
this.__lastTouchMoment = new Date();
this.handler.processGesture(event, 'start');
localDOMHandlers.mousemove.call(this, event);
localDOMHandlers.mousedown.call(this, event);
},
touchmove: function (event) {
event = normalizeEvent(this.dom, event);
markTouch(event);
this.handler.processGesture(event, 'change');
localDOMHandlers.mousemove.call(this, event);
},
touchend: function (event) {
event = normalizeEvent(this.dom, event);
markTouch(event);
this.handler.processGesture(event, 'end');
localDOMHandlers.mouseup.call(this, event);
if (+new Date() - +this.__lastTouchMoment < TOUCH_CLICK_DELAY) {
localDOMHandlers.click.call(this, event);
}
},
pointerdown: function (event) {
localDOMHandlers.mousedown.call(this, event);
},
pointermove: function (event) {
if (!isPointerFromTouch(event)) {
localDOMHandlers.mousemove.call(this, event);
}
},
pointerup: function (event) {
localDOMHandlers.mouseup.call(this, event);
},
pointerout: function (event) {
if (!isPointerFromTouch(event)) {
localDOMHandlers.mouseout.call(this, event);
}
}
};
each$4(['click', 'dblclick', 'contextmenu'], function (name) {
localDOMHandlers[name] = function (event) {
event = normalizeEvent(this.dom, event);
this.trigger(name, event);
};
});
var globalDOMHandlers = {
pointermove: function (event) {
if (!isPointerFromTouch(event)) {
globalDOMHandlers.mousemove.call(this, event);
}
},
pointerup: function (event) {
globalDOMHandlers.mouseup.call(this, event);
},
mousemove: function (event) {
this.trigger('mousemove', event);
},
mouseup: function (event) {
var pointerCaptureReleasing = this.__pointerCapturing;
this.__togglePointerCapture(false);
this.trigger('mouseup', event);
if (pointerCaptureReleasing) {
event.zrEventControl = 'only_globalout';
this.trigger('mouseout', event);
}
}
};
function mountLocalDOMEventListeners(instance, scope) {
var domHandlers = scope.domHandlers;
if (env.pointerEventsSupported) {
each$4(localNativeListenerNames.pointer, function (nativeEventName) {
mountSingleDOMEventListener(scope, nativeEventName, function (event) {
domHandlers[nativeEventName].call(instance, event);
});
});
} else {
if (env.touchEventsSupported) {
each$4(localNativeListenerNames.touch, function (nativeEventName) {
mountSingleDOMEventListener(scope, nativeEventName, function (event) {
domHandlers[nativeEventName].call(instance, event);
setTouchTimer(scope);
});
});
}
each$4(localNativeListenerNames.mouse, function (nativeEventName) {
mountSingleDOMEventListener(scope, nativeEventName, function (event) {
event = getNativeEvent(event);
if (!scope.touching) {
domHandlers[nativeEventName].call(instance, event);
}
});
});
}
}
function mountGlobalDOMEventListeners(instance, scope) {
if (env.pointerEventsSupported) {
each$4(globalNativeListenerNames.pointer, mount);
} else if (!env.touchEventsSupported) {
each$4(globalNativeListenerNames.mouse, mount);
}
function mount(nativeEventName) {
function nativeEventListener(event) {
event = getNativeEvent(event);
if (!isLocalEl(instance, event.target)) {
event = normalizeGlobalEvent(instance, event);
scope.domHandlers[nativeEventName].call(instance, event);
}
}
mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, {
capture: true
});
}
}
function mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {
scope.mounted[nativeEventName] = listener;
scope.listenerOpts[nativeEventName] = opt;
addEventListener(scope.domTarget, nativeEventName, listener, opt);
}
function unmountDOMEventListeners(scope) {
var mounted = scope.mounted;
for (var nativeEventName in mounted) {
if (mounted.hasOwnProperty(nativeEventName)) {
removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);
}
}
scope.mounted = {};
}
var DOMHandlerScope = function () {
function DOMHandlerScope(domTarget, domHandlers) {
this.mounted = {};
this.listenerOpts = {};
this.touching = false;
this.domTarget = domTarget;
this.domHandlers = domHandlers;
}
return DOMHandlerScope;
}();
var HandlerDomProxy = function (_super) {
__extends(HandlerDomProxy, _super);
function HandlerDomProxy(dom, painterRoot) {
var _this = _super.call(this) || this;
_this.__pointerCapturing = false;
_this.dom = dom;
_this.painterRoot = painterRoot;
_this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);
if (globalEventSupported) {
_this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);
}
mountLocalDOMEventListeners(_this, _this._localHandlerScope);
return _this;
}
HandlerDomProxy.prototype.dispose = function () {
unmountDOMEventListeners(this._localHandlerScope);
if (globalEventSupported) {
unmountDOMEventListeners(this._globalHandlerScope);
}
};
HandlerDomProxy.prototype.setCursor = function (cursorStyle) {
this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');
};
HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {
this.__mayPointerCapture = null;
if (globalEventSupported && +this.__pointerCapturing ^ +isPointerCapturing) {
this.__pointerCapturing = isPointerCapturing;
var globalHandlerScope = this._globalHandlerScope;
isPointerCapturing ? mountGlobalDOMEventListeners(this, globalHandlerScope) : unmountDOMEventListeners(globalHandlerScope);
}
};
return HandlerDomProxy;
}(Eventful);
var dpr = 1;
if (env.hasGlobalWindow) {
dpr = Math.max(window.devicePixelRatio || window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI || 1, 1);
}
var devicePixelRatio = dpr;
var DARK_MODE_THRESHOLD = 0.4;
var DARK_LABEL_COLOR = '#333';
var LIGHT_LABEL_COLOR = '#ccc';
var LIGHTER_LABEL_COLOR = '#eee';
var mIdentity = identity;
var EPSILON$2 = 5e-5;
function isNotAroundZero(val) {
return val > EPSILON$2 || val < -EPSILON$2;
}
var scaleTmp = [];
var tmpTransform = [];
var originTransform = create();
var abs = Math.abs;
var Transformable = function () {
function Transformable() {}
Transformable.prototype.getLocalTransform = function (m) {
return Transformable.getLocalTransform(this, m);
};
Transformable.prototype.setPosition = function (arr) {
this.x = arr[0];
this.y = arr[1];
};
Transformable.prototype.setScale = function (arr) {
this.scaleX = arr[0];
this.scaleY = arr[1];
};
Transformable.prototype.setSkew = function (arr) {
this.skewX = arr[0];
this.skewY = arr[1];
};
Transformable.prototype.setOrigin = function (arr) {
this.originX = arr[0];
this.originY = arr[1];
};
Transformable.prototype.needLocalTransform = function () {
return isNotAroundZero(this.rotation) || isNotAroundZero(this.x) || isNotAroundZero(this.y) || isNotAroundZero(this.scaleX - 1) || isNotAroundZero(this.scaleY - 1) || isNotAroundZero(this.skewX) || isNotAroundZero(this.skewY);
};
Transformable.prototype.updateTransform = function () {
var parentTransform = this.parent && this.parent.transform;
var needLocalTransform = this.needLocalTransform();
var m = this.transform;
if (!(needLocalTransform || parentTransform)) {
if (m) {
mIdentity(m);
this.invTransform = null;
}
return;
}
m = m || create();
if (needLocalTransform) {
this.getLocalTransform(m);
} else {
mIdentity(m);
}
if (parentTransform) {
if (needLocalTransform) {
mul(m, parentTransform, m);
} else {
copy(m, parentTransform);
}
}
this.transform = m;
this._resolveGlobalScaleRatio(m);
};
Transformable.prototype._resolveGlobalScaleRatio = function (m) {
var globalScaleRatio = this.globalScaleRatio;
if (globalScaleRatio != null && globalScaleRatio !== 1) {
this.getGlobalScale(scaleTmp);
var relX = scaleTmp[0] < 0 ? -1 : 1;
var relY = scaleTmp[1] < 0 ? -1 : 1;
var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;
var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;
m[0] *= sx;
m[1] *= sx;
m[2] *= sy;
m[3] *= sy;
}
this.invTransform = this.invTransform || create();
invert(this.invTransform, m);
};
Transformable.prototype.getComputedTransform = function () {
var transformNode = this;
var ancestors = [];
while (transformNode) {
ancestors.push(transformNode);
transformNode = transformNode.parent;
}
while (transformNode = ancestors.pop()) {
transformNode.updateTransform();
}
return this.transform;
};
Transformable.prototype.setLocalTransform = function (m) {
if (!m) {
return;
}
var sx = m[0] * m[0] + m[1] * m[1];
var sy = m[2] * m[2] + m[3] * m[3];
var rotation = Math.atan2(m[1], m[0]);
var shearX = Math.PI / 2 + rotation - Math.atan2(m[3], m[2]);
sy = Math.sqrt(sy) * Math.cos(shearX);
sx = Math.sqrt(sx);
this.skewX = shearX;
this.skewY = 0;
this.rotation = -rotation;
this.x = +m[4];
this.y = +m[5];
this.scaleX = sx;
this.scaleY = sy;
this.originX = 0;
this.originY = 0;
};
Transformable.prototype.decomposeTransform = function () {
if (!this.transform) {
return;
}
var parent = this.parent;
var m = this.transform;
if (parent && parent.transform) {
mul(tmpTransform, parent.invTransform, m);
m = tmpTransform;
}
var ox = this.originX;
var oy = this.originY;
if (ox || oy) {
originTransform[4] = ox;
originTransform[5] = oy;
mul(tmpTransform, m, originTransform);
tmpTransform[4] -= ox;
tmpTransform[5] -= oy;
m = tmpTransform;
}
this.setLocalTransform(m);
};
Transformable.prototype.getGlobalScale = function (out) {
var m = this.transform;
out = out || [];
if (!m) {
out[0] = 1;
out[1] = 1;
return out;
}
out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);
out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);
if (m[0] < 0) {
out[0] = -out[0];
}
if (m[3] < 0) {
out[1] = -out[1];
}
return out;
};
Transformable.prototype.transformCoordToLocal = function (x, y) {
var v2 = [x, y];
var invTransform = this.invTransform;
if (invTransform) {
applyTransform$1(v2, v2, invTransform);
}
return v2;
};
Transformable.prototype.transformCoordToGlobal = function (x, y) {
var v2 = [x, y];
var transform = this.transform;
if (transform) {
applyTransform$1(v2, v2, transform);
}
return v2;
};
Transformable.prototype.getLineScale = function () {
var m = this.transform;
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;
};
Transformable.prototype.copyTransform = function (source) {
copyTransform(this, source);
};
Transformable.getLocalTransform = function (target, m) {
m = m || [];
var ox = target.originX || 0;
var oy = target.originY || 0;
var sx = target.scaleX;
var sy = target.scaleY;
var ax = target.anchorX;
var ay = target.anchorY;
var rotation = target.rotation || 0;
var x = target.x;
var y = target.y;
var skewX = target.skewX ? Math.tan(target.skewX) : 0;
var skewY = target.skewY ? Math.tan(-target.skewY) : 0;
if (ox || oy || ax || ay) {
var dx = ox + ax;
var dy = oy + ay;
m[4] = -dx * sx - skewX * dy * sy;
m[5] = -dy * sy - skewY * dx * sx;
} else {
m[4] = m[5] = 0;
}
m[0] = sx;
m[3] = sy;
m[1] = skewY * sx;
m[2] = skewX * sy;
rotation && rotate(m, m, rotation);
m[4] += ox + x;
m[5] += oy + y;
return m;
};
Transformable.initDefaultProps = function () {
var proto = Transformable.prototype;
proto.scaleX = proto.scaleY = proto.globalScaleRatio = 1;
proto.x = proto.y = proto.originX = proto.originY = proto.skewX = proto.skewY = proto.rotation = proto.anchorX = proto.anchorY = 0;
}();
return Transformable;
}();
var TRANSFORMABLE_PROPS = ['x', 'y', 'originX', 'originY', 'anchorX', 'anchorY', 'rotation', 'scaleX', 'scaleY', 'skewX', 'skewY'];
function copyTransform(target, source) {
for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) {
var propName = TRANSFORMABLE_PROPS[i];
target[propName] = source[propName];
}
}
var textWidthCache = {};
function getWidth(text, font) {
font = font || DEFAULT_FONT;
var cacheOfFont = textWidthCache[font];
if (!cacheOfFont) {
cacheOfFont = textWidthCache[font] = new LRU(500);
}
var width = cacheOfFont.get(text);
if (width == null) {
width = platformApi.measureText(text, font).width;
cacheOfFont.put(text, width);
}
return width;
}
function innerGetBoundingRect(text, font, textAlign, textBaseline) {
var width = getWidth(text, font);
var height = getLineHeight(font);
var x = adjustTextX(0, width, textAlign);
var y = adjustTextY(0, height, textBaseline);
var rect = new BoundingRect(x, y, width, height);
return rect;
}
function getBoundingRect(text, font, textAlign, textBaseline) {
var textLines = ((text || '') + '').split('\n');
var len = textLines.length;
if (len === 1) {
return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);
} else {
var uniondRect = new BoundingRect(0, 0, 0, 0);
for (var i = 0; i < textLines.length; i++) {
var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);
i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);
}
return uniondRect;
}
}
function adjustTextX(x, width, textAlign) {
if (textAlign === 'right') {
x -= width;
} else if (textAlign === 'center') {
x -= width / 2;
}
return x;
}
function adjustTextY(y, height, verticalAlign) {
if (verticalAlign === 'middle') {
y -= height / 2;
} else if (verticalAlign === 'bottom') {
y -= height;
}
return y;
}
function getLineHeight(font) {
return getWidth('国', font);
}
function parsePercent$1(value, maxValue) {
if (typeof value === 'string') {
if (value.lastIndexOf('%') >= 0) {
return parseFloat(value) / 100 * maxValue;
}
return parseFloat(value);
}
return value;
}
function calculateTextPosition(out, opts, rect) {
var textPosition = opts.position || 'inside';
var distance = opts.distance != null ? opts.distance : 5;
var height = rect.height;
var width = rect.width;
var halfHeight = height / 2;
var x = rect.x;
var y = rect.y;
var textAlign = 'left';
var textVerticalAlign = 'top';
if (textPosition instanceof Array) {
x += parsePercent$1(textPosition[0], rect.width);
y += parsePercent$1(textPosition[1], rect.height);
textAlign = null;
textVerticalAlign = null;
} else {
switch (textPosition) {
case 'left':
x -= distance;
y += halfHeight;
textAlign = 'right';
textVerticalAlign = 'middle';
break;
case 'right':
x += distance + width;
y += hal
gitextract_a_7sud7x/ ├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── .vscode/ │ └── settings.json ├── README.md ├── babel.config.js ├── config/ │ ├── dev.js │ ├── index.js │ └── prod.js ├── package.json ├── plugins/ │ └── view-data-plugin.js ├── project.config.json ├── src/ │ ├── api/ │ │ ├── http-result.ts │ │ ├── index.ts │ │ ├── logic/ │ │ │ ├── account_book.ts │ │ │ ├── asset.ts │ │ │ ├── budget.ts │ │ │ ├── category.ts │ │ │ ├── chaos.ts │ │ │ ├── finance.ts │ │ │ ├── friend.ts │ │ │ ├── main.ts │ │ │ ├── message.ts │ │ │ ├── payee.ts │ │ │ ├── statement.ts │ │ │ ├── statistic.ts │ │ │ ├── superChart.ts │ │ │ ├── superStatement.ts │ │ │ └── user.ts │ │ ├── request.ts │ │ └── types.ts │ ├── app.config.ts │ ├── app.ts │ ├── assets/ │ │ ├── echarts.js │ │ ├── fonts/ │ │ │ ├── iconfont.css │ │ │ └── index.styl │ │ └── styl/ │ │ ├── common/ │ │ │ ├── border.styl │ │ │ ├── calculator.styl │ │ │ ├── common.styl │ │ │ ├── flex.styl │ │ │ ├── header.styl │ │ │ ├── image.styl │ │ │ ├── index.styl │ │ │ ├── input.styl │ │ │ ├── mask.styl │ │ │ └── text.styl │ │ ├── components/ │ │ │ ├── asset_banner.styl │ │ │ ├── select_component.styl │ │ │ ├── slide_sidebar.styl │ │ │ ├── statement.styl │ │ │ └── statement_form.styl │ │ ├── index.styl │ │ ├── pages/ │ │ │ ├── budget/ │ │ │ │ └── index.styl │ │ │ ├── finance/ │ │ │ │ ├── asset_flow.styl │ │ │ │ └── index.styl │ │ │ ├── friends/ │ │ │ │ └── invite_info.styl │ │ │ ├── home/ │ │ │ │ └── index.styl │ │ │ ├── profile/ │ │ │ │ ├── category-form.styl │ │ │ │ └── index.styl │ │ │ ├── settings/ │ │ │ │ ├── category_manager.styl │ │ │ │ ├── chart.styl │ │ │ │ ├── export_page.styl │ │ │ │ ├── statement_imgs.styl │ │ │ │ └── user_info.styl │ │ │ ├── statements/ │ │ │ │ └── detail.styl │ │ │ └── statistic/ │ │ │ ├── calendar.styl │ │ │ └── index.styl │ │ ├── shift.styl │ │ ├── themes/ │ │ │ ├── components/ │ │ │ │ ├── button.styl │ │ │ │ ├── form.styl │ │ │ │ ├── loading.styl │ │ │ │ └── tab.styl │ │ │ ├── index.styl │ │ │ └── root.styl │ │ └── vars.styl │ ├── components/ │ │ ├── AssetBanner/ │ │ │ └── index.jsx │ │ ├── AssetList/ │ │ │ └── index.tsx │ │ ├── Avatar/ │ │ │ └── index.jsx │ │ ├── BasePage/ │ │ │ └── index.tsx │ │ ├── Calculator/ │ │ │ ├── index.scss │ │ │ └── index.tsx │ │ ├── CategoryList/ │ │ │ └── index.tsx │ │ ├── EmptyTips/ │ │ │ └── index.tsx │ │ ├── Home/ │ │ │ ├── FinancePage/ │ │ │ │ └── index.tsx │ │ │ ├── IndexPage/ │ │ │ │ └── index.tsx │ │ │ ├── ProfilePage/ │ │ │ │ └── index.tsx │ │ │ ├── StatisticPage/ │ │ │ │ └── index.tsx │ │ │ └── index.js │ │ ├── Select/ │ │ │ └── index.jsx │ │ ├── SlideSetting/ │ │ │ └── index.tsx │ │ ├── Statement/ │ │ │ └── index.jsx │ │ ├── Statements/ │ │ │ └── index.jsx │ │ ├── Statistic/ │ │ │ ├── CalendarStatistic.tsx │ │ │ ├── ExpendCategory.tsx │ │ │ ├── ExpendList.tsx │ │ │ ├── ExpendTrend.tsx │ │ │ └── Summary.tsx │ │ ├── UiComponents/ │ │ │ ├── Button/ │ │ │ │ └── index.tsx │ │ │ ├── Calculator/ │ │ │ │ └── index.tsx │ │ │ ├── Form/ │ │ │ │ └── index.tsx │ │ │ ├── Loading/ │ │ │ │ └── index.tsx │ │ │ ├── Tabs/ │ │ │ │ └── index.tsx │ │ │ └── index.js │ │ └── statementForm/ │ │ ├── CategorySelect.tsx │ │ ├── PayeeSelect.tsx │ │ └── baseForm.tsx │ ├── config/ │ │ ├── config.ts.example │ │ └── index.ts │ ├── index.html │ ├── jz.ts │ ├── pages/ │ │ ├── account_books/ │ │ │ ├── create.config.ts │ │ │ ├── create.styl │ │ │ ├── create.tsx │ │ │ ├── edit.config.ts │ │ │ ├── edit.tsx │ │ │ ├── list.config.ts │ │ │ ├── list.styl │ │ │ └── list.tsx │ │ ├── assets_flow/ │ │ │ ├── index.config.ts │ │ │ └── index.tsx │ │ ├── friends/ │ │ │ ├── index.config.ts │ │ │ ├── index.scss │ │ │ ├── index.tsx │ │ │ ├── invite_info.config.ts │ │ │ └── invite_info.tsx │ │ ├── home/ │ │ │ ├── index.config.ts │ │ │ └── index.tsx │ │ ├── payee/ │ │ │ ├── list.config.ts │ │ │ ├── list.scss │ │ │ └── list.tsx │ │ ├── setting/ │ │ │ ├── asset/ │ │ │ │ ├── form.tsx │ │ │ │ ├── index.config.ts │ │ │ │ └── index.tsx │ │ │ ├── budget/ │ │ │ │ ├── index.config.ts │ │ │ │ └── index.tsx │ │ │ ├── category/ │ │ │ │ ├── form.tsx │ │ │ │ ├── index.config.ts │ │ │ │ └── index.tsx │ │ │ ├── chart/ │ │ │ │ ├── category_statement.config.ts │ │ │ │ └── category_statement.tsx │ │ │ ├── child_budget/ │ │ │ │ ├── index.config.ts │ │ │ │ └── index.tsx │ │ │ ├── feedback/ │ │ │ │ ├── index.config.ts │ │ │ │ └── index.tsx │ │ │ ├── messages/ │ │ │ │ ├── detail.config.ts │ │ │ │ ├── detail.tsx │ │ │ │ ├── index.config.ts │ │ │ │ └── index.tsx │ │ │ ├── search/ │ │ │ │ ├── search.config.ts │ │ │ │ └── search.tsx │ │ │ ├── statement_imgs/ │ │ │ │ ├── index.config.ts │ │ │ │ └── index.tsx │ │ │ ├── statements_flow/ │ │ │ │ ├── index.config.ts │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── statements_manage/ │ │ │ │ ├── data_in.config.ts │ │ │ │ ├── data_in.tsx │ │ │ │ ├── data_out.config.ts │ │ │ │ └── data_out.tsx │ │ │ └── user_info/ │ │ │ ├── index.config.ts │ │ │ └── index.tsx │ │ ├── share/ │ │ │ ├── index.config.ts │ │ │ ├── index.tsx │ │ │ ├── public.config.ts │ │ │ └── public.tsx │ │ ├── statement/ │ │ │ ├── form.config.ts │ │ │ └── form.tsx │ │ ├── statement_detail/ │ │ │ ├── index.config.ts │ │ │ └── index.tsx │ │ └── sub/ │ │ └── chart/ │ │ ├── index.config.ts │ │ └── index.tsx │ ├── router/ │ │ └── index.ts │ ├── storage/ │ │ └── index.ts │ ├── stores/ │ │ ├── home_store.ts │ │ ├── index.ts │ │ └── theme_store.ts │ └── utils/ │ ├── echart_option.ts │ └── event.ts └── tsconfig.json
SYMBOL INDEX (1485 symbols across 57 files)
FILE: plugins/view-data-plugin.js
method fn (line 6) | fn(platform) {
FILE: src/api/http-result.ts
class HttpResult (line 1) | class HttpResult {
method constructor (line 9) | constructor (st) {
method isSuccess (line 16) | get isSuccess(): boolean {
FILE: src/api/index.ts
class Api (line 18) | class Api extends Request {
method createLazyService (line 19) | private createLazyService<T>(key: string, Constructor: new (api: Api) ...
method main (line 26) | get main(): Main {
method statements (line 30) | get statements(): Statement {
method users (line 34) | get users(): User {
method categories (line 38) | get categories(): Category {
method assets (line 42) | get assets(): Asset {
method account_books (line 46) | get account_books(): AccountBook {
method finances (line 50) | get finances(): Finance {
method superStatements (line 54) | get superStatements(): SuperStatement {
method superCharts (line 58) | get superCharts(): SuperChart {
method budgets (line 62) | get budgets(): Budget {
method chaos (line 66) | get chaos(): Chaos {
method statistics (line 70) | get statistics(): Statistic {
method messages (line 74) | get messages(): Message {
method payees (line 78) | get payees(): Payee {
method friends (line 82) | get friends(): Friend {
FILE: src/api/logic/account_book.ts
class AccountBook (line 3) | class AccountBook {
method constructor (line 5) | constructor (request: Request) {
method getAccountBooks (line 9) | getAccountBooks() {
method getAccountBook (line 13) | getAccountBook(id) {
method getAccountBookTypes (line 17) | getAccountBookTypes() {
method getCategoriesList (line 21) | getCategoriesList({ accountType }) {
method updateDefaultAccount (line 25) | updateDefaultAccount(accountBook) {
method create (line 29) | create(data) {
method update (line 33) | update(id, data) {
method destroy (line 37) | destroy(id) {
FILE: src/api/logic/asset.ts
class Asset (line 3) | class Asset {
method constructor (line 5) | constructor (request: Request) {
method getSettingList (line 9) | getSettingList({ parentId }) {
method getAssetDetail (line 13) | getAssetDetail(id) {
method deleteAsset (line 17) | deleteAsset(id) {
method getAssetIcon (line 21) | getAssetIcon() {
method updateAsset (line 25) | updateAsset(id, data) {
method create (line 29) | create(data) {
method updateAssetAmount (line 33) | updateAssetAmount(id, amount) {
FILE: src/api/logic/budget.ts
class Budget (line 3) | class Budget {
method constructor (line 5) | constructor (request: Request) {
method getSummary (line 9) | getSummary({
method getParentList (line 16) | getParentList({
method getCategoryBudget (line 23) | getCategoryBudget({category_id, year, month}) {
method updateRootAmount (line 27) | updateRootAmount({amount}) {
method updateCategoryAmount (line 31) | updateCategoryAmount({amount, category_id}) {
FILE: src/api/logic/category.ts
class Category (line 3) | class Category {
method constructor (line 5) | constructor (request: Request) {
method getSettingList (line 9) | getSettingList({ type = 'expend', parent_id = 0 }) {
method getCategoryDetail (line 16) | getCategoryDetail(id) {
method deleteCategory (line 20) | deleteCategory(id) {
method getCategoryIcon (line 24) | getCategoryIcon() {
method updateCategory (line 28) | updateCategory(id, data) {
method create (line 32) | create(data) {
FILE: src/api/logic/chaos.ts
class Chaos (line 3) | class Chaos {
method constructor (line 5) | constructor (request: Request) {
method submitFeedback (line 9) | async submitFeedback({ content }) {
FILE: src/api/logic/finance.ts
type AssetStatementParams (line 2) | type AssetStatementParams = {
class Finance (line 8) | class Finance {
method constructor (line 10) | constructor (request: Request) {
method index (line 14) | async index () {
method getAssetDetail (line 18) | async getAssetDetail(assetId: number) {
method getAssetTimeline (line 22) | async getAssetTimeline(assetId: number) {
method getAssetStatements (line 26) | async getAssetStatements(params: AssetStatementParams) {
method updateAmountVisible (line 30) | async updateAmountVisible({visible}) {
FILE: src/api/logic/friend.ts
class Friend (line 5) | class Friend {
method constructor (line 8) | constructor(request: Request) {
method list (line 12) | public async list({
method invite (line 19) | public async invite(data: FriendInviteRequest) {
method information (line 24) | public async information(token: string) {
method accept (line 29) | public async accept(token: string, nickname: string) {
method remove (line 34) | public async remove(data) {
method update (line 39) | public async update(data) {
FILE: src/api/logic/main.ts
class Main (line 4) | class Main {
method constructor (line 7) | constructor(request: Request) {
method header (line 11) | public async header(): Promise<HeaderResponse> {
method statements (line 16) | public async statements(range: string): Promise<StatementsResponse> {
FILE: src/api/logic/message.ts
class Message (line 3) | class Message {
method constructor (line 5) | constructor (request: Request) {
method getList (line 9) | async getList () {
method getMessage (line 13) | async getMessage (id) {
FILE: src/api/logic/payee.ts
type PayeeType (line 4) | interface PayeeType {
class Payee (line 9) | class Payee {
method constructor (line 11) | constructor (request: Request) {
method list (line 15) | async list(): Promise<PayeeType[]> {
method create (line 21) | async create(payee: PayeeType): Promise<PayeeType> {
method update (line 27) | async update(payeeId: string, payee: PayeeType): Promise<PayeeType> {
method delete (line 33) | async delete(payee: PayeeType): Promise<boolean> {
FILE: src/api/logic/statement.ts
class Statement (line 5) | class Statement {
method constructor (line 7) | constructor (request: Request) {
method categoriesWithForm (line 12) | async categoriesWithForm(type: 'income' | 'expend') {
method assetsWithForm (line 29) | async assetsWithForm(params={}) {
method categoryFrequent (line 46) | categoryFrequent(type: 'income' | 'expend') {
method assetFrequent (line 53) | assetFrequent() {
method list (line 58) | list(params) {
method getListByToken (line 62) | getListByToken(token, orderBy) {
method create (line 67) | create(data) {
method update (line 72) | update(statementId, data) {
method getStatement (line 77) | getStatement(statementId: number) {
method deleteStatement (line 82) | deleteStatement(statementId: number) {
method searchStatements (line 87) | searchStatements(keyword: string) {
method getStatementImages (line 92) | getStatementImages() {
method generateShareToken (line 96) | generateShareToken(params) {
method pre_check_export (line 100) | pre_check_export() {
method export_excel (line 104) | async export_excel (timeRange: string) {
method targetObjects (line 117) | targetObjects(statementType: string) {
method removeAvatar (line 121) | removeAvatar(statementId: number, avatar_id: number) {
method defaultCategoryAsset (line 125) | defaultCategoryAsset(statementType: string) {
FILE: src/api/logic/statistic.ts
class Statistic (line 2) | class Statistic {
method constructor (line 4) | constructor (request: Request) {
method getCalendarData (line 8) | getCalendarData(date: string) {
method getOverviewHeader (line 14) | getOverviewHeader(date: string) {
method getOverviewStatements (line 20) | getOverviewStatements(date: string) {
method getRate (line 26) | getRate(date: string, type: string) {
FILE: src/api/logic/superChart.ts
class SuperChart (line 3) | class SuperChart {
method constructor (line 5) | constructor (request: Request) {
method getHeader (line 9) | getHeader(params) {
method getPieData (line 13) | getPieData(params) {
method getWeekData (line 17) | getWeekData(params) {
method getLineData (line 21) | getLineData({ year }) {
method getCategoriesTop (line 25) | getCategoriesTop({ year, month }) {
method getTableSumary (line 29) | getTableSumary({ year, month }) {
FILE: src/api/logic/superStatement.ts
class SuperStatement (line 3) | class SuperStatement {
method constructor (line 5) | constructor (request: Request) {
method getTime (line 9) | getTime() {
method getStatements (line 13) | getStatements(params) {
FILE: src/api/logic/user.ts
class User (line 3) | class User {
method constructor (line 5) | constructor (request: Request) {
method getSettingsData (line 9) | getSettingsData() {
method getUserInfo (line 13) | getUserInfo() {
method updateUserInfo (line 17) | updateUserInfo(params) {
method loginPc (line 21) | loginPc(code) {
FILE: src/api/request.ts
class RequestManager (line 5) | class RequestManager {
method getStoredToken (line 8) | private static getStoredToken() {
method setStoredToken (line 20) | private static setStoredToken(token: string) {
method get (line 28) | static async get(url, endpoint, code): Promise<any> {
method delCache (line 61) | static async delCache() {
class Request (line 67) | class Request {
method constructor (line 69) | constructor (endpoint: string) {
method get (line 73) | get (path, data?, options = {}) {
method post (line 77) | post (path, data, options = {}): Promise<HttpResult> {
method put (line 81) | put (path, data, options = {}): Promise<HttpResult> {
method delete (line 85) | delete (path, data={}, options = {}): Promise<HttpResult> {
method upload (line 89) | async upload (file_path, formData) {
method getAccessToken (line 106) | async getAccessToken(): Promise<string> {
method request (line 116) | async request (method, path, data, options = {}): Promise<HttpResult> {
FILE: src/api/types.ts
type User (line 1) | interface User {
type FailureResponse (line 8) | type FailureResponse = {
type AccountBook (line 15) | interface AccountBook {
type HeaderMessage (line 20) | interface HeaderMessage {
type HeaderResponse (line 25) | interface HeaderResponse {
type Statement (line 33) | interface Statement {
type StatementsResponse (line 54) | interface StatementsResponse {
type FriendInviteRequest (line 59) | interface FriendInviteRequest {
type FriendInviteSuccessResponse (line 65) | type FriendInviteSuccessResponse = {
type FriendInviteResponse (line 70) | type FriendInviteResponse = FriendInviteSuccessResponse | FailureResponse
type InviteInfo (line 74) | interface InviteInfo {
type InviteInfoSuccessResponse (line 80) | interface InviteInfoSuccessResponse {
type InviteInfoResponse (line 85) | type InviteInfoResponse = InviteInfoSuccessResponse | FailureResponse
FILE: src/app.ts
class App (line 5) | class App extends Component {
method onLaunch (line 6) | onLaunch () {
method render (line 27) | render () {
FILE: src/assets/echarts.js
function __extends (line 32) | function __extends(d, b) {
function Browser (line 44) | function Browser() {
function Env (line 56) | function Env() {
function detect (line 87) | function detect(ua, env) {
function getTextWidthMap (line 130) | function getTextWidthMap(mapStr) {
function setPlatformAPI (line 199) | function setPlatformAPI(newPlatformApis) {
function guid (line 228) | function guid() {
function logError (line 232) | function logError() {
function clone$3 (line 244) | function clone$3(source) {
function merge (line 287) | function merge(target, source, overwrite) {
function mergeAll (line 308) | function mergeAll(targetAndSources, overwrite) {
function extend (line 318) | function extend(target, source) {
function defaults (line 332) | function defaults(target, source, overlay) {
function indexOf (line 348) | function indexOf(array, value) {
function inherits (line 364) | function inherits(clazz, baseClazz) {
function mixin (line 382) | function mixin(target, source, override) {
function isArrayLike (line 403) | function isArrayLike(data) {
function each$4 (line 415) | function each$4(arr, cb, context) {
function map$1 (line 435) | function map$1(arr, cb, context) {
function reduce (line 457) | function reduce(arr, cb, memo, context) {
function filter (line 469) | function filter(arr, cb, context) {
function find (line 493) | function find(arr, cb, context) {
function keys (line 505) | function keys(obj) {
function bindPolyfill (line 525) | function bindPolyfill(func, context) {
function curry$1 (line 539) | function curry$1(func) {
function isArray (line 551) | function isArray(value) {
function isFunction (line 559) | function isFunction(value) {
function isString (line 563) | function isString(value) {
function isStringSafe (line 567) | function isStringSafe(value) {
function isNumber (line 571) | function isNumber(value) {
function isObject$2 (line 575) | function isObject$2(value) {
function isBuiltInObject (line 580) | function isBuiltInObject(value) {
function isTypedArray (line 584) | function isTypedArray(value) {
function isDom (line 588) | function isDom(value) {
function isGradientObject (line 592) | function isGradientObject(value) {
function isImagePatternObject (line 596) | function isImagePatternObject(value) {
function isRegExp (line 600) | function isRegExp(value) {
function eqNaN (line 604) | function eqNaN(value) {
function retrieve (line 608) | function retrieve() {
function retrieve2 (line 622) | function retrieve2(value0, value1) {
function retrieve3 (line 626) | function retrieve3(value0, value1, value2) {
function slice (line 630) | function slice(arr) {
function normalizeCssArray$1 (line 640) | function normalizeCssArray$1(val) {
function assert (line 656) | function assert(condition, message) {
function trim (line 662) | function trim(str) {
function setAsPrimitive (line 674) | function setAsPrimitive(obj) {
function isPrimitive (line 678) | function isPrimitive(obj) {
function MapPolyfill (line 683) | function MapPolyfill() {
function maybeNativeMap (line 729) | function maybeNativeMap() {
function HashMap (line 734) | function HashMap(obj) {
function createHashMap (line 776) | function createHashMap(obj) {
function concatArray (line 780) | function concatArray(a, b) {
function createObject (line 796) | function createObject(proto, properties) {
function disableUserSelect (line 815) | function disableUserSelect(dom) {
function hasOwn (line 823) | function hasOwn(own, prop) {
function noop (line 827) | function noop() {}
function create$1 (line 884) | function create$1(x, y) {
function copy$1 (line 896) | function copy$1(out, v) {
function clone$2 (line 902) | function clone$2(v) {
function set$1 (line 906) | function set$1(out, a, b) {
function add (line 912) | function add(out, v1, v2) {
function scaleAndAdd (line 918) | function scaleAndAdd(out, v1, v2, a) {
function sub (line 924) | function sub(out, v1, v2) {
function len (line 930) | function len(v) {
function lenSquare (line 936) | function lenSquare(v) {
function mul$1 (line 942) | function mul$1(out, v1, v2) {
function div (line 948) | function div(out, v1, v2) {
function dot (line 954) | function dot(v1, v2) {
function scale$2 (line 958) | function scale$2(out, v, s) {
function normalize$1 (line 964) | function normalize$1(out, v) {
function distance (line 978) | function distance(v1, v2) {
function distanceSquare (line 984) | function distanceSquare(v1, v2) {
function negate (line 990) | function negate(out, v) {
function lerp$1 (line 996) | function lerp$1(out, v1, v2, t) {
function applyTransform$1 (line 1002) | function applyTransform$1(out, v, m) {
function min$1 (line 1010) | function min$1(out, v1, v2) {
function max$1 (line 1016) | function max$1(out, v1, v2) {
function Param (line 1052) | function Param(target, e) {
function Draggable (line 1061) | function Draggable(handler) {
function Eventful (line 1133) | function Eventful(eventProcessors) {
function determinant (line 1328) | function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {
function buildTransformer (line 1363) | function buildTransformer(src, dest) {
function transformLocalCoord (line 1391) | function transformLocalCoord(out, elFrom, elTarget, inX, inY) {
function transformCoordWithViewport (line 1395) | function transformCoordWithViewport(out, el, inX, inY, inverse) {
function prepareCoordMarkers (line 1410) | function prepareCoordMarkers(el, saved) {
function preparePointerTransformer (line 1434) | function preparePointerTransformer(markers, saved, inverse) {
function isCanvasEl (line 1455) | function isCanvasEl(el) {
function encodeHTML (line 1468) | function encodeHTML(source) {
function clientToLocal (line 1478) | function clientToLocal(el, e, out, calculate) {
function calculateZrXY (line 1496) | function calculateZrXY(el, e, out) {
function getNativeEvent (line 1518) | function getNativeEvent(e) {
function normalizeEvent (line 1522) | function normalizeEvent(el, e, calculate) {
function getWheelDeltaMayPolyfill (line 1550) | function getWheelDeltaMayPolyfill(e) {
function addEventListener (line 1569) | function addEventListener(el, name, handler, opt) {
function removeEventListener (line 1573) | function removeEventListener(el, name, handler, opt) {
function GestureMgr (line 1584) | function GestureMgr() {
function dist (line 1638) | function dist(pointPair) {
function center (line 1644) | function center(pointPair) {
function create (line 1675) | function create() {
function identity (line 1679) | function identity(out) {
function copy (line 1689) | function copy(out, m) {
function mul (line 1699) | function mul(out, m1, m2) {
function translate (line 1715) | function translate(out, a, v) {
function rotate (line 1725) | function rotate(out, a, rad) {
function scale$1 (line 1743) | function scale$1(out, a, v) {
function invert (line 1755) | function invert(out, a) {
function clone$1 (line 1778) | function clone$1(a) {
function Point (line 1798) | function Point(x, y) {
function BoundingRect (line 1966) | function BoundingRect(x, y, width, height) {
function makeEventPacket (line 2194) | function makeEventPacket(eveType, targetInfo, event) {
function stopEvent (line 2214) | function stopEvent() {
function EmptyProxy (line 2221) | function EmptyProxy() {
function HoveredResult (line 2236) | function HoveredResult(x, y) {
function Handler (line 2250) | function Handler(storage, painter, proxy, painterRoot, pointerSize) {
function isHover (line 2486) | function isHover(displayable, x, y) {
function setHoverTarget (line 2519) | function setHoverTarget(list, out, x, y, exclude) {
function isOutsideBoundary (line 2535) | function isOutsideBoundary(handlerInstance, x, y) {
function minRunLength (line 2543) | function minRunLength(n) {
function makeAscendingRun (line 2554) | function makeAscendingRun(array, lo, hi, compare) {
function reverseRun (line 2576) | function reverseRun(array, lo, hi) {
function binaryInsertionSort (line 2586) | function binaryInsertionSort(array, lo, hi, start, compare) {
function gallopLeft (line 2632) | function gallopLeft(value, array, start, length, hint, compare) {
function gallopRight (line 2691) | function gallopRight(value, array, start, length, hint, compare) {
function TimSort (line 2750) | function TimSort(array, compare) {
function sort (line 3147) | function sort(array, compare, lo, hi) {
function logInvalidZError (line 3201) | function logInvalidZError() {
function shapeCompareFunc (line 3210) | function shapeCompareFunc(a, b) {
function Storage (line 3223) | function Storage() {
function isAroundZero (line 3622) | function isAroundZero(val) {
function isNotAroundZero$1 (line 3626) | function isNotAroundZero$1(val) {
function cubicAt (line 3630) | function cubicAt(p0, p1, p2, p3, t) {
function cubicDerivativeAt (line 3635) | function cubicDerivativeAt(p0, p1, p2, p3, t) {
function cubicRootAt (line 3640) | function cubicRootAt(p0, p1, p2, p3, val, roots) {
function cubicExtrema (line 3723) | function cubicExtrema(p0, p1, p2, p3, extrema) {
function cubicSubdivide (line 3760) | function cubicSubdivide(p0, p1, p2, p3, t, out) {
function cubicProjectPoint (line 3777) | function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {
function cubicLength (line 3837) | function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {
function quadraticAt (line 3857) | function quadraticAt(p0, p1, p2, t) {
function quadraticDerivativeAt (line 3862) | function quadraticDerivativeAt(p0, p1, p2, t) {
function quadraticRootAt (line 3866) | function quadraticRootAt(p0, p1, p2, val, roots) {
function quadraticExtremum (line 3907) | function quadraticExtremum(p0, p1, p2) {
function quadraticSubdivide (line 3917) | function quadraticSubdivide(p0, p1, p2, t, out) {
function quadraticProjectPoint (line 3929) | function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {
function quadraticLength (line 3985) | function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {
function createCubicEasingFunc (line 4007) | function createCubicEasingFunc(cubicEasingStr) {
function Clip (line 4029) | function Clip(opts) {
function Entry (line 4098) | function Entry(val) {
function LinkedList (line 4106) | function LinkedList() {
function LRU (line 4162) | function LRU(maxSize) {
function clampCssByte (line 4378) | function clampCssByte(i) {
function clampCssAngle (line 4383) | function clampCssAngle(i) {
function clampCssFloat (line 4388) | function clampCssFloat(f) {
function parseCssInt (line 4392) | function parseCssInt(val) {
function parseCssFloat (line 4402) | function parseCssFloat(val) {
function cssHueToRgb (line 4412) | function cssHueToRgb(m1, m2, h) {
function lerpNumber (line 4434) | function lerpNumber(a, b, p) {
function setRgba (line 4438) | function setRgba(out, r, g, b, a) {
function copyRgba (line 4446) | function copyRgba(out, a) {
function putToCache (line 4457) | function putToCache(colorStr, rgbaArr) {
function parse (line 4465) | function parse(colorStr, rgbaArr) {
function hsla2rgba (line 4572) | function hsla2rgba(hsla, rgba) {
function rgba2hsla (line 4588) | function rgba2hsla(rgba) {
function lift (line 4643) | function lift(color, level) {
function toHex (line 4665) | function toHex(color) {
function fastLerp (line 4673) | function fastLerp(normalizedValue, colors, out) {
function lerp (line 4694) | function lerp(normalizedValue, colors, fullOutput) {
function modifyHSL (line 4716) | function modifyHSL(color, h, s, l) {
function modifyAlpha (line 4728) | function modifyAlpha(color, alpha) {
function stringify (line 4737) | function stringify(arrColor, type) {
function lum (line 4751) | function lum(color, backgroundLum) {
function random (line 4756) | function random() {
function isLinearGradient (line 4776) | function isLinearGradient(val) {
function isRadialGradient (line 4780) | function isRadialGradient(val) {
function interpolateNumber$1 (line 4807) | function interpolateNumber$1(p0, p1, percent) {
function interpolate1DArray (line 4811) | function interpolate1DArray(out, p0, p1, percent) {
function interpolate2DArray (line 4821) | function interpolate2DArray(out, p0, p1, percent) {
function add1DArray (line 4838) | function add1DArray(out, p0, p1, sign) {
function add2DArray (line 4848) | function add2DArray(out, p0, p1, sign) {
function fillColorStops (line 4865) | function fillColorStops(val0, val1) {
function fillArray (line 4883) | function fillArray(val0, val1, arrDim) {
function cloneValue (line 4923) | function cloneValue(value) {
function rgba2String (line 4943) | function rgba2String(rgba) {
function guessArrayDim (line 4951) | function guessArrayDim(value) {
function isGradientValueType (line 4963) | function isGradientValueType(valType) {
function isArrayValueType (line 4967) | function isArrayValueType(valType) {
function Track (line 4974) | function Track(propName) {
function Animator (line 5263) | function Animator(target, loop, allowDiscreteAnimation, additiveTo) {
function getTime (line 5678) | function getTime() {
function Animation (line 5685) | function Animation(opts) {
function step (line 5788) | function step() {
function isPointerFromTouch (line 5883) | function isPointerFromTouch(event) {
function setTouchTimer (line 5888) | function setTouchTimer(scope) {
function markTouch (line 5902) | function markTouch(event) {
function normalizeGlobalEvent (line 5906) | function normalizeGlobalEvent(instance, event) {
function isLocalEl (line 5910) | function isLocalEl(instance, el) {
function FakeGlobalEvent (line 5922) | function FakeGlobalEvent(instance, event) {
function mountLocalDOMEventListeners (line 6057) | function mountLocalDOMEventListeners(instance, scope) {
function mountGlobalDOMEventListeners (line 6088) | function mountGlobalDOMEventListeners(instance, scope) {
function mountSingleDOMEventListener (line 6111) | function mountSingleDOMEventListener(scope, nativeEventName, listener, o...
function unmountDOMEventListeners (line 6117) | function unmountDOMEventListeners(scope) {
function DOMHandlerScope (line 6130) | function DOMHandlerScope(domTarget, domHandlers) {
function HandlerDomProxy (line 6144) | function HandlerDomProxy(dom, painterRoot) {
function isNotAroundZero (line 6199) | function isNotAroundZero(val) {
function Transformable (line 6209) | function Transformable() {}
function copyTransform (line 6458) | function copyTransform(target, source) {
function getWidth (line 6467) | function getWidth(text, font) {
function innerGetBoundingRect (line 6485) | function innerGetBoundingRect(text, font, textAlign, textBaseline) {
function getBoundingRect (line 6494) | function getBoundingRect(text, font, textAlign, textBaseline) {
function adjustTextX (line 6512) | function adjustTextX(x, width, textAlign) {
function adjustTextY (line 6522) | function adjustTextY(y, height, verticalAlign) {
function getLineHeight (line 6532) | function getLineHeight(font) {
function parsePercent$1 (line 6536) | function parsePercent$1(value, maxValue) {
function calculateTextPosition (line 6548) | function calculateTextPosition(out, opts, rect) {
function Element (line 6671) | function Element(props) {
function logDeprecatedError (line 7589) | function logDeprecatedError(key, xKey, yKey) {
function createLegacyProperty (line 7596) | function createLegacyProperty(key, privateKey, xKey, yKey) {
function animateTo (line 7654) | function animateTo(animatable, target, cfg, animationProps, reverse) {
function copyArrShallow (line 7711) | function copyArrShallow(source, target, len) {
function is2DArray (line 7717) | function is2DArray(value) {
function copyValue (line 7721) | function copyValue(target, source, key) {
function isValueSame (line 7760) | function isValueSame(val1, val2) {
function is1DArraySame (line 7764) | function is1DArraySame(arr0, arr1) {
function animateToShallow (line 7780) | function animateToShallow(animatable, topKey, animateObj, target, cfg, a...
function Group (line 7898) | function Group(opts) {
function delInstance (line 8138) | function delInstance(id) {
function isDarkMode (line 8142) | function isDarkMode(backgroundColor) {
function ZRender (line 8166) | function ZRender(id, dom, opts) {
function init$1 (line 8403) | function init$1(dom, opts) {
function dispose$1 (line 8409) | function dispose$1(zr) {
function disposeAll (line 8413) | function disposeAll() {
function getInstance (line 8423) | function getInstance(id) {
function registerPainter (line 8427) | function registerPainter(name, Ctor) {
function _trim (line 8446) | function _trim(str) {
function linearMap (line 8458) | function linearMap(val, domain, range, clamp) {
function parsePercent (line 8507) | function parsePercent(percent, all) {
function round$1 (line 8536) | function round$1(x, precision, returnStr) {
function asc (line 8553) | function asc(arr) {
function getPrecision (line 8564) | function getPrecision(val) {
function getPrecisionSafe (line 8597) | function getPrecisionSafe(val) {
function getPixelPrecision (line 8613) | function getPixelPrecision(dataExtent, pixelExtent) {
function getPercentWithPrecision (line 8635) | function getPercentWithPrecision(valueList, idx, precision) {
function getPercentSeats (line 8655) | function getPercentSeats(valueList, precision) {
function addSafe (line 8708) | function addSafe(val0, val1) {
function remRadian (line 8723) | function remRadian(radian) {
function isRadianAroundZero (line 8733) | function isRadianAroundZero(val) {
function parseDate (line 8757) | function parseDate(value) {
function quantity (line 8808) | function quantity(val) {
function quantityExponent (line 8820) | function quantityExponent(val) {
function nice (line 8851) | function nice(val, round) {
function quantile (line 8897) | function quantile(ascArr, p) {
function reformIntervals (line 8928) | function reformIntervals(list) {
function numericToNumber (line 8980) | function numericToNumber(val) {
function isNumeric (line 8991) | function isNumeric(val) {
function getRandomIdBase (line 9001) | function getRandomIdBase() {
function getGreatestCommonDividor (line 9012) | function getGreatestCommonDividor(a, b) {
function getLeastCommonMultiple (line 9027) | function getLeastCommonMultiple(a, b) {
function outputLog (line 9044) | function outputLog(type, str, onlyOnce) {
function log (line 9059) | function log(str, onlyOnce) {
function warn (line 9063) | function warn(str, onlyOnce) {
function error (line 9067) | function error(str, onlyOnce) {
function deprecateLog (line 9071) | function deprecateLog(str) {
function deprecateReplaceLog (line 9078) | function deprecateReplaceLog(oldOpt, newOpt, scope) {
function makePrintable (line 9094) | function makePrintable() {
function throwError (line 9140) | function throwError(msg) {
function interpolateNumber (line 9144) | function interpolateNumber(p0, p1, percent) {
function normalizeToArray (line 9162) | function normalizeToArray(value) {
function defaultEmphasis (line 9179) | function defaultEmphasis(opt, key, subOpts) {
function getDataItemValue (line 9209) | function getDataItemValue(dataItem) {
function isDataItemOption (line 9218) | function isDataItemOption(dataItem) {
function mappingToExists (line 9253) | function mappingToExists(existings, newCmptOptions, mode) {
function prepareResult (line 9301) | function prepareResult(existings, existingIdIdxMap, mode) {
function mappingById (line 9333) | function mappingById(result, existings, existingIdIdxMap, newCmptOptions) {
function mappingByName (line 9355) | function mappingByName(result, newCmptOptions) {
function mappingByIndex (line 9376) | function mappingByIndex(result, newCmptOptions, brandNew) {
function mappingInReplaceAllMode (line 9414) | function mappingInReplaceAllMode(result, newCmptOptions) {
function makeIdAndName (line 9432) | function makeIdAndName(mapResult) {
function keyExistAndEqual (line 9493) | function keyExistAndEqual(attr, obj1, obj2) {
function makeComparableKey (line 9504) | function makeComparableKey(val) {
function convertOptionIdName (line 9513) | function convertOptionIdName(idOrName, defaultValue) {
function warnInvalidateIdOrName (line 9521) | function warnInvalidateIdOrName(idOrName) {
function isValidIdOrName (line 9527) | function isValidIdOrName(idOrName) {
function isNameSpecified (line 9531) | function isNameSpecified(componentModel) {
function isComponentIdInternal (line 9543) | function isComponentIdInternal(cmptOption) {
function setComponentTypeToKeyInfo (line 9547) | function setComponentTypeToKeyInfo(mappingResult, mainType, componentMod...
function determineSubType (line 9559) | function determineSubType(mainType, newCmptOption, existComponent, compo...
function queryDataIndex (line 9572) | function queryDataIndex(data, payload) {
function makeInner (line 9607) | function makeInner() {
function parseFinder (line 9619) | function parseFinder(ecModel, finderInput, opt) {
function preParseFinder (line 9644) | function preParseFinder(finderInput, opt) {
function queryReferringComponents (line 9690) | function queryReferringComponents(ecModel, mainType, userOption, opt) {
function setAttribute (line 9729) | function setAttribute(dom, key, value) {
function getAttribute (line 9733) | function getAttribute(dom, key) {
function getTooltipRenderMode (line 9737) | function getTooltipRenderMode(renderModeOption) {
function interpolateRawValues (line 9761) | function interpolateRawValues(data, precision, sourceValue, targetValue,...
function parseClassType (line 9805) | function parseClassType(componentType) {
function checkClassType (line 9824) | function checkClassType(componentType) {
function isExtendedClass (line 9828) | function isExtendedClass(clz) {
function enableClassExtend (line 9843) | function enableClassExtend(rootClz, mandatoryMethods) {
function isESClass (line 9894) | function isESClass(fn) {
function mountExtend (line 9913) | function mountExtend(SubClz, SupperClz) {
function enableClassCheck (line 9933) | function enableClassCheck(target) {
function superCall (line 9951) | function superCall(context, methodName) {
function superApply (line 9961) | function superApply(context, methodName, args) {
function enableClassManagement (line 9976) | function enableClassManagement(target) {
function makeStyleMapper (line 10105) | function makeStyleMapper(properties, ignoreParent) {
function AreaStyleMixin (line 10144) | function AreaStyleMixin() {}
function findExistImage (line 10155) | function findExistImage(newImageOrSrc) {
function createOrUpdateImage (line 10164) | function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPay...
function imageOnLoad (line 10197) | function imageOnLoad() {
function isImageReady (line 10211) | function isImageReady(image) {
function truncateText (line 10217) | function truncateText(text, containerWidth, font, ellipsis, options) {
function prepareTruncateOptions (line 10232) | function prepareTruncateOptions(containerWidth, font, ellipsis, options) {
function truncateSingleLine (line 10263) | function truncateSingleLine(textLine, options) {
function estimateLength (line 10296) | function estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {
function parsePlainText (line 10308) | function parsePlainText(text, style) {
function RichTextToken (line 10383) | function RichTextToken() {}
function RichTextLine (line 10389) | function RichTextLine(tokens) {
function RichTextContentBlock (line 10401) | function RichTextContentBlock() {
function parseRichText (line 10414) | function parseRichText(text, style) {
function pushTokens (line 10559) | function pushTokens(block, str, style, wrapInfo, styleName) {
function isAlphabeticLetter (line 10616) | function isAlphabeticLetter(ch) {
function isWordBreakChar (line 10626) | function isWordBreakChar(ch) {
function wrapText (line 10638) | function wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {
function Displayable (line 10777) | function Displayable(props) {
function isDisplayableCulled (line 11121) | function isDisplayableCulled(el, width, height) {
function fromLine (line 11142) | function fromLine(x0, y0, x1, y1, min, max) {
function fromCubic (line 11152) | function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {
function fromQuadratic (line 11185) | function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {
function fromArc (line 11198) | function fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min,...
function modPI2 (line 11276) | function modPI2(radian) {
function normalizeArcAngles (line 11281) | function normalizeArcAngles(angles, anticlockwise) {
function PathProxy (line 11307) | function PathProxy(notSaveData) {
function containStroke$4 (line 12105) | function containStroke$4(x0, y0, x1, y1, lineWidth, x, y) {
function containStroke$3 (line 12132) | function containStroke$3(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {
function containStroke$2 (line 12147) | function containStroke$2(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {
function normalizeRadian (line 12164) | function normalizeRadian(angle) {
function containStroke$1 (line 12176) | function containStroke$1(cx, cy, r, startAngle, endAngle, anticlockwise,...
function windingLine (line 12216) | function windingLine(x0, y0, x1, y1, x, y) {
function isAroundEqual$1 (line 12240) | function isAroundEqual$1(a, b) {
function swapExtrema (line 12247) | function swapExtrema() {
function windingCubic (line 12253) | function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {
function windingQuadratic (line 12312) | function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {
function windingArc (line 12357) | function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {
function containPath (line 12422) | function containPath(path, lineWidth, isStroke, x, y) {
function contain$2 (line 12571) | function contain$2(pathProxy, x, y) {
function containStroke (line 12575) | function containStroke(pathProxy, lineWidth, x, y) {
function Path (line 12609) | function Path(opts) {
function Sub (line 13009) | function Sub(opts) {
function TSpan (line 13062) | function TSpan() {
function isImageLike (line 13136) | function isImageLike(source) {
function ZRImage (line 13143) | function ZRImage() {
function buildPath$2 (line 13202) | function buildPath$2(ctx, shape) {
function subPixelOptimizeLine$1 (line 13284) | function subPixelOptimizeLine$1(outputShape, inputShape, style) {
function subPixelOptimizeRect$1 (line 13314) | function subPixelOptimizeRect$1(outputShape, inputShape, style) {
function subPixelOptimize$1 (line 13340) | function subPixelOptimize$1(position, lineWidth, positiveOrNegative) {
function RectShape (line 13350) | function RectShape() {
function Rect (line 13365) | function Rect(opts) {
function ZRText (line 13439) | function ZRText(opts) {
function parseFontSize (line 13936) | function parseFontSize(fontSize) {
function setSeparateFont (line 13946) | function setSeparateFont(targetStyle, sourceStyle) {
function hasSeparateFont (line 13957) | function hasSeparateFont(style) {
function normalizeTextStyle (line 13961) | function normalizeTextStyle(style) {
function normalizeStyle (line 13967) | function normalizeStyle(style) {
function getStroke (line 13984) | function getStroke(stroke, lineWidth) {
function getFill (line 13988) | function getFill(fill) {
function getTextXForPadding (line 13992) | function getTextXForPadding(x, textAlign, textPadding) {
function getStyleText (line 13996) | function getStyleText(style) {
function needDrawBackground (line 14002) | function needDrawBackground(style) {
function hasFillOrStroke (line 14045) | function hasFillOrStroke(fillOrStroke) {
function liftColor (line 14052) | function liftColor(color$1) {
function doChangeHoverState (line 14077) | function doChangeHoverState(el, stateName, hoverStateEnum) {
function singleEnterEmphasis (line 14085) | function singleEnterEmphasis(el) {
function singleLeaveEmphasis (line 14091) | function singleLeaveEmphasis(el) {
function singleEnterBlur (line 14099) | function singleEnterBlur(el) {
function singleLeaveBlur (line 14103) | function singleLeaveBlur(el) {
function singleEnterSelect (line 14109) | function singleEnterSelect(el) {
function singleLeaveSelect (line 14113) | function singleLeaveSelect(el) {
function updateElementState (line 14117) | function updateElementState(el, updater, commonParam) {
function traverseUpdateState (line 14121) | function traverseUpdateState(el, updater, commonParam) {
function setStatesFlag (line 14128) | function setStatesFlag(el, stateName) {
function getFromStateStyle (line 14147) | function getFromStateStyle(el, props, toStateName, defaultValue) {
function createEmphasisDefaultState (line 14169) | function createEmphasisDefaultState(el, stateName, targetStates, state) {
function createSelectDefaultState (line 14224) | function createSelectDefaultState(el, stateName, state) {
function createBlurDefaultState (line 14238) | function createBlurDefaultState(el, stateName, state) {
function elementStateProxy (line 14260) | function elementStateProxy(stateName, targetStates) {
function setDefaultStateProxy (line 14282) | function setDefaultStateProxy(el) {
function enterEmphasisWhenMouseOver (line 14296) | function enterEmphasisWhenMouseOver(el, e) {
function leaveEmphasisWhenMouseOut (line 14301) | function leaveEmphasisWhenMouseOut(el, e) {
function enterEmphasis (line 14306) | function enterEmphasis(el, highlightDigit) {
function leaveEmphasis (line 14311) | function leaveEmphasis(el, highlightDigit) {
function enterBlur (line 14315) | function enterBlur(el) {
function leaveBlur (line 14319) | function leaveBlur(el) {
function enterSelect (line 14323) | function enterSelect(el) {
function leaveSelect (line 14327) | function leaveSelect(el) {
function shouldSilent (line 14331) | function shouldSilent(el, e) {
function allLeaveBlur (line 14335) | function allLeaveBlur(api) {
function blurSeries (line 14362) | function blurSeries(targetSeriesIndex, focus, blurScope, api) {
function blurComponent (line 14444) | function blurComponent(componentMainType, componentIndex, api) {
function blurSeriesFromHighlightPayload (line 14467) | function blurSeriesFromHighlightPayload(seriesModel, payload, api) {
function findComponentHighDownDispatchers (line 14507) | function findComponentHighDownDispatchers(componentMainType, componentIn...
function handleGlobalMouseOverForHighDown (line 14551) | function handleGlobalMouseOverForHighDown(dispatcher, e, api) {
function handleGlobalMouseOutForHighDown (line 14588) | function handleGlobalMouseOutForHighDown(dispatcher, e, api) {
function toggleSelectionFromPayload (line 14606) | function toggleSelectionFromPayload(seriesModel, payload, api) {
function updateSeriesElementSelection (line 14622) | function updateSeriesElementSelection(seriesModel) {
function getAllSelectedIndices (line 14633) | function getAllSelectedIndices(ecModel) {
function enableHoverEmphasis (line 14667) | function enableHoverEmphasis(el, focus, blurScope) {
function disableHoverEmphasis (line 14673) | function disableHoverEmphasis(el) {
function toggleHoverEmphasis (line 14677) | function toggleHoverEmphasis(el, focus, blurScope, isDisabled) {
function enableHoverFocus (line 14681) | function enableHoverFocus(el, focus, blurScope) {
function setStatesStylesFromModel (line 14709) | function setStatesStylesFromModel(el, itemModel, styleType, // default i...
function setAsHighDownDispatcher (line 14742) | function setAsHighDownDispatcher(el, asDispatcher) {
function isHighDownDispatcher (line 14762) | function isHighDownDispatcher(el) {
function getHighlightDigit (line 14775) | function getHighlightDigit(highlightKey) {
function isSelectChangePayload (line 14785) | function isSelectChangePayload(payload) {
function isHighDownPayload (line 14790) | function isHighDownPayload(payload) {
function savePathStates (line 14795) | function savePathStates(el) {
function transformPath (line 14809) | function transformPath(path, m) {
function vMag (line 14900) | function vMag(v) {
function vRatio (line 14904) | function vRatio(u, v) {
function vAngle (line 14908) | function vAngle(u, v) {
function processArc (line 14912) | function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {
function createPathProxyFromString (line 14952) | function createPathProxyFromString(data) {
function SVGPath (line 15205) | function SVGPath() {
function isPathProxy (line 15214) | function isPathProxy(path) {
function createPathOptions (line 15218) | function createPathOptions(str, opts) {
function createFromString (line 15244) | function createFromString(str, opts) {
function extendFromString (line 15248) | function extendFromString(str, defaultOpts) {
function mergePath$1 (line 15268) | function mergePath$1(pathEls, opts) {
function CircleShape (line 15295) | function CircleShape() {
function Circle (line 15307) | function Circle(opts) {
function EllipseShape (line 15326) | function EllipseShape() {
function Ellipse (line 15339) | function Ellipse(opts) {
function intersect (line 15379) | function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
function computeCornerTangents (line 15394) | function computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {
function normalizeCornerRadius (line 15436) | function normalizeCornerRadius(cr) {
function buildPath$1 (line 15462) | function buildPath$1(ctx, shape) {
function SectorShape (line 15617) | function SectorShape() {
function Sector (line 15634) | function Sector(opts) {
function RingShape (line 15656) | function RingShape() {
function Ring (line 15669) | function Ring(opts) {
function smoothBezier (line 15692) | function smoothBezier(points, smooth, isLoop, constraint) {
function buildPath (line 15765) | function buildPath(ctx, shape, closePath) {
function PolygonShape (line 15794) | function PolygonShape() {
function Polygon (line 15806) | function Polygon(opts) {
function PolylineShape (line 15824) | function PolylineShape() {
function Polyline (line 15837) | function Polyline(opts) {
function LineShape (line 15863) | function LineShape() {
function Line (line 15877) | function Line(opts) {
function BezierCurveShape (line 15939) | function BezierCurveShape() {
function someVectorAt (line 15952) | function someVectorAt(shape, t, isTangent) {
function BezierCurve (line 15966) | function BezierCurve(opts) {
function ArcShape (line 16040) | function ArcShape() {
function Arc (line 16055) | function Arc(opts) {
function CompoundPath (line 16091) | function CompoundPath() {
function Gradient (line 16152) | function Gradient(colorStops) {
function LinearGradient (line 16169) | function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {
function RadialGradient (line 16187) | function RadialGradient(x, y, r, colorStops, globalCoord) {
function OrientedBoundingRect (line 16207) | function OrientedBoundingRect(rect, transform) {
function IncrementalDisplayable (line 16351) | function IncrementalDisplayable() {
function getAnimationConfig (line 16490) | function getAnimationConfig(animationType, animatableModel, dataIndex, /...
function animateOrSetProps (line 16546) | function animateOrSetProps(animationType, el, props, animatableModel, da...
function updateProps$1 (line 16615) | function updateProps$1(el, props, // TODO: TYPE AnimatableModel
function initProps (line 16629) | function initProps(el, props, animatableModel, dataIndex, cb, during) {
function isElementRemoved (line 16638) | function isElementRemoved(el) {
function removeElement (line 16658) | function removeElement(el, props, animatableModel, dataIndex, cb, during) {
function fadeOutDisplayable (line 16667) | function fadeOutDisplayable(el, animatableModel, dataIndex, done) {
function removeElementWithFadeOut (line 16677) | function removeElementWithFadeOut(el, animatableModel, dataIndex) {
function saveOldStyle (line 16703) | function saveOldStyle(el) {
function extendShape (line 16714) | function extendShape(opts) {
function extendPath (line 16723) | function extendPath(pathData, opts) {
function registerShape (line 16739) | function registerShape(name, ShapeClass) {
function getShapeClass (line 16771) | function getShapeClass(name) {
function makePath (line 16785) | function makePath(pathData, opts, rect, layout) {
function makeImage (line 16807) | function makeImage(imageUrl, rect, layout) {
function centerGraphic (line 16837) | function centerGraphic(rect, boundingRect) {
function resizePath (line 16867) | function resizePath(path, rect) {
function subPixelOptimizeLine (line 16881) | function subPixelOptimizeLine(shape, lineWidth) {
function subPixelOptimizeRect (line 16892) | function subPixelOptimizeRect(param) {
function getTransform (line 16915) | function getTransform(target, ancestor) {
function applyTransform (line 16936) | function applyTransform(target, transform, invert$1) {
function transformDirection (line 16955) | function transformDirection(direction, transform, invert) {
function isNotGroup (line 16964) | function isNotGroup(el) {
function isPath (line 16968) | function isPath(el) {
function groupTransition (line 16977) | function groupTransition(g1, g2, animatableModel) {
function clipPointsByRect (line 17020) | function clipPointsByRect(points, rect) {
function clipRectByRect (line 17038) | function clipRectByRect(targetRect, rect) {
function createIcon (line 17055) | function createIcon(iconStr, // Support 'image://' or 'path://' or direc...
function linePolygonIntersect (line 17082) | function linePolygonIntersect(a1x, a1y, a2x, a2y, points) {
function lineLineIntersect (line 17101) | function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {
function crossProduct2d (line 17140) | function crossProduct2d(x1, y1, x2, y2) {
function nearZero (line 17144) | function nearZero(val) {
function setTooltipConfig (line 17148) | function setTooltipConfig(opt) {
function traverseElement (line 17186) | function traverseElement(el, cb) {
function traverseElements (line 17199) | function traverseElements(els, cb) {
function setLabelText (line 17276) | function setLabelText(label, labelTexts) {
function getLabelText (line 17293) | function getLabelText(opt, stateModels, interpolatedValue) {
function setLabelStyle (line 17323) | function setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified ...
function getLabelStatesModels (line 17419) | function getLabelStatesModels(itemModel, labelName) {
function createTextStyle$1 (line 17437) | function createTextStyle$1(textStyleModel, specifiedTextStyle, // Fixed ...
function createTextConfig (line 17447) | function createTextConfig(textStyleModel, opt, isNotNormal) {
function setTextStyleCommon (line 17491) | function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal,...
function getRichItemNames (line 17564) | function getRichItemNames(textStyleModel) {
function setTokenTextStyle (line 17591) | function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, o...
function getFont (line 17741) | function getFont(opt, ecModel) {
function setLabelValueAnimation (line 17749) | function setLabelValueAnimation(label, labelStatesModels, value, getDefa...
function animateLabelValue (line 17767) | function animateLabelValue(textEl, dataIndex, data, animatableModel, lab...
function TextStyleMixin (line 17807) | function TextStyleMixin() {}
function LineStyleMixin (line 17859) | function LineStyleMixin() {}
function ItemStyleMixin (line 17876) | function ItemStyleMixin() {}
function Model (line 17888) | function Model(option, parentModel, ecModel) {
function getUID (line 18040) | function getUID(type) {
function enableSubTypeDefaulter (line 18050) | function enableSubTypeDefaulter(target) {
function enableTopologicalTravel (line 18082) | function enableTopologicalTravel(entity, dependencyGetter) {
function inheritDefaultOption (line 18195) | function inheritDefaultOption(superOption, subOption) {
function registerLocale (line 18518) | function registerLocale(locale, localeObj) {
function createLocaleObject (line 18527) | function createLocaleObject(locale) {
function getLocaleModel (line 18541) | function getLocaleModel(lang) {
function getDefaultLocaleModel (line 18545) | function getDefaultLocaleModel() {
function pad (line 18580) | function pad(str, len) {
function getPrimaryTimeUnit (line 18585) | function getPrimaryTimeUnit(timeUnit) {
function isPrimaryTimeUnit (line 18605) | function isPrimaryTimeUnit(timeUnit) {
function getDefaultFormatPrecisionOfInterval (line 18609) | function getDefaultFormatPrecisionOfInterval(timeUnit) {
function format$1 (line 18624) | function format$1( // Note: The result based on `isUTC` are totally diff...
function leveledFormat (line 18647) | function leveledFormat(tick, idx, formatter, lang, isUTC) {
function getUnitFromValue (line 18697) | function getUnitFromValue(value, isUTC) {
function getUnitValue (line 18729) | function getUnitValue(value, unit, isUTC) {
function fullYearGetterName (line 18766) | function fullYearGetterName(isUTC) {
function monthGetterName (line 18770) | function monthGetterName(isUTC) {
function dateGetterName (line 18774) | function dateGetterName(isUTC) {
function hoursGetterName (line 18778) | function hoursGetterName(isUTC) {
function minutesGetterName (line 18782) | function minutesGetterName(isUTC) {
function secondsGetterName (line 18786) | function secondsGetterName(isUTC) {
function millisecondsGetterName (line 18790) | function millisecondsGetterName(isUTC) {
function fullYearSetterName (line 18794) | function fullYearSetterName(isUTC) {
function monthSetterName (line 18798) | function monthSetterName(isUTC) {
function dateSetterName (line 18802) | function dateSetterName(isUTC) {
function hoursSetterName (line 18806) | function hoursSetterName(isUTC) {
function minutesSetterName (line 18810) | function minutesSetterName(isUTC) {
function secondsSetterName (line 18814) | function secondsSetterName(isUTC) {
function millisecondsSetterName (line 18818) | function millisecondsSetterName(isUTC) {
function getTextRect (line 18822) | function getTextRect(text, font, align, verticalAlign, padding, rich, tr...
function addCommas (line 18842) | function addCommas(x) {
function toCamelCase (line 18851) | function toCamelCase(str, upperCaseFirst) {
function makeValueReadable (line 18872) | function makeValueReadable(value, valueType, useUTC) {
function formatTpl (line 18917) | function formatTpl(tpl, paramsList, encode) {
function getTooltipMarker (line 18945) | function getTooltipMarker(inOpt, extraCssText) {
function formatTime (line 18997) | function formatTime(tpl, value, isUTC) {
function capitalFirst (line 19025) | function capitalFirst(str) {
function convertToColorString (line 19033) | function convertToColorString(color, defaultColor) {
function windowOpen (line 19044) | function windowOpen(link, target) {
function boxLayout (line 19067) | function boxLayout(orient, group, gap, maxWidth, maxHeight) {
function getLayoutRect (line 19158) | function getLayoutRect(positionInfo, containerRect, margin) {
function fetchLayoutMode (line 19256) | function fetchLayoutMode(ins) {
function mergeLayoutParam (line 19287) | function mergeLayoutParam(targetOption, newOption, opt) {
function getLayoutParams (line 19368) | function getLayoutParams(source) {
function copyLayoutParams (line 19378) | function copyLayoutParams(target, source) {
function ComponentModel (line 19392) | function ComponentModel(option, parentModel, ecModel) {
function getDependencies (line 19583) | function getDependencies(componentType) {
function resetSourceDefaulter (line 19751) | function resetSourceDefaulter(ecModel) {
function makeSeriesEncodeForAxisCoordSys (line 19772) | function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, s...
function makeSeriesEncodeForNameBased (line 19855) | function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {
function querySeriesUpstreamDatasetModel (line 19940) | function querySeriesUpstreamDatasetModel(seriesModel) {
function queryDatasetUpstreamDatasetModels (line 19960) | function queryDatasetUpstreamDatasetModels(datasetModel) {
function guessOrdinal (line 19979) | function guessOrdinal(source, dimIndex) {
function doGuessOrdinal (line 19985) | function doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDe...
function concatInternalOptions (line 20099) | function concatInternalOptions(ecModel, mainType, newCmptOptionList) {
function PaletteMixin (line 20126) | function PaletteMixin() {}
function getNearestPalette (line 20141) | function getNearestPalette(palettes, requestColorNum) {
function getFromPalette (line 20160) | function getFromPalette(that, inner, defaultPalette, layeredPalette, nam...
function clearPalette (line 20188) | function clearPalette(that, inner) {
function checkMissingComponents (line 20254) | function checkMissingComponents(option) {
function GlobalModel (line 20272) | function GlobalModel() {
function visitComponent (line 20410) | function visitComponent(mainType) {
function getQueryCond (line 20675) | function getQueryCond(q) {
function doFilter (line 20688) | function doFilter(res) {
function isNotTargetSeries (line 20903) | function isNotTargetSeries(seriesModel, payload) {
function mergeTheme (line 20912) | function mergeTheme(option, theme) {
function queryByIdOrName (line 20935) | function queryByIdOrName(attr, idOrName, cmpts) {
function filterBySubType (line 20957) | function filterBySubType(components, condition) {
function normalizeSetOptionInput (line 20965) | function normalizeSetOptionInput(opts) {
function ExtensionAPI (line 20987) | function ExtensionAPI(ecInstance) {
function CoordinateSystemManager (line 21001) | function CoordinateSystemManager() {
function OptionManager (line 21054) | function OptionManager(api) {
function parseRawOption (line 21257) | function parseRawOption( // `rawOption` May be modified
function applyMediaQuery (line 21341) | function applyMediaQuery(query, ecWidth, ecHeight) {
function compare (line 21366) | function compare(real, expect, operator) {
function indicesEquals (line 21377) | function indicesEquals(indices1, indices2) {
function compatEC2ItemStyle (line 21386) | function compatEC2ItemStyle(opt) {
function convertNormalEmphasis (line 21430) | function convertNormalEmphasis(opt, optType, useExtend) {
function removeEC3NormalStatus (line 21468) | function removeEC3NormalStatus(opt) {
function compatTextStyle (line 21480) | function compatTextStyle(opt, propName) {
function compatEC3CommonStyles (line 21501) | function compatEC3CommonStyles(opt) {
function processSeries (line 21509) | function processSeries(seriesOpt) {
function toArr (line 21617) | function toArr(o) {
function toObj (line 21621) | function toObj(o) {
function globalCompatStyle (line 21625) | function globalCompatStyle(option, isTheme) {
function get (line 21710) | function get(opt, path) {
function set (line 21725) | function set(opt, path, val, overwrite) {
function compatLayoutProperties (line 21746) | function compatLayoutProperties(option) {
function compatBarItemStyle (line 21758) | function compatBarItemStyle(option) {
function compatPieLabel (line 21776) | function compatPieLabel(option) {
function compatSunburstState (line 21789) | function compatSunburstState(option) {
function compatGraphFocus (line 21802) | function compatGraphFocus(option) {
function traverseTree (line 21819) | function traverseTree(data, cb) {
function globalBackwardCompat (line 21828) | function globalBackwardCompat(option, isTheme) {
function dataStack$1 (line 21961) | function dataStack$1(ecModel) {
function calculateStack (line 21992) | function calculateStack(stackInfoList) {
function SourceImpl (line 22056) | function SourceImpl(fields) {
function isSourceInstance (line 22082) | function isSourceInstance(val) {
function createSource (line 22091) | function createSource(sourceData, thisMetaRawOption, // can be null. If ...
function createSourceFromSeriesDataOption (line 22112) | function createSourceFromSeriesDataOption(data) {
function cloneSourceShallow (line 22123) | function cloneSourceShallow(source) {
function detectSourceFormat (line 22138) | function detectSourceFormat(data) {
function determineSourceDimensions (line 22179) | function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, s...
function objectRowsCollectDimensions (line 22256) | function objectRowsCollectDimensions(data) {
function normalizeDimensionsOption (line 22271) | function normalizeDimensionsOption(dimensionsDefine) {
function arrayRowsTravelFirst (line 22320) | function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {
function shouldRetrieveDataByName (line 22334) | function shouldRetrieveDataByName(source) {
function DefaultDataProvider (line 22394) | function DefaultDataProvider(sourceParam, dimSize) {
function appendDataSimply (line 22549) | function appendDataSimply(newData) {
function getRawSourceItemGetter (line 22593) | function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {
function getRawSourceDataCounter (line 22621) | function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {
function getRawSourceValueGetter (line 22642) | function getRawSourceValueGetter(sourceFormat) {
function getMethodMapKey (line 22650) | function getMethodMapKey(sourceFormat, seriesLayoutBy) {
function retrieveRawValue (line 22661) | function retrieveRawValue(data, dataIndex, // If dimIndex is null/undefi...
function DataFormatMixin (line 22698) | function DataFormatMixin() {}
function normalizeTooltipFormatResult (line 22841) | function normalizeTooltipFormatResult(result) {
function createTask (line 22877) | function createTask(define) {
function Task (line 22884) | function Task(define) {
function normalizeModBy (line 22933) | function normalizeModBy(val) {
function sequentialNext (line 23114) | function sequentialNext() {
function modNext (line 23118) | function modNext() {
function parseDataValue (line 23221) | function parseDataValue(value, // For high performance, do not omit the ...
function getRawValueParser (line 23262) | function getRawValueParser(type) {
function FilterOrderComparator (line 23284) | function FilterOrderComparator(op, rval) {
function SortOrderComparator (line 23315) | function SortOrderComparator(order, incomparable) {
function FilterEqualityComparator (line 23365) | function FilterEqualityComparator(isEq, rval) {
function createFilterComparator (line 23432) | function createFilterComparator(op, rval) {
function ExternalSource (line 23444) | function ExternalSource() {}
function createExternalSource (line 23507) | function createExternalSource(internalSource, externalTransform) {
function getRawData (line 23611) | function getRawData(upstream) {
function cloneRawData (line 23625) | function cloneRawData(upstream) {
function getDimensionInfo (line 23658) | function getDimensionInfo(dimensions, dimsByName, dim) {
function cloneAllDimensionInfo (line 23672) | function cloneAllDimensionInfo(dimensions) {
function registerExternalTransform (line 23678) | function registerExternalTransform(externalTransform) {
function applyDataTransform (line 23712) | function applyDataTransform(rawTransOption, sourceList, infoForPrint) {
function applySingleDataTransform (line 23737) | function applySingleDataTransform(transOption, upSourceList, infoForPrin...
function isSupportedSourceFormat (line 23865) | function isSupportedSourceFormat(sourceFormat) {
function getIndicesCtor (line 23892) | function getIndicesCtor(rawCount) {
function getInitialExtent (line 23897) | function getInitialExtent() {
function cloneChunk (line 23901) | function cloneChunk(originalChunk) {
function prepareStore (line 23907) | function prepareStore(store, dimIdx, dimType, end, append) {
function DataStore (line 23936) | function DataStore() {
function getDimValueSimply (line 24999) | function getDimValueSimply(dataItem, property, dataIndex, dimIndex) {
function SourceManager (line 25121) | function SourceManager(sourceHost) {
function disableTransformOptionMerge (line 25433) | function disableTransformOptionMerge(datasetModel) {
function isSeries (line 25438) | function isSeries(sourceHost) {
function doThrow (line 25443) | function doThrow(errMsg) {
function getTooltipTextStyle (line 25449) | function getTooltipTextStyle(textStyle, renderMode) {
function createTooltipMarkup (line 25486) | function createTooltipMarkup(type, option) {
function isSectionFragment (line 25491) | function isSectionFragment(frag) {
function getBuilder (line 25495) | function getBuilder(frag) {
function getBlockGapLevel (line 25499) | function getBlockGapLevel(frag) {
function buildSection (line 25521) | function buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextSt...
function buildNameValue (line 25572) | function buildNameValue(ctx, fragment, topMarginForOuterGap, toolTipText...
function buildTooltipMarkup (line 25611) | function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, or...
function getGap (line 25627) | function getGap(gapLevel) {
function wrapBlockHTML (line 25634) | function wrapBlockHTML(encodedContent, topGap) {
function wrapInlineNameHTML (line 25640) | function wrapInlineNameHTML(name, leftHasMarker, style) {
function wrapInlineValueHTML (line 25645) | function wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker, ...
function wrapInlineNameRichText (line 25656) | function wrapInlineNameRichText(ctx, name, style) {
function wrapInlineValueRichText (line 25660) | function wrapInlineValueRichText(ctx, values, alignRight, valueCloseToMa...
function retrieveVisualColorForTooltipMarker (line 25671) | function retrieveVisualColorForTooltipMarker(series, dataIndex) {
function getPaddingFromTooltipModel (line 25677) | function getPaddingFromTooltipModel(model, renderMode) {
function TooltipMarkupStyleCreator (line 25692) | function TooltipMarkupStyleCreator() {
function defaultSeriesFormatTooltip (line 25760) | function defaultSeriesFormatTooltip(opt) {
function formatTooltipArrayValue (line 25817) | function formatTooltipArrayValue(value, series, dataIndex, tooltipDims, ...
function getSelectionKey (line 25862) | function getSelectionKey(data, dataIndex) {
function SeriesModel (line 25873) | function SeriesModel() {
function autoSeriesName (line 26377) | function autoSeriesName(seriesModel) {
function getSeriesAutoName (line 26387) | function getSeriesAutoName(seriesModel) {
function dataTaskCount (line 26398) | function dataTaskCount(context) {
function dataTaskReset (line 26402) | function dataTaskReset(context) {
function dataTaskProgress (line 26408) | function dataTaskProgress(param, context) {
function wrapData (line 26416) | function wrapData(data, seriesModel) {
function onDataChange (line 26422) | function onDataChange(seriesModel, newList) {
function getCurrentTask (line 26433) | function getCurrentTask(seriesModel) {
function ComponentView (line 26457) | function ComponentView() {
function createRenderPlanner (line 26509) | function createRenderPlanner() {
function ChartView (line 26531) | function ChartView() {
function elSetState (line 26640) | function elSetState(el, state, highlightDigit) {
function toggleHighlight (line 26646) | function toggleHighlight(data, payload, state) {
function renderTaskPlan (line 26664) | function renderTaskPlan(context) {
function renderTaskReset (line 26668) | function renderTaskReset(context) {
function throttle (line 26760) | function throttle(fn, delay, debounce) {
function createOrUpdate (line 26858) | function createOrUpdate(obj, fnAttr, rate, throttleType) {
function clear (line 26887) | function clear(obj, fnAttr) {
function getStyleMapper (line 26907) | function getStyleMapper(seriesModel, stylePath) {
function getDefaultColorKey (line 26918) | function getDefaultColorKey(seriesModel, stylePath) {
function defaultLoading (line 27093) | function defaultLoading(api, opts) {
function Scheduler (line 27204) | function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandler...
function needSetDirty (line 27426) | function needSetDirty(opt, task) {
function create (line 27481) | function create(seriesModel) {
function createStub (line 27550) | function createStub(seriesModel) {
function overallTaskReset (line 27603) | function overallTaskReset(context) {
function stubReset (line 27607) | function stubReset(context) {
function stubProgress (line 27611) | function stubProgress() {
function stubOnDirty (line 27616) | function stubOnDirty() {
function seriesTaskPlan (line 27620) | function seriesTaskPlan(context) {
function seriesTaskReset (line 27624) | function seriesTaskReset(context) {
function makeSeriesTaskProgress (line 27637) | function makeSeriesTaskProgress(resetDefineIdx) {
function seriesTaskCount (line 27652) | function seriesTaskCount(context) {
function detectSeriseType (line 27664) | function detectSeriseType(legacyFunc) {
function mockMethods (line 27691) | function mockMethods(target, Clz) {
function ECEventProcessor (line 27991) | function ECEventProcessor() {}
function check (line 28070) | function check(query, host, prop, propOnHost) {
function dataEach (line 28129) | function dataEach(data, idx) {
function dataEach (line 28160) | function dataEach(data, idx) {
function getItemVisualFromData (line 28220) | function getItemVisualFromData(data, dataIndex, key) {
function getVisualFromData (line 28241) | function getVisualFromData(data, key) {
function createLegacyDataSelectAction (line 28263) | function createLegacyDataSelectAction(seriesType, ecRegisterAction) {
function handleSeriesLegacySelectEvents (line 28290) | function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecMod...
function handleLegacySelectEvents (line 28321) | function handleLegacySelectEvents(messageCenter, ecIns, api) {
function findEventDispatcher (line 28380) | function findEventDispatcher(target, det, returnFirstMatch) {
function WeakMap (line 28402) | function WeakMap() {
function symbolPathSetColor (line 28679) | function symbolPathSetColor(color, innerColor) {
function createSymbol (line 28702) | function createSymbol(symbolType, x, y, w, h, color, // whether to keep ...
function normalizeSymbolSize (line 28740) | function normalizeSymbolSize(symbolSize) {
function normalizeSymbolOffset (line 28748) | function normalizeSymbolOffset(symbolOffset, symbolSize) {
function isSafeNum (line 28760) | function isSafeNum(num) {
function createLinearGradient (line 28764) | function createLinearGradient(ctx, obj, rect) {
function createRadialGradient (line 28785) | function createRadialGradient(ctx, obj, rect) {
function getCanvasGradient (line 28806) | function getCanvasGradient(ctx, obj, rect) {
function isClipPathChanged (line 28817) | function isClipPathChanged(clipPaths, prevClipPaths) {
function parseInt10 (line 28835) | function parseInt10(val) {
function getSize (line 28839) | function getSize(root, whIdx, opts) {
function normalizeLineDash (line 28853) | function normalizeLineDash(lineType, lineWidth) {
function getLineDash (line 28861) | function getLineDash(el) {
function styleHasStroke (line 28882) | function styleHasStroke(style) {
function isValidStrokeFillStyle (line 28887) | function isValidStrokeFillStyle(strokeOrFill) {
function styleHasFill (line 28891) | function styleHasFill(style) {
function doFillPath (line 28896) | function doFillPath(ctx, style) {
function doStrokePath (line 28907) | function doStrokePath(ctx, style) {
function createCanvasPattern (line 28918) | function createCanvasPattern(ctx, pattern, el) {
function brushPath (line 28936) | function brushPath(ctx, el, style, inBatch) {
function brushImage (line 29071) | function brushImage(ctx, el, style) {
function brushText (line 29108) | function brushText(ctx, el, style) {
function bindCommonProps (line 29157) | function bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {
function bindPathAndTextCommonStyle (line 29209) | function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {
function bindImageStyle (line 29277) | function bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {
function setContextTransform (line 29281) | function setContextTransform(ctx, el) {
function updateClipStatus (line 29292) | function updateClipStatus(clipPaths, ctx, scope) {
function isTransformChanged (line 29307) | function isTransformChanged(m0, m1) {
function canPathBatch (line 29322) | function canPathBatch(style) {
function flushPathDrawn (line 29328) | function flushPathDrawn(ctx, scope) {
function getStyle (line 29335) | function getStyle(el, inHover) {
function brushSingle (line 29339) | function brushSingle(ctx, el) {
function brush (line 29347) | function brush(ctx, el, scope, isLast) {
function brushIncremental (line 29461) | function brushIncremental(ctx, el, scope) {
function createOrUpdatePatternFromDecal (line 29511) | function createOrUpdatePatternFromDecal(decalObject, api) {
function normalizeSymbolArray (line 29773) | function normalizeSymbolArray(symbol) {
function normalizeDashArrayX (line 29815) | function normalizeDashArrayX(dash) {
function normalizeDashArrayY (line 29874) | function normalizeDashArrayY(dash) {
function getLineBlockLengthX (line 29899) | function getLineBlockLengthX(dash) {
function getLineBlockLengthY (line 29905) | function getLineBlockLengthY(dash) {
function decalVisual (line 29921) | function decalVisual(ecModel, api) {
function registerImpl (line 29954) | function registerImpl(name, impl) {
function getImpl (line 29963) | function getImpl(name) {
function createRegisterEventWithLowercaseECharts (line 30034) | function createRegisterEventWithLowercaseECharts(method) {
function createRegisterEventWithLowercaseMessageCenter (line 30051) | function createRegisterEventWithLowercaseMessageCenter(method) {
function toLowercaseNameAndCallEventful (line 30063) | function toLowercaseNameAndCallEventful(host, method, args) {
function MessageCenter (line 30074) | function MessageCenter() {
function ECharts (line 30111) | function ECharts(dom, // Theme name or themeOption.
function doPrepare (line 31029) | function doPrepare(model) {
function callView (line 31178) | function callView(view) {
function clearColorPalette (line 31571) | function clearColorPalette(ecModel) {
function allocateZlevels (line 31578) | function allocateZlevels(ecModel) {
function applyElementStates (line 31737) | function applyElementStates(el) {
function updateHoverLayerStatus (line 31763) | function updateHoverLayerStatus(ecIns, ecModel) {
function updateBlend (line 31796) | function updateBlend(seriesModel, chartView) {
function updateZ (line 31807) | function updateZ(model, view) {
function doUpdateZ (line 31822) | function doUpdateZ(el, z, zlevel, maxZ2) {
function clearStates (line 31863) | function clearStates(model, view) {
function updateStates (line 31895) | function updateStates(model, view) {
function class_1 (line 31955) | function class_1() {
function updateConnectedChartsStatus (line 32022) | function updateConnectedChartsStatus(charts, status) {
function wrapped (line 32071) | function wrapped() {
function disposedWarning (line 32088) | function disposedWarning(id) {
function init (line 32121) | function init(dom, theme, opts) {
function connect (line 32173) | function connect(groupId) {
function disconnect (line 32194) | function disconnect(groupId) {
function dispose (line 32208) | function dispose(chart) {
function getInstanceByDom (line 32221) | function getInstanceByDom(dom) {
function getInstanceById (line 32225) | function getInstanceById(key) {
function registerTheme (line 32233) | function registerTheme(name, theme) {
function registerPreprocessor (line 32241) | function registerPreprocessor(preprocessorFunc) {
function registerProcessor (line 32247) | function registerProcessor(priority, processor) {
function registerPostInit (line 32256) | function registerPostInit(postInitFunc) {
function registerPostUpdate (line 32265) | function registerPostUpdate(postUpdateFunc) {
function registerUpdateLifecycle (line 32269) | function registerUpdateLifecycle(name, cb) {
function registerAction (line 32273) | function registerAction(actionInfo, eventName, action) {
function registerCoordinateSystem (line 32304) | function registerCoordinateSystem(type, coordSysCreator) {
function getCoordinateSystemDimensions (line 32314) | function getCoordinateSystemDimensions(type) {
function registerLayout (line 32322) | function registerLayout(priority, layoutTask) {
function registerVisual (line 32326) | function registerVisual(priority, visualTask) {
function normalizeRegister (line 32332) | function normalizeRegister(targetList, priority, fn, defaultPriority, vi...
function registerLoading (line 32360) | function registerLoading(name, loadingFx) {
function setCanvasCreator (line 32381) | function setCanvasCreator(creator) {
function registerMap (line 32395) | function registerMap(mapName, geoJson, specialAreas) {
function getMap (line 32400) | function getMap(mapName) {
function dataIndexMapValueLength (line 32504) | function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {
function defaultKeyGetter (line 32508) | function defaultKeyGetter(item) {
function DataDiffer (line 32518) | function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context,...
function DimensionUserOuput (line 32756) | function DimensionUserOuput(encode, dimRequest) {
function summarizeDimensions (line 32788) | function summarizeDimensions(data, schema) {
function getOrCreateEncodeArr (line 32870) | function getOrCreateEncodeArr(encode, dim) {
function getDimensionTypeByAxis (line 32879) | function getDimensionTypeByAxis(axisType) {
function mayLabelDimType (line 32883) | function mayLabelDimType(dimType) {
function SeriesDimensionDefine (line 32907) | function SeriesDimensionDefine(opt) {
function SeriesDataSchema (line 32974) | function SeriesDataSchema(opt) {
function isSeriesDataSchema (line 33134) | function isSeriesDataSchema(schema) {
function createDimNameMap (line 33138) | function createDimNameMap(dimsDef) {
function ensureSourceDimNameMap (line 33153) | function ensureSourceDimNameMap(source) {
function shouldOmitUnusedDimensions (line 33158) | function shouldOmitUnusedDimensions(dimCount) {
function SeriesData (line 33191) | function SeriesData(dimensionsInput, hostModel) {
function createDimensions (line 34297) | function createDimensions(source, opt) {
function prepareSeriesDataSchema (line 34314) | function prepareSeriesDataSchema( // TODO: TYPE completeDimensions type
function removeDuplication (line 34549) | function removeDuplication(result) {
function getDimCount (line 34577) | function getDimCount(source, sysDims, dimsDef, optDimCount) {
function genCoordDimName (line 34591) | function genCoordDimName(name, map, fromZero) {
function CoordSysInfo (line 34630) | function CoordSysInfo(coordSysName) {
function getCoordSysInfoBySeries (line 34640) | function getCoordSysInfoBySeries(seriesModel) {
function isCategory (line 34743) | function isCategory(axisModel) {
function enableDataStack (line 34768) | function enableDataStack(seriesModel, dimensionsInput, opt) {
function isLegacyDimensionsInput (line 34882) | function isLegacyDimensionsInput(dimensionsInput) {
function isDimensionStacked (line 34886) | function isDimensionStacked(data, stackedDim) {
function getStackedDimension (line 34892) | function getStackedDimension(data, targetDim) {
function getCoordSysDimDefs (line 34896) | function getCoordSysDimDefs(seriesModel, coordSysInfo) {
function injectOrdinalMeta (line 34925) | function injectOrdinalMeta(dimInfoList, createInvertedIndices, coordSysI...
function createSeriesData (line 34961) | function createSeriesData(sourceRaw, seriesModel, opt) {
function isNeedCompleteOrdinalData (line 35006) | function isNeedCompleteOrdinalData(source) {
function firstDataNotNull (line 35013) | function firstDataNotNull(arr) {
function Scale (line 35026) | function Scale(setting) {
function OrdinalMeta (line 35115) | function OrdinalMeta(opt) {
function getName (line 35196) | function getName(obj) {
function isValueNice (line 35204) | function isValueNice(val) {
function isIntervalOrLogScale (line 35210) | function isIntervalOrLogScale(scale) {
function intervalScaleNiceTicks (line 35220) | function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInt...
function increaseInterval (line 35241) | function increaseInterval(interval) {
function getIntervalPrecision (line 35264) | function getIntervalPrecision(interval) {
function clamp (line 35269) | function clamp(niceTickExtent, idx, extent) {
function fixExtent (line 35274) | function fixExtent(niceTickExtent, extent) {
function contain$1 (line 35285) | function contain$1(val, extent) {
function normalize (line 35289) | function normalize(val, extent) {
function scale (line 35297) | function scale(val, extent) {
function OrdinalScale (line 35306) | function OrdinalScale(setting) {
function IntervalScale (line 35506) | function IntervalScale() {
function createFloat32Array (line 35771) | function createFloat32Array(arg) {
function getSeriesStackId (line 35783) | function getSeriesStackId(seriesModel) {
function getAxisKey (line 35787) | function getAxisKey(axis) {
function prepareLayoutBarSeries (line 35791) | function prepareLayoutBarSeries(seriesType, ecModel) {
function getValueAxesMinGaps (line 35811) | function getValueAxesMinGaps(barSeries) {
function makeColumnLayout (line 35877) | function makeColumnLayout(barSeries) {
function doCalBarWidthAndOffset (line 35921) | function doCalBarWidthAndOffset(seriesInfoList) {
function retrieveColumnLayout (line 36066) | function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {
function layout$1 (line 36078) | function layout$1(seriesType, ecModel) {
function createProgressiveLayout (line 36098) | function createProgressiveLayout(seriesType) {
function isOnCartesian (line 36226) | function isOnCartesian(seriesModel) {
function isInLargeMode (line 36230) | function isInLargeMode(seriesModel) {
function getValueAxisStart (line 36235) | function getValueAxisStart(baseAxis, valueAxis) {
function TimeScale (line 36258) | function TimeScale(settings) {
function isUnitValueSame (line 36381) | function isUnitValueSame(unit, valueA, valueB, isUTC) {
function getDateInterval (line 36492) | function getDateInterval(approxInterval, daysInMonth) {
function getMonthInterval (line 36499) | function getMonthInterval(approxInterval) {
function getHourInterval (line 36505) | function getHourInterval(approxInterval) {
function getMinutesAndSecondsInterval (line 36510) | function getMinutesAndSecondsInterval(approxInterval, isMinutes) {
function getMillisecondsInterval (line 36515) | function getMillisecondsInterval(approxInterval) {
function getFirstTimestampOfUnit (line 36519) | function getFirstTimestampOfUnit(date, unitName, isUTC) {
function getIntervalTicks (line 36544) | function getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {
function LogScale (line 36785) | function LogScale() {
function fixRoundingError (line 36921) | function fixRoundingError(val, originalVal) {
function ScaleRawExtentInfo (line 36930) | function ScaleRawExtentInfo(scale, model, // Usually: data extent from a...
function ensureScaleRawExtentInfo (line 37125) | function ensureScaleRawExtentInfo(scale, model, // Usually: data extent ...
function parseAxisModelMinMax (line 37140) | function parseAxisModelMinMax(scale, minMax) {
function getScaleExtent (line 37154) | function getScaleExtent(scale, model) {
function adjustScaleForOverflow (line 37200) | function adjustScaleForOverflow(min, max, model, // Only support cartesi...
function niceScaleExtent (line 37241) | function niceScaleExtent(scale, inModel) {
function createScaleByModel (line 37276) | function createScaleByModel(model, axisType) {
function ifAxisCrossZero (line 37305) | function ifAxisCrossZero(axis) {
function makeLabelFormatter (line 37321) | function makeLabelFormatter(axis) {
function getAxisRawValue (line 37366) | function getAxisRawValue(axis, tick) {
function estimateLabelUnionRect (line 37378) | function estimateLabelUnionRect(axis) {
function rotateTextRect (line 37419) | function rotateTextRect(textRect, rotate) {
function getOptionCategoryInterval (line 37434) | function getOptionCategoryInterval(model) {
function shouldShowAllLabels (line 37445) | function shouldShowAllLabels(axis) {
function getDataDimensionsOnAxis (line 37449) | function getDataDimensionsOnAxis(data, axisDim) {
function AxisModelCommonMixin (line 37513) | function AxisModelCommonMixin() {}
function createList (line 37536) | function createList(seriesModel) {
function createScale (line 37553) | function createScale(dataExtent, option) {
function mixinAxisModelCommonMethods (line 37584) | function mixinAxisModelCommonMethods(Model) {
function createTextStyle (line 37588) | function createTextStyle(textStyleModel, opts) {
function use (line 37647) | function use(ext) {
function isAroundEqual (line 37673) | function isAroundEqual(a, b) {
function contain (line 37677) | function contain(points, x, y) {
function transformPoints (line 37702) | function transformPoints(points, transform) {
function updateBBoxFromPoints (line 37708) | function updateBBoxFromPoints(points, min, max, projection) {
function centroid (line 37724) | function centroid(points) {
function Region (line 37749) | function Region(name) {
function GeoJSONPolygonGeometry (line 37781) | function GeoJSONPolygonGeometry(exterior, interiors) {
function GeoJSONLineStringGeometry (line 37793) | function GeoJSONLineStringGeometry(points) {
function GeoJSONRegion (line 37806) | function GeoJSONRegion(name, geometries, cp) {
function GeoSVGRegion (line 37969) | function GeoSVGRegion(name, elOnlyForCalculate) {
function decode (line 37997) | function decode(json) {
function decodeRings (line 38044) | function decodeRings(rings, encodeOffsets, encodeScale) {
function decodeRing (line 38050) | function decodeRing(coordinate, encodeOffsets, encodeScale) {
function parseGeoJSON (line 38073) | function parseGeoJSON(geoJson, nameProperty) {
function createAxisLabels (line 38208) | function createAxisLabels(axis) {
function createAxisTicks (line 38222) | function createAxisTicks(axis, tickModel) {
function makeCategoryLabels (line 38231) | function makeCategoryLabels(axis) {
function makeCategoryLabelsActually (line 38240) | function makeCategoryLabelsActually(axis, labelModel) {
function makeCategoryTicks (line 38266) | function makeCategoryTicks(axis, tickModel) {
function makeRealNumberLabels (line 38306) | function makeRealNumberLabels(axis) {
function getListCache (line 38321) | function getListCache(axis, prop) {
function listCacheGet (line 38326) | function listCacheGet(cache, key) {
function listCacheSet (line 38334) | function listCacheSet(cache, key, value) {
function makeAutoCategoryInterval (line 38342) | function makeAutoCategoryInterval(axis) {
function calculateCategoryInterval (line 38353) | function calculateCategoryInterval(axis) {
function fetchAutoCategoryIntervalCalculationParams (line 38432) | function fetchAutoCategoryIntervalCalculationParams(axis) {
function makeLabelsByNumericCategoryInterval (line 38441) | function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onl...
function makeLabelsByCustomizedCategoryInterval (line 38497) | function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, ...
function Axis (line 38524) | function Axis(dim, scale, extent) {
function fixExtentWithBands (line 38718) | function fixExtentWithBands(extent, nTick) {
function fixOnBandTicksCoords (line 38735) | function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {
function extendComponentModel (line 38801) | function extendComponentModel(proto) {
function extendComponentView (line 38807) | function extendComponentView(proto) {
function extendSeriesModel (line 38813) | function extendSeriesModel(proto) {
function extendChartView (line 38819) | function extendChartView(proto) {
function getCandidateAnchor (line 38829) | function getCandidateAnchor(pos, distance, rect, outPt, outDir) {
function projectPointToArc (line 38856) | function projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwis...
function projectPointToLine (line 38917) | function projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {
function projectPointToRect (line 38939) | function projectPointToRect(x1, y1, width, height, x, y, out) {
function nearestPointOnRect (line 38959) | function nearestPointOnRect(pt, rect, out) {
function nearestPointOnPath (line 38970) | function nearestPointOnPath(pt, path, out) {
function updateLabelLinePoints (line 39088) | function updateLabelLinePoints(target, labelLineModel) {
function limitTurnAngle (line 39151) | function limitTurnAngle(linePoints, minTurnAngle) {
function limitSurfaceAngle (line 39207) | function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {
function setLabelLineState (line 39262) | function setLabelLineState(labelLine, ignore, stateName, stateModel) {
function buildLabelLinePath (line 39284) | function buildLabelLinePath(path, shape) {
function setLabelLineStyle (line 39321) | function setLabelLineStyle(targetEl, statesModels, defaultStyle) {
function getLabelLineStatesModels (line 39391) | function getLabelLineStatesModels(itemModel, labelLineName) {
function prepareLayoutList (line 39405) | function prepareLayoutList(input) {
function shiftLayout (line 39445) | function shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceSh...
function shiftLayoutOnX (line 39610) | function shiftLayoutOnX(list, leftBound, rightBound, // If average the s...
function shiftLayoutOnY (line 39622) | function shiftLayoutOnY(list, topBound, bottomBound, // If average the s...
function hideOverlap (line 39627) | function hideOverlap(labelList) {
function cloneArr (line 39705) | function cloneArr(points) {
function prepareLayoutCallbackParams (line 39717) | function prepareLayoutCallbackParams(labelItem, hostEl) {
function extendWithKeys (line 39740) | function extendWithKeys(target, source, keys) {
function LabelManager (line 39755) | function LabelManager() {
function createDragHandler (line 39871) | function createDragHandler(el, labelLineModel) {
function installLabelLayout (line 40151) | function installLabelLayout(registers) {
function createDom (line 40175) | function createDom(id, painter, dpr) {
function Layer (line 40198) | function Layer(id, painter, dpr) {
function addRectToMergePool (line 40287) | function addRectToMergePool(rect) {
function doClear (line 40454) | function doClear(x, y, width, height) {
function isLayerValid (line 40514) | function isLayerValid(layer) {
function createRoot (line 40530) | function createRoot(width, height) {
function CanvasPainter (line 40537) | function CanvasPainter(root, storage, opts, id) {
function updatePrevLayer (line 41007) | function updatePrevLayer(idx) {
function install$b (line 41253) | function install$b(registers) {
function DatasetModel (line 41262) | function DatasetModel() {
function DatasetView (line 41302) | function DatasetView() {
function install$a (line 41313) | function install$a(registers) {
function dataSample (line 41377) | function dataSample(seriesType) {
function BaseBarSeriesModel (line 41425) | function BaseBarSeriesModel() {
function BarSeriesModel (line 41556) | function BarSeriesModel() {
function createGridClipPath (line 41629) | function createGridClipPath(cartesian, hasAnimation, seriesModel, done, ...
function createPolarClipPath (line 41688) | function createPolarClipPath(polar, hasAnimation, seriesModel) {
function createClipPath (line 41725) | function createClipPath(coordSys, hasAnimation, seriesModel, done, durin...
function SausageShape (line 41744) | function SausageShape() {
function SausagePath (line 41762) | function SausagePath(opts) {
function isCoordinateSystemType (line 41857) | function isCoordinateSystemType(coordSys, type) {
function getDefaultLabel (line 41865) | function getDefaultLabel(data, dataIndex) {
function getDefaultInterpolatedLabel (line 41883) | function getDefaultInterpolatedLabel(data, interpolatedValue) {
function createSectorCalculateTextPosition (line 41903) | function createSectorCalculateTextPosition(positionMapping, opts) {
function setSectorTextRotation (line 42010) | function setSectorTextRotation(sector, textPosition, positionMapping, ro...
function adjustAngleDistanceX (line 42076) | function adjustAngleDistanceX(angle, distance, isEnd) {
function adjustAngleDistanceY (line 42080) | function adjustAngleDistanceY(angle, distance, isEnd) {
function getSectorCornerRadius (line 42084) | function getSectorCornerRadius(model, shape, zeroIfNull) {
function getClipArea (line 42108) | function getClipArea(coord, data) {
function BarView (line 42137) | function BarView() {
function createBackground (line 42230) | function createBackground(dataIndex) {
function shouldRealtimeSort (line 42719) | function shouldRealtimeSort(seriesModel, coordSys) {
function updateRealtimeAnimation (line 42742) | function updateRealtimeAnimation(realtimeSortCfg, seriesAnimationModel, ...
function checkPropertiesNotValid (line 42780) | function checkPropertiesNotValid(obj, props) {
function isZeroOnPolar (line 42830) | function isZeroOnPolar(layout) {
function createPolarPositionMapping (line 42834) | function createPolarPositionMapping(isRadial) {
function updateStyle (line 42852) | function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel...
function getLineWidth (line 42905) | function getLineWidth(itemModel, rawLayout) {
function LagePathShape (line 42923) | function LagePathShape() {}
function LargePath (line 42933) | function LargePath(opts) {
function createLarge (line 42966) | function createLarge(seriesModel, group, progressiveEls, incremental) {
function largePathFindDataIndex (line 43023) | function largePathFindDataIndex(largePath, x, y) {
function createBackgroundShape (line 43052) | function createBackgroundShape(isHorizontalOrRadial, layout, coord) {
function createBackgroundEl (line 43076) | function createBackgroundEl(coord, isHorizontalOrRadial, layout) {
function install$9 (line 43085) | function install$9(registers) {
function LineSeriesModel (line 43127) | function LineSeriesModel() {
function Symbol (line 43241) | function Symbol(data, idx, seriesScope, opts) {
function getLabelDefaultText (line 43484) | function getLabelDefaultText(idx) {
function driftSymbol (line 43556) | function driftSymbol(dx, dy) {
function symbolNeedsDraw (line 43560) | function symbolNeedsDraw(data, point, idx, opt) {
function normalizeUpdateOpt (line 43567) | function normalizeUpdateOpt(opt) {
function makeSeriesScope (line 43577) | function makeSeriesScope(data) {
function SymbolDraw (line 43596) | function SymbolDraw(SymbolCtor) {
function updateIncrementalAndHover (line 43708) | function updateIncrementalAndHover(el) {
function prepareDataCoordInfo (line 43752) | function prepareDataCoordInfo(coordSys, data, valueOrigin) {
function getValueStart (line 43796) | function getValueStart(valueAxis, valueOrigin) {
function getStackedOnPoint (line 43823) | function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {
function diffData (line 43841) | function diffData(oldData, newData) {
function lineAnimationDiff (line 43863) | function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStac...
function isPointNull$1 (line 43974) | function isPointNull$1(x, y) {
function drawSegment (line 43984) | function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, sm...
function ECPolylineShape (line 44142) | function ECPolylineShape() {
function ECPolyline (line 44155) | function ECPolyline(opts) {
function ECPolygonShape (line 44277) | function ECPolygonShape() {
function ECPolygon (line 44289) | function ECPolygon(opts) {
function isPointsSame (line 44333) | function isPointsSame(points1, points2) {
function bboxFromPoints (line 44347) | function bboxFromPoints(points) {
function getBoundingDiff (line 44371) | function getBoundingDiff(points1, points2) {
function getSmooth (line 44384) | function getSmooth(smooth) {
function getStackedOnPoints (line 44388) | function getStackedOnPoints(coordSys, data, dataCoordInfo) {
function turnPointsIntoStep (line 44405) | function turnPointsIntoStep(points, coordSys, stepTurnAt, connectNulls) {
function clipColorStops (line 44469) | function clipColorStops(colorStops, maxSize) {
function getVisualGradient (line 44517) | function getVisualGradient(data, coordSys, api) {
function getIsIgnoreFunc (line 44611) | function getIsIgnoreFunc(seriesModel, data, coordSys) {
function canShowAllSymbolForCategory (line 44645) | function canShowAllSymbolForCategory(categoryAxis, data) {
function isPointNull (line 44669) | function isPointNull(x, y) {
function getLastIndexNotNull (line 44673) | function getLastIndexNotNull(points) {
function getPointAtIndex (line 44685) | function getPointAtIndex(points, idx) {
function getIndexRange (line 44689) | function getIndexRange(points, xOrY, dim) {
function anyStateShowEndLabel (line 44724) | function anyStateShowEndLabel(seriesModel) {
function createLineClipPath (line 44738) | function createLineClipPath(lineView, coordSys, hasAnimation, seriesMode...
function getEndLabelStateSpecified (line 44792) | function getEndLabelStateSpecified(endLabelModel, coordSys) {
function LineView (line 44811) | function LineView() {
function pointsLayout (line 45553) | function pointsLayout(seriesType, forceStoreInTypedArray) {
function install$8 (line 45620) | function install$8(registers) {
function getViewRect (line 45648) | function getViewRect(seriesModel, api) {
function getBasicPieLayout (line 45655) | function getBasicPieLayout(seriesModel, api) {
function pieLayout (line 45696) | function pieLayout(seriesType, ecModel, api) {
function dataFilter (line 45850) | function dataFilter(seriesType) {
function adjustSingleSide (line 45881) | function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, v...
function avoidOverlap (line 45960) | function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight,...
function constrainTextWidth (line 46068) | function constrainTextWidth(layout, availableWidth, forceRecalculate) {
function isPositionCenter (line 46126) | function isPositionCenter(sectorShape) {
function pieLabelLayout (line 46131) | function pieLabelLayout(seriesModel) {
function PiePiece (line 46376) | function PiePiece(data, idx, startAngle) {
function PieView (line 46549) | function PieView() {
function createSeriesDataSimply (line 46639) | function createSeriesDataSimply(seriesModel, opt, nameList) {
function LegendVisualProvider (line 46702) | function LegendVisualProvider( // Function to get data after filtered. I...
function PieSeriesModel (line 46749) | function PieSeriesModel() {
function negativeDataFilter (line 46923) | function negativeDataFilter(seriesType) {
function install$7 (line 46943) | function install$7(registers) {
function GridModel (line 46959) | function GridModel() {
function CartesianAxisModel (line 46990) | function CartesianAxisModel() {
function axisModelCreator (line 47213) | function axisModelCreator(registers, axisName, BaseAxisModelClass, extra...
function getAxisType (line 47282) | function getAxisType(option) {
function Cartesian (line 47290) | function Cartesian(name) {
function canCalculateAffineTransform (line 47326) | function canCalculateAffineTransform(scale) {
function Cartesian2D (line 47335) | function Cartesian2D() {
function Axis2D (line 47474) | function Axis2D(dim, scale, coordExtent, axisType, position) {
function layout (line 47536) | function layout(gridModel, axisModel, opt) {
function isCartesian2DSeries (line 47592) | function isCartesian2DSeries(seriesModel) {
function findAxisModels (line 47596) | function findAxisModels(seriesModel) {
function alignScaleTicks (line 47616) | function alignScaleTicks(scale, axisModel, alignToScale) {
function Grid (line 47719) | function Grid(gridModel, ecModel, api) {
function updateAxisTicks (line 47743) | function updateAxisTicks(axes) {
function adjustAxes (line 47845) | function adjustAxes() {
function createAxisCreator (line 48005) | function createAxisCreator(dimName) {
function unionExtent (line 48082) | function unionExtent(data, axis) {
function isAxisUsedInTheGrid (line 48153) | function isAxisUsedInTheGrid(axisModel, gridModel) {
function fixAxisOnZero (line 48157) | function fixAxisOnZero(axesMap, otherAxisDim, axis, // Key: see `getOnZe...
function canOnZeroToAxis (line 48203) | function canOnZeroToAxis(axis) {
function updateAxisTransform (line 48207) | function updateAxisTransform(axis, coordBase) {
function AxisBuilder (line 48250) | function AxisBuilder(axisModel, opt) {
function endTextLayout (line 48524) | function endTextLayout(rotation, textPosition, textRotate, extent) {
function fixMinMaxLabelShow (line 48554) | function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {
function ignoreEl (line 48604) | function ignoreEl(el) {
function isTwoLabelOverlapped (line 48608) | function isTwoLabelOverlapped(current, next) {
function isNameLocationCenter (line 48626) | function isNameLocationCenter(nameLocation) {
function createTicks (line 48630) | function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineS...
function buildAxisMajorTicks (line 48668) | function buildAxisMajorTicks(group, transformGroup, axisModel, opt) {
function buildAxisMinorTicks (line 48695) | function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirec...
function buildAxisLabel (line 48724) | function buildAxisLabel(group, transformGroup, axisModel, opt) {
function collect (line 48804) | function collect(ecModel, api) {
function collectAxesInfo (line 48836) | function collectAxesInfo(result, ecModel, api) {
function makeAxisPointerModel (line 48926) | function makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerM...
function collectSeriesInfo (line 48962) | function collectSeriesInfo(result, ecModel) {
function getLinkGroupIndex (line 49001) | function getLinkGroupIndex(linksOption, axis) {
function checkPropInLink (line 49014) | function checkPropInLink(linkPropValue, axisPropValue) {
function fixValue (line 49018) | function fixValue(axisModel) {
function getAxisInfo (line 49064) | function getAxisInfo(axisModel) {
function getAxisPointerModel (line 49069) | function getAxisPointerModel(axisModel) {
function isHandleTrigger (line 49074) | function isHandleTrigger(axisPointerModel) {
function makeKey (line 49083) | function makeKey(model) {
function AxisView (line 49097) | function AxisView() {
function rectCoordAxisBuildSplitArea (line 49183) | function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gri...
function rectCoordAxisHandleRemove (line 49269) | function rectCoordAxisHandleRemove(axisView) {
function CartesianAxisView (line 49281) | function CartesianAxisView() {
function CartesianXAxisView (line 49465) | function CartesianXAxisView() {
function CartesianYAxisView (line 49481) | function CartesianYAxisView() {
function GridView (line 49497) | function GridView() {
function install$6 (line 49529) | function install$6(registers) {
function TitleModel (line 49552) | function TitleModel() {
function TitleView (line 49598) | function TitleView() {
function install$5 (line 49739) | function install$5(registers) {
function LegendModel (line 49765) | function LegendModel() {
function makeBackground (line 50053) | function makeBackground(rect, componentModel) {
function LegendView (line 50085) | function LegendView() {
function getLegendStyle (line 50449) | function getLegendStyle(iconType, legendItemModel, lineVisualStyle, item...
function getDefaultLegendIcon (line 50527) | function getDefaultLegendIcon(opt) {
function dispatchSelectAction (line 50543) | function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {
function isUseHoverLayer (line 50555) | function isUseHoverLayer(api) {
function dispatchHighlightAction (line 50568) | function dispatchHighlightAction(seriesName, dataName, api, excludeSerie...
function dispatchDownplayAction (line 50580) | function dispatchDownplayAction(seriesName, dataName, api, excludeSeries...
function legendFilter (line 50634) | function legendFilter(ecModel) {
function legendSelectActionHandler (line 50654) | function legendSelectActionHandler(methodName, payload, ecModel) {
function installLegendAction (line 50700) | function installLegendAction(registers) {
function install$4 (line 50729) | function install$4(registers) {
function ScrollableLegendModel (line 50744) | function ScrollableLegendModel() {
function mergeAndNormalizeLayoutParams (line 50799) | function mergeAndNormalizeLayoutParams(legendModel, target, raw) {
function ScrollableLegendView (line 50818) | function ScrollableLegendView() {
function createPageButton (line 50881) | function createPageButton(name, iconIdx) {
function getItemInfo (line 51162) | function getItemInfo(el) {
function intersect (line 51174) | function intersect(itemInfo, winStart) {
function installScrollableLegendAction (line 51251) | function installScrollableLegendAction(registers) {
function install$3 (line 51270) | function install$3(registers) {
function BaseAxisPointer (line 51288) | function BaseAxisPointer() {
function updateProps (line 51653) | function updateProps(animationModel, moveAnimation, el, props) {
function propsEqual (line 51661) | function propsEqual(lastProps, newProps) {
function updateLabelShowHide (line 51673) | function updateLabelShowHide(labelEl, axisPointerModel) {
function getHandleTransProps (line 51677) | function getHandleTransProps(trans) {
function updateMandatoryProps (line 51685) | function updateMandatoryProps(group, axisPointerModel, silent) {
function buildElStyle (line 51697) | function buildElStyle(axisPointerModel) {
function buildLabelElOption (line 51717) | function buildLabelElOption(elOption, axisModel, axisPointerModel, api, ...
function confineInContainer (line 51762) | function confineInContainer(position, width, height, api) {
function getValueLabel (line 51771) | function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {
function getTransformedPosition (line 51808) | function getTransformedPosition(axis, value, layoutInfo) {
function buildCartesianSingleLabelElOption (line 51815) | function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, ...
function makeLineShape (line 51826) | function makeLineShape(p1, p2, xDimIndex) {
function makeRectShape (line 51836) | function makeRectShape(xy, wh, xDimIndex) {
function CartesianAxisPointer (line 51851) | function CartesianAxisPointer() {
function getCartesian (line 51932) | function getCartesian(grid, axis) {
function getAxisDimIndex (line 51957) | function getAxisDimIndex(axis) {
function AxisPointerModel (line 51966) | function AxisPointerModel() {
function register (line 52043) | function register(key, api, handler) {
function initGlobalListeners (line 52055) | function initGlobalListeners(zr, api) {
function dispatchTooltipFinally (line 52077) | function dispatchTooltipFinally(pendings, api) {
function onLeave (line 52094) | function onLeave(record, e, dispatchAction) {
function doEnter (line 52098) | function doEnter(currTrigger, record, e, dispatchAction) {
function makeDispatchAction$1 (line 52102) | function makeDispatchAction$1(api) {
function unregister (line 52129) | function unregister(key, api) {
function AxisPointerView (line 52147) | function AxisPointerView() {
function findPointFromSeries (line 52190) | function findPointFromSeries(finder, ecModel) {
function axisTrigger (line 52253) | function axisTrigger(payload, ecModel, api) {
function processOnAxis (line 52339) | function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinde...
function buildPayloadsBySeries (line 52375) | function buildPayloadsBySeries(value, axisInfo) {
function showPointer (line 52434) | function showPointer(showValueMap, axisInfo, value, payloadBatch) {
function showTooltip (line 52441) | function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {
function updateModelActually (line 52485) | function updateModelActually(showValueMap, axesInfo, outputPayload) {
function dispatchTooltipActually (line 52514) | function dispatchTooltipActually(dataByCoordSys, point, payload, dispatc...
function dispatchHighDownActually (line 52542) | function dispatchHighDownActually(axesInfo, dispatchAction, api) {
function findInputAxisInfo (line 52584) | function findInputAxisInfo(inputAxesInfo, axisInfo) {
function makeMapperParam (line 52594) | function makeMapperParam(axisInfo) {
function illegalPoint (line 52604) | function illegalPoint(point) {
function install$2 (line 52608) | function install$2(registers) {
function TooltipModel (line 52648) | function TooltipModel() {
function shouldTooltipConfine (line 52729) | function shouldTooltipConfine(tooltipModel) {
function testStyle (line 52735) | function testStyle(styleProps) {
function toCSSVendorPrefix (line 52752) | function toCSSVendorPrefix(styleVendor, styleProp) {
function getComputedStyle (line 52763) | function getComputedStyle(el, style) {
function mirrorPos (line 52775) | function mirrorPos(pos) {
function assembleArrow (line 52780) | function assembleArrow(tooltipModel, borderColor, arrowPosition) {
function assembleTransition (line 52812) | function assembleTransition(duration, onlyFade) {
function assembleTransform (line 52825) | function assembleTransform(x, y, toString) {
function assembleFont (line 52847) | function assembleFont(textStyleModel) {
function assembleCssText (line 52867) | function assembleCssText(tooltipModel, enableTransition, onlyFade) {
function makeStyleCoord$1 (line 52904) | function makeStyleCoord$1(out, zr, appendToBody, zrX, zrY) {
function TooltipHTMLContent (line 52935) | function TooltipHTMLContent(container, api, opt) {
function TooltipRichContent (line 53172) | function TooltipRichContent(api) {
function mathMaxWith0 (line 53338) | function mathMaxWith0(val) {
function calcShadowOuterSize (line 53342) | function calcShadowOuterSize(style) {
function makeStyleCoord (line 53354) | function makeStyleCoord(out, zr, zrX, zrY) {
function TooltipView (line 53375) | function TooltipView() {
function buildTooltipModel (line 54071) | function buildTooltipModel(modelCascade, globalTooltipModel, defaultTool...
function makeDispatchAction (line 54111) | function makeDispatchAction(payload, api) {
function refixTooltipPosition (line 54115) | function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH...
function confineTooltipPosition (line 54143) | function confineTooltipPosition(x, y, content, viewWidth, viewHeight) {
function calcTooltipPosition (line 54154) | function calcTooltipPosition(position, rect, contentSize, borderWidth) {
function isCenterAlign (line 54192) | function isCenterAlign(align) {
function findComponentReference (line 54208) | function findComponentReference(payload, ecModel, api) {
function install$1 (line 54247) | function install$1(registers) {
function RegExpEvaluator (line 54298) | function RegExpEvaluator(rVal) {
function ConstConditionInternal (line 54322) | function ConstConditionInternal() {}
function AndConditionInternal (line 54334) | function AndConditionInternal() {}
function OrConditionInternal (line 54354) | function OrConditionInternal() {}
function NotConditionInternal (line 54374) | function NotConditionInternal() {}
function RelationalConditionInternal (line 54386) | function RelationalConditionInternal() {}
function parseOption (line 54407) | function parseOption(exprOption, getters) {
function parseAndOrOption (line 54434) | function parseAndOrOption(op, exprOption, getters) {
function parseNotOption (line 54461) | function parseNotOption(exprOption, getters) {
function parseRelationalOption (line 54482) | function parseRelationalOption(exprOption, getters) {
function isObjectNotArray (line 54528) | function isObjectNotArray(val) {
function ConditionalExpressionParsed (line 54535) | function ConditionalExpressionParsed(exprOption, getters) {
function parseConditionalExpression (line 54546) | function parseConditionalExpression(exprOption, getters) {
function install (line 54734) | function install(registers) {
FILE: src/components/Avatar/index.jsx
constant COLORS (line 4) | const COLORS = [
function Avatar (line 10) | function Avatar({ text, size = 34, backgroundColor }) {
FILE: src/components/Calculator/index.tsx
type CalculatorProps (line 5) | interface CalculatorProps {
FILE: src/components/EmptyTips/index.tsx
function EmptyTips (line 6) | function EmptyTips({
FILE: src/components/Home/ProfilePage/index.tsx
function UserInfo (line 27) | function UserInfo ({
FILE: src/components/Select/index.jsx
function Select (line 3) | function Select ({
FILE: src/components/Statement/index.jsx
function Statement (line 38) | function Statement({ statement, editable = true }) {
FILE: src/components/Statements/index.jsx
function Statements (line 5) | function Statements({ statements, editable = true }) {
FILE: src/components/Statistic/CalendarStatistic.tsx
type DayData (line 7) | interface DayData {
FILE: src/components/Statistic/ExpendCategory.tsx
function ExpendCategory (line 4) | function ExpendCategory() {
FILE: src/components/Statistic/ExpendList.tsx
function ExpendList (line 14) | function ExpendList({
FILE: src/components/Statistic/ExpendTrend.tsx
function ExpendTrend (line 6) | function ExpendTrend() {
FILE: src/components/UiComponents/Calculator/index.tsx
function Calculator (line 5) | function Calculator({
FILE: src/components/statementForm/CategorySelect.tsx
function CategorySelect (line 6) | function CategorySelect({
function CategoryContent (line 55) | function CategoryContent({ title, data, handleClick, parent = null }) {
FILE: src/components/statementForm/PayeeSelect.tsx
type PayeeSelectProps (line 5) | type PayeeSelectProps = {
function PayeeSelect (line 13) | function PayeeSelect({
FILE: src/components/statementForm/baseForm.tsx
function BaseForm (line 21) | function BaseForm({
FILE: src/config/index.ts
type Config (line 4) | type Config = {
FILE: src/jz.ts
class Jz (line 9) | class Jz {
method constructor (line 20) | private constructor() {
method getInstance (line 28) | public static getInstance(): Jz {
method bootstrap (line 35) | bootstrap({ appid = '', baseUrl = '', apiUrl = '' }) {
method initialize (line 46) | async initialize() {
method toastError (line 57) | toastError(content: string, duration = 1500, icon = 'none') {
method toastSuccess (line 65) | toastSuccess(content: string, duration = 800, icon = 'success') {
method confirm (line 73) | confirm(text, title='提示', payload={}) {
method showNavigatorBack (line 93) | showNavigatorBack(): boolean {
method withLoading (line 100) | async withLoading<T>(promise: Promise<T>): Promise<T> {
method currentUser (line 109) | get currentUser() {
method router (line 113) | get router(): Router {
method baseUrl (line 117) | get baseUrl(): string {
method baseUrl (line 121) | set baseUrl(url: string) {
method apiUrl (line 125) | get apiUrl(): string {
method appId (line 129) | get appId(): string {
method api (line 133) | get api(): Api {
method storage (line 137) | get storage(): Storage {
method event (line 141) | get event(): EventEmitter {
FILE: src/pages/account_books/create.tsx
function CreateAccountBook (line 76) | function CreateAccountBook() {
FILE: src/pages/assets_flow/index.tsx
function AssetsFlow (line 8) | function AssetsFlow() {
FILE: src/pages/friends/index.tsx
type Friend (line 13) | interface Friend {
function FriendsPage (line 26) | function FriendsPage() {
FILE: src/pages/friends/invite_info.tsx
function FriendInvitePage (line 8) | function FriendInvitePage() {
FILE: src/pages/home/index.tsx
function Home (line 31) | function Home() {
FILE: src/pages/setting/asset/form.tsx
function IconList (line 12) | function IconList({
function EditAsset (line 49) | function EditAsset () {
FILE: src/pages/setting/asset/index.tsx
function List (line 12) | function List ({
function AssetSetting (line 71) | function AssetSetting () {
FILE: src/pages/setting/budget/index.tsx
function BudgetPage (line 9) | function BudgetPage () {
FILE: src/pages/setting/category/form.tsx
function IconList (line 11) | function IconList({
function EditCategory (line 42) | function EditCategory () {
FILE: src/pages/setting/category/index.tsx
function CategorySetting (line 9) | function CategorySetting () {
FILE: src/pages/setting/child_budget/index.tsx
function BudgetPage (line 10) | function BudgetPage () {
FILE: src/pages/setting/statements_manage/data_out.tsx
type ExportRange (line 8) | type ExportRange = '1month' | '3months' | 'all'
function ExportIndex (line 10) | function ExportIndex(): JSX.Element {
FILE: src/pages/statement_detail/index.tsx
type StatementDetail (line 12) | type StatementDetail = {
FILE: src/router/index.ts
type RouterOptions (line 3) | interface RouterOptions {
class Router (line 9) | class Router {
method constructor (line 13) | constructor() {
method getParams (line 22) | getParams() {
method getCurrentInstance (line 26) | getCurrentInstance() {
method getCurrentPages (line 34) | getCurrentPages() {
method getCurrentPage (line 39) | getCurrentPage() {
method buildUrl (line 46) | private buildUrl({ url, params }: RouterOptions): string {
method beforeEach (line 55) | beforeEach(callback: (to: string) => boolean | Promise<boolean>) {
method runBeforeHooks (line 60) | private async runBeforeHooks(to: string): Promise<boolean> {
method navigateTo (line 68) | async navigateTo(options: RouterOptions) {
method redirectTo (line 83) | async redirectTo(options: RouterOptions) {
method navigateBack (line 98) | navigateBack(delta = 1) {
method canNavigateBack (line 110) | canNavigateBack(): boolean {
FILE: src/storage/index.ts
class Storage (line 3) | class Storage {
method saveLocal (line 6) | saveLocal(key, value, expireDays = 7) {
method getLocal (line 18) | getLocal(key) {
method delLocal (line 34) | delLocal(key) {
method setCurrentUser (line 38) | setCurrentUser(user) {
method getCurrentUser (line 42) | getCurrentUser() {
method getCurrentTheme (line 46) | getCurrentTheme() {
method setCurrentTheme (line 50) | setCurrentTheme(data) {
method setAccessToken (line 54) | setAccessToken(data) {
method getAccessToken (line 58) | getAccessToken() {
method delAccessToken (line 62) | delAccessToken() {
method setWalletData (line 66) | setWalletData(data) {
method getWalletData (line 70) | getWalletData() {
method setCurrentAccountBook (line 74) | setCurrentAccountBook(data) {
method getCurrentAccountBook (line 78) | getCurrentAccountBook() {
method setStatementCategories (line 82) | setStatementCategories(type, data) {
method getStatementCategories (line 91) | getStatementCategories(type) {
method setStatementAssets (line 100) | setStatementAssets(data) {
method getStatementAssets (line 109) | getStatementAssets() {
method delStatementCategories (line 118) | delStatementCategories() {
method delStatementAssets (line 128) | delStatementAssets() {
FILE: src/stores/home_store.ts
class HomeStore (line 6) | class HomeStore {
method fetchStatements (line 21) | async fetchStatements(range) {
method fetchHomeData (line 26) | async fetchHomeData(range = 'today') {
method getFinanceData (line 43) | async getFinanceData() {
method updateFinanceAmountVisible (line 53) | async updateFinanceAmountVisible() {
method getSummaryData (line 63) | async getSummaryData(date) {
method getProfileData (line 80) | async getProfileData() {
method currentTheme (line 96) | get currentTheme() {
FILE: src/stores/theme_store.ts
class ThemeStore (line 5) | class ThemeStore {
method setTheme (line 29) | setTheme(theme) {
FILE: src/utils/event.ts
type EventHandler (line 1) | type EventHandler = (...args: any[]) => void
class EventEmitter (line 3) | class EventEmitter {
method constructor (line 6) | constructor() {
method on (line 10) | on(event: string, handler: EventHandler) {
method off (line 17) | off(event: string, handler?: EventHandler) {
method emit (line 35) | emit(event: string, ...args: any[]) {
Condensed preview — 179 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,161K chars).
[
{
"path": ".editorconfig",
"chars": 197,
"preview": "# http://editorconfig.org\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\ncharset = utf-8\ntrim_trailing_whitespace"
},
{
"path": ".eslintrc.js",
"chars": 161,
"preview": "// module.exports = {\n// \"extends\": [\"taro/react\"],\n// \"rules\": {\n// \"react/jsx-uses-react\": \"off\",\n// \"reac"
},
{
"path": ".gitignore",
"chars": 90,
"preview": "dist/\ndeploy_versions/\n.temp/\n.rn_temp/\nnode_modules/\n.DS_Store\n.swc/\nsrc/config/config.ts"
},
{
"path": ".vscode/settings.json",
"chars": 67,
"preview": "{\n \"compile-hero.disable-compile-files-on-did-save-code\": true\n}"
},
{
"path": "README.md",
"chars": 1172,
"preview": "# 洁账小程序\n\n重要:基于 wepy 的老版本已经不维护了,请切换到 Taro 最新版本!!\n\n一款简单易用的记账小程序,帮助用户轻松管理个人财务。\n\n后端代码请切换到旧版本-配合 wepy 前端使用:https://github.com"
},
{
"path": "babel.config.js",
"chars": 213,
"preview": "// babel-preset-taro 更多选项和默认值:\n// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md\nmodule.e"
},
{
"path": "config/dev.js",
"chars": 218,
"preview": "module.exports = {\n projectname: \"jz-taro-development\",\n outputRoot: 'dist/development',\n env: {\n NODE_ENV: '\"deve"
},
{
"path": "config/index.js",
"chars": 1849,
"preview": "const path = require('path');\n\nconst config = {\n projectName: 'jz-taro',\n date: '2021-4-4',\n designWidth: 750,\n devi"
},
{
"path": "config/prod.js",
"chars": 425,
"preview": "module.exports = {\n projectname: \"jz-taro-production\",\n outputRoot: 'dist/production',\n env: {\n NODE_ENV: '\"produc"
},
{
"path": "package.json",
"chars": 2352,
"preview": "{\n \"name\": \"jz-taro\",\n \"version\": \"4.0.0\",\n \"private\": true,\n \"description\": \"jiezhang\",\n \"templateInfo\": {\n \"na"
},
{
"path": "plugins/view-data-plugin.js",
"chars": 411,
"preview": "// NOTE:Taro 的 View 不支持自定义属性,比如 <View theme='test'></View>,编译会过滤掉 theme 属性\n// https://github.com/NervJS/taro/issues/1153"
},
{
"path": "project.config.json",
"chars": 706,
"preview": "{\n\t\"miniprogramRoot\": \"dist/\",\n\t\"projectname\": \"jz-taro\",\n\t\"description\": \"jiezhang\",\n\t\"appid\": \"wx414689c547b71ab0\",\n\t\""
},
{
"path": "src/api/http-result.ts",
"chars": 337,
"preview": "export default class HttpResult {\n \n public data: any\n public message: string\n public status: number\n public header"
},
{
"path": "src/api/index.ts",
"chars": 2171,
"preview": "import Request from './request'\nimport Statement from './logic/statement'\nimport Main from './logic/main'\nimport User fr"
},
{
"path": "src/api/logic/account_book.ts",
"chars": 896,
"preview": "import Request from '../request'\n\nexport default class AccountBook {\n private _request: Request\n constructor (request:"
},
{
"path": "src/api/logic/asset.ts",
"chars": 784,
"preview": "import Request from '../request'\n\nexport default class Asset {\n private _request: Request\n constructor (request: Reque"
},
{
"path": "src/api/logic/budget.ts",
"chars": 801,
"preview": "import Request from '../request'\n\nexport default class Budget {\n private _request: Request\n constructor (request: Requ"
},
{
"path": "src/api/logic/category.ts",
"chars": 744,
"preview": "import Request from '../request'\n\nexport default class Category {\n private _request: Request\n constructor (request: Re"
},
{
"path": "src/api/logic/chaos.ts",
"chars": 307,
"preview": "import Request from '../request'\n\nexport default class Chaos {\n private _request: Request\n constructor (request: Reque"
},
{
"path": "src/api/logic/finance.ts",
"chars": 848,
"preview": "import Request from '../request'\ntype AssetStatementParams = {\n asset_id: number;\n year: number;\n month: number;\n}\n\ne"
},
{
"path": "src/api/logic/friend.ts",
"chars": 1216,
"preview": "import jz from '@/jz'\nimport Request from '../request'\nimport { FriendInviteRequest, FriendInviteResponse } from '../typ"
},
{
"path": "src/api/logic/main.ts",
"chars": 535,
"preview": "import Request from '../request'\nimport { HeaderResponse, StatementsResponse } from '../types'\n\nexport default class Mai"
},
{
"path": "src/api/logic/message.ts",
"chars": 317,
"preview": "import Request from '../request'\n\nexport default class Message {\n private _request: Request\n constructor (request: Req"
},
{
"path": "src/api/logic/payee.ts",
"chars": 1246,
"preview": "import Request from '../request'\nimport jz from '../../jz'\n\nexport interface PayeeType {\n id: number\n name: string\n}\n\n"
},
{
"path": "src/api/logic/statement.ts",
"chars": 3261,
"preview": "import Request from '../request'\nimport jz from '@/jz'\nimport Taro from '@tarojs/taro'\n\nexport default class Statement {"
},
{
"path": "src/api/logic/statistic.ts",
"chars": 663,
"preview": "import Request from '../request'\nexport default class Statistic {\n private _request: Request\n constructor (request: Re"
},
{
"path": "src/api/logic/superChart.ts",
"chars": 801,
"preview": "import Request from '../request'\n\nexport default class SuperChart {\n private _request: Request\n constructor (request: "
},
{
"path": "src/api/logic/superStatement.ts",
"chars": 335,
"preview": "import Request from '../request'\n\nexport default class SuperStatement {\n private _request: Request\n constructor (reque"
},
{
"path": "src/api/logic/user.ts",
"chars": 482,
"preview": "import Request from '../request'\n\nexport default class User {\n private _request: Request\n constructor (request: Reques"
},
{
"path": "src/api/request.ts",
"chars": 4022,
"preview": "import Taro from \"@tarojs/taro\"\nimport HttpResult from './http-result'\nimport jz from '../jz'\n\nclass RequestManager {\n "
},
{
"path": "src/api/types.ts",
"chars": 1528,
"preview": "export interface User {\n id: number\n nickname: string\n avatar_path: string \n}\n\n// 请求失败的响应通用\ntype FailureResponse = {\n"
},
{
"path": "src/app.config.ts",
"chars": 1551,
"preview": "export default {\n pages: [\n // 首页\n 'pages/home/index',\n // 创建账单的表单\n 'pages/statement/form',\n 'pages/stat"
},
{
"path": "src/app.ts",
"chars": 631,
"preview": "import { Component } from 'react'\nimport Taro from \"@tarojs/taro\"\nimport jz from './jz'\n\nclass App extends Component {\n "
},
{
"path": "src/assets/echarts.js",
"chars": 1670132,
"preview": "(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof"
},
{
"path": "src/assets/fonts/iconfont.css",
"chars": 53077,
"preview": ".jcon-pic1:before {\n content: \"\\ea09\";\n}\n\n.jcon-banzhengfuwu:before {\n content: \"\\eb09\";\n}\n\n.jcon-pin:before {\n conte"
},
{
"path": "src/assets/fonts/index.styl",
"chars": 473,
"preview": "@import 'iconfont.css'\n \n@font-face {\n font-family: \"iconfont\"; /* Project id 2523724 */\n src: url('iconfont.woff2?t="
},
{
"path": "src/assets/styl/common/border.styl",
"chars": 122,
"preview": ".jz-border-bottom-1 {\n border-bottom: 1PX solid $borderColor\n}\n\n.jz-border-top-1 {\n border-top: 1PX solid $borderColor"
},
{
"path": "src/assets/styl/common/calculator.styl",
"chars": 1790,
"preview": "// 按钮的高度\n$calculatorHeight = 60\n// 背景色\n$itemBgColor = #dee2e6\n// 边框颜色\n$itemBorderColor = #ced4da\n\n\n.jz-calculator__main "
},
{
"path": "src/assets/styl/common/common.styl",
"chars": 305,
"preview": ".w-100 {\n width: 100%\n box-sizing: border-box\n}\n\n.h-100 {\n height: 100%\n}\n\n// 定位\n.p-absolute {\n position: absolute\n}"
},
{
"path": "src/assets/styl/common/flex.styl",
"chars": 2606,
"preview": "// flex 子元素,小程序不支持 * 选择符\n$flexChildSelector := '*'\n$flexJustifyContentEnums := {\n start: flex-start,\n end: flex-end,\n "
},
{
"path": "src/assets/styl/common/header.styl",
"chars": 484,
"preview": ".header-1 {\n display: block\n font-weight: bold\n font-size: 36px\n padding: 6px\n}\n\n.header-with-color-bottom {\n posit"
},
{
"path": "src/assets/styl/common/image.styl",
"chars": 348,
"preview": ".jz-image {\n display: inline-block\n\n &-normal {\n width: 100px;\n height: 100px;\n\n image {\n width: 100%;\n "
},
{
"path": "src/assets/styl/common/index.styl",
"chars": 184,
"preview": "@import \"./common\"\n@import \"./flex\"\n@import \"./shift\"\n@import \"./text\"\n@import \"./image\"\n@import \"./header\"\n@import \"./c"
},
{
"path": "src/assets/styl/common/input.styl",
"chars": 126,
"preview": ".jz-component__input {\n background: #ffffff\n border-bottom: 1rpx solid #f4f4f4\n input {\n padding: 14PX\n "
},
{
"path": "src/assets/styl/common/mask.styl",
"chars": 593,
"preview": ".jz-mask__main {\n position: fixed\n bottom: 0\n height: 100vh\n width: 100%\n z-index: 999\n\n .jz-mask {\n background"
},
{
"path": "src/assets/styl/common/text.styl",
"chars": 254,
"preview": ".text-bold {\n font-weight: bold\n}\n\nfor fontSize in (12..32)\n .fs-{fontSize}\n font-size \"%sPX !important\" % (fontSiz"
},
{
"path": "src/assets/styl/components/asset_banner.styl",
"chars": 1486,
"preview": ".asset-banner-component\n .banner-card\n background: var(--primary-bg-color)\n border-radius: 20PX\n padding: 21PX"
},
{
"path": "src/assets/styl/components/select_component.styl",
"chars": 1475,
"preview": ".select-component {\n position: fixed\n bottom: 0\n min-height: 400PX\n max-height: 780PX \n width: 100%\n z-index: 1000"
},
{
"path": "src/assets/styl/components/slide_sidebar.styl",
"chars": 1212,
"preview": ".slide-sidebar {\n position: fixed\n bottom: 0\n height: 100vh\n width: 100%\n z-index: 1000\n > .slide-sidebar__mask {\n"
},
{
"path": "src/assets/styl/components/statement.styl",
"chars": 2458,
"preview": "\n.statement-component__icon-image {\n width: 60px\n height: 60px\n image {\n width: 100%\n height: 100%\n }\n}\n.state"
},
{
"path": "src/assets/styl/components/statement_form.styl",
"chars": 7548,
"preview": ".statement-form__expend-form {\n .at-textarea {\n border-top: 0px !important\n font-size: 21PX !important\n paddin"
},
{
"path": "src/assets/styl/index.styl",
"chars": 821,
"preview": "// 通用组件样式\n@import \"./vars\"\n@import \"./themes/index\"\n@import \"./common/index\"\n\n// 组件通用\n@import \"./components/statement\"\n@"
},
{
"path": "src/assets/styl/pages/budget/index.styl",
"chars": 3854,
"preview": ".jz-pages__budget {\n background: var(--page-bg-color)\n min-height: 100vh\n \n .header-banner {\n background: #ffffff"
},
{
"path": "src/assets/styl/pages/finance/asset_flow.styl",
"chars": 3423,
"preview": ".jz-pages-assets-flow {\n background: #f8f9fa\n\n .asset-header {\n margin: 16PX\n \n .balance-section {\n back"
},
{
"path": "src/assets/styl/pages/finance/index.styl",
"chars": 1659,
"preview": ".jz-pages__finance\n padding: 16PX\n min-height: 100vh\n background: var(--background-color)\n\n .jz-pages__finance-list\n"
},
{
"path": "src/assets/styl/pages/friends/invite_info.styl",
"chars": 1026,
"preview": ".friend-invite-page\n padding: 16PX\n \n .invite-info-card\n background: #fff\n border-radius: 12PX\n padding: 24P"
},
{
"path": "src/assets/styl/pages/home/index.styl",
"chars": 1580,
"preview": ".jz-pages__index {\n .jz-pages__index-header {\n .row-content-block {\n background: #ffffff\n padding: 16PX\n "
},
{
"path": "src/assets/styl/pages/profile/category-form.styl",
"chars": 115,
"preview": ".category-icon-default-select {\n background: #f3f3f3;\n padding: 0 6PX\n border-left: 1px dashed #f4f4f4\n }"
},
{
"path": "src/assets/styl/pages/profile/index.styl",
"chars": 1897,
"preview": ".jz-pages__profile {\n background: var(--background-color)\n min-height: 100vh\n padding: 24PX 0\n font-size: 14PX\n\n .u"
},
{
"path": "src/assets/styl/pages/settings/category_manager.styl",
"chars": 147,
"preview": ".category-manager > .header {\n background-color: var(--primary-color)\n color: #ffffff\n padding: 24px 16px\n font-size"
},
{
"path": "src/assets/styl/pages/settings/chart.styl",
"chars": 768,
"preview": ".setting-chart-page {\n .header{\n background-color: #fbfbfb\n }\n .pie-echart {\n background-color: #fbfbfb\n }\n c"
},
{
"path": "src/assets/styl/pages/settings/export_page.styl",
"chars": 82,
"preview": ".export_pages {\n .item-selected {\n background-color: #e6f3ff !important;\n }\n}"
},
{
"path": "src/assets/styl/pages/settings/statement_imgs.styl",
"chars": 530,
"preview": ".statement-images {\n .year {\n font-size: 40rpx;\n font-weight: bold;\n margin: 12px 0;\n }\n .month "
},
{
"path": "src/assets/styl/pages/settings/user_info.styl",
"chars": 236,
"preview": ".user-info-page {\n image {\n width: 80PX\n height: 80PX\n }\n\n .nickname-input {\n margin: 24PX 12PX\n border-r"
},
{
"path": "src/assets/styl/pages/statements/detail.styl",
"chars": 3062,
"preview": ".jz-pages__statement-detail {\n min-height: 100vh\n background: #f8f9fa\n \n .detail-header {\n position: relative\n "
},
{
"path": "src/assets/styl/pages/statistic/calendar.styl",
"chars": 2135,
"preview": ".month-selector {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 20px 0;\n \n .month-arro"
},
{
"path": "src/assets/styl/pages/statistic/index.styl",
"chars": 177,
"preview": ".summary-component__header {\n display: flex\n background: #ffffff\n border-bottom: 1px solid #f4f4f4\n .header-item {\n "
},
{
"path": "src/assets/styl/shift.styl",
"chars": 8653,
"preview": ".p-auto {\n padding: auto !important;\n}\n.px-auto {\n padding-left: auto !important;\n padding-right: auto !important;\n}\n"
},
{
"path": "src/assets/styl/themes/components/button.styl",
"chars": 1162,
"preview": ".jz-common-components__button {\n background: var(--primary-bg-color)\n color: var(--primary-bg-text-color)\n margin: 12"
},
{
"path": "src/assets/styl/themes/components/form.styl",
"chars": 403,
"preview": ".jz-common-component__input, .jz-common-component__textarea {\n .label {\n margin: 21PX 0 0PX 12PX\n }\n input {\n b"
},
{
"path": "src/assets/styl/themes/components/loading.styl",
"chars": 452,
"preview": ".jz-common-component__loading:after {\n content: \" \";\n display: block;\n width: 30PX;\n height: 30PX;\n border-radius: "
},
{
"path": "src/assets/styl/themes/components/tab.styl",
"chars": 2462,
"preview": ".jz-common-components__tab {\n background: #fff\n white-space: nowrap\n border-bottom: 1px solid #f4f4f4\n padding: 8PX "
},
{
"path": "src/assets/styl/themes/index.styl",
"chars": 2455,
"preview": "\n$default = {\n primaryColor: #2196F3\n primaryBgColor: linear-gradient(135deg, #2196F3, #64B5F6)\n primaryBgTextColor: "
},
{
"path": "src/assets/styl/themes/root.styl",
"chars": 1130,
"preview": "$header-height ?= 68PX\n$bottom-height ?= 80PX\n\n.page-root-component {\n position relative\n display flex\n flex-directio"
},
{
"path": "src/assets/styl/vars.styl",
"chars": 1072,
"preview": "// 主题色(深色)\n$darkPrimaryColor ?= #1976D2\n\n// 主题色(浅色)\n$primaryColor ?= #2196F3\n\n// 文本颜色\n$primaryText ?= #212121\n\n// 二级文本颜色"
},
{
"path": "src/components/AssetBanner/index.jsx",
"chars": 1748,
"preview": "import React from 'react'\nimport { View, Text } from '@tarojs/components'\n\nconst AssetBanner = ({\n firstColumn={},\n se"
},
{
"path": "src/components/AssetList/index.tsx",
"chars": 7732,
"preview": "import Taro from '@tarojs/taro'\nimport React, { useState } from 'react'\nimport { forwardRef, useImperativeHandle } from "
},
{
"path": "src/components/Avatar/index.jsx",
"chars": 1143,
"preview": "import React, { useMemo } from 'react'\nimport { View, Text } from '@tarojs/components'\n\nconst COLORS = [\n '#f56a00', '#"
},
{
"path": "src/components/BasePage/index.tsx",
"chars": 6293,
"preview": "import Taro from '@tarojs/taro'\nimport React, { useContext, useEffect, useState } from 'react'\nimport jz from '@/jz'\nimp"
},
{
"path": "src/components/Calculator/index.scss",
"chars": 1415,
"preview": ".calculator {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n background: #f5f5f5;\n z-index: 100;\n border-top"
},
{
"path": "src/components/Calculator/index.tsx",
"chars": 4354,
"preview": "import { View, Text } from '@tarojs/components'\nimport React, { useState } from 'react'\nimport './index.scss'\n\ninterface"
},
{
"path": "src/components/CategoryList/index.tsx",
"chars": 8800,
"preview": "import Taro from '@tarojs/taro'\nimport React, { useEffect, useState } from 'react'\nimport { forwardRef, useImperativeHan"
},
{
"path": "src/components/EmptyTips/index.tsx",
"chars": 448,
"preview": "import React from 'react'\nimport { View } from '@tarojs/components'\nimport EmptyNoData from '@/assets/images/empty_no_da"
},
{
"path": "src/components/Home/FinancePage/index.tsx",
"chars": 5852,
"preview": "import { useState, useContext, useEffect } from 'react'\nimport { useDidShow } from '@tarojs/taro'\nimport { View, Image, "
},
{
"path": "src/components/Home/IndexPage/index.tsx",
"chars": 5515,
"preview": "import React, { useEffect, useState, useContext } from 'react'\nimport Taro from '@tarojs/taro'\nimport { View, Text } fro"
},
{
"path": "src/components/Home/ProfilePage/index.tsx",
"chars": 7174,
"preview": "import jz from '@/jz'\nimport { useContext, useEffect, useState } from 'react'\nimport { differenceInDays } from 'date-fns"
},
{
"path": "src/components/Home/StatisticPage/index.tsx",
"chars": 2188,
"preview": "import { Component, useState, useMemo } from 'react'\nimport { View, Picker } from '@tarojs/components'\nimport { Tabs } f"
},
{
"path": "src/components/Home/index.js",
"chars": 125,
"preview": "export * from './FinancePage'\nexport * from './IndexPage/index'\nexport * from './ProfilePage'\nexport * from './Statistic"
},
{
"path": "src/components/Select/index.jsx",
"chars": 1097,
"preview": "import { View } from '@tarojs/components'\n\nexport default function Select ({\n children,\n onSubmit,\n onCancel,\n onTog"
},
{
"path": "src/components/SlideSetting/index.tsx",
"chars": 2786,
"preview": "import React, { useEffect, useState } from 'react'\nimport { View, Image } from '@tarojs/components'\nimport jz from '@/jz"
},
{
"path": "src/components/Statement/index.jsx",
"chars": 3604,
"preview": "import React from 'react'\nimport { View, Image, Text } from '@tarojs/components'\nimport Avatar from '@/components/Avatar"
},
{
"path": "src/components/Statements/index.jsx",
"chars": 338,
"preview": "import React from 'react'\nimport { View } from '@tarojs/components'\nimport Statement from '../Statement'\n\nexport default"
},
{
"path": "src/components/Statistic/CalendarStatistic.tsx",
"chars": 5147,
"preview": "import React, { useEffect, useState, memo } from 'react'\nimport { format, getDaysInMonth, startOfMonth, getDay } from 'd"
},
{
"path": "src/components/Statistic/ExpendCategory.tsx",
"chars": 226,
"preview": "import React, { useEffect, useState } from 'react'\nimport { View } from '@tarojs/components'\n\nexport default function Ex"
},
{
"path": "src/components/Statistic/ExpendList.tsx",
"chars": 1211,
"preview": "import React, { useState, useEffect } from 'react'\nimport { Tabs } from '@/src/components/UiComponents'\nimport { View } "
},
{
"path": "src/components/Statistic/ExpendTrend.tsx",
"chars": 291,
"preview": "import React, { useEffect, useState } from 'react'\nimport { format } from 'date-fns'\nimport BaseForm from './baseForm'\ni"
},
{
"path": "src/components/Statistic/Summary.tsx",
"chars": 1765,
"preview": "import React, { useEffect, useState, useContext } from 'react'\nimport { View, Text } from '@tarojs/components'\nimport St"
},
{
"path": "src/components/UiComponents/Button/index.tsx",
"chars": 317,
"preview": "import React from 'react'\nimport { Button as B } from '@tarojs/components'\n\nexport const Button = ({\n title,\n classNam"
},
{
"path": "src/components/UiComponents/Calculator/index.tsx",
"chars": 6138,
"preview": "import React, { useEffect, useState } from 'react'\nimport { View } from '@tarojs/components'\n\n\nexport function Calculato"
},
{
"path": "src/components/UiComponents/Form/index.tsx",
"chars": 2868,
"preview": "import React, { useState } from 'react'\nimport { View, Input as VInput, Textarea as VTextarea } from '@tarojs/components"
},
{
"path": "src/components/UiComponents/Loading/index.tsx",
"chars": 383,
"preview": "import React from 'react'\nimport { View } from '@tarojs/components'\nexport const Loading = function ({\n active,\n title"
},
{
"path": "src/components/UiComponents/Tabs/index.tsx",
"chars": 661,
"preview": "\nimport React from 'react'\nimport { ScrollView, View } from '@tarojs/components'\n\nexport const Tabs = ({\n tabs,\n curre"
},
{
"path": "src/components/UiComponents/index.js",
"chars": 125,
"preview": "export * from './Button'\nexport * from './Loading'\nexport * from './Calculator'\nexport * from './Tabs'\nexport * from './"
},
{
"path": "src/components/statementForm/CategorySelect.tsx",
"chars": 2483,
"preview": "import React from 'react'\nimport { View, Image, Text } from '@tarojs/components'\nimport { Loading } from '@/src/componen"
},
{
"path": "src/components/statementForm/PayeeSelect.tsx",
"chars": 1995,
"preview": "import { View, Text } from '@tarojs/components'\nimport jz from '@/jz'\nimport { Loading } from '@/src/components/UiCompon"
},
{
"path": "src/components/statementForm/baseForm.tsx",
"chars": 20411,
"preview": "import Taro from \"@tarojs/taro\"\nimport React, { useEffect, useState } from 'react'\nimport { useDidShow } from '@tarojs/t"
},
{
"path": "src/config/config.ts.example",
"chars": 168,
"preview": "export default {\n appid: '填入小程序app_id',\n dev_host: 'http://127.0.0.1:3000',\n production_host: 'https://example-produc"
},
{
"path": "src/config/index.ts",
"chars": 387,
"preview": "// 从本地配置文件导入\nimport devConfig from './config'\n\ntype Config = {\n appid: string,\n host: string,\n api_url: string,\n web"
},
{
"path": "src/index.html",
"chars": 1011,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n <meta content=\"wid"
},
{
"path": "src/jz.ts",
"chars": 3199,
"preview": "import Taro from \"@tarojs/taro\"\n\nimport { Api } from './api'\nimport Router from './router'\nimport Storage from './storag"
},
{
"path": "src/pages/account_books/create.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '创建账簿'\n}\n"
},
{
"path": "src/pages/account_books/create.styl",
"chars": 2863,
"preview": ".create-account-book__page {\n \n .btn-group {\n position: fixed\n bottom: 0\n }\n\n .edit-category-component {\n p"
},
{
"path": "src/pages/account_books/create.tsx",
"chars": 5351,
"preview": "import Taro from '@tarojs/taro'\nimport React, { useEffect, useState, useRef } from 'react'\nimport { View } from '@tarojs"
},
{
"path": "src/pages/account_books/edit.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '编辑账簿'\n}\n"
},
{
"path": "src/pages/account_books/edit.tsx",
"chars": 3137,
"preview": "import Taro from '@tarojs/taro'\nimport { View } from \"@tarojs/components\"\nimport BasePage from '@/components/BasePage'\ni"
},
{
"path": "src/pages/account_books/list.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '账簿列表'\n}\n"
},
{
"path": "src/pages/account_books/list.styl",
"chars": 108,
"preview": ".account-list {\n .account {\n background: #fff\n &.active {\n border: 1PX solid #6bb16b\n }\n }\n}"
},
{
"path": "src/pages/account_books/list.tsx",
"chars": 2140,
"preview": "import Taro from '@tarojs/taro'\nimport { View } from \"@tarojs/components\"\nimport BasePage from '@/components/BasePage'\ni"
},
{
"path": "src/pages/assets_flow/index.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '资金流水'\n}\n"
},
{
"path": "src/pages/assets_flow/index.tsx",
"chars": 5121,
"preview": "import React, { useEffect, useState } from 'react'\nimport { View, Text } from '@tarojs/components'\nimport BasePage from "
},
{
"path": "src/pages/friends/index.config.ts",
"chars": 89,
"preview": "export default {\n navigationBarTitleText: '好友列表',\n enableShareAppMessage: true\n}\n "
},
{
"path": "src/pages/friends/index.scss",
"chars": 3475,
"preview": ".friends-page {\n padding: 16PX;\n\n .friends-list {\n margin-bottom: 20PX;\n }\n\n .friend-card {\n margin-bottom: 16"
},
{
"path": "src/pages/friends/index.tsx",
"chars": 7674,
"preview": "import BasePage from '@/components/BasePage'\nimport { View, Text, Image } from '@tarojs/components'\nimport { useEffect, "
},
{
"path": "src/pages/friends/invite_info.config.ts",
"chars": 83,
"preview": "export default {\n navigationBarTitleText: '邀请好友',\n enableShareAppMessage: true\n}\n"
},
{
"path": "src/pages/friends/invite_info.tsx",
"chars": 3451,
"preview": "import BasePage from '@/components/BasePage'\nimport { View, Text, Image, Button } from '@tarojs/components'\nimport { use"
},
{
"path": "src/pages/home/index.config.ts",
"chars": 81,
"preview": "export default {\n navigationBarTitleText: '首页',\n enableShareAppMessage: true\n}\n"
},
{
"path": "src/pages/home/index.tsx",
"chars": 1335,
"preview": "import React, { useState } from 'react'\nimport BasePage from '@/components/BasePage'\nimport { View } from '@tarojs/compo"
},
{
"path": "src/pages/payee/list.config.ts",
"chars": 59,
"preview": "export default {\n navigationBarTitleText: '商家管理',\n }\n "
},
{
"path": "src/pages/payee/list.scss",
"chars": 924,
"preview": ".payee-list {\n .payee-item {\n border-bottom: 1px solid #eee;\n \n .order-buttons {\n display: flex;\n fl"
},
{
"path": "src/pages/payee/list.tsx",
"chars": 2957,
"preview": "import React, { useEffect, useState } from 'react'\nimport { View, Text } from '@tarojs/components'\nimport BasePage from "
},
{
"path": "src/pages/setting/asset/form.tsx",
"chars": 5065,
"preview": "import { useEffect, useState } from 'react'\nimport { View, Image } from '@tarojs/components'\nimport BasePage from '@/com"
},
{
"path": "src/pages/setting/asset/index.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '资产管理'\n}\n"
},
{
"path": "src/pages/setting/asset/index.tsx",
"chars": 3627,
"preview": "import { useState } from 'react'\nimport { AtSwipeAction } from \"taro-ui\"\nimport { View, Image, Text } from '@tarojs/comp"
},
{
"path": "src/pages/setting/budget/index.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '预算管理'\n}\n"
},
{
"path": "src/pages/setting/budget/index.tsx",
"chars": 8840,
"preview": "import { useState, useEffect } from 'react'\nimport { View, Image, Text, Picker } from '@tarojs/components'\nimport jz fro"
},
{
"path": "src/pages/setting/category/form.tsx",
"chars": 4054,
"preview": "import { useEffect, useState } from 'react'\nimport { View, Image } from '@tarojs/components'\nimport BasePage from '@/com"
},
{
"path": "src/pages/setting/category/index.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '分类管理'\n}\n"
},
{
"path": "src/pages/setting/category/index.tsx",
"chars": 4555,
"preview": "import { Component, useEffect, useState, useContext } from 'react'\nimport { View, Image } from '@tarojs/components'\nimpo"
},
{
"path": "src/pages/setting/chart/category_statement.config.ts",
"chars": 58,
"preview": "export default {\n navigationBarTitleText: '分类报表'\n }\n "
},
{
"path": "src/pages/setting/chart/category_statement.tsx",
"chars": 1962,
"preview": "import { useEffect, useState } from 'react'\nimport { View } from '@tarojs/components'\nimport jz from '@/jz'\nimport BaseP"
},
{
"path": "src/pages/setting/child_budget/index.config.ts",
"chars": 54,
"preview": "export default {\n navigationBarTitleText: '分类预算管理'\n}\n"
},
{
"path": "src/pages/setting/child_budget/index.tsx",
"chars": 3785,
"preview": "import { useState } from 'react'\nimport { View, Image, Text } from '@tarojs/components'\nimport jz from '@/jz'\nimport { u"
},
{
"path": "src/pages/setting/feedback/index.config.ts",
"chars": 50,
"preview": "export default {\n navigationBarTitleText: '反馈'\n}\n"
},
{
"path": "src/pages/setting/feedback/index.tsx",
"chars": 924,
"preview": "import { Component, useEffect, useState } from 'react'\nimport { View, Image } from '@tarojs/components'\nimport jz from '"
},
{
"path": "src/pages/setting/messages/detail.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '消息详情'\n}\n"
},
{
"path": "src/pages/setting/messages/detail.tsx",
"chars": 1179,
"preview": "import { useEffect, useState } from 'react'\nimport { View } from '@tarojs/components'\nimport jz from '@/jz'\nimport BaseP"
},
{
"path": "src/pages/setting/messages/index.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '站内消息'\n}\n"
},
{
"path": "src/pages/setting/messages/index.tsx",
"chars": 1242,
"preview": "import { Component, useEffect, useState } from 'react'\nimport { View, Image } from '@tarojs/components'\nimport jz from '"
},
{
"path": "src/pages/setting/search/search.config.ts",
"chars": 50,
"preview": "export default {\n navigationBarTitleText: '搜索'\n}\n"
},
{
"path": "src/pages/setting/search/search.tsx",
"chars": 1069,
"preview": "import { useState } from 'react'\nimport { View, Input } from '@tarojs/components'\nimport jz from '@/jz'\nimport BasePage "
},
{
"path": "src/pages/setting/statement_imgs/index.config.ts",
"chars": 58,
"preview": "export default {\n navigationBarTitleText: '账单图库'\n }\n "
},
{
"path": "src/pages/setting/statement_imgs/index.tsx",
"chars": 1828,
"preview": "import { Component, useEffect, useState } from 'react'\nimport { View, Image } from '@tarojs/components'\nimport jz from '"
},
{
"path": "src/pages/setting/statements_flow/index.config.ts",
"chars": 50,
"preview": "export default {\n navigationBarTitleText: '流水'\n}\n"
},
{
"path": "src/pages/setting/statements_flow/index.scss",
"chars": 1881,
"preview": ".jz-pages-assets-flow {\n min-height: 100vh;\n background: var(--page-bg-color);\n\n &__header {\n padding: 24PX;\n m"
},
{
"path": "src/pages/setting/statements_flow/index.tsx",
"chars": 3353,
"preview": "import { Component, useEffect, useState } from 'react'\nimport { View, Text } from '@tarojs/components'\nimport BasePage f"
},
{
"path": "src/pages/setting/statements_manage/data_in.config.ts",
"chars": 53,
"preview": "export default {\n navigationBarTitleText: '登录PC端'\n}\n"
},
{
"path": "src/pages/setting/statements_manage/data_in.tsx",
"chars": 864,
"preview": "import { Component, useEffect, useState } from 'react'\nimport { View } from '@tarojs/components'\nimport jz from '@/jz'\ni"
},
{
"path": "src/pages/setting/statements_manage/data_out.config.ts",
"chars": 58,
"preview": "export default {\n navigationBarTitleText: '账单导出'\n }\n "
},
{
"path": "src/pages/setting/statements_manage/data_out.tsx",
"chars": 2432,
"preview": "import { useState } from 'react'\nimport { View } from '@tarojs/components'\nimport { AtButton, AtList, AtListItem } from "
},
{
"path": "src/pages/setting/user_info/index.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '用户信息'\n}\n"
},
{
"path": "src/pages/setting/user_info/index.tsx",
"chars": 2401,
"preview": "import { useEffect, useState } from 'react'\nimport { View, Image, Button, Input, Text } from '@tarojs/components'\nimport"
},
{
"path": "src/pages/share/index.config.ts",
"chars": 83,
"preview": "export default {\n navigationBarTitleText: '账单分享',\n enableShareAppMessage: true\n}\n"
},
{
"path": "src/pages/share/index.tsx",
"chars": 7173,
"preview": "import React, { useEffect, useState } from 'react'\nimport Taro, { useShareAppMessage } from \"@tarojs/taro\"\nimport { View"
},
{
"path": "src/pages/share/public.config.ts",
"chars": 83,
"preview": "export default {\n navigationBarTitleText: '账单分享',\n enableShareAppMessage: true\n}\n"
},
{
"path": "src/pages/share/public.tsx",
"chars": 2517,
"preview": "import React, { useEffect, useState } from 'react'\nimport { View } from '@tarojs/components'\nimport { AtTag } from 'taro"
},
{
"path": "src/pages/statement/form.config.ts",
"chars": 51,
"preview": "export default {\n navigationBarTitleText: '记一笔'\n}\n"
},
{
"path": "src/pages/statement/form.tsx",
"chars": 1629,
"preview": "import React, { useEffect, useState } from 'react'\nimport { View } from '@tarojs/components'\nimport BasePage from '@/com"
},
{
"path": "src/pages/statement_detail/index.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '账单详情'\n}\n"
},
{
"path": "src/pages/statement_detail/index.tsx",
"chars": 17430,
"preview": "import { Component, useEffect, useState } from 'react'\nimport Taro from \"@tarojs/taro\"\nimport { View, Image, Text, Texta"
},
{
"path": "src/pages/sub/chart/index.config.ts",
"chars": 52,
"preview": "export default {\n navigationBarTitleText: '消费报表'\n}\n"
},
{
"path": "src/pages/sub/chart/index.tsx",
"chars": 7314,
"preview": "import { useEffect, useState } from 'react'\nimport { View, Picker, ScrollView } from '@tarojs/components'\nimport jz from"
},
{
"path": "src/router/index.ts",
"chars": 2480,
"preview": "import Taro from '@tarojs/taro'\n\ninterface RouterOptions {\n url: string\n name?: string\n params?: Record<string, any>\n"
},
{
"path": "src/storage/index.ts",
"chars": 2786,
"preview": "import Taro from \"@tarojs/taro\"\n\nexport default class Storage {\n private _version = 'v1'\n\n saveLocal(key, value, expir"
},
{
"path": "src/stores/home_store.ts",
"chars": 3113,
"preview": "import {observable, action,computed } from 'mobx';\nimport { createContext } from \"react\";\nimport jz from '@/jz';\n\n// 此 S"
},
{
"path": "src/stores/index.ts",
"chars": 146,
"preview": "import { HomeStoreContext } from './home_store'\nimport { ThemeStoreContext } from './theme_store'\n\nexport { HomeStoreCon"
},
{
"path": "src/stores/theme_store.ts",
"chars": 574,
"preview": "import {observable, action} from 'mobx';\nimport jz from '@/jz'\nimport { createContext } from \"react\";\n\nclass ThemeStore "
},
{
"path": "src/utils/echart_option.ts",
"chars": 1376,
"preview": "export const getExpendLineOption = (data) => {\n return {\n legend: {\n },\n tooltip: {},\n xAxis: { type: 'cate"
},
{
"path": "src/utils/event.ts",
"chars": 892,
"preview": "type EventHandler = (...args: any[]) => void\n\nexport class EventEmitter {\n private events: Map<string, EventHandler[]>\n"
},
{
"path": "tsconfig.json",
"chars": 337,
"preview": "{\n \"compilerOptions\": {\n \"experimentalDecorators\": true,\n \"jsx\": \"react\",\n \"baseUrl\": \".\",\n \"paths\": {\n "
}
]
About this extraction
This page contains the full source code of the yigger/jiezhang GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 179 files (2.0 MB), approximately 537.9k tokens, and a symbol index with 1485 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.