fec-dev-designer 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/es/_virtual/FileSaver.min.js +4 -0
- package/es/_virtual/___vite-browser-external.js +6 -0
- package/es/_virtual/__vite-browser-external.js +4 -0
- package/es/_virtual/_commonjs-dynamic-modules.js +6 -0
- package/es/_virtual/_commonjsHelpers.js +30 -0
- package/es/_virtual/_plugin-vue_export-helper.js +9 -0
- package/es/_virtual/advancedFormat.js +4 -0
- package/es/_virtual/aes.js +4 -0
- package/es/_virtual/bessel.js +4 -0
- package/es/_virtual/blowfish.js +4 -0
- package/es/_virtual/cipher-core.js +4 -0
- package/es/_virtual/clipboard.js +4 -0
- package/es/_virtual/core.js +4 -0
- package/es/_virtual/customParseFormat.js +4 -0
- package/es/_virtual/dayOfYear.js +4 -0
- package/es/_virtual/dayjs.min.js +4 -0
- package/es/_virtual/enc-base64.js +4 -0
- package/es/_virtual/enc-base64url.js +4 -0
- package/es/_virtual/enc-utf16.js +4 -0
- package/es/_virtual/evpkdf.js +4 -0
- package/es/_virtual/format-hex.js +4 -0
- package/es/_virtual/hmac.js +4 -0
- package/es/_virtual/index.js +4 -0
- package/es/_virtual/interact.min.js +4 -0
- package/es/_virtual/isSameOrAfter.js +4 -0
- package/es/_virtual/isSameOrBefore.js +4 -0
- package/es/_virtual/jstat.js +4 -0
- package/es/_virtual/lib-typedarrays.js +4 -0
- package/es/_virtual/localeData.js +4 -0
- package/es/_virtual/md5.js +4 -0
- package/es/_virtual/mode-cfb.js +4 -0
- package/es/_virtual/mode-ctr-gladman.js +4 -0
- package/es/_virtual/mode-ctr.js +4 -0
- package/es/_virtual/mode-ecb.js +4 -0
- package/es/_virtual/mode-ofb.js +4 -0
- package/es/_virtual/pad-ansix923.js +4 -0
- package/es/_virtual/pad-iso10126.js +4 -0
- package/es/_virtual/pad-iso97971.js +4 -0
- package/es/_virtual/pad-nopadding.js +4 -0
- package/es/_virtual/pad-zeropadding.js +4 -0
- package/es/_virtual/pbkdf2.js +4 -0
- package/es/_virtual/rabbit-legacy.js +4 -0
- package/es/_virtual/rabbit.js +4 -0
- package/es/_virtual/rc4.js +4 -0
- package/es/_virtual/ripemd160.js +4 -0
- package/es/_virtual/sha1.js +4 -0
- package/es/_virtual/sha224.js +4 -0
- package/es/_virtual/sha256.js +4 -0
- package/es/_virtual/sha3.js +4 -0
- package/es/_virtual/sha384.js +4 -0
- package/es/_virtual/sha512.js +4 -0
- package/es/_virtual/tripledes.js +4 -0
- package/es/_virtual/vue-json-viewer.js +4 -0
- package/es/_virtual/weekOfYear.js +4 -0
- package/es/_virtual/weekYear.js +4 -0
- package/es/_virtual/x64-core.js +4 -0
- package/es/config-dev.js +37 -0
- package/es/config-prod.js +37 -0
- package/es/logo.ico +0 -0
- package/es/node_modules/@codemirror/autocomplete/dist/index.js +1372 -0
- package/es/node_modules/@codemirror/commands/dist/index.js +845 -0
- package/es/node_modules/@codemirror/lang-javascript/dist/index.js +300 -0
- package/es/node_modules/@codemirror/language/dist/index.js +1301 -0
- package/es/node_modules/@codemirror/lint/dist/index.js +481 -0
- package/es/node_modules/@codemirror/search/dist/index.js +841 -0
- package/es/node_modules/@codemirror/state/dist/index.js +2649 -0
- package/es/node_modules/@codemirror/view/dist/index.js +7452 -0
- package/es/node_modules/@ctrl/tinycolor/dist/module/conversion.js +115 -0
- package/es/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js +153 -0
- package/es/node_modules/@ctrl/tinycolor/dist/module/format-input.js +68 -0
- package/es/node_modules/@ctrl/tinycolor/dist/module/index.js +183 -0
- package/es/node_modules/@ctrl/tinycolor/dist/module/util.js +32 -0
- package/es/node_modules/@element-plus/icons-vue/dist/index.js +739 -0
- package/es/node_modules/@formulajs/formulajs/lib/esm/index.js +4095 -0
- package/es/node_modules/@lezer/common/dist/index.js +1434 -0
- package/es/node_modules/@lezer/highlight/dist/index.js +637 -0
- package/es/node_modules/@lezer/javascript/dist/index.js +166 -0
- package/es/node_modules/@lezer/lr/dist/index.js +1313 -0
- package/es/node_modules/@marijn/find-cluster-break/src/index.js +78 -0
- package/es/node_modules/@popperjs/core/dist/index.js +588 -0
- package/es/node_modules/@vexip-ui/hooks/dist/index.js +612 -0
- package/es/node_modules/@vexip-ui/utils/dist/index.js +250 -0
- package/es/node_modules/@vue/shared/dist/shared.esm-bundler.js +32 -0
- package/es/node_modules/@vueuse/core/index.js +299 -0
- package/es/node_modules/@vueuse/shared/index.js +111 -0
- package/es/node_modules/async-validator/dist-web/index.js +653 -0
- package/es/node_modules/bessel/bessel.js +136 -0
- package/es/node_modules/clipboard/dist/clipboard.js +499 -0
- package/es/node_modules/codemirror/dist/index.js +40 -0
- package/es/node_modules/crelt/index.js +31 -0
- package/es/node_modules/crypto-js/aes.js +70 -0
- package/es/node_modules/crypto-js/blowfish.js +1132 -0
- package/es/node_modules/crypto-js/cipher-core.js +545 -0
- package/es/node_modules/crypto-js/core.js +508 -0
- package/es/node_modules/crypto-js/enc-base64.js +81 -0
- package/es/node_modules/crypto-js/enc-base64url.js +88 -0
- package/es/node_modules/crypto-js/enc-utf16.js +100 -0
- package/es/node_modules/crypto-js/evpkdf.js +71 -0
- package/es/node_modules/crypto-js/format-hex.js +54 -0
- package/es/node_modules/crypto-js/hmac.js +84 -0
- package/es/node_modules/crypto-js/index.js +49 -0
- package/es/node_modules/crypto-js/lib-typedarrays.js +28 -0
- package/es/node_modules/crypto-js/md5.js +72 -0
- package/es/node_modules/crypto-js/mode-cfb.js +37 -0
- package/es/node_modules/crypto-js/mode-ctr-gladman.js +46 -0
- package/es/node_modules/crypto-js/mode-ctr.js +29 -0
- package/es/node_modules/crypto-js/mode-ecb.js +28 -0
- package/es/node_modules/crypto-js/mode-ofb.js +27 -0
- package/es/node_modules/crypto-js/pad-ansix923.js +26 -0
- package/es/node_modules/crypto-js/pad-iso10126.js +26 -0
- package/es/node_modules/crypto-js/pad-iso97971.js +24 -0
- package/es/node_modules/crypto-js/pad-nopadding.js +22 -0
- package/es/node_modules/crypto-js/pad-zeropadding.js +29 -0
- package/es/node_modules/crypto-js/pbkdf2.js +75 -0
- package/es/node_modules/crypto-js/rabbit-legacy.js +74 -0
- package/es/node_modules/crypto-js/rabbit.js +76 -0
- package/es/node_modules/crypto-js/rc4.js +64 -0
- package/es/node_modules/crypto-js/ripemd160.js +399 -0
- package/es/node_modules/crypto-js/sha1.js +50 -0
- package/es/node_modules/crypto-js/sha224.js +37 -0
- package/es/node_modules/crypto-js/sha256.js +58 -0
- package/es/node_modules/crypto-js/sha3.js +117 -0
- package/es/node_modules/crypto-js/sha384.js +38 -0
- package/es/node_modules/crypto-js/sha512.js +148 -0
- package/es/node_modules/crypto-js/tripledes.js +730 -0
- package/es/node_modules/crypto-js/x64-core.js +236 -0
- package/es/node_modules/dayjs/dayjs.min.js +296 -0
- package/es/node_modules/dayjs/plugin/advancedFormat.js +55 -0
- package/es/node_modules/dayjs/plugin/customParseFormat.js +138 -0
- package/es/node_modules/dayjs/plugin/dayOfYear.js +19 -0
- package/es/node_modules/dayjs/plugin/isSameOrAfter.js +18 -0
- package/es/node_modules/dayjs/plugin/isSameOrBefore.js +18 -0
- package/es/node_modules/dayjs/plugin/localeData.js +83 -0
- package/es/node_modules/dayjs/plugin/weekOfYear.js +31 -0
- package/es/node_modules/dayjs/plugin/weekYear.js +19 -0
- package/es/node_modules/element-plus/dist/locale/zh-cn.js +198 -0
- package/es/node_modules/element-plus/es/_virtual/plugin-vue_export-helper.js +9 -0
- package/es/node_modules/element-plus/es/components/alert/index.js +7 -0
- package/es/node_modules/element-plus/es/components/alert/src/alert.js +43 -0
- package/es/node_modules/element-plus/es/components/alert/src/alert2.js +130 -0
- package/es/node_modules/element-plus/es/components/badge/index.js +7 -0
- package/es/node_modules/element-plus/es/components/badge/src/badge.js +36 -0
- package/es/node_modules/element-plus/es/components/badge/src/badge2.js +73 -0
- package/es/node_modules/element-plus/es/components/button/index.js +11 -0
- package/es/node_modules/element-plus/es/components/button/src/button-custom.js +51 -0
- package/es/node_modules/element-plus/es/components/button/src/button-group.js +14 -0
- package/es/node_modules/element-plus/es/components/button/src/button-group2.js +35 -0
- package/es/node_modules/element-plus/es/components/button/src/button.js +72 -0
- package/es/node_modules/element-plus/es/components/button/src/button2.js +93 -0
- package/es/node_modules/element-plus/es/components/button/src/constants.js +6 -0
- package/es/node_modules/element-plus/es/components/button/src/use-button.js +79 -0
- package/es/node_modules/element-plus/es/components/card/index.js +7 -0
- package/es/node_modules/element-plus/es/components/card/src/card.js +26 -0
- package/es/node_modules/element-plus/es/components/card/src/card2.js +75 -0
- package/es/node_modules/element-plus/es/components/checkbox/index.js +15 -0
- package/es/node_modules/element-plus/es/components/checkbox/src/checkbox-button.js +92 -0
- package/es/node_modules/element-plus/es/components/checkbox/src/checkbox-group.js +53 -0
- package/es/node_modules/element-plus/es/components/checkbox/src/checkbox-group2.js +94 -0
- package/es/node_modules/element-plus/es/components/checkbox/src/checkbox.js +65 -0
- package/es/node_modules/element-plus/es/components/checkbox/src/checkbox2.js +119 -0
- package/es/node_modules/element-plus/es/components/checkbox/src/composables/use-checkbox-disabled.js +27 -0
- package/es/node_modules/element-plus/es/components/checkbox/src/composables/use-checkbox-event.js +49 -0
- package/es/node_modules/element-plus/es/components/checkbox/src/composables/use-checkbox-model.js +25 -0
- package/es/node_modules/element-plus/es/components/checkbox/src/composables/use-checkbox-status.js +34 -0
- package/es/node_modules/element-plus/es/components/checkbox/src/composables/use-checkbox.js +79 -0
- package/es/node_modules/element-plus/es/components/checkbox/src/constants.js +4 -0
- package/es/node_modules/element-plus/es/components/col/index.js +7 -0
- package/es/node_modules/element-plus/es/components/col/src/col.js +47 -0
- package/es/node_modules/element-plus/es/components/col/src/col2.js +43 -0
- package/es/node_modules/element-plus/es/components/collapse/index.js +11 -0
- package/es/node_modules/element-plus/es/components/collapse/src/collapse-item.js +21 -0
- package/es/node_modules/element-plus/es/components/collapse/src/collapse-item2.js +113 -0
- package/es/node_modules/element-plus/es/components/collapse/src/collapse.js +29 -0
- package/es/node_modules/element-plus/es/components/collapse/src/collapse2.js +30 -0
- package/es/node_modules/element-plus/es/components/collapse/src/constants.js +4 -0
- package/es/node_modules/element-plus/es/components/collapse/src/use-collapse-item.js +59 -0
- package/es/node_modules/element-plus/es/components/collapse/src/use-collapse.js +63 -0
- package/es/node_modules/element-plus/es/components/collapse-transition/index.js +7 -0
- package/es/node_modules/element-plus/es/components/collapse-transition/src/collapse-transition.js +51 -0
- package/es/node_modules/element-plus/es/components/collection/src/collection-item.js +13 -0
- package/es/node_modules/element-plus/es/components/collection/src/collection.js +53 -0
- package/es/node_modules/element-plus/es/components/collection/src/collection2.js +12 -0
- package/es/node_modules/element-plus/es/components/config-provider/index.js +9 -0
- package/es/node_modules/element-plus/es/components/config-provider/src/config-provider-props.js +44 -0
- package/es/node_modules/element-plus/es/components/config-provider/src/config-provider.js +24 -0
- package/es/node_modules/element-plus/es/components/config-provider/src/constants.js +4 -0
- package/es/node_modules/element-plus/es/components/config-provider/src/hooks/use-global-config.js +86 -0
- package/es/node_modules/element-plus/es/components/container/index.js +20 -0
- package/es/node_modules/element-plus/es/components/container/src/aside.js +33 -0
- package/es/node_modules/element-plus/es/components/container/src/container.js +34 -0
- package/es/node_modules/element-plus/es/components/container/src/footer.js +33 -0
- package/es/node_modules/element-plus/es/components/container/src/header.js +33 -0
- package/es/node_modules/element-plus/es/components/container/src/main.js +24 -0
- package/es/node_modules/element-plus/es/components/date-picker/index.js +7 -0
- package/es/node_modules/element-plus/es/components/date-picker/src/date-picker.js +68 -0
- package/es/node_modules/element-plus/es/components/date-picker/src/props.js +12 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/index.js +7 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/composables/use-basic-date-table.js +190 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/composables/use-month-range-header.js +30 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/composables/use-panel-date-range.js +76 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/composables/use-range-picker.js +93 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/composables/use-shortcut.js +24 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/composables/use-year-range-header.js +35 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/constants.js +5 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/basic-cell-render.js +31 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/basic-date-table.js +116 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/basic-month-table.js +168 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/basic-year-table.js +159 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.js +611 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-date-range.js +729 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-month-range.js +290 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/date-picker-com/panel-year-range.js +303 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/date-picker-panel.js +79 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/panel-utils.js +20 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/props/basic-cell.js +9 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/props/basic-date-table.js +11 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/props/basic-month-table.js +9 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/props/basic-year-table.js +9 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/props/date-picker-panel.js +61 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/props/panel-date-pick.js +19 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/props/panel-date-range.js +9 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/props/panel-month-range.js +13 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/props/panel-year-range.js +13 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/props/shared.js +90 -0
- package/es/node_modules/element-plus/es/components/date-picker-panel/src/utils.js +81 -0
- package/es/node_modules/element-plus/es/components/dialog/index.js +7 -0
- package/es/node_modules/element-plus/es/components/dialog/src/constants.js +5 -0
- package/es/node_modules/element-plus/es/components/dialog/src/dialog-content.js +42 -0
- package/es/node_modules/element-plus/es/components/dialog/src/dialog-content2.js +101 -0
- package/es/node_modules/element-plus/es/components/dialog/src/dialog.js +77 -0
- package/es/node_modules/element-plus/es/components/dialog/src/dialog2.js +181 -0
- package/es/node_modules/element-plus/es/components/dialog/src/use-dialog.js +163 -0
- package/es/node_modules/element-plus/es/components/divider/index.js +7 -0
- package/es/node_modules/element-plus/es/components/divider/src/divider.js +20 -0
- package/es/node_modules/element-plus/es/components/divider/src/divider2.js +40 -0
- package/es/node_modules/element-plus/es/components/drawer/index.js +7 -0
- package/es/node_modules/element-plus/es/components/drawer/src/composables/useResizable.js +48 -0
- package/es/node_modules/element-plus/es/components/drawer/src/drawer.js +36 -0
- package/es/node_modules/element-plus/es/components/drawer/src/drawer2.js +212 -0
- package/es/node_modules/element-plus/es/components/dropdown/index.js +14 -0
- package/es/node_modules/element-plus/es/components/dropdown/src/dropdown-item-impl.js +99 -0
- package/es/node_modules/element-plus/es/components/dropdown/src/dropdown-item.js +87 -0
- package/es/node_modules/element-plus/es/components/dropdown/src/dropdown-menu.js +80 -0
- package/es/node_modules/element-plus/es/components/dropdown/src/dropdown.js +110 -0
- package/es/node_modules/element-plus/es/components/dropdown/src/dropdown2.js +242 -0
- package/es/node_modules/element-plus/es/components/dropdown/src/tokens.js +5 -0
- package/es/node_modules/element-plus/es/components/dropdown/src/useDropdown.js +15 -0
- package/es/node_modules/element-plus/es/components/empty/index.js +7 -0
- package/es/node_modules/element-plus/es/components/empty/src/empty.js +15 -0
- package/es/node_modules/element-plus/es/components/empty/src/empty2.js +75 -0
- package/es/node_modules/element-plus/es/components/empty/src/img-empty.js +132 -0
- package/es/node_modules/element-plus/es/components/focus-trap/src/focus-trap.js +165 -0
- package/es/node_modules/element-plus/es/components/focus-trap/src/tokens.js +17 -0
- package/es/node_modules/element-plus/es/components/focus-trap/src/utils.js +90 -0
- package/es/node_modules/element-plus/es/components/form/index.js +11 -0
- package/es/node_modules/element-plus/es/components/form/src/constants.js +5 -0
- package/es/node_modules/element-plus/es/components/form/src/form-item.js +243 -0
- package/es/node_modules/element-plus/es/components/form/src/form-item2.js +50 -0
- package/es/node_modules/element-plus/es/components/form/src/form-label-wrap.js +66 -0
- package/es/node_modules/element-plus/es/components/form/src/form.js +59 -0
- package/es/node_modules/element-plus/es/components/form/src/form2.js +149 -0
- package/es/node_modules/element-plus/es/components/form/src/hooks/use-form-common-props.js +20 -0
- package/es/node_modules/element-plus/es/components/form/src/hooks/use-form-item.js +51 -0
- package/es/node_modules/element-plus/es/components/form/src/utils.js +45 -0
- package/es/node_modules/element-plus/es/components/icon/index.js +7 -0
- package/es/node_modules/element-plus/es/components/icon/src/icon.js +12 -0
- package/es/node_modules/element-plus/es/components/icon/src/icon2.js +35 -0
- package/es/node_modules/element-plus/es/components/input/index.js +7 -0
- package/es/node_modules/element-plus/es/components/input/src/input.js +462 -0
- package/es/node_modules/element-plus/es/components/input/src/input2.js +128 -0
- package/es/node_modules/element-plus/es/components/input/src/utils.js +66 -0
- package/es/node_modules/element-plus/es/components/input-number/index.js +7 -0
- package/es/node_modules/element-plus/es/components/input-number/src/input-number.js +78 -0
- package/es/node_modules/element-plus/es/components/input-number/src/input-number2.js +272 -0
- package/es/node_modules/element-plus/es/components/input-tag/index.js +7 -0
- package/es/node_modules/element-plus/es/components/input-tag/src/composables/use-drag-tag.js +58 -0
- package/es/node_modules/element-plus/es/components/input-tag/src/composables/use-hovering.js +16 -0
- package/es/node_modules/element-plus/es/components/input-tag/src/composables/use-input-tag-dom.js +70 -0
- package/es/node_modules/element-plus/es/components/input-tag/src/composables/use-input-tag.js +145 -0
- package/es/node_modules/element-plus/es/components/input-tag/src/input-tag.js +86 -0
- package/es/node_modules/element-plus/es/components/input-tag/src/input-tag2.js +322 -0
- package/es/node_modules/element-plus/es/components/link/index.js +7 -0
- package/es/node_modules/element-plus/es/components/link/src/link.js +29 -0
- package/es/node_modules/element-plus/es/components/link/src/link2.js +72 -0
- package/es/node_modules/element-plus/es/components/loading/index.js +16 -0
- package/es/node_modules/element-plus/es/components/loading/src/directive.js +60 -0
- package/es/node_modules/element-plus/es/components/loading/src/loading.js +117 -0
- package/es/node_modules/element-plus/es/components/loading/src/service.js +67 -0
- package/es/node_modules/element-plus/es/components/menu/index.js +23 -0
- package/es/node_modules/element-plus/es/components/menu/src/menu-collapse-transition.js +40 -0
- package/es/node_modules/element-plus/es/components/menu/src/menu-item-group.js +6 -0
- package/es/node_modules/element-plus/es/components/menu/src/menu-item-group2.js +48 -0
- package/es/node_modules/element-plus/es/components/menu/src/menu-item.js +18 -0
- package/es/node_modules/element-plus/es/components/menu/src/menu-item2.js +102 -0
- package/es/node_modules/element-plus/es/components/menu/src/menu.js +299 -0
- package/es/node_modules/element-plus/es/components/menu/src/sub-menu.js +309 -0
- package/es/node_modules/element-plus/es/components/menu/src/tokens.js +5 -0
- package/es/node_modules/element-plus/es/components/menu/src/use-menu-color.js +11 -0
- package/es/node_modules/element-plus/es/components/menu/src/use-menu-css-var.js +19 -0
- package/es/node_modules/element-plus/es/components/menu/src/use-menu.js +22 -0
- package/es/node_modules/element-plus/es/components/menu/src/utils/menu-bar.js +15 -0
- package/es/node_modules/element-plus/es/components/menu/src/utils/menu-item.js +44 -0
- package/es/node_modules/element-plus/es/components/menu/src/utils/submenu.js +47 -0
- package/es/node_modules/element-plus/es/components/message/index.js +7 -0
- package/es/node_modules/element-plus/es/components/message/src/instance.js +18 -0
- package/es/node_modules/element-plus/es/components/message/src/message.js +112 -0
- package/es/node_modules/element-plus/es/components/message/src/message2.js +148 -0
- package/es/node_modules/element-plus/es/components/message/src/method.js +118 -0
- package/es/node_modules/element-plus/es/components/message-box/index.js +10 -0
- package/es/node_modules/element-plus/es/components/message-box/src/index.js +466 -0
- package/es/node_modules/element-plus/es/components/message-box/src/messageBox.js +93 -0
- package/es/node_modules/element-plus/es/components/overlay/index.js +9 -0
- package/es/node_modules/element-plus/es/components/overlay/src/overlay.js +70 -0
- package/es/node_modules/element-plus/es/components/pagination/index.js +10 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/jumper.js +11 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/jumper2.js +62 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/next.js +40 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/next2.js +22 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/pager.js +19 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/pager2.js +151 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/prev.js +21 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/prev2.js +40 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/sizes.js +29 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/sizes2.js +75 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/total.js +10 -0
- package/es/node_modules/element-plus/es/components/pagination/src/components/total2.js +24 -0
- package/es/node_modules/element-plus/es/components/pagination/src/constants.js +4 -0
- package/es/node_modules/element-plus/es/components/pagination/src/pagination.js +246 -0
- package/es/node_modules/element-plus/es/components/pagination/src/usePagination.js +6 -0
- package/es/node_modules/element-plus/es/components/popconfirm/index.js +7 -0
- package/es/node_modules/element-plus/es/components/popconfirm/src/popconfirm.js +145 -0
- package/es/node_modules/element-plus/es/components/popconfirm/src/popconfirm2.js +53 -0
- package/es/node_modules/element-plus/es/components/popover/index.js +11 -0
- package/es/node_modules/element-plus/es/components/popover/src/directive.js +17 -0
- package/es/node_modules/element-plus/es/components/popover/src/popover.js +70 -0
- package/es/node_modules/element-plus/es/components/popover/src/popover2.js +97 -0
- package/es/node_modules/element-plus/es/components/popper/index.js +7 -0
- package/es/node_modules/element-plus/es/components/popper/src/arrow.js +10 -0
- package/es/node_modules/element-plus/es/components/popper/src/arrow2.js +35 -0
- package/es/node_modules/element-plus/es/components/popper/src/composables/use-content-dom.js +40 -0
- package/es/node_modules/element-plus/es/components/popper/src/composables/use-content.js +63 -0
- package/es/node_modules/element-plus/es/components/popper/src/composables/use-focus-trap.js +29 -0
- package/es/node_modules/element-plus/es/components/popper/src/constants.js +5 -0
- package/es/node_modules/element-plus/es/components/popper/src/content.js +89 -0
- package/es/node_modules/element-plus/es/components/popper/src/content2.js +118 -0
- package/es/node_modules/element-plus/es/components/popper/src/popper.js +21 -0
- package/es/node_modules/element-plus/es/components/popper/src/popper2.js +24 -0
- package/es/node_modules/element-plus/es/components/popper/src/trigger.js +33 -0
- package/es/node_modules/element-plus/es/components/popper/src/trigger2.js +116 -0
- package/es/node_modules/element-plus/es/components/popper/src/utils.js +56 -0
- package/es/node_modules/element-plus/es/components/radio/index.js +14 -0
- package/es/node_modules/element-plus/es/components/radio/src/constants.js +4 -0
- package/es/node_modules/element-plus/es/components/radio/src/radio-button.js +8 -0
- package/es/node_modules/element-plus/es/components/radio/src/radio-button2.js +74 -0
- package/es/node_modules/element-plus/es/components/radio/src/radio-group.js +57 -0
- package/es/node_modules/element-plus/es/components/radio/src/radio-group2.js +82 -0
- package/es/node_modules/element-plus/es/components/radio/src/radio.js +39 -0
- package/es/node_modules/element-plus/es/components/radio/src/radio2.js +97 -0
- package/es/node_modules/element-plus/es/components/radio/src/use-radio.js +39 -0
- package/es/node_modules/element-plus/es/components/roving-focus-group/src/roving-focus-group-impl.js +118 -0
- package/es/node_modules/element-plus/es/components/roving-focus-group/src/roving-focus-group.js +33 -0
- package/es/node_modules/element-plus/es/components/roving-focus-group/src/roving-focus-group2.js +34 -0
- package/es/node_modules/element-plus/es/components/roving-focus-group/src/roving-focus-item.js +81 -0
- package/es/node_modules/element-plus/es/components/roving-focus-group/src/tokens.js +5 -0
- package/es/node_modules/element-plus/es/components/roving-focus-group/src/utils.js +37 -0
- package/es/node_modules/element-plus/es/components/row/index.js +7 -0
- package/es/node_modules/element-plus/es/components/row/src/constants.js +4 -0
- package/es/node_modules/element-plus/es/components/row/src/row.js +32 -0
- package/es/node_modules/element-plus/es/components/row/src/row2.js +37 -0
- package/es/node_modules/element-plus/es/components/scrollbar/index.js +7 -0
- package/es/node_modules/element-plus/es/components/scrollbar/src/bar.js +14 -0
- package/es/node_modules/element-plus/es/components/scrollbar/src/bar2.js +51 -0
- package/es/node_modules/element-plus/es/components/scrollbar/src/constants.js +6 -0
- package/es/node_modules/element-plus/es/components/scrollbar/src/scrollbar.js +61 -0
- package/es/node_modules/element-plus/es/components/scrollbar/src/scrollbar2.js +168 -0
- package/es/node_modules/element-plus/es/components/scrollbar/src/thumb.js +14 -0
- package/es/node_modules/element-plus/es/components/scrollbar/src/thumb2.js +112 -0
- package/es/node_modules/element-plus/es/components/scrollbar/src/util.js +34 -0
- package/es/node_modules/element-plus/es/components/select/index.js +14 -0
- package/es/node_modules/element-plus/es/components/select/src/option-group.js +87 -0
- package/es/node_modules/element-plus/es/components/select/src/option.js +16 -0
- package/es/node_modules/element-plus/es/components/select/src/option2.js +82 -0
- package/es/node_modules/element-plus/es/components/select/src/options.js +28 -0
- package/es/node_modules/element-plus/es/components/select/src/select-dropdown.js +66 -0
- package/es/node_modules/element-plus/es/components/select/src/select.js +148 -0
- package/es/node_modules/element-plus/es/components/select/src/select2.js +664 -0
- package/es/node_modules/element-plus/es/components/select/src/token.js +5 -0
- package/es/node_modules/element-plus/es/components/select/src/useOption.js +68 -0
- package/es/node_modules/element-plus/es/components/select/src/useSelect.js +486 -0
- package/es/node_modules/element-plus/es/components/select-v2/src/useProps.js +30 -0
- package/es/node_modules/element-plus/es/components/slot/src/only-child.js +53 -0
- package/es/node_modules/element-plus/es/components/space/index.js +9 -0
- package/es/node_modules/element-plus/es/components/space/src/item.js +19 -0
- package/es/node_modules/element-plus/es/components/space/src/space.js +144 -0
- package/es/node_modules/element-plus/es/components/space/src/use-space.js +37 -0
- package/es/node_modules/element-plus/es/components/switch/index.js +7 -0
- package/es/node_modules/element-plus/es/components/switch/src/switch.js +264 -0
- package/es/node_modules/element-plus/es/components/switch/src/switch2.js +79 -0
- package/es/node_modules/element-plus/es/components/table/index.js +11 -0
- package/es/node_modules/element-plus/es/components/table/src/composables/use-scrollbar.js +20 -0
- package/es/node_modules/element-plus/es/components/table/src/config.js +204 -0
- package/es/node_modules/element-plus/es/components/table/src/filter-panel.js +306 -0
- package/es/node_modules/element-plus/es/components/table/src/h-helper.js +26 -0
- package/es/node_modules/element-plus/es/components/table/src/layout-observer.js +50 -0
- package/es/node_modules/element-plus/es/components/table/src/store/current.js +47 -0
- package/es/node_modules/element-plus/es/components/table/src/store/expand.js +50 -0
- package/es/node_modules/element-plus/es/components/table/src/store/helper.js +58 -0
- package/es/node_modules/element-plus/es/components/table/src/store/index.js +113 -0
- package/es/node_modules/element-plus/es/components/table/src/store/tree.js +151 -0
- package/es/node_modules/element-plus/es/components/table/src/store/watcher.js +327 -0
- package/es/node_modules/element-plus/es/components/table/src/table/defaults.js +90 -0
- package/es/node_modules/element-plus/es/components/table/src/table/key-render-helper.js +18 -0
- package/es/node_modules/element-plus/es/components/table/src/table/style-helper.js +173 -0
- package/es/node_modules/element-plus/es/components/table/src/table/utils-helper.js +35 -0
- package/es/node_modules/element-plus/es/components/table/src/table-body/defaults.js +25 -0
- package/es/node_modules/element-plus/es/components/table/src/table-body/events-helper.js +125 -0
- package/es/node_modules/element-plus/es/components/table/src/table-body/index.js +67 -0
- package/es/node_modules/element-plus/es/components/table/src/table-body/render-helper.js +178 -0
- package/es/node_modules/element-plus/es/components/table/src/table-body/styles-helper.js +88 -0
- package/es/node_modules/element-plus/es/components/table/src/table-body/td-wrapper.js +28 -0
- package/es/node_modules/element-plus/es/components/table/src/table-column/defaults.js +62 -0
- package/es/node_modules/element-plus/es/components/table/src/table-column/index.js +125 -0
- package/es/node_modules/element-plus/es/components/table/src/table-column/render-helper.js +106 -0
- package/es/node_modules/element-plus/es/components/table/src/table-column/watcher-helper.js +70 -0
- package/es/node_modules/element-plus/es/components/table/src/table-footer/index.js +99 -0
- package/es/node_modules/element-plus/es/components/table/src/table-footer/mapState-helper.js +34 -0
- package/es/node_modules/element-plus/es/components/table/src/table-footer/style-helper.js +30 -0
- package/es/node_modules/element-plus/es/components/table/src/table-header/event-helper.js +114 -0
- package/es/node_modules/element-plus/es/components/table/src/table-header/index.js +244 -0
- package/es/node_modules/element-plus/es/components/table/src/table-header/style.helper.js +64 -0
- package/es/node_modules/element-plus/es/components/table/src/table-header/utils-helper.js +45 -0
- package/es/node_modules/element-plus/es/components/table/src/table-layout.js +146 -0
- package/es/node_modules/element-plus/es/components/table/src/table.js +423 -0
- package/es/node_modules/element-plus/es/components/table/src/tokens.js +4 -0
- package/es/node_modules/element-plus/es/components/table/src/util.js +312 -0
- package/es/node_modules/element-plus/es/components/tabs/index.js +14 -0
- package/es/node_modules/element-plus/es/components/tabs/src/constants.js +4 -0
- package/es/node_modules/element-plus/es/components/tabs/src/tab-bar.js +15 -0
- package/es/node_modules/element-plus/es/components/tabs/src/tab-bar2.js +75 -0
- package/es/node_modules/element-plus/es/components/tabs/src/tab-nav.js +215 -0
- package/es/node_modules/element-plus/es/components/tabs/src/tab-pane.js +19 -0
- package/es/node_modules/element-plus/es/components/tabs/src/tab-pane2.js +69 -0
- package/es/node_modules/element-plus/es/components/tabs/src/tabs.js +151 -0
- package/es/node_modules/element-plus/es/components/tag/index.js +7 -0
- package/es/node_modules/element-plus/es/components/tag/src/tag.js +119 -0
- package/es/node_modules/element-plus/es/components/tag/src/tag2.js +30 -0
- package/es/node_modules/element-plus/es/components/teleport/index.js +7 -0
- package/es/node_modules/element-plus/es/components/teleport/src/teleport.js +11 -0
- package/es/node_modules/element-plus/es/components/teleport/src/teleport2.js +19 -0
- package/es/node_modules/element-plus/es/components/text/index.js +7 -0
- package/es/node_modules/element-plus/es/components/text/src/text.js +25 -0
- package/es/node_modules/element-plus/es/components/text/src/text2.js +49 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/common/picker-range-trigger.js +112 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/common/picker.js +410 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/common/props.js +139 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/composables/use-common-picker.js +61 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/composables/use-time-panel.js +60 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/composables/use-time-picker.js +40 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/constants.js +23 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/props/basic-time-spinner.js +25 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/props/panel-time-picker.js +12 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/props/shared.js +26 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/time-picker-com/basic-time-spinner.js +312 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/time-picker-com/panel-time-pick.js +135 -0
- package/es/node_modules/element-plus/es/components/time-picker/src/utils.js +37 -0
- package/es/node_modules/element-plus/es/components/tooltip/index.js +7 -0
- package/es/node_modules/element-plus/es/components/tooltip/src/constants.js +4 -0
- package/es/node_modules/element-plus/es/components/tooltip/src/content.js +32 -0
- package/es/node_modules/element-plus/es/components/tooltip/src/content2.js +156 -0
- package/es/node_modules/element-plus/es/components/tooltip/src/tooltip.js +36 -0
- package/es/node_modules/element-plus/es/components/tooltip/src/tooltip2.js +156 -0
- package/es/node_modules/element-plus/es/components/tooltip/src/trigger.js +19 -0
- package/es/node_modules/element-plus/es/components/tooltip/src/trigger2.js +80 -0
- package/es/node_modules/element-plus/es/components/tooltip/src/utils.js +9 -0
- package/es/node_modules/element-plus/es/components/tree/index.js +7 -0
- package/es/node_modules/element-plus/es/components/tree/src/model/node.js +266 -0
- package/es/node_modules/element-plus/es/components/tree/src/model/tree-store.js +223 -0
- package/es/node_modules/element-plus/es/components/tree/src/model/useDragNode.js +90 -0
- package/es/node_modules/element-plus/es/components/tree/src/model/useKeydown.js +85 -0
- package/es/node_modules/element-plus/es/components/tree/src/model/useNodeExpandEventBroadcast.js +27 -0
- package/es/node_modules/element-plus/es/components/tree/src/model/util.js +19 -0
- package/es/node_modules/element-plus/es/components/tree/src/tokens.js +6 -0
- package/es/node_modules/element-plus/es/components/tree/src/tree-node-content.js +34 -0
- package/es/node_modules/element-plus/es/components/tree/src/tree-node.js +269 -0
- package/es/node_modules/element-plus/es/components/tree/src/tree.js +95 -0
- package/es/node_modules/element-plus/es/components/tree/src/tree2.js +250 -0
- package/es/node_modules/element-plus/es/components/virtual-list/src/defaults.js +4 -0
- package/es/node_modules/element-plus/es/components/virtual-list/src/hooks/use-wheel.js +22 -0
- package/es/node_modules/element-plus/es/constants/aria.js +20 -0
- package/es/node_modules/element-plus/es/constants/date.js +17 -0
- package/es/node_modules/element-plus/es/constants/event.js +6 -0
- package/es/node_modules/element-plus/es/constants/form.js +5 -0
- package/es/node_modules/element-plus/es/constants/size.js +4 -0
- package/es/node_modules/element-plus/es/directives/click-outside/index.js +46 -0
- package/es/node_modules/element-plus/es/directives/mousewheel/index.js +28 -0
- package/es/node_modules/element-plus/es/directives/repeat-click/index.js +30 -0
- package/es/node_modules/element-plus/es/directives/trap-focus/index.js +37 -0
- package/es/node_modules/element-plus/es/hooks/use-aria/index.js +14 -0
- package/es/node_modules/element-plus/es/hooks/use-attrs/index.js +22 -0
- package/es/node_modules/element-plus/es/hooks/use-calc-input-width/index.js +19 -0
- package/es/node_modules/element-plus/es/hooks/use-composition/index.js +29 -0
- package/es/node_modules/element-plus/es/hooks/use-cursor/index.js +39 -0
- package/es/node_modules/element-plus/es/hooks/use-delayed-toggle/index.js +49 -0
- package/es/node_modules/element-plus/es/hooks/use-deprecated/index.js +21 -0
- package/es/node_modules/element-plus/es/hooks/use-draggable/index.js +47 -0
- package/es/node_modules/element-plus/es/hooks/use-empty-values/index.js +38 -0
- package/es/node_modules/element-plus/es/hooks/use-escape-keydown/index.js +21 -0
- package/es/node_modules/element-plus/es/hooks/use-focus-controller/index.js +38 -0
- package/es/node_modules/element-plus/es/hooks/use-forward-ref/index.js +23 -0
- package/es/node_modules/element-plus/es/hooks/use-id/index.js +27 -0
- package/es/node_modules/element-plus/es/hooks/use-locale/index.js +27 -0
- package/es/node_modules/element-plus/es/hooks/use-lockscreen/index.js +30 -0
- package/es/node_modules/element-plus/es/hooks/use-model-toggle/index.js +69 -0
- package/es/node_modules/element-plus/es/hooks/use-namespace/index.js +44 -0
- package/es/node_modules/element-plus/es/hooks/use-ordered-children/index.js +45 -0
- package/es/node_modules/element-plus/es/hooks/use-popper/index.js +96 -0
- package/es/node_modules/element-plus/es/hooks/use-popper-container/index.js +26 -0
- package/es/node_modules/element-plus/es/hooks/use-prop/index.js +11 -0
- package/es/node_modules/element-plus/es/hooks/use-same-target/index.js +16 -0
- package/es/node_modules/element-plus/es/hooks/use-size/index.js +16 -0
- package/es/node_modules/element-plus/es/hooks/use-timeout/index.js +14 -0
- package/es/node_modules/element-plus/es/hooks/use-z-index/index.js +27 -0
- package/es/node_modules/element-plus/es/locale/lang/en.js +197 -0
- package/es/node_modules/element-plus/es/utils/arrays.js +6 -0
- package/es/node_modules/element-plus/es/utils/browser.js +9 -0
- package/es/node_modules/element-plus/es/utils/dom/aria.js +37 -0
- package/es/node_modules/element-plus/es/utils/dom/event.js +35 -0
- package/es/node_modules/element-plus/es/utils/dom/scroll.js +35 -0
- package/es/node_modules/element-plus/es/utils/dom/style.js +59 -0
- package/es/node_modules/element-plus/es/utils/error.js +19 -0
- package/es/node_modules/element-plus/es/utils/i18n.js +4 -0
- package/es/node_modules/element-plus/es/utils/objects.js +15 -0
- package/es/node_modules/element-plus/es/utils/raf.js +6 -0
- package/es/node_modules/element-plus/es/utils/strings.js +9 -0
- package/es/node_modules/element-plus/es/utils/types.js +20 -0
- package/es/node_modules/element-plus/es/utils/typescript.js +4 -0
- package/es/node_modules/element-plus/es/utils/vue/icon.js +32 -0
- package/es/node_modules/element-plus/es/utils/vue/install.js +20 -0
- package/es/node_modules/element-plus/es/utils/vue/props/runtime.js +37 -0
- package/es/node_modules/element-plus/es/utils/vue/refs.js +8 -0
- package/es/node_modules/element-plus/es/utils/vue/validator.js +5 -0
- package/es/node_modules/element-plus/es/utils/vue/vnode.js +26 -0
- package/es/node_modules/element-plus/theme-chalk/base.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-alert.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-aside.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-badge.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-button-group.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-button.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-card.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-checkbox-group.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-checkbox.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-col.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-collapse-item.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-collapse.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-config-provider.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-container.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-date-picker-panel.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-date-picker.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-dialog.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-divider.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-drawer.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-dropdown-item.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-dropdown-menu.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-dropdown.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-empty.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-footer.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-form-item.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-form.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-header.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-input-number.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-input-tag.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-input.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-link.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-loading.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-main.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-menu-item.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-menu.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-message-box.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-message.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-option-group.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-option.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-overlay.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-pagination.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-popconfirm.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-popover.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-popper.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-radio-button.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-radio-group.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-radio.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-row.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-scrollbar.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-select.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-space.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-sub-menu.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-switch.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-tab-pane.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-table-column.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-table.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-tabs.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-tag.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-text.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-tooltip.css.js +4 -0
- package/es/node_modules/element-plus/theme-chalk/el-tree.css.js +4 -0
- package/es/node_modules/file-saver/dist/FileSaver.min.js +73 -0
- package/es/node_modules/grid-layout-plus/es/components/grid-item.vue.js +358 -0
- package/es/node_modules/grid-layout-plus/es/components/grid-layout.vue.js +268 -0
- package/es/node_modules/grid-layout-plus/es/helpers/common.js +202 -0
- package/es/node_modules/grid-layout-plus/es/helpers/dom.js +10 -0
- package/es/node_modules/grid-layout-plus/es/helpers/draggable.js +33 -0
- package/es/node_modules/grid-layout-plus/es/helpers/responsive.js +40 -0
- package/es/node_modules/grid-layout-plus/es/index.js +13 -0
- package/es/node_modules/interactjs/dist/interact.min.js +2444 -0
- package/es/node_modules/jstat/dist/jstat.js +2295 -0
- package/es/node_modules/lodash-es/_DataView.js +7 -0
- package/es/node_modules/lodash-es/_Hash.js +20 -0
- package/es/node_modules/lodash-es/_ListCache.js +20 -0
- package/es/node_modules/lodash-es/_Map.js +7 -0
- package/es/node_modules/lodash-es/_MapCache.js +20 -0
- package/es/node_modules/lodash-es/_Promise.js +7 -0
- package/es/node_modules/lodash-es/_Set.js +7 -0
- package/es/node_modules/lodash-es/_SetCache.js +13 -0
- package/es/node_modules/lodash-es/_Stack.js +18 -0
- package/es/node_modules/lodash-es/_Symbol.js +6 -0
- package/es/node_modules/lodash-es/_Uint8Array.js +6 -0
- package/es/node_modules/lodash-es/_WeakMap.js +7 -0
- package/es/node_modules/lodash-es/_apply.js +16 -0
- package/es/node_modules/lodash-es/_arrayEach.js +8 -0
- package/es/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/es/node_modules/lodash-es/_arrayLikeKeys.js +20 -0
- package/es/node_modules/lodash-es/_arrayMap.js +8 -0
- package/es/node_modules/lodash-es/_arrayPush.js +8 -0
- package/es/node_modules/lodash-es/_arraySome.js +9 -0
- package/es/node_modules/lodash-es/_assignMergeValue.js +8 -0
- package/es/node_modules/lodash-es/_assignValue.js +10 -0
- package/es/node_modules/lodash-es/_assocIndexOf.js +10 -0
- package/es/node_modules/lodash-es/_baseAssign.js +8 -0
- package/es/node_modules/lodash-es/_baseAssignIn.js +8 -0
- package/es/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/es/node_modules/lodash-es/_baseClamp.js +6 -0
- package/es/node_modules/lodash-es/_baseClone.js +65 -0
- package/es/node_modules/lodash-es/_baseCreate.js +18 -0
- package/es/node_modules/lodash-es/_baseEach.js +7 -0
- package/es/node_modules/lodash-es/_baseFindIndex.js +9 -0
- package/es/node_modules/lodash-es/_baseFlatten.js +13 -0
- package/es/node_modules/lodash-es/_baseFor.js +6 -0
- package/es/node_modules/lodash-es/_baseForOwn.js +8 -0
- package/es/node_modules/lodash-es/_baseGet.js +11 -0
- package/es/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/es/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/es/node_modules/lodash-es/_baseHas.js +7 -0
- package/es/node_modules/lodash-es/_baseHasIn.js +6 -0
- package/es/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/es/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/es/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
- package/es/node_modules/lodash-es/_baseIsMap.js +9 -0
- package/es/node_modules/lodash-es/_baseIsMatch.js +31 -0
- package/es/node_modules/lodash-es/_baseIsNative.js +16 -0
- package/es/node_modules/lodash-es/_baseIsSet.js +9 -0
- package/es/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
- package/es/node_modules/lodash-es/_baseIteratee.js +11 -0
- package/es/node_modules/lodash-es/_baseKeys.js +14 -0
- package/es/node_modules/lodash-es/_baseKeysIn.js +15 -0
- package/es/node_modules/lodash-es/_baseMap.js +11 -0
- package/es/node_modules/lodash-es/_baseMatches.js +12 -0
- package/es/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
- package/es/node_modules/lodash-es/_baseMerge.js +20 -0
- package/es/node_modules/lodash-es/_baseMergeDeep.js +31 -0
- package/es/node_modules/lodash-es/_basePick.js +10 -0
- package/es/node_modules/lodash-es/_basePickBy.js +13 -0
- package/es/node_modules/lodash-es/_baseProperty.js +8 -0
- package/es/node_modules/lodash-es/_basePropertyDeep.js +9 -0
- package/es/node_modules/lodash-es/_baseRest.js +9 -0
- package/es/node_modules/lodash-es/_baseSet.js +24 -0
- package/es/node_modules/lodash-es/_baseSetToString.js +15 -0
- package/es/node_modules/lodash-es/_baseSlice.js +10 -0
- package/es/node_modules/lodash-es/_baseTimes.js +8 -0
- package/es/node_modules/lodash-es/_baseToString.js +18 -0
- package/es/node_modules/lodash-es/_baseTrim.js +8 -0
- package/es/node_modules/lodash-es/_baseUnary.js +8 -0
- package/es/node_modules/lodash-es/_baseUnset.js +28 -0
- package/es/node_modules/lodash-es/_cacheHas.js +6 -0
- package/es/node_modules/lodash-es/_castPath.js +10 -0
- package/es/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/es/node_modules/lodash-es/_cloneBuffer.js +11 -0
- package/es/node_modules/lodash-es/_cloneDataView.js +8 -0
- package/es/node_modules/lodash-es/_cloneRegExp.js +8 -0
- package/es/node_modules/lodash-es/_cloneSymbol.js +8 -0
- package/es/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/es/node_modules/lodash-es/_copyArray.js +9 -0
- package/es/node_modules/lodash-es/_copyObject.js +14 -0
- package/es/node_modules/lodash-es/_copySymbols.js +8 -0
- package/es/node_modules/lodash-es/_copySymbolsIn.js +8 -0
- package/es/node_modules/lodash-es/_coreJsData.js +6 -0
- package/es/node_modules/lodash-es/_createAssigner.js +15 -0
- package/es/node_modules/lodash-es/_createBaseEach.js +15 -0
- package/es/node_modules/lodash-es/_createBaseFor.js +13 -0
- package/es/node_modules/lodash-es/_customOmitClone.js +7 -0
- package/es/node_modules/lodash-es/_defineProperty.js +12 -0
- package/es/node_modules/lodash-es/_equalArrays.js +40 -0
- package/es/node_modules/lodash-es/_equalByTag.js +45 -0
- package/es/node_modules/lodash-es/_equalObjects.js +36 -0
- package/es/node_modules/lodash-es/_flatRest.js +9 -0
- package/es/node_modules/lodash-es/_freeGlobal.js +5 -0
- package/es/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/es/node_modules/lodash-es/_getAllKeysIn.js +9 -0
- package/es/node_modules/lodash-es/_getMapData.js +8 -0
- package/es/node_modules/lodash-es/_getMatchData.js +12 -0
- package/es/node_modules/lodash-es/_getNative.js +9 -0
- package/es/node_modules/lodash-es/_getPrototype.js +6 -0
- package/es/node_modules/lodash-es/_getRawTag.js +15 -0
- package/es/node_modules/lodash-es/_getSymbols.js +11 -0
- package/es/node_modules/lodash-es/_getSymbolsIn.js +13 -0
- package/es/node_modules/lodash-es/_getTag.js +29 -0
- package/es/node_modules/lodash-es/_getValue.js +6 -0
- package/es/node_modules/lodash-es/_hasPath.js +19 -0
- package/es/node_modules/lodash-es/_hashClear.js +7 -0
- package/es/node_modules/lodash-es/_hashDelete.js +7 -0
- package/es/node_modules/lodash-es/_hashGet.js +13 -0
- package/es/node_modules/lodash-es/_hashHas.js +9 -0
- package/es/node_modules/lodash-es/_hashSet.js +9 -0
- package/es/node_modules/lodash-es/_initCloneArray.js +8 -0
- package/es/node_modules/lodash-es/_initCloneByTag.js +42 -0
- package/es/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/es/node_modules/lodash-es/_isFlattenable.js +10 -0
- package/es/node_modules/lodash-es/_isIndex.js +8 -0
- package/es/node_modules/lodash-es/_isIterateeCall.js +13 -0
- package/es/node_modules/lodash-es/_isKey.js +12 -0
- package/es/node_modules/lodash-es/_isKeyable.js +7 -0
- package/es/node_modules/lodash-es/_isMasked.js +11 -0
- package/es/node_modules/lodash-es/_isPrototype.js +8 -0
- package/es/node_modules/lodash-es/_isStrictComparable.js +7 -0
- package/es/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/es/node_modules/lodash-es/_listCacheDelete.js +12 -0
- package/es/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/es/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/es/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/es/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/es/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/es/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/es/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/es/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/es/node_modules/lodash-es/_mapToArray.js +9 -0
- package/es/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
- package/es/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/es/node_modules/lodash-es/_nativeCreate.js +6 -0
- package/es/node_modules/lodash-es/_nativeKeys.js +6 -0
- package/es/node_modules/lodash-es/_nativeKeysIn.js +10 -0
- package/es/node_modules/lodash-es/_nodeUtil.js +12 -0
- package/es/node_modules/lodash-es/_objectToString.js +7 -0
- package/es/node_modules/lodash-es/_overArg.js +8 -0
- package/es/node_modules/lodash-es/_overRest.js +15 -0
- package/es/node_modules/lodash-es/_parent.js +8 -0
- package/es/node_modules/lodash-es/_root.js +6 -0
- package/es/node_modules/lodash-es/_safeGet.js +7 -0
- package/es/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/es/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/es/node_modules/lodash-es/_setToArray.js +9 -0
- package/es/node_modules/lodash-es/_setToString.js +7 -0
- package/es/node_modules/lodash-es/_shortOut.js +16 -0
- package/es/node_modules/lodash-es/_stackClear.js +7 -0
- package/es/node_modules/lodash-es/_stackDelete.js +7 -0
- package/es/node_modules/lodash-es/_stackGet.js +6 -0
- package/es/node_modules/lodash-es/_stackHas.js +6 -0
- package/es/node_modules/lodash-es/_stackSet.js +17 -0
- package/es/node_modules/lodash-es/_stringToPath.js +11 -0
- package/es/node_modules/lodash-es/_toKey.js +11 -0
- package/es/node_modules/lodash-es/_toSource.js +17 -0
- package/es/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
- package/es/node_modules/lodash-es/castArray.js +10 -0
- package/es/node_modules/lodash-es/clamp.js +8 -0
- package/es/node_modules/lodash-es/clone.js +8 -0
- package/es/node_modules/lodash-es/cloneDeep.js +8 -0
- package/es/node_modules/lodash-es/constant.js +8 -0
- package/es/node_modules/lodash-es/debounce.js +54 -0
- package/es/node_modules/lodash-es/eq.js +6 -0
- package/es/node_modules/lodash-es/findLastIndex.js +14 -0
- package/es/node_modules/lodash-es/flatMap.js +8 -0
- package/es/node_modules/lodash-es/flatten.js +8 -0
- package/es/node_modules/lodash-es/fromPairs.js +10 -0
- package/es/node_modules/lodash-es/get.js +8 -0
- package/es/node_modules/lodash-es/has.js +8 -0
- package/es/node_modules/lodash-es/hasIn.js +8 -0
- package/es/node_modules/lodash-es/identity.js +6 -0
- package/es/node_modules/lodash-es/isArguments.js +11 -0
- package/es/node_modules/lodash-es/isArray.js +5 -0
- package/es/node_modules/lodash-es/isArrayLike.js +8 -0
- package/es/node_modules/lodash-es/isArrayLikeObject.js +8 -0
- package/es/node_modules/lodash-es/isBuffer.js +7 -0
- package/es/node_modules/lodash-es/isEqual.js +7 -0
- package/es/node_modules/lodash-es/isFunction.js +12 -0
- package/es/node_modules/lodash-es/isLength.js +7 -0
- package/es/node_modules/lodash-es/isMap.js +8 -0
- package/es/node_modules/lodash-es/isNil.js +6 -0
- package/es/node_modules/lodash-es/isNull.js +6 -0
- package/es/node_modules/lodash-es/isObject.js +7 -0
- package/es/node_modules/lodash-es/isObjectLike.js +6 -0
- package/es/node_modules/lodash-es/isPlainObject.js +16 -0
- package/es/node_modules/lodash-es/isSet.js +8 -0
- package/es/node_modules/lodash-es/isSymbol.js +9 -0
- package/es/node_modules/lodash-es/isTypedArray.js +8 -0
- package/es/node_modules/lodash-es/isUndefined.js +6 -0
- package/es/node_modules/lodash-es/keys.js +9 -0
- package/es/node_modules/lodash-es/keysIn.js +9 -0
- package/es/node_modules/lodash-es/last.js +7 -0
- package/es/node_modules/lodash-es/map.js +11 -0
- package/es/node_modules/lodash-es/memoize.js +18 -0
- package/es/node_modules/lodash-es/merge.js +9 -0
- package/es/node_modules/lodash-es/now.js +8 -0
- package/es/node_modules/lodash-es/omit.js +24 -0
- package/es/node_modules/lodash-es/pick.js +9 -0
- package/es/node_modules/lodash-es/property.js +10 -0
- package/es/node_modules/lodash-es/set.js +7 -0
- package/es/node_modules/lodash-es/stubArray.js +6 -0
- package/es/node_modules/lodash-es/stubFalse.js +6 -0
- package/es/node_modules/lodash-es/toFinite.js +14 -0
- package/es/node_modules/lodash-es/toInteger.js +8 -0
- package/es/node_modules/lodash-es/toNumber.js +22 -0
- package/es/node_modules/lodash-es/toPlainObject.js +8 -0
- package/es/node_modules/lodash-es/toString.js +7 -0
- package/es/node_modules/mitt/dist/mitt.js +19 -0
- package/es/node_modules/normalize-wheel-es/dist/index.js +92 -0
- package/es/node_modules/style-mod/src/style-mod.js +116 -0
- package/es/node_modules/uuid/dist/esm-browser/native.js +6 -0
- package/es/node_modules/uuid/dist/esm-browser/rng.js +10 -0
- package/es/node_modules/uuid/dist/esm-browser/stringify.js +9 -0
- package/es/node_modules/uuid/dist/esm-browser/v4.js +19 -0
- package/es/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +140 -0
- package/es/node_modules/vue-draggable-plus/dist/vue-draggable-plus.js +1597 -0
- package/es/node_modules/vue-json-viewer/vue-json-viewer.js +727 -0
- package/es/node_modules/vxe-table/lib/style.css.js +4 -0
- package/es/node_modules/w3c-keyname/index.js +96 -0
- package/es/src/api/index.js +12 -0
- package/es/src/axios/config.js +127 -0
- package/es/src/axios/crypto.js +29 -0
- package/es/src/axios/index.js +35 -0
- package/es/src/axios/util.js +68 -0
- package/es/src/components/ConditionConfigButton.vue.js +4 -0
- package/es/src/components/ConditionConfigButton.vue2.js +91 -0
- package/es/src/components/DataSourceSelect.vue.js +77 -0
- package/es/src/components/EventConfigButton.vue.js +79 -0
- package/es/src/components/EventConfigButton.vue2.js +4 -0
- package/es/src/components/FieldMapping.vue.js +4 -0
- package/es/src/components/FieldMapping.vue2.js +164 -0
- package/es/src/components/FilterConfigDisplay.vue.js +82 -0
- package/es/src/components/FilterConfigDisplay.vue2.js +4 -0
- package/es/src/components/FormulaEditorInput.vue.js +128 -0
- package/es/src/components/JsonDataDrawer.vue.js +81 -0
- package/es/src/components/JsonDataDrawer.vue2.js +4 -0
- package/es/src/components/OptionConfig.vue.js +238 -0
- package/es/src/components/OptionConfig.vue2.js +4 -0
- package/es/src/components/ParamsConfig.vue.js +4 -0
- package/es/src/components/ParamsConfig.vue2.js +117 -0
- package/es/src/components/TemplateSelector.vue.js +216 -0
- package/es/src/components/TemplateSelector.vue2.js +4 -0
- package/es/src/components/ValueSelector.vue.js +4 -0
- package/es/src/components/ValueSelector.vue2.js +142 -0
- package/es/src/components/ValueSelectorPopover.vue.js +4 -0
- package/es/src/components/ValueSelectorPopover.vue2.js +263 -0
- package/es/src/components/useJsonDataDrawer.js +15 -0
- package/es/src/index.js +11 -0
- package/es/src/layout/aside/index.vue.js +175 -0
- package/es/src/layout/aside/index.vue2.js +4 -0
- package/es/src/layout/header/index.vue.js +207 -0
- package/es/src/layout/header/index.vue2.js +4 -0
- package/es/src/layout/index.vue.js +97 -0
- package/es/src/layout/index.vue2.js +4 -0
- package/es/src/layout/property/index.vue.js +35 -0
- package/es/src/layout/property/index.vue2.js +4 -0
- package/es/src/packages/advancedFilter/AdvancedFilter.vue.js +4 -0
- package/es/src/packages/advancedFilter/AdvancedFilter.vue2.js +321 -0
- package/es/src/packages/advancedFilter/Operator.vue.js +4 -0
- package/es/src/packages/advancedFilter/Operator.vue2.js +79 -0
- package/es/src/packages/advancedFilter/Trigger.vue.js +4 -0
- package/es/src/packages/advancedFilter/Trigger.vue2.js +84 -0
- package/es/src/packages/advancedFilter/ValueInput.vue.js +4 -0
- package/es/src/packages/advancedFilter/ValueInput.vue2.js +356 -0
- package/es/src/packages/advancedFilter/dialog.vue.js +89 -0
- package/es/src/packages/advancedFilter/dialog.vue2.js +4 -0
- package/es/src/packages/advancedFilter/index.vue.js +58 -0
- package/es/src/packages/advancedFilter/useAdvancedFilterDialog.js +15 -0
- package/es/src/packages/dataLinkage/dialog.vue.js +77 -0
- package/es/src/packages/dataLinkage/dialog.vue2.js +4 -0
- package/es/src/packages/dataLinkage/index.vue.js +442 -0
- package/es/src/packages/dataLinkage/index.vue2.js +4 -0
- package/es/src/packages/dataLinkage/useDataLinkageDialog.js +15 -0
- package/es/src/packages/dataSource/dataSource.vue.js +323 -0
- package/es/src/packages/dataSource/dataSource.vue2.js +4 -0
- package/es/src/packages/dataSource/index.vue.js +244 -0
- package/es/src/packages/dataSource/index.vue2.js +4 -0
- package/es/src/packages/dataSource/useDataSourceDialog.js +15 -0
- package/es/src/packages/event/index.vue.js +4 -0
- package/es/src/packages/event/index.vue2.js +295 -0
- package/es/src/packages/event/pageEvent.vue.js +213 -0
- package/es/src/packages/event/pageEvent.vue2.js +4 -0
- package/es/src/packages/event/useEventDialog.js +15 -0
- package/es/src/packages/eventFlow/defaultProcessData.js +19 -0
- package/es/src/packages/eventFlow/dialog/action/Advanced.vue.js +50 -0
- package/es/src/packages/eventFlow/dialog/action/Confirm.vue.js +140 -0
- package/es/src/packages/eventFlow/dialog/action/FormSetValue.vue.js +4 -0
- package/es/src/packages/eventFlow/dialog/action/FormSetValue.vue2.js +43 -0
- package/es/src/packages/eventFlow/dialog/action/FormSubmit.vue.js +4 -0
- package/es/src/packages/eventFlow/dialog/action/FormSubmit.vue2.js +84 -0
- package/es/src/packages/eventFlow/dialog/action/Message.vue.js +68 -0
- package/es/src/packages/eventFlow/dialog/action/Page.vue.js +86 -0
- package/es/src/packages/eventFlow/dialog/action/PageGoBack.vue.js +111 -0
- package/es/src/packages/eventFlow/dialog/action/Request.vue.js +28 -0
- package/es/src/packages/eventFlow/dialog/action/TableRefresh.vue.js +4 -0
- package/es/src/packages/eventFlow/dialog/action/TableRefresh.vue2.js +54 -0
- package/es/src/packages/eventFlow/dialog/action/config.js +88 -0
- package/es/src/packages/eventFlow/dialog/action/index.vue.js +4 -0
- package/es/src/packages/eventFlow/dialog/action/index.vue2.js +193 -0
- package/es/src/packages/eventFlow/dialog/execution/index.vue.js +4 -0
- package/es/src/packages/eventFlow/dialog/execution/index.vue2.js +81 -0
- package/es/src/packages/eventFlow/dialog/index.vue.js +112 -0
- package/es/src/packages/eventFlow/eventFlow.vue.js +4 -0
- package/es/src/packages/eventFlow/eventFlow.vue2.js +298 -0
- package/es/src/packages/eventFlow/hooks/useDraggableScroll.js +27 -0
- package/es/src/packages/eventFlow/index.vue.js +26 -0
- package/es/src/packages/eventFlow/nodes/Add.vue.js +4 -0
- package/es/src/packages/eventFlow/nodes/Add.vue2.js +84 -0
- package/es/src/packages/eventFlow/nodes/ApprovalNode.vue.js +41 -0
- package/es/src/packages/eventFlow/nodes/CcNode.vue.js +73 -0
- package/es/src/packages/eventFlow/nodes/ConditionNode.vue.js +4 -0
- package/es/src/packages/eventFlow/nodes/ConditionNode.vue2.js +52 -0
- package/es/src/packages/eventFlow/nodes/EndNode.vue.js +4 -0
- package/es/src/packages/eventFlow/nodes/EndNode.vue2.js +45 -0
- package/es/src/packages/eventFlow/nodes/ExclusiveNode.vue.js +36 -0
- package/es/src/packages/eventFlow/nodes/GatewayNode.vue.js +4 -0
- package/es/src/packages/eventFlow/nodes/GatewayNode.vue2.js +79 -0
- package/es/src/packages/eventFlow/nodes/Node.vue.js +4 -0
- package/es/src/packages/eventFlow/nodes/Node.vue2.js +176 -0
- package/es/src/packages/eventFlow/nodes/NotifyNode.vue.js +73 -0
- package/es/src/packages/eventFlow/nodes/ServiceNode.vue.js +38 -0
- package/es/src/packages/eventFlow/nodes/StartNode.vue.js +4 -0
- package/es/src/packages/eventFlow/nodes/StartNode.vue2.js +39 -0
- package/es/src/packages/eventFlow/nodes/TimerNode.vue.js +45 -0
- package/es/src/packages/eventFlow/nodes/TreeNode.vue.js +47 -0
- package/es/src/packages/form/HiddenFieldDialog.vue.js +258 -0
- package/es/src/packages/form/HiddenFieldDialog.vue2.js +4 -0
- package/es/src/packages/form/PageFooterSetting.vue.js +114 -0
- package/es/src/packages/form/PageFooterSetting.vue2.js +4 -0
- package/es/src/packages/form/PageHeaderSetting.vue.js +142 -0
- package/es/src/packages/form/PageHeaderSetting.vue2.js +4 -0
- package/es/src/packages/form/aside/index.js +123 -0
- package/es/src/packages/form/components/ComponentPreviewWrapper.vue.js +140 -0
- package/es/src/packages/form/components/ComponentPreviewWrapper.vue2.js +4 -0
- package/es/src/packages/form/components/DividerWrapper.vue.js +22 -0
- package/es/src/packages/form/components/DividerWrapper.vue2.js +4 -0
- package/es/src/packages/form/components/H2Wrapper.vue.js +24 -0
- package/es/src/packages/form/components/H2Wrapper.vue2.js +4 -0
- package/es/src/packages/form/components/SubForm.vue.js +88 -0
- package/es/src/packages/form/components/SubForm.vue2.js +4 -0
- package/es/src/packages/form/components/SubForm.vue3.js +4 -0
- package/es/src/packages/form/components/SubTable.vue.js +87 -0
- package/es/src/packages/form/components/SubTable.vue2.js +4 -0
- package/es/src/packages/form/default.js +41 -0
- package/es/src/packages/form/fieldRecycleBin.vue.js +194 -0
- package/es/src/packages/form/fieldRecycleBin.vue2.js +4 -0
- package/es/src/packages/form/formSetting.vue.js +137 -0
- package/es/src/packages/form/formSetting.vue2.js +4 -0
- package/es/src/packages/form/headerBtn.vue.js +138 -0
- package/es/src/packages/form/headerBtn.vue2.js +4 -0
- package/es/src/packages/form/index.vue.js +355 -0
- package/es/src/packages/form/index.vue2.js +4 -0
- package/es/src/packages/form/property/dividerH2.vue.js +86 -0
- package/es/src/packages/form/property/index.vue.js +40 -0
- package/es/src/packages/form/property/pageFooterBtn.vue.js +111 -0
- package/es/src/packages/form/property/pageHeaderBtn.vue.js +107 -0
- package/es/src/packages/form/property/subForm.vue.js +188 -0
- package/es/src/packages/form/property/subTable.vue.js +286 -0
- package/es/src/packages/form/property/widgets.vue.js +579 -0
- package/es/src/packages/form/property/widgets.vue2.js +4 -0
- package/es/src/packages/formulaEditor/components/FieldVariable.vue.js +71 -0
- package/es/src/packages/formulaEditor/components/FieldVariable.vue2.js +4 -0
- package/es/src/packages/formulaEditor/components/FormulaList.vue.js +93 -0
- package/es/src/packages/formulaEditor/components/FormulaList.vue2.js +4 -0
- package/es/src/packages/formulaEditor/core/calculate.js +50 -0
- package/es/src/packages/formulaEditor/core/functionCore.js +16 -0
- package/es/src/packages/formulaEditor/core/index.js +136 -0
- package/es/src/packages/formulaEditor/function.js +524 -0
- package/es/src/packages/formulaEditor/index.js +7 -0
- package/es/src/packages/formulaEditor/index.vue.js +186 -0
- package/es/src/packages/formulaEditor/index.vue2.js +4 -0
- package/es/src/packages/formulaEditor/utils/index.js +40 -0
- package/es/src/packages/mode/fieldSelection.vue.js +154 -0
- package/es/src/packages/mode/fieldSelection.vue2.js +4 -0
- package/es/src/packages/mode/index.vue.js +387 -0
- package/es/src/packages/mode/index.vue2.js +4 -0
- package/es/src/packages/mode/useModeDialog.js +15 -0
- package/es/src/packages/table/aside/index.js +53 -0
- package/es/src/packages/table/default.js +87 -0
- package/es/src/packages/table/headerBtn.vue.js +172 -0
- package/es/src/packages/table/headerBtn.vue2.js +4 -0
- package/es/src/packages/table/index.vue.js +373 -0
- package/es/src/packages/table/index.vue2.js +4 -0
- package/es/src/packages/table/property/customBtn.vue.js +142 -0
- package/es/src/packages/table/property/filterWidgets.vue.js +86 -0
- package/es/src/packages/table/property/index.vue.js +40 -0
- package/es/src/packages/table/property/optBtn.vue.js +126 -0
- package/es/src/packages/table/property/widgets.vue.js +430 -0
- package/es/src/packages/table/property/widgets.vue2.js +4 -0
- package/es/src/packages/table/queryModule/FixedModeConfig.vue.js +218 -0
- package/es/src/packages/table/queryModule/FixedModeConfig.vue2.js +4 -0
- package/es/src/packages/table/queryModule/index.vue.js +192 -0
- package/es/src/packages/table/queryModule/index.vue2.js +4 -0
- package/es/src/packages/table/tableBtn.vue.js +145 -0
- package/es/src/packages/table/tableBtn.vue2.js +4 -0
- package/es/src/packages/table/tablePagination.vue.js +196 -0
- package/es/src/packages/table/tablePagination.vue2.js +4 -0
- package/es/src/packages/table/tableSetting.vue.js +423 -0
- package/es/src/packages/table/tableSetting.vue2.js +4 -0
- package/es/src/packages/utils/common.js +65 -0
- package/es/src/packages/utils/datasource.js +226 -0
- package/es/src/packages/utils/eventBus.js +5 -0
- package/es/src/store/index.js +49 -0
- package/es/src/style/index.css.js +4 -0
- package/es/src/utils/env.js +9 -0
- package/es/style.css +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,2295 @@
|
|
|
1
|
+
import { commonjsGlobal as J, getDefaultExportFromCjs as K } from "../../../_virtual/_commonjsHelpers.js";
|
|
2
|
+
import { __module as Z } from "../../../_virtual/jstat.js";
|
|
3
|
+
(function(F, $) {
|
|
4
|
+
(function(h, u) {
|
|
5
|
+
F.exports = u();
|
|
6
|
+
})(J, function() {
|
|
7
|
+
var h = function(u, f) {
|
|
8
|
+
var q = Array.prototype.concat, p = Array.prototype.slice, w = Object.prototype.toString;
|
|
9
|
+
function d(a, t) {
|
|
10
|
+
var c = a > t ? a : t;
|
|
11
|
+
return u.pow(
|
|
12
|
+
10,
|
|
13
|
+
17 - ~~(u.log(c > 0 ? c : -c) * u.LOG10E)
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
var i = Array.isArray || function(t) {
|
|
17
|
+
return w.call(t) === "[object Array]";
|
|
18
|
+
};
|
|
19
|
+
function r(a) {
|
|
20
|
+
return w.call(a) === "[object Function]";
|
|
21
|
+
}
|
|
22
|
+
function n(a) {
|
|
23
|
+
return typeof a == "number" ? a - a === 0 : !1;
|
|
24
|
+
}
|
|
25
|
+
function e(a) {
|
|
26
|
+
return q.apply([], a);
|
|
27
|
+
}
|
|
28
|
+
function o() {
|
|
29
|
+
return new o._init(arguments);
|
|
30
|
+
}
|
|
31
|
+
o.fn = o.prototype, o._init = function(t) {
|
|
32
|
+
if (i(t[0]))
|
|
33
|
+
if (i(t[0][0])) {
|
|
34
|
+
r(t[1]) && (t[0] = o.map(t[0], t[1]));
|
|
35
|
+
for (var c = 0; c < t[0].length; c++)
|
|
36
|
+
this[c] = t[0][c];
|
|
37
|
+
this.length = t[0].length;
|
|
38
|
+
} else
|
|
39
|
+
this[0] = r(t[1]) ? o.map(t[0], t[1]) : t[0], this.length = 1;
|
|
40
|
+
else if (n(t[0]))
|
|
41
|
+
this[0] = o.seq.apply(null, t), this.length = 1;
|
|
42
|
+
else {
|
|
43
|
+
if (t[0] instanceof o)
|
|
44
|
+
return o(t[0].toArray());
|
|
45
|
+
this[0] = [], this.length = 1;
|
|
46
|
+
}
|
|
47
|
+
return this;
|
|
48
|
+
}, o._init.prototype = o.prototype, o._init.constructor = o, o.utils = {
|
|
49
|
+
calcRdx: d,
|
|
50
|
+
isArray: i,
|
|
51
|
+
isFunction: r,
|
|
52
|
+
isNumber: n,
|
|
53
|
+
toVector: e
|
|
54
|
+
}, o._random_fn = u.random, o.setRandom = function(t) {
|
|
55
|
+
if (typeof t != "function")
|
|
56
|
+
throw new TypeError("fn is not a function");
|
|
57
|
+
o._random_fn = t;
|
|
58
|
+
}, o.extend = function(t) {
|
|
59
|
+
var c, g;
|
|
60
|
+
if (arguments.length === 1) {
|
|
61
|
+
for (g in t)
|
|
62
|
+
o[g] = t[g];
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
for (c = 1; c < arguments.length; c++)
|
|
66
|
+
for (g in arguments[c])
|
|
67
|
+
t[g] = arguments[c][g];
|
|
68
|
+
return t;
|
|
69
|
+
}, o.rows = function(t) {
|
|
70
|
+
return t.length || 1;
|
|
71
|
+
}, o.cols = function(t) {
|
|
72
|
+
return t[0].length || 1;
|
|
73
|
+
}, o.dimensions = function(t) {
|
|
74
|
+
return {
|
|
75
|
+
rows: o.rows(t),
|
|
76
|
+
cols: o.cols(t)
|
|
77
|
+
};
|
|
78
|
+
}, o.row = function(t, c) {
|
|
79
|
+
return i(c) ? c.map(function(g) {
|
|
80
|
+
return o.row(t, g);
|
|
81
|
+
}) : t[c];
|
|
82
|
+
}, o.rowa = function(t, c) {
|
|
83
|
+
return o.row(t, c);
|
|
84
|
+
}, o.col = function(t, c) {
|
|
85
|
+
if (i(c)) {
|
|
86
|
+
var g = o.arange(t.length).map(function() {
|
|
87
|
+
return new Array(c.length);
|
|
88
|
+
});
|
|
89
|
+
return c.forEach(function(_, k) {
|
|
90
|
+
o.arange(t.length).forEach(function(R) {
|
|
91
|
+
g[R][k] = t[R][_];
|
|
92
|
+
});
|
|
93
|
+
}), g;
|
|
94
|
+
}
|
|
95
|
+
for (var y = new Array(t.length), b = 0; b < t.length; b++)
|
|
96
|
+
y[b] = [t[b][c]];
|
|
97
|
+
return y;
|
|
98
|
+
}, o.cola = function(t, c) {
|
|
99
|
+
return o.col(t, c).map(function(g) {
|
|
100
|
+
return g[0];
|
|
101
|
+
});
|
|
102
|
+
}, o.diag = function(t) {
|
|
103
|
+
for (var c = o.rows(t), g = new Array(c), y = 0; y < c; y++)
|
|
104
|
+
g[y] = [t[y][y]];
|
|
105
|
+
return g;
|
|
106
|
+
}, o.antidiag = function(t) {
|
|
107
|
+
for (var c = o.rows(t) - 1, g = new Array(c), y = 0; c >= 0; c--, y++)
|
|
108
|
+
g[y] = [t[y][c]];
|
|
109
|
+
return g;
|
|
110
|
+
}, o.transpose = function(t) {
|
|
111
|
+
var c = [], g, y, b, _, k;
|
|
112
|
+
for (i(t[0]) || (t = [t]), y = t.length, b = t[0].length, k = 0; k < b; k++) {
|
|
113
|
+
for (g = new Array(y), _ = 0; _ < y; _++)
|
|
114
|
+
g[_] = t[_][k];
|
|
115
|
+
c.push(g);
|
|
116
|
+
}
|
|
117
|
+
return c.length === 1 ? c[0] : c;
|
|
118
|
+
}, o.map = function(t, c, g) {
|
|
119
|
+
var y, b, _, k, R;
|
|
120
|
+
for (i(t[0]) || (t = [t]), b = t.length, _ = t[0].length, k = g ? t : new Array(b), y = 0; y < b; y++)
|
|
121
|
+
for (k[y] || (k[y] = new Array(_)), R = 0; R < _; R++)
|
|
122
|
+
k[y][R] = c(t[y][R], y, R);
|
|
123
|
+
return k.length === 1 ? k[0] : k;
|
|
124
|
+
}, o.cumreduce = function(t, c, g) {
|
|
125
|
+
var y, b, _, k, R;
|
|
126
|
+
for (i(t[0]) || (t = [t]), b = t.length, _ = t[0].length, k = g ? t : new Array(b), y = 0; y < b; y++)
|
|
127
|
+
for (k[y] || (k[y] = new Array(_)), _ > 0 && (k[y][0] = t[y][0]), R = 1; R < _; R++)
|
|
128
|
+
k[y][R] = c(k[y][R - 1], t[y][R]);
|
|
129
|
+
return k.length === 1 ? k[0] : k;
|
|
130
|
+
}, o.alter = function(t, c) {
|
|
131
|
+
return o.map(t, c, !0);
|
|
132
|
+
}, o.create = function(t, c, g) {
|
|
133
|
+
var y = new Array(t), b, _;
|
|
134
|
+
for (r(c) && (g = c, c = t), b = 0; b < t; b++)
|
|
135
|
+
for (y[b] = new Array(c), _ = 0; _ < c; _++)
|
|
136
|
+
y[b][_] = g(b, _);
|
|
137
|
+
return y;
|
|
138
|
+
};
|
|
139
|
+
function s() {
|
|
140
|
+
return 0;
|
|
141
|
+
}
|
|
142
|
+
o.zeros = function(t, c) {
|
|
143
|
+
return n(c) || (c = t), o.create(t, c, s);
|
|
144
|
+
};
|
|
145
|
+
function l() {
|
|
146
|
+
return 1;
|
|
147
|
+
}
|
|
148
|
+
o.ones = function(t, c) {
|
|
149
|
+
return n(c) || (c = t), o.create(t, c, l);
|
|
150
|
+
}, o.rand = function(t, c) {
|
|
151
|
+
return n(c) || (c = t), o.create(t, c, o._random_fn);
|
|
152
|
+
};
|
|
153
|
+
function v(a, t) {
|
|
154
|
+
return a === t ? 1 : 0;
|
|
155
|
+
}
|
|
156
|
+
o.identity = function(t, c) {
|
|
157
|
+
return n(c) || (c = t), o.create(t, c, v);
|
|
158
|
+
}, o.symmetric = function(t) {
|
|
159
|
+
var c = t.length, g, y;
|
|
160
|
+
if (t.length !== t[0].length)
|
|
161
|
+
return !1;
|
|
162
|
+
for (g = 0; g < c; g++)
|
|
163
|
+
for (y = 0; y < c; y++)
|
|
164
|
+
if (t[y][g] !== t[g][y])
|
|
165
|
+
return !1;
|
|
166
|
+
return !0;
|
|
167
|
+
}, o.clear = function(t) {
|
|
168
|
+
return o.alter(t, s);
|
|
169
|
+
}, o.seq = function(t, c, g, y) {
|
|
170
|
+
r(y) || (y = !1);
|
|
171
|
+
var b = [], _ = d(t, c), k = (c * _ - t * _) / ((g - 1) * _), R = t, z;
|
|
172
|
+
for (z = 0; R <= c && z < g; z++, R = (t * _ + k * _ * z) / _)
|
|
173
|
+
b.push(y ? y(R, z) : R);
|
|
174
|
+
return b;
|
|
175
|
+
}, o.arange = function(t, c, g) {
|
|
176
|
+
var y = [], b;
|
|
177
|
+
if (g = g || 1, c === f && (c = t, t = 0), t === c || g === 0)
|
|
178
|
+
return [];
|
|
179
|
+
if (t < c && g < 0)
|
|
180
|
+
return [];
|
|
181
|
+
if (t > c && g > 0)
|
|
182
|
+
return [];
|
|
183
|
+
if (g > 0)
|
|
184
|
+
for (b = t; b < c; b += g)
|
|
185
|
+
y.push(b);
|
|
186
|
+
else
|
|
187
|
+
for (b = t; b > c; b += g)
|
|
188
|
+
y.push(b);
|
|
189
|
+
return y;
|
|
190
|
+
}, o.slice = function() {
|
|
191
|
+
function a(c, g, y, b) {
|
|
192
|
+
var _, k = [], R = c.length;
|
|
193
|
+
if (g === f && y === f && b === f)
|
|
194
|
+
return o.copy(c);
|
|
195
|
+
if (g = g || 0, y = y || c.length, g = g >= 0 ? g : R + g, y = y >= 0 ? y : R + y, b = b || 1, g === y || b === 0)
|
|
196
|
+
return [];
|
|
197
|
+
if (g < y && b < 0)
|
|
198
|
+
return [];
|
|
199
|
+
if (g > y && b > 0)
|
|
200
|
+
return [];
|
|
201
|
+
if (b > 0)
|
|
202
|
+
for (_ = g; _ < y; _ += b)
|
|
203
|
+
k.push(c[_]);
|
|
204
|
+
else
|
|
205
|
+
for (_ = g; _ > y; _ += b)
|
|
206
|
+
k.push(c[_]);
|
|
207
|
+
return k;
|
|
208
|
+
}
|
|
209
|
+
function t(c, g) {
|
|
210
|
+
var y, b;
|
|
211
|
+
if (g = g || {}, n(g.row)) {
|
|
212
|
+
if (n(g.col))
|
|
213
|
+
return c[g.row][g.col];
|
|
214
|
+
var _ = o.rowa(c, g.row);
|
|
215
|
+
return y = g.col || {}, a(_, y.start, y.end, y.step);
|
|
216
|
+
}
|
|
217
|
+
if (n(g.col)) {
|
|
218
|
+
var k = o.cola(c, g.col);
|
|
219
|
+
return b = g.row || {}, a(k, b.start, b.end, b.step);
|
|
220
|
+
}
|
|
221
|
+
b = g.row || {}, y = g.col || {};
|
|
222
|
+
var R = a(c, b.start, b.end, b.step);
|
|
223
|
+
return R.map(function(z) {
|
|
224
|
+
return a(z, y.start, y.end, y.step);
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
return t;
|
|
228
|
+
}(), o.sliceAssign = function(t, c, g) {
|
|
229
|
+
var y, b;
|
|
230
|
+
if (n(c.row)) {
|
|
231
|
+
if (n(c.col))
|
|
232
|
+
return t[c.row][c.col] = g;
|
|
233
|
+
c.col = c.col || {}, c.col.start = c.col.start || 0, c.col.end = c.col.end || t[0].length, c.col.step = c.col.step || 1, y = o.arange(
|
|
234
|
+
c.col.start,
|
|
235
|
+
u.min(t.length, c.col.end),
|
|
236
|
+
c.col.step
|
|
237
|
+
);
|
|
238
|
+
var _ = c.row;
|
|
239
|
+
return y.forEach(function(R, z) {
|
|
240
|
+
t[_][R] = g[z];
|
|
241
|
+
}), t;
|
|
242
|
+
}
|
|
243
|
+
if (n(c.col)) {
|
|
244
|
+
c.row = c.row || {}, c.row.start = c.row.start || 0, c.row.end = c.row.end || t.length, c.row.step = c.row.step || 1, b = o.arange(
|
|
245
|
+
c.row.start,
|
|
246
|
+
u.min(t[0].length, c.row.end),
|
|
247
|
+
c.row.step
|
|
248
|
+
);
|
|
249
|
+
var k = c.col;
|
|
250
|
+
return b.forEach(function(R, z) {
|
|
251
|
+
t[R][k] = g[z];
|
|
252
|
+
}), t;
|
|
253
|
+
}
|
|
254
|
+
return g[0].length === f && (g = [g]), c.row.start = c.row.start || 0, c.row.end = c.row.end || t.length, c.row.step = c.row.step || 1, c.col.start = c.col.start || 0, c.col.end = c.col.end || t[0].length, c.col.step = c.col.step || 1, b = o.arange(
|
|
255
|
+
c.row.start,
|
|
256
|
+
u.min(t.length, c.row.end),
|
|
257
|
+
c.row.step
|
|
258
|
+
), y = o.arange(
|
|
259
|
+
c.col.start,
|
|
260
|
+
u.min(t[0].length, c.col.end),
|
|
261
|
+
c.col.step
|
|
262
|
+
), b.forEach(function(R, z) {
|
|
263
|
+
y.forEach(function(A, E) {
|
|
264
|
+
t[R][A] = g[z][E];
|
|
265
|
+
});
|
|
266
|
+
}), t;
|
|
267
|
+
}, o.diagonal = function(t) {
|
|
268
|
+
var c = o.zeros(t.length, t.length);
|
|
269
|
+
return t.forEach(function(g, y) {
|
|
270
|
+
c[y][y] = g;
|
|
271
|
+
}), c;
|
|
272
|
+
}, o.copy = function(t) {
|
|
273
|
+
return t.map(function(c) {
|
|
274
|
+
return n(c) ? c : c.map(function(g) {
|
|
275
|
+
return g;
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
var m = o.prototype;
|
|
280
|
+
return m.length = 0, m.push = Array.prototype.push, m.sort = Array.prototype.sort, m.splice = Array.prototype.splice, m.slice = Array.prototype.slice, m.toArray = function() {
|
|
281
|
+
return this.length > 1 ? p.call(this) : p.call(this)[0];
|
|
282
|
+
}, m.map = function(t, c) {
|
|
283
|
+
return o(o.map(this, t, c));
|
|
284
|
+
}, m.cumreduce = function(t, c) {
|
|
285
|
+
return o(o.cumreduce(this, t, c));
|
|
286
|
+
}, m.alter = function(t) {
|
|
287
|
+
return o.alter(this, t), this;
|
|
288
|
+
}, function(a) {
|
|
289
|
+
for (var t = 0; t < a.length; t++)
|
|
290
|
+
(function(c) {
|
|
291
|
+
m[c] = function(g) {
|
|
292
|
+
var y = this, b;
|
|
293
|
+
return g ? (setTimeout(function() {
|
|
294
|
+
g.call(y, m[c].call(y));
|
|
295
|
+
}), this) : (b = o[c](this), i(b) ? o(b) : b);
|
|
296
|
+
};
|
|
297
|
+
})(a[t]);
|
|
298
|
+
}("transpose clear symmetric rows cols dimensions diag antidiag".split(" ")), function(a) {
|
|
299
|
+
for (var t = 0; t < a.length; t++)
|
|
300
|
+
(function(c) {
|
|
301
|
+
m[c] = function(g, y) {
|
|
302
|
+
var b = this;
|
|
303
|
+
return y ? (setTimeout(function() {
|
|
304
|
+
y.call(b, m[c].call(b, g));
|
|
305
|
+
}), this) : o(o[c](this, g));
|
|
306
|
+
};
|
|
307
|
+
})(a[t]);
|
|
308
|
+
}("row col".split(" ")), function(a) {
|
|
309
|
+
for (var t = 0; t < a.length; t++)
|
|
310
|
+
(function(c) {
|
|
311
|
+
m[c] = function() {
|
|
312
|
+
return o(o[c].apply(null, arguments));
|
|
313
|
+
};
|
|
314
|
+
})(a[t]);
|
|
315
|
+
}("create zeros ones rand identity".split(" ")), o;
|
|
316
|
+
}(Math);
|
|
317
|
+
return function(u, f) {
|
|
318
|
+
var q = u.utils.isFunction;
|
|
319
|
+
function p(i, r) {
|
|
320
|
+
return i - r;
|
|
321
|
+
}
|
|
322
|
+
function w(i, r, n) {
|
|
323
|
+
return f.max(r, f.min(i, n));
|
|
324
|
+
}
|
|
325
|
+
u.sum = function(r) {
|
|
326
|
+
for (var n = 0, e = r.length; --e >= 0; )
|
|
327
|
+
n += r[e];
|
|
328
|
+
return n;
|
|
329
|
+
}, u.sumsqrd = function(r) {
|
|
330
|
+
for (var n = 0, e = r.length; --e >= 0; )
|
|
331
|
+
n += r[e] * r[e];
|
|
332
|
+
return n;
|
|
333
|
+
}, u.sumsqerr = function(r) {
|
|
334
|
+
for (var n = u.mean(r), e = 0, o = r.length, s; --o >= 0; )
|
|
335
|
+
s = r[o] - n, e += s * s;
|
|
336
|
+
return e;
|
|
337
|
+
}, u.sumrow = function(r) {
|
|
338
|
+
for (var n = 0, e = r.length; --e >= 0; )
|
|
339
|
+
n += r[e];
|
|
340
|
+
return n;
|
|
341
|
+
}, u.product = function(r) {
|
|
342
|
+
for (var n = 1, e = r.length; --e >= 0; )
|
|
343
|
+
n *= r[e];
|
|
344
|
+
return n;
|
|
345
|
+
}, u.min = function(r) {
|
|
346
|
+
for (var n = r[0], e = 0; ++e < r.length; )
|
|
347
|
+
r[e] < n && (n = r[e]);
|
|
348
|
+
return n;
|
|
349
|
+
}, u.max = function(r) {
|
|
350
|
+
for (var n = r[0], e = 0; ++e < r.length; )
|
|
351
|
+
r[e] > n && (n = r[e]);
|
|
352
|
+
return n;
|
|
353
|
+
}, u.unique = function(r) {
|
|
354
|
+
for (var n = {}, e = [], o = 0; o < r.length; o++)
|
|
355
|
+
n[r[o]] || (n[r[o]] = !0, e.push(r[o]));
|
|
356
|
+
return e;
|
|
357
|
+
}, u.mean = function(r) {
|
|
358
|
+
return u.sum(r) / r.length;
|
|
359
|
+
}, u.meansqerr = function(r) {
|
|
360
|
+
return u.sumsqerr(r) / r.length;
|
|
361
|
+
}, u.geomean = function(r) {
|
|
362
|
+
var n = r.map(f.log), e = u.mean(n);
|
|
363
|
+
return f.exp(e);
|
|
364
|
+
}, u.median = function(r) {
|
|
365
|
+
var n = r.length, e = r.slice().sort(p);
|
|
366
|
+
return n & 1 ? e[n / 2 | 0] : (e[n / 2 - 1] + e[n / 2]) / 2;
|
|
367
|
+
}, u.cumsum = function(r) {
|
|
368
|
+
return u.cumreduce(r, function(n, e) {
|
|
369
|
+
return n + e;
|
|
370
|
+
});
|
|
371
|
+
}, u.cumprod = function(r) {
|
|
372
|
+
return u.cumreduce(r, function(n, e) {
|
|
373
|
+
return n * e;
|
|
374
|
+
});
|
|
375
|
+
}, u.diff = function(r) {
|
|
376
|
+
var n = [], e = r.length, o;
|
|
377
|
+
for (o = 1; o < e; o++)
|
|
378
|
+
n.push(r[o] - r[o - 1]);
|
|
379
|
+
return n;
|
|
380
|
+
}, u.rank = function(i) {
|
|
381
|
+
var r, n = [], e = {};
|
|
382
|
+
for (r = 0; r < i.length; r++) {
|
|
383
|
+
var o = i[r];
|
|
384
|
+
e[o] ? e[o]++ : (e[o] = 1, n.push(o));
|
|
385
|
+
}
|
|
386
|
+
var s = n.sort(p), l = {}, v = 1;
|
|
387
|
+
for (r = 0; r < s.length; r++) {
|
|
388
|
+
var o = s[r], m = e[o], a = v, t = v + m - 1, c = (a + t) / 2;
|
|
389
|
+
l[o] = c, v += m;
|
|
390
|
+
}
|
|
391
|
+
return i.map(function(g) {
|
|
392
|
+
return l[g];
|
|
393
|
+
});
|
|
394
|
+
}, u.mode = function(r) {
|
|
395
|
+
var n = r.length, e = r.slice().sort(p), o = 1, s = 0, l = 0, v = [], m;
|
|
396
|
+
for (m = 0; m < n; m++)
|
|
397
|
+
e[m] === e[m + 1] ? o++ : (o > s ? (v = [e[m]], s = o, l = 0) : o === s && (v.push(e[m]), l++), o = 1);
|
|
398
|
+
return l === 0 ? v[0] : v;
|
|
399
|
+
}, u.range = function(r) {
|
|
400
|
+
return u.max(r) - u.min(r);
|
|
401
|
+
}, u.variance = function(r, n) {
|
|
402
|
+
return u.sumsqerr(r) / (r.length - (n ? 1 : 0));
|
|
403
|
+
}, u.pooledvariance = function(r) {
|
|
404
|
+
var n = r.reduce(function(o, s) {
|
|
405
|
+
return o + u.sumsqerr(s);
|
|
406
|
+
}, 0), e = r.reduce(function(o, s) {
|
|
407
|
+
return o + s.length;
|
|
408
|
+
}, 0);
|
|
409
|
+
return n / (e - r.length);
|
|
410
|
+
}, u.deviation = function(i) {
|
|
411
|
+
for (var r = u.mean(i), n = i.length, e = new Array(n), o = 0; o < n; o++)
|
|
412
|
+
e[o] = i[o] - r;
|
|
413
|
+
return e;
|
|
414
|
+
}, u.stdev = function(r, n) {
|
|
415
|
+
return f.sqrt(u.variance(r, n));
|
|
416
|
+
}, u.pooledstdev = function(r) {
|
|
417
|
+
return f.sqrt(u.pooledvariance(r));
|
|
418
|
+
}, u.meandev = function(r) {
|
|
419
|
+
for (var n = u.mean(r), e = [], o = r.length - 1; o >= 0; o--)
|
|
420
|
+
e.push(f.abs(r[o] - n));
|
|
421
|
+
return u.mean(e);
|
|
422
|
+
}, u.meddev = function(r) {
|
|
423
|
+
for (var n = u.median(r), e = [], o = r.length - 1; o >= 0; o--)
|
|
424
|
+
e.push(f.abs(r[o] - n));
|
|
425
|
+
return u.median(e);
|
|
426
|
+
}, u.coeffvar = function(r) {
|
|
427
|
+
return u.stdev(r) / u.mean(r);
|
|
428
|
+
}, u.quartiles = function(r) {
|
|
429
|
+
var n = r.length, e = r.slice().sort(p);
|
|
430
|
+
return [
|
|
431
|
+
e[f.round(n / 4) - 1],
|
|
432
|
+
e[f.round(n / 2) - 1],
|
|
433
|
+
e[f.round(n * 3 / 4) - 1]
|
|
434
|
+
];
|
|
435
|
+
}, u.quantiles = function(r, n, e, o) {
|
|
436
|
+
var s = r.slice().sort(p), l = [n.length], v = r.length, m, a, t, c, g, y;
|
|
437
|
+
for (typeof e > "u" && (e = 3 / 8), typeof o > "u" && (o = 3 / 8), m = 0; m < n.length; m++)
|
|
438
|
+
a = n[m], t = e + a * (1 - e - o), c = v * a + t, g = f.floor(w(c, 1, v - 1)), y = w(c - g, 0, 1), l[m] = (1 - y) * s[g - 1] + y * s[g];
|
|
439
|
+
return l;
|
|
440
|
+
}, u.percentile = function(r, n, e) {
|
|
441
|
+
var o = r.slice().sort(p), s = n * (o.length + (e ? 1 : -1)) + (e ? 0 : 1), l = parseInt(s), v = s - l;
|
|
442
|
+
return l + 1 < o.length ? o[l - 1] + v * (o[l] - o[l - 1]) : o[l - 1];
|
|
443
|
+
}, u.percentileOfScore = function(r, n, e) {
|
|
444
|
+
var o = 0, s = r.length, l = !1, v, m;
|
|
445
|
+
for (e === "strict" && (l = !0), m = 0; m < s; m++)
|
|
446
|
+
v = r[m], (l && v < n || !l && v <= n) && o++;
|
|
447
|
+
return o / s;
|
|
448
|
+
}, u.histogram = function(r, n) {
|
|
449
|
+
n = n || 4;
|
|
450
|
+
var e = u.min(r), o = (u.max(r) - e) / n, s = r.length, l = [], v;
|
|
451
|
+
for (v = 0; v < n; v++)
|
|
452
|
+
l[v] = 0;
|
|
453
|
+
for (v = 0; v < s; v++)
|
|
454
|
+
l[f.min(f.floor((r[v] - e) / o), n - 1)] += 1;
|
|
455
|
+
return l;
|
|
456
|
+
}, u.covariance = function(r, n) {
|
|
457
|
+
var e = u.mean(r), o = u.mean(n), s = r.length, l = new Array(s), v;
|
|
458
|
+
for (v = 0; v < s; v++)
|
|
459
|
+
l[v] = (r[v] - e) * (n[v] - o);
|
|
460
|
+
return u.sum(l) / (s - 1);
|
|
461
|
+
}, u.corrcoeff = function(r, n) {
|
|
462
|
+
return u.covariance(r, n) / u.stdev(r, 1) / u.stdev(n, 1);
|
|
463
|
+
}, u.spearmancoeff = function(i, r) {
|
|
464
|
+
return i = u.rank(i), r = u.rank(r), u.corrcoeff(i, r);
|
|
465
|
+
}, u.stanMoment = function(r, n) {
|
|
466
|
+
for (var e = u.mean(r), o = u.stdev(r), s = r.length, l = 0, v = 0; v < s; v++)
|
|
467
|
+
l += f.pow((r[v] - e) / o, n);
|
|
468
|
+
return l / r.length;
|
|
469
|
+
}, u.skewness = function(r) {
|
|
470
|
+
return u.stanMoment(r, 3);
|
|
471
|
+
}, u.kurtosis = function(r) {
|
|
472
|
+
return u.stanMoment(r, 4) - 3;
|
|
473
|
+
};
|
|
474
|
+
var d = u.prototype;
|
|
475
|
+
(function(i) {
|
|
476
|
+
for (var r = 0; r < i.length; r++)
|
|
477
|
+
(function(n) {
|
|
478
|
+
d[n] = function(e, o) {
|
|
479
|
+
var s = [], l = 0, v = this;
|
|
480
|
+
if (q(e) && (o = e, e = !1), o)
|
|
481
|
+
return setTimeout(function() {
|
|
482
|
+
o.call(v, d[n].call(v, e));
|
|
483
|
+
}), this;
|
|
484
|
+
if (this.length > 1) {
|
|
485
|
+
for (v = e === !0 ? this : this.transpose(); l < v.length; l++)
|
|
486
|
+
s[l] = u[n](v[l]);
|
|
487
|
+
return s;
|
|
488
|
+
}
|
|
489
|
+
return u[n](this[0], e);
|
|
490
|
+
};
|
|
491
|
+
})(i[r]);
|
|
492
|
+
})("cumsum cumprod".split(" ")), function(i) {
|
|
493
|
+
for (var r = 0; r < i.length; r++)
|
|
494
|
+
(function(n) {
|
|
495
|
+
d[n] = function(e, o) {
|
|
496
|
+
var s = [], l = 0, v = this;
|
|
497
|
+
if (q(e) && (o = e, e = !1), o)
|
|
498
|
+
return setTimeout(function() {
|
|
499
|
+
o.call(v, d[n].call(v, e));
|
|
500
|
+
}), this;
|
|
501
|
+
if (this.length > 1) {
|
|
502
|
+
for (n !== "sumrow" && (v = e === !0 ? this : this.transpose()); l < v.length; l++)
|
|
503
|
+
s[l] = u[n](v[l]);
|
|
504
|
+
return e === !0 ? u[n](u.utils.toVector(s)) : s;
|
|
505
|
+
}
|
|
506
|
+
return u[n](this[0], e);
|
|
507
|
+
};
|
|
508
|
+
})(i[r]);
|
|
509
|
+
}("sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr geomean median diff rank mode range variance deviation stdev meandev meddev coeffvar quartiles histogram skewness kurtosis".split(" ")), function(i) {
|
|
510
|
+
for (var r = 0; r < i.length; r++)
|
|
511
|
+
(function(n) {
|
|
512
|
+
d[n] = function() {
|
|
513
|
+
var e = [], o = 0, s = this, l = Array.prototype.slice.call(arguments), v;
|
|
514
|
+
if (q(l[l.length - 1])) {
|
|
515
|
+
v = l[l.length - 1];
|
|
516
|
+
var m = l.slice(0, l.length - 1);
|
|
517
|
+
return setTimeout(function() {
|
|
518
|
+
v.call(
|
|
519
|
+
s,
|
|
520
|
+
d[n].apply(s, m)
|
|
521
|
+
);
|
|
522
|
+
}), this;
|
|
523
|
+
} else {
|
|
524
|
+
v = void 0;
|
|
525
|
+
var a = function(c) {
|
|
526
|
+
return u[n].apply(s, [c].concat(l));
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
if (this.length > 1) {
|
|
530
|
+
for (s = s.transpose(); o < s.length; o++)
|
|
531
|
+
e[o] = a(s[o]);
|
|
532
|
+
return e;
|
|
533
|
+
}
|
|
534
|
+
return a(this[0]);
|
|
535
|
+
};
|
|
536
|
+
})(i[r]);
|
|
537
|
+
}("quantiles percentileOfScore".split(" "));
|
|
538
|
+
}(h, Math), function(u, f) {
|
|
539
|
+
u.gammaln = function(p) {
|
|
540
|
+
var w = 0, d = [
|
|
541
|
+
76.18009172947146,
|
|
542
|
+
-86.50532032941678,
|
|
543
|
+
24.01409824083091,
|
|
544
|
+
-1.231739572450155,
|
|
545
|
+
0.001208650973866179,
|
|
546
|
+
-5395239384953e-18
|
|
547
|
+
], i = 1.000000000190015, r, n, e;
|
|
548
|
+
for (e = (n = r = p) + 5.5, e -= (r + 0.5) * f.log(e); w < 6; w++)
|
|
549
|
+
i += d[w] / ++n;
|
|
550
|
+
return f.log(2.5066282746310007 * i / r) - e;
|
|
551
|
+
}, u.loggam = function(p) {
|
|
552
|
+
var w, d, i, r, n, e, o, s = [
|
|
553
|
+
0.08333333333333333,
|
|
554
|
+
-0.002777777777777778,
|
|
555
|
+
7936507936507937e-19,
|
|
556
|
+
-5952380952380952e-19,
|
|
557
|
+
8417508417508418e-19,
|
|
558
|
+
-0.001917526917526918,
|
|
559
|
+
0.00641025641025641,
|
|
560
|
+
-0.02955065359477124,
|
|
561
|
+
0.1796443723688307,
|
|
562
|
+
-1.3924322169059
|
|
563
|
+
];
|
|
564
|
+
if (w = p, o = 0, p == 1 || p == 2)
|
|
565
|
+
return 0;
|
|
566
|
+
for (p <= 7 && (o = f.floor(7 - p), w = p + o), d = 1 / (w * w), i = 2 * f.PI, n = s[9], e = 8; e >= 0; e--)
|
|
567
|
+
n *= d, n += s[e];
|
|
568
|
+
if (r = n / w + 0.5 * f.log(i) + (w - 0.5) * f.log(w) - w, p <= 7)
|
|
569
|
+
for (e = 1; e <= o; e++)
|
|
570
|
+
r -= f.log(w - 1), w -= 1;
|
|
571
|
+
return r;
|
|
572
|
+
}, u.gammafn = function(p) {
|
|
573
|
+
var w = [
|
|
574
|
+
-1.716185138865495,
|
|
575
|
+
24.76565080557592,
|
|
576
|
+
-379.80425647094563,
|
|
577
|
+
629.3311553128184,
|
|
578
|
+
866.9662027904133,
|
|
579
|
+
-31451.272968848367,
|
|
580
|
+
-36144.413418691176,
|
|
581
|
+
66456.14382024054
|
|
582
|
+
], d = [
|
|
583
|
+
-30.8402300119739,
|
|
584
|
+
315.35062697960416,
|
|
585
|
+
-1015.1563674902192,
|
|
586
|
+
-3107.771671572311,
|
|
587
|
+
22538.11842098015,
|
|
588
|
+
4755.846277527881,
|
|
589
|
+
-134659.9598649693,
|
|
590
|
+
-115132.2596755535
|
|
591
|
+
], i = !1, r = 0, n = 0, e = 0, o = p, s, l, v, m;
|
|
592
|
+
if (p > 171.6243769536076)
|
|
593
|
+
return 1 / 0;
|
|
594
|
+
if (o <= 0)
|
|
595
|
+
if (m = o % 1 + 36e-17, m)
|
|
596
|
+
i = (o & 1 ? -1 : 1) * f.PI / f.sin(f.PI * m), o = 1 - o;
|
|
597
|
+
else
|
|
598
|
+
return 1 / 0;
|
|
599
|
+
for (v = o, o < 1 ? l = o++ : l = (o -= r = (o | 0) - 1) - 1, s = 0; s < 8; ++s)
|
|
600
|
+
e = (e + w[s]) * l, n = n * l + d[s];
|
|
601
|
+
if (m = e / n + 1, v < o)
|
|
602
|
+
m /= v;
|
|
603
|
+
else if (v > o)
|
|
604
|
+
for (s = 0; s < r; ++s)
|
|
605
|
+
m *= o, o++;
|
|
606
|
+
return i && (m = i / m), m;
|
|
607
|
+
}, u.gammap = function(p, w) {
|
|
608
|
+
return u.lowRegGamma(p, w) * u.gammafn(p);
|
|
609
|
+
}, u.lowRegGamma = function(p, w) {
|
|
610
|
+
var d = u.gammaln(p), i = p, r = 1 / p, n = r, e = w + 1 - p, o = 1 / 1e-30, s = 1 / e, l = s, v = 1, m = -~(f.log(p >= 1 ? p : 1 / p) * 8.5 + p * 0.4 + 17), a;
|
|
611
|
+
if (w < 0 || p <= 0)
|
|
612
|
+
return NaN;
|
|
613
|
+
if (w < p + 1) {
|
|
614
|
+
for (; v <= m; v++)
|
|
615
|
+
r += n *= w / ++i;
|
|
616
|
+
return r * f.exp(-w + p * f.log(w) - d);
|
|
617
|
+
}
|
|
618
|
+
for (; v <= m; v++)
|
|
619
|
+
a = -v * (v - p), e += 2, s = a * s + e, o = e + a / o, s = 1 / s, l *= s * o;
|
|
620
|
+
return 1 - l * f.exp(-w + p * f.log(w) - d);
|
|
621
|
+
}, u.factorialln = function(p) {
|
|
622
|
+
return p < 0 ? NaN : u.gammaln(p + 1);
|
|
623
|
+
}, u.factorial = function(p) {
|
|
624
|
+
return p < 0 ? NaN : u.gammafn(p + 1);
|
|
625
|
+
}, u.combination = function(p, w) {
|
|
626
|
+
return p > 170 || w > 170 ? f.exp(u.combinationln(p, w)) : u.factorial(p) / u.factorial(w) / u.factorial(p - w);
|
|
627
|
+
}, u.combinationln = function(p, w) {
|
|
628
|
+
return u.factorialln(p) - u.factorialln(w) - u.factorialln(p - w);
|
|
629
|
+
}, u.permutation = function(p, w) {
|
|
630
|
+
return u.factorial(p) / u.factorial(p - w);
|
|
631
|
+
}, u.betafn = function(p, w) {
|
|
632
|
+
if (!(p <= 0 || w <= 0))
|
|
633
|
+
return p + w > 170 ? f.exp(u.betaln(p, w)) : u.gammafn(p) * u.gammafn(w) / u.gammafn(p + w);
|
|
634
|
+
}, u.betaln = function(p, w) {
|
|
635
|
+
return u.gammaln(p) + u.gammaln(w) - u.gammaln(p + w);
|
|
636
|
+
}, u.betacf = function(p, w, d) {
|
|
637
|
+
var i = 1e-30, r = 1, n = w + d, e = w + 1, o = w - 1, s = 1, l = 1 - n * p / e, v, m, a, t;
|
|
638
|
+
for (f.abs(l) < i && (l = i), l = 1 / l, t = l; r <= 100 && (v = 2 * r, m = r * (d - r) * p / ((o + v) * (w + v)), l = 1 + m * l, f.abs(l) < i && (l = i), s = 1 + m / s, f.abs(s) < i && (s = i), l = 1 / l, t *= l * s, m = -(w + r) * (n + r) * p / ((w + v) * (e + v)), l = 1 + m * l, f.abs(l) < i && (l = i), s = 1 + m / s, f.abs(s) < i && (s = i), l = 1 / l, a = l * s, t *= a, !(f.abs(a - 1) < 3e-7)); r++)
|
|
639
|
+
;
|
|
640
|
+
return t;
|
|
641
|
+
}, u.gammapinv = function(p, w) {
|
|
642
|
+
var d = 0, i = w - 1, r = 1e-8, n = u.gammaln(w), e, o, s, l, v, m, a;
|
|
643
|
+
if (p >= 1)
|
|
644
|
+
return f.max(100, w + 100 * f.sqrt(w));
|
|
645
|
+
if (p <= 0)
|
|
646
|
+
return 0;
|
|
647
|
+
for (w > 1 ? (m = f.log(i), a = f.exp(i * (m - 1) - n), v = p < 0.5 ? p : 1 - p, s = f.sqrt(-2 * f.log(v)), e = (2.30753 + s * 0.27061) / (1 + s * (0.99229 + s * 0.04481)) - s, p < 0.5 && (e = -e), e = f.max(
|
|
648
|
+
1e-3,
|
|
649
|
+
w * f.pow(1 - 1 / (9 * w) - e / (3 * f.sqrt(w)), 3)
|
|
650
|
+
)) : (s = 1 - w * (0.253 + w * 0.12), p < s ? e = f.pow(p / s, 1 / w) : e = 1 - f.log(1 - (p - s) / (1 - s))); d < 12; d++) {
|
|
651
|
+
if (e <= 0)
|
|
652
|
+
return 0;
|
|
653
|
+
if (o = u.lowRegGamma(w, e) - p, w > 1 ? s = a * f.exp(-(e - i) + i * (f.log(e) - m)) : s = f.exp(-e + i * f.log(e) - n), l = o / s, e -= s = l / (1 - 0.5 * f.min(1, l * ((w - 1) / e - 1))), e <= 0 && (e = 0.5 * (e + s)), f.abs(s) < r * e)
|
|
654
|
+
break;
|
|
655
|
+
}
|
|
656
|
+
return e;
|
|
657
|
+
}, u.erf = function(p) {
|
|
658
|
+
var w = [
|
|
659
|
+
-1.3026537197817094,
|
|
660
|
+
0.6419697923564902,
|
|
661
|
+
0.019476473204185836,
|
|
662
|
+
-0.00956151478680863,
|
|
663
|
+
-946595344482036e-18,
|
|
664
|
+
366839497852761e-18,
|
|
665
|
+
42523324806907e-18,
|
|
666
|
+
-20278578112534e-18,
|
|
667
|
+
-1624290004647e-18,
|
|
668
|
+
130365583558e-17,
|
|
669
|
+
15626441722e-18,
|
|
670
|
+
-85238095915e-18,
|
|
671
|
+
6529054439e-18,
|
|
672
|
+
5059343495e-18,
|
|
673
|
+
-991364156e-18,
|
|
674
|
+
-227365122e-18,
|
|
675
|
+
96467911e-18,
|
|
676
|
+
2394038e-18,
|
|
677
|
+
-6886027e-18,
|
|
678
|
+
894487e-18,
|
|
679
|
+
313092e-18,
|
|
680
|
+
-112708e-18,
|
|
681
|
+
381e-18,
|
|
682
|
+
7106e-18,
|
|
683
|
+
-1523e-18,
|
|
684
|
+
-94e-18,
|
|
685
|
+
121e-18,
|
|
686
|
+
-28e-18
|
|
687
|
+
], d = w.length - 1, i = !1, r = 0, n = 0, e, o, s, l;
|
|
688
|
+
for (p < 0 && (p = -p, i = !0), e = 2 / (2 + p), o = 4 * e - 2; d > 0; d--)
|
|
689
|
+
s = r, r = o * r - n + w[d], n = s;
|
|
690
|
+
return l = e * f.exp(-p * p + 0.5 * (w[0] + o * r) - n), i ? l - 1 : 1 - l;
|
|
691
|
+
}, u.erfc = function(p) {
|
|
692
|
+
return 1 - u.erf(p);
|
|
693
|
+
}, u.erfcinv = function(p) {
|
|
694
|
+
var w = 0, d, i, r, n;
|
|
695
|
+
if (p >= 2)
|
|
696
|
+
return -100;
|
|
697
|
+
if (p <= 0)
|
|
698
|
+
return 100;
|
|
699
|
+
for (n = p < 1 ? p : 2 - p, r = f.sqrt(-2 * f.log(n / 2)), d = -0.70711 * ((2.30753 + r * 0.27061) / (1 + r * (0.99229 + r * 0.04481)) - r); w < 2; w++)
|
|
700
|
+
i = u.erfc(d) - n, d += i / (1.1283791670955126 * f.exp(-d * d) - d * i);
|
|
701
|
+
return p < 1 ? d : -d;
|
|
702
|
+
}, u.ibetainv = function(p, w, d) {
|
|
703
|
+
var i = 1e-8, r = w - 1, n = d - 1, e = 0, o, s, l, v, m, a, t, c, g, y, b;
|
|
704
|
+
if (p <= 0)
|
|
705
|
+
return 0;
|
|
706
|
+
if (p >= 1)
|
|
707
|
+
return 1;
|
|
708
|
+
for (w >= 1 && d >= 1 ? (l = p < 0.5 ? p : 1 - p, v = f.sqrt(-2 * f.log(l)), t = (2.30753 + v * 0.27061) / (1 + v * (0.99229 + v * 0.04481)) - v, p < 0.5 && (t = -t), c = (t * t - 3) / 6, g = 2 / (1 / (2 * w - 1) + 1 / (2 * d - 1)), y = t * f.sqrt(c + g) / g - (1 / (2 * d - 1) - 1 / (2 * w - 1)) * (c + 5 / 6 - 2 / (3 * g)), t = w / (w + d * f.exp(2 * y))) : (o = f.log(w / (w + d)), s = f.log(d / (w + d)), v = f.exp(w * o) / w, m = f.exp(d * s) / d, y = v + m, p < v / y ? t = f.pow(w * y * p, 1 / w) : t = 1 - f.pow(d * y * (1 - p), 1 / d)), b = -u.gammaln(w) - u.gammaln(d) + u.gammaln(w + d); e < 10; e++) {
|
|
709
|
+
if (t === 0 || t === 1)
|
|
710
|
+
return t;
|
|
711
|
+
if (a = u.ibeta(t, w, d) - p, v = f.exp(r * f.log(t) + n * f.log(1 - t) + b), m = a / v, t -= v = m / (1 - 0.5 * f.min(1, m * (r / t - n / (1 - t)))), t <= 0 && (t = 0.5 * (t + v)), t >= 1 && (t = 0.5 * (t + v + 1)), f.abs(v) < i * t && e > 0)
|
|
712
|
+
break;
|
|
713
|
+
}
|
|
714
|
+
return t;
|
|
715
|
+
}, u.ibeta = function(p, w, d) {
|
|
716
|
+
var i = p === 0 || p === 1 ? 0 : f.exp(u.gammaln(w + d) - u.gammaln(w) - u.gammaln(d) + w * f.log(p) + d * f.log(1 - p));
|
|
717
|
+
return p < 0 || p > 1 ? !1 : p < (w + 1) / (w + d + 2) ? i * u.betacf(p, w, d) / w : 1 - i * u.betacf(1 - p, d, w) / d;
|
|
718
|
+
}, u.randn = function(p, w) {
|
|
719
|
+
var d, i, r, n, e;
|
|
720
|
+
if (w || (w = p), p)
|
|
721
|
+
return u.create(p, w, function() {
|
|
722
|
+
return u.randn();
|
|
723
|
+
});
|
|
724
|
+
do
|
|
725
|
+
d = u._random_fn(), i = 1.7156 * (u._random_fn() - 0.5), r = d - 0.449871, n = f.abs(i) + 0.386595, e = r * r + n * (0.196 * n - 0.25472 * r);
|
|
726
|
+
while (e > 0.27597 && (e > 0.27846 || i * i > -4 * f.log(d) * d * d));
|
|
727
|
+
return i / d;
|
|
728
|
+
}, u.randg = function(p, w, d) {
|
|
729
|
+
var i = p, r, n, e, o, s, l;
|
|
730
|
+
if (d || (d = w), p || (p = 1), w)
|
|
731
|
+
return l = u.zeros(w, d), l.alter(function() {
|
|
732
|
+
return u.randg(p);
|
|
733
|
+
}), l;
|
|
734
|
+
p < 1 && (p += 1), r = p - 1 / 3, n = 1 / f.sqrt(9 * r);
|
|
735
|
+
do {
|
|
736
|
+
do
|
|
737
|
+
s = u.randn(), o = 1 + n * s;
|
|
738
|
+
while (o <= 0);
|
|
739
|
+
o = o * o * o, e = u._random_fn();
|
|
740
|
+
} while (e > 1 - 0.331 * f.pow(s, 4) && f.log(e) > 0.5 * s * s + r * (1 - o + f.log(o)));
|
|
741
|
+
if (p == i)
|
|
742
|
+
return r * o;
|
|
743
|
+
do
|
|
744
|
+
e = u._random_fn();
|
|
745
|
+
while (e === 0);
|
|
746
|
+
return f.pow(e, 1 / i) * r * o;
|
|
747
|
+
}, function(q) {
|
|
748
|
+
for (var p = 0; p < q.length; p++)
|
|
749
|
+
(function(w) {
|
|
750
|
+
u.fn[w] = function() {
|
|
751
|
+
return u(
|
|
752
|
+
u.map(this, function(d) {
|
|
753
|
+
return u[w](d);
|
|
754
|
+
})
|
|
755
|
+
);
|
|
756
|
+
};
|
|
757
|
+
})(q[p]);
|
|
758
|
+
}("gammaln gammafn factorial factorialln".split(" ")), function(q) {
|
|
759
|
+
for (var p = 0; p < q.length; p++)
|
|
760
|
+
(function(w) {
|
|
761
|
+
u.fn[w] = function() {
|
|
762
|
+
return u(u[w].apply(null, arguments));
|
|
763
|
+
};
|
|
764
|
+
})(q[p]);
|
|
765
|
+
}("randn".split(" "));
|
|
766
|
+
}(h, Math), function(u, f) {
|
|
767
|
+
(function(i) {
|
|
768
|
+
for (var r = 0; r < i.length; r++)
|
|
769
|
+
(function(n) {
|
|
770
|
+
u[n] = function e(o, s, l) {
|
|
771
|
+
return this instanceof e ? (this._a = o, this._b = s, this._c = l, this) : new e(o, s, l);
|
|
772
|
+
}, u.fn[n] = function(e, o, s) {
|
|
773
|
+
var l = u[n](e, o, s);
|
|
774
|
+
return l.data = this, l;
|
|
775
|
+
}, u[n].prototype.sample = function(e) {
|
|
776
|
+
var o = this._a, s = this._b, l = this._c;
|
|
777
|
+
return e ? u.alter(e, function() {
|
|
778
|
+
return u[n].sample(o, s, l);
|
|
779
|
+
}) : u[n].sample(o, s, l);
|
|
780
|
+
}, function(e) {
|
|
781
|
+
for (var o = 0; o < e.length; o++)
|
|
782
|
+
(function(s) {
|
|
783
|
+
u[n].prototype[s] = function(l) {
|
|
784
|
+
var v = this._a, m = this._b, a = this._c;
|
|
785
|
+
return !l && l !== 0 && (l = this.data), typeof l != "number" ? u.fn.map.call(l, function(t) {
|
|
786
|
+
return u[n][s](t, v, m, a);
|
|
787
|
+
}) : u[n][s](l, v, m, a);
|
|
788
|
+
};
|
|
789
|
+
})(e[o]);
|
|
790
|
+
}("pdf cdf inv".split(" ")), function(e) {
|
|
791
|
+
for (var o = 0; o < e.length; o++)
|
|
792
|
+
(function(s) {
|
|
793
|
+
u[n].prototype[s] = function() {
|
|
794
|
+
return u[n][s](this._a, this._b, this._c);
|
|
795
|
+
};
|
|
796
|
+
})(e[o]);
|
|
797
|
+
}("mean median mode variance".split(" "));
|
|
798
|
+
})(i[r]);
|
|
799
|
+
})("beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy laplace lognormal noncentralt normal pareto studentt weibull uniform binomial negbin hypgeom poisson triangular tukey arcsine".split(" ")), u.extend(u.beta, {
|
|
800
|
+
pdf: function(r, n, e) {
|
|
801
|
+
return r > 1 || r < 0 ? 0 : n == 1 && e == 1 ? 1 : n < 512 && e < 512 ? f.pow(r, n - 1) * f.pow(1 - r, e - 1) / u.betafn(n, e) : f.exp((n - 1) * f.log(r) + (e - 1) * f.log(1 - r) - u.betaln(n, e));
|
|
802
|
+
},
|
|
803
|
+
cdf: function(r, n, e) {
|
|
804
|
+
return r > 1 || r < 0 ? (r > 1) * 1 : u.ibeta(r, n, e);
|
|
805
|
+
},
|
|
806
|
+
inv: function(r, n, e) {
|
|
807
|
+
return u.ibetainv(r, n, e);
|
|
808
|
+
},
|
|
809
|
+
mean: function(r, n) {
|
|
810
|
+
return r / (r + n);
|
|
811
|
+
},
|
|
812
|
+
median: function(r, n) {
|
|
813
|
+
return u.ibetainv(0.5, r, n);
|
|
814
|
+
},
|
|
815
|
+
mode: function(r, n) {
|
|
816
|
+
return (r - 1) / (r + n - 2);
|
|
817
|
+
},
|
|
818
|
+
// return a random sample
|
|
819
|
+
sample: function(r, n) {
|
|
820
|
+
var e = u.randg(r);
|
|
821
|
+
return e / (e + u.randg(n));
|
|
822
|
+
},
|
|
823
|
+
variance: function(r, n) {
|
|
824
|
+
return r * n / (f.pow(r + n, 2) * (r + n + 1));
|
|
825
|
+
}
|
|
826
|
+
}), u.extend(u.centralF, {
|
|
827
|
+
// This implementation of the pdf function avoids float overflow
|
|
828
|
+
// See the way that R calculates this value:
|
|
829
|
+
// https://svn.r-project.org/R/trunk/src/nmath/df.c
|
|
830
|
+
pdf: function(r, n, e) {
|
|
831
|
+
var o, s, l;
|
|
832
|
+
return r < 0 ? 0 : n <= 2 ? r === 0 && n < 2 ? 1 / 0 : r === 0 && n === 2 ? 1 : 1 / u.betafn(n / 2, e / 2) * f.pow(n / e, n / 2) * f.pow(r, n / 2 - 1) * f.pow(1 + n / e * r, -(n + e) / 2) : (o = n * r / (e + r * n), s = e / (e + r * n), l = n * s / 2, l * u.binomial.pdf((n - 2) / 2, (n + e - 2) / 2, o));
|
|
833
|
+
},
|
|
834
|
+
cdf: function(r, n, e) {
|
|
835
|
+
return r < 0 ? 0 : u.ibeta(n * r / (n * r + e), n / 2, e / 2);
|
|
836
|
+
},
|
|
837
|
+
inv: function(r, n, e) {
|
|
838
|
+
return e / (n * (1 / u.ibetainv(r, n / 2, e / 2) - 1));
|
|
839
|
+
},
|
|
840
|
+
mean: function(r, n) {
|
|
841
|
+
return n > 2 ? n / (n - 2) : void 0;
|
|
842
|
+
},
|
|
843
|
+
mode: function(r, n) {
|
|
844
|
+
return r > 2 ? n * (r - 2) / (r * (n + 2)) : void 0;
|
|
845
|
+
},
|
|
846
|
+
// return a random sample
|
|
847
|
+
sample: function(r, n) {
|
|
848
|
+
var e = u.randg(r / 2) * 2, o = u.randg(n / 2) * 2;
|
|
849
|
+
return e / r / (o / n);
|
|
850
|
+
},
|
|
851
|
+
variance: function(r, n) {
|
|
852
|
+
if (!(n <= 4))
|
|
853
|
+
return 2 * n * n * (r + n - 2) / (r * (n - 2) * (n - 2) * (n - 4));
|
|
854
|
+
}
|
|
855
|
+
}), u.extend(u.cauchy, {
|
|
856
|
+
pdf: function(r, n, e) {
|
|
857
|
+
return e < 0 ? 0 : e / (f.pow(r - n, 2) + f.pow(e, 2)) / f.PI;
|
|
858
|
+
},
|
|
859
|
+
cdf: function(r, n, e) {
|
|
860
|
+
return f.atan((r - n) / e) / f.PI + 0.5;
|
|
861
|
+
},
|
|
862
|
+
inv: function(i, r, n) {
|
|
863
|
+
return r + n * f.tan(f.PI * (i - 0.5));
|
|
864
|
+
},
|
|
865
|
+
median: function(r) {
|
|
866
|
+
return r;
|
|
867
|
+
},
|
|
868
|
+
mode: function(r) {
|
|
869
|
+
return r;
|
|
870
|
+
},
|
|
871
|
+
sample: function(r, n) {
|
|
872
|
+
return u.randn() * f.sqrt(1 / (2 * u.randg(0.5))) * n + r;
|
|
873
|
+
}
|
|
874
|
+
}), u.extend(u.chisquare, {
|
|
875
|
+
pdf: function(r, n) {
|
|
876
|
+
return r < 0 ? 0 : r === 0 && n === 2 ? 0.5 : f.exp((n / 2 - 1) * f.log(r) - r / 2 - n / 2 * f.log(2) - u.gammaln(n / 2));
|
|
877
|
+
},
|
|
878
|
+
cdf: function(r, n) {
|
|
879
|
+
return r < 0 ? 0 : u.lowRegGamma(n / 2, r / 2);
|
|
880
|
+
},
|
|
881
|
+
inv: function(i, r) {
|
|
882
|
+
return 2 * u.gammapinv(i, 0.5 * r);
|
|
883
|
+
},
|
|
884
|
+
mean: function(i) {
|
|
885
|
+
return i;
|
|
886
|
+
},
|
|
887
|
+
// TODO: this is an approximation (is there a better way?)
|
|
888
|
+
median: function(r) {
|
|
889
|
+
return r * f.pow(1 - 2 / (9 * r), 3);
|
|
890
|
+
},
|
|
891
|
+
mode: function(r) {
|
|
892
|
+
return r - 2 > 0 ? r - 2 : 0;
|
|
893
|
+
},
|
|
894
|
+
sample: function(r) {
|
|
895
|
+
return u.randg(r / 2) * 2;
|
|
896
|
+
},
|
|
897
|
+
variance: function(r) {
|
|
898
|
+
return 2 * r;
|
|
899
|
+
}
|
|
900
|
+
}), u.extend(u.exponential, {
|
|
901
|
+
pdf: function(r, n) {
|
|
902
|
+
return r < 0 ? 0 : n * f.exp(-n * r);
|
|
903
|
+
},
|
|
904
|
+
cdf: function(r, n) {
|
|
905
|
+
return r < 0 ? 0 : 1 - f.exp(-n * r);
|
|
906
|
+
},
|
|
907
|
+
inv: function(i, r) {
|
|
908
|
+
return -f.log(1 - i) / r;
|
|
909
|
+
},
|
|
910
|
+
mean: function(i) {
|
|
911
|
+
return 1 / i;
|
|
912
|
+
},
|
|
913
|
+
median: function(i) {
|
|
914
|
+
return 1 / i * f.log(2);
|
|
915
|
+
},
|
|
916
|
+
mode: function() {
|
|
917
|
+
return 0;
|
|
918
|
+
},
|
|
919
|
+
sample: function(r) {
|
|
920
|
+
return -1 / r * f.log(u._random_fn());
|
|
921
|
+
},
|
|
922
|
+
variance: function(i) {
|
|
923
|
+
return f.pow(i, -2);
|
|
924
|
+
}
|
|
925
|
+
}), u.extend(u.gamma, {
|
|
926
|
+
pdf: function(r, n, e) {
|
|
927
|
+
return r < 0 ? 0 : r === 0 && n === 1 ? 1 / e : f.exp((n - 1) * f.log(r) - r / e - u.gammaln(n) - n * f.log(e));
|
|
928
|
+
},
|
|
929
|
+
cdf: function(r, n, e) {
|
|
930
|
+
return r < 0 ? 0 : u.lowRegGamma(n, r / e);
|
|
931
|
+
},
|
|
932
|
+
inv: function(i, r, n) {
|
|
933
|
+
return u.gammapinv(i, r) * n;
|
|
934
|
+
},
|
|
935
|
+
mean: function(i, r) {
|
|
936
|
+
return i * r;
|
|
937
|
+
},
|
|
938
|
+
mode: function(r, n) {
|
|
939
|
+
if (r > 1)
|
|
940
|
+
return (r - 1) * n;
|
|
941
|
+
},
|
|
942
|
+
sample: function(r, n) {
|
|
943
|
+
return u.randg(r) * n;
|
|
944
|
+
},
|
|
945
|
+
variance: function(r, n) {
|
|
946
|
+
return r * n * n;
|
|
947
|
+
}
|
|
948
|
+
}), u.extend(u.invgamma, {
|
|
949
|
+
pdf: function(r, n, e) {
|
|
950
|
+
return r <= 0 ? 0 : f.exp(-(n + 1) * f.log(r) - e / r - u.gammaln(n) + n * f.log(e));
|
|
951
|
+
},
|
|
952
|
+
cdf: function(r, n, e) {
|
|
953
|
+
return r <= 0 ? 0 : 1 - u.lowRegGamma(n, e / r);
|
|
954
|
+
},
|
|
955
|
+
inv: function(i, r, n) {
|
|
956
|
+
return n / u.gammapinv(1 - i, r);
|
|
957
|
+
},
|
|
958
|
+
mean: function(i, r) {
|
|
959
|
+
return i > 1 ? r / (i - 1) : void 0;
|
|
960
|
+
},
|
|
961
|
+
mode: function(r, n) {
|
|
962
|
+
return n / (r + 1);
|
|
963
|
+
},
|
|
964
|
+
sample: function(r, n) {
|
|
965
|
+
return n / u.randg(r);
|
|
966
|
+
},
|
|
967
|
+
variance: function(r, n) {
|
|
968
|
+
if (!(r <= 2))
|
|
969
|
+
return n * n / ((r - 1) * (r - 1) * (r - 2));
|
|
970
|
+
}
|
|
971
|
+
}), u.extend(u.kumaraswamy, {
|
|
972
|
+
pdf: function(r, n, e) {
|
|
973
|
+
return r === 0 && n === 1 ? e : r === 1 && e === 1 ? n : f.exp(f.log(n) + f.log(e) + (n - 1) * f.log(r) + (e - 1) * f.log(1 - f.pow(r, n)));
|
|
974
|
+
},
|
|
975
|
+
cdf: function(r, n, e) {
|
|
976
|
+
return r < 0 ? 0 : r > 1 ? 1 : 1 - f.pow(1 - f.pow(r, n), e);
|
|
977
|
+
},
|
|
978
|
+
inv: function(r, n, e) {
|
|
979
|
+
return f.pow(1 - f.pow(1 - r, 1 / e), 1 / n);
|
|
980
|
+
},
|
|
981
|
+
mean: function(i, r) {
|
|
982
|
+
return r * u.gammafn(1 + 1 / i) * u.gammafn(r) / u.gammafn(1 + 1 / i + r);
|
|
983
|
+
},
|
|
984
|
+
median: function(r, n) {
|
|
985
|
+
return f.pow(1 - f.pow(2, -1 / n), 1 / r);
|
|
986
|
+
},
|
|
987
|
+
mode: function(r, n) {
|
|
988
|
+
if (r >= 1 && n >= 1 && r !== 1 && n !== 1)
|
|
989
|
+
return f.pow((r - 1) / (r * n - 1), 1 / r);
|
|
990
|
+
},
|
|
991
|
+
variance: function() {
|
|
992
|
+
throw new Error("variance not yet implemented");
|
|
993
|
+
}
|
|
994
|
+
}), u.extend(u.lognormal, {
|
|
995
|
+
pdf: function(r, n, e) {
|
|
996
|
+
return r <= 0 ? 0 : f.exp(-f.log(r) - 0.5 * f.log(2 * f.PI) - f.log(e) - f.pow(f.log(r) - n, 2) / (2 * e * e));
|
|
997
|
+
},
|
|
998
|
+
cdf: function(r, n, e) {
|
|
999
|
+
return r < 0 ? 0 : 0.5 + 0.5 * u.erf((f.log(r) - n) / f.sqrt(2 * e * e));
|
|
1000
|
+
},
|
|
1001
|
+
inv: function(i, r, n) {
|
|
1002
|
+
return f.exp(-1.4142135623730951 * n * u.erfcinv(2 * i) + r);
|
|
1003
|
+
},
|
|
1004
|
+
mean: function(r, n) {
|
|
1005
|
+
return f.exp(r + n * n / 2);
|
|
1006
|
+
},
|
|
1007
|
+
median: function(r) {
|
|
1008
|
+
return f.exp(r);
|
|
1009
|
+
},
|
|
1010
|
+
mode: function(r, n) {
|
|
1011
|
+
return f.exp(r - n * n);
|
|
1012
|
+
},
|
|
1013
|
+
sample: function(r, n) {
|
|
1014
|
+
return f.exp(u.randn() * n + r);
|
|
1015
|
+
},
|
|
1016
|
+
variance: function(r, n) {
|
|
1017
|
+
return (f.exp(n * n) - 1) * f.exp(2 * r + n * n);
|
|
1018
|
+
}
|
|
1019
|
+
}), u.extend(u.noncentralt, {
|
|
1020
|
+
pdf: function(r, n, e) {
|
|
1021
|
+
var o = 1e-14;
|
|
1022
|
+
return f.abs(e) < o ? u.studentt.pdf(r, n) : f.abs(r) < o ? f.exp(u.gammaln((n + 1) / 2) - e * e / 2 - 0.5 * f.log(f.PI * n) - u.gammaln(n / 2)) : n / r * (u.noncentralt.cdf(r * f.sqrt(1 + 2 / n), n + 2, e) - u.noncentralt.cdf(r, n, e));
|
|
1023
|
+
},
|
|
1024
|
+
cdf: function(r, n, e) {
|
|
1025
|
+
var o = 1e-14, s = 200;
|
|
1026
|
+
if (f.abs(e) < o)
|
|
1027
|
+
return u.studentt.cdf(r, n);
|
|
1028
|
+
var l = !1;
|
|
1029
|
+
r < 0 && (l = !0, e = -e);
|
|
1030
|
+
for (var v = u.normal.cdf(-e, 0, 1), m = o + 1, a = m, t = r * r / (r * r + n), c = 0, g = f.exp(-e * e / 2), y = f.exp(-e * e / 2 - 0.5 * f.log(2) - u.gammaln(3 / 2)) * e; c < s || a > o || m > o; )
|
|
1031
|
+
a = m, c > 0 && (g *= e * e / (2 * c), y *= e * e / (2 * (c + 1 / 2))), m = g * u.beta.cdf(t, c + 0.5, n / 2) + y * u.beta.cdf(t, c + 1, n / 2), v += 0.5 * m, c++;
|
|
1032
|
+
return l ? 1 - v : v;
|
|
1033
|
+
}
|
|
1034
|
+
}), u.extend(u.normal, {
|
|
1035
|
+
pdf: function(r, n, e) {
|
|
1036
|
+
return f.exp(-0.5 * f.log(2 * f.PI) - f.log(e) - f.pow(r - n, 2) / (2 * e * e));
|
|
1037
|
+
},
|
|
1038
|
+
cdf: function(r, n, e) {
|
|
1039
|
+
return 0.5 * (1 + u.erf((r - n) / f.sqrt(2 * e * e)));
|
|
1040
|
+
},
|
|
1041
|
+
inv: function(i, r, n) {
|
|
1042
|
+
return -1.4142135623730951 * n * u.erfcinv(2 * i) + r;
|
|
1043
|
+
},
|
|
1044
|
+
mean: function(i) {
|
|
1045
|
+
return i;
|
|
1046
|
+
},
|
|
1047
|
+
median: function(r) {
|
|
1048
|
+
return r;
|
|
1049
|
+
},
|
|
1050
|
+
mode: function(i) {
|
|
1051
|
+
return i;
|
|
1052
|
+
},
|
|
1053
|
+
sample: function(r, n) {
|
|
1054
|
+
return u.randn() * n + r;
|
|
1055
|
+
},
|
|
1056
|
+
variance: function(i, r) {
|
|
1057
|
+
return r * r;
|
|
1058
|
+
}
|
|
1059
|
+
}), u.extend(u.pareto, {
|
|
1060
|
+
pdf: function(r, n, e) {
|
|
1061
|
+
return r < n ? 0 : e * f.pow(n, e) / f.pow(r, e + 1);
|
|
1062
|
+
},
|
|
1063
|
+
cdf: function(r, n, e) {
|
|
1064
|
+
return r < n ? 0 : 1 - f.pow(n / r, e);
|
|
1065
|
+
},
|
|
1066
|
+
inv: function(r, n, e) {
|
|
1067
|
+
return n / f.pow(1 - r, 1 / e);
|
|
1068
|
+
},
|
|
1069
|
+
mean: function(r, n) {
|
|
1070
|
+
if (!(n <= 1))
|
|
1071
|
+
return n * f.pow(r, n) / (n - 1);
|
|
1072
|
+
},
|
|
1073
|
+
median: function(r, n) {
|
|
1074
|
+
return r * (n * f.SQRT2);
|
|
1075
|
+
},
|
|
1076
|
+
mode: function(r) {
|
|
1077
|
+
return r;
|
|
1078
|
+
},
|
|
1079
|
+
variance: function(i, r) {
|
|
1080
|
+
if (!(r <= 2))
|
|
1081
|
+
return i * i * r / (f.pow(r - 1, 2) * (r - 2));
|
|
1082
|
+
}
|
|
1083
|
+
}), u.extend(u.studentt, {
|
|
1084
|
+
pdf: function(r, n) {
|
|
1085
|
+
return n = n > 1e100 ? 1e100 : n, 1 / (f.sqrt(n) * u.betafn(0.5, n / 2)) * f.pow(1 + r * r / n, -((n + 1) / 2));
|
|
1086
|
+
},
|
|
1087
|
+
cdf: function(r, n) {
|
|
1088
|
+
var e = n / 2;
|
|
1089
|
+
return u.ibeta((r + f.sqrt(r * r + n)) / (2 * f.sqrt(r * r + n)), e, e);
|
|
1090
|
+
},
|
|
1091
|
+
inv: function(i, r) {
|
|
1092
|
+
var n = u.ibetainv(2 * f.min(i, 1 - i), 0.5 * r, 0.5);
|
|
1093
|
+
return n = f.sqrt(r * (1 - n) / n), i > 0.5 ? n : -n;
|
|
1094
|
+
},
|
|
1095
|
+
mean: function(r) {
|
|
1096
|
+
return r > 1 ? 0 : void 0;
|
|
1097
|
+
},
|
|
1098
|
+
median: function() {
|
|
1099
|
+
return 0;
|
|
1100
|
+
},
|
|
1101
|
+
mode: function() {
|
|
1102
|
+
return 0;
|
|
1103
|
+
},
|
|
1104
|
+
sample: function(r) {
|
|
1105
|
+
return u.randn() * f.sqrt(r / (2 * u.randg(r / 2)));
|
|
1106
|
+
},
|
|
1107
|
+
variance: function(r) {
|
|
1108
|
+
return r > 2 ? r / (r - 2) : r > 1 ? 1 / 0 : void 0;
|
|
1109
|
+
}
|
|
1110
|
+
}), u.extend(u.weibull, {
|
|
1111
|
+
pdf: function(r, n, e) {
|
|
1112
|
+
return r < 0 || n < 0 || e < 0 ? 0 : e / n * f.pow(r / n, e - 1) * f.exp(-f.pow(r / n, e));
|
|
1113
|
+
},
|
|
1114
|
+
cdf: function(r, n, e) {
|
|
1115
|
+
return r < 0 ? 0 : 1 - f.exp(-f.pow(r / n, e));
|
|
1116
|
+
},
|
|
1117
|
+
inv: function(i, r, n) {
|
|
1118
|
+
return r * f.pow(-f.log(1 - i), 1 / n);
|
|
1119
|
+
},
|
|
1120
|
+
mean: function(i, r) {
|
|
1121
|
+
return i * u.gammafn(1 + 1 / r);
|
|
1122
|
+
},
|
|
1123
|
+
median: function(r, n) {
|
|
1124
|
+
return r * f.pow(f.log(2), 1 / n);
|
|
1125
|
+
},
|
|
1126
|
+
mode: function(r, n) {
|
|
1127
|
+
return n <= 1 ? 0 : r * f.pow((n - 1) / n, 1 / n);
|
|
1128
|
+
},
|
|
1129
|
+
sample: function(r, n) {
|
|
1130
|
+
return r * f.pow(-f.log(u._random_fn()), 1 / n);
|
|
1131
|
+
},
|
|
1132
|
+
variance: function(r, n) {
|
|
1133
|
+
return r * r * u.gammafn(1 + 2 / n) - f.pow(u.weibull.mean(r, n), 2);
|
|
1134
|
+
}
|
|
1135
|
+
}), u.extend(u.uniform, {
|
|
1136
|
+
pdf: function(r, n, e) {
|
|
1137
|
+
return r < n || r > e ? 0 : 1 / (e - n);
|
|
1138
|
+
},
|
|
1139
|
+
cdf: function(r, n, e) {
|
|
1140
|
+
return r < n ? 0 : r < e ? (r - n) / (e - n) : 1;
|
|
1141
|
+
},
|
|
1142
|
+
inv: function(i, r, n) {
|
|
1143
|
+
return r + i * (n - r);
|
|
1144
|
+
},
|
|
1145
|
+
mean: function(r, n) {
|
|
1146
|
+
return 0.5 * (r + n);
|
|
1147
|
+
},
|
|
1148
|
+
median: function(r, n) {
|
|
1149
|
+
return u.mean(r, n);
|
|
1150
|
+
},
|
|
1151
|
+
mode: function() {
|
|
1152
|
+
throw new Error("mode is not yet implemented");
|
|
1153
|
+
},
|
|
1154
|
+
sample: function(r, n) {
|
|
1155
|
+
return r / 2 + n / 2 + (n / 2 - r / 2) * (2 * u._random_fn() - 1);
|
|
1156
|
+
},
|
|
1157
|
+
variance: function(r, n) {
|
|
1158
|
+
return f.pow(n - r, 2) / 12;
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
function q(i, r, n, e) {
|
|
1162
|
+
for (var o = 0, s = 1, l = 1, v = 1, m = 0, a = 0, t; f.abs((l - a) / l) > e; )
|
|
1163
|
+
a = l, t = -(r + m) * (r + n + m) * i / (r + 2 * m) / (r + 2 * m + 1), o = l + t * o, s = v + t * s, m = m + 1, t = m * (n - m) * i / (r + 2 * m - 1) / (r + 2 * m), l = o + t * l, v = s + t * v, o = o / v, s = s / v, l = l / v, v = 1;
|
|
1164
|
+
return l / r;
|
|
1165
|
+
}
|
|
1166
|
+
u.extend(u.binomial, {
|
|
1167
|
+
pdf: function(r, n, e) {
|
|
1168
|
+
return e === 0 || e === 1 ? n * e === r ? 1 : 0 : u.combination(n, r) * f.pow(e, r) * f.pow(1 - e, n - r);
|
|
1169
|
+
},
|
|
1170
|
+
cdf: function(r, n, e) {
|
|
1171
|
+
var o, s = 1e-10;
|
|
1172
|
+
if (r < 0)
|
|
1173
|
+
return 0;
|
|
1174
|
+
if (r >= n)
|
|
1175
|
+
return 1;
|
|
1176
|
+
if (e < 0 || e > 1 || n <= 0)
|
|
1177
|
+
return NaN;
|
|
1178
|
+
r = f.floor(r);
|
|
1179
|
+
var l = e, v = r + 1, m = n - r, a = v + m, t = f.exp(u.gammaln(a) - u.gammaln(m) - u.gammaln(v) + v * f.log(l) + m * f.log(1 - l));
|
|
1180
|
+
return l < (v + 1) / (a + 2) ? o = t * q(l, v, m, s) : o = 1 - t * q(1 - l, m, v, s), f.round((1 - o) * (1 / s)) / (1 / s);
|
|
1181
|
+
}
|
|
1182
|
+
}), u.extend(u.negbin, {
|
|
1183
|
+
pdf: function(r, n, e) {
|
|
1184
|
+
return r !== r >>> 0 ? !1 : r < 0 ? 0 : u.combination(r + n - 1, n - 1) * f.pow(1 - e, r) * f.pow(e, n);
|
|
1185
|
+
},
|
|
1186
|
+
cdf: function(r, n, e) {
|
|
1187
|
+
var o = 0, s = 0;
|
|
1188
|
+
if (r < 0)
|
|
1189
|
+
return 0;
|
|
1190
|
+
for (; s <= r; s++)
|
|
1191
|
+
o += u.negbin.pdf(s, n, e);
|
|
1192
|
+
return o;
|
|
1193
|
+
}
|
|
1194
|
+
}), u.extend(u.hypgeom, {
|
|
1195
|
+
pdf: function(r, n, e, o) {
|
|
1196
|
+
if (r !== r | 0)
|
|
1197
|
+
return !1;
|
|
1198
|
+
if (r < 0 || r < e - (n - o))
|
|
1199
|
+
return 0;
|
|
1200
|
+
if (r > o || r > e)
|
|
1201
|
+
return 0;
|
|
1202
|
+
if (e * 2 > n)
|
|
1203
|
+
return o * 2 > n ? u.hypgeom.pdf(n - e - o + r, n, n - e, n - o) : u.hypgeom.pdf(o - r, n, n - e, o);
|
|
1204
|
+
if (o * 2 > n)
|
|
1205
|
+
return u.hypgeom.pdf(e - r, n, e, n - o);
|
|
1206
|
+
if (e < o)
|
|
1207
|
+
return u.hypgeom.pdf(r, n, o, e);
|
|
1208
|
+
for (var s = 1, l = 0, v = 0; v < r; v++) {
|
|
1209
|
+
for (; s > 1 && l < o; )
|
|
1210
|
+
s *= 1 - e / (n - l), l++;
|
|
1211
|
+
s *= (o - v) * (e - v) / ((v + 1) * (n - e - o + v + 1));
|
|
1212
|
+
}
|
|
1213
|
+
for (; l < o; l++)
|
|
1214
|
+
s *= 1 - e / (n - l);
|
|
1215
|
+
return f.min(1, f.max(0, s));
|
|
1216
|
+
},
|
|
1217
|
+
cdf: function(r, n, e, o) {
|
|
1218
|
+
if (r < 0 || r < e - (n - o))
|
|
1219
|
+
return 0;
|
|
1220
|
+
if (r >= o || r >= e)
|
|
1221
|
+
return 1;
|
|
1222
|
+
if (e * 2 > n)
|
|
1223
|
+
return o * 2 > n ? u.hypgeom.cdf(n - e - o + r, n, n - e, n - o) : 1 - u.hypgeom.cdf(o - r - 1, n, n - e, o);
|
|
1224
|
+
if (o * 2 > n)
|
|
1225
|
+
return 1 - u.hypgeom.cdf(e - r - 1, n, e, n - o);
|
|
1226
|
+
if (e < o)
|
|
1227
|
+
return u.hypgeom.cdf(r, n, o, e);
|
|
1228
|
+
for (var s = 1, l = 1, v = 0, m = 0; m < r; m++) {
|
|
1229
|
+
for (; s > 1 && v < o; ) {
|
|
1230
|
+
var a = 1 - e / (n - v);
|
|
1231
|
+
l *= a, s *= a, v++;
|
|
1232
|
+
}
|
|
1233
|
+
l *= (o - m) * (e - m) / ((m + 1) * (n - e - o + m + 1)), s += l;
|
|
1234
|
+
}
|
|
1235
|
+
for (; v < o; v++)
|
|
1236
|
+
s *= 1 - e / (n - v);
|
|
1237
|
+
return f.min(1, f.max(0, s));
|
|
1238
|
+
}
|
|
1239
|
+
}), u.extend(u.poisson, {
|
|
1240
|
+
pdf: function(r, n) {
|
|
1241
|
+
return n < 0 || r % 1 !== 0 || r < 0 ? 0 : f.pow(n, r) * f.exp(-n) / u.factorial(r);
|
|
1242
|
+
},
|
|
1243
|
+
cdf: function(r, n) {
|
|
1244
|
+
var e = [], o = 0;
|
|
1245
|
+
if (r < 0)
|
|
1246
|
+
return 0;
|
|
1247
|
+
for (; o <= r; o++)
|
|
1248
|
+
e.push(u.poisson.pdf(o, n));
|
|
1249
|
+
return u.sum(e);
|
|
1250
|
+
},
|
|
1251
|
+
mean: function(i) {
|
|
1252
|
+
return i;
|
|
1253
|
+
},
|
|
1254
|
+
variance: function(i) {
|
|
1255
|
+
return i;
|
|
1256
|
+
},
|
|
1257
|
+
sampleSmall: function(r) {
|
|
1258
|
+
var n = 1, e = 0, o = f.exp(-r);
|
|
1259
|
+
do
|
|
1260
|
+
e++, n *= u._random_fn();
|
|
1261
|
+
while (n > o);
|
|
1262
|
+
return e - 1;
|
|
1263
|
+
},
|
|
1264
|
+
sampleLarge: function(r) {
|
|
1265
|
+
var n = r, e, o, s, l, v, m, a, t, c, g;
|
|
1266
|
+
for (l = f.sqrt(n), v = f.log(n), a = 0.931 + 2.53 * l, m = -0.059 + 0.02483 * a, t = 1.1239 + 1.1328 / (a - 3.4), c = 0.9277 - 3.6224 / (a - 2); ; ) {
|
|
1267
|
+
if (o = f.random() - 0.5, s = f.random(), g = 0.5 - f.abs(o), e = f.floor((2 * m / g + a) * o + n + 0.43), g >= 0.07 && s <= c)
|
|
1268
|
+
return e;
|
|
1269
|
+
if (!(e < 0 || g < 0.013 && s > g) && f.log(s) + f.log(t) - f.log(m / (g * g) + a) <= -n + e * v - u.loggam(e + 1))
|
|
1270
|
+
return e;
|
|
1271
|
+
}
|
|
1272
|
+
},
|
|
1273
|
+
sample: function(r) {
|
|
1274
|
+
return r < 10 ? this.sampleSmall(r) : this.sampleLarge(r);
|
|
1275
|
+
}
|
|
1276
|
+
}), u.extend(u.triangular, {
|
|
1277
|
+
pdf: function(r, n, e, o) {
|
|
1278
|
+
return e <= n || o < n || o > e ? NaN : r < n || r > e ? 0 : r < o ? 2 * (r - n) / ((e - n) * (o - n)) : r === o ? 2 / (e - n) : 2 * (e - r) / ((e - n) * (e - o));
|
|
1279
|
+
},
|
|
1280
|
+
cdf: function(r, n, e, o) {
|
|
1281
|
+
return e <= n || o < n || o > e ? NaN : r <= n ? 0 : r >= e ? 1 : r <= o ? f.pow(r - n, 2) / ((e - n) * (o - n)) : 1 - f.pow(e - r, 2) / ((e - n) * (e - o));
|
|
1282
|
+
},
|
|
1283
|
+
inv: function(r, n, e, o) {
|
|
1284
|
+
return e <= n || o < n || o > e ? NaN : r <= (o - n) / (e - n) ? n + (e - n) * f.sqrt(r * ((o - n) / (e - n))) : n + (e - n) * (1 - f.sqrt((1 - r) * (1 - (o - n) / (e - n))));
|
|
1285
|
+
},
|
|
1286
|
+
mean: function(r, n, e) {
|
|
1287
|
+
return (r + n + e) / 3;
|
|
1288
|
+
},
|
|
1289
|
+
median: function(r, n, e) {
|
|
1290
|
+
if (e <= (r + n) / 2)
|
|
1291
|
+
return n - f.sqrt((n - r) * (n - e)) / f.sqrt(2);
|
|
1292
|
+
if (e > (r + n) / 2)
|
|
1293
|
+
return r + f.sqrt((n - r) * (e - r)) / f.sqrt(2);
|
|
1294
|
+
},
|
|
1295
|
+
mode: function(r, n, e) {
|
|
1296
|
+
return e;
|
|
1297
|
+
},
|
|
1298
|
+
sample: function(r, n, e) {
|
|
1299
|
+
var o = u._random_fn();
|
|
1300
|
+
return o < (e - r) / (n - r) ? r + f.sqrt(o * (n - r) * (e - r)) : n - f.sqrt((1 - o) * (n - r) * (n - e));
|
|
1301
|
+
},
|
|
1302
|
+
variance: function(r, n, e) {
|
|
1303
|
+
return (r * r + n * n + e * e - r * n - r * e - n * e) / 18;
|
|
1304
|
+
}
|
|
1305
|
+
}), u.extend(u.arcsine, {
|
|
1306
|
+
pdf: function(r, n, e) {
|
|
1307
|
+
return e <= n ? NaN : r <= n || r >= e ? 0 : 2 / f.PI * f.pow(f.pow(e - n, 2) - f.pow(2 * r - n - e, 2), -0.5);
|
|
1308
|
+
},
|
|
1309
|
+
cdf: function(r, n, e) {
|
|
1310
|
+
return r < n ? 0 : r < e ? 2 / f.PI * f.asin(f.sqrt((r - n) / (e - n))) : 1;
|
|
1311
|
+
},
|
|
1312
|
+
inv: function(i, r, n) {
|
|
1313
|
+
return r + (0.5 - 0.5 * f.cos(f.PI * i)) * (n - r);
|
|
1314
|
+
},
|
|
1315
|
+
mean: function(r, n) {
|
|
1316
|
+
return n <= r ? NaN : (r + n) / 2;
|
|
1317
|
+
},
|
|
1318
|
+
median: function(r, n) {
|
|
1319
|
+
return n <= r ? NaN : (r + n) / 2;
|
|
1320
|
+
},
|
|
1321
|
+
mode: function() {
|
|
1322
|
+
throw new Error("mode is not yet implemented");
|
|
1323
|
+
},
|
|
1324
|
+
sample: function(r, n) {
|
|
1325
|
+
return (r + n) / 2 + (n - r) / 2 * f.sin(2 * f.PI * u.uniform.sample(0, 1));
|
|
1326
|
+
},
|
|
1327
|
+
variance: function(r, n) {
|
|
1328
|
+
return n <= r ? NaN : f.pow(n - r, 2) / 8;
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1331
|
+
function p(i) {
|
|
1332
|
+
return i / f.abs(i);
|
|
1333
|
+
}
|
|
1334
|
+
u.extend(u.laplace, {
|
|
1335
|
+
pdf: function(r, n, e) {
|
|
1336
|
+
return e <= 0 ? 0 : f.exp(-f.abs(r - n) / e) / (2 * e);
|
|
1337
|
+
},
|
|
1338
|
+
cdf: function(r, n, e) {
|
|
1339
|
+
return e <= 0 ? 0 : r < n ? 0.5 * f.exp((r - n) / e) : 1 - 0.5 * f.exp(-(r - n) / e);
|
|
1340
|
+
},
|
|
1341
|
+
mean: function(i) {
|
|
1342
|
+
return i;
|
|
1343
|
+
},
|
|
1344
|
+
median: function(i) {
|
|
1345
|
+
return i;
|
|
1346
|
+
},
|
|
1347
|
+
mode: function(i) {
|
|
1348
|
+
return i;
|
|
1349
|
+
},
|
|
1350
|
+
variance: function(i, r) {
|
|
1351
|
+
return 2 * r * r;
|
|
1352
|
+
},
|
|
1353
|
+
sample: function(r, n) {
|
|
1354
|
+
var e = u._random_fn() - 0.5;
|
|
1355
|
+
return r - n * p(e) * f.log(1 - 2 * f.abs(e));
|
|
1356
|
+
}
|
|
1357
|
+
});
|
|
1358
|
+
function w(i, r, n) {
|
|
1359
|
+
var e = 12, o = 6, s = -30, l = -50, v = 60, m = 8, a = 3, t = 2, c = 3, g = [
|
|
1360
|
+
0.9815606342467192,
|
|
1361
|
+
0.9041172563704749,
|
|
1362
|
+
0.7699026741943047,
|
|
1363
|
+
0.5873179542866175,
|
|
1364
|
+
0.3678314989981802,
|
|
1365
|
+
0.1252334085114689
|
|
1366
|
+
], y = [
|
|
1367
|
+
0.04717533638651183,
|
|
1368
|
+
0.10693932599531843,
|
|
1369
|
+
0.16007832854334622,
|
|
1370
|
+
0.20316742672306592,
|
|
1371
|
+
0.2334925365383548,
|
|
1372
|
+
0.24914704581340277
|
|
1373
|
+
], b = i * 0.5;
|
|
1374
|
+
if (b >= m)
|
|
1375
|
+
return 1;
|
|
1376
|
+
var _ = 2 * u.normal.cdf(b, 0, 1, 1, 0) - 1;
|
|
1377
|
+
_ >= f.exp(l / n) ? _ = f.pow(_, n) : _ = 0;
|
|
1378
|
+
var k;
|
|
1379
|
+
i > a ? k = t : k = c;
|
|
1380
|
+
for (var R = b, z = (m - b) / k, A = R + z, E = 0, I = n - 1, V = 1; V <= k; V++) {
|
|
1381
|
+
for (var U = 0, x = 0.5 * (A + R), N = 0.5 * (A - R), L = 1; L <= e; L++) {
|
|
1382
|
+
var O, T;
|
|
1383
|
+
o < L ? (O = e - L + 1, T = g[O - 1]) : (O = L, T = -g[O - 1]);
|
|
1384
|
+
var G = N * T, P = x + G, Q = P * P;
|
|
1385
|
+
if (Q > v)
|
|
1386
|
+
break;
|
|
1387
|
+
var C = 2 * u.normal.cdf(P, 0, 1, 1, 0), W = 2 * u.normal.cdf(P, i, 1, 1, 0), H = C * 0.5 - W * 0.5;
|
|
1388
|
+
H >= f.exp(s / I) && (H = y[O - 1] * f.exp(-(0.5 * Q)) * f.pow(H, I), U += H);
|
|
1389
|
+
}
|
|
1390
|
+
U *= 2 * N * n / f.sqrt(2 * f.PI), E += U, R = A, A += z;
|
|
1391
|
+
}
|
|
1392
|
+
return _ += E, _ <= f.exp(s / r) ? 0 : (_ = f.pow(_, r), _ >= 1 ? 1 : _);
|
|
1393
|
+
}
|
|
1394
|
+
function d(i, r, n) {
|
|
1395
|
+
var e = 0.322232421088, o = 0.099348462606, s = -1, l = 0.588581570495, v = -0.342242088547, m = 0.531103462366, a = -0.204231210125, t = 0.10353775285, c = -453642210148e-16, g = 0.0038560700634, y = 0.8832, b = 0.2368, _ = 1.214, k = 1.208, R = 1.4142, z = 120, A = 0.5 - 0.5 * i, E = f.sqrt(f.log(1 / (A * A))), I = E + ((((E * c + a) * E + v) * E + s) * E + e) / ((((E * g + t) * E + m) * E + l) * E + o);
|
|
1396
|
+
n < z && (I += (I * I * I + I) / n / 4);
|
|
1397
|
+
var V = y - b * I;
|
|
1398
|
+
return n < z && (V += -_ / n + k * I / n), I * (V * f.log(r - 1) + R);
|
|
1399
|
+
}
|
|
1400
|
+
u.extend(u.tukey, {
|
|
1401
|
+
cdf: function(r, n, e) {
|
|
1402
|
+
var o = 1, s = n, l = 16, v = 8, m = -30, a = 1e-14, t = 100, c = 800, g = 5e3, y = 25e3, b = 1, _ = 0.5, k = 0.25, R = 0.125, z = [
|
|
1403
|
+
0.9894009349916499,
|
|
1404
|
+
0.9445750230732326,
|
|
1405
|
+
0.8656312023878318,
|
|
1406
|
+
0.755404408355003,
|
|
1407
|
+
0.6178762444026438,
|
|
1408
|
+
0.45801677765722737,
|
|
1409
|
+
0.2816035507792589,
|
|
1410
|
+
0.09501250983763744
|
|
1411
|
+
], A = [
|
|
1412
|
+
0.027152459411754096,
|
|
1413
|
+
0.062253523938647894,
|
|
1414
|
+
0.09515851168249279,
|
|
1415
|
+
0.12462897125553388,
|
|
1416
|
+
0.14959598881657674,
|
|
1417
|
+
0.16915651939500254,
|
|
1418
|
+
0.18260341504492358,
|
|
1419
|
+
0.1894506104550685
|
|
1420
|
+
];
|
|
1421
|
+
if (r <= 0)
|
|
1422
|
+
return 0;
|
|
1423
|
+
if (e < 2 || o < 1 || s < 2)
|
|
1424
|
+
return NaN;
|
|
1425
|
+
if (!Number.isFinite(r))
|
|
1426
|
+
return 1;
|
|
1427
|
+
if (e > y)
|
|
1428
|
+
return w(r, o, s);
|
|
1429
|
+
var E = e * 0.5, I = E * f.log(e) - e * f.log(2) - u.gammaln(E), V = E - 1, U = e * 0.25, x;
|
|
1430
|
+
e <= t ? x = b : e <= c ? x = _ : e <= g ? x = k : x = R, I += f.log(x);
|
|
1431
|
+
for (var N = 0, L = 1; L <= 50; L++) {
|
|
1432
|
+
for (var O = 0, T = (2 * L - 1) * x, G = 1; G <= l; G++) {
|
|
1433
|
+
var P, Q;
|
|
1434
|
+
v < G ? (P = G - v - 1, Q = I + V * f.log(T + z[P] * x) - (z[P] * x + T) * U) : (P = G - 1, Q = I + V * f.log(T - z[P] * x) + (z[P] * x - T) * U);
|
|
1435
|
+
var C;
|
|
1436
|
+
if (Q >= m) {
|
|
1437
|
+
v < G ? C = r * f.sqrt((z[P] * x + T) * 0.5) : C = r * f.sqrt((-(z[P] * x) + T) * 0.5);
|
|
1438
|
+
var W = w(C, o, s), H = W * A[P] * f.exp(Q);
|
|
1439
|
+
O += H;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
if (L * x >= 1 && O <= a)
|
|
1443
|
+
break;
|
|
1444
|
+
N += O;
|
|
1445
|
+
}
|
|
1446
|
+
if (O > a)
|
|
1447
|
+
throw new Error("tukey.cdf failed to converge");
|
|
1448
|
+
return N > 1 && (N = 1), N;
|
|
1449
|
+
},
|
|
1450
|
+
inv: function(i, r, n) {
|
|
1451
|
+
var e = 1, o = r, s = 1e-4, l = 50;
|
|
1452
|
+
if (n < 2 || e < 1 || o < 2)
|
|
1453
|
+
return NaN;
|
|
1454
|
+
if (i < 0 || i > 1)
|
|
1455
|
+
return NaN;
|
|
1456
|
+
if (i === 0)
|
|
1457
|
+
return 0;
|
|
1458
|
+
if (i === 1)
|
|
1459
|
+
return 1 / 0;
|
|
1460
|
+
var v = d(i, o, n), m = u.tukey.cdf(v, r, n) - i, a;
|
|
1461
|
+
m > 0 ? a = f.max(0, v - 1) : a = v + 1;
|
|
1462
|
+
for (var t = u.tukey.cdf(a, r, n) - i, c, g = 1; g < l; g++) {
|
|
1463
|
+
c = a - t * (a - v) / (t - m), m = t, v = a, c < 0 && (c = 0, t = -i), t = u.tukey.cdf(c, r, n) - i, a = c;
|
|
1464
|
+
var y = f.abs(a - v);
|
|
1465
|
+
if (y < s)
|
|
1466
|
+
return c;
|
|
1467
|
+
}
|
|
1468
|
+
throw new Error("tukey.inv failed to converge");
|
|
1469
|
+
}
|
|
1470
|
+
});
|
|
1471
|
+
}(h, Math), function(u, f) {
|
|
1472
|
+
var q = Array.prototype.push, p = u.utils.isArray;
|
|
1473
|
+
function w(d) {
|
|
1474
|
+
return p(d) || d instanceof u;
|
|
1475
|
+
}
|
|
1476
|
+
u.extend({
|
|
1477
|
+
// add a vector/matrix to a vector/matrix or scalar
|
|
1478
|
+
add: function(i, r) {
|
|
1479
|
+
return w(r) ? (w(r[0]) || (r = [r]), u.map(i, function(n, e, o) {
|
|
1480
|
+
return n + r[e][o];
|
|
1481
|
+
})) : u.map(i, function(n) {
|
|
1482
|
+
return n + r;
|
|
1483
|
+
});
|
|
1484
|
+
},
|
|
1485
|
+
// subtract a vector or scalar from the vector
|
|
1486
|
+
subtract: function(i, r) {
|
|
1487
|
+
return w(r) ? (w(r[0]) || (r = [r]), u.map(i, function(n, e, o) {
|
|
1488
|
+
return n - r[e][o] || 0;
|
|
1489
|
+
})) : u.map(i, function(n) {
|
|
1490
|
+
return n - r;
|
|
1491
|
+
});
|
|
1492
|
+
},
|
|
1493
|
+
// matrix division
|
|
1494
|
+
divide: function(i, r) {
|
|
1495
|
+
return w(r) ? (w(r[0]) || (r = [r]), u.multiply(i, u.inv(r))) : u.map(i, function(n) {
|
|
1496
|
+
return n / r;
|
|
1497
|
+
});
|
|
1498
|
+
},
|
|
1499
|
+
// matrix multiplication
|
|
1500
|
+
multiply: function(i, r) {
|
|
1501
|
+
var n, e, o, s, l, v, m, a;
|
|
1502
|
+
if (i.length === void 0 && r.length === void 0)
|
|
1503
|
+
return i * r;
|
|
1504
|
+
if (l = i.length, v = i[0].length, m = u.zeros(l, o = w(r) ? r[0].length : v), a = 0, w(r)) {
|
|
1505
|
+
for (; a < o; a++)
|
|
1506
|
+
for (n = 0; n < l; n++) {
|
|
1507
|
+
for (s = 0, e = 0; e < v; e++)
|
|
1508
|
+
s += i[n][e] * r[e][a];
|
|
1509
|
+
m[n][a] = s;
|
|
1510
|
+
}
|
|
1511
|
+
return l === 1 && a === 1 ? m[0][0] : m;
|
|
1512
|
+
}
|
|
1513
|
+
return u.map(i, function(t) {
|
|
1514
|
+
return t * r;
|
|
1515
|
+
});
|
|
1516
|
+
},
|
|
1517
|
+
// outer([1,2,3],[4,5,6])
|
|
1518
|
+
// ===
|
|
1519
|
+
// [[1],[2],[3]] times [[4,5,6]]
|
|
1520
|
+
// ->
|
|
1521
|
+
// [[4,5,6],[8,10,12],[12,15,18]]
|
|
1522
|
+
outer: function(i, r) {
|
|
1523
|
+
return u.multiply(i.map(function(n) {
|
|
1524
|
+
return [n];
|
|
1525
|
+
}), [r]);
|
|
1526
|
+
},
|
|
1527
|
+
// Returns the dot product of two matricies
|
|
1528
|
+
dot: function(i, r) {
|
|
1529
|
+
w(i[0]) || (i = [i]), w(r[0]) || (r = [r]);
|
|
1530
|
+
for (var n = i[0].length === 1 && i.length !== 1 ? u.transpose(i) : i, e = r[0].length === 1 && r.length !== 1 ? u.transpose(r) : r, o = [], s = 0, l = n.length, v = n[0].length, m, a; s < l; s++) {
|
|
1531
|
+
for (o[s] = [], m = 0, a = 0; a < v; a++)
|
|
1532
|
+
m += n[s][a] * e[s][a];
|
|
1533
|
+
o[s] = m;
|
|
1534
|
+
}
|
|
1535
|
+
return o.length === 1 ? o[0] : o;
|
|
1536
|
+
},
|
|
1537
|
+
// raise every element by a scalar
|
|
1538
|
+
pow: function(i, r) {
|
|
1539
|
+
return u.map(i, function(n) {
|
|
1540
|
+
return f.pow(n, r);
|
|
1541
|
+
});
|
|
1542
|
+
},
|
|
1543
|
+
// exponentiate every element
|
|
1544
|
+
exp: function(i) {
|
|
1545
|
+
return u.map(i, function(r) {
|
|
1546
|
+
return f.exp(r);
|
|
1547
|
+
});
|
|
1548
|
+
},
|
|
1549
|
+
// generate the natural log of every element
|
|
1550
|
+
log: function(i) {
|
|
1551
|
+
return u.map(i, function(r) {
|
|
1552
|
+
return f.log(r);
|
|
1553
|
+
});
|
|
1554
|
+
},
|
|
1555
|
+
// generate the absolute values of the vector
|
|
1556
|
+
abs: function(i) {
|
|
1557
|
+
return u.map(i, function(r) {
|
|
1558
|
+
return f.abs(r);
|
|
1559
|
+
});
|
|
1560
|
+
},
|
|
1561
|
+
// computes the p-norm of the vector
|
|
1562
|
+
// In the case that a matrix is passed, uses the first row as the vector
|
|
1563
|
+
norm: function(i, r) {
|
|
1564
|
+
var n = 0, e = 0;
|
|
1565
|
+
for (isNaN(r) && (r = 2), w(i[0]) && (i = i[0]); e < i.length; e++)
|
|
1566
|
+
n += f.pow(f.abs(i[e]), r);
|
|
1567
|
+
return f.pow(n, 1 / r);
|
|
1568
|
+
},
|
|
1569
|
+
// computes the angle between two vectors in rads
|
|
1570
|
+
// In case a matrix is passed, this uses the first row as the vector
|
|
1571
|
+
angle: function(i, r) {
|
|
1572
|
+
return f.acos(u.dot(i, r) / (u.norm(i) * u.norm(r)));
|
|
1573
|
+
},
|
|
1574
|
+
// augment one matrix by another
|
|
1575
|
+
// Note: this function returns a matrix, not a jStat object
|
|
1576
|
+
aug: function(i, r) {
|
|
1577
|
+
var n = [], e;
|
|
1578
|
+
for (e = 0; e < i.length; e++)
|
|
1579
|
+
n.push(i[e].slice());
|
|
1580
|
+
for (e = 0; e < n.length; e++)
|
|
1581
|
+
q.apply(n[e], r[e]);
|
|
1582
|
+
return n;
|
|
1583
|
+
},
|
|
1584
|
+
// The inv() function calculates the inverse of a matrix
|
|
1585
|
+
// Create the inverse by augmenting the matrix by the identity matrix of the
|
|
1586
|
+
// appropriate size, and then use G-J elimination on the augmented matrix.
|
|
1587
|
+
inv: function(i) {
|
|
1588
|
+
for (var r = i.length, n = i[0].length, e = u.identity(r, n), o = u.gauss_jordan(i, e), s = [], l = 0, v; l < r; l++)
|
|
1589
|
+
for (s[l] = [], v = n; v < o[0].length; v++)
|
|
1590
|
+
s[l][v - n] = o[l][v];
|
|
1591
|
+
return s;
|
|
1592
|
+
},
|
|
1593
|
+
// calculate the determinant of a matrix
|
|
1594
|
+
det: function d(i) {
|
|
1595
|
+
if (i.length === 2)
|
|
1596
|
+
return i[0][0] * i[1][1] - i[0][1] * i[1][0];
|
|
1597
|
+
for (var r = 0, n = 0; n < i.length; n++) {
|
|
1598
|
+
for (var e = [], o = 1; o < i.length; o++) {
|
|
1599
|
+
e[o - 1] = [];
|
|
1600
|
+
for (var s = 0; s < i.length; s++)
|
|
1601
|
+
s < n ? e[o - 1][s] = i[o][s] : s > n && (e[o - 1][s - 1] = i[o][s]);
|
|
1602
|
+
}
|
|
1603
|
+
var l = n % 2 ? -1 : 1;
|
|
1604
|
+
r += d(e) * i[0][n] * l;
|
|
1605
|
+
}
|
|
1606
|
+
return r;
|
|
1607
|
+
},
|
|
1608
|
+
gauss_elimination: function(i, r) {
|
|
1609
|
+
var n = 0, e = 0, o = i.length, s = i[0].length, l = 1, v = 0, m = [], a, t, c, g;
|
|
1610
|
+
for (i = u.aug(i, r), a = i[0].length, n = 0; n < o; n++) {
|
|
1611
|
+
for (t = i[n][n], e = n, g = n + 1; g < s; g++)
|
|
1612
|
+
t < f.abs(i[g][n]) && (t = i[g][n], e = g);
|
|
1613
|
+
if (e != n)
|
|
1614
|
+
for (g = 0; g < a; g++)
|
|
1615
|
+
c = i[n][g], i[n][g] = i[e][g], i[e][g] = c;
|
|
1616
|
+
for (e = n + 1; e < o; e++)
|
|
1617
|
+
for (l = i[e][n] / i[n][n], g = n; g < a; g++)
|
|
1618
|
+
i[e][g] = i[e][g] - l * i[n][g];
|
|
1619
|
+
}
|
|
1620
|
+
for (n = o - 1; n >= 0; n--) {
|
|
1621
|
+
for (v = 0, e = n + 1; e <= o - 1; e++)
|
|
1622
|
+
v = v + m[e] * i[n][e];
|
|
1623
|
+
m[n] = (i[n][a - 1] - v) / i[n][n];
|
|
1624
|
+
}
|
|
1625
|
+
return m;
|
|
1626
|
+
},
|
|
1627
|
+
gauss_jordan: function(i, r) {
|
|
1628
|
+
var n = u.aug(i, r), e = n.length, o = n[0].length, s = 0, l, v, m;
|
|
1629
|
+
for (v = 0; v < e; v++) {
|
|
1630
|
+
var a = v;
|
|
1631
|
+
for (m = v + 1; m < e; m++)
|
|
1632
|
+
f.abs(n[m][v]) > f.abs(n[a][v]) && (a = m);
|
|
1633
|
+
var t = n[v];
|
|
1634
|
+
for (n[v] = n[a], n[a] = t, m = v + 1; m < e; m++)
|
|
1635
|
+
for (s = n[m][v] / n[v][v], l = v; l < o; l++)
|
|
1636
|
+
n[m][l] -= n[v][l] * s;
|
|
1637
|
+
}
|
|
1638
|
+
for (v = e - 1; v >= 0; v--) {
|
|
1639
|
+
for (s = n[v][v], m = 0; m < v; m++)
|
|
1640
|
+
for (l = o - 1; l > v - 1; l--)
|
|
1641
|
+
n[m][l] -= n[v][l] * n[m][v] / s;
|
|
1642
|
+
for (n[v][v] /= s, l = e; l < o; l++)
|
|
1643
|
+
n[v][l] /= s;
|
|
1644
|
+
}
|
|
1645
|
+
return n;
|
|
1646
|
+
},
|
|
1647
|
+
// solve equation
|
|
1648
|
+
// Ax=b
|
|
1649
|
+
// A is upper triangular matrix
|
|
1650
|
+
// A=[[1,2,3],[0,4,5],[0,6,7]]
|
|
1651
|
+
// b=[1,2,3]
|
|
1652
|
+
// triaUpSolve(A,b) // -> [2.666,0.1666,1.666]
|
|
1653
|
+
// if you use matrix style
|
|
1654
|
+
// A=[[1,2,3],[0,4,5],[0,6,7]]
|
|
1655
|
+
// b=[[1],[2],[3]]
|
|
1656
|
+
// will return [[2.666],[0.1666],[1.666]]
|
|
1657
|
+
triaUpSolve: function(i, r) {
|
|
1658
|
+
var n = i[0].length, e = u.zeros(1, n)[0], o, s = !1;
|
|
1659
|
+
return r[0].length != null && (r = r.map(function(l) {
|
|
1660
|
+
return l[0];
|
|
1661
|
+
}), s = !0), u.arange(n - 1, -1, -1).forEach(function(l) {
|
|
1662
|
+
o = u.arange(l + 1, n).map(function(v) {
|
|
1663
|
+
return e[v] * i[l][v];
|
|
1664
|
+
}), e[l] = (r[l] - u.sum(o)) / i[l][l];
|
|
1665
|
+
}), s ? e.map(function(l) {
|
|
1666
|
+
return [l];
|
|
1667
|
+
}) : e;
|
|
1668
|
+
},
|
|
1669
|
+
triaLowSolve: function(i, r) {
|
|
1670
|
+
var n = i[0].length, e = u.zeros(1, n)[0], o, s = !1;
|
|
1671
|
+
return r[0].length != null && (r = r.map(function(l) {
|
|
1672
|
+
return l[0];
|
|
1673
|
+
}), s = !0), u.arange(n).forEach(function(l) {
|
|
1674
|
+
o = u.arange(l).map(function(v) {
|
|
1675
|
+
return i[l][v] * e[v];
|
|
1676
|
+
}), e[l] = (r[l] - u.sum(o)) / i[l][l];
|
|
1677
|
+
}), s ? e.map(function(l) {
|
|
1678
|
+
return [l];
|
|
1679
|
+
}) : e;
|
|
1680
|
+
},
|
|
1681
|
+
// A -> [L,U]
|
|
1682
|
+
// A=LU
|
|
1683
|
+
// L is lower triangular matrix
|
|
1684
|
+
// U is upper triangular matrix
|
|
1685
|
+
lu: function(i) {
|
|
1686
|
+
var r = i.length, n = u.identity(r), e = u.zeros(i.length, i[0].length), o;
|
|
1687
|
+
return u.arange(r).forEach(function(s) {
|
|
1688
|
+
e[0][s] = i[0][s];
|
|
1689
|
+
}), u.arange(1, r).forEach(function(s) {
|
|
1690
|
+
u.arange(s).forEach(function(l) {
|
|
1691
|
+
o = u.arange(l).map(function(v) {
|
|
1692
|
+
return n[s][v] * e[v][l];
|
|
1693
|
+
}), n[s][l] = (i[s][l] - u.sum(o)) / e[l][l];
|
|
1694
|
+
}), u.arange(s, r).forEach(function(l) {
|
|
1695
|
+
o = u.arange(s).map(function(v) {
|
|
1696
|
+
return n[s][v] * e[v][l];
|
|
1697
|
+
}), e[s][l] = i[o.length][l] - u.sum(o);
|
|
1698
|
+
});
|
|
1699
|
+
}), [n, e];
|
|
1700
|
+
},
|
|
1701
|
+
// A -> T
|
|
1702
|
+
// A=TT'
|
|
1703
|
+
// T is lower triangular matrix
|
|
1704
|
+
cholesky: function(i) {
|
|
1705
|
+
var r = i.length, n = u.zeros(i.length, i[0].length), e;
|
|
1706
|
+
return u.arange(r).forEach(function(o) {
|
|
1707
|
+
e = u.arange(o).map(function(s) {
|
|
1708
|
+
return f.pow(n[o][s], 2);
|
|
1709
|
+
}), n[o][o] = f.sqrt(i[o][o] - u.sum(e)), u.arange(o + 1, r).forEach(function(s) {
|
|
1710
|
+
e = u.arange(o).map(function(l) {
|
|
1711
|
+
return n[o][l] * n[s][l];
|
|
1712
|
+
}), n[s][o] = (i[o][s] - u.sum(e)) / n[o][o];
|
|
1713
|
+
});
|
|
1714
|
+
}), n;
|
|
1715
|
+
},
|
|
1716
|
+
gauss_jacobi: function(i, r, n, e) {
|
|
1717
|
+
for (var o = 0, s = 0, l = i.length, v = [], m = [], a = [], t, c, g, y; o < l; o++)
|
|
1718
|
+
for (v[o] = [], m[o] = [], a[o] = [], s = 0; s < l; s++)
|
|
1719
|
+
o > s ? (v[o][s] = i[o][s], m[o][s] = a[o][s] = 0) : o < s ? (m[o][s] = i[o][s], v[o][s] = a[o][s] = 0) : (a[o][s] = i[o][s], v[o][s] = m[o][s] = 0);
|
|
1720
|
+
for (g = u.multiply(u.multiply(u.inv(a), u.add(v, m)), -1), c = u.multiply(u.inv(a), r), t = n, y = u.add(u.multiply(g, n), c), o = 2; f.abs(u.norm(u.subtract(y, t))) > e; )
|
|
1721
|
+
t = y, y = u.add(u.multiply(g, t), c), o++;
|
|
1722
|
+
return y;
|
|
1723
|
+
},
|
|
1724
|
+
gauss_seidel: function(i, r, n, e) {
|
|
1725
|
+
for (var o = 0, s = i.length, l = [], v = [], m = [], a, t, c, g, y; o < s; o++)
|
|
1726
|
+
for (l[o] = [], v[o] = [], m[o] = [], a = 0; a < s; a++)
|
|
1727
|
+
o > a ? (l[o][a] = i[o][a], v[o][a] = m[o][a] = 0) : o < a ? (v[o][a] = i[o][a], l[o][a] = m[o][a] = 0) : (m[o][a] = i[o][a], l[o][a] = v[o][a] = 0);
|
|
1728
|
+
for (g = u.multiply(u.multiply(u.inv(u.add(m, l)), v), -1), c = u.multiply(u.inv(u.add(m, l)), r), t = n, y = u.add(u.multiply(g, n), c), o = 2; f.abs(u.norm(u.subtract(y, t))) > e; )
|
|
1729
|
+
t = y, y = u.add(u.multiply(g, t), c), o = o + 1;
|
|
1730
|
+
return y;
|
|
1731
|
+
},
|
|
1732
|
+
SOR: function(i, r, n, e, o) {
|
|
1733
|
+
for (var s = 0, l = i.length, v = [], m = [], a = [], t, c, g, y, b; s < l; s++)
|
|
1734
|
+
for (v[s] = [], m[s] = [], a[s] = [], t = 0; t < l; t++)
|
|
1735
|
+
s > t ? (v[s][t] = i[s][t], m[s][t] = a[s][t] = 0) : s < t ? (m[s][t] = i[s][t], v[s][t] = a[s][t] = 0) : (a[s][t] = i[s][t], v[s][t] = m[s][t] = 0);
|
|
1736
|
+
for (y = u.multiply(
|
|
1737
|
+
u.inv(u.add(a, u.multiply(v, o))),
|
|
1738
|
+
u.subtract(
|
|
1739
|
+
u.multiply(a, 1 - o),
|
|
1740
|
+
u.multiply(m, o)
|
|
1741
|
+
)
|
|
1742
|
+
), g = u.multiply(u.multiply(u.inv(u.add(
|
|
1743
|
+
a,
|
|
1744
|
+
u.multiply(v, o)
|
|
1745
|
+
)), r), o), c = n, b = u.add(u.multiply(y, n), g), s = 2; f.abs(u.norm(u.subtract(b, c))) > e; )
|
|
1746
|
+
c = b, b = u.add(u.multiply(y, c), g), s++;
|
|
1747
|
+
return b;
|
|
1748
|
+
},
|
|
1749
|
+
householder: function(i) {
|
|
1750
|
+
for (var r = i.length, n = i[0].length, e = 0, o = [], s = [], l, v, m, a, t; e < r - 1; e++) {
|
|
1751
|
+
for (l = 0, a = e + 1; a < n; a++)
|
|
1752
|
+
l += i[a][e] * i[a][e];
|
|
1753
|
+
for (t = i[e + 1][e] > 0 ? -1 : 1, l = t * f.sqrt(l), v = f.sqrt((l * l - i[e + 1][e] * l) / 2), o = u.zeros(r, 1), o[e + 1][0] = (i[e + 1][e] - l) / (2 * v), m = e + 2; m < r; m++)
|
|
1754
|
+
o[m][0] = i[m][e] / (2 * v);
|
|
1755
|
+
s = u.subtract(
|
|
1756
|
+
u.identity(r, n),
|
|
1757
|
+
u.multiply(u.multiply(o, u.transpose(o)), 2)
|
|
1758
|
+
), i = u.multiply(s, u.multiply(i, s));
|
|
1759
|
+
}
|
|
1760
|
+
return i;
|
|
1761
|
+
},
|
|
1762
|
+
// A -> [Q,R]
|
|
1763
|
+
// Q is orthogonal matrix
|
|
1764
|
+
// R is upper triangular
|
|
1765
|
+
QR: function() {
|
|
1766
|
+
var d = u.sum, i = u.arange;
|
|
1767
|
+
function r(n) {
|
|
1768
|
+
var e = n.length, o = n[0].length, s = u.zeros(o, o);
|
|
1769
|
+
n = u.copy(n);
|
|
1770
|
+
var l, v, m;
|
|
1771
|
+
for (v = 0; v < o; v++) {
|
|
1772
|
+
for (s[v][v] = f.sqrt(d(i(e).map(function(a) {
|
|
1773
|
+
return n[a][v] * n[a][v];
|
|
1774
|
+
}))), l = 0; l < e; l++)
|
|
1775
|
+
n[l][v] = n[l][v] / s[v][v];
|
|
1776
|
+
for (m = v + 1; m < o; m++)
|
|
1777
|
+
for (s[v][m] = d(i(e).map(function(a) {
|
|
1778
|
+
return n[a][v] * n[a][m];
|
|
1779
|
+
})), l = 0; l < e; l++)
|
|
1780
|
+
n[l][m] = n[l][m] - n[l][v] * s[v][m];
|
|
1781
|
+
}
|
|
1782
|
+
return [n, s];
|
|
1783
|
+
}
|
|
1784
|
+
return r;
|
|
1785
|
+
}(),
|
|
1786
|
+
lstsq: function() {
|
|
1787
|
+
function d(r) {
|
|
1788
|
+
r = u.copy(r);
|
|
1789
|
+
var n = r.length, e = u.identity(n);
|
|
1790
|
+
return u.arange(n - 1, -1, -1).forEach(function(o) {
|
|
1791
|
+
u.sliceAssign(
|
|
1792
|
+
e,
|
|
1793
|
+
{ row: o },
|
|
1794
|
+
u.divide(u.slice(e, { row: o }), r[o][o])
|
|
1795
|
+
), u.sliceAssign(
|
|
1796
|
+
r,
|
|
1797
|
+
{ row: o },
|
|
1798
|
+
u.divide(u.slice(r, { row: o }), r[o][o])
|
|
1799
|
+
), u.arange(o).forEach(function(s) {
|
|
1800
|
+
var l = u.multiply(r[s][o], -1), v = u.slice(r, { row: s }), m = u.multiply(u.slice(r, { row: o }), l);
|
|
1801
|
+
u.sliceAssign(r, { row: s }, u.add(v, m));
|
|
1802
|
+
var a = u.slice(e, { row: s }), t = u.multiply(u.slice(e, { row: o }), l);
|
|
1803
|
+
u.sliceAssign(e, { row: s }, u.add(a, t));
|
|
1804
|
+
});
|
|
1805
|
+
}), e;
|
|
1806
|
+
}
|
|
1807
|
+
function i(r, n) {
|
|
1808
|
+
var e = !1;
|
|
1809
|
+
n[0].length === void 0 && (n = n.map(function(y) {
|
|
1810
|
+
return [y];
|
|
1811
|
+
}), e = !0);
|
|
1812
|
+
var o = u.QR(r), s = o[0], l = o[1], v = r[0].length, m = u.slice(s, { col: { end: v } }), a = u.slice(l, { row: { end: v } }), t = d(a), c = u.transpose(m);
|
|
1813
|
+
c[0].length === void 0 && (c = [c]);
|
|
1814
|
+
var g = u.multiply(u.multiply(t, c), n);
|
|
1815
|
+
return g.length === void 0 && (g = [[g]]), e ? g.map(function(y) {
|
|
1816
|
+
return y[0];
|
|
1817
|
+
}) : g;
|
|
1818
|
+
}
|
|
1819
|
+
return i;
|
|
1820
|
+
}(),
|
|
1821
|
+
jacobi: function(i) {
|
|
1822
|
+
for (var r = 1, n = i.length, e = u.identity(n, n), o = [], s, l, v, m, a, t, c, g; r === 1; ) {
|
|
1823
|
+
for (t = i[0][1], m = 0, a = 1, l = 0; l < n; l++)
|
|
1824
|
+
for (v = 0; v < n; v++)
|
|
1825
|
+
l != v && t < f.abs(i[l][v]) && (t = f.abs(i[l][v]), m = l, a = v);
|
|
1826
|
+
for (i[m][m] === i[a][a] ? c = i[m][a] > 0 ? f.PI / 4 : -f.PI / 4 : c = f.atan(2 * i[m][a] / (i[m][m] - i[a][a])) / 2, g = u.identity(n, n), g[m][m] = f.cos(c), g[m][a] = -f.sin(c), g[a][m] = f.sin(c), g[a][a] = f.cos(c), e = u.multiply(e, g), s = u.multiply(u.multiply(u.inv(g), i), g), i = s, r = 0, l = 1; l < n; l++)
|
|
1827
|
+
for (v = 1; v < n; v++)
|
|
1828
|
+
l != v && f.abs(i[l][v]) > 1e-3 && (r = 1);
|
|
1829
|
+
}
|
|
1830
|
+
for (l = 0; l < n; l++)
|
|
1831
|
+
o.push(i[l][l]);
|
|
1832
|
+
return [e, o];
|
|
1833
|
+
},
|
|
1834
|
+
rungekutta: function(i, r, n, e, o, s) {
|
|
1835
|
+
var l, v, m, a, t;
|
|
1836
|
+
if (s === 2)
|
|
1837
|
+
for (; e <= n; )
|
|
1838
|
+
l = r * i(e, o), v = r * i(e + r, o + l), m = o + (l + v) / 2, o = m, e = e + r;
|
|
1839
|
+
if (s === 4)
|
|
1840
|
+
for (; e <= n; )
|
|
1841
|
+
l = r * i(e, o), v = r * i(e + r / 2, o + l / 2), a = r * i(e + r / 2, o + v / 2), t = r * i(e + r, o + a), m = o + (l + 2 * v + 2 * a + t) / 6, o = m, e = e + r;
|
|
1842
|
+
return o;
|
|
1843
|
+
},
|
|
1844
|
+
romberg: function(i, r, n, e) {
|
|
1845
|
+
for (var o = 0, s = (n - r) / 2, l = [], v = [], m = [], a, t, c, g, y; o < e / 2; ) {
|
|
1846
|
+
for (y = i(r), c = r, g = 0; c <= n; c = c + s, g++)
|
|
1847
|
+
l[g] = c;
|
|
1848
|
+
for (a = l.length, c = 1; c < a - 1; c++)
|
|
1849
|
+
y += (c % 2 !== 0 ? 4 : 2) * i(l[c]);
|
|
1850
|
+
y = s / 3 * (y + i(n)), m[o] = y, s /= 2, o++;
|
|
1851
|
+
}
|
|
1852
|
+
for (t = m.length, a = 1; t !== 1; ) {
|
|
1853
|
+
for (c = 0; c < t - 1; c++)
|
|
1854
|
+
v[c] = (f.pow(4, a) * m[c + 1] - m[c]) / (f.pow(4, a) - 1);
|
|
1855
|
+
t = v.length, m = v, v = [], a++;
|
|
1856
|
+
}
|
|
1857
|
+
return m;
|
|
1858
|
+
},
|
|
1859
|
+
richardson: function(i, r, n, e) {
|
|
1860
|
+
function o(b, _) {
|
|
1861
|
+
for (var k = 0, R = b.length, z; k < R; k++)
|
|
1862
|
+
b[k] === _ && (z = k);
|
|
1863
|
+
return z;
|
|
1864
|
+
}
|
|
1865
|
+
for (var s = f.abs(n - i[o(i, n) + 1]), l = 0, v = [], m = [], a, t, c, g, y; e >= s; )
|
|
1866
|
+
a = o(i, n + e), t = o(i, n), v[l] = (r[a] - 2 * r[t] + r[2 * t - a]) / (e * e), e /= 2, l++;
|
|
1867
|
+
for (g = v.length, c = 1; g != 1; ) {
|
|
1868
|
+
for (y = 0; y < g - 1; y++)
|
|
1869
|
+
m[y] = (f.pow(4, c) * v[y + 1] - v[y]) / (f.pow(4, c) - 1);
|
|
1870
|
+
g = m.length, v = m, m = [], c++;
|
|
1871
|
+
}
|
|
1872
|
+
return v;
|
|
1873
|
+
},
|
|
1874
|
+
simpson: function(i, r, n, e) {
|
|
1875
|
+
for (var o = (n - r) / e, s = i(r), l = [], v = r, m = 0, a = 1, t; v <= n; v = v + o, m++)
|
|
1876
|
+
l[m] = v;
|
|
1877
|
+
for (t = l.length; a < t - 1; a++)
|
|
1878
|
+
s += (a % 2 !== 0 ? 4 : 2) * i(l[a]);
|
|
1879
|
+
return o / 3 * (s + i(n));
|
|
1880
|
+
},
|
|
1881
|
+
hermite: function(i, r, n, e) {
|
|
1882
|
+
for (var o = i.length, s = 0, l = 0, v = [], m = [], a = [], t = [], c; l < o; l++) {
|
|
1883
|
+
for (v[l] = 1, c = 0; c < o; c++)
|
|
1884
|
+
l != c && (v[l] *= (e - i[c]) / (i[l] - i[c]));
|
|
1885
|
+
for (m[l] = 0, c = 0; c < o; c++)
|
|
1886
|
+
l != c && (m[l] += 1 / (i[l] - i[c]));
|
|
1887
|
+
a[l] = (1 - 2 * (e - i[l]) * m[l]) * (v[l] * v[l]), t[l] = (e - i[l]) * (v[l] * v[l]), s += a[l] * r[l] + t[l] * n[l];
|
|
1888
|
+
}
|
|
1889
|
+
return s;
|
|
1890
|
+
},
|
|
1891
|
+
lagrange: function(i, r, n) {
|
|
1892
|
+
for (var e = 0, o = 0, s, l, v = i.length; o < v; o++) {
|
|
1893
|
+
for (l = r[o], s = 0; s < v; s++)
|
|
1894
|
+
o != s && (l *= (n - i[s]) / (i[o] - i[s]));
|
|
1895
|
+
e += l;
|
|
1896
|
+
}
|
|
1897
|
+
return e;
|
|
1898
|
+
},
|
|
1899
|
+
cubic_spline: function(i, r, n) {
|
|
1900
|
+
for (var e = i.length, o = 0, s, l = [], v = [], m = [], a = [], t = [], c = [], g = []; o < e - 1; o++)
|
|
1901
|
+
t[o] = i[o + 1] - i[o];
|
|
1902
|
+
for (m[0] = 0, o = 1; o < e - 1; o++)
|
|
1903
|
+
m[o] = 3 / t[o] * (r[o + 1] - r[o]) - 3 / t[o - 1] * (r[o] - r[o - 1]);
|
|
1904
|
+
for (o = 1; o < e - 1; o++)
|
|
1905
|
+
l[o] = [], v[o] = [], l[o][o - 1] = t[o - 1], l[o][o] = 2 * (t[o - 1] + t[o]), l[o][o + 1] = t[o], v[o][0] = m[o];
|
|
1906
|
+
for (a = u.multiply(u.inv(l), v), s = 0; s < e - 1; s++)
|
|
1907
|
+
c[s] = (r[s + 1] - r[s]) / t[s] - t[s] * (a[s + 1][0] + 2 * a[s][0]) / 3, g[s] = (a[s + 1][0] - a[s][0]) / (3 * t[s]);
|
|
1908
|
+
for (s = 0; s < e && !(i[s] > n); s++)
|
|
1909
|
+
;
|
|
1910
|
+
return s -= 1, r[s] + (n - i[s]) * c[s] + u.sq(n - i[s]) * a[s] + (n - i[s]) * u.sq(n - i[s]) * g[s];
|
|
1911
|
+
},
|
|
1912
|
+
gauss_quadrature: function() {
|
|
1913
|
+
throw new Error("gauss_quadrature not yet implemented");
|
|
1914
|
+
},
|
|
1915
|
+
PCA: function(i) {
|
|
1916
|
+
var r = i.length, n = i[0].length, e = 0, o, s, l = [], v = [], m = [], a = [], t = [], c = [], g = [], y = [], b = [], _ = [];
|
|
1917
|
+
for (e = 0; e < r; e++)
|
|
1918
|
+
l[e] = u.sum(i[e]) / n;
|
|
1919
|
+
for (e = 0; e < n; e++)
|
|
1920
|
+
for (g[e] = [], o = 0; o < r; o++)
|
|
1921
|
+
g[e][o] = i[o][e] - l[o];
|
|
1922
|
+
for (g = u.transpose(g), e = 0; e < r; e++)
|
|
1923
|
+
for (y[e] = [], o = 0; o < r; o++)
|
|
1924
|
+
y[e][o] = u.dot([g[e]], [g[o]]) / (n - 1);
|
|
1925
|
+
for (m = u.jacobi(y), b = m[0], v = m[1], _ = u.transpose(b), e = 0; e < v.length; e++)
|
|
1926
|
+
for (o = e; o < v.length; o++)
|
|
1927
|
+
v[e] < v[o] && (s = v[e], v[e] = v[o], v[o] = s, a = _[e], _[e] = _[o], _[o] = a);
|
|
1928
|
+
for (c = u.transpose(g), e = 0; e < r; e++)
|
|
1929
|
+
for (t[e] = [], o = 0; o < c.length; o++)
|
|
1930
|
+
t[e][o] = u.dot([_[e]], [c[o]]);
|
|
1931
|
+
return [i, v, _, t];
|
|
1932
|
+
}
|
|
1933
|
+
}), function(d) {
|
|
1934
|
+
for (var i = 0; i < d.length; i++)
|
|
1935
|
+
(function(r) {
|
|
1936
|
+
u.fn[r] = function(n, e) {
|
|
1937
|
+
var o = this;
|
|
1938
|
+
return e ? (setTimeout(function() {
|
|
1939
|
+
e.call(o, u.fn[r].call(o, n));
|
|
1940
|
+
}, 15), this) : typeof u[r](this, n) == "number" ? u[r](this, n) : u(u[r](this, n));
|
|
1941
|
+
};
|
|
1942
|
+
})(d[i]);
|
|
1943
|
+
}("add divide multiply subtract dot pow exp log abs norm angle".split(" "));
|
|
1944
|
+
}(h, Math), function(u, f) {
|
|
1945
|
+
var q = [].slice, p = u.utils.isNumber, w = u.utils.isArray;
|
|
1946
|
+
u.extend({
|
|
1947
|
+
// 2 different parameter lists:
|
|
1948
|
+
// (value, mean, sd)
|
|
1949
|
+
// (value, array, flag)
|
|
1950
|
+
zscore: function() {
|
|
1951
|
+
var r = q.call(arguments);
|
|
1952
|
+
return p(r[1]) ? (r[0] - r[1]) / r[2] : (r[0] - u.mean(r[1])) / u.stdev(r[1], r[2]);
|
|
1953
|
+
},
|
|
1954
|
+
// 3 different paramter lists:
|
|
1955
|
+
// (value, mean, sd, sides)
|
|
1956
|
+
// (zscore, sides)
|
|
1957
|
+
// (value, array, sides, flag)
|
|
1958
|
+
ztest: function() {
|
|
1959
|
+
var r = q.call(arguments), n;
|
|
1960
|
+
return w(r[1]) ? (n = u.zscore(r[0], r[1], r[3]), r[2] === 1 ? u.normal.cdf(-f.abs(n), 0, 1) : u.normal.cdf(-f.abs(n), 0, 1) * 2) : r.length > 2 ? (n = u.zscore(r[0], r[1], r[2]), r[3] === 1 ? u.normal.cdf(-f.abs(n), 0, 1) : u.normal.cdf(-f.abs(n), 0, 1) * 2) : (n = r[0], r[1] === 1 ? u.normal.cdf(-f.abs(n), 0, 1) : u.normal.cdf(-f.abs(n), 0, 1) * 2);
|
|
1961
|
+
}
|
|
1962
|
+
}), u.extend(u.fn, {
|
|
1963
|
+
zscore: function(r, n) {
|
|
1964
|
+
return (r - this.mean()) / this.stdev(n);
|
|
1965
|
+
},
|
|
1966
|
+
ztest: function(r, n, e) {
|
|
1967
|
+
var o = f.abs(this.zscore(r, e));
|
|
1968
|
+
return n === 1 ? u.normal.cdf(-o, 0, 1) : u.normal.cdf(-o, 0, 1) * 2;
|
|
1969
|
+
}
|
|
1970
|
+
}), u.extend({
|
|
1971
|
+
// 2 parameter lists
|
|
1972
|
+
// (value, mean, sd, n)
|
|
1973
|
+
// (value, array)
|
|
1974
|
+
tscore: function() {
|
|
1975
|
+
var r = q.call(arguments);
|
|
1976
|
+
return r.length === 4 ? (r[0] - r[1]) / (r[2] / f.sqrt(r[3])) : (r[0] - u.mean(r[1])) / (u.stdev(r[1], !0) / f.sqrt(r[1].length));
|
|
1977
|
+
},
|
|
1978
|
+
// 3 different paramter lists:
|
|
1979
|
+
// (value, mean, sd, n, sides)
|
|
1980
|
+
// (tscore, n, sides)
|
|
1981
|
+
// (value, array, sides)
|
|
1982
|
+
ttest: function() {
|
|
1983
|
+
var r = q.call(arguments), n;
|
|
1984
|
+
return r.length === 5 ? (n = f.abs(u.tscore(r[0], r[1], r[2], r[3])), r[4] === 1 ? u.studentt.cdf(-n, r[3] - 1) : u.studentt.cdf(-n, r[3] - 1) * 2) : p(r[1]) ? (n = f.abs(r[0]), r[2] == 1 ? u.studentt.cdf(-n, r[1] - 1) : u.studentt.cdf(-n, r[1] - 1) * 2) : (n = f.abs(u.tscore(r[0], r[1])), r[2] == 1 ? u.studentt.cdf(-n, r[1].length - 1) : u.studentt.cdf(-n, r[1].length - 1) * 2);
|
|
1985
|
+
}
|
|
1986
|
+
}), u.extend(u.fn, {
|
|
1987
|
+
tscore: function(r) {
|
|
1988
|
+
return (r - this.mean()) / (this.stdev(!0) / f.sqrt(this.cols()));
|
|
1989
|
+
},
|
|
1990
|
+
ttest: function(r, n) {
|
|
1991
|
+
return n === 1 ? 1 - u.studentt.cdf(f.abs(this.tscore(r)), this.cols() - 1) : u.studentt.cdf(-f.abs(this.tscore(r)), this.cols() - 1) * 2;
|
|
1992
|
+
}
|
|
1993
|
+
}), u.extend({
|
|
1994
|
+
// Paramter list is as follows:
|
|
1995
|
+
// (array1, array2, array3, ...)
|
|
1996
|
+
// or it is an array of arrays
|
|
1997
|
+
// array of arrays conversion
|
|
1998
|
+
anovafscore: function() {
|
|
1999
|
+
var r = q.call(arguments), n, e, o, s, l, v, m, a;
|
|
2000
|
+
if (r.length === 1) {
|
|
2001
|
+
for (l = new Array(r[0].length), m = 0; m < r[0].length; m++)
|
|
2002
|
+
l[m] = r[0][m];
|
|
2003
|
+
r = l;
|
|
2004
|
+
}
|
|
2005
|
+
for (e = new Array(), m = 0; m < r.length; m++)
|
|
2006
|
+
e = e.concat(r[m]);
|
|
2007
|
+
for (o = u.mean(e), n = 0, m = 0; m < r.length; m++)
|
|
2008
|
+
n = n + r[m].length * f.pow(u.mean(r[m]) - o, 2);
|
|
2009
|
+
for (n /= r.length - 1, v = 0, m = 0; m < r.length; m++)
|
|
2010
|
+
for (s = u.mean(r[m]), a = 0; a < r[m].length; a++)
|
|
2011
|
+
v += f.pow(r[m][a] - s, 2);
|
|
2012
|
+
return v /= e.length - r.length, n / v;
|
|
2013
|
+
},
|
|
2014
|
+
// 2 different paramter setups
|
|
2015
|
+
// (array1, array2, array3, ...)
|
|
2016
|
+
// (anovafscore, df1, df2)
|
|
2017
|
+
anovaftest: function() {
|
|
2018
|
+
var r = q.call(arguments), n, e, o, s;
|
|
2019
|
+
if (p(r[0]))
|
|
2020
|
+
return 1 - u.centralF.cdf(r[0], r[1], r[2]);
|
|
2021
|
+
var l = u.anovafscore(r);
|
|
2022
|
+
for (n = r.length - 1, o = 0, s = 0; s < r.length; s++)
|
|
2023
|
+
o = o + r[s].length;
|
|
2024
|
+
return e = o - n - 1, 1 - u.centralF.cdf(l, n, e);
|
|
2025
|
+
},
|
|
2026
|
+
ftest: function(r, n, e) {
|
|
2027
|
+
return 1 - u.centralF.cdf(r, n, e);
|
|
2028
|
+
}
|
|
2029
|
+
}), u.extend(u.fn, {
|
|
2030
|
+
anovafscore: function() {
|
|
2031
|
+
return u.anovafscore(this.toArray());
|
|
2032
|
+
},
|
|
2033
|
+
anovaftes: function() {
|
|
2034
|
+
var r = 0, n;
|
|
2035
|
+
for (n = 0; n < this.length; n++)
|
|
2036
|
+
r = r + this[n].length;
|
|
2037
|
+
return u.ftest(this.anovafscore(), this.length - 1, r - this.length);
|
|
2038
|
+
}
|
|
2039
|
+
}), u.extend({
|
|
2040
|
+
// 2 parameter lists
|
|
2041
|
+
// (mean1, mean2, n1, n2, sd)
|
|
2042
|
+
// (array1, array2, sd)
|
|
2043
|
+
qscore: function() {
|
|
2044
|
+
var r = q.call(arguments), n, e, o, s, l;
|
|
2045
|
+
return p(r[0]) ? (n = r[0], e = r[1], o = r[2], s = r[3], l = r[4]) : (n = u.mean(r[0]), e = u.mean(r[1]), o = r[0].length, s = r[1].length, l = r[2]), f.abs(n - e) / (l * f.sqrt((1 / o + 1 / s) / 2));
|
|
2046
|
+
},
|
|
2047
|
+
// 3 different parameter lists:
|
|
2048
|
+
// (qscore, n, k)
|
|
2049
|
+
// (mean1, mean2, n1, n2, sd, n, k)
|
|
2050
|
+
// (array1, array2, sd, n, k)
|
|
2051
|
+
qtest: function() {
|
|
2052
|
+
var r = q.call(arguments), n;
|
|
2053
|
+
r.length === 3 ? (n = r[0], r = r.slice(1)) : r.length === 7 ? (n = u.qscore(r[0], r[1], r[2], r[3], r[4]), r = r.slice(5)) : (n = u.qscore(r[0], r[1], r[2]), r = r.slice(3));
|
|
2054
|
+
var e = r[0], o = r[1];
|
|
2055
|
+
return 1 - u.tukey.cdf(n, o, e - o);
|
|
2056
|
+
},
|
|
2057
|
+
tukeyhsd: function(r) {
|
|
2058
|
+
for (var n = u.pooledstdev(r), e = r.map(function(a) {
|
|
2059
|
+
return u.mean(a);
|
|
2060
|
+
}), o = r.reduce(function(a, t) {
|
|
2061
|
+
return a + t.length;
|
|
2062
|
+
}, 0), s = [], l = 0; l < r.length; ++l)
|
|
2063
|
+
for (var v = l + 1; v < r.length; ++v) {
|
|
2064
|
+
var m = u.qtest(e[l], e[v], r[l].length, r[v].length, n, o, r.length);
|
|
2065
|
+
s.push([[l, v], m]);
|
|
2066
|
+
}
|
|
2067
|
+
return s;
|
|
2068
|
+
}
|
|
2069
|
+
}), u.extend({
|
|
2070
|
+
// 2 different parameter setups
|
|
2071
|
+
// (value, alpha, sd, n)
|
|
2072
|
+
// (value, alpha, array)
|
|
2073
|
+
normalci: function() {
|
|
2074
|
+
var r = q.call(arguments), n = new Array(2), e;
|
|
2075
|
+
return r.length === 4 ? e = f.abs(u.normal.inv(r[1] / 2, 0, 1) * r[2] / f.sqrt(r[3])) : e = f.abs(u.normal.inv(r[1] / 2, 0, 1) * u.stdev(r[2]) / f.sqrt(r[2].length)), n[0] = r[0] - e, n[1] = r[0] + e, n;
|
|
2076
|
+
},
|
|
2077
|
+
// 2 different parameter setups
|
|
2078
|
+
// (value, alpha, sd, n)
|
|
2079
|
+
// (value, alpha, array)
|
|
2080
|
+
tci: function() {
|
|
2081
|
+
var r = q.call(arguments), n = new Array(2), e;
|
|
2082
|
+
return r.length === 4 ? e = f.abs(u.studentt.inv(r[1] / 2, r[3] - 1) * r[2] / f.sqrt(r[3])) : e = f.abs(u.studentt.inv(r[1] / 2, r[2].length - 1) * u.stdev(r[2], !0) / f.sqrt(r[2].length)), n[0] = r[0] - e, n[1] = r[0] + e, n;
|
|
2083
|
+
},
|
|
2084
|
+
significant: function(r, n) {
|
|
2085
|
+
return r < n;
|
|
2086
|
+
}
|
|
2087
|
+
}), u.extend(u.fn, {
|
|
2088
|
+
normalci: function(r, n) {
|
|
2089
|
+
return u.normalci(r, n, this.toArray());
|
|
2090
|
+
},
|
|
2091
|
+
tci: function(r, n) {
|
|
2092
|
+
return u.tci(r, n, this.toArray());
|
|
2093
|
+
}
|
|
2094
|
+
});
|
|
2095
|
+
function d(i, r, n, e) {
|
|
2096
|
+
if (i > 1 || n > 1 || i <= 0 || n <= 0)
|
|
2097
|
+
throw new Error("Proportions should be greater than 0 and less than 1");
|
|
2098
|
+
var o = (i * r + n * e) / (r + e), s = f.sqrt(o * (1 - o) * (1 / r + 1 / e));
|
|
2099
|
+
return (i - n) / s;
|
|
2100
|
+
}
|
|
2101
|
+
u.extend(u.fn, {
|
|
2102
|
+
oneSidedDifferenceOfProportions: function(r, n, e, o) {
|
|
2103
|
+
var s = d(r, n, e, o);
|
|
2104
|
+
return u.ztest(s, 1);
|
|
2105
|
+
},
|
|
2106
|
+
twoSidedDifferenceOfProportions: function(r, n, e, o) {
|
|
2107
|
+
var s = d(r, n, e, o);
|
|
2108
|
+
return u.ztest(s, 2);
|
|
2109
|
+
}
|
|
2110
|
+
});
|
|
2111
|
+
}(h, Math), h.models = function() {
|
|
2112
|
+
function u(d) {
|
|
2113
|
+
var i = d[0].length, r = h.arange(i).map(function(n) {
|
|
2114
|
+
var e = h.arange(i).filter(function(o) {
|
|
2115
|
+
return o !== n;
|
|
2116
|
+
});
|
|
2117
|
+
return f(
|
|
2118
|
+
h.col(d, n).map(function(o) {
|
|
2119
|
+
return o[0];
|
|
2120
|
+
}),
|
|
2121
|
+
h.col(d, e)
|
|
2122
|
+
);
|
|
2123
|
+
});
|
|
2124
|
+
return r;
|
|
2125
|
+
}
|
|
2126
|
+
function f(d, i) {
|
|
2127
|
+
var r = d.length, n = i[0].length - 1, e = r - n - 1, o = h.lstsq(i, d), s = h.multiply(i, o.map(function(g) {
|
|
2128
|
+
return [g];
|
|
2129
|
+
})).map(function(g) {
|
|
2130
|
+
return g[0];
|
|
2131
|
+
}), l = h.subtract(d, s), v = h.mean(d), m = h.sum(s.map(function(g) {
|
|
2132
|
+
return Math.pow(g - v, 2);
|
|
2133
|
+
})), a = h.sum(d.map(function(g, y) {
|
|
2134
|
+
return Math.pow(g - s[y], 2);
|
|
2135
|
+
})), t = m + a, c = m / t;
|
|
2136
|
+
return {
|
|
2137
|
+
exog: i,
|
|
2138
|
+
endog: d,
|
|
2139
|
+
nobs: r,
|
|
2140
|
+
df_model: n,
|
|
2141
|
+
df_resid: e,
|
|
2142
|
+
coef: o,
|
|
2143
|
+
predict: s,
|
|
2144
|
+
resid: l,
|
|
2145
|
+
ybar: v,
|
|
2146
|
+
SST: t,
|
|
2147
|
+
SSE: m,
|
|
2148
|
+
SSR: a,
|
|
2149
|
+
R2: c
|
|
2150
|
+
};
|
|
2151
|
+
}
|
|
2152
|
+
function q(d) {
|
|
2153
|
+
var i = u(d.exog), r = Math.sqrt(d.SSR / d.df_resid), n = i.map(function(v) {
|
|
2154
|
+
var m = v.SST, a = v.R2;
|
|
2155
|
+
return r / Math.sqrt(m * (1 - a));
|
|
2156
|
+
}), e = d.coef.map(function(v, m) {
|
|
2157
|
+
return (v - 0) / n[m];
|
|
2158
|
+
}), o = e.map(function(v) {
|
|
2159
|
+
var m = h.studentt.cdf(v, d.df_resid);
|
|
2160
|
+
return (m > 0.5 ? 1 - m : m) * 2;
|
|
2161
|
+
}), s = h.studentt.inv(0.975, d.df_resid), l = d.coef.map(function(v, m) {
|
|
2162
|
+
var a = s * n[m];
|
|
2163
|
+
return [v - a, v + a];
|
|
2164
|
+
});
|
|
2165
|
+
return {
|
|
2166
|
+
se: n,
|
|
2167
|
+
t: e,
|
|
2168
|
+
p: o,
|
|
2169
|
+
sigmaHat: r,
|
|
2170
|
+
interval95: l
|
|
2171
|
+
};
|
|
2172
|
+
}
|
|
2173
|
+
function p(d) {
|
|
2174
|
+
var i = d.R2 / d.df_model / ((1 - d.R2) / d.df_resid), r = function(e, o, s) {
|
|
2175
|
+
return h.beta.cdf(e / (s / o + e), o / 2, s / 2);
|
|
2176
|
+
}, n = 1 - r(i, d.df_model, d.df_resid);
|
|
2177
|
+
return { F_statistic: i, pvalue: n };
|
|
2178
|
+
}
|
|
2179
|
+
function w(d, i) {
|
|
2180
|
+
var r = f(d, i), n = q(r), e = p(r), o = 1 - (1 - r.R2) * ((r.nobs - 1) / r.df_resid);
|
|
2181
|
+
return r.t = n, r.f = e, r.adjust_R2 = o, r;
|
|
2182
|
+
}
|
|
2183
|
+
return { ols: w };
|
|
2184
|
+
}(), h.extend({
|
|
2185
|
+
buildxmatrix: function() {
|
|
2186
|
+
for (var f = new Array(arguments.length), q = 0; q < arguments.length; q++) {
|
|
2187
|
+
var p = [1];
|
|
2188
|
+
f[q] = p.concat(arguments[q]);
|
|
2189
|
+
}
|
|
2190
|
+
return h(f);
|
|
2191
|
+
},
|
|
2192
|
+
builddxmatrix: function() {
|
|
2193
|
+
for (var f = new Array(arguments[0].length), q = 0; q < arguments[0].length; q++) {
|
|
2194
|
+
var p = [1];
|
|
2195
|
+
f[q] = p.concat(arguments[0][q]);
|
|
2196
|
+
}
|
|
2197
|
+
return h(f);
|
|
2198
|
+
},
|
|
2199
|
+
buildjxmatrix: function(f) {
|
|
2200
|
+
for (var q = new Array(f.length), p = 0; p < f.length; p++)
|
|
2201
|
+
q[p] = f[p];
|
|
2202
|
+
return h.builddxmatrix(q);
|
|
2203
|
+
},
|
|
2204
|
+
buildymatrix: function(f) {
|
|
2205
|
+
return h(f).transpose();
|
|
2206
|
+
},
|
|
2207
|
+
buildjymatrix: function(f) {
|
|
2208
|
+
return f.transpose();
|
|
2209
|
+
},
|
|
2210
|
+
matrixmult: function(f, q) {
|
|
2211
|
+
var p, w, d, i, r;
|
|
2212
|
+
if (f.cols() == q.rows()) {
|
|
2213
|
+
if (q.rows() > 1) {
|
|
2214
|
+
for (i = [], p = 0; p < f.rows(); p++)
|
|
2215
|
+
for (i[p] = [], w = 0; w < q.cols(); w++) {
|
|
2216
|
+
for (r = 0, d = 0; d < f.cols(); d++)
|
|
2217
|
+
r += f.toArray()[p][d] * q.toArray()[d][w];
|
|
2218
|
+
i[p][w] = r;
|
|
2219
|
+
}
|
|
2220
|
+
return h(i);
|
|
2221
|
+
}
|
|
2222
|
+
for (i = [], p = 0; p < f.rows(); p++)
|
|
2223
|
+
for (i[p] = [], w = 0; w < q.cols(); w++) {
|
|
2224
|
+
for (r = 0, d = 0; d < f.cols(); d++)
|
|
2225
|
+
r += f.toArray()[p][d] * q.toArray()[w];
|
|
2226
|
+
i[p][w] = r;
|
|
2227
|
+
}
|
|
2228
|
+
return h(i);
|
|
2229
|
+
}
|
|
2230
|
+
},
|
|
2231
|
+
//regress and regresst to be fixed
|
|
2232
|
+
regress: function(f, q) {
|
|
2233
|
+
var p = h.xtranspxinv(f), w = f.transpose(), d = h.matrixmult(h(p), w);
|
|
2234
|
+
return h.matrixmult(d, q);
|
|
2235
|
+
},
|
|
2236
|
+
regresst: function(f, q, p) {
|
|
2237
|
+
var w = h.regress(f, q), d = {};
|
|
2238
|
+
d.anova = {};
|
|
2239
|
+
var i = h.jMatYBar(f, w);
|
|
2240
|
+
d.yBar = i;
|
|
2241
|
+
var r = q.mean();
|
|
2242
|
+
d.anova.residuals = h.residuals(q, i), d.anova.ssr = h.ssr(i, r), d.anova.msr = d.anova.ssr / (f[0].length - 1), d.anova.sse = h.sse(q, i), d.anova.mse = d.anova.sse / (q.length - (f[0].length - 1) - 1), d.anova.sst = h.sst(q, r), d.anova.mst = d.anova.sst / (q.length - 1), d.anova.r2 = 1 - d.anova.sse / d.anova.sst, d.anova.r2 < 0 && (d.anova.r2 = 0), d.anova.fratio = d.anova.msr / d.anova.mse, d.anova.pvalue = h.anovaftest(
|
|
2243
|
+
d.anova.fratio,
|
|
2244
|
+
f[0].length - 1,
|
|
2245
|
+
q.length - (f[0].length - 1) - 1
|
|
2246
|
+
), d.anova.rmse = Math.sqrt(d.anova.mse), d.anova.r2adj = 1 - d.anova.mse / d.anova.mst, d.anova.r2adj < 0 && (d.anova.r2adj = 0), d.stats = new Array(f[0].length);
|
|
2247
|
+
for (var n = h.xtranspxinv(f), e, o, s, l = 0; l < w.length; l++)
|
|
2248
|
+
e = Math.sqrt(d.anova.mse * Math.abs(n[l][l])), o = Math.abs(w[l] / e), s = h.ttest(o, q.length - f[0].length - 1, p), d.stats[l] = [w[l], e, o, s];
|
|
2249
|
+
return d.regress = w, d;
|
|
2250
|
+
},
|
|
2251
|
+
xtranspx: function(f) {
|
|
2252
|
+
return h.matrixmult(f.transpose(), f);
|
|
2253
|
+
},
|
|
2254
|
+
xtranspxinv: function(f) {
|
|
2255
|
+
var q = h.matrixmult(f.transpose(), f), p = h.inv(q);
|
|
2256
|
+
return p;
|
|
2257
|
+
},
|
|
2258
|
+
jMatYBar: function(f, q) {
|
|
2259
|
+
var p = h.matrixmult(f, q);
|
|
2260
|
+
return new h(p);
|
|
2261
|
+
},
|
|
2262
|
+
residuals: function(f, q) {
|
|
2263
|
+
return h.matrixsubtract(f, q);
|
|
2264
|
+
},
|
|
2265
|
+
ssr: function(f, q) {
|
|
2266
|
+
for (var p = 0, w = 0; w < f.length; w++)
|
|
2267
|
+
p += Math.pow(f[w] - q, 2);
|
|
2268
|
+
return p;
|
|
2269
|
+
},
|
|
2270
|
+
sse: function(f, q) {
|
|
2271
|
+
for (var p = 0, w = 0; w < f.length; w++)
|
|
2272
|
+
p += Math.pow(f[w] - q[w], 2);
|
|
2273
|
+
return p;
|
|
2274
|
+
},
|
|
2275
|
+
sst: function(f, q) {
|
|
2276
|
+
for (var p = 0, w = 0; w < f.length; w++)
|
|
2277
|
+
p += Math.pow(f[w] - q, 2);
|
|
2278
|
+
return p;
|
|
2279
|
+
},
|
|
2280
|
+
matrixsubtract: function(f, q) {
|
|
2281
|
+
for (var p = new Array(f.length), w = 0; w < f.length; w++) {
|
|
2282
|
+
p[w] = new Array(f[w].length);
|
|
2283
|
+
for (var d = 0; d < f[w].length; d++)
|
|
2284
|
+
p[w][d] = f[w][d] - q[w][d];
|
|
2285
|
+
}
|
|
2286
|
+
return h(p);
|
|
2287
|
+
}
|
|
2288
|
+
}), h.jStat = h, h;
|
|
2289
|
+
});
|
|
2290
|
+
})(Z);
|
|
2291
|
+
var B = Z.exports;
|
|
2292
|
+
const X = /* @__PURE__ */ K(B);
|
|
2293
|
+
export {
|
|
2294
|
+
X as default
|
|
2295
|
+
};
|